#enfusion_scripting
1 messages · Page 17 of 1
Guys, I need help, do you know how to make increased bleeding when hit, for example, so that the blood flows faster than usual or deducts the blood from the blood by 30%
?
There is a health setting component you can tweak in your game mode prefab.
Just click on it, tweak the settings and you're good to go.
This is going to be an extra dumb question, but when I turn on logging in the diag menu (as an example "Log inventory changes") where does that log go?
Huh, it doesn't work like that
I tried different settings, but none of them helped me so that the bullet would take away the blood when it hit
I would imagine you would want to look in these files to see what they do and how they function together:
Well those are two complete different things. From what i understood in your message you wanted to increase the bleeding rate by 30%.
If you want to make it so that getting shot removes some blood then get to scripting 🤷♂️
In the log console most likely(bottom of your screen by default)
nothing was showing there, but I guess I don't know what to expect the log inventory changes diag menu option to do. I did find the log file though, so I am going to comb through it
I haven't messed with those diag for the inventory so i can't tell you for sure.
Make sure the blue "i" is ticked (loglevel normal)
Well, I asked a question to understand which scripts I need to connect to the ball so that it takes away blood
I tried to put it on display because of this, but it turned out that it doesn't work that way.
I haven't ever done a dive into damage systems yet, but there is the dayz reforged mod that handles bleeding pretty well if you want to get some ideas
They have a little hud icon that shows how much blood you lost and what not
Hello, I'm trying to write a script that spawns AI patrols following a set of waypoints for mission making convenience. I've got it fully functional so the AI spawn and follow the route, but I can't find the information on how to correctly apply settings to these waypoints for a column formation and walk speed. Can anyone help me out? Thanks.
The waypoints are also dynamically generated.
A funny question: has anyone even tried to change the radio station range? I've even written custom scripts and configs, but the engine just doesn't care – it just uses its 2000 meter range no matter what. The script's description, "Don't change anything, it's automatically generated," is especially amusing. LOL – so why are the parameters editable if they don't affect anything?
Please correct me, I might be missing something, as I'm not a programmer. I have a prefab composition for a radio antenna for conflict mode, as an example. My problem is that I want to change the radius of connections between points, thereby affecting their capture order. This can be done through the base radio component, but I think it's more optional to do it through the radio component of the radio station.
The crux of the problem is that no matter how I copy the prefab, I create an e_ prefab from it (which, in theory, won't help at all). The main problem is that I can't isolate the prefab/composition from the logic of base classes such as the base radio component and base transceiver.
Any of my prefabs will still reference these classes. In this case, the screenshot shows the e_ prefab I created using the plugin from a copied vanilla prefab.
The arrows show the inheritance of the mother components and classes. The trick is that I can enter the desired distance (1350) meters into each one, and it will even work until I restart the tool. However, after that, the default mother components will be rewritten by the engine/script to the standard 2000 meters.
Neither scripts nor any other settings help. The script's API is severely limited, and no matter what I do, everything resets to vanilla (even scripts with frame interception don't help).
Am I correct in assuming this is some kind of bug or oversight? Perhaps my use of the RHS Status mod somehow interferes with this issue? (But I doubt it; on empty maps without third-party mods, everything worked just fine with the vanilla rewrite.)
Perhaps I should contact support about this, or is everyone generally aware that this module doesn't allow changing these settings due to a limited API? Perhaps this functionality will be available in the future?
Currently, there's simply no way to influence connections between points (only within 2 km).
To summarize, am I correct in understanding that until there's an API that provides access to changing the radius functionality in the radio component or receiver component, essentially all changes are meaningless, since any of my settings will be overwritten by the parent one?
Have you made a new component that references the base component?
for example class NewRadioComponentClass : BaseRadioComponenetClass
create your-own waypoint prefab (you can inherit it from some other wp), and in Waypoint's attributes in Settings attribute add Formation setting
Yeap, alredy trying it from diff base and other subclass & transrec - non result
Btw all issues will be non-result if im right about the basic script re-writte any inh-class cuz duplicate and other typological path is take a inh frome base and try to change they selfs, but if base is core - nothing help
Is there a component that allows decals to be added to a object, instead of having a decal.et prefab as a childe ? https://i.imgur.com/4mxfB9m.jpeg
The list of entity in screen - is UI seens of inh-classes, do it like i try in screept path - that just do mirrored inh-classes (with any changes) & will be non result
U want to do pref crater for like chiled from what other pref?
If yes - just drag&drop entity to wanted parent entity
If u want to do a pattern-prefab - need to do local and better check video in youtube about pref creation - will see a basick algo
Ive added the decal.et to the prefab(So crater_object.et >Decal.et as child) the left in the imag. But it dosnt work that well when im spawning it, the prefab child seems to have issue loading at times when im doing a spawn function for it. So i would like to test to see if there is a component i can connect it to directly instead.
Im was try to search some info about it there, but allways its just question without answer - like wear part whan 1 time is work, but aftre re-up tool or other re-build - its stay on vanilla settings
Sound interest - i have a small exp in calss-list, but think that 2 comp will can help u - but, they are using in e_prefabs and issuise of they using can be more than profitable - what result u want of ur idea, maybe some easy path will help u if u say the aim
Ah, I think I get it - you want the crater to immediately have a sticker like from an explosion - check out videos on YouTube on how to assemble prefabs from other prefabs, there are a couple of good videos - you'll quickly understand what's going on and how to do it better
the issue im having is that on the first spawn of the crater here it dosnt have the Decal(child) attached to it. But the others ones after the first spawn does. Its like it has to load it or something 🤣
Seems like bug with polyline & walls (whan must push "is closed" to normal work) - try to do prefab (crat&decal) and will see how it will work
Try adding a BasePreloadManager to your world with your decal added as a PreloadEntry.
Is there any way to allocate static arrays from dynamic arrays?
Like
array<vector> m_aPoints = {etc..};
vector points[] = m_aPoints;
why you need this?
CreateLines only takes a static array
Right now I just have one allocated to 500, it's not that big of a deal just would be cleaner if there was a way to scale static arrays in a method when they are created
Looks like no other way https://enfusionengine.com/api/redirect?to=enfusion://ScriptEditor/scripts/GameLib/entities/autotest/MotionComponent.c;218 (same on experimental)
¯_(ツ)_/¯
It's not too big of a deal
Even with 1000 bullets the memory allocation for that is like ~6mbs or so if I did my math right
So is base game persistence going to break epf/edf?
No
is there a persistent setting like arma 3 server ? i keep having problem with GM mode that i build bunch of scenery, left server and everything lost.
oh and the save and load function crash every time
This is a good example why I made a workshop suggestion to see what's being called: https://feedback.bistudio.com/T194980
I *think * 1.6 has something like this. See #enfusion_scripting message
GM mode and Eden editor don't work the same way.
To have persistence in game master you need to use a GameMode_Editor scenario
- OnPlayerConnected
- OnPlayerAuditSuccess
- OnPlayerRegistered
Is this correct order of those methods?
Pretty sure, just look at console log I think it shows all three when someone connects
Can anyone DM me? I need help setting up a mod with replication. I’ve gone through the bootcamp video and the documentation, but I’m still confused.
OnPlayerRegistered fires before OnPlayerAuditSuccess
Turns out
Then ask your question here
How do I replicate sounds and hint messages to players in a way that will work on dedicated server as well as offline single player?
What is error code 16 for RestCallback?
I know some bohemia folks said they wanted to set up a https://github.com/BohemiaInteractive/DayZ-Script-Diff - like repo for Reforger. am i going to get yeeted if I start one myself?
can anyone help? I can't make replication work on the sounds. apparently, hints are working fine on dedicated server, but the sound isn't, and I don't know why.
BI needs to implement the diff tool into the workbench.
Especially considering arma 4 is probably gonna have 5-10 years of updates.
Every update even more and more modders will have this issue
The earlier BI start developing and adding diff to workbench, the more benefit it yields.
Show diff related to the project we have currently open, (as well as whole diff between previous version etc)
if I use SCR_ChimeraCharacter in my project.
I should be alerted to the diff related to this class every update that changes it.
If a class I'm modding or inheriting changes, show diff related too etc.
My website supports build diffing https://landaire.github.io/enfusion_tools/
The issue is with making it easy to view diffs without having two versions installed.
https://github.com/BohemiaInteractive/Arma-Reforger-Script-Diff-Experimental
Is is there for experimental, it should come to stable when 1.6 will be release
What is this? A comunnity driven script library?
No this is official bohemia account putting script folder to github, this helps to see exact changes since a changelog is not enough, you will be able to just go there and see which exact line was changed to, so it should help everyone
Can we download the vanilla scripts offline from it?
Looks like it. Cool.
Hi everyone,
I’m working on a modded server for Arma Reforger / Enfusion, and I’m encountering a bug: when a player clicks Exit Game while connected to the server, the screen freezes (nothing happens) and the client doesn’t fully exit.
I suspect it’s something in my scripts/mods blocking the shutdown flow. I’m looking for which function, script, or engine hook is responsible for handling the “exit game / disconnect” flow in Reforger mods, and how to properly “clean up” so the client can exit cleanly.
If anyone knows which EnforceScript API handles exit / client disconnect, or has seen similar “freeze on exit” mod issues, any pointers or sample code would be super helpful.
Thanks in advance!
SCR_PauseMenuUI.c -> OnExitConfirm
Thanks a ton, @torn bane! I really appreciate it — I’ll look into it.
I’ll report back if I can fix it.
What API can I use in 1.6 instead of the blocked Physics API? For manual Projectile control
cant figure it out how to do it with EPF when i exit game my character has items which i droped before i exit game
save on exit is unreliable with EPF. 1.6 vanilla system fixes it
think now i fixed it u can exit normal no more screen freeze
i will test some days it on server when works fine share it on workshop to people
now u can use it on modded server with epf system and other mods for exit game button
Can i add component to entity runtime in game, or CreateComponent works with world editor only?
No runtime adding of components
Base topic:
#enfusion_configuration message
I discovered that when the HAB is spawned from the construction truck, the spawn object (E_SpawnPoint_US_Supplies) is not registered to the US. I checked all the spots for a faction value and they are all US.
So in order for the spawn point to be registered to the US, it needs to be set after it is spawned.... Can anyone explain why this breaks and what I can do about it?
What's the greater save functionality in 1.6 since it's currently disabled?
Also will it be working this week? I'm actually debating opening workbench 1.4 and copying old save system for when server crashes happen and delete all progress in 1.6. it's very unmotivating and depressing currently trying to get through a conflict match. I think most of my community is opting to play stable instead because of this major issue.
No this week's experimental won't have it enabled. We are chasing some issues. Maybe next week or so.
I am not sure if the old system would still work
Ok thanks for the update! I'll probably give it a go tomorrow night after work and see if I can get it working for the meantime.
why not just wait for the new system? Experimental builds are experimental for a reason if someone can’t handle that they’re probably better off sticking with stable 
Hello, i am currently writing a script so players can load one of the predefined loadouts ingame, via using an Action on a crate. Is there an accessible method to set a players entire loadout, or do i have to modify each storage component?
There are a few check the player loadout component on player controller to see how the server does it when the client asks for it in respawn screen.
Eh I can understand that they want to finish a match. We wanted to have it working already but things did not go to plan and it would lead to some crashes and invalid states on load. With new HQC mode the old save load was overwhelmed. That's why I would not even attempt it.
Okay, thank you
Should we expect an update with documentation on the changed API and some new components this week?
Or is it more likely not?
Lol
Unfortunately, it's sad 🥲
Who needs documentation?
I was referring to the new components, how they work, and the new or alternative API mechanics.
I'm still not entirely clear on this, but I'm trying to understand it.
I have two mods that use the Physics API to control the projectile.
MarioE responded to me a couple of weeks ago, saying that access to this API will be restricted and it will be moved to a separate sim component.
In fact, I'm looking for this component.I can't find it in any way
🥲
Fortunately my pve scenario is based on legacy conflict, I'm just not sure how important the backend was in saving scenario data. I feel like the structs and everything from 1.4 save/load component should be able to do the job on it's own.
quick one, is there any way at all to limit how many attack choppers in the skies
If it's for conflict, maybe have a look at building budgets. One could probably implement a custom one for this.
yup it for conflict
If crashes and bad state are important then why was loadSessionSave a thing in the first place?
Would anyone be please willing to help me make a script? It would enable "sights skip switch" on sights component, when player inspects the weapon, there would be option to do that.
Hello, I've been following the 6th bootcamp and I would like to script my own entity. So it needs to have a RplComponent to work in multiplayer. I've currently got the Create_an_Entity wiki page open and I'm following the format like:
[EntityEditorProps(category: "Tutorial/Entities", description: "Prints player's position regularly")]
class TAG_PrintPlayerPositionEntityClass : GenericEntityClass
{
}
class TAG_PrintPlayerPositionEntity : GenericEntity
{
}
And it appears in the create tab and it works. I can add a RplComponent once it's placed into the world and save it as a prefab.
But, do I need to add the RplComponent somehow in the original script file? Because I'm currently wanting to use the RplComponent like:
auto rplComponent = BaseRplComponent.Cast(GenericEntity.Cast(this).FindComponent(RplComponent));
But I can't get it to findthe component
you need to use a spawned instance of your entity with FindComponent, you could set your event mask to allow init and fetch it there:
// inside TAG_PrintPlayerPositionEntity
protected RplComponent m_RplComp;
override void EOnInit(IEntity owner)
{
m_RplComp = RplComponent.Cast(owner.FindComponent(RplComponent));
if (!m_RplComp)
Print("uh oh...");
}
void TAG_PrintPlayerPositionEntity(IEntitySource src, IEntity parent)
{
SetEventMask(EntityEvent.INIT);
}
hmm okay I'll do that thank you
would recommend messing with other stuff before getting into replication though
not easy on the noggin
hmm yeah it seems like it can cause lots of problems
I do have a menu and manager entity which works in singleplayer, but I didn't wanna post it because it's alittle messy
I'll see how I go
if you explain what youre actually going for someone might be able to help you better
you could also potentially get away with simple stuff by just using RplProp() and Replication.BumpMe() but i would go read the replication page before doing even that
Anyone happen to know where the players MSAR is stored, or how it's updated?
I think I found it under SCR_PlayerSupplyAllocationComponent
is the timeslice in the game variable or fixed?
if only there was some easy way to Print that
Print makes the game slower so don't use it
wait sry for spamming the chat. I might start with sending a simple custom class back and fourth then adding all the parts I need
Not sure if workbench or scripting but.. I can't figure out how to create a new version of the SCR_BaseGameMode entity. I'd like to extend it but I can't find a way to create/duplicate the prefab. I've got a script for it created extending the SCR_BaseGameMode class but I can't select it with "Change Class" on the existing game mode entity so... IDK.
Edit: I think I figured it out. I don't think SCR_BaseGameMode is an "entity" to override, but I found the GameMode_Base.et that I can use. So I was looking for the wrong thing.
Is your script extending it creating a new class with unique name or marked as an override?
new class, unique name.
Does it show up in the create panel?
No
class CNR_BaseGameMode : SCR_BaseGameMode {
override void OnPlayerConnected(int playerId) {
super.OnPlayerConnected(playerId);
Faction faction = GetPlayerFaction(playerId);
PrintFormat("Player %1 connected. Assigned faction: %2", playerId, faction.GetFactionKey());
}
override void OnPlayerSpawned(IEntity playerEntity, int playerId) {
vector pos = playerEntity.GetOrigin();
PrintFormat("Player %1 spawned at position: %2", playerId, pos.ToString());
Faction faction = GetPlayerFaction(playerId);
PrintFormat("Spawned entity faction: %1", faction.GetFactionKey());
PrintFormat("Entity prefab: %1", playerEntity.GetPrefab().ToString());
}
override void OnGameStart() {
super.OnGameStart();
Print("✅ My modded GameMode is active!");
}
}
It compiles fine?
yes
Also have you tried restarting WB since creating it? Weird but sometimes fixes new classes and stuff not appearing
Just tried again. Not there.
It's just a script i created in the resource browser. I haven't been able to get an entity to use the class.
You created the file manually? I'm not 100% sure but IIRC for some kinds of scripts the path can be important, if it's not already in a path that mirrors where vanilla game mode scripts live that might prevent it being registered properly or something.
If you duplicate a vanilla game mode script, rename it and paste your code over the contents it should automatically be in the right place which should rule out anything like the above
hmm you could try changing class CNR_BaseGameMode : SCR_BaseGameMode {} to
modded class SCR_BaseGameMode
{ ... // code in here
}
and I think the path is project-name/scripts/Game/Gamemode
sry if that doesn't work
In the world editor, when you click on your gamemode entity, the place where you can do stuff with the components, right click on the SCR_BaseGameMode(i think thats it) or whichever is the parent class and hit change class, then select your custom gamemode
Yeah it can't find it. The script compiled fine, but once I duplicated the existing script and edited the one in Scripts/Game/GameMode it's throwing another error when I try to compile.
scripts/Game/GameMode/CNR_BaseGameMode.c(1): error: Missing Entity Class for 'CNR_BaseGameModeClass' for Entity 'CNR_BaseGameMode'
IDK What CNR_BaseGameModeClass is or where it came from. I don't see references to that.
class CNR_BaseGameModeClass : SCR_BaseGameModeClass {}
put that at the top of your gamemode class

