#enfusion_scripting
1 messages · Page 16 of 1
are you familiar with unity3d ?
Down to internals
ive seen images of the editor, i am curious, how close it is to unitiy3d's approach ?
you tie scripts to objects ?
Learn it from scratch
so, nothing like unity then
I mean you can
But we do not use it as its a mess compared to systems and such
Specially for modding
We have something similar to ECS too
unity's approach is that you use the scripting to directly access the behaviour of the gameobject
the loop of any script is still determined by unity's main engine
just trying to understand whats different
But itd more fleshed out in current enf (AR is not on latest atm)
Learn the engine by scratch tbh
Otherwise you will have issues getting things
Its not really based from other engines
What is there has been added based on needs of the projects while development
If you want quick jump start
Watch the modding bootcamps in youtube from ArmaPlatform
Also, its nothing like dayz
script or gameobject wise?
does this/will this come with civilian assets (cloths/food)
because this channel is about arma right? just military stuff?
There are civilian assets in AR
You can mod whatever you want
It does not have to be even on theme of the game
whats AR
arma reforger?
oh lol ok
If someone tells ypu that ypu cantthen ignore them
i see, thats what i was told last time i asked in here... thats a shame 🙁
What is a shame?
I am confused hehe
that this person told me something different, so i was no longer interested in this discord
that person said no civilian stuff
Ah, well you can add ehat you please into AR
But
Do not use this chat for dayz scripting questions
As this discord channel is for AR
fair enough
i am interested in learning AR but, if its not fully supported with docs etc then it will be quite hard for me... i just don't do well with learning curves 🙂
Ignore him
Check the modding bootcamps in youtube
On Arma Platform channel
There is a dozen going over multiple aspects of engine and game
IP issues aside, there are actually less restrictions on non military related things
cool, ill check those out, thanks MarioE
Also always feel welcomed to ask anything in the proper channels
well obviously i am a big DayZ fan... arma is too militaristic for me...
Beware that you cant use dayz stuff in here.
#ip_rights_violations message
so what does that mean, you're not allowed to turn this game into a zombie survival mod?
You are not allowed to make it dayz
You can make your own zombie survival. Just dont copy or use dayz
fair enough... i can understand you dont want a fully ported dayz when you might want to release your own lol
I don't know any other ways to justify this anymore from BI's perspective, but I think BI is sitting on top of huge pile of revenue that would come from supporting (civilian) roleplaying stuff especially before new GTA arrives and even after that if it turns out to be a buggy mess
(Speaking of the civilian stuff)
well as i hinted, everyone is waiting for the "next dayz -engine" maybe thats why
Were you the one that told him no civ stuff?
(?) Nope, I tried to emphasize that I'd love to see more of civ stuff
no that wasnt him, i was in here years ago asking questions (sorry should have clarified)
so i quickly skipped through the bootcamp #1 and the scripting section... is that the same editor used by the workbench?
Everything is in wb
WB here is way better than dz's
Although it still has bugs
reason i am asking is because there is no UI font scaler... in dayz's editor... i need a magnifying glass to read any of it
It bugged out in some of the vids too
We decided to keep those scenes to show a bit of truth of some of the issues modders can still face when developing their features
And how to sort it in some cases
ctrl + scroll will let you adjust code text size
yeah, tried that, but has no effect
i can't use the WB editor, i have been using vs code and command line instead
Some things will not scale well as in your screenshot
Do what TIl told you
i cant read the UI lol
this is max zoom with coding, so assume that then think of how small the rest of the UI is 🙂
(and this image is larger because its stretched by discord)
i am assuming the AR workbench will be the same?
There is a bit more support to windows scale in AR WB
ok
when I spawn an item which can be equipped in the hand slot using InventoryStorageManagerComponent.TrySpawnPrefabToStorage, the item gets properly equipped, but it does not appear visually in hand unless moved out & in to the slot. is there some specific hack I can do to refresh it?
Hello, is there any way to block the construction of a helipad? Since I have made a map focused on infantry and I only want vehicles, not helicopters. Thank you.
IEntity::Update
I'm absolutely stumped, I've done everything I can to prevent memory spikes from my mod but it's happening without my mod even having a drone placed or anywhere on the server
A server restarts and it happens immediately without any drones being on the map, nothing in the arsenals so I'm so confused
no effect unfortunately. or does it have to happen after some delay?
You're just trying to force someone to hold something in their hand?
I want to spawn a prefab into the character inventory (preferably equip, if it's equippable). it happens to be an item which is configured for the hand slot, in which case I want it to properly appear in it.
TrySpawnPrefabToStorage works fine for all cases so far, with the exception of that visual appearance in the hand slot
I'd say that TrySpawnPrefabToStorage is expecting a virtual inventory and not a "Storage" that requires the model to be visible.
The way I do it is with handcuffs is CharacterControllerComponent::TakeGadgetInLeftHand
This is 100% getting called when you then take the item back into your hand as you described above.
sounds good, I should be able to detect after the fact that the item has been stored in the hand slot and then (re)attach it this way. thanks!
Just use a custom InventoryOperationCallback
If its in the hand slot though you'll probably have to force drop it, then pick it up.
You may be able to get the inventory item component and set it to visible tbh
is there a way to compile my mod on headless setup (ie cli)?
wdym by compile?
Like write some script source in my editor of choice and then I can invoke some cli tool to build/compile/whatever its doing in workbench
for what? without a running workbench it's useless, and with it - just open the script editor and press shift + f7
If you want to pack addon - use -packAddon argument
For validating scripts - specify to run script module through arguments and -validate
hej modders i have a question
i get always this if i start workbench
How are we meant to get the radios of other players
SCR_GadgetManagerComponent gadgetManager = SCR_GadgetManagerComponent.GetGadgetManager(entity);
ref array<SCR_GadgetComponent> gadgets = gadgetManager.GetGadgetsByType(EGadgetType.RADIO);
This gives me nothing
GetItems and GetAllItems from SCR_InventoryStorageManagerComponent also give me nothing
He definitely has a radio in his inventory
All this works when I am calling it locally on myself but whenever I try it on another player it does not get the other players radios
ChimeraWorld world = GetGame().GetWorld();
world.GetRadioManager().GetTransceiversInRange(SCR_PlayerController.GetLocalControlledEntity().GetOrigin(), 10, radios);
and this just crashes my game
: ))))))
SCR_InventoryStorageManagerComponent invMgr = SCR_InventoryStorageManagerComponent.Cast(
charEnt.FindComponent(SCR_InventoryStorageManagerComponent)
);
if (!invMgr) return null;
array<IEntity> found = {};
array<typename> comps = { BaseRadioComponent };
invMgr.FindItemsWithComponents(found, comps, EStoragePurpose.PURPOSE_ANY);
maybe something like this? Definitely not efficient but it works
Are you trying to do this on client?
It should work on client but I’m not sure
As in the radio entity does not appear at all
Like it's not tracked with the inventory of another client
This works fine if it's called on the entity the client is controlling
Any other entities besides itself it does not find any of the radios
And just the radios
Ah I see
For some reason radios in the inventory of other players are not within our replication bubbles

Stop trying to do your handlings on clients. Really don't understand why you still insist doing it that way.
I'm opening up a UI that needs to see what frequency the other players radio is on. No real way I can open a ui on the server and show it to the player.
Yes, but the data should be compiled by the server, not the client.
Basically, client should do request and server sends the data back so you can create the UI afterwards.
How do I send data from the server to the client
Rpcs dont give back values
Oh I guess I could broadcast owner
Yeah, owner RPC that opens the UI with the given data.
That's smart, appreciate it
Still kind of silly that radios and radios only are not replicated in an inventory
You will always get burned by replicated entities outside of your replication bubble not existing. Only the server has knowledge of everything all the time.
No but this radio is right next to me
Like its an action on another player
It should be in my bubble
This isn't a bubble issue this is the radio does not exist on the client
Well I guess it is but it shouldn't be
Yeah, some replicated entities don't have proxies to begin with (i.e. never exist on other clients). Though the only one I was aware of so far are player controllers.
One of the reasons I'm hoping we'll get world controllers sooner than later, as you have the option to have proxies on all clients for stuff like RplProps.
What if we had a flag\option inside EntitySpawnParams to avoid spawning prefab magazines? I get that "magazines" are way too specific for a broad term like "entity", but I don't know where else would be better.
One option I always wanted in RV is spawning a vehicle without inventory items and I also would find a use for it here in Enfusion.
What's wrong with gamemode? it have proxies on all clients, and you can't play without it normally
Definetly not on those params, that is way too specific for it. But I can imagine adding a static flag somewhere for inventory to avoid spawning cargo type attachments. i have to see how to solve it, as e.g. a modular vehicle with some slots still wants those to be addded, but not the cargo inside some compartment.
Its a hack done on an entity
Makes no sense the gamemode is an entity within the physical worldx that has transforms and many other things
- plethora of other complications because of it being an entity on engine.
Assume. At all times that nothing is replicated unless needed
Replicating entities and components all the time to users that do not need it is mega wasteful
And leads to explosion on bandwith usage + performance issues as that has to be processed as well
Also as kex said, stop doing rpl auth stuff on client
Do it on server, it will be better overall. And safer against hackers and cheaters
It will also make yout life easier
anyway @desert escarp, may the enfusion god of suffering and despair be gentle on you.
The VoN and related are quite hard coded, and non controllable so you will have many issues.
Yeah I gave up on that bs pretty quickly
Also talking about states that are per player like their position for map markers or positions they ping or whatever.
hopefully all the people having trouble with VON modding will
help reforger 2 get better VON with more modding and scripting support
👋
Hello, i was wondering, what would be the best way to hide / show the RIS rail on my gun. That would depend on if the RIS optics slot would be occupied.
I tried to look into the scripting for this but havent figured out what would be the best approach, have it in one .xob, or separate mesh? Please help.
Would love to use Cutscene for a singleplayer mission im building - but stupid Q, how do one use this (if Im not big on scripting) 
@minor agate Is it possible to use this https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~core:scripts/Core/generated/System/PixelRawData.c PixelRawData to set texture pixels from script, or only to read?
Could you elaborate?
Say I generate an image pixel by pixel, can I write those pixels into a texture that's used in a material?
Only on render target as texture, but that wil be quite expensive. In that case you would also better do a CanvasWidget for the texture
IF you want to use it otherwise, you would have to create a texture, save it to disk and use it.
Which is only possible on PC afaik, and quite slow
slow is ok, but PC only 😦 I have some fun thing in Unreal generates pretty skyboxes for a procedural galaxy, thought it would be fun to try same in Reforger
Could be done with the render target as texture with canvas widget
That would work on all, and is faster than creating image to disk and reading it
It's pretty simple.
- Take the name of your scene entity and put it into the attribute input called "Entity Name".
- After you set up the trigger activation type,
- and class filter,
it should play once a character enters the sphere
If you don't know how to make a cutscene, look up "ARMA REFORGER CINEMATIC TUTORIAL FULL (2025)" by CebCine.
If you're completely new to scripting.... it might be easier if you just pm'd me
If you want to know what good cinematics look like, check out the mod "Rookie" by Sarge studios. They use the Scenario frame work to get their cutscenes working.
Hey, is there any way to detect any decal textures applied to the player model through scripts?
(lets say a player was very close to a explosion and the explosion texture gets applied to the player, how would one detect this/remove this?)
this clip shows it, at a bit past the 4second mark a invisible player is given a black sooty texture due to them being too close to a explosion
https://www.youtube.com/clip/Ugkxc2nNgK_sYq2LWyETDhnIpE-C_A1ECppB
How is the seating position for a turret determined?
anyone know where/how to find the scripts that calls these functions when right clicking on actionsmanager?
SCR_BaseCompartmentManagerComponent on the turret prefab.
Never hurts to search up the string itself to see if it's hard coded in somewhere, or parts of the string
Is there a way to implement this pattern in enfusion script (not using enums)?
https://refactoring.guru/design-patterns/state
I usggest you avoid this pattern in code in general (outside of enforce script too)
But yeah you can
why avoid?
Its generally super bad for performance
You see it more common in UI web frameworks ngl
But for games, or anywhere where performance matters. It causes insane indirection
But yes, it is possible to do this pattern in enforce script
how we can check if player or AI is not death
m_CharacterController = SCR_CharacterControllerComponent.Cast(pOccupant.FindComponent(CharacterControllerComponent));
if (m_CharacterController && m_CharacterController.!IsDead())
{
do something
return;
}
i noticed ! .isDead() is not allowed
a i found it if (m_CharacterController && !m_CharacterController.IsDead())
whats a good way to manage state without switch-case-enum hell?
need help with enfusion / RHS
im trying to make thermal works with ads. when “use thermal” is ticked you cant ads with any weapon at all. how can i modify that and or where and what do i change to make thermal compatible with ads
Those use a library which does the hell, Enfusion doesn’t do that much hand holding for stuff like this, what is desired outcome?
Main issue is developing thinking of state
Rather than the behaviors driving instances to those states
hey @minor agate o/
can you confirm that those will be properly GC when the chimera gets GC
// --- Register vehicle compartment event handlers
SCR_ChimeraCharacter chimeraPlayer = SCR_ChimeraCharacter.Cast(entity);
SCR_CompartmentAccessComponent baseCompartmentAccessComp = SCR_CompartmentAccessComponent.Cast(chimeraPlayer.FindComponent(SCR_CompartmentAccessComponent));
baseCompartmentAccessComp.GetOnCompartmentLeft().Insert(OnCompartmentLeft);
baseCompartmentAccessComp.GetOnCompartmentEntered().Insert(OnCompartmentEntered);
baseCompartmentAccessComp.GetOnPlayerCompartmentEnter().Insert(OnPlayerEnterCompartment);
baseCompartmentAccessComp.GetOnPlayerCompartmentExit().Insert(OnPlayerExitCompartment);
but those wont ?
EventHandlerManagerComponent eventHandlerManager = EventHandlerManagerComponent.Cast(entity.FindComponent(EventHandlerManagerComponent));
if (eventHandlerManager)
{
eventHandlerManager.RegisterScriptHandler("OnProjectileShot", this, OnProjectileShot);
eventHandlerManager.RegisterScriptHandler("OnGrenadeThrown", this, OnGrenadeThrown);
}
Random q but I recall watching a video that described enfusion's task system and how it figures out dependencies between components (like particle effects depending on another effect system). Does anyone happen to know the video I'm thinking of?
Don't bother, the task system has had a complete rework as of 1.5 experimental. Still waiting for the docs!
nah it wasn't anything deeply technical / tutorial-oriented, more about how the engine has modernized in general
how would i go about editing the values in the m_aNameOfObjectsToSpawnOnActivation array using the world editor api?
this causes an error
array<ref ContainerIdPathEntry> fin0_spawn0 = CreateContainerPath("m_aActionsOnFinished[0]/m_aActions[0]/m_aNameOfObjectsToSpawnOnActivation");
api.SetVariableValue(comp, fin0_spawn0, "0", string.Format("Air_Art_%1", taskIndex));
WORLD (E): SetVariableValue - Property called: m_aNameOfObjectsToSpawnOnActivation is not OBJECT type
i can do this
array<ref ContainerIdPathEntry> fin0_spawn0 = CreateContainerPath("m_aActionsOnFinished[0]/m_aActions[0]");
string spawnList = string.Format("\"Air_Art_%1\" \"Defend_TaskArea_%1\"", taskIndex);
api.SetVariableValue(comp, fin0_spawn0, "m_aNameOfObjectsToSpawnOnActivation", spawnList);
but that puts the "list" in the first entry/sets the array to only one entry
so i guess my question is if theres a way to properly represent those arrays in a string?
i just needed a comma and no extra quotes 
I just saw you mentioned the task system, and I had a mod that pretty much had to be completely rewritten for the 1.5 task system.
is it possible to rename a project if I already published to workshop previous versions
Hello,
someone have a tips for me for how i can add a cooldown inside an object in Arsenal ?
Adding cooldown for vehicle are easy but for object in arsenal it's a bit complicated
I’d like to ask about conf files in Arma Reforger Workbench. Is it possible to use multiple inheritance within a single conf file?
Hey, every time i reload Scripts in EXP 1.5, i got the following Error:
SCRIPT (E): Leaked 'OneHandAimModifier' script instance (25x)!
SCRIPT (E): ==== Total Leaks (25x)! ====
Hello!
Please, help me.
I have a code that should trigger the greeting sound on the character if you use this action.
In single player mode - it works. In Multiplayer on a dedicated server it does not work.
I get this error -
15:01:51.053 WORLD : UpdateEntities
15:01:51.053 RPL : rpl::Pip::ProcessNetToGame
15:01:51.053 SCRIPT : soundManagerEntity not found
//------------------------------------------------------------------------------------------------
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
{
SCR_SoundManagerEntity soundManagerEntity = GetGame().GetSoundManagerEntity();
if(!soundManagerEntity)
{
Print("soundManagerEntity not found");
return;
}
vector mat[4];
mat[3] = GetOwner().GetOrigin();
SCR_AudioSource audioSource = soundManagerEntity.CreateAudioSource(GetOwner(), m_AudioHello);
if (!audioSource)
{
Print("audioSource not found");
return;
}
soundManagerEntity.PlayAudioSource(audioSource, mat);};
in class SCR_PlayInstrument
I do not understand what the difference is with the same
//------------------------------------------------------------------------------------------------
override void OnActionStart(IEntity pUserEntity)
{
if (s_onInstrumentPlayed)
s_onInstrumentPlayed.Invoke(GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(pUserEntity), m_eInstrumentType);SCR_SoundManagerEntity soundManagerEntity = GetGame().GetSoundManagerEntity(); if (!soundManagerEntity) return; if (!m_AudioSourceConfiguration || !m_AudioSourceConfiguration.IsValid()) return; SCR_AudioSource audioSource = soundManagerEntity.CreateAudioSource(GetOwner(), m_AudioSourceConfiguration); if (!audioSource) return; vector mat[4]; IEntity owner = GetOwner(); owner.GetTransform(mat); mat[3] = owner.CoordToParent(m_vSoundOffset); AudioSystem.TerminateSound(m_AudioHandle); soundManagerEntity.PlayAudioSource(audioSource, mat); m_AudioHandle = audioSource.m_AudioHandle; }
SCR_SoundManagerEntity will no longer exists in Reforger 1.5. You can use SCR_CommunicationSoundComponent on the Character and RPL the event
Pretty sure that error only pops up if you have the world editor open
There is no multiple inheritance at all. Prefer to use composition.
why wasnt this in the patch notes? 
This is also new:
/*!
SCR_SoundManagerModule is created for playing simple one-shot sounds without need of SoundComponent on given entity.
SCR_SoundManagerModule is not present on console app.
If functions in SCR_SoundManagerModule are enough for given sound, prioritize it befor adding SoundComponent on the entity.
If entity already has SoundComponent because of some other sound, do not use SCR_SoundManagerModule.
Do not use SCR_SoundManagerModule for UI sounds.
Do not use SCR_SoundManagerModule for managing looped sounds. Looped sounds always need SoundComponent to work properly
Signals for given sound can be set only before the playback and is not possible to update them during the sound playback.
*/

Hey guys, need help...I have made predefined groups in my faction for my server, but people can rename those in game or when they left that team, the name of the predefined group and its description dissaphered...And also I have still callsign Atlas Red 1 etc. which I would like to delete or change...because in the radio settings its not showing the name of the group, but callsign from ArmA, which is Atlas Red...and I dont know how to change it.
Ping me with anwers, thank you
Are you sure the entire faction config is set up correctly?
IIRC there is another layer there but could be wrong.
How can I register a system? Docs say to specify GetSystemPoint to my need but can't seem to find how/where to use that
Override Configs/Systems/ChimeraSystemsConfig.conf
Thank you ❤️
You may have to restart the WB afterwards if reloading scripts doesn't do it.
bet
Does anyone have any resources on how I can setup a dedicated test server with custom mods without needing to upload them?
Pretty sure this is covered in the replication bootcamp video series on YT
https://youtu.be/asWxIIHT6d0?si=N7kfcalOs-SUpsLu
It's either this one or the advanced one which is next in the playlist
https://community.bistudio.com/wiki/Arma_Reforger:Multiplayer_Scripting
This Modding Boot Camp seminar was originally held on the Arma Discord Server on January 23rd, 2025.
In this session, we explore the fundamentals of replication within the Enfusion Engine, highlighting key concepts and common challenges. Through detailed examples and clear...
I'll have a look through that, thanks!
I hope so, I was following those tutorials from Bohemia, some on the YouTube and just been trying to setup it just right, but been stuck with this
I wanted to make a component to make be able to switch power transfer to axles so you can make vehicles have 4wd and 2wd, maybe difflock too but focuse now is the torque share parameters here that gives powers to the wheels. However ive tried a couple of approaches to do this with no luck.
So does anyone know how to access differential TorqueShare parameters through VehicleWheeledSimulation scripting? Or alternative methods to achive this?
Just a small heads up, while this config still says which systems are active (and there will be more specifics configs inheriting from it in 1.6 btw), in the near future the rest of the configuration regarding server/client and system points will be removed. what matters is defined via code in the systems initinfo method. you will get a warning in console if they mismatch.
Hey, how expensive is it to have the Hierachy component to an entity with ~100 children entity to it ?
The reason why I 'need' it is that this "outpost" is spawned in via Script and despawned later on, unless there is a better way to do it that i am not aware of...
Thanks in advance !
might be a frame and networking hiccup if you spawn them all in 1 frame but otherwise should be fine
we do spawn this outpost all at once. it's just a "pretty big prefab"
Knowing that only one of these prefab and it'll respawn every ~20-40 ish minutes do you think it'll be a pretty huge deal or not ?
And the fact that players will most likely be decently far away from this prefab at the time of the spawn will it help reduce this potential lag spike ?
I mean you could test it
from a "visual" observation it feels like the prefab do not spawn all at once
feels like it's taking ~100-200ms to spawn(in the workbench) and that there is some kind of queuing. i wonder if the replication takes care of splitting the spawn to not overload the network.
(could just be my slow ass laptop struggling to load it all at once)
Is there a proper way to make the AI spawn above this terrain ?
Regardless of if i add some height to the spawn param or snap it to geometry they seem to always spawn below that "fake terrain".. like as their pos is snapped to the actual terrain after they spawn.
vector newPos = vector.Zero;
array<IEntity> excludedEntities = {};
SCR_TerrainHelper.SnapToGeometry(newPos, m_vPosition, excludedEntities);
EntitySpawnParams spawnParams = new EntitySpawnParams();
spawnParams.TransformMode = ETransformMode.WORLD;
vector mat[4];
Math3D.MatrixIdentity4(mat);
mat[3] = newPos;
spawnParams.Transform = mat;
IEntity aiGroupEntity = GetGame().SpawnEntityPrefab(prefabResource, GetGame().GetWorld(), spawnParams);
(last pic is the position of m_vPosition which is already above the spawn location of the prefab)
There's an option on the group that dictates whether or not they snap to terrain height
Never found a solution via script to ignore it. Option is enabled by default on all groups as far as I could tell when I ran into the issue.
Ok. That’s really useful to know. Thanks a lot
Hey, what is the correct way to get the playerIdent in EXP 1.5?
string playerUID = BackendAuthenticatorApi.GetIdentityId();
string playerUID = GetGame().GetBackendApi().GetPlayerIdentityId(playerId);
__
[Obsolete()]
proto external string GetPlayerIdentityId(int iPlayerId);
What should we use now on Master/Server side?
BackendAuthenticatorApi = Client only
Even though it's marked as obsolete in 1.5, the old way still works for now.
But yeah that's the kind of info that is essential for modders, would be nice to get docs before experimental is pushed to stable. Otherwise how are we to get our mods ready, which is the point of making experimental available to modders. 
They may mark it later when its set to deprecated on what to use.
At least that's what they've done with previously deprecated functions.
They didn't do that with the task system because it got a complete rewrite, that took me almost two weeks to figure out how to do what I needed to. I was told to wait for the docs, which still are not available almost a month later.
Yeah, it's frustrating. Point being, docs for modders in experimental to help them get their mods ready would be a huge help. If the identity id getter does in fact become obsolete, it's going to break a lot of mods. So I hope someone does answer r34p3rs question above.
Afternoon
please could someone help me how do I script this into a component I just need a dropdown menu with the add and minus feature.
I dont know what this is called.
[Attribute("", UIWidgets.Auto)]
protected array<int> m_aMyListOfInts;
Don't forget the ref 👀
Forgetting that ref has led to an embarrassing amount of hours debugging
I think this is because replacement is not yet done in actual experimental, will be done later
Is a ref needed for when the array is just ints? 
ty
yes
array is an object that needs to keep referenced somewhere
Many Thanks !!!! What about a ref, I'm new to scripting ?
If you read above you should add ref to it so protected ref array<int> asdfgdfhsg;
Any ideas to debug why the GM menu (EditorMenuUI) is randomly closing in multiplayer? I tried adding Debug.DumpStack() all over the place and it didn't help
Ah got you.
Thanks Tonic !
Essentially don't use ref until workbench yells at you that it's missing
Use ref until WB tells you not to use it, or until you understand where and when to use it, otherwise you'll be f*cked by debugging
And that'd be any array, map or Json class being made/referenced at the top level of a class? I just write until it tells me to add it for the most part and haven't went wrong so far
pull a bacon and ref the ref
I'm not allowed to talk about scripting anymore