Thank you, this helped me down the right path as well. It works differently if the folder isn't correct.
oh cool good
Hello! Friends, is it possible to set up a trigger so that the mission ends when the required amount of resources is brought to the task by supplies?
Hi there, how do I send a message in chat from server?
Hi everyone, I have a question. I saw in the script that an item has a component called InventoryItemComponent, and inside it there is a field Stackable. When I have an item in my inventory and it already has over 100 stacked items, is there a way to move the whole stack, or is there some option for transferring it? Or can this be added with scripts? Does anyone with experience in this matter know how to help?
hey guys ive searched the web but couldnt find an answer to this question: what are the recommended IDE and plugins for scripting enfusion/reforger stuff?
Is there a way to get a prefabs item name without having to spawn it in?
You'll have to load the resource but spawning should not be necessary
Resource.Load(rn).GetResource().ToBaseContainer().Get("name", name); would work I think
you may have to get the components obv
We recommend not using the built-in script editor.
it closes when the workbench crashes.
Using vscode in c# works for us
the built-in script editor is for exploring vanilla code and for Ctlr+f7 to update a functions during runtime in workbenhc
@minor agate very random question, what delay on a callqueue, past which, should it be considered imploded/detrimental? I created a simple mod which measures the time OnUpdate takes in ArmaReforgerScripted - which invariably is influenced by how many functions are executing when the ScriptedCallqueue ticks. 2ms? More? Going forward my goal is to avoid CallLater at all costs, but it would be good for profiling other mods which utilize it to see where the stalling is coming from.
Hey I was wondering if anyone has experience with scripting in custom actions to a prefab could reach out to me to see if you could help me get this mod over the finish line?
Little info, took an auto-cannon where the toggles are in GM Mode, made it a child prefab to a vehicle, made a script to allow the parent vehicle to see it, now I just need to script in the toggleable actions.
"We" lol
you don't get code completion or other nice ide features
I'm trying to get the right size of the playable map area. GetGame().GetWorld().GetBoundBox() gives you the information in most cases, but for example on Kunar map the bounding box is much larger than the actual land mass. GenericTerrainEntity is the land mass, but I don't know how to get it's size. How to access it's bounding box or the coordinates?
Is EOnInit no longer being called in workbench edit mode in 1.6 exp? If it's intended behaviour, so SCR_Global.IsEditMode() calls could be removed, right?
Can't confirm...
hmm, strange, it's not being called anymore in SCR_AmbientVehicleSpawnPointComponent deriative class
probably have something to do with the entity itself, or SetEventMask(INIT) was removed
if you need to call some EntityEvent you should always set mask
yeah, I know
I just noticed that it worked before in 1.4 and stopped doing so in 1.6 ¯_(ツ)_/¯
Take it like this
Whatever time it takes to process, it's time taken away from replication threads
In other words more latency added
Not only it slows framerate, it also slows down that even if they are separate threads because the rpl threads are subject to the main thread script mutex
The biggest issue is that it is there mostly for UI. For small calculations and signaling
But people misused it even internally for feature development, adding expensive calls to it
I have a solution for this problem.
Server only calculates networking.
Headless client runs code.
It works so great in arma 33
rip rpl calculations that are supposed to be fast then
We have headless clients in AR
we don't use them because that option does not realyl solve the problem
just moves it elsewhere
You will still get the stall
There is solution that is better for it, but we are not using it for AR as AR does not have that tech
We have world systems with special update points for things 😛
Have you added a new sim-component for Projectile yet?
when i press TAB near vehicle i can see Trunk Is there a way to forbid this?
Because we need the simple way for delaying! In A3 it was single command waitUntil or sleep, and in AR you need to write tons of code just for 1 second time delay. So, when such simple thing as global game callqueue is exist - it will be used extensively.
Yeah but it is way slower in SQF
We prefer to have the performance even if it means more work
For A4 we are providing more shortcuts for those not technically good
So then global callqueue should be removed...
We would break all mods in AR
As I said before, on A4 you won't find it
Guys, can you tell me how to enable the bullet trajectory display with Win + Alt?
GameCode-Projectiles-Show Shell True
пасиба
could anyone ELI5 on what each RplComponent property practically means? I read community wiki article about it and honestly, haven't gathered much knowledge from tech mumbojumbo speak there. 🐸
I only understood that streamable property affects network streaming for clients (so entity outside of "player bubble" will no longer exist for such client and/or it's state will not be synchronized until such entity reaches "player bubble" again), but others, especially spatial relevancy, auto hierarchy and rpl state override, are mysterious in what they actually affect
Hi, does anyone know how ti Fire a weapon (BaseWeaponComponent/BaseMuzzleComponent) by Script?
I was looking for an answer to this question too for my heli rocket strike feature and came to the conclusion that it is not yet possible and there are two ways to "fire a weapon":
- spawn rockets as projectiles in the general direction of target - essentially mimicking weapon fire
- use AI behaviour trees (
Fire.bt,Fire_Ballistic.bt,Fire_Single.btandFire_Burst.bt) and force pilot/gunner to fire his weapons by sending a highest priority "Fire" AI message in his message queue
yeah, someone shared this link with me before (thanks for sharing again, btw, I lost this link), but it's only tangentially related to RplComponent
there are a lot of technical and theoretical stuff, but I haven't found an answer to "what an rpl state override actually means in practical terms" and other simple stuff 😅
btw, if you're interested in AI behaviour tree way, you may start to look at SCR_AIGroupUtilityComponent as an example of this way, see for a EvaluateFlareUsage() function - it checks right conditions to fire a illumination flare and forces guy with an underbarrel GL in the group to take cover, aim and fire a flare at the target position and direction
so, the call stack is (roughly)
SCR_AIGroupUtilityComponent.EvaluateActivity() (check s the state of the group and forces various behaviours)->EvaluateFlareUsage() (checks if there is a necessity to launch the flare)->SCR_AIActivityIllumFlareFeature.Execute() (checks if group has the alive and available soldier with GL and flares, picks particular soldier from the group and sends him an AI message that he needs to fire the flare)->SCR_AIFireIllumFlareBehavior and FireIllumFlareAt.bt (actual illumination flare firing behaviour)
OR
you can just spawn projectiles and launch them via ProjectileMoveComponent (see SCR_AirstrikePrototype as an example) 🫠
(I ended up doing it this way, but it has some accuracy problems - you need to manually compensate speed and distance to make it really hit something at all, and there are no generated AI ballistic tables for heli rockets so you can't use BI ballistic helpers either)
In your workbench, look for the file "rpl_docs.c"
Tons of information there, might need a few reads to really understand but it's quite informational
i think "ProjectileMoveComponent " is the way i go, so i do not need to mess around with AI stuff
Here's the formatted version of the file @vast flower https://community.bistudio.com/wikidata/external-data/arma-reforger/EnfusionScriptAPIPublic/Page_Replication_Overview.html
I am currently testing something like this in my mod for a missile run. I managed to get the turrets to fire automatically using the TurretControllerComponent API to override the turret and control it.
what an rpl state override actually means in practical terms
replication items inserted during world loading (for example, entities placed in World Editor) becomesLoadtimeand inserted after -Runtime, so this option force first items to be second
But why would someone force the Runtime option? (I'm wondering the same than him I think)
Still very WIP tho. currently I recursively search through the helicopter entity and its children using FindComponents(TurretControllerComponent) and manual child traversal with GetChildren()/GetSibling() but that means it finds ALL the turrets in the chopper so it not only fires missiles but the 50cal too lol
Loadtime entities must be deterministically setuped during world load without syncying, so, for example, if loadtime entity failed to attach to runtime entity (because for example it's not streamed in), this will generate JIP_ERROR
If you spawn a weapon but from world file, you might want that switched to runtime on that entity
Do not read the biki for rpl docs
Read the multiple doxygen docs instead
or the rpl bootcamps
Hierarchies for RPL and all that are explained there too
That makes sense, thanks!
All the answers are on the doxygen. Go there
Also for you @vast flower
Trying to get the custom attributes here from the entity source
Currently doing
IEntitySource entitySource = SCR_BaseContainerTools.FindEntitySource(Resource.Load(sight));
if (entitySource)
{
for(int nComponent, componentCount = entitySource.GetComponentCount(); nComponent < componentCount; nComponent++)
{
IEntityComponentSource componentSource = entitySource.GetComponent(nComponent);
Print(componentSource);
if(componentSource.GetClassName().ToType().IsInherited(InventoryItemComponent))
{
BaseContainer attributesContainer = componentSource.GetObject("Attributes");
if (attributesContainer)
{
auto itemAttributes = componentSource.GetObjectArray("CustomAttributes");
Print(itemAttributes);
}
}
}
}
itemAttributes is returning a nullptr, what am I doing wrong here
Nvm just had to change
componentSource.GetObjectArray("CustomAttributes");
to
attributesContainer.GetObjectArray("CustomAttributes");
🤦♂️
Where or how to access the doxygen docs? Never used those before. Always opened up the docs in the workbench files
SetFireWeaponWanted?
Speaking about this - how much is to much to move Loadtime entities?)
or it's just about if you move something, then it will be out-of-sync until players come close?
disable streaming for it and it will stay in sync)
Is there a way to get nested components with the IEntitySource
For example
IEntitySource entitySource = SCR_BaseContainerTools.FindEntitySource(Resource.Load(prefab));
if (entitySource)
{
for(int nComponent, componentCount = entitySource.GetComponentCount(); nComponent < componentCount; nComponent++)
{
IEntityComponentSource componentSource = entitySource.GetComponent(nComponent);
Print(componentSource.GetClassName().ToType());
}
}
This prints all these non nesteed components in a weapon
hello all, so i have been experimenting with loads of different gamemodes for a survival dayz roleplay server on reforger, on my understanding a life roleplay server has a lot of custom script built in, so I'm using the everon life mod and the enfusion data/persistence frameworks mods as my foundation build on worthy islands map.
I have messed with GM mode and SF mode to which i find has components i dont need.
Looking at everon life prefabs for MP it has a roleplay gamemode and as prefab, and spawnpoint...
My question is... would it be best to use? that prefab and duplicate it to my mod or should i set up a SCR_BaseGameMode and add the components from the everon life prefab as i noticed it only has the EPF components needed for persistence.
What is my best option...
Set up scr_basegamemode and add the epf components or
Set up the everonlife prefab roleplay gamemode and add the componets needed manully ?
could do GetChild(n) on the component source maybe since its just a BaseContainer?
Nothing unfortunately
what about GetObjectArray("components")
That worked appreciate it
🫡
SCRIPT (E): Usage of released BaseResourceObject 0x000002799CCF6940 in:
SCRIPT (E): -- Stack trace --
SCRIPT (E): GetPrefabsDefaultSight() scripts/Game/Systems/UI/Menus/CRF_SightArsenal.c : 247
SCRIPT (E): GetDefaultAttachments() scripts/Game/Systems/UI/Menus/CRF_SightArsenal.c : 90
SCRIPT (E): PopulateSights() scripts/Game/Systems/UI/Menus/CRF_SightArsenal.c : 49
SCRIPT (E): OnUpdate() scripts/Game/game.c : 922
SCRIPT (E): OnUpdate() scripts/Game/ACE_Medical_Circulation/Diag/ArmaReforgerScripted.c : 15
SCRIPT (E): OnUpdate() scripts/Game/ACE_Medical_Medication/Diag/ArmaReforgerScripted.c : 15
Getting this error currently but all that is at 247 is
for(int nComponent, componentCount = entitySource.GetComponentCount(); nComponent < componentCount; nComponent++)
ResourceName GetPrefabsDefaultSight(ResourceName prefab)
{
IEntitySource entitySource = SCR_BaseContainerTools.FindEntitySource(Resource.Load(prefab));
if (entitySource)
{
for(int nComponent, componentCount = entitySource.GetComponentCount(); nComponent < componentCount; nComponent++)
{
IEntityComponentSource componentSource = entitySource.GetComponent(nComponent);
if(componentSource.GetClassName().ToType().IsInherited(WeaponComponent))
{
BaseContainerList attachmentComponents = componentSource.GetObjectArray("components");
for (int i = 0; i < attachmentComponents.Count(); i++)
{
IEntityComponentSource attachmentComponent = attachmentComponents.Get(i);
if (attachmentComponent)
{
BaseAttachmentType type;
attachmentComponent.Get("AttachmentType", type);
if (!type)
continue;
if (type.Type().IsInherited(AttachmentOptics))
{
BaseContainer attachmentSlot = attachmentComponent.GetObject("AttachmentSlot");
if (attachmentSlot)
{
ResourceName attachment;
attachmentSlot.Get("Prefab", attachment);
if (attachment)
return attachment;
else
return "";
}
}
}
}
}
}
}
return "";
}
That's the full method
Everything still works fine, it just barks that error for some reason
@minor agate Maybe you could throw more insight but it seems that some duplicated weapons cause this to happen. Everything works fine still but it barks that error, it seems to inconsistently happen as well only on certain duplicated weapons.
Hi everyone,
I’m looking for a way to disable the component that handles target locking on RHS tanks, since it’s way too strong. Does anyone know how to do this without disabling the stabilization system?
It's the Resource.Load(prefab) youi have in the first line
Load it separately into a var with Resource type
then use it
Do not use it without storing it, only valid case is in cases like the spawn methods
The resource gets cleared later on if not hold somewhere
Hey im currently working on a drive by mod for my server. Ive copied the s150 prefab and am trying to edit it but it wont let me attach my script onto it. can anyone help with that
You shouldn't add scripts to prefabs. Define and add new components instead.
how do i do that😅
You create a component and attach it to the prefab. Check out how other components in the game are made
ive made this
class VehicleShootComponentClass : ScriptComponentClass
{
};
class VehicleShootComponent : ScriptComponent
{
override void OnPostInit(IEntity owner)
{
super.OnPostInit(owner);
Print("VehicleShootComponent initialized for: " + owner);
}
};
but its not showing up in the add component
have you validated and reloaded your script?
i figured it out
my class name was VehicleShootComponent but the file name was VehicleShootingComponent
lol
charController.SetBlockedState(ECharacterControllerState.FIRING, !allowFire);
Print("[DriveBy] Shooting" + (allowFire , "ENABLED" : "BLOCKED") + " | Leaning=" + m_bIsLeaningOut + " | Weapon=" + itemName);
this is saying unmatched brackets detected
anyone know how to help
What in the chatgpt is that
Don't use chat gpt for reforger, that looks horrid
where exactly do I find this?
im still learning this coding language so im having the GPTs help but it keeps writing in an out dated version and its stating to piss me off
i keep getting the error: Broken expression (missing ';'?)
Don't use ChatGPT to help you in enfusion, it has little to no idea on the proper syntax of enforce. Your best bet is to just look at what the base game does and go from there.
Most enforce syntax is relatively close to C# anyway.
ik C# but idk something with enforce throws me off
Well it's not strictly C#, it's definitely an almogamation of the C based languages
But imo it's closest to C#
u should give Claude a try
its not an outdated version, enforce script has never looked like that, not even in dayz.
No ternary operators
Can anyone explain to me how or where to access Enfusion Doxygen?
Nevermind I think I figured it out
Mind sharing how you got it? I got doxygen setup but dont know what folder to run it against
open SteamLibrary\steamapps\common\Arma Reforger Experimental Tools\Workbench\docs\EnfusionScriptAPIPublic and extract EnfusionScriptAPIPublic.zip. all the info will be there in different files
ahh okay, was thinking it was this but did it against the \Workbench folder. Thank you
ahh its already generated from doxygen i see, thought these were 2 different things
I was very confused too 😅
How would you make the Doxygen docs look like in the MarioE's message? #enfusion_scripting message When I open those files it looks quite different
Hey all! New to modding in the enfusion engine (not new to programming though). One thing that I am really struggling with is just finding the correct configs for what I want.
For example, I'm trying to add a new task to the Game Masters faction tasks bar, but I don't know where this config is. I am assuming it is in a config somewhere much like how I would add a new item to the spawnable prefabs?
Edit: to clarify, I'm not looking for how to find that specific config, more just how to trace things back to a config in general (if there is an 'easy' way?)
Use UI diag option to see what layout it comes from. On if check which script components are attached as handlers. Then you can trace where they get their info from
No idea. I hope he replies with that info.
Also ran the unzipped folder through Doxygen executable via it's GUI wizard, but I think I'm doing something wrong because the end result wasn't correct
Apparently there's no need to use Doxygen executable as the files have been formatted by it already, but that doesn't explain why it's looking completely different and missing stuff
because whatever we have will always be outdated
more than likely a dev build
Hey, is there a shortcut or something to disable all breakpoints quickly ?
Press that one?
Oh yeah I didn't saw the breakpoint window thanks
How can I find the GenericTerrainEntity from the map? I've had no success with querying with a sphere. Finding GenericWorldEntity has specific getter GetWorldEntity() but such is not available for GenericTerrainEntity.
I'm trying to find the size/bounding box of the GenericTerrainEntity to determine the size of the playable area. I can see bouding box in WB, but have no idea on how to get that information. (GetGame().GetWorld().GetBoundBox() is not reliable on all maps).
Has anyone figured how to use new (1.6 exp) task system?
I want to assign newly created task for all players in the faction, but not sure how to do it, as there is no SCR_TaskExecutor.FromFaction (only player, group and entity support) thing in TaskSystem.AssignTask() function.
I already assign task to faction:
m_TaskSystem.SetTaskOwnership(task, SCR_ETaskOwnership.FACTION);
m_TaskSystem.SetTaskVisibility(task, SCR_ETaskVisibility.FACTION);
m_TaskSystem.AddTaskFaction(task, playerFaction.GetFactionKey());
but it seems to be not enough to assign task to all players in faction and show notification to them too.
Hello. How can i get terrain material type at specific coords? I want to restrict item placement on roads.
Well you will be delighted to know roads are not terrain materials
I known. Roads have own RoadEntity. But when i try to get entity by TraceMove it returns LakeGeneratorEntity when i check road 🙁
Lol
it was my fail with flags.
With "Flags = TraceFlags.WORLD | TraceFlags.ENTS;" works fine.
hmmm. it works with roads only, but ignores concrete surface, because its part of terrain
Why?
As in why is GetGame().GetWorld().GetBoundBox() not reliable on all maps?
how can i get physics material of terrain in point? I cant find any function to get that info from map
get terrain height at x,y then trace down from like 0.5 meter above with terrain flags only
I vaguely remember there being a helper function for that
material info in TraceParam ?
yeah is that not physics material?
ye. I see "SurfaceProperties SurfaceProps;"
I think you have to account for those maps that have offsets on the map entity
I can get PhysicsMaterial of surface but i dont known what do next 
PhysicsMaterial doesnt have any functions or documentations or examples. How to work with it?
idk I just thought roads might have a different one than anything else
Why do you think you need the PhysicsMaterial?
Guys i need some help, ive added 2 new vehicle mods to my server and wanted to make them lockable, im on wcs based server, so i added the wcs-lockable component in the prefab, but still cannot lock or unlock it, any idea why?
Im making modifications for ACE_Trenches and want to allow digging on dirt only.
i can get roads and buildings by TraceMove, but i cant get concrete, because concrete is just terrain with own material.
No scripting is needed for this, this is the spawn menu logic from the game mode manager. you need to find the SCR_RespawnSystemComponent and change the spawn logic to SCR_AutoSpawnLogic
unless you need something else
Okay, and do you know anything about whitelisting police items are even locks to doors so players can’t enter certain buildings ?
Or is that even a thing haha
Should OnPostInit run for proxies? I have a component on a vehicle and currently the init code does not run on peer tool client. Is there a replication event I can hook into to run it on ownership change?
For example this component is placed onto a M151A1:
[EntityEditorProps(category: "GameScripted/Physics")]
class PhysicsTestClass: ScriptComponentClass
{
}
class PhysicsTest : ScriptComponent
{
protected RplComponent m_Rpl;
override void OnPostInit(IEntity owner)
{
m_Rpl = RplComponent.Cast(owner.GetRootParent().FindComponent(RplComponent));
Print("PhysicsTest::OnPostInit");
SetEventMask(owner, EntityEvent.SIMULATE | EntityEvent.FRAME);
}
override event protected void EOnSimulate(IEntity owner, float timeSlice)
{
if (!m_Rpl || !m_Rpl.IsOwner())
return;
Print("PhysicsTest::Simulate");
}
override event protected void EOnFrame(IEntity owner, float timeSlice)
{
if (!m_Rpl || !m_Rpl.IsOwner())
return;
Print("PhysicsTest::Frame");
}
}```
1. In workbench, Frame & Simulate debug prints work fine. [expected]
2. Once peertool client enters the vehicle the print stops in workbench console as ownership has been transferred to the peertool client. [expected]
3. But OnPostInit was never called on the peertool client so it does not have the correct event mask's enabled so it never runs frame & simulate events so no prints to peertool log file. [what do??]
Essentially an OnOwnershipChanged function would be great in RplComponent, but that only exists on PlayerController.
Post init is called on proxies too. If you did not see it, the entity did not stream in. Add print to constructor
No
Did you add your component to Prefab or just in World Editor?
This example in Kunar. The GenericWorldEntity size is ~7k. Inside it there is the playable area GenericTerrainEntity which is of size 4k x 4k. Outside of the terrain there are nice mountain walls. Terrain is centered in the world (in 0,0,0) which leaves a lot empty space outside of it. This empty space is not play area as it has no land mass on it. The ...GetBoundBox() for world returns the size of 7k.
Do ExecuteBefore and ExecuteAfter have deadlock detection? Like if system A depends on system B results and system B is also set to depend on system A
Try to use MapEntity size and offset
Tried that a few versions back. Works in WB, but on dedicated server always returned 1024 regardless of map.
I had a problem with zeros when I tried to get values too early, but never saw 1024
GetGame().GetWorld().GetTerrainBoundBox() or GetGame().GetWorld().GetTerrainSize() would be nice. 🙂
How do I get to this point that I can change and select auto spawn logic got lost right here aswell
There is. You just need to define either of these rpl callbacks similarly to RplLoad/RplSave
// Authority event, called on ownership change. You can use the writer to send aditional data.
protected bool RplGive(ScriptBitWriter writer)
{
// Do something here
return true;
}
// Owner event, called on ownership change. You can use the reader to send aditional data.
// This is called only on the client receiving the ownership.
protected bool RplGiven(ScriptBitReader reader)
{
// Do something here
return true;
}
This is before, for after the change. Do RplTake/RplTaken
Might be a big ask, but I'm still struggling to find how this task list gets populated. Would it be possible for a bit of a step by step? I have used the "Widgets under cursor" but this just shows the layout, and I have tried logging the construction but I can't figure out how to trace this back to the script
some widgets in the layout should have scripts attached, if you look at those scripts you should be able to find where the info comes from
i think is what arkensor was saying
This is getting me closer! Let me see how I go from here thanks!
Devs that deal with UI usually only check #enfusion_gui
So usually better luck from getting someone from our side to answer things there regarding UI
Copy that! thanks 🙂
you can use the reader to send data
reader - how I suppose to write to reader?
And what do all these bools mean for Rpl methods anyway? They're everywhere, but nowhere is it written what will or won't happen if you return false.
It's ScriptBitWriter, sorry for the mistake. Wrote it from memory without much thought
What about bools?
return false means the callback has failed
usually it causes crash as it most of the time means something bad happened
or a stall iirc
I will need to check, but it can cause some bad things.
So i figured out that i cannot change sights skip switch in the runtime, so there have to be some workaround T_T Why is coding so hard? Would anyone be willing to help me out with that? My knowledge about scripting/coding is almost non existent. Im slowly learning, but its not easy
So how do I fake keyboard / controller input to make my VR Controllers work? 
I've done this to override car inputs on every frame:
InputManager inputManager = GetGame().GetInputManager();
if (inputManager)
{
// Attempt to ignore car inputs
inputManager.ResetContext("CarContext");
// Apply custom car inputs (steering, brakes)
UpdateSteering(timeSlice);
inputManager.SetActionValue("CarSteering", m_fSteeringAngle);
inputManager.SetActionValue("CarBrake", m_fWheelBrakeInput);
inputManager.SetActionValue("CarHandBrake", m_fHandBrakeInput);
}```
this was my issue, accidently didn't add to prefab
since two days ago I've started to learn how to code in enforce script by fixing AIs mistakes (actually kinda helpful) and looking through arma code. But I'm getting stuck on this and i don't know how to fix it (the console is screaming at me saying Incompatible parameter 'prefabPath')
im still really new to modding so please dont be to harsh if it looks like a monkey bashed a stick on a keyboard to make this
Fairly certain all you need is to check weaponPrefab, don't need to make it into a string.
Print out what weaponPrefab gives you, it might be the entire path and prefab ID, I don't think there is a ToLower either, so you'll need to test the case sensitivity
ok ill try that
And ResourceName can be parsed like a string iirc
weaponPrefab.Contains("m9");
Something like that, writing this off memory
ResourceName is a string
That explains it
I'm getting errors again this time its saying Broken expression (missing ';'?) I've checked over it and nothing should be missing a semicolon but if anyone could point me in the right direction that would be awesome
I dont think you can use those operators ? and :, thats where chat gpt goes wrong.
No ternary operators are allowed, that's why you are getting broken expression errors
what can i use instead?
standard if-else statements
ok thanks
Example
This is wrong:
float blendRate = m_IsFiring ? 0.30 : 0.15;
This compiles:
float blendRate;
if (m_IsFiring)
blendRate = 0.30;
else
blendRate = 0.15;
for a weapon allow list do i only need the WhatEverTheWeaponIs_base.et GUID or do i need ever other variant's as well (i can get screenshots if needed)
You don't even need to do this chatgpt shit with strings, use components or map-like config file
ik
ive only been using it to learn off its mistakes and that was not one of them im making this part
and i figured it out i just needed the prefab IDs
ResourceNames
Is it possible for a manualcamera feed or PiP to be displayed on a rendertarget?
is it possible to script in my own text editors like vscode?
yes but you wont get correct syntax highlighting or intellisense
where's a good place to get started for just the scripting?
im trying to find some sort of documentation of the API
Go tho Arma Reforger Tools\Workbench\docs folder and unzip the two zip files, then find index.html from the main directory of the unzipped folders. Open it and you should have some documentation made with Doxygen there
Yes
thankyou
Is this only for layout widgets? I'd like to see what scripts are called when a player does xyz in the world testbed. Kinda like print debugging/tracing, but done automatically to see what config/script is getting called
yeah those are scripts attached to widgets
the diag menu might be useful for you then
i forget what bind it is, maybe tilde
if not should be searchable in here or on the wiki somewhere
at work right now so cant check
For a working example look at my bank cards
which part sorry
so in my Letmedriveby mod i have a list of unallowed weapons while in the vehicle, so i had to make this list to tell tell the program what weapon is what. my question is how do i get the names or IDs to actuly make it work. (the sceen shots are from me testing last night)
and also what is the player prefab im supposed to put scripts on, ive been using a copy of Character_Base.et
i did end up haveing to change it from a bunch or ORs to if statements
Why do you have "unallowed" weapons?
i dont want players to use primary weapons inside of the car
Then check the weapon component
{599A1E833BEF3A43}Prefabs/Weapons/MachineGuns/M249/MG_M249_base.et like these things?
Why are you returning false in every if statement?
Oh I see, I assume the last one is returning true.
Regardless, how would the mod work with other mods if you're hardcoding the prefabs?
how else can i do it?
i assumed people could make their own version of the mod or something. idk this is my first mod.
also this is more of how it looks now
i didnt know what you meant by that or how to add it so i did what someone else told me to do
Someone told you wrong.
There is 0 reason to hardcode values when you can read that data.
protected bool IsPrimaryWeapon(notnull IEntity Weapon)
{
WeaponComponent WeaponComp = WeaponComponent.Cast(Weapon.FindComponent(WeaponComponent));
if(!WeaponComp)
return false;
return WeaponComp.GetWeaponSlotType() == "primary";
}
This should work for your use case.
is there a way to disable screen effects when switching from a player to game master or arma vision? I want my custom damage screen effect to go away when i'm not longer controlling my player
If you don't even know what means then you need to read these btw.
https://community.bistudio.com/wiki/Category:Arma_Reforger/Modding/Scripting/Guidelines
https://community.bistudio.com/wiki/Category:Arma_Reforger/Modding/Scripting/Tutorials
Help us, help you.
Is there anyway on our side to pass function pointers around? I see there's the func variable but we cannot use it on our side as it just barks errors in the IDE
Trying to create a game system that will let me pass around function pointers as a way to by pass using CallLaters, we have a lot of systems we need to do this for and it seems tire some to create multiple systems to do one thing in each. Or make a really complicated system that can do it all. Function pointers would make this much cleaner.
No
is it disabled just for security reasons?
Sounds like maybe a use case for ScriptInvoker? I also remember seeing EPF using some funny async callback patterns for waitForUid you could maybe (ab)use
anyone know if it is possible to either have a dynamic prefab that changes after a certain amount of time or a dynamic texture that changes with time? We would want to script it to start after we do a certain action.
What in scr_platercontroller would help us stop the screeneffects from playing when switching to GM or AV?
Thanks, should help me and saber get a bit further with that
Is there any way to hold paramter values as voids like you could in the C++ side?
class CRF_QueryObject
{
float m_fLastUpdatedTime = 0;
void CRF_QueryObject()
{
m_fLastUpdatedTime = GetGame().GetWorld().GetWorldTime()
}
CRF_EQueryType m_eQueryType;
float m_fDelay;
ScriptComponent m_Component;
void m_Param1;
void m_Param2;
void m_Param3;
void m_Param4;
void m_Param5;
void m_Param6;
void m_Param7;
void m_Param8;
void m_Param9;
}
Example, but this gives errors in the IDE, is there anything on our side like void in C++?
I see things like Format and CallLater use void like this so I am just assuming this usecase is just locked from our side.
:/
no. Enfusion script looks like C++ but its not C++
u can try to use own class as fake void if need:
class MyFakeVoid
{
int m_i;
float m_f;
string m_s;
void Set(int i) {}
void Set(float f) {}
void Set(string s) {}
void Get(out int i) {}
void Get(out float f) {}
void Get(out string s) {}
}
class CRF_QueryObject
{
float m_fLastUpdatedTime = 0;
void CRF_QueryObject()
{
m_fLastUpdatedTime = GetGame().GetWorld().GetWorldTime()
}
CRF_EQueryType m_eQueryType;
float m_fDelay;
ScriptComponent m_Component;
MyFakeVoid m_Param1;
MyFakeVoid m_Param2;
MyFakeVoid m_Param3;
MyFakeVoid m_Param4;
MyFakeVoid m_Param5;
MyFakeVoid m_Param6;
MyFakeVoid m_Param7;
MyFakeVoid m_Param8;
MyFakeVoid m_Param9;
}
By "inactive and not fully finished" does that mean there's something functional there and it's just disabled? Is there any way to enable this for testing?
I'm not too worried about any bugs or the system's APIs/behaviour changing, if just character persistence is working then that's probably enough for me to start testing with it and planning migration from EPF.
I have a fresh experimental Eden HQC world and am not sure how to enable the new save system, I can see SCR_PersistenceSystem enabled in ConflictSystems.conf but it doesn't seem to save/load anything, do I have to add a manager entity to world or something?
It's locked behind a CLI parameter called -persistence that without the system does nothing even if loaded via system config. The reason it is disabled is because the script APIs were not finished and there were many sources if crashes. I would wait for the experimental update to properly enable it, as any work done until then needs to be adjusted for parameter order etc
As in a param when launching experimental WB e.g. in Steam launch options? Or some setting within WB itself?
Any upcoming changes to APIs/param order etc shouldn't impact me. I just wanted to try running it in 1.6 exp to test it "as-is" on a vanilla Conflict setup for planning, no intention to use script APIs for anything custom until it's fully released
You can, but we have that disabled in scripts for safety reasons. Only parts that can use it are cpp exposed apis, or special apis.
Then it's not interesting as the vanilla setups were not finished and are not functional. Yes launch option
Any plan to expose it to us or at least something similar?
No because of memory safety reasons
many modders already struggle with the primitive memory management we have with Managed classes, using void and possibly ignoring that will make it worse
Lol you are approaching this completely backwards. I would have better luck fixing memory leaks if you bothered to give me tools to find memory leaks.
I can't profile my mod
I dont see why I should take any of that memory stuff seriously if the tools given to me dont take me and my time seriously
Thanks for coming to my ted talk
This is the reason we do not give memory unsafe options
Also you can't track leaks with profile tools
You need the game source code
To be fair I dont think memory management has any place in video game modding
In retrospect
It's limited right now, and people are asking for more
You just asked for more as well
😅
Yea the whole 5 modders
But scripts are not for modders
We use it internally
And the way we do things, is that we provide you as much of the tools we use to modding
where legally allowed and safe
I would actually prefer not having to do any of it. I want to define a data structure and use it anywhere I want and the game engine should deal with the heavy lifting for me.
That also limits a lot
but depends on what one does
those modders wanting to do low level stuff would suffer
While the high level ones would like it
In general realistically modding is in some ways a waste of time, so if I have to troubleshoot some missing ref crashing my entire game that's even more waste of time
but at any point if you do not care, just slap ref anywhere and enjoy the strong reference issues you will face
same that you can face in JS and such
Yeah but with JS I get a stack trace that points me in the right direction, whereas here when I try to unpack a json with some ref issue it wipes out the entire thing with nothing presented to me that is even remotely helpful
Then again, the whole software stack crashes when I ctrl+c ctrl+v in behavior editor, so I should lower my expectations
One I believe objectively valid point regarding not respecting modders' time is asking them to do 50 null checks instead of giving them try/catch
Do you have example of the kind of logging you would like to see?
In my json example I would expect some kind of null pointer or json decode failure instead of wb popping like a balloon
Not sure if that's different in experimental or not
a few of my files could probably be chopped in half with this
But in general that is I would say lower priority than stability issues
I believe stability issues are the biggest contributor to discouraging me from making mods
Wouldn't mind knowing how much memory etc my mod uses.
How much impact x/y/z has.
Even some basic way to overview how much ms do scripts in my mod take and how much data, how much network traffic when testing in workbenhc.
I know there is the debug menu thing that shows,
but having some graph that is made from the data there for clarity would be nice and probably easier to understand for a variety of modders.
And then maybe getting some notification from the graph when issues happen.
Such as scripts taking too loing or what not warnings for modders.
But having a new window/menu in workbench to consolidate this clearly.
Hey, when creating a custom logic in a modded SCR_CommandHandlerComponent,
override event bool HandleWeaponReloading(CharacterInputContext pInputCtx, float pDt, int pCurrentCommandID)
{
super.HandleWeaponReloading(pInputCtx, pDt, pCurrentCommandID);
The good way is to make to set up the animation events with flag in a custom WeaponAnimationComponent, and use these flags to drive the reload logic in the handler ?
This sounds good to me but I'm not sure that's the good way
You can profile whatever you want yourself, and you scripts will use a much memory as you fill for it. If you want a pretty graph you can also make it yourself... not really clear what you're asking for
I'd like a vanilla workbench implementation as it's quite a common concern.
I don't think I can accecss the data in the debug menu with a script, so I can't really graph it in-game.
I don't know how big my data is etc.
Struggling to envision situation where 1) you don't know size of your data 2) that size important. Maybe I'm just stupid, but the most complex mods I can imagine would only ever use at most a couple of MB in script, or you could know how much memory you will use.
For example in arma 3 I wrote a script that generated loot for every building position in the game.
Tanoa/Altis were a lot of data etc.
or caching/spawning system with couple of thousand AI units.
Hard to grasp which methods of writing the data are better or slower etc
But in general profiling window for modders is a great thing to have in the long run.
don't known size of your data
You can't do this, because you can't access to internals (you don't known how looks layout for your string/array/map, you don't known rules for padding and alignment of your classes, you don't known how many levels of indirection they have, you don't known how much additional info VM allocates for your data (type checking, inheritance and etc)
Just ask you - how much memory will be allocated for single component with single variable, and after that look at what your world editor will say
that size is important
But it can be important because you can use it for thousands entities
I'd like classes to be replication compatible by default without having to implement the codec.
That would be neat. I find it crazy that it's more convenient to serialize my class to json, send it as a string and deserialize it after sending it to the client / server(i know that performance wise it's horrible)

anyone know how to get the position of the seat a player is sitting in (like if a player is sitting in the front passenger seat)
Compartment access component on the character. On it you can get the compartment. It should hold a point info getter somewhere
thank you so much
Can someone tell me how to do it correctly?
And in general, did I do it correctly?
When implementing my BlastComponent for the RocketEjectorMuzzleComponent, I encountered a problem.
When I use the Action Refound Rocket (SCR_RefundVehicleAmmoSupportStationAction), the BlastComponent constantly triggers.
How can I forcefully block it? I only want it to work from the turret's shooter position.
Ah ok vanilla entity persistence not functional yet so nothing really for us to test yet even with the cli param specified and system enabled? Gotcha thanks for clarifying, I misunderstood it as being functional but just disabled
how to change player loadout when they first join ?
A long ways to go, but it's a start
It's communicating with WB (so it can search for most resent and modded scripts) or just some "predefined" table?
How do I import vec[3] from json? This only seems to import the first element. Not sure if this is even possible, or im doing it wrong 
class RotationTestJson : JsonApiStruct
{
vector rotation[3];
void RotationTestJson()
{
RegV("rotation");
}
}
...
vector mat[3];
Math3D.MatrixIdentity3(mat);
SCR_JsonSaveContext context = new SCR_JsonSaveContext();
context.WriteValue("rotation", mat);
string myJson = context.ExportToString();
//-> string myJson = '{"rotation":[[1.0,0.0,0.0],[0.0,1.0,0.0],[0.0,0.0,1.0]]}'
RotationTestJson rotTest = new RotationTestJson();
rotTest.ExpandFromRAW(myJson);
Print(rotTest.rotation);
//-> {<1.000000,0.000000,0.000000>,<0.000000,0.000000,0.000000>,<0.000000,0.000000,0.000000>}
your rotation in myJson is not a vector
but if I export to string should it not be able to import it correctly again?
Oh wait I am a dummy
Your first mistake is using JsonApiStruct instead of JsonLoadContext
JsonApiStruct does not parse JSON correctly
Right, LoadContext just works. The one time I try to use the fancy struct like the wiki says, everything breaks 
SCR_JsonLoadContext loadContext = new SCR_JsonLoadContext();
loadContext.ImportFromString(myJson);
vector rotation[3];
loadContext.ReadValue("rotation", rotation);
//-> {<1.000000,0.000000,0.000000>,<0.000000,1.000000,0.000000>,<0.000000,0.000000,1.000000>}
It’s not communicating with WB at all. It’s leveraging my own library for getting data out of pak files then using https://github.com/simonvic/tree-sitter-enforce to parse scripts. No intermediate formats, dumping data to disk, or manual steps needed other than configuring the game directory.
My LSP implementation is quite jank atm, I’m just building a list of classes and returning that for completion results as a PoC, but using tree-sitter allows for real-time editing and analysis.
This approach would allow you to do dev on any platform so long as you have Arma installed somewhere.
Is there anyway to reconnect with the same playerId to my hosted dedicated server in the WB
Ive tried direct join with localhost and my ip but nothing works
And if I just relaunch the diag exe it connects me to the server with a seperate playerId
It works only with diag version of the game and only on 1.6 onwards. There it should match the old connection and you get your Id back. But only if the client did not voluntarily disconnect. Only on killing the process or rpl timeout etc
Rip alright bet
Why the hell is this illegal?
void MyTestFunction(array<LocalizedString> formatParams = null)
{
if (!formatParams)
formatParams = {};
}
I don't know how other modder's work their mods, but scripts are where I'm focusing my efforts to make two mods that change/add logic and use existing assets. It'd be nice to have better documentation and examples, the mod bootcamp was a good start.

you know what's funny is I looked for you in this discord and straight up didn't find you. I must not have tried hard enough
btw, if there is any nerd here that uses neovim, tree-sitter works amazingly well #1305643710779883570 message
I'd suggest you to get the hang of "queries" https://tree-sitter.github.io/tree-sitter/using-parsers/queries/1-syntax.html
idk about rust bindings, but in Java I could quickly query for all decl_class with something like this
var queryDeclClass = new Query(language, """
(decl_class
typename: (_) @_identifier) @_root
""");
or I could find all syntax errors with (ERROR) @error (and eventually report it as diagnostics from the language server)
And it's so stupidly fast that you could run it on every keystroke 😄
He is kinda married to dz modding iirc
Also, rare to see you here @narrow walrus 
DayZ is my wife, Arma is the girl I cheat with once in a while because of better tooling 😄
it was actually at your suggestion that I came across his great tree-sitter grammar. writing an LSP server with it sounded like a fun project
he's been a great maintainer too helping fix some of the grammar issues that have arisen from applying it to Reforger
but no worries, we'll soon get all the improvements backported to DayZ e.e right? @ Mario
dayz mods will surely get function pointers before arma reforger
we had/have them (?)
modders can't use them in Reforger scripts. first-party scripts can tho
yeah same, now they're only allowed in native functions
Its the same in dz
Its the other way around tho
AR enforce script has more things
btw mario is it worth filing bug reports for errors that are encountered when parsing scripts? e.g. some scripts contain non-utf8 chars or are very obviously missing semicolons here and there. I don't want to add noise if the scripts or functionality aren't used though
word. from random sampling what the parser is spitting out so far a decent number don't seem like false positives. Some random examples:
These aren't impacting me in-game or workbench, but I suppose could lead to runtime issues for someone?
tree-sitter parse --stat --quiet $(find /var/tmp/Arma-Reforger-Script-Diff-Experimental/ -name '*.c') | grep 'MISSING ";"' | wc -l
55
Question for you gents i made a XM7 magwell script and the Validator refuses to run i know its correct because its the exact same one i use on my other Mod but still not getting any Validation attempts
I will take a look at it (tomorrow, for it is 23:30 here :^), I try to fix'em here and there too
there may be some false positives 🙂
I've just noticed that we can omit the generic type (e.g. ScriptInvoker<>); will it be Class by default?
No, it is to be avoided entirely as it is a "free pass"
See Script Invoker Usage on the wiki
anyone able to help im having trouble with finding the specific seat a player is in
this is cursed
it probably is
lol
i cant access the reforger API stuff so im learning pretty much on my own
I'm sorry that I can't provide a helpful response -- I have never had to deal with vehicles like this.
What do you mean reforger API stuff?
just the tutorials and how certain things are worded
Does your vehicle entity have a SCR_BaseCompartmentManagerComponent component?
this is going to be placed on the player prefab. why is that bad lol
its for my driveby mod
oh, that's a little trickier. If you can access the SCR_BaseCompartmentManagerComponent there's a method that can grab which seats are filled.
yea thats what someone told me and i assumed i could call it there but figured out pretty fast that i couldnt
unless i did something wrong which is a really big probably
you'll need to determine if the player is inside a vehicle, and if they are, find out which vehicle. I think when the player gets in they're set as a child of the vehicle entity?
I've looked into the SCR_ChimeraCharacter class and there's a method that determines if an entity is driving. I think you can repurpose it to get you the specific vehicle and then you can get the occupant status.
bool IsDriving(float minSpeedSq = -1)
{
if (!IsInVehicle())
return false;
CompartmentAccessComponent access = GetCompartmentAccessComponent();
if (!access)
return false;
PilotCompartmentSlot pilotSlot = PilotCompartmentSlot.Cast(access.GetCompartment());
if (!pilotSlot)
return false;
Vehicle vehicle = Vehicle.Cast(pilotSlot.GetOwner());
if (!vehicle)
return false;
if (vehicle.GetPilotCompartmentSlot() != pilotSlot)
return false;
if (minSpeedSq <= 0)
return true;
Physics physics = vehicle.GetPhysics();
if (!physics)
return false;
return physics.GetVelocity().LengthSq() >= minSpeedSq;
}
look at the relevant prefabs (vehicle, player controller) and you can right-click on relevant components e.g. SCR_BaseCompartmentManagerComponent and "Jump to script definition" to see the class(es) underlying that component is usually a good way to get an idea of what properties and methods you want to target
If you search the whole codebase (ctrl+shift+F in script editor) for "compartment" and then filter those results by "controller" will give you a ton of usage examples e.g.
From SCR_CharacterControllerComponent::OnPrepareControls
CompartmentAccessComponent compAccess = character.GetCompartmentAccessComponent();
BaseCompartmentSlot compartment = compAccess.GetCompartment();
if (compartment)
Hey guys I'm posting here as it seems most relevant, anyone abke to help point to some guidance on getting turrets or the heli base turret working, trying to get it to use the flame thrower nl prefabs
Uhm
I would avoid reporting based on 3rd party parsers
; is not needed in many places
For example if you already have {} then its not needed at the end
But if the issues you found are not those, then yes. Report
Like the ones you did
But i am myself more interested on why in this case there was no error 
Hello, I'm having a crash in 1.6 exp with following logic within a component when the world is being destroyed. This works fine on stable. Is this considered an illegal op during world unload, or is that an issue with 1.6?
override void OnDelete(IEntity owner)
{
super.OnDelete(owner);
IEntity ent = GetGame().GetWorld().FindEntityByID(m_SomeID);
if (ent) {
JWK_SomeComponent foo = JWK_SomeComponent.Cast(ent.FindComponent(JWK_SomeComponent)); // this crashes with access violation
foo.Unlink(this);
}
}
Crash GUID: 96d3ce02-5201-4819-b965-4f633f990d5b
...or could it be some special case such as m_SomeID pointing to a children/ancestor in the hierarchy of the owner, or even being the owner, which previously worked only incidentally?
The entity you found by ID is probably being deleted already, but was not yet cleared from the find id table. and then when you try to access component on it, it will crash. This probably should not happen, expected result may be null there instead.
Is there something I can do on my side to safeguard against it, even as a bandaid?
Well if you can repro it, have a look at what ent printed, but i assume it looks like it is not null. in that case you habe no way known to me to be sure that the entity pointer you got back is still valid. it is the responsiblity of our code to only give you valid ones. that this supposely changed between 1.4 and 1.6 is interesting. if you can make a minimal example mod setup to reproduce it with, this may help us investigate. For the latter please submit a feedback ticket then
It does reproduce reliably and the entity prints correctly when casted to string (class name and transform XYZ). I'll try to see later if I can do a minimal example.
One important piece of infor for you would be that we might actually be clearing the id table on world destruction already, so you will never find it there. it would probably be best to not even store the id and try to find later. just keep an entity reference. its the same size in memory
But if it were due to ID lookup being cleared, shouldn't that crash on any access attempt on IEntity (including the string cast), not only FindComponent?
It means you should already only get null back and not even enter component find block. and the crashing depends. the memory might still be there where it was so some operations can still succeed on accident. anyway, i need a solid repro to investigate. but you may change you approach entirely too if you don't want to bother
Gotcha, thanks. If for any reason the minimal example does not repro, would you still look into it if I attach the full mod ID in a ticket?
Well I would need a setup in which this happens and see how you got the id, what kind of entities they are, what their hierarchy is etc. just this alone does not allow me to repro.
Yes you can send me mod id and instructions if it happens reliably with whats on workshop right now. but ideally we do not want to download 50 gb of mod dependencies to try it out. so if you can isolate the issue into a small test mod and just share the source as zip on the ticket that is usually preferred.
Sure, that's understandable. Asking because the steps to reproduce it with the full mod are straightforward as can be, simply load in, exit and bam. No need to establish any conditions by gameplay.
Send me mod id and i will check how much dependencies to deal with. if its not too much i can just do that. either way ticket please as we need it for our workflows. include map name to load there etc too
Hope by arma 4 the engine is less fragile
Had this happen the other day
if (entitySource)
{
for(int nComponent, componentCount = entitySource.GetComponentCount(); nComponent < componentCount; nComponent++)
{
IEntityComponentSource componentSource = entitySource.GetComponent(nComponent);
if(componentSource.GetClassName().ToType().IsInherited(InventoryItemComponent))
{
BaseContainer attributesContainer = componentSource.GetObject("Attributes");
if (attributesContainer)
{
BaseContainer itemDisplayNameContainer = attributesContainer.GetObject("ItemDisplayName");
if (itemDisplayNameContainer)
{
string name
itemDisplayNameContainer.Get("Name", name);
TextWidget.Cast(item.FindWidget("ArsenalItemText")).SetText(name);
break;
}
}
}
}
}
String name didn't have a semi colon
IDE didn't have any errors and it worked just fine
Only reason I found it was a copilot review in our github
There should've been an error here right?
huh
Yeah I noticed this too, sometimes parser ignores missing ;
It worked completely fine too which baffled me a little
Because of new line, some of the code cases simply do not even look for the closing ; and just continue to read fine.
YEah this is from legacy enforce script
From when ; was not a thing and it was bit more like C (As in language type).
WIll report. Probably some forgotten corner case
😢 I like languages that understand that new line is new statement (like Lua with optional ; for edge cases)
hey, am software developer but total reforger scripting noob here, trying to make a mod to do something on the server, but struggling to even get my mod to initialize/do anything.
From watching one of the bootcamp vids and from looking at how some other mods do things, It seems like the following should work, simplified to a hello world here for the sake of the example.
I can't for the life of me get this print statement to run though, am I missing something super obvious?
modded class SCR_BaseGameMode
{
override void OnGameStart()
{
super.OnGameStart();
Print("hello world");
}
}
alternatively is there a better way for me to make the entrypoint to initialize my stuff?
Did you compile it? And what world you start?
alternatively is there a better way for me to make the entrypoint to initialize my stuff?
Depends on what you want, sometimes your-own component, sometimes - custom entity, modded some vanila entity/component
Did you compile it?
got to the point where i even published it and loaded the mod on a dedicated server, console output on the server seems to indicate the mod was loaded. Tested with the default everon campaign and a custom wcs-based conflict mission on of the boys is working on.
Tried changing it to inherit ArmaReforgerScripted too, assuming that would make it mission agnostic, no luck there either
then what is path to this file?
mod_folder/Scripts/<tag>_ModdedGameMode.c
then it's not compiled at all
scripts should be in scripts/<ModuleName> folders (modules you can find in project options, but for 99% cases its Game)
woohoo
thanks
been smacking my head against the table on this one for a solid hour 
is class classname : classname the same as class classname extends classname ?
yes
thanks vlad
I've been wondering why the script creater makes both TAG_ExampleClass and TAG_Example. What's the difference between the two? And do we need both?
can you not have an IEntity array as an [Attribute()]? I have a very small amount (6) of map entities that I want to have in an array but didn't really want to have to "find" them every startup
*Class is using for creation, you can define dependencies here (https://enfusionengine.com/api/redirect?to=enfusion://ScriptEditor/scripts/GameLib/generated/ScriptComponentClass.c;1)
also you can specify here through CommonEditorProps category, desc, visuals for your stuff in WB
thanks
Uh, this might be a dumb question but how to duplicate class variable/instance easily?
//I want another instance y where I copy the information from x
MapItem y = new MapItem();
y = x;
y.SetInfoText(...); //This will change (also) x```
You don't. There is no deep copy. You can assign all values manually, you can use a shallow copy method but that will share any nested complex properties. Or serialise and deserialize from e.g. JSON
Thanks. That was what I feared and I was looking smth easier.
Would a call later repeating on the client cause client sided replication stalling?
Or is that strictly an issue with the server
Having issues with mass disconnects mid session with stalling being the issue, happens like once or twice every 5 hour session and I'm pretty stumped. The only Call Laters we have left is on the client in a scripted widget.
Could the long delay be because I'm testing in Workbench?
Because, after exiting the trigger, OnDeactivate is called with quite a delay.
Hey, I noticed that if I use this:
override event bool HandleWeaponFire(CharacterInputContext pInputCtx, float pDt, int pCurrentCommandID)
{
super.HandleWeaponFire(pInputCtx, pDt, pCurrentCommandID);
it returns true as long as the character has a weapon in hand. I'm trying to find a vanilla event or method that I could use to update shared variables while the character is holding a weapon. Is HandleWeaponFire appropriate for this, or is there a more suitable method I should use?
I don't need to update the variables all the time anymore, but would still be good to know if in the future I can make use of HandleWeaponFire
does anyone know how i can edit the ability of the AI to see through disguised status? trying to help a friend run a server and cant seem to get the variables correct for one mission we want to do.
IIRC there's a component with settings for that stuff on the GameMode entity
Would this be through the Game Master or through editing the server?
Is there any event that I can use to track how many times Replication.BumpMe() is called?
Or at least some server parameter to log replication stats
How can i from IEntity find the faction of the entity? and how can i find the relation between two factions?
I have to se if the hit is friendly, im hooking into SCR_CharacterDamageManagerComponent.OnDamage
The entities have a FactionAffiliationComponent on them
Or something similar
Place a character down and look through the components on him to get the exact name of it
SCR_BaseGameModeComponent::OnPlayerKilled is a better place to do that.
Hmm not when i am looking for hits i guess
Ohh nvm. You're specifically wanting "if hit"
Yeah, i am trying to log when entity is hit, by what, who and if its a team hit.
I think it was just me using the FactionAffiliationComponent wrong.
Yeah for finding faction associated with an entity it'll be on the affiliation component, sometimes on prefabs with a hierarchy of entities the component will only be on the root entity of the prefab so you might have to traverse up some parents for some entities
For getting the relationship between factions check the faction manager, it has the config on which factions a faction considers friendly and IIRC had some kind of "is faction friendly?" check method which is probably what you're after
No
The faction manager doesn't have that information.
The faction it does
Get the "shooter" and check his faction against the owner of the components faction.
InstigatorFaction.IsFactionFriendly(OwnerFaction)
The faction manager doesn't even need to be touched
This is what i ended up doing, and works perfectly.
Next question, i want to get the weapon name is that through the UIComponent?
You might wanna make sure your functionality works correctly when someone gets hit by a vehicle before you worry about weapons.
I guess that will just result in the weaponComponent from the instigator entity is null? I got that handled
So what i did is i used the UIInfo get name, but i think there is something off about the name.
Yeah thats what i mean, i am looking at the instigator entity weaponcomponent
Characters don't have a WeaponComponent
Okay, then to be exact i am looking at the CharacterWeaponManagerComponent on the instigator entity.
Then i use GetCurrentWeapon to get the BaseWeaponComponent.
What i am asking is where do i find the weapon name, if it is not in the UIInfo
from the weapons uinfo in its item attribute collection
From the UIInfo.GetName() i get this: "#AR-Weapon_M16A2_Name"
But i think that seems weird?
I am looking for something like "M16A2", like it would be displayed in the arsenal.
Ah yeah right you are, well unless the context in question doesn't already have a reference to the faction which I guess is how I mixed that up 😂
That's the localized string of the name
Even if it doesn't you don't get it from the faction manager you get it from an affiliation component
I meant like the other faction you're checking for friendliness with the one from the affiliation component
Should usually probably be an arg passed direct to the method in most cases but I've had to get a faction from faction manager by its key in a few occasions
Then my question is how do i "unlocalize" the localized name
You don't
Search for Translate function
If you're just displaying it in UI the client should automatically substitute the #-prefixed strings with their translation for whatever language the player selected
Nice, I had looked and didn't know there was a function for that.
Shouldn't need to statically translate yourself unless you're trying to format it for logs or some other output aside from the game client
I just hope he's not wanting to do a string comparison
If displaying it ingame you probably specifically don't want to statically translate it yourself as that will prevent it translating correctly for players of other languages
*if not disabled in widget attributes
Well, i am using it for logging, 😉
Thanks for a useful answer
Hi guys I was making a custom component that controls lights and that's it more specifically lights for vehicles
I created a simple script that I want attach to my object but now I want redrences to the light entities and blink them via update call
I want si.iliar structure to baselightmanagwr
Where can I find the magazine reload script ?
I want to make a script that keeps the empty magazines and puts them back into inventory or drop on the ground instead of deleting them.
This is not controlled in script afair.
Probably on the weapon component or muzzle component
Or possibly on an animation event, but don't think so
Animation event makes empty mag disappear
So it is beyond my skill set.
Damn... oh well not a train smash.
It's just a script that goes on Animation timeline.
I have multiple mods open in WB. One of them defines #define MODNAME_IS_LOADED. Is this global? Should other mods see it?
I have a setup where the SDRC_define.c defines #define MODNAME_IS_LOADED.
In the other mod (..DefNoDep), I have simple check #ifdef MODNAME_IS_LOADED.
Why does the ..DefNoDep mod (upper) not see the define from ..DefOneDep (lower)?
Because the compilation order is given by the alphabetic order of the file paths (mod folder excluded).
anyone know how to Add Garrison to an Interactive Entity via scripts or in the Workbench somehow?
Thanks. Seems to be that mod order affects also. "Define" is alphabetically before "Helpers". To get the above to work, the folders above needs to be switched between the mods. This is atleast in WB - not sure about game.
Guys if I have a variable in my script
Bool switch
In ADM_CustomClass
I want it to be switched on using in game ActionContext like open close behaviour
How to bind them together??
Make a setter function in your CustomClass, instance your custom class in the action you're making and call the setter
Hello everyone, I’m reaching out because I’m looking for the script that manages the maximum number of constructions on a base. I would like to reduce the maximum number of constructions allowed on each base. Thank you.
@minor agate
CAREFUL.
Last time I did this, the game crashed when I only had empty magazines in my character inventory and reloaded.
Reloading empty magazine used to crash the game.
why would my extended tasks be failing to parent due to no task data? even though i do in fact, have the data
i in-fact did not haha
Hey everyone! I am new to arma reforger and enfusion and am trying to get my bearings. I wanted to make a simple script mod that would reduce the weapon sway, but I have not had any luck. When I search the ArmaReforger scripts, I see a generated script that uses BaseWeaponAimModifier() and GetCharacterWeaponSway(). Does anyone have any advice on how I can create a script to modify the returned value from GetCharacterWeaponSway() when its invoked?
Trying to get a JSON from our web api but I can't quiet seem to make it work
CRF_APICallback cb = new CRF_APICallback;
RestContext ctx = g_Game.GetRestApi().GetContext("https://api.coalitiongroup.net/");
ctx.GET(cb, "api/events/groups/eventname");
Is there anything I am doing wring?
OnSuccess does not fire neither does OnError
Is there anyone in here who would like to do me about a script I want written and if its possible willing to pay fair price
its against TOS
@coarse bane im not offering my work
It's against TOS for someone to accept payment for work within Arma/Enfusion tooling
You can pay for static assets like models, textures, sounds etc but not for stuff like scripting or workbench integration
It wouldnt be work inside the workshop i can put in the workshop myself i just need the script written
i dont see why anyone would lie about that
https://reforger.armaplatform.com/workshop-terms#:~:text=3. Uploading Content to ARMA REFORGER Workshop
Whats the best way to learn the script language then if im not able to get anyone to help
https://community.bistudio.com/wiki/Category:Arma_Reforger/Modding/Scripting/Tutorials is a good place to start, BI also has a modding bootcamp series on their YouTube channel that is a good way for beginners to familiarise themselves with workbench and scripting Reforger, definitely recommend watching at least the first few episodes then anything that seems relevant to what you're interested in
Just the script language really cause im trying make a prospector mod, I can make 3d models as thats what im good at
I've entered recursive land and I can't find a way to update an SCR_EditBoxComponent's text without triggering the OnConfirm event handler twice.
The menu opens and adds an onConfirm event handler.
The onConfirm event handler fires and then clears the text box. This is triggering the same event handler.
I tried finding the actual edit box and updating it directly but it still fires recursively..
I also tried ConfirmValue("") to clear the text and it ran the onConfirm event handler, which makes sense.
Maybe SetValue("") isn't supposed to trigger onConfirm, but it is rn 😬
Callback must be alive until answer from server is arrived, in your code it is not - it will be deleted right after executing it
Hello. Any one known how to block clothes on player (do not allow change it)? Any ideas where search it in code or mods with similar mechanics?
Do u use vanilla component. Do u use additional mods in your project or just vanilla?
Yeah there's a few mods in it. I'm using the wlib_EditBox but Idk if other mods are affecting it.
Ah okay that makes sense
Trying to parse a JSON right now and I am stumped
This is returning false everytime from this line.
SCR_JsonLoadContext ctx = new SCR_JsonLoadContext();
if (!ctx.ImportFromString(jsonStr))
return false;
m_Response = new CRF_Response();
if (!ctx.ReadValue("", m_Response))
{
Print("JSON parse failed: ");
return false;
}
This is the JSON I am trying to parse
{"success":true,"missionName":"CCO #21 - Northern Flight","eventId":"b6086bd7-86c8-4df7-ac09-8016911fc84e","groups":[],"dateTime":"2025-11-08T18:00:00.000Z","message":"Groups retrieved successfully"}
class CRF_Response
{
bool success;
string missionName;
string eventId;
ref array<ref CRF_Faction> groups = {};
}
jsonStr is the right JSON
The callback needs to be kept alive by you or else the request is cancelled
You actually do not even need to instantiate the object, the deserialization will do that for you
If you encounter issues, you can always turn on error logging for it in the diag menu under "Serialization". That will print you every detailed step and where it fails.
Ended up just switching the using JSONApiStruct instead and it worked. I could not for the life of me get it to read the root of that json with the load context
In experimental it works fine. do not use json api struct, its not meant for your use cases
I would recommend you develop you mod on experimental, we changed a lot there for serialization
Will do, and it was actually the array in the struct causing it to fail to read for some reason
On 1.4
The minute I commented out the array it read just fine
Speaking of which when do you think 1.6 will drop on stable? 👀
Depends on how experimental continues. but we are releasing it as soon as possible.
@abstract crescent Tried it out with a vanilla project. Still trying to recursively call the OnConfirm event handler..
OnMenuOpened where i add the event handler. i've confirmed the event handler insert is only called once
SCR_EditBoxComponent editBox = SCR_EditBoxComponent.GetEditBoxComponent(EDIT_BOX_COMPONENT, rootWidget);
if (editBox)
editBox.m_OnConfirm.Insert(Confirm);
else
Print("Edit Box not found", LogLevel.WARNING);
... and the event handler ...
protected void Confirm()
{
Widget rootWidget = GetRootWidget();
if (!rootWidget)
return;
SCR_EditBoxComponent editBox = SCR_EditBoxComponent.GetEditBoxComponent(EDIT_BOX_COMPONENT, rootWidget);
if (!editBox) {
Print("Edit Box not found", LogLevel.ERROR);
return;
}
string msg = editBox.GetValue();
PrintFormat("Edit Box: %1", msg);
// clear the value after sending
editBox.SetValue("");
}
its very strange, SCR_EditBoxComponent doesnt have any calls in SetValue and SetEditBoxText
can u check callstack?
who makes Invoke for m_OnConfirm?
SCRIPT : Edit Box: hi
SCRIPT (E): Virtual Machine Exception
Reason: ScriptInvoker: Recursive call of Invoke!
Class: 'SCR_EventHandlerComponent'
Function: 'Invoke'
Stack trace:
Scripts/Game/UI/Components/WidgetLibrary/SCR_EventHandlerComponent.c:52 Function OnChange
Scripts/Game/UI/Components/WidgetLibrary/SCR_EditBox/SCR_EditBoxComponent.c:353 Function SetEditBoxText
Scripts/Game/UI/Components/WidgetLibrary/SCR_EditBox/SCR_EditBoxComponent.c:512 Function SetValue
Scripts/Game/TAG_LayoutTutorialUI.c:92 Function Confirm
Scripts/Game/UI/Components/WidgetLibrary/SCR_EditBox/SCR_EditBoxComponent.c:318 Function OnConfirm
Scripts/Game/UI/Components/WidgetLibrary/SCR_EventHandlerComponent.c:52 Function OnChange
SCRIPT : Edit Box:
hmm. its srange, line 52 is m_OnChangeFinal, but its OnChange in trace
That's just the function name which is still OnChange
can u try to use m_OnChangeFinal if u need cleanup test in end of texting. OnChange calls every time u change text, m_OnChangeFinal calls in end of text print, i think
IDK how I would do that. Right now use m_OnConfirm to check when the enter key is pressed, and within that I use SetValue().
hah. i tried removing the m_onChanged event handlers and adding them back after setting the value. nope
what do u have in line 92 ?
Scripts/Game/TAG_LayoutTutorialUI.c:92 Function Confirm
I changed it since, but I'm pretty sure it's referring to this:
editBox.SetValue("");
If I don't set the value, it doesn't try to call the OnConfirm event handler recursively. But I'd like to clear the value at the end of the OnConfirm event handler..
Why you even try to delete text after input? do this after pressing some "confirm" button if you need
It's a text entry box. Press enter -> send message -> clear for the next message.
then just listen for confirm action, I think it will not be intercepted by edit
I don't know what you mean by that.
As in don't add a OnConfirm event handler and listen for the confirm event some other way?
each menu have action context assigned with it where you can specify actions, keys and etc
i don't remember how exactly it called
Like where this adds the "MenuOpen" listeners etc. ?
inputManager.AddActionListener("MenuOpen", EActionTrigger.DOWN, Close);
yes
Do do you know what the confirm action is called or where i can find it?
DialogConfirm
you can find it in actions list
ooo thank you, i'll try that
where you setup context for menu
also you can use chatcontext as example
it defines chatconfirm action same as dialogconfirm
I setup the action by just adding it to a radio's actionmanagercomponent's additional actions property
i don't see anything about dialogconfirm
where you define your menu?
Oh. I added it to chimeraMenus.conf. That part?
yes, close to it is chimereInput or something similar conf
there are two sections - actions itself and contexts, which you can assign to menu in first config
Adding ChatContext disables interaction with the menu
Action Context was empty before. I'm following this guide:
https://community.bistudio.com/wiki/Arma_Reforger:Layout_Creation
Oh it probably uses MenuContext
Eh, thought I was getting somewhere. Setting it to "DialogContext" enabled interaction again and it shows the DialogConfirm action but the event isn't firing when I added a listener for it..
@pliant ingot by gosh I've gotten somewhere.. I have to press enter twice. It seems like it has to cycle focus from the text box to the menu itself before the second enter/confirm then triggers my "Confirm" event.
If only I could attach the action listener to the editbox itself..
It depends on what you use, some context have higher priority (which is chat context for example)
So you need to properly adjust your context
How does one convert a local rotation matrix to world? 
I overrode the ChatContext with a custom one and enabled the cursor. It still lets me enter text but now pressing Enter just cycles Focus on the EditText component. I tried add listeners for ChatConfirm and ChatSendMessage
Trying to get Squad Leader markers on the map to work for my custom faction. I can see it works for vanilla factions, and I have tried to look into MapMarkerConfig and MapMarkerEntrySquadLeader, but I haven't managed to figure out just what I need to do - to make the squad leader markers appear for my custom faction. Anyone have a step guide or would be willing to guide me in the right direction? 🙂
Are you copying the components/attributes from an existing squad leader asset?
I believe I am? I started off from duplicating the US faction and have worked my way from there. So I have not really touched on the components/attributes of the existing squad leader asset. It still points to the group flags etc.
Do you mean like this? https://community.bistudio.com/wikidata/external-data/arma-reforger/ArmaReforgerScriptAPIPublic/interfaceSCR__DbgUI.html#a8dc2b315ad9b5c7bbfdac091114d3f7e Sounds like something the physics classes would have
I'm not sure. Maybe the asset ID isn't unique so it ignores your squad leader, or maybe it sees it as a non-US faction so it won't give it a US squad leader marker.
all based on potato-quality theory of course, I just got into modding so I may be off track
I tried wrestling with ChatGPT about it cause I am at a loss for what causes it, but only made me more confused. The thing is, this happens for a total of 3 custom factions that are playing together. Meanwhile Vanilla and RHS factions work as intended. So I am assuming there is a silly and likely simple reason/fix for why it is not working for our factions at all.
We do use Predefined groups only, and then a set amount of predefined groups with our desired callsigns etc. Might that be the reason squad leader markers don't show up?
Do the other squad members get a marker, if so does it show on them?
No, we do not have any mods that enable markers for squad members otherwise.
But squads in vanilla factions do.
i created a config class and it has a PointInfo m_pointInfo and Resource prefab2Spawn
i have another SystemClass which takes in Array of this config file to spawn prefab at specific posiiton my Array is not null but it says m_pointInfo is null even though i assigned it in ediotr with vector values ???
it's strong reference?
It really sounds like an issue with the new faction using an existing faction markers. Maybe they have to have their own set to that faction?
i made it work but lights are not displaying
im trying to create something like BaseLightManager
so my config file has light prefab and point info
my LightManager will flicker lights
im only stuck on 1 place which is adding the light prefab
i dont want to spawn and child it i want somethign similiar to BaseLightManager as i said
What are you trying to do exactly? Make light bars for vehicles?
"I don't want to spawn and child it". If you're not wanting static lights then that's what you have to do.
I.E. if it a light for a vehicle, it has to be a child of the vehicle otherwise when the vehicle moves the light will be stationary
im making light system for my aircrafts
the reason for childing was to keep the hiearchy clean i thought maybe enfusion has some sort of slot systems to do this
as i mentioned the BaseLightManagerComponent just ask for SCR_LightSlots which is a config file and light spanws automatically and ther is no subchild
if its not possible to do it that way just let me know how to spawn it i have the resource path and PointInfo
in my LightManager onPostInit i want to spawn thats it for now
if you dont mind may i dm you so i can give you more detailed info
Why are you trying to spawn lights at runtime though?
Why aren't you using the slot manage and attaching your lights to the vehicle like base game?
Manager*
studying the mi8 prefab theres not slot for lights in SlotManagerComp
but Rather in BaseLightManagerComp
whihc takes A list of SCR_LightSlot and they store point info and prefab of light
But it doesent have the functionality i need
so i Made my own lightManager
Oof, did they switch wheeled vehicles to that set up too?
yea
i just want to know when we assign prefab over there in basemanagerslot the light is there
so i decided instead of ADM_LightSlot i use SCR_LightSlot but light not coming for me
i think theres some sort of Logic in the BaselihgtmManager to do this
yea but in sequence
red wait white wait
repeat
im also plannign to release it as a core Airraft System so that other can use it as well
i mean not physics liek these small utilities for realsim based projects
and yea i can do the blinkign part but as i said how to get teh lights to show up idk
Use their light manager component and add your light to it. In a custom component get your light entity and handle the blinking
i was thinking of doing it but ill inherit a lot of waste
You're not
and secondly their functions are not very clear
and kind of limited
most of them are portected or private
it was my plan b btw but i was just hoping for a cleaner approach
The cleanest approach is use preexisting functionality
You can literally do what you're trying to do with a custom component and user action
ok ill try that if i cant figure out because i was really tryign to dig in and find out their implementation
I can give you a hand if you can't figure it out
i will come back to im very close to my approach and yea we have to do some spawning
the only issue is my workbench sometimes stop for long period of times while compilign scripts
This looks like Reforger 1.1 documentation, I'd check to see if there are any differences in Tools 1.6 Exp
Are there any plans to make PerceptionComponent scriptable? I want to change friend-enemy detection to be based on something other than faction so wanna override GetTargetsList or similar
Whats the best way for me to get heightmap data from the currently loaded world? SCR_MapEntity.GetMapInstance().ElevationAt(Vector(6000, 0, 6000)) doesn't seem to work (always returns 0). I see that I can pull from GetGame().GetWorld().GetSurfaceY(6000, 6000) which works but there is no way to get X / Y size (either in meters or grids and cells). Apologies if there's some documentation out there that explains this but I'm just starting to transition to enfusion.
Just guessing here, but the first option gets the information from you flat (paper) map. The second option is the right one to get height on a certain spot. What is the X/Y size you refer to?
No clue. It has BLUFOR as parent in inheriting marker styles as is detailed in faction creation guide. And from what I can see it does not differ from how it is setup in other custom factions
I have Succesfully achieved whta i wanted
here is also another link i found that may help others too
The actual terrain size limit, so I can make sure that my calls are within bounds
Try:
vector mins, maxs; GetGame().GetWorld().GetBoundBox(mins, maxs);
This is the best I have been able to use. Be aware that this is not the actual playable area, but works for most maps.
See also: #enfusion_scripting message and related discussion.
Hello everyone, I’m reaching out because I’m looking for the script that manages the maximum number of constructions on a base. I would like to reduce the maximum number of constructions allowed on each base. Thank you.
guys how to reduce wokrbench graphics its killign my gpu
Prefab > SCR_EditableEnitytComponent > Entity Budget Cost - create your own budget + Your own component on MilitaryBase for count
If the server crashes do destructors still get called on it?
Not if it's a seg fault on C++ side. Why?
Is there a way for my mod to see if any of my other mods are running? Thinking of way to make my mods so modular that they enable more menu items only if modXYZ is installed, essentially so they can all be controlled from one menu
Creating a save state for our lobby so if the server crashes we can just reload everyone into their slots and position on the server.
My current method was on the gamemode destructor writing all our data wed need to restart it
You should probably make backups from time to time.
Mabye somethink like _<mod guid>.c (just has to be named in a way that it gets compiled first) in the script root folder and have inside of it a #define, which can be checked by other mods with #ifdef
Thanks, that makes my planning much easier that way
Hi! Apologies for pinging you on this again. I've added your bandaid, and had a similar issue again, but no error logs this time: when selecting a faction, I can't create or select a group, and when I force myself in as a character, the group string is empty and broken. I've tried reloading scripts and even restarting my computer, but it just doesn't seem to refresh. Any clues? This randomly occured after adding a component to my SCR_Gamemode script, and even after removing it, the issue is not removed.
(attached screenshots of how it looks like atm)
Did manage to get one line of error code, when I tried creating a new group.
Reason: NULL pointer to instance. Variable 'm_iGroupID'
Class: 'SCR_GroupSubMenuPlayerlist'
Function: 'UpdateGroups'
Stack trace:
scripts/Game/Groups/SCR_GroupSubMenuBase.c:91 Function UpdateGroups
scripts/Game/Groups/SCR_GroupSubMenuBase.c:91 Function OnUpdate```
**Looks like the above was the culprit after all! **For all those running into similar problems in the future, I fixed with with the following code snippet.
modded class SCR_GroupsManagerComponent
{
//---
override void OnPostInit(IEntity owner)
{
// Refresh singleton to avoid stale instance across Workbench play sessions
s_Instance = this;
#ifdef WORKBENCH
Print("[NCM][Groups] Refreshed SCR_GroupsManagerComponent.s_Instance", LogLevel.DEBUG);
#endif
super.OnPostInit(owner);
}
...```
That fixed the entire issue, without tears :'D thanks again JohnnyKerner though, since you provided the first solution it helped me find this one. Hopefully, that'll be the end of it...
Did you ever get an answer on this? I was going to start looking into how to implement it
I am confused, the instance normally would not survive exiting playmode and entering it again. What exactly was your issue? Did it happen in vanilla?
No it isn't, and may have been a modded issue, my apologies for not clarifying. I've edited the group manager before, so it may be related!
Nope still no info
Im surprised to see no one talking about it or making a mod for it so I am wondering if it's impossible or the use case is so small no one has cared.
I think it would be quite useful! maybe something like hold rt click for drag a stack?
and maybe middle mouse button to split a stack
is there any way to check if helicopter rotor is intact? I guess I need somehow to get the bone and and check it's state?
Yeah, I want it for the Mosin ammo
Damage Manager, check the HitZone for it
Maybe something like this
https://github.com/EveronLife/EveronLife/blob/main/src/Scripts/Game/Feature/Quantity/EL_QuantityComponent.c
Might have to look through the scripts a bit more but this seems like its the one that deals with moving stacks of items @west prism
Im on my phone, but it looks like that is exactly what we need
just make some interesting
Is this the new Layout from the company?
Tbh I have been surprised the Reforger inventory has sucked so bad and nobody has done anything about it yet either 😂
When (if) I get time for it I was planning on making an improved inventory mod that maintains a state of the "target" inventory and add ctrl/shift/alt click modifiers to transfer all/half/X quantity of a stack to the target inventory like how it usually works in MMOs and survival games, but if someone wants to beat me to it I'll be very happy 😂
Also if we could actually see the max capacity of containers in inventory instead of guessing which backpack is bigger would be super cool 😎
God yes
Hello
I spawn a magazine prefab and parent it to a slot info,
I tried with AddChild, also tried to spawn it directly parented using EntitySpawnParams, both works perfectly in SP but in MP it spawn at the good spot, but it stay there, not parented.
Is there a vanilla example of a replicated dynamic hierarchy ?
Это не слой а работа 500 строк кода которые генерируют слой, ну и там всякие анимки понапихал и тп
sorry
Oh, I personally don't care but, the moderators might.
I just responded to him about the code's operation
Understood
No worries but, it's probably better to use english if you can.
I'd just rather not see you get "yelled at" for using your native language.
I understand that everything here is done to ensure that everyone understands each other
Looking really nice !
What about adding a sound for every new letters to give a type writer machine effect ?
As for the #AR-Campaign string, translate the string first and then process it
WidgetManager.Translate
If you need examples for both, we made something similar (way more basic) for the mini campaign mission introductions
Do anyone know why my component won’t show inside world edit for my delivery script
why does it say my action getin is obstructed???
- Failed to compile
- Wrong scripts folder, so it's not compile at all
- Not inherited from base component class
Make sure you have the *Class suffixed editor class definition for your component as well
What do you mean by that
look at the source code of any vanilla component. there will be another class with the same name but suffixed with Class and extending ScriptComponentClass or similar, I'm pretty sure you will need a matching one for your component for WB to register it as an available component
you can right-click any component in world editor and jump to its script definiton
If you still can't get it working, a pretty reliable way to do it is duplicate an existing vanilla script of a component attached to the same entity, delete/replace the contents of it and rename the classes. Doing it that way makes sure the file is in a correct location to be compiled (2. Vlad mentioned) and ensures you don't forget the "editor" component class at the top
So grab a arma script and just replace it with mine right
According to the Modding bootcamp video #2 on youtube you have to override it, like (non-correct example off my memory)-
modding myclassname : thingy { # Allows access to everything in the parent class "thingy"
override parent.thingy { # Overriding parent class "thingy"
super.thingy() # Inherit all of the parent class "thingy", else it'll overwrite the entire class
ThingToOverride { ... # What to override in the class "thingy"
Slight correction for your memory
You override methods/functions, not classes. Inherit or mod classes
and modding a class you have to use the name of what you're modding
modded class SCR_BaseGameMode : BaseGameMode
{
override void OnPlayerConnected(int playerId)
{
super.OnPlayerConnected(playerId)
Your code here
}
}
or with your own class, inherit SCR_BaseGameMode
class GSE_BaseGameMode : SCR_BaseGameMode
{
override void OnPlayerConnected(int playerId)
{
super.OnPlayerConnected(playerId)
Your code here
}
}
hej modders
i want to make an automatic door system
how can a do it
i found out that the normal doors only work with a generated script (DoorComponent.c)
how do i get the proto external vector GetDoorPivotPointWS(); pivot from my object ?
On a door, look for the ActionsManagerComponent, then find SCR_DoorUserAction(pretty sure thats the name of it) under Additional Actions. That handles happens opening/closing a door, should be able to do something with that information to make a ScriptComponent that does something like a QueryEntitiesBySphere and check for anything that IsInherited(SCR_ChimeraCharacter). Which if there is a character in range, open the door., if no character is in range, close door if it is open
Has anyone managed to get the SCR_FactionDominanceTriggerEntity to configure correctly? I can never get OnActivate to fire correctly. I'm assuming it's config.
Hello, regarding the Callqueue(), all from a custom animations component like in bootcamp 10,
I'm ejecting an ammo rounds entity from the chamber of a weapon during the rack bolt event, It has physics and then when it hit the ground I would like to delete it, I should not use CallQueue to delete the entity after it hit the ground ? Do you have any solutions or I should use a particle effect and give up on the meshes coherence ? (different type of ammo)
Actually I already use CallQueue for an another weapon but I saw your conversations here so I try to fix my potential mistakes
I'm quite simple lol I should just delete it once the animation is finished 🤣
I just found out about garbage system, that's what I should use in my case right ?
Hi all! Does anyone here know a bit more on drawing on the map using scripts? i.e, creating a circle size of X meters, depending on whatever the script wants? I've created a mobile assembly exclusion zone around military bases in Conflict, and wanted to add a circle representing the size of this. I've been able to leverage OnIconHovered to detect if the player is looking at the icon, but can't find any good way to draw a circle. Thoughts?
I'm trying to configure a new chat channel but the name isn't showing in the chat panel. I added the ScriptedChatEntity, added a new channel, set the class of the channel to a newly created inherited class from BaseChatChannel , configured the new class to appear in the chat list for the player and send to players, but it still says "Send to <name>" instead of something like "Send to Special channel".
I tried to find a .conf or something with extra configurations but I couldn't find anything. When I check the GetName() method of the chat channel it is correctly showing "Special".
Does anyone have experience creating a new chat channel?
Oh snap, I found some .conf files in Configs/Chat
Hmm, I must still need to tell it to use the newly created chat channel .conf
Well I found it. It's configured within the SCR_ChatPanel but requires a few overrides and I couldn't get it to use the .conf file but I was able to manually configure the same options within the component's settings. Progress!
Did you override the chat panel layout and add your conf to it?
Yes I eventually did that and I got it to work, but I was unable to add the actual .conf file like the other chat channels showed. I had to configure the same options directly in the layout/component options.
modded class SCR_ChatPanel : ScriptedWidgetComponent
{
[Attribute()]
ref SCR_ChatMessageStyle m_CustomChannelStyle;
}
Then override VerifyChannelStyles and GetChannelStyle adding your style to the array and switch
Good evening gents! I'm looking for any information on how I can make vanilla and modded armed vehicles spawn without ammo/rockets/missiles. If you know anything about it, please tag/ping/mention/dm me. Thank you in advance!
Yep I did that. I also had to override the ChatPanel.layout so that I could make changes to the new custom chat channel I added because it was unconfigured. None of the .conf files show in the overridden layout file either, but they're all still configured so idk.
Not sure what the issue is, when I override the layout I still see the chanel styles and just drag and dropped my own for the custom attribute that I added
damn.. I never tried dragging and dropping. that worked. thank you!
not having those click boxes on the side to choose it threw me off
Does enfusion maintain a public array of items built at bases (whether it was destroyed or still standing), or is that something I'd need to script out?
Hey, so im just trying to make a little script to change the stamina drain if you have an item attached on you, now i made the script but how do i attache it to the prefab
Hey! I have a question: how do I actually run Unit Tests?
I'm new to this and wanted to learn the scripting ropes by writing a few unit tests, and also because my idea of a mod will require me to rewrite an algorithm implementation from C to Enfusion, so I'd have a good starting point to see if my idea is feasible.
But anyway, I found the documentation for writing tests here: https://community.bistudio.com/wikidata/external-data/arma-reforger/EnfusionScriptAPIPublic/group__ScriptTestingFramework.html but I cannot, for the life of me, find anywhere where it says how I am supposed to run them 🙁
And also, whenever I'm doing Ctrl+Shift+F and look for TestBase, the only files that are found are AutotestGrid, which seems to be something completely different and... TestingFramework.c
Am I doing something wrong or are there truly no unit tests anywhere?
Just write code without bugs
My code has always been without bugs, no need for testing there. I just want to test for the algorithm correctness, obviously!
username checks out 😄
What's the best way to get all buildings on the map without adding a register component to them?
Register them through an override on a component that all buildings already have? 😅
I wanted to avoid overrides as this is for a specific thing that isn't used all the time.
I think registering them or iterating through world entity graph would be your only real options, hopefully some Enfusion guru can come along and prove me wrong 🙂
if your concern is just always registering them would hog RAM, I think if you're just storing a pointer to entity or a string (rplid or something) it shouldn't be that bad. The game is already holding the data for every world building in memory, a few more bytes per building to register them shouldn't hurt too bad
Using registering component
few more bytes
Unfortunately simple component consumes not few, but ~120 bytes (at least it's reported by worldeditor) 😢
In 1.6 this should be all possible in workbench, we had it in an internal addon in previous versions but you know ... modders can and should do tests too, so we polished it up and merged it into the base game. there is a little bug icon as a main tool in the world editor bar. it opens the test runner window
Does someone have some insight on how the faction enemies work in reforger? Does it work the same as arma 3 where if you are the same faction but your rating is >9,000 you are set as an enemy?
I’m assuming it’s not as straight shooting as addRating or joining a unit to a enemy to / friendly for group
I’m trying to replicate a FFA style where I can reliably track one’s score without having to hackily inverse the score. There’s definitely a similar behavior in reforger as attacking a certain number of friendlies has them shooting at you. Kinda like how your rating would drop for each blue on blue accident
And one last paragraph length question: since we’ve moved away from the client/server locality for the network replication would I need to communicate “rating” changes to all players or would a component allow for “automatic” replication? Not entirely sure how all that works or how it behaves yet
Just create 128 factions for each player in faction manager
Seriously? 😐 lol.
Hopefully there is a programmatic way of doing that no way im gonna hand that out
It's stupid, but it's just CtrlC/CtrlV
I’m not exactly managing a production repo here but this just spells absolute misery if anything needs changing going forward .
The workbench is extensible right I guess I could just make something to manage it for me. But wtf D:
Are there really no emitter based methods that I can use for event hooks?
I can’t complain about the docs compared to a2/a3 because those have had YEARS of maturing but I definitely gonna have to do some reading on all this.
This is great actually
*Also a GH actions compatible bundler/compiler for scenarios would be pretty neat if possible 👍
Hello. I have some question: how to properly delete entity? I try to use SCR_EntityHelper.DeleteEntityAndChildren, but entity is back after relogin and for new conections.
Delete on Authority
It was my fail. I just check and replication component was disabled. It works fine with it
Then need to delete everywhere where it was spawned
So for world editor - save info for new connections and delete on it
Cool, thanks! I'll check it out. I understand that it's on Experimental, right?
Quick question: are these ( https://github.com/BohemiaInteractive/Arma-Reforger-Script-Diff-Experimental/blob/3a80862f88c8301d08a0f7edfc888650e0af7e33/scripts/Game/Tests/TestFramework/SCR_AutotestCaseBase.c#L11 ) set in stone already or is there still a chance to give some input about these methods before they are released from experimental? (because I understand that then changing the way these work will be unlikely)
You can send us feedback via tracker with improvement ideas and we will have a look. for 1.6 this will not change, it will take many weeks to arrive even if we decided to change it today
Because I've seen that jUnit was mentioned somewhere as basis for what you have. Don't know where, but I've seen it somewhere.
I come from a Python background where unittest and pytest are based on jUnit, so that's where I'm getting my testing knowlegde from, mostly.
What pains me with the current tests is that you have to do the assertion yourself, set the result yourself AND stop the test yourself (which is a lot of code for each separate assertion). The AssertTrue helper function linked above helps with that already, but I'd love it to be consistent with other testing frameworks, where failing an assertion automatically fails the test, so that you don't have to have an if and a return.
It would make much more sense for assert<Whatever> to internally throw a custom exception on failure and the harness to catch it, instead of relying on the test return value. Once the first assertion fails, there is little point in carrying on with the test anyway, and this would make the tests much simpler to write.
Is there a point in suggesting such a change via the tracker or does that look like too late for that?
We do not have exceptions and return true false on the tests has a different meaning with async waiting for integration testing over multiple frames. but some ultility to set false if not matched can surely be added
Sadly we can not abort easily so you still need the if (!assert(x)) return; lines
Is there any way to change how fast/slow a character walks or runs?
I was hoping I could find a script for it with some sort of speed multiplier but I can't find anything
some ultility to set false if not matched can surely be added
I mean, that's precisely what assertTrue in SCR_AutotestCaseBase linked above is already doing (which is great 🙂 ).
We do not have exceptions and return true false on the tests has a different meaning with async waiting for integration testing over multiple frames
I'll take a peak at the code later, since all I can do while at work is look at what's on github.
The question is whether you have tests that actually do anything meaningful after failing the assertion. Because if you want to test a different thing after the first assertion has failed, then AFAIK you're supposed to create a different tests for that (especially since you're already failing the current test anyway).
As such, the runner could check for a true/false return value from those tests over multiple frames, but also run them in a try/catch TestAssertionFailed block that would assume a true was returned (because the test failed and the code raising the exception already set the test result)
Anyway, good to see that the unit test framework is being worked on 🙂
As i said we have no exception handling in the language, and the return values are already used to determine if a test should continue to be checked next frame or not, so it is not possible to change it to return true/false early means success and stops the test. we would need to change behavior to stop attempting once a result has been set, that is perhaps a possiblity. either way you probably will never get the same behavior, names and flow as in other testing frameworks. we took inspiration but nothing is following any "standard", not that there would be one for testing. to many opinions, it starts with the naming pattern of them already
All I can find is this in the Character_Base.et but the SCR_CharacterCommandHandlerComponent doesn't really deal with those values at all
As i said we have no exception handling in the language
Oh I'm sorry, I completely missed that 🤦♂️
Yet, hopefully
Hey, is it possible to retreive de reload animation tag id from the weapon animation component ? Without having to bind it ?
proto external bool IsAnimationTag(AnimationTagID animTagID); ~~I'm having a hard time understanding if the ID could just be the raw name of the tag "TagWeaponReload" ~~
Those are the right values but from my testing long ago it doesnt seem to change the animation speed so it will look funny
But in script there is something dynamicspeed etc. that is used in damage manager for example to limit speed when leg is injured. Maybe check that one out
Thanks!
Yeah I modified the run speed and the character is jogging at 200km/h 😅
While I would love that feature to be added, I wouldn't hold my breath for that, since adding exceptions would be exceptionally 😏 hard, with all the winding and unwinding of the stack that's required, and all the time it already took to stabilize the current language (from what I've read 2 years ago).
However SQF had try/catch functionality 🤔 🤔 🤔 . Okay, crossing my fingers for that and hoping for the best.
Porting C/C++ code is sure going to be challenging, for now. C++ has exceptions so the control flow would have to be completely rewritten to account for that. C does not have exceptions... but sometimes heavily relies on gotos for memory management (if(failure) goto DeallocateAllAndExit;), and those we do not want here 😅
VMEs are already thrown when you pass null to a function that says notnull
You just cant use it yourself
The VM knows when it's going to throw an exception, so I don't see how it would be a lot of work
Similarly it could know when it enters a try catch, the same way it knows when it enters an if statement
Then an exception happens, and it knows it's inside a try catch
Extremely simplified lol
Hmm... I dunno. What you're saying makes sense, but I seem to recall reading about exception handling somewhere and the article was making it look extremely complicated.
It was focusing on the DWARF format, though, so maybe it was not the exception handling mechanism that was hard but the format itself? (which would not be applicable here). The article was by Gynvael and was for the Programista magazine, so I don't know if it's available for free
Huh, it turns out that it actually is available, from the author's blog (https://gynvael.coldwind.pl/?id=695). Direct link here, but it's Polish only (sorry, everyone else): https://docs.google.com/document/d/1nMC3mIDCyzsDBSHzNhpqmH2arBOdPQ25SrbbOZC_Wb0/edit?usp=sharing
EDIT: ah! It's about Zero Cost Exceptions! That's probably why it's that complicated. Nonzero Cost Exceptions could be simpler to implement, most probably
Is this safe to use OnProcessAnimOutput to delete an entity once an animation tag is false ? OnProcessAnimOutput tick every frame as long as the weapon is in the hands of a character. I would need to do something like this
override protected bool OnProcessAnimOutput(IEntity owner, float ts)
{
if (m_SpawnedAmmoEntity)
{
if (!IsAnimationTag(m_iTagWeaponReload))
{
Cleanup();
}
}
return false;
}
quick question about enforce script, is the syntax closer to C# or C++ in similarity?
C#
What's the statement if I want to get the player count of the faction for the in-game notification and active AI count in the different faction?
is there a vanilla radio that isnt a handheld that you can speak through?
like a entity i can place somewhere
Like a stationary one? Check out the prefabs for relays, they have a radio box which I think is just set up for Conflict network stuff but you could probably give it radio-like VON capabilities by copying components from a backpack or pocket voice radio and adding a custom action to activate it by interacting instead of hotkey
Conflict HQ tents have a static radio prefab. Im sure you could override it to add actual functionality to it. I used that to add an action for the character identity selection mod. Shows up in every cap point's hq tent.
hi, i get an error about "Missing Entity Class" when validating?
What's the way to get the actual map size on dedicated server. I want a way to dynamically get the map size. some maps have nothing at their cutoff edge but have skybox objects that increase world bounds
This returns is bigger then the actual map. Everon returns 14443.8 x 12900
GetGame().GetWorldEntity().GetWorldBounds(min, max);
This doesn't work on a dedicated server
SCR_MapEntity mapEntity = SCR_MapEntity.GetMapInstance();
Print("X: " + mapEntity.GetMapSizeX());
Print("Y: " + mapEntity.GetMapSizeY());
I see few searches say to do traces but, theres gotta be a better way? Reading config or somthing
Config or prefab reading might be the only way in production
A lot of the map tools are only available on workbench, probably because of dangerous methods. Now map entity should work which is strange why it might not be
map entity works on the client not the server. this script runs before any clients join, and is ideal
Yeah, guess the question is the purpose. But you should be able to get the map entity from the map entity prefab, maybe.
why d oes workbench freezez sometimes?? hangs my whole computer i have to power it off by switch
What CPU do you have? I had to modify launch settings to limit cores
-jobsysLongWorkerCount 7 -jobsysShortWorkerCount 14