I'll always use you as a ref don't worry
|| be worried ||
Printing EntityID on linux dedicated server gives me weird result like 0x0x40000000000049d8.
In workbench or when running via windows dedicated server tool in AR Tools, it gives me correct string like 0x40000000000049d8.
What's wrong?
Already reported: https://feedback.bistudio.com/T188436
Ah, thanks
It's even worse than I thought
What are you trying to use it for?
If its for identifying entities from server and client then dont. It will not be deterministic there regardless of OS environment
Yo
What formats are Reforger's PlayerId's in?
And are they unique to each player
I assume it changes between PS, Xbox and PC users
Depends on what kind of entity you are dealing with. For map entities, it's fine #enfusion_scripting message
It's not just "always use ref for type X", sometimes you need to use ref, sometimes it will be better to not use ref (and even use Class instead of Managed). But while you don't understand when and where to do this - use ref (if type allows it) and your reference will never be null at random (for newbie) moment.
I see few peoples who don't understand it and ask me what the hell is going on and in most cases answer was "missing ref"
I'll assume no-one knows, cause Google sure af doesn't lol
Like what? You can see that the return type is integer
The server just gives each player an index. Not that complicated.
Noooo, I mean the uid
Not server one
I can only test with PC is the issue
So I don't know if xbox or ps have different uid structures
Don't think so. Pretty sure Overthrow uses player UIDs for storing player related data.
Cool
Cheers guv
Making a web interface for stuff so needed to check I can rely on the uid easily
They are just stored as string from what I remember.
Logging projectiles server-side, I use it to collect multiple hits by same bullet and detect ricochets/shots through objects
Known a long time, I will check with guys when it will be fixed
How to change object color without creating a new material, for example for a Backpack?
They're the same on all platforms, if they weren't they'd have a seriously hard time with their own stuff. They're unique to the "account" playing so on PC it's the steam account or whatever other platform its on, on consoles i'm not fully sure how that works but for the most part its tied to the XBL/PSN account but they have sub-accounts or something that cause it to change..?
Yee my lack of understanding of it is truly why I don't use it until workbench tells me to
Cool, cheers Tonic, thought that would be the case, but you never know haha
Was confident with the PC uid but not consoles
They're the same on all platforms except for when you download a spoofer on PC
It depends, seems like every account is assigned one by bohemia, unless of course you link two accounts to one bohemia account (like xbox and steam), in which those identities irrevocably merge together, even if you unlink and link to different bohemia accounts
Unless you print it, it should work fine
Ok so runtime ents
These will be non deterministic
So they might not match on client vs server
But if you care about only server, then it should be fine
It's ok, i use it only on server. Just want to compare damageSource's entity IDs when OnEffect fires
Yeah i always warn because people try to use it for both all the time then run into issues
You can also tun into issues when using loadtime map entities
If you are using it in wb + peertool for example
Wb will cache them and then it will mismatch with the client
Which is why sometimes you have go restart wb to make your stuff work if it relies on that
Or restart WE
May i ask for some help, to get the Override materials form a Prefab?
BaseLoadoutClothComponent
WornMaterialsOverride {
"{60DCA03734C7B78C}Assets/Characters/Textures/UV6_Helmet/UV6_ACU_HELMET.emat"
}
i tryed:
// Get override Materials from prefab
Resource resource = Resource.Load(owner.GetPrefabData().GetPrefabName());
BaseContainer prefab = resource.GetResource().ToBaseContainer();
BaseContainerList mats = prefab.GetObjectArray("WornMaterialsOverride");
for(int i = 0; i < mats.Count(); i++) {
m_aOverrideMaterials.Insert(mats.Get(i).ToString());
Print(m_aOverrideMaterials[i]);
}
Ive tried to make a modded component, and the class isnt sealed, so not sure how to go forward about this if anyone could point me in the right direction 😅
IEntityComponentSource ClothComponentSource = SCR_BaseContainerTools.FindComponentSource(PrefabResource, "BaseLoadoutClothComponent");
TResourceNameArray WornOverrides = new TResourceNameArray();
ClothComponentSource.Get("WornMaterialsOverride", WornOverrides);
If I use KickPlayer() with reason ban, and timeout of -1, is that essentially a permanent ban? If so how would I remove that ban if I wanted to?
Thanks mate
Where can I find the resources to make a scripted event for AI helicopter?
This only works if that prefab and not the one it inherits from has an override unfortunately. Also clothing uses multiple sources depending on mod, if it’s yours obviously you have control over it
In all cases, people should be inheriting from the base prefab and changing the material overrides. If they aren't that's on them.
Upon testing, If i inherit from a prefab that has material overrides I can still get them this way.
If they are removed in my inherited prefab, then of course I can't get them.
Because they don't exist.
I might have been confused with getting an object's materials if the prefab doesn't have overrides
because if you import an object, make a prefab for it, the meshobject doesn't allow you to set an override if it is still the same material, but for basecloth component, it can still work
In the base cloth component, if the parent prefab has material overrides so does the child.
These don't work like most other things.
The comment for KickPlayer() says it is a temp ban, so does that mean if I do a ban for -1, it will be undone when the server restarts?
Is Shape.CreateLines only available in workbench/peertool and not hosted servers?
I can draw lines fine and view in peertool but dedicated test server, nothing
Is it possible to enable debug in live environment for GMs?
Or workaround for shapes to render in live environment?
I've tried saving reference, tries rendering eonframe ShapeFlags.ONCE | ShapeFlags.NOZBUFFER | ShapeFlags.VISIBLE
it works as expected in WB/peertool
debug features exist only in diag exe, and not in normal exe
I want to figure out vanilla spawn system, I see there is plenty of logging under #ifdef _ENABLE_RESPAWN_LOGS, how can I enable this flag?
Fck. So let's say I want to draw a line via script, so I need a prefab or something?
Basically I was drawing aim direction lines for admins only
Basically replicate like a laser attachment and connect to eye/head bone?
sorry for at @torn bane but it seems so simple to being able to add a selective drive system to the game since everything is in here, like the ability to switch the willys jeeps drive train from 4wd to 2wd and there is also a difflock feature and all that could be used to make more in-depth vehicle controls and driving. Why isnt it? ive been trying to find a way to edit this myself but cant find any relevance to the "torque share"
I have been wishing for many of those features to be exposed to script for years now.
I just want to be able to change differentials and gear ranges during runtime to actually make offroad driving interesting.
Yes, if you need some debug shapes in normal exe, you need some 3d model with this shape
effort rn
How can I make the Projectile visually fly to the locked target on the Player Client (on the Server)
because my invisible missile hits the target and flies further according to its ballistics on the client
Are there any secrets in the scripts in this game? 😄
I would tell you but I am not allowed to
yeah its so sad its right here would be so easy to tweak it too
🥲
Could you tell me your secrets on how to do good navmesh
If you were using Physics API then that would stop working at all in a future update, also @undone patrol
It's being moved to it's own sim component
you should have the control there after that
It will be in a modding update so you will know how
🫡
So how does one do navmesh
If that’s for this channel there are just too many it confuses me
just open navmesh tool in WE and generate it
I tried that but it didn’t work I do choose like the soldiers option on it right?
yes, and after you generate navmesh you need to select it in AIWorld entity in NavmeshComponent of your map
Can anyone help me? In offline single player, AI units don’t seem to "activate" on in it. They only start following waypoints once I—or the camera—move within roughly 600 meters of them. I assumed disabling LoD might fix it, but either I did it wrong or it simply has no effect in single player. On a dedicated server this problem doesn’t happen. If this isn’t related to LoD, what’s the proper fix?
Evening
I got AI to write this script, because my scripting knowledge is limited.
How do I get the radio to play a sound after the script has been activated ?
This may be for the #enfusion_audio section.
Look at the flush toilet action, stop using AI.
100%, you right on AI
thanks for the help, I will take a look at the Flush Toilet action.
Anyone know how to enable again the command truck extending range? I know it's from vanilla but I'm loading WCS and can't find where they changed that
I would hop on the WCS server and ask those guys.
It was probably done in a prefab and not from script. Which would make it a question for https://discord.com/channels/105462288051380224/976159689668722718
From exp, as soon as you mention that you used AI or it is apparent you did. You get ignored in modding communities of any game 
I bet if you let loose an AI debugging agent on Reforger's codebase it could fix many crashes. There are so many, must be some low hanging fruit. That said it could just as easily waste your time hah.
If it applies try catch to engine code it will win a nobel peace prize
I disable exceptions, so nothing to catch, but my C++ still crashes eh
Can anyone help?
Hello guys, i'm very new to enfusion scripting but i have a lot of experience in other games already, but no game has such a bad explanation and so few tutorials as arma has, is anyone here willing ot explain to me where to start and how i can do a simple script which triggers when a player is unscontious?
Most scripting is hijacking events. Yes it’s unfortunate there isn’t a good searchable documentation, the outliner is really your only friend plus discord search. For stuff you need to start with “what handles this thing?” Probably a component on the character. Look at them and find one which seems to relate the most to what you are trying to do, then pull the thread on the yarn ball lol.
I get that, came to the same conclusion lol, but i feel like someone who already knows that could probaply way easier verbally explain this to me or show me than whatever time it takes me to learn it without (decent) docs myself, so i'm really hoping someone could do that.
Sorry to interrupt the convo, don’t mean to hijack it. However, I can’t for the life of me figure this out.
We’ve had multiple players report crashing and share their crash logs. I myself have had these crashes as well, and upon loading back into the game, I’ll end up crashing shortly after. Typically, the third time does the trick and I’ll be good for a while until it happens again. In all of our logs, we notice this common denominator—
‘
Virtual Machine Exception
Reason: Division by zero
Class: 'SCR_MapEntity'
Entity name:'SCR_MapEntity1' id:3
Function: 'UpdateZoomBounds'
Stack trace:
scripts/Game/Map/SCR_MapEntity.c:1067 Function UpdateZoomBounds
scripts/Game/Map/SCR_MapEntity.c:345 Function OnMapOpen
scripts/Game/Map/SCR_MapEntity.c:1488 Function EOnFrame
‘
Along with this one to follow—
Virtual Machine Exception
Reason: Division by zero
Class: 'SCR_MapEntity'
Entity name:'SCR_MapEntity1' id:3
Function: 'SetZoom'
Stack trace:
scripts/Game/Map/SCR_MapEntity.c:626 Function SetZoom
scripts/Game/Map/SCR_MapEntity.c:1414 Function ZoomUpdate
scripts/Game/Map/SCR_MapEntity.c:1470 Function UpdateMap
scripts/Game/Map/SCR_MapEntity.c:1497 Function EOnFrame
This happens when trying to do anything too quickly with the map before it has been initialized, what mods are you running?
I could go through the whole list if you’d like but for the sake of brevity, I think one of these could be the culprit. Pure speculation though—
•WCS_Settings
•WCS_TankMarkers
•Player Map Markers and Where Am I
•Coalition Squad Interface
•ACE Compass Dev
These mods touch the map UI, so that’s why I’m guessing one of these could be guilty. Although I will say, the crash doesn’t discriminate. Hardly ever do I crash when I open my map.
The script could be triggering for a player which does not have their map open when another player opens their map. I would look into trying to find a way to reproduce it
Yea, I need to. I’ve tried to replicate the issue in the past but no cigar.
I’m just curious as to why it causes double crashes, sometimes resulting in full system crashes.
hej guys can someone give me some information i want to use a image in a script for the ingame map
i use the MapDescriptorProps for showing a little image on the map
i use the SetImageDef parameter
i make a own imageSet
how can i the Quadname of the image in the script
string myImageset = "{D9E84F7D13F926D0}UI/Imagesets/Dots.imageset";
string myImageQuad = "Red_DG_dot";
MapItem pointItem = mapEntity.CreateCustomMapItem();
if (!pointItem)
continue;
pointItem.SetBaseType(EMapDescriptorType.MDT_DEBUG_POINTS);
pointItem.SetPos(x, y);
pointItem.SetRange(1);
pointItem.SetVisible(true);
MapDescriptorProps props = pointItem.GetProps();
if (props)
{
//props.SetImageDef(myImageset);
props.SetFrontColor(Color.Red);
props.SetOutlineColor(Color.Red);
}
i noticed the color does not change so thats why i want a own image and create a red dot for on the map
can someone give me a push 🙂 thanks already
Thanks for the heads up!
For a beginner it helps a lot to understand what is going on.
The only thing AI did was fix some syntax issues and structuring on the sound component.
Everything else is written by me using other game scripts as a sample.
I looked at the flush toilet script and it is way harder to understand for a beginner.
After that I simply gave up on scripting the radio sound.
Hi! Is there a way to ensure that my modded class runs last?
Where can i find more information about the mod hierarchy?
So i'm asking again as this got buried, could anyone show me how to set up a basic script that catches a event or knows a good tutorial?
Watch the bootcamp series on scripting and replication.
i did but it was more about ai an not what i needed
Script editor stores the best examples, try search for "RegisterScriptHandler" keyword, its add new script to events
https://community.bistudio.com/wiki/Arma_Reforger:Event_Handlers
Hey! Thanks for showing interest in scripting. We can always use more scripters. Yeah there isn't a whole lot of good beginner tutorials. But you should start with the examples here https://community.bistudio.com/wiki/Category:Arma_Reforger/Modding/Scripting/Tutorials
Specifically the Component then the Entity examples.
Then read these files in the Enfusion Script Editor for some useful methods/functions (You don't need to memorize these, it's nice to know that they're there):
tools.c
Game.c (capital G)
game.c (lowecase G)
IEntity.c
BaseGameTriggerEntity
SCR_AIGroup.c
and CharacterControllerComponent.c
//------------------------------------------------------------------------------------------------
As for your question. Player characters will have a CharacterControllerComponent component. In that component there's a boolean IsUnconscious() method that checks if the character is unconscious (lol) . You can start there.
Now, I have a question. How would I best go about filling an array with every player Id? I'm thinking a loop that goes from 0 to some number, and if the Id does not have a controller associated with it I stop the loop. Otherwise I add the integer to the array.
I actually had this exact thing, system failure, checked logs and both these same two errors at the time in crash logs. Nothing to note in console logs or other
Why not use PlayerManager::GetPlayers?
😮
Hello all - what function/class is responsible for displaying the nameplate/name tag of another player when you look at them?
I.e., you look at a player, it tells you their name, and what squad they are in
Check hud manager
Scr_nametagdata, scr_nametagdisplay etc
Thank you!
Hmm, you haven’t found the root of it have ya?
Nope, I know it's nothing I did personally though. I was in editor mode just spectating hands off keyboard
Thanks ill take a look
Hey friends, does anyone have a good example of a script to control a looping audio sample like the vehicle horns?
How do i attach a script to a interactive model.
For instance I have a ATM, I want users to hit F on it and it pop up a GUI.
I have read the docs but it doesn’t really explain all that well lol.
The way I did it was via a dialog, what kind of GUI do you want? A menu I’m assuming?
Yeah, ive tried adding “interaction component handler” or whatever its called but theres no option to link a actual script to it
Im not trying to release this mod, just playing around with stuff to learn modding in general
I’d open it/close it via the player controller, that way it exists per player, and since player owns it they have authority to tell server what data is changing on it.
I think the GUI modding bootcamp does go over the interactivity of the menu itself
I think it’s as easy as adding script handler to widget desired
Ah, yeah could be why my logs show something about a player controller lol
Can I request that the character movement speeds be added to the class CharacterCommandMoveSettings list? I'd like to make movement enhancing/limiting items without having to hard code a custom character with the settings manually or using the encumbrance system.
Can local Entities be inserted into inventory? Or do i have to make them global ?
I have a feeling it could be due to the presence of a hacker. The night I was experiencing repeated crashes, we had a couple hackers in the server. Last night, I didn’t have a single crash, and there weren’t any hackers. Something they inject in the scripts breaks things. I’m not 100% sure about this, just speculation
Anything is possible I guess
In SCR_CampaignBuildingProviderComponent.GetAvailableTraits() Where is the list of entities populated from those traits?
Hi there. How to get entities inside a trigger? The only thing I found is GetCountEntitiesInside(), but it just counts them
Fought for 8 hrs today, trying to get my script to just populate map markers randomly on the map to work and for the life of me I cant get it to
Compiles & builds correctly,
Generic Entity
<{myscriptname} component added to the generic entity
I add the prefab to the world and hit save and nothing shows up on maps or even in the logs like the script isnt even activating even though it got loaded into the world
Fresh project, no additional mods loaded
Also, what difference between this two methods of SCR_ScenarioFrameworkTriggerEntity.c?
would you be able to help me do a height map?
I have no idea about terrian lol
worth a try cant find anyone who does
Is there a way I can have the OnActivate of an SCR_BaseTriggerEntity run on all clients? I'm new to replication and struggling with this, I've yet to get the trigger entity to be replicated to all clients regardless of distance.
The method inside the second one looks like what you're looking for
Or at least, that variable is what you want to get
I mean why there are 2 of them? They are basically the same except first does not work, at least for me (it always return 0)
And I'm looking for a way to get entities in trigger, not amount of entities
The variable m_aEntitiesInside should be an array with all the entities inside the trigger listed for you
Try tracing the m_iCountInsideTrigger variable for the first one and see what actually uses that variable
You can either use that array variable or make your own array variable and have that GetEntitiesInside(array<IEntity> yourArrayVariableHere) method populate your array
Yes, but it is protected
Then use the method that populates it and use your own array
Look at BaseGameTriggerEntity for your needs
Ahh, here it is, thank you
How do I set up the script and implement it to my helmet attachments.
Ok Im pretty confused. I am trying to script the ability to use saved loadouts on the MHQ in conflict. I put a bunch of prints in both SCR_BaseGameMode and SCR_GameModeCampaign for CanPlayerSpawn_S(). What I dont get is why is the super in GameModeCampaign returning false when BaseGameMode returns true?
how do I get a script defines working on a linux dedicated server without doing something super ugly like making a file called _.c (so it loads before everyone elses scripts) and throwing all my #defines in there?
I need it done via the mod, cant expect every server who wants to use the mod to have to mess with their launch options
also I think srcdefine makes a server refuse connections from non diag.exe
last time I checked
back in 1.2 or something
Well then idk
hopefully someone else has an idea

I mean I got it working using my ugly way, I was just hoping maybe I can do it using the system I believe was intended for it lol
theres a PLATFORM_LINUX but I cant find where that is coming from, maybe I should just add an object called linux and see if it works 
Why are the Tags modded in a vanilla script and why do I need to also add these values in my modded enum for it to not break vanilla code? 
modded enum ETagCategory
{
Metal = 8,
Insect = 16,
StaticTurret = 32,
}
they are flags I guess
but so is EntityEvent, idk
nvm I forgot I'm not allowed to talk here
Those configurations are for when building an addon (build -> pack)
This is the importance of using BitFlag or LinearEnum decorator on the enums
Same old modding issues found in DayZ too from not using them
But this is the vanilla game code, so its missing there?
enum ETagCategory
{
NameTag,
Perceivable,
Radio,
}
modded enum ETagCategory
{
Metal = 8,
Insect = 16,
StaticTurret = 32,
}
Yeah, it is not on your side
This code was done before i got those decorators to be introduced
It has to be updated
And why is this the only modded enum in the whole game code?
Because it comes from CPP, and someone in scripts needed to add more to it
Modded can also be used by us
Its not a modder only thing
But then why not just add it to the base enum
Because if i recall, this comes from engine
And you do not want to mix game project specific things to engine
I see
Those are only supported in a future version
// m_vRotMat is set OnInit: Math3D.AnglesToMatrix(owner.GetAngles(), m_vRotMat);
vector rotAxis = owner.GetWorldTransformAxis(1);
vector rotOut[4];
SCR_Math3D.RotateAround(m_vRotMat, owner.GetOrigin(), rotAxis, pitchDeg * Math.DEG2RAD, rotOut);
owner.SetAngles(Math3D.MatrixToAngles(rotOut));
this only rotates my entity around the correct axis if its pointing north or south how can i fix that?
well its actually just wrong most of the time
fixed it using quats, still just as confused but it works
Ye, would be nice to get more helper functions for 3d positioning and rotating.
It's confusing and takes long time for many people, common struggle
Doesn't the entity have functions to get and set the matrix directly?
yeah theres [Get/Set]WorldTransform which is what im using now
but i was doing stuff to the position separately in the same place during debugging and i barely know what im doing here so its messy
Converting matrix to Euler angles and back - is weird
yup had many times where i hit play and it just started doing some crazy backflips
Anyone want to collaborate with me on a project?
Recreating the popular arma 3 "Dynamic Missions Spawner" - for multiple use cases on Reforger
Trying to work out where the prefabs are populated for the campaign building mode. Anyone have a clue?
Depends for what. For vehicles and groups it's the same configs as for GM, as you can add a whitelist to entries for which editor modes they are available. As for structures, it's Compositions_FreeRoamBuilding.conf, but you probably already used that one before for your extended conflict structures mod.
I think Im getting closer! Im trying to attach the building mode to the MHQ to allow both fortifications (which is working fine) and one small modded vehicle to be spawned. The trouble is I dont want all vehicles to be spawnable. Now I'm trying to figure out how to determine if the building mode was entered from the MHQ, so I can then manually filter out the unwanted vehicles. However, the owner for the building mode seems to be the game mode 😢
Cross post from generic: Hi all, I'm trying to work out how to make a modification to the PlayerManager class in Enfusion but the only thing I can find seems to be a header file PlayerManager.c. If you could @ me in your response just in case I miss is that would be appreciated ❤️
But I guess the answer to my earlier question is SCR_EntityCatalog and SCR_EntityCatalogEntry. The building mode seems to use cs SCR_EntityCatalogManagerComponent.GetFilteredEditorPrefabs() however the heavy vehicle depot uses ```cs
SCR_CatalogEntitySpawnerComponent.AddAssetsFromCatalog()
You cannot modify this class.
You beat me to it lol
Yeah, seems that you can only whitelist tabs, but not blacklist certain editable entity labels...
Can I make a child class that inherits from it and overrides some of its methods?
No, but what the heck are you even trying to accomplish?
I just realized that if the vehicle depots are the owner normally, then if the game mode is the owner I can probably assume its then the MHQ! 😎
I just want to override the functionality of GetPlayerName to return a custom value. I believe there is at least one mod that allows for custom names but it doesn't play nice with other mods. Overriding this would mean anything relying on get player name like squad compass would get a custom name
generated classes can't be modded and external functions can't be overwritten
Even if you could inherit and override some methods, you wouldn't be able to override the method to get the player manager from the game.
ChimeraGame::GetPlayerManager is external.
You'd then be forced to replaced every call of getting the playername in every script
And if there is anything engine side that calls it you'd be SOL
Yep, but I only wanted to replace it in one and I would have just made compats of the mods locally if there were new mods I wanted to override that functionality in
I have another solution but it is less elegant I think 🤔
I appreciate the help though ❤️
Turns out I was mistaken and the game mode is always the owner. So I need to figure out how to determine where the building mode was entered from.
Why not trying to expand the component with an editable entity label blacklist?
well the main issue now is trying to figure out where the action was called from, the MHQ truck, or a vehicle depot.
probably have to use Rpc's as the action is local only
Not really sure how to connect SCR_CampaignBuildingStartUserAction and SCR_EntityCatalogManagerComponent
I guess I could use the game mode!
That worked!
You can override external proto methods if they have the event keyword added to it.
I forgot to mention that, thanks.
In future you will also be able to mod generated classes
But you wont be able to override non event generated proto or external methods
That will stay locked
I recall you mentioning that script invokers are probably going away
What would they be replaced with?
On AR they will stay
Newer proper and robust event system
Will there be an event system in AR that we can use that'll be like in A4?
Are you talking about the 506th IRRU custom name mod?
There was an update to it recently to ensure compatibility with Coaliton Squad Interface
By simply modding CSI's classes.
Ho ho ho, exactly what I'm looking for. Must have my local version pinned rather than being on latest. I appreciate the heads up 🙌
Yeah we didnt want to have CSI as a dependency, but unfortunately due to Enfusion's race condition only one mod can fight for control of GetName()
So we had to end up modding CSI aswell
I keep running into the problem that I cant get/set different properties of Components that are exposed through the editor, for example the type of bullet inside a magazine. I can get the Magazine from a weapon, but there doesn't seem to be a way to determine what ammunition it uses. Does anyone have any idea how one might be able to access these properties?
So compile order can potentially fix this, I imagine there are other ways potentially to go about this as well, like on the CSI side with just returning super for that so it would conflict the least, like if name is not set on CSI, let another mod set it.
My Game won't go in the cinematic camera when running the game engine. what can i do?
oooohhh this only works in preview. ohh noooo
Can i do cutscenes?
1.6 exposes some better getters for it
Only getters or also setters?
Getters, you cannot set these. They are handled by the magazine config which is hardcoded via the .conf files. no changing via script
Does anyone know why this assertion fails when trying to create a particle emitter? Works on a different component with that same configuration and no issue
Is it because I'm doing it from an AimModifier?
Is there any way to actually diagnose a memory leak in the debug menu?
Something is leaking from my mod and it's not appearing in the script profiler in the WB
You can read any property from BaseContainer: https://github.com/acemod/ACE-Anvil/blob/5fd26b6a09ab19a8a4173b467645b62044e44cb7/addons/cookoff/scripts/Game/ACE_CookOff/Helpers/ACE_CookOff_HelperEntity.c#L86
Interesting, I’ll look into it
Just beware that you do not have permission to feed AI our script code.
Thank you for this, I've got it working properly. Two more questions though: Is it possible to modify these values on a componenrt at runtime? My understanding is that the BaseContainer basically only contains the data for the prefab, so not "up-to-date" data, meaning SetObject won't change an object at runtime. Also do you know if it's possible to obtain the currently chambered round? My only way would be to get the current AmmoCount-1 and use that to find the round from the MagazineConfig.
They must have already ingested some data, given how chatgpt knows enfusion script and can hallucinate bullshit with modded keyword etc. maybe it was from dayz standalone ... oh well ... imagine respecting creators choice. Learn now, get sued and called into congress later I guess
As the saying goes, better to ask forgiveness than permission
trying to script changes to player animation audio
what exactly handles the triggers for footsteps?
character_footsteps.acp
I see charactersoundcomponent on the character_base but even scripted it to disabled has no effect
local models too? 😬
SCR_SupportStationManagerComponent seems to cause major issues for me in Conflict, whenever this error pops up, my groups break. Any ideas what causes this / how to fix? Seems so random...
Reason: NULL pointer to instance. Variable 'm_eSupportStationPriority'
Class: 'SCR_SupportStationManagerComponent'
Function: 'AddSupportStation'
Stack trace:
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function AddSupportStation
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function DelayedInit
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function DelayedInit
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function OnUpdate
SCRIPT (E): Virtual Machine Exception
Reason: NULL pointer to instance. Variable 'm_eSupportStationPriority'
Class: 'SCR_SupportStationManagerComponent'
Function: 'AddSupportStation'
Stack trace:
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function AddSupportStation
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function DelayedInit
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function OnUpdate
SCRIPT (E): Virtual Machine Exception
Reason: NULL pointer to instance. Variable 'm_eSupportStationPriority'
Class: 'SCR_SupportStationManagerComponent'
Function: 'AddSupportStation'
Stack trace:
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function AddSupportStation
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function DelayedInit
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function OnUpdate
This frequently fails in Workbench because that component holds a singleton handle which it never refreshes, and this of course starts to cause random issues because editor VM is shared with "play mode" and never reset. Basically a vanilla bug.
Add this as a band-aid:
modded class SCR_SupportStationManagerComponent : ScriptComponent
{
protected static SCR_SupportStationManagerComponent s_Instance;
override void OnPostInit(IEntity owner)
{
s_Instance = this;
super.OnPostInit(owner);
}
}
Are there any conventions for e.g requires.Insert(FactionAffiliationComponent); and still checking for null after FindComponent(FactionAffiliationComponent)?
What an annoying issue. Thanks for helping me out! Ripped out my hair more than once on that specific problem and could never solve it.
Has therr been any recent changes to how the PlayerController works? We have a profile for players that is on their PlayerController which includes money. It worked initially where players money would save/load/update if depositing or withdrawing money, now it doesn't seem to update or save their money when doing a transaction.
If you withdraw money and relog, you have the money you withdrew and the balance before the withdrawal in your bank account.
A few weeks ago it worked as it should.
Disregard, with all my glorious intellect, I found out that you need to put "await player.save()" at the end of your function, to actually have it update the database 
Anyone know what's the best way to start scripting in enfusion when I've never had any experience with it?
Hi All. I'm just starting with some scripting. I'm attempting to subclass SCR_ScriptedEntity and I'm getting : Unknown type 'SCR_ScriptedEntity' My project has the main ArmaReforger dependency 58D0FB3206B6F859 but I can't seem to get it to recognise this SCR_ class. Do i need to do anthing special to fix this? ( chatGpt has been suggesting I add the dependency that I already believe I have). Thanks.
Trying to do something like
ZEN_ScriptedEntity : SCR_ScriptedEntity
{}
So your custom class is inheriting from it?
Yeah exactly. I feel like I've not imported something correctly but it's not super clear from the docs I've seen. If i search inside the ArmaReforger dependencies i see plenty of SCR_ files but not SCR_Entity so I'm also thinking perhaps chatgpt is sending me off on a wild goose chase based on some old API version or something.
... after telling chatgpt my exact version it now reveals to me that class no longer exists. Sigh...
ChatGPT is not a good source for this, it tends to hallucinate Arma 3 SQF lol
What is your desired end result?
Yeah, like agent zero asked what's your goal here? Share code if possible
Goal is simply to setup an entity so just looking for the correct approach. I think I've got it now that Ive fixed chatgpt's hallucination. I'm now using GenericEntity which seems to be fine.
The bootcamp vids are really great.
I’ve made some pretty simple mods that you can take a look at here too if you’re a “learn from reading source” type of person https://github.com/landaire/arma-mods
If you're a "learn from reading source" person just open Workbench and look and the vanilla scripts. Lol
At*
im new to tools just wondering if anyone know how to setup cars in map creation because i cant find anything online
for sure -- I guess I meant for actually seeing how a mod hooks existing functionality and whatnot
Place a GenericEntity on the map, create a class that inherits from the GenericEntity.
Zen_GenericEntity : GenericEntity {}
Compile your code.
In the world editor, right click on the entity, in the resource browser, and change class to the one you just made. Then you can do your overrides as needed. Don't forget to create a class constructor. I've found that without it the entity won't initialize. Mainly an override to the EOnInit or OnInit or Init(im on my phone rn so unsure which one it exactly is) along with a SetEventMask(EventMask.Init) in the constructor is a good way to start having your entity 'run'. From there, look at docs and just how certain things are scripted from the base game. ie something that is doing something relative in the base game that you want to try to do.
With figuring out the event mask, the workbench helps a ton. Just write
SetEventMask(EventMask.
And the workbench will generate some auto completes for that specific enum.
Again, im on my phone so what I write my look like some chatgpt "there but not exactly correct", im just going off if memory.
Thanks for the detailed response. I'll try this out next time i get a chance.
I am using Enfusion Persistent Framework respawn system, How do I make sure the faction manager counts the player into the assigned faction ?
I have only one player in the scenario it has the correct assigned faction but doesn't get counted, I have tried multiple scripts and it still doesn't work, this has been an issue for a few months, If anyone can help PLEASE let me know.
Wait fora game update which replaces my mod with built in functionality. this case is handled there. it should be the next major exp one if all goes well. We will see
I hope so I am at ends wit with this.
Will you be keeping your mod up after this is added in? Also for those using EPF, will the data be easily transferable from EPF to base game persistence?
I will probably ensure EPF keeps what ever functionality it has now for a few months. I will not add anything new. Transition is not really hard but requires touching everything. The idea of extracting save data and applying it back is still there so it's not hard to transition I would imagine.
Hello guys, does anyone know if it's possible to make hand logic in Arma.r like in the game Bodycam? Without creating animations for it, p.s I don't know how to make them. So here's an interesting question: we have the character's hands and they have bones, we can work with the bones through setbone, but setbone works in a confusing way, and as I checked, if you set the weapon rotation logic through setbone, the animation will be clunky and frame-by-frame. set/offset also doesn't work as we can only change the position of the hands in the offset but can't rotate them (maybe I haven't fully explored the option with offsets, but still, if anyone knows how to do this, please help
How about getting on the wiki and doing some reading? A lot of good info there for a beginner.
https://community.bistudio.com/wiki/Category:Arma_Reforger/Modding/Scripting
What is the best method to ensure AI has infinite mags? (not infinite ammo)
hook when they reload and add another magazine?
How do you check if a string has " inside it?
cause doesn't like ' " '
Imma use string helper
backslash iirc, so it woud be "\""
I see thanks
How can I detect when a character is being controlled by a human player?
SCR_CharacterHelper has static bool IsAPlayer(IEntity entity)
or static bool IsPlayerOrAIOwner(notnull ChimeraCharacter character, out bool isAi = false) in the same class if thats what you mean
Thank you. I can't get it to work not sure what I am doing wrong.
Here's a script that adds a magazine to inventory when the character reloads, and it works fine but I can't make it apply only to AI. since this component is attached to Base Character Prefab, all characters have this feature. I want to make the feature only for AI with an optional checkbox to allow players to use it but no matter what I do it keeps detecting players as characters in general. any ideas? would greatly appreciate it.
a bit hacky but I managed to solve it by modding the SCR_PlayerController to disable the Infinite Mags component on player entities. Works great now. thank you for your help!
post init seems to be too early still to detect if its a player, this should work
//------------------------------------------------------------------------------------------------
override void OnPostInit(IEntity owner)
{
super.OnPostInit(owner);
m_WpnMan = BaseWeaponManagerComponent.Cast(owner.FindComponent(BaseWeaponManagerComponent));
if (!m_WpnMan)
return;
GetGame().GetCallqueue().Call(EE_InfiniteMagsInit, owner);
}
//------------------------------------------------------------------------------------------------
protected void EE_InfiniteMagsInit(IEntity owner)
{
EE_InfiniteMagsComponentClass compClass = EE_InfiniteMagsComponentClass.Cast(GetComponentData(owner));
if (!compClass)
return;
SCR_ECharacterControlType controlType = SCR_CharacterHelper.GetCharacterControlType(owner);
if (controlType == SCR_ECharacterControlType.AI)
m_bIsValidCharacter = true;
if (compClass.m_bAllowPlayers && SCR_CharacterHelper.IsAPlayer(owner))
m_bIsValidCharacter = true;
if (m_bIsValidCharacter)
SetEventMask(owner, EntityEvent.FRAME);
}
Thanks!
Hey we are looking for a Life Framework because there is no German server and we would like to play 🙂
Nope, this is some weird bug in WB. I have a few files that when added to a certain directory, suddenly the files seem to be duplicate.
Hi. I try to make some diagnostics code. Can i get server performance statistics like CPU, RAM, Replication and VON network activity for server?
You can get RAM stats from System. The other's you're not really able to. Server FPS tells you a whole lot, just gotta either make some script or observe what's happening yourself to understand if it's a CPU bottleneck, or too much stuff in replication.
Debug tools you find in the Diag exe for arma are not enabled in the regular exe for Arma for security reasons.
is it possible to add an EEditableEntityLabel to a prefab via script?
maybe something like ```cs
m_aAuthoredLabels.Insert(EEditableEntityLabel.ENTITYTYPE_VEHICLE);
Or maybe thats not allowed with an APL-ND mod though, huh? o.O 💩
You know how to fix it?
I think it is causing some bugs to occur in game
Even reinstalling Reforger or the Tool won’t help
No. OTOH, I did not see any other issues than the visual annoyance. In my case, I just keep the files triggering this in a separate dir. As said, this is a weird bug.
\dirB\otherfile.c```
If I move the otherfile.c to \dirA\, it suddenly looks like:
```\dirA\file.c
\dirA\file.c
\dirA\otherfile.c
\dirA\otherfile.c```
Random Question: In terms of resource/network usage, are these 2 methods of saving different data types the same or is one method better than the other?
1] Create multiple components and corresponding savedata classes extending EPF_ComponentSaveData that are included in the EPF_PersistenceComponent attached to the Chimera_Character.
This way, the data is more spread out and on every save and read, it is looking into multiple different json files for data pertaining to each individual character. Smaller chunks.
2] Creating a single gamemode component and corresponding savedata class extending EPF_ScriptedStateSaveData , and having just one, big json file with all the players and relevant data.
This way the data is more centralized but the read/write would have to deal with one, larger file.
I hope this makes sense to someone. Or maybe I'm just overthinking it.
Hi there. I'm trying to make a little racing framework and end up with a problem. How do I create some variable (with start/finish time, etc) and have it accessible from different triggers?
- WorldTimestamp, GetGame().GetWorld().GetServerTimestamp()
- GameMode and Get func, GameMode component and Get func
No, I mean how can I some data structure to which I can access globally from different scripts and triggers?
I need to store start time in start trigger, and finish time in finish trigger

class MYTAG_MyGameMode: SCR_BaseGameMode
{
private WorldTimestamp m_startRaceTime = null;
void StartRace()
{
m_startRaceTime = GetGame().GetWorld().GetServerTimestamp();
}
void StopRace()
{
m_startRaceTime = null;
}
void GetStartTime()
{
return m_startRaceTime;
}
}
void SomeFuncSomeWhere()
{
...
MYTAG_MyGameMode gameMode = MYTAG_MyGameMode.CAst(GetGame().GameMode());
WorldTimestamp startTime = gameMode.GetStartTime();
...
}
You suggest using gamemode as storage? I'll try, thank you
there is a different places to storage, depends from yours code structure and targets
and dont forget about replication 
Is it correct to edit the zoom step in the notepad?
since the limit in the game is x5, and instead of writing a new script, I'm editing the prefab in the notepad.
Will this cause conflicts?
According to the console, there are no errors.
Essentially, this bypasses the script restriction
And is it Legal? 
Or would it be more correct to use override or inheritance?
Why not? Did you reupload their content? No? Finding a prefab and modifying it (if it exists) can never be against any license, only if you include their content, and what type of content, would you find yourself in a bad position
So you are modifying a config file which is completely fine, what I’m interested in seeing is if it actually works (not just not errors), if it works this is an excellent albeit dumb solution to an arbitrary problem. Now if it doesn’t work you might need to make a modded class that overrides that attribute to increase it. Or inherit the class with override attribute so it only affects certain (scopes)?
can you tell me how you made ur vics scope have variable zoom optics?
i cant figure it out for the life of me
Yes, it works.
I tested it on 2 configurations, the Zoom of the Sight (its step) and the Range of Gravity activation for the MissileMoveComponent
But my friends have already told me that it is better to use the inherited script.
This component allows you to edit the Minimum and Maximum zoom levels and the Step ratio when zooming in.
it doesnt work for me,if i change base zoom level i cant zoom up to max zoom level
does interloption speed have do with anything?
It's strange, what are your zoom values? Minimum and Maximum
what is the change step?
Do you have your own custom script or are you using the game's native one?
2x for min,7x for max,5 change step and using game script
Take any turret prefab (BRDM,LAV) or PSO \ ART scope as a basis.
Duplicate--Change the zoom settings in it.(set your own values)
It should work, but if it does, you probably don't have the Scope component fully configured.
im currently tryna mod LAV optics to be realistic(LAV had low FOV setting which was 2x
i figured the problem out
There is an article that helps you adjust your sights.
If you haven't found it, here it is
https://community.bistudio.com/wiki/Arma_Reforger:Weapon_Optic_Creation
It would technically change the prefab even if Im only adding the APL-ND mod as a dependency, no? Maybe this would be better asked in #other_ip_topics
Anything related to possible license violations or concerns about it would Definitely be better asked in #ip_rights_violations and/or #other_ip_topics
It's as simple to understand as it is tricky. They know more in there than here.
if you want to get the current faction holder of a campaign base, which would be the best function to do so? I have been trying to use the faction affiliation component but it does not work well
it seems the faction affiliation don’t change after capturing
should I use getcampainfaction or Getfaction
Currently trying to use the CharacterIdentityComponent to set specific bodies to specific slots but it seems like swaping the visual identities in the Enforce side does not work and results in clipping.
void SetVisIdentity(IEntity entity)
{
SCR_CharacterIdentityComponent identityComp = SCR_CharacterIdentityComponent.Cast(entity.FindComponent(SCR_CharacterIdentityComponent));
VisualIdentity visIdentity = identityComp.GetIdentity().GetVisualIdentity();
visIdentity.SetBody("{E7C1C23F782B7481}Prefabs/Characters/Basebody/BigBossBaseBody.et");
identityComp.CommitChanges();
}
override void OnControllableSpawned(IEntity entity)
{
super.OnControllableSpawned(entity);
if (entity.GetPrefabData().GetPrefabName() == "{B3182F73DBEACB7B}Prefabs/Characters/Factions/BLUFOR/CRF_GS_BLUFOR_COY_P.et")
GetGame().GetCallqueue().Call(SetVisIdentity, entity);
}
The same thing happens when I use the override in the SCR_CharacterIdentityComponent , we are adding gear to the entity in runtime, currently I've tried calling the gear being adding at the same time and after and the clipping persists
Correction, even using the override from the component with the base loadout manager causes clipping.
Nvm it was my custom mesh that was the issue
I think it's something like campaign military base component or just military base component, there should be some kind of get faction there
How would I get the SCR_EditableEntityUIInfo of a Vehicle, or the Vehicle of the SCR_EditableEntityUIInfo?
Since its listed under the SCR_EditableVehicleComponent in the world editor, would it be a child of the SCR_EditableVehicleComponent?
Anyone know how to add blown cover when fired a round into an enemy in SCR_PerceivedFactionManagerComponent?
I know this is a new feature which is so cool and hope they add code to "reveal your cover in certain rules (Example: Noise radius, Suppressed weapons, First shot free...etc)", if broken a rule the enemy faction (same faction impersonating) sees right through the cover.
However does anyone know how to add that currently? Mainly for shooting an enemy... Im pretty new to scripting in this engine and need to do some heavy learning.
Also I hope we get more settings like distance, chain reaction and other bits to improve "going undercover" Scenarios
can I not modify SCR_EditableEntityUIInfo? If I try to do modded class without actually modifying anything, I get a bunch of errors that seem to come from ```cs
protected override void CopyFrom(SCR_UIName source)
int factionCount = 0;
Anyone know something similar that works to resolve this error?
Thats just a warning, is it causing your code to not compile? If so, comment it out since it's not used anyways
It compiles but its not functioning as intended but could be the way I actually configured some prefabs to use the scripts
What is the best and cheapest way to get material (gamemat/physmat) from bullet hit (contact)?
Either delete the variable factionCount or use it
Is there a way to add aditional actions to a ActionsManagerComponent in runtime through a script? Because it has no 'AddAction' function. I tried searching for the word 'ActionsManagerComponent' but all 59 results in the original Arma code dont try something like that.
Just add the action and then use cs bool CanBeShownScript(IEntity user) to determine if it can be seen in runtime. Or use ```cs
bool CanBePerformedScript(IEntity user)
No, not during runtime
as Gramps said only way is to add it already and just hide it
Thanks but unfortunatily that wont work for what i am trying to do.
I'd have to add 100's of actions to each item lol
If you dont expect all be active at same time, maybe just make few actions and change their functionality and name at runtime?
Guys please tell me, is there a separate signal that reads the player's turn while standing still or in motion?
Hi, im doing some super vibe coding to proof of concept.
I am wondering why my code compiles and runs on the server, but i get a 415 whenever i attempt to POST
code incoming:
//OpsTrack_BaseGameMode
modded class SCR_BaseGameMode
{
override void EOnInit(IEntity owner)
{
super.EOnInit(owner); //Run code from super class
if(Replication.IsServer()) //Using IsServer because we only want it to happen when it is a server.
{
Print("[OpsTrack] Mod is running on the server!");
}
}
override void OnPlayerConnected(int playerId)
{
super.OnPlayerConnected(playerId);
BackendApi backend = GetGame().GetBackendApi();
string uniqueId = backend.GetPlayerIdentityId(playerId);
RestApi api = GetGame().GetRestApi();
RestContext ctx = api.GetContext("<SOMEURL>");
ctx.SetHeaders("Content-Type,application/json,Accept,application/json");
string json = string.Format("{\"PlayerId\":\"%1\",\"UniqueId\":\"%2\"}", playerId.ToString(), uniqueId);
ctx.POST(new OpsTrackCallback(), "/player/join", json);
Print(string.Format("[OpsTrack] Player connected: %1 (%2)", playerId, uniqueId));
}
override void OnPlayerDisconnected(int playerId, KickCauseCode cause, int timeout)
{
super.OnPlayerDisconnected(playerId, cause, timeout);
BackendApi backend = GetGame().GetBackendApi();
string uniqueId = backend.GetPlayerIdentityId(playerId);
RestApi api = GetGame().GetRestApi();
RestContext ctx = api.GetContext("<SOMEURL>");
ctx.SetHeaders("Content-Type,application/json,Accept,application/json");
string json = string.Format("{\"PlayerId\":\"%1\",\"UniqueId\":\"%2\"}", playerId.ToString(), uniqueId);
ctx.POST(new OpsTrackCallback(), "/player/leave", json);
Print(string.Format("[OpsTrack] Player disconnected: %1 (%2)", playerId, uniqueId));
}
}```
Server log:
DEFAULT : BattlEye Server: Disconnect player identity=0x00000000
DEFAULT : BattlEye Server: 'Player #0 Mikkelsen disconnected'
NETWORK : Player disconnected: connectionID=0
BACKEND (E): SetHeaders - Number of strings must be even!
SCRIPT : [OpsTrack] Player disconnected: 1 (605f7501-78f3-4f02-b029-fdb329d14751)
NETWORK : Total number of players: 0
BACKEND (E): [RestApi] ID:[34] TYPE:[UNKNOWN] Error Code:415 - Unimplemented 4xx, apiCode="", uid="", message=""
Its definetly game server side, i can post just fine to my api, through swagger
You are not keeping youur callback alive beyond the request. which you must do. apart from that you are getting an error code from your webapi. SetHeaders - Number of strings must be even! says you are not putting them correctly and then it probably posts witth default headers which your api does not like
Hello Reforger Modders,
I'm currently working on a custom map UI component (SCR_MapUIBaseComponent) to draw a circular zone using multiple MapItem markers (a point cloud).
I'm running into an issue loading a custom image from an Imageset onto these MapItems. I keep getting white squares on the map, indicating the resource isn't found or loaded correctly, despite the resource paths being confirmed in the Workbench.
I've already tried the standard solution, but it's not working:
// 1. Canonical Resource ID is constructed correctly.
string myImageset = "{GUID}UI/Imagesets/Dots.imageset";
string myImageQuad = "RedDot";
string myImageResourceID = myImageset + ":" + myImageQuad;
Using the correct MapItem property setter.
MapDescriptorProps props = pointItem.GetProps();
if (props)
{
props.SetImageDef(myImageResourceID);
// I also tried explicitly setting a solid alpha:
props.SetFrontColor(Color.RGBA(255, 0, 0, 255));
}
Is there a specific method required to register an Imageset or ResourceName with the MapEntity or MapConfiguration before using MapDescriptorProps.SetImageDef()
Any insights would be greatly appreciated! Thanks!"
Oh yeah definetly makes sense with the callbacks, thanks.
Figured the header issue was that i was using
But with RestContext it expects it as comma seperated. 🤬
Guess i learned something 😂
Yes we hope to improve the apis to make it less error prone. this was just added so there is any way to set headers with least amount of effort
Whats the name of the action for placing vehicles in building mode?
is there a way to dump the localization stringtable or do lookups on strings from core game? I don't see anyone talking about that
FYI: It's been talked about once before, but it didn't get any attention. SCR_MapCampaignUI.ShowSpawnPoint is for Campaign / Conflict, but it affects all scenarios due to how MapFullscreen.conf is set without being mission-specific like when tied to a game mode prefab. A SCR_GameModeCampaign type check forces a premature return in that method for all non-Conflict scenarios. You can change the class back to the parent to get spawnpoint icon drawing on map to use the generic code. MapSpawnMenu is unaffected by this Campaign / Conflict misconfig / code.
getting an error here, what am i missing?
scripts/WorkbenchGame/Editor/SMG_Bake.c(47): error: Wrong number of template parameters
SMG_SystemRegistry sys;
if (!SMG_Template<SMG_SystemRegistry>.Load(m_sSystemTemplate, "System Template", sys, curErr))
ShowError(curErr);
// ...
class SMG_Template<BaseContainer T>
{
static bool Load(ResourceName path, string label, out T instance, out string error)
{
// ...
Then you should definitely rethink your approach to whatever it is that you're doing.
can i establish an ip connection in enfusion engine?
Like using the REST API?
yes
If you're trying to through the workbench then yes, there is also DNS resolution
Do you just use the enfusion IDE? and github desktop to push for repo?
I was wondering if there exist a better solution, like the inbuild version control in vs2022
Good Morning, question: Do we need to replicate Entity Flags or will they replicated by the game itself? For example if we change the visibility on runtime.
You need to replicate
You might want some to be active on server, while other active on clients
whicle several clients having different ones
etc etc
Replicate your feature needs. Do not replicate the flags from server ent to client ent
as you will mess with other things because of what I mentioned.
Mario, do you know how i can setup a second Peer for the Dedicated Tool? One peer is always crashing with: (see image)
In 1.6 exp this will be solved and allow you to connect multiple clients. Until then, no chance
Hopefully 1.6 doesn't get deleted internally 
I need to create a configuration file located in the $profile: folder in JSON format, and of course read that config back into my mod.
What is the recommended way to work with JSON serialization in Enfusion/Arma Reforger?
- Which classes or containers should I use (JsonLoadContainer, JsonSaveContainer, etc.)?
- And how do I read the values back into my own settings class?
SCR_JsonSaveContext/SCR_JsonLoadContext, you can pass it a whole scripted class, including nesting, and it will write and read it back as you want. SaveToFile LoadFromFile. 5 minute job
Nice, thanks. Where would it be appropiate to load settings? BaseGameMode doesnt run before the actual "mission" is getting loaded, i suppose loading settings should happen before that?
does anyone know why the if statement here is erroring?
dont wanna dig myself into a hole if this something i can fix
class SMG_Template<BaseContainer T>
Shouldnt it just be <T> ?
The earliest instances that run before any other entity in the world is created are world systems. But adding a system just to read the config is meh. I do not have an ideal place in my head yet. Maybe a derived mission header type would be a good approach, but not sure how those will work with the main menu where your mod is not active ...
Usually you can just make your settings holder a singleton that does the reading on the first occurance of someone wanting your settings and then it keeps them. That should work
only when defining arrays since they dont need a variable name as well
do you have an example
ok any knowlage base with examples about this topic
Give me a bit to find a link, the REST docs provided were some of the easiest to use
Makes sense with the lazy singleton.
Should a marker be visible only to USSR faction if I do this:
Faction faction = GetGame().GetFactionManager().GetFactionByKey("USSR");
int fIndex = GetGame().GetFactionManager().GetFactionIndex(faction);
SCR_MapMarkerBase markerst = new SCR_MapMarkerBase();
markerst.AddMarkerFactionFlags(fIndex);
/* Rest of the needed things */
mapMarkerMgr.InsertStaticMarker(markerst, false, true);
Doing the above makes it hidden to everyone.
Try Set instead of Add.
I did that too - same effect.
Wait are you sure it displays for everyone without changing the flags?
Yes.
If I set it as SetMarkerFactionFlags(0), everyone can see it (..as is documented).
Hmm, no idea. Seems to work for me.
Thanks for testing. I'm still scratching my head here. 😕
How can i make my script execute by the game on every server session.
Idk if it's marker type specific or something or if you're on experimental but just try changing it up.
Tested with different marker types but it did not help. I'm using a really plain gamemode for testing. So, opening Coop_CombatOps_Arland as the map, it seems to work. I'm probably missing something in my testing game mode.
There's only two things that should have anything map marker related which are the game mode entity and player controller. I'd check which player controller you're running and if it has all the map managers on it.
Care to elaborate on how to check the player controller?
so i get this error for my componant that i made "SCR_ExplosionPrefabSpawnerComponent"
Reason: NULL pointer to instance. Variable '@m00'
Class: 'SCR_ExplosionPrefabSpawnerComponent'
Function: 'IsNearExistingCrater'
Stack trace:
scripts/Game/CombatOps/Test.c:215 Function IsNearExistingCrater
scripts/Game/CombatOps/Test.c:90 Function SpawnCraterPrefab
scripts/Game/CombatOps/Test.c:313 Function OnDelete
However it dosnt pop up with the text box asking to debug or anyhting only in console here and a little warning in the corner when i compile. Tested it many times in game here and it works fine, so i uploaded it to the workshop to download and test in game and there too it work fine. Should i just ignore this then?
Where can I change the behavior of the fuel depot to act like the fuel truck cargo so it has limited fuel? It looks like it's a fuel node but it has no fuel manager so it just limits the fuel flow per the logic
Hey, I'm trying to create a marker that floats above an object and is visible to all players in the game world from anywhere. Similar to the task icons in Arma 3. Does anyone have any idea how to implement this? As far as I know, the tasks in Reforger are not displayed in the game world but only on the map, right?
What is the meaning of “chimera” I see in script?
And what is the difference between ChimeraAIAgent and regular AIAgent?
As far as I know, Chimera is an internal project name, though I don't know whether it stands Reforger in general or something used for Reforger.
Either way, in practice the name just indicates at what level that class was implemented, same as SCR_ (scripted chimera reforger) classes are implemented in script.
hej guys i have a question about how to make a own strings text for example the RestrictionZoneWarning.layout
i want to create a custom Message for it
i did already edit the SCR_RestrictionZoneWarningHUD so that i can add the New Warning Type in the ERestrictionZoneWarningType
but how can i change the strings or add the strings
Do i need to create a stringTable or How does the #AR_justtext work
The warning types are set up on a component on the player controller prefab.
It has a string field for each type, and in there you can put the text directly, or alternatively a localization key.
Correct that what i found but they use the strange strings right the #AR_something
i think the best is to use localization key.
If you want it to show messages in different languages, you will need to create a string table and add such an entry.
Unless the Arma Reforger string table already has a suitable entry that you can reuse.
it is not possible to change the Arma Reforger string table right
so i need to create a new one
and add it here right
i cant open or find the default.st
Yeah, the Workbench does not let you access it, the st files might not even be included, just the built runtime tables
so for the mod you dont need the orginal Table just create a new Table what i use for that specific mod is that correct
Yes
i added it into the Game Project -> WidgetManagerSettings -> String Tables
i added the new String table to it but it does not work
i added also the Translation string to the HUDManager in the playerController
do i forget something?
Hello all!!
I am really good with Arma 3's SQF language but I really really struggled to even find my footing into Reforger. I watched a few of the modding bootcamp videos which were helpful in familiarizing myself with the workbench, components, etc but I think where my struggles still largest lie is in how one would go about starting to make a mission. For example, initialization order, event scripts, etc.
Does anyone here have any resources that were helpful for them while learning to build missions? Were there any resources that helped in learning client / server-side relationship? Is anyone here an SQF native who struggles a bit with the concepts of OOP and have any guides or suggestions on how to navigate that?
Apologies in advance if this is all a really loaded question. Would love to get into Reforger, just struggling to find my steps.
Hey guys. I'm looking to add a custom construction object for construction trucks. I want to build a Hab object like from squad.
Can anyone point in the right direction:
Where is the list of construction objects for conflict?
What is the file path to the bunker construction object?
What components do I need to create a physical supply depot?
I already know where to look for this, but any tips on a creating custom spawn point object?
Im getting a bit confused when looking around at KickCauseCode...
I want to "capture" the reason for a disconnect, and the potential error message... Am i even looking at the right class here?
can anyone see where the broken expression is here?: SendMessage(playerId, string.Format(" Discord Integration: %1", configManager.IsDiscordEnabled() ? "✅ ON" : "❌ OFF"));
im neww to the arma tools and very confused
enfusion doesnt support ternary operators
Whats the name of the action for placing vehicles in building mode?
anyone help with adding enfusion character persistence to my server/scenario?
very new to reforger tools and im having some rough luck here
Hey, probably a stupid question but how do you DEspawn prefabs from script?
I'm trying to make an entity that has a vest equipped delete itself when it dies, but no matter how hard I try, it doesn't work. Am I doing something wrong?
{
// More code...
// Store reference to delete after explosion processing
IEntity bodyToDelete = m_OwnerCharacter;
OnItemUnequipped();
GetGame().GetCallqueue().CallLater(DeleteBody, 200, false, bodyToDelete);
}
void DeleteBody(IEntity body)
{
if (!body)
return;
delete body;
}```
If you're trying to delete everything on the character use
SCR_EntityHelper::DeleteEntityAndChildren
What is the best strategy of loading custom config and using those values across multiple files?
if class of your config is inherited from class of some attribute then you can use it directly
Thank you, you are absolutely correct. I also just found out I was looking in the wrong direction.
I have to add that this doesn't seem to work client side, only server side
For context, this is in a GameSystem that is defined for both client and server
That highly depends on what you're actually doing, some functionality can't run client side regardless.
Some code would help I'd say, sorry for leaving that out but thanks for taking the time to answer.
I've got a config in the mod and that is confirmed loading serverside OnInit but once I call GetVoteGroupByName from a menu for example (clientside) I get a Reason: NULL pointer to instance. Variable '#array' during call 'array<@ZERO_VotingGroupConfig>.Count' error.
class ZERO_VotingGroupSystem : GameSystem
{
static ref ZERO_VotingGroupSystem s_Instance;
protected SCR_VotingManagerComponent m_aVotingManager;
ref array<ref ZERO_VotingGroupConfig> m_aVotingGroups;
ref map<string, int> m_mLastVoteTimeByGroup;
static ZERO_VotingGroupSystem GetInstance()
{
World w = GetGame().GetWorld();
if (!w)
return null;
return ZERO_VotingGroupSystem.Cast(w.FindSystem(ZERO_VotingGroupSystem));
}
override protected void OnInit()
{
ZERO_VotingGroupsConfig groupsConfig = new ZERO_VotingGroupsConfig();
m_aVotingGroups = groupsConfig.m_aVotingGroups;
}
ZERO_VotingGroupConfig GetVoteGroupByName(string name)
{
foreach (ZERO_VotingGroupConfig group : m_aVotingGroups)
{
if (group && group.GetGroupName() == name)
{
return group;
}
}
return null;
}
....
the config manipulates how the UI is displayed and provides config that I will need server side. So I'm stuck on conditionally displaying the UI from a config in essence.
How is ZERO_VotingGroupsConfig::m_aVotingGroups getting populated?
Your ZERO_VotingGroupsConfig::m_aVotingGroups could be getting populated by functionality that only the server can run. Meaning it's null on the client.
I have a config file that is located in the mod, in the folder Configs that contains:
ZERO_VotingGroupsConfig {
m_aVotingGroups {
ZERO_VotingGroupConfig "{66610CC5ADA12E83}" {
m_Name "y"
}
ZERO_VotingGroupConfig "{66610CC5ADC54F4C}" {
m_Name "y"
}
ZERO_VotingGroupConfig "{66610CC5AD39F9C8}" {
m_Name "y"
}
}
}
Based on the following classes:
ZERO_VotingGroupsConfig.c
[BaseContainerProps(configRoot:true)]
class ZERO_VotingGroupsConfig : Managed
{
[Attribute("", UIWidgets.Object, "Voting group configs")]
ref array<ref ZERO_VotingGroupConfig> m_aVotingGroups;
};
ZERO_VotingGroupConfig.c
[BaseContainerProps()]
class ZERO_VotingGroupConfig : Managed
{
[Attribute()]
string m_Name;
};
I've stripped some details which aren't relevant for this issue
Creating a new instance of ZERO_VotingGroupsConfig isn't doing anything in regards to your conf file.
You need to create an instance of the actual config file that you're trying to use.
override protected void OnInit()
{
ZERO_VotingGroupsConfig GC;
ResourceName RN = "{965E7D57CC2AB8E0}Configs/ExampleConfig.conf";
GC = ZERO_VotingGroupsConfig.Cast(SCR_BaseContainerTools.CreateInstanceFromPrefab(RN));
m_aVotingGroups = GC.m_aVotingGroups;
}
Ahh then I misinterpreted Vlad then, because that was what I was initially doing. I will retry that in a moment and give an update asap
It works
If it's not a value that you intend to actually be changed you can just use a const.
Otherwise make the ResouceName an attribute of the system
[Attribute(defvalue: "{965E7D57CC2AB8E0}Configs/ExampleConfig.conf",params: "conf class=ZERO_VotingGroupsConfig")]
protected ResourceName m_VotingGroupsConfig;
override protected void OnInit()
{
if(m_VotingGroupsConfig == string.Empty || !Resource.Load(m_VotingGroupsConfig).IsValid())
m_VotingGroupsConfig = "{965E7D57CC2AB8E0}Configs/ExampleConfig.conf";
ZERO_VotingGroupsConfig GC;
GC = ZERO_VotingGroupsConfig.Cast(SCR_BaseContainerTools.CreateInstanceFromPrefab(m_VotingGroupsConfig));
m_aVotingGroups = GC.m_aVotingGroups;
}
With a default value it may not ever be "empty" but, it's safe to assume that if someone can break it they will. So some checks before hand are advised.
Thank you very much, this works perfect indeed. I've been banging my head over this all day 😅 my mistake was using resource.GetResource().ToBaseContainer() and BaseContainerTools.CreateInstanceFromContainer
I wasn't sure how it worked but I saw a config beeing loaded for hints like that in the source
Great advice thank you 🙂
For loading configs just use SCR_ConfigHelper
Or just cut out the middle man and use SCR_BaseContainerTools::CreateInstanceFromPrefab
Config helper does do some "null checks" for you though.
ZERO_VotingGroupsConfig GC = SCR_ConfigHelperT<ZERO_VotingGroupsConfig>.GetConfigObject(m_VotingGroupsConfig);
that looks clean yeah, I will have a look at what null checks I need as I need to properly disable some UI elements depending on the results.
both solutions do it for me, thank you both very much for helping me out 🤟🏻
What's the difference between Resource.Load and BaseContainerTools.LoadContainer? Both seem to be the same.
Resource.Load is through resource manager only, it has to be in resource database or otherwise it won't work
LoadContainer will try basically Resrouce.Load first, and if failed then goes directly into trying filesystem
Still don't get it tbh, resource manager builds asset list from file system as well isn't it? Is there upside/downside to either?
BaseContainerTools.LoadContainer is more useful for plugins in WB
Where you might want to load a config file from outside game dirs or paks
As it will be able to read from unregistered resoruces
🤔
While the .Load() one is there to use resource manager
Which will need them to be registered (Have meta file on them)
BaseContainerTools.LoadContainer will be okay to use filesystem paths as well, unlike Resource.Load which should be used with actual ResourceNames
Here is a reference I gave before for understanding filesystem in enfusion
Thanks, guess I gonna have to make use of it to fully get it. Bookmarked that post for myself.
resource manager builds asset list from file system as well isn't it? I
No
Only to registered resources (Those that have meta files to them) have ResourceName. But this is talking about resource databse
Unregistered resources have no ResourceName
The ResourceName is more than just an ID tied to a filepath
That ID, is not just for quick lookup like some people think. It's also the basis of the whole modding of configs and so.
Got it, thanks for clarification
Does anyone know how I can make this config class renamable in the config? Since there isn’t a read only UIWidgets, I’m trying to work around the fact that m_VotingType can’t be editable but still needs to be recognizable.
[BaseContainerProps()]
class ZERO_VotingTypeConfig : Managed
{
[Attribute("4", UIWidgets.Hidden, "Voting type", "", ParamEnumArray.FromEnum(EVotingType))]
EVotingType m_VotingType;
[Attribute("true")]
bool m_Enabled;
bool IsEnabled()
{
return m_Enabled;
}
};
You can !
Here is a quick made up example usingm_sName
[BaseContainerProps(configRoot: false), SCR_BaseContainerCustomTitleField("m_sName")]
class SCR_VotingConfigEntry : Managed
{
[Attribute("", UIWidgets.EditBox, "Vote name")]
string m_sName;
[Attribute("", UIWidgets.EditBox, "Vote description")]
string m_sDescription;
[Attribute("", UIWidgets.CheckBox, "Is voting locked by GM")]
bool m_bIsVotingLocked;
}
in your case I suppose this would do ? (untested)
[BaseContainerProps(configRoot: false), SCR_BaseContainerCustomTitleEnum(EVotingType, "m_VotingType")]
class ZERO_VotingTypeConfig : Managed
{
[Attribute("4", UIWidgets.Hidden, "Voting type", "", ParamEnumArray.FromEnum(EVotingType))]
EVotingType m_VotingType;
[Attribute("true")]
bool m_Enabled;
bool IsEnabled()
{
return m_Enabled;
}
}
Does anyone else have same issue with the hints in script editor? Its so annoying.
What is the issue exactly ?
hint overlaps half of text and do not disappears when i move with arrows in text
Guessing you're on high res monitor with UI scale >100%?
Do scripted inventory actions only work for weapons as parent? I can't see the action when I inspect my gadget and have another item with a scripted inventory action in my backpack that registers to a context of the gadget.
no. i have 2 standard monitors with 1920x1080 and 1920x1200 res - same issue on both monitors
does anyone know how to get a vehicle to move when makeing a cinematic? I have a soldier in a jeep and scripted this, but I just can't get him to drive forward. He moves maybe half a foot. I attached it to the scene not the jeep entity. but either way it does not work. Any help is much appreciated!
**Hi hope this is the right place for this ! Does anyone know how to create an AI tracker team that moves to the players last know position in 60 second intervals ? in arma 3 it was getpos ...... moveto on loop with a pause before the moveto comman ! Any ideas would be grate thanks in advance ! ** // Create a function to make AI follow the player (you)
void trackPlayer(Entity player, Entity aiUnit)
{
// Loop to continuously check AI's awareness of the player's position
while (true)
{
if (aiUnit != null && player != null)
{
// Set the AI's waypoint to the player's position
aiUnit.GetWaypointManager().ClearWaypoints();
aiUnit.GetWaypointManager().AddWaypoint(player.GetWorldPosition());
// Optionally: Make the AI "alert" to the player, so they actively track and engage
aiUnit.SetStance(EStance.Alert);
}
// Small delay to avoid excessive computation
Wait(30); // Wait for half a second before checking again
}
}`
What is the best way to read what material (.gamemat, .physmat) bullet hit?
Hi, take a look at: https://reforger.armaplatform.com/workshop/597324ECFC025225 .. there was a youtube video by the developer that went through each part of the code. Can't find the video now ..
For waiting you can use GetGame().GetCallQueue.CallLater() if nothing else is available to you
I have a bit of a "stupid" question, but if i want to run a logic (call a function) every like 20 minutes, Would it be wiser to use a callqueue or should i rather have a component / system adding timeslices until the 20 minute mark is reached ?
And how big of a difference does it make ?
Yeah, It's the GetOrigin() method under IEntity and AddWaypoint() under AIGroup.
There's more but, I'll need to ask: Are you using this script for singplayer or multiplayer? And, will your hunter team be on the map at the start of the game or are you planning on spawning them in when your players meet a condition (i.e trigger, user action)?
I'm looking to make a triggerzone that prevents rockets and high caliber bullets from being used in that triggerzone does anyone have any experience with this?
Single player / Hunter team on map at the start ..... i was looking also for a way to loop the follow waypoint every 60 seconds in the editor to avoid running a script ! for the first 60 seconds they move towards the player but the waypoint does not spawn again for some reason and they just stop moving !...... testing lots of stuff !
Is there a way to fix this? How can I sync them together? 😄
I've revived the old Trailer mod (2022)
I've created an updated system.
With trailers and TD
everything is perfect in single player as always.
Another day another stupid question :
when i have for example the character entity of a player. Is there a cleaner way to get the player controller than go through the playermanager, get the player id and finally get the player controller??
I really hate this approach it feels unclean for me
Ok that's much easier since you can name your hunter entity and you don't need to differentiate between players
let's see...
First let's get your player position. In the game mode there's a method PlayerController GetPlayerController(); so we can do
PlayerController playerController = GetGame().GetPlayerController();
IEntity player = playerController.GetControlledEntity();
vector playerPos = getOrigin(player);
for your waypoints, you'll need to spawn a new one and assign it every time the 60 seconds elapses. Spawning things can be a bit tricky but you need SpawnEntityPrefab(notnull Resource templateResource, BaseWorld world = null, EntitySpawnParams params = null)
To utilize SpawnEntityPrefab you need a resource (The name of the type of waypoint you want to spawn. See images) and the spawn parameters (where you want to spawn the waypoint, i.e the playerPos).
We can start by generating some spawn parameters
I lifted this from Rabid Squirrel's videos.
protected EntitySpawnParams GenerateSpawnParameters(vector playerPos)
{
// Create a new set of spawn parameters
EntitySpawnParams params = EntitySpawnParams();
// Calibrate to our world map
params.TransformMode = ETransformMode.WORLD;
// Assign the position to those parameters
params.Transform[3] = playerPos;
// Return this set of spawn parameters
return params;
}
Now let's spawn our new waypoint
Resource resource = Resource.Load("the_name_of_your_resource");
AIWaypoint waypoint = AIWaypoint.Cast(GetGame().SpawnEntityPrefab(resource, null, GenerateSpawnParameters(playerPos)));
and assign it to our hunter group
SCR_AIGroup HunterGroup = GetGame().GetWorld().FindEntityByName("HunterGroupsName");
group.AddWaypoint(waypoint);
As for looping. I suppose you can use recursive function(?) by calling your method again 60 seconds later. GetGame().GetCallQueue.CallLater(the_name_of_the_method_you_put_all_you_stuff_in, 6000, false, What_ever_paramaters_you_used_for_said_function)
The rest of it is object oriented programing, and setting failing conditions. But I feel if you make it a component that you could place into your hunter group, you can have another way to loop things by using the EOnFrame(IEntity owner, float timeSlice) event mask.
https://community.bistudio.com/wiki/Arma_Reforger:Create_a_Component
Thanks ! I will mess around with this tomorrow, it will really spice things up when escaping through enemy territory knowing that there on to me !
yeah, no problem. Right now the hunter group will keep following the chain of waypoints. But if you want them to take a straight path to the player whenever it loops I suggest looking into CompleteWaypoint() found in the AIGroup class.
I saw some post from someone did a towing thing more recently, maybe somewhat works already
can't remember who author was tho
Depends on who needs the player controller. Server, Owner or proxy.
Usually server for my issue. If I'm inside a component i simply cast the owner as the pc.
Well not really issue. I'd say code that feels "unclean"
That's not "unclean" its boilerplate. Should be expected in OOP.
If you don't want all the boilerplate write a helper function.
int playerId = GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(storageOwner.GetOwner().GetRootParent());
Probably your best best
The above is missing like 5 null checks because try/catch is dark magic blasphemy to enfusion devs
I did already. Thanks a lot
With lines like these you're begging to crash the server
Didn't included that amount of null checks for that one line lmao
who doesn't love
if (object == null)
return;
over and over and over in each and every single fucking method
Unfortunately it's very necessary (learned that the hard way) :(
Vertical code length is always better than horizontal
but i'd love some support for a null conditional operator
We need ternary operators
yes please!
Uh, more like
if(!object)
return;
lol
I swear if a method, specifically IEntity returns null !object does not work and it has to be object == null
At least in an IEntity case
IEntity radio = m_PlayerController.m_aRadios.Get(0);
if (radio == null)
return;
Here it was
This was the case in which I had to use it
doing !radio for some reason did not return properly
Same thing for ray casts
if (p.TraceEnt == null)
{
found = true;
break;
}
Works
if (!p.TraceEnt)
{
found = true;
break;
}
Does not
I never had that issue on my end. I know some people use == null for readability and thought you were doing it for the same reasons lol.
But to me it never caused issues, except with enumerator but that's because i'm stupid.
I've done plenty of traces and it's worked perfectly fine for me
Okay
Odd
I can try again, but I spent literal hours debugging that raycast for it to have been that
Keep doing whatever works for you. It's just odd that !object has always worked for me
Oh same, it works almost 100% of the time, in the case of TraceEnt was like the only time I specifically had to do == null for some odd reason. Makes no sense as !p.TraceEnt should do the exact same thing
Just cast the controlled entity you got to SCR_ChimeraCharacter, then GetController directly from that
Will i find my player controller components in the chimera controller or whatever it is called?
You have two things
The controller and the controlled enitty
If you got the character entity, then it is the controlled entity
if you cast that entity to SCR_ChimeraCharacter
then you can access directly the controller
Which is where people usually add their components for controller logic
IEntity ent;
// Supposing ent is for sure ChimeraCharacter.
CharacterControllerComponent controller = SCR_ChimeraCharacter.Cast(ent).GetCharacterController();
Ok. Thank you. I wasn't aware that we could find our playercontroller component in CharacterControllerComponent.
Ty^^
And while you're here could i get more info on this question?
I keep hearing callqueues are bad since whatever we're passing as a param doesn't get automatically collected.
But are there other reasons we should avoid call queues?
Yes, bad design in general
Also it causes something we call callqueue explosion
Which is a big issue for us with mods and replication
as it stalls the replication threads
That and script invokers
which is why for A4 they are basically gone
Hmm.. would it be wiser to then count timeslices even for "long" wait such as like 20 minutes?
What's wrong with scriptinvokers?
I find them very handy to inform infodisplays about events
Tangled unmanaged code maker
You are receiving the latest Enf event system anyway at some point on AR
So you could use that which is not only faster, but clearer and with compile level errors for misconnections and recurssion issues
That sounds great
Like the idea behind script invokers is not bad, the impl of script invokers and the interface and thus pattern it provides is what is bad for code stability, maintainability and performance.
@red cedar The issue with the CallQueue you usually use is that it is global
Everyone adds things to it
whcih get checked every frame
the more you add, the worse it gets
at some point it explodes and stalls many things
I've noticed that on populated server sometimes a scheduled call is dropped completely. Which i assume is what you're referring to as callqueue explosion?
IF you really need CallQueue
Then just do anew callqueue instance and store it on a system
then tick it manually there
That would be better
And would adding time slices every frame on a component until we reach a desired value be a bad practice or would it be alright?
I usually do that for clients sided code such as hud displays etc. But i'm not sure about server side and for longer periods
avoid periodical events on components
Use systems
Issue is that having to tick for example 10 components is worse than ticking a single system
Also the process to decide what to tick from engine is not free
It's more efficient to use system
and more manageable for you as well
As you get a single point of control/update
Suddently if you want to connect those components updates to other updates, create dependencies, etc
you will heavily suffer with the component approach
Not to sidetrack, sent you a DM Mario - no rush, just in case it got buried.
Ok that's good to know. I was told to only use system for short periods.
Thanks a lot for your time Mario i really appreciate your clarification, i try to produce cleaner code so that's why sometimes i come up with those silly questions ^^
I'll also need to test out the CharacterControllerComponent approach to find my components and if it doesn't work i'll just keep using my helper functions
Anybody know where to work with the x/y green lines on the map widget for layouts?
These
And MapWidget.c is just generated basically empty script.
Hello, do you think it would be possible to have a script that would move a prefab from point A to point B following a spline?
I haven't been able to find an example.
I have a script that spawns artillery barrage immediately but I want to delay it from when it is called.
I tried calllater but it just doesn’t spawn then.
How do you do a delayed spawn?
Check out this component SCR_BarrageEffectsModule
CallQueue?
Avoided callqueue and did a tick system like this for anything that needs periodic updates, both are bad practice ;-;
Going to wait until the new event system is released though to change what I have. Thank you for the information on these
Will do. Thank you.
Will do thank you.
The issue really with components that tick constantly is that every component is replicated to every player (within bubble) and you are essentially wasting the engines time per component per client which that component really shouldn’t need to tick on, at least that’s what I’ve found
System usage saved me lots of network traffic client side.
some things do need frame events though, you’ll never really have a perfect solution but a lot of big servers right now are having replication related stalling on Xbox as far as I can tell
Which leads to a 10 second freeze for clients when players join or leave, or shoot tons of rockets, because a lot of data is being streamed at one time
I'll have to look into systems big time then, always got away with a time check at the top of my postframe or on frame functions
I do the backend stuff for Badlands and that has been a huge issue. I did read the rpldocs which was a lot but was quite useful and we were able to work on getting things like that diminished
And it definitely depends on what you’re doing as well. Let’s say it’s a state that all players should see, kind of makes sense to have the component frame for all clients, custom movement protocol would be a good example. Because that logic has to live somewhere, and if it lives on the instance which needs to be simulated, kind of makes sense.
Alternatively, if that state can be invoked (whereas you basically have a client ask “hey can I get this data”),using system to store that data and send it when needed, especially via player controller (once I learned about its power it became a god send), then you can really tighten network usage, send batch updates or filter updates per player as needed, or have system send component changes to components for storage via RplProp if it must be readily accessible without request by clients
A huge thing with the freezes too, it happened a lot on some sort of user action, gotta make sure to restrict the action to client or server where and when needed. Understanding replication made me understand that, there's 60 things being replicated when it should just be to the person using the action and the server, unless not
Yeah server only actions are pretty much the way to go, I like client based without proxy for things which only the player sees (like HUD), that way you aren’t wasting network usage on worst case 128 transmissions of that data where it does not apply.
As I code I ask myself a lot now after learningmore about replication, should this be ran on the client or server? Seems to have helped a lot of issues we've had understanding and slimming down replicated things
This will also help a ton. We found the var limit in enfusion the other day due to a hefty economy script.
Which it's all wrapped in callqueues to update prices for everyone 8^)
would anyone here be so kind to possibly help walkthrough maybe guide me on setting up a proper vehicle the vehicle in question being the lifeboat from halo,
even if no help can be offered I woud like to ask questions (without flooding this chat) about whats possible and what isnt possible when it comes to it.
also should note I have no prior experience to setting any vehicles up, so any help is greatly appreciated.
#enfusion_model may be a better place for this question. Correct me if I'm wrong if there are any better channels
I thought it might be the best place due to the needs of the lifeboat, doesn't necessarily act like most vanilla vehicles in reforger do.
most useful and important bootcamp vido of them all btw ^
I'm having a weird moment with tasks...
so i'm spawning the task but i can't seem to figure out why the name isn't being set properly.
if(m_taskPrefab)
{
Resource resource = Resource.Load(m_taskPrefab);
if(!resource) {return;}
EntitySpawnParams spawnParams = new EntitySpawnParams();
spawnParams.Transform[3] = GetOrigin();
m_taskEntity = SCR_TriggerTask.Cast(
GetGame().SpawnEntityPrefab(resource, GetGame().GetWorld(), spawnParams)
);
m_taskEntity.SetTitle(m_sMissionName); // doesn't work ?? or there is something i don't quite understand
m_taskEntity.SetDescription(m_sMissionName); // works fine
}
Thanks in advance ^^
At some point you'll make your way back in here, but if you don't even have the life boat itself set up as an entity then you got some more to do before getting functionality setup
Good morning
Today's experimental update contains an inactive and not fully finished version of our new save game system. This is entirely incompatible with anything you might have built on top of the old scripted save manager core and it's associated JsonApi structs.
If you are super curious to see the new system and how it generally works you can search for "Persistence" as keyword in config and scripts later.
The more polished version with some API changes will come in another experimental update. Including full documentation and examples.
Anyone using my modded persistence solution: That should still work and I will give some migration examples, but I will deprecate it as soon as 1.6 hits stable as anyone will want to transition to the vanilla solution. It's > 100x faster than my mod with ~80% less memory consumption.
Is new version also limited at funny 1 MB
Hi, is there any way to tell clients to connect to another server?
No no limit, we'll reach for the sky ... https://youtu.be/7kmEEkECFQw?si=4zAzS12_HnmBbuFz&t=139 ... except on consoles where Xbox has a total limit of 256 MB across all saves and we hard limit you to maximum of 10 save points per mission if you use our general save manager. But for DS in general you can do what ever you want. New binary saves are also available as format which makes it all 🤏
🙁
is there likely to be at any point in the future (or in A4)?
Maybe, it will require some additional user prompts to let them know and accept etc. It must be an active user choice if and where they want to connect. No chance of silently moving them onto another server instance for some sort of round based lobby server
yeah at the moment I display a message telling them to connect to <other server> but it's kinda high friction so just having them able to click "Ok" on a prompt would be a lot easier
Please just add a freaking popup that says
"You are offeredd to connect to another server: Name / IP"
It would be such a useful feature in the engine to allow changing servers with scripts.
Anything 🙏
Will we see improvement to the http client any time soon?
Not in 1.6 probably. the built in http database for persistence which I want to ship (in an even later exp) simply handles everything in gamecode. script raw usage of rest api is on the list but we have many pressing issues to deal with so it will take time until it is on the schedule
So Xbox will be able to have persistence even if playing offline?
I am not an expert on console specifics and if any of its saving requires online connectivity, but in general the system supports saving on consoles the same as on other platforms and this includes modded scenarios who could previously not do it, as no access to fileIO script api
Hmm ok.. i was referring to raw api usage which is what i used for shared progress.
Good to know ty^^
Will we eventually get the possibility to have either an Await or traceback for which player the request was ran(server side) without having to return the uid / id in the response?
Sounds promising. Can't wait for 1.6. Thanks!
I am not sure what you mean.
Nvm i just realized that i should refactor my code...
I was reusing the same callback instance for all of my requests of the same type.
Could you just tell me wether it would be a bad idea or not to instantiate one callback instance per request?
it depends on your needs. if you need context info like which player id it was for then you will have to make a new one every time. does not really matter
Okk good to know.. currently i was adding the uid as part of the response and iterating through every player to see who has the uid from the response.
Thank you ^^
GetPhysics no longer works when referenced.
How can I correctly reference the new logic now?
Anyone making an open source RP gamemode here?
How long are we looking at until the new save system is in non experimental?
Need to plan if I should keep building my own persistence system or pause and wait to leverage this.
We want to have 1.6 released as soon as possible. I would not invest any more time into any custom modded solutions that are not based on what exp has to offer
Awesome, exactly what I needed.Thank you very much
Is this the reason players lose rank after reconnecting from a crash in 1.6, or is that a separate/new bug? Just trying to figure out if I should submit a feedback ticket
Known and fixed in one of the next updates
Hello everyone. I'm trying to modify respawn behaviour. I have a mod that enables an Spectator mode. I want to launch the spectator mode for a player when is killed. How can I do it? Thanks!
Help please - i changing Transmittin range, save prefab and change in new by the Building conf list, but in game Conflict start - radio still have 2k range (base stay 1 m range), and some wear - in Tools - game it can work normal, but if im upload to WS and start game like DServer - that work like vanilla (2k range) - some one know how it works and how to do custom range wich will work?


