#enfusion_scripting
1 messages ยท Page 11 of 1
That just crashes the game though so irrelevant
A modder might create one
I guess the reason is: "OOP philosophy uber alles"
is it possible to create a world that users can join into and walk around/practise shooting or flying while waiting in qeuee ? like they can walk up to a sign in the "waiting world" to click which server to join or is that just not possible yet with arma. idk if im making sense at all
Technically yes
No, game crash. You are better off spawning a room at the edge of the map or something stupid like that.
Don't talk stuff you don't know, no trolling
It's a legitimate question
So basically, don;'t do static for systems
Technically possible does not mean actually works, in my case it didn't
You will cause issues, specially if a modder creates another world
You probably did something wrong
Or a system with static messes you up
Hence why do it correctly
If I am doing modding and I get game crash it means there's bug in the game or engine. I should get error not crash.
how would i go about studying up on this to see all relevant info ?
The reason why I am telling to not do that is because of that and more things
Misbehavior bc suddenly a system used the wrong system it connected to
and many other things
Anyway this is not changing, it is more prevalent on A4
So you have to learn it if you want to do stuff in A4
current docs are in doxygen
But that implies your entities are spawning in those secondary worlds. My entities only spawn in the primary world.
SomeSystem.Cast(GetOwner().GetWorld().FindSystem(SomeSystem))
vs
SomeSystem.GetInstanceThatMatters() //static variable
See, the issue is exactly that
If you somehow got the system on the second world to handle some of your entities
Though second approach assumes you're NEVER going to execute the code outside of main game world otherwise it might mess things up
Then that's where you find issues
Or items in second world registering into your first world system
Which is common case for inv preview items messing with main world systems
When they should not
Suddenly you get two items representing the same but technicalyl different because they both used the main system
I guess it makes sense, I just hate calling lots of functions not understanding what they do exactly and how slow they are
sorry current docs for this is in something called doxygen ?
If it's inv preview enabled, then last part is not what happens
Yes
Also noticed I am a bit high in tone, sorry. I got caught mid migraine
But just avoid doing the static
Specially if you want to transfer nicely to A4
Or if you want to not mess with mods that make custom extra worlds
and specially if you want to also deal with preview world
yeah fair enough. your good man, hopefully your migraine goes away soon ๐
also thanks for letting me know about this. didnt think it was possible till now. ill look more into in the future
Scripted method that gets a static variable is slower than native FindSystem
Haha that's crazy
That's whole lot of gets and then a cast VS single static variable
I wish I knew how to profile to test
One is doing stuff in CPP, another one calls many CPP methods internally through the hell of the Script VM instructions
The only way I know how to time something is to use two System.GetTickCount()
That is about the worst
But you do not have profiling tools we use
timeSlice doesnt work, time/unixtime obviously also doesnt
At some point maybe we will provide it, but if so then only for scripts
the diag menu script profiler is useful but only in some cases
GIB diag_codePeformance-like tool where you can feed it code bit and it measures it
But if you're going to give modders low level and nuanced features then it seems a bit weird a profiler doesnt come with it
Decision was mostly to it showing things that could be sued for hacking, or some other itnernals
But for only scripts it should be fine, but it is not prepared to only show that
Does it matter? There are still hackers and reverse engineers everywhere. You tell us protecting our stuff is fruitless but it seems like you restricting access to profiler for those reasons accomplishes... not much
But I do see it big priority, as I do see lots of modders that do care for performance but have no proper way of knowing
And it does affect the game
In many cases many have slowed down the game more trying to optimize network performance
Moving the latency from the networking layer into the actual game
Making it worse
But they could not measure that
Is that why there is packet loss on localhost nowadays?
If you freeze main thread, networking also gets frozen as it uses scripts sometimes
And the vehicle simulation desync correction got much worse in recent months
It can trip things
This is specially common thing when people misuse calllater
It always shows up after callqueue implosion
CallQueue on it's own is not bad
The issue is people using the general game one for it
They should use their own instance of CallQueue
Suddenly you have a queue system with hundreds of thousands of things to process every frame to know if it should call them or not
Having your own on your own system, ticked by it only having stuff relevant to you. Is better than the general one
I wanted to write my own callqueue as an exercise but not being able to pass functions as parameters nuked it
just return the callqueue
It's what GetCallQueue() does anyway
Yeah but I mean from scratch
You wanted to make it from scratch?
The limitation saved you then
Why?
But I could have not used scriptinvokers if I could pass functions as parameters
There's a few reasons. One of them is I want to collect metrics on execution every time it runs.
Yeah if you had the profiler you would not need that
Not just for performance reasons, for observability reasons when I export metrics from the server to pushgateway
You can measure script code like that
There is a whole class for that
forgot the name, sec
// From Debug class
//! Starts measuring time until EndTimeMeasure() is called.
static proto void BeginTimeMeasure();
//! Ends time measurement which began with last BeginTimeMeasure() call.
static proto void EndTimeMeasure(string title);
Let me gather how to get the print as I do not recall that rn
I see there is SCR_TimeMeasurementHelper which uses System.GetTickCount()
THat's a hack
Unfortunately
I mean it will still work to measure how fast it runs relative to another run
Even if the time units are inaccurate or something, you can still see if something is twice as slow
Yeah but it adds random overhead
hey mario idk if your still on but im thinking of writing a email to the bohemia support regarding my mod to make sure my idea isnt against any eula/BL's TOS etc etc i know its vague but would it be wrong of me to seek clarification before i start making it
And trips the CPU even more when it comes to caches and stuff
It fucks you up for actual measurement
Thats ok if I just want to see how much slower function A is than function B, since both measurements factor in the overhead
It doesnt work for measuring how fast the function actually is in real time, but it's still useful
I see what you mean
I would like to see real world examples of common performance issues found in the game and mod scripts
I'm sure there's a big list you guys have and you could post it with how to fix it
CallQueue
Engine events (EOnXXX) on components instead of Systems
The usual ones we keep repeating
We repeat them for a reason
Components being used for processing logic themselves instead of just holding data
etc etc
Which the game is full of as well
What's wrong in having logic in say gamemode component?
It should have been a system, or separate class.
By the way any idea why MPTest loads fine when running server on android but Arland stops loading and just sits using 50% of a cpu core never loading into the actual world?
The issue is the update loop of the engine, you can read the Systems doxygen doc.
I was testing on my Galaxy S24
It will show you some of the issues there
The reason of not being able to know when to do something is also that
is my man tryna play arma on a phone ?
No just server
(The reason why people do CallLAter next frame or after 10s)
All because of logic in components and entities, instead of a systematic way
I'm no expert on anything to say, but I still feel confused about systems a bit, feels like them going against ECS approach
In A4 we might just block ticked engine events outside of systems
It's all because of convenience right? Like nobody wants to make a system just to do something every frame
We can't use ECS
It's protected by Unity iirc
The way it is designed for us is this
i know its stupid of me asking this but is it possible to save all scripts that are viewable in the arma forger in the script editor to a folder on my desktop ?
Entities for defining something existing in the world (With world related physical attributes like transforms), Components to add data to said entites, and to replicate state. And then systems to process everything.
Why is gamemode, faction manager, etc. are entities then? Outdated approach?
Wrong since the beginning

As I said before, the game itself is not a good example.
And modders just take what they see there
The unity ECS patent is more about memory allocation than design of the system though
Yeah I was talking about ECS idea in general
?
Exactly what I've been doing, trying to replicate practices seen in the game itself, instance singletons, logic in game mode components, etc.
I would need to ask for AR. Idk when or if it will actually hit it
So how would you reimagine factions in ideal world then? Faction system and then how do you define factions? In the system itself?
Factions aren't physical, they don't need world transformation, placing "faction entity" would be wrong design then
They can't be data of some entity, as that entity has world transformation too
Current implementation of factions being data of a component of a game world entity is wrong too
Systems can have configs in them
You can use attributes on systems
And you can also just read any .conf from anywhere
Not trying to be annoying, I'm just trying to grasp the proper design philosophy you'd expect
configs are annoying to edit / manage, no?
No?
Everything where you set data in Enf is a config
.conf, .et, .enat, .ragdoll, etc
even the anim graphs
What are the advantages of your config system than say using json?
Honestly the #1 thing I don't like about new engine is having to click around stuff, I like consoles and editing text files
Editing configs through menus is indeed very annoying
True, especially since it loves to crash when I copy and paste using the UI
Same, many times I have wanted to do mass edits or go over thigns faster, just open the .conf in text editor 
Old decision
Not changing
So no need to argue
Everything is built on top of that
conf is fine, just needs more UI/UX
Like everything
Didnt mean as an argument, genuine question, maybe they do something better
I wish "Text view" was editable, or at least copy-pasteable
I mean technically you can do similar things, it might actualyl be more text on json
The only thing tho, is that configs here mimic memory layout when binarized
And also weather config is very very annoying and infuriating
So it's faster to parse even on source format
LMAO it's the same with the playerdata from data collector, it's just an array of numbers and if you add new stats you're cooked
At least its not XML 
You are not supposed to edit manually in text editor
And you will never get that support
It's unsafe
emat and stuff is nice tho it looks good in txt file and I just use FileIO to edit them most of the itme 
Imagine being the developer doing those UI widgets for the weather editor having to build UI entirely around array indices instead of you know, KEYS
brother, they break every update ya'll chgange the weather parameters
the order gets wrong
It happend like 3+ times maybe more
WEather eddcitor should really use the conf model, so they parameters are the same
That is issue of the feature
Gotta save those bytes
weather editor still crashes when you click the curves wrong?
not the conf system
many such cases ๐
I do send the reports

It feels to me that this config was one of those that were supposed to be binarized
But the configuration mimic the attributes they have set
The problem is that the weather editor is really cooll and useful and fun.
But I can't create a script and FileIO the changes after updates ๐ญ
If they set these attributes to be used directly by the code
then they would probably be a mess internally in the file
You should not use fileio
You should use the base container api
base container are the config underlying system
๐ค that can edit files and parameters?
THere any examples for base container api usage in vanilla?
Yes, the workbench plugins
is there a way i can open all the scripts from the arma folder that you can see in the script editor on visual studio code ??
One example of configs I sometimes wanted to edit all the vhcsurface to edit all terrain roughness / friction.
Just made fileIO and changed the things....
I must look into this "base container api" sounds promising
BaseContainer
BaseContainerList
BaseContainerTools
and anything related to BaseResourceObject
Yo its me or the workshop is dead ?
By class you mean?
Well I want to load the config and interact with it
Do I need to CreateInstanceFromContainer?
I mean you can interact through the API
BUT
If you want it to be created into a script class from it
Then yes, that method
That's ok, only twice as much boilerplate as I would like, but one extra line is not that much
LoadContainer loads the actual data container (tied to a file)
CreateInstanceFromContainer creates an instance based on that
If we did not give you this control you would also complain
I feel like
Better to give it
You can make your helper functions if you want to minimize and know the specific usage you will give
We don't so that is why you get the raw API
been creating overrides w/ .meta files on fileIO
Sometimes when we know we do add it
Btw why does SCR_JsonLoadContext.ReadValue("", ...) fail when reading to a variable that has a key with a default value that the json config does not have?
Like the Utils classes
Is there no way to override a desctructor?
Just getting this when I try
scripts/Game/SALRHS_SAL_DroneHudComponent.c(21): error: Function '~SAL_DroneHUDComponent' is marked as override, but there is no function with this name in the base class
there is definitely a desctructor method in the base class
But it;s hard to know all
override void ~SAL_DroneHUDComponent()
{
super.SAL_DroneHUDComponent();
}
I think @torn bane was checking on that. Pinging him now
I think you have to override the file, if you use the same folder/file structure, you can overwrite the entire file.
I don't think you can override consturctors and deconstructors AT ALL using override
If you want to add stuff to it. Yes possible
If you want to remove previous behavior, not possible
for example this works
modded class SAL_DroneHUDComponent
{
void ~SAL_DroneHUDComponent()
{
// Some new code here
}
}
Notice that there is no override
and no super
Only thing you can do is append logic to the original
same for constructor
And the reason is to not make script instance creation and deletion slower for everything
This is why, in many classes you se an Init method
that is called only on constructor
So that we can give modders ability to fully modding it
by the way, do [attributes] work for default values when creating an instance with new?
afaik yes
For example here is the config definition
[BaseContainerProps(configRoot: true)]
class ServerMessageConfig {
[Attribute("", desc: "Discord link")]
string discordLink;
[Attribute("1", desc: "Should message open automatically when joining server")]
bool openOnJoin;
}
and this is json
{
"discordLink": "https://something",
}
then:
SCR_JsonLoadContext ctx = ctx.LoadFromFile(path);
variable = new ServerMessageConfig;
ctx.ReadValue("", variable);
// false
Ah JSON related
idk
I have never touched that API myself
I feels like it should load what it can and keep openOnJoin as default
Did you ask before if this was possible?
No I didn't even know that was a thing, I'll try it out some time today to use BaseContainerTools
If you will deal with files
Then on top of what I show you there
also use/deal with the ResourceManager
For example if you need a meta file
resourceManager.GetMetaFile(filePath);
You will notice,that the meta file itself is a BaseContainer too
Which means you can use the BaseContainer class family
It's documented on wiki to some extent
Ok so there is a helper lol
ConfigClassHere someVar = SCR_ConfigHelperT<ConfigClassHere>.GetConfigObject(configPath)
Nice
That is more or less what I would have had to type up on my end anyway to get what I want
Bet thank you
I think I already told you bacon that there was a "bug" of sorts and the new default reading api fully supports what you intend to do. so you must wait for experimental ๐
Bacon refuses to use exp
Is it possible to set a maximum rank on a player?
For example I want the maximum obtainable rank to be corporal
Hello, about CreateInstanceFromContainer, does this can be done from a modded class of SCR_CharacterControllerComponent with a class attached to the weapon like in the screenshot ? I just want to detect if this class is attached to the weapon to toggle off my logic in the CharacterController
the basecontainer is kinda annoying but looks like it works
m_API.SetVariableValue(
entitySource
, {
new ContainerIdPathEntry("components", componentIndex)
, new ContainerIdPathEntry("Simulation")
, new ContainerIdPathEntry("Axles",t_Index)
, new ContainerIdPathEntry("Suspension")
}
, "MaxSteeringAngle"
, "" + t_fSteeringAngle * 1.5
);
going through hierarchy of multiple containers 
it does however beat manually changing values on prefabs etc. with a mouse and keyboard
How do you upcast from BaseWorld to World? ๐ค
SomeSystem.Cast(World.Cast(parent.GetWorld()).FindSystem(SomeSystem))
``` => `Cast not supported on type 'World'`
There's a special method for world casting:
World w = ChimeraWorld.CastFrom(baseWorld);
Implicit casts also just work:
World w = baseWorld;
But not the explicit cast, there must be something special about worlds in engine or game code which Class::Cast() cannot handle
What a mess
SomeSystem.Cast(ChimeraWorld.CastFrom(parent.GetWorld()).FindSystem(SomeSystem))
@minor agate Is this still faster than addressing a static singleton variable?
Thanks btw, seems to be working within a single line
Now add 4 null checks
Might as well crash the game if its null at that point 
Oh yeah, ChimeraWorld.CastFrom returns null for prefab editor world
GIB walrus operator
ChimeraWorld world = ent.GetWorld();
if(world)
{
m_SomeSystem = SomeSystem.Cast(world.FindSystem(SomeSystem));
}
```Safe version to whoever will find it through search years later
Just do implicitly directly tbh: ChimeraWorld world = ent.GetWorld();
Now we need more checks in caller code, that will use this world
ChimeraWorld world = ChimeraWorld.CastFrom(GetGame().GetWorld());
m_tagSystem = TagSystem.Cast(world.FindSystem(TagSystem));
this is what i do
i think that if world is null, am already fucked and if my system is not here, i did some config wrong so it should break and i must fix
This works. So you can downcast AND upcast like this? What's the point of CastFrom then?
m_tagSystem = TagSystem.Cast(ChimeraWorld.CastFrom(GetGame().GetWorld()).FindSystem(TagSystem));
to do this i guess
ChimeraWorld world = ChimeraWorld.CastFrom(gameMode.GetWorld());
```Vanilla lines everywhere
anybody can help me to make a server like Dayz?
I guess in case you want to do it explicitly instead of doing an implicit cast into a variable that you don't need otherwise
Vanilla scripts also have lots of implicit world casts, I don't think there is usually a reason you need to use CastFrom
Just got a real lesson why its bad, had gamemode prefab with my component open in workbench tab and it messed with same gamemode instance and component in world editor, making workbench component "singleton" instead of world editor one.
Vanilla components also sent out warnings:
21:08:37.802 SCRIPT (W): 'SCR_AdditionalGameModeSettingsComponent' exists twice in the world!
21:08:37.802 SCRIPT (E): Trying to register a SCR_BuildingDestructionManagerComponent, but one is already registered!
21:08:37.802 SCRIPT (W): 'SCR_PerceivedFactionManagerComponent' exists twice in the world!
21:08:37.802 SCRIPT (W): 'SCR_PlayerListedAdminManagerComponent' Multiple instances of the 'SCR_PlayerListedAdminManagerComponent' exist in the world!
if (SCR_Global.IsEditMode())
return;
Yeah, but I guess I'm gonna try doing it the right way without singletons
You have no idea how many times I search for something in the Discord to get a stray hit about it and just see no follow up after haha.
Give it like 4-5 more years in A4 when you'll find a niche fix in this channel to an issue you've been having for days
Yes because world is pointers, so when you don't use CastFrom it is not safe, so in case the world is not ChimeraWorld it could cause crash
Casting down world need to use special CastFrom method
Is there an example you could provide with moving the attributes to the entity class, or a vanilla script to reference? Not entirely sure what you mean
I guess more so I understand how to move it there, but not sure how to access that attribute in the component once moved
or wait, should work as
CE_UsageTriggerAreaClass attributes = CE_UsageTriggerAreaClass.Cast(GetPrefabData());
``` yeah?
GenericComponent.GetComponentData() IEntity.GetPrefabData()
Additionally, to go back to the original issue I was having, I verified it's not a timing issue, nor does it seem to be related to any EntityFlags, as clearing them does not making a difference.
But it's %100 related to the TriggerAreaEntity being a child of the building. The component variable can be set with a area entity that is not a child of the building, just not with one that is a child. So I'm not sure what I could do to fix that currently ๐ค
other than, yknow, making the area entity not a child of the building, but kinda not an option with how it's been setup
anyone had an issue when spawning a prefab via an action it is spawning a duplicate of the prefab? The script isn't running twice
When is that coming out to exp though as it might actually make me download it to continue my project 
In a very long time due to MANW
MANW is on main branch, just push it to exp
I will if it means my code works correctly
Share whole code
I have been working on this project on and off for like 7 months now
Got off for the night but will thread it tomorrow
Yes MANW submissions needing to be functional with latest version of the game would be a nightmare if a massive update comes out right before the deadline haha.
is there a handy way to know which map the server is running on via script without reading the mission headers ?
why is it always when i ask for help that i find it...
GetGame().GetWorldFile() does the job
Because your mind is on the lookout for it
It's like when you learn from a new brand you never "seen/heard" before and then suddenly you notice it everywhere in the streets
same happens when i learn a new word in english, it only starts to exist after i learn it lmao
what is this
00:35:06.074 WORLD : UpdateEntities
00:35:06.074 WORLD : FixedFrame
00:35:06.074 SCRIPT (E): Usage of released BaseResourceObject 0x000002B2F8562F70 in:
00:35:06.074 SCRIPT (E): -- Stack trace --
00:35:06.074 SCRIPT (E): HandleMeleeSound() scripts/Game/Character/Melee/SCR_MeleeComponent.c : 214
00:35:06.074 SCRIPT (E): ProcessMeleeAttack() scripts/Game/Character/Melee/SCR_MeleeComponent.c : 315
00:35:06.074 SCRIPT (E): Update() scripts/Game/Character/Melee/SCR_MeleeComponent.c : 472
00:35:06.074 SCRIPT (E): HandleMelee() scripts/Game/Character/SCR_CharacterCommandHandler.c : 20
00:35:06.074 SCRIPT (E): -----------------
00:35:06.075 ENGINE (F): Crashed
00:35:06.560 WORLD : UpdateEntities
00:35:06.560 WORLD : FixedFrame
00:35:06.560 RENDER : ----------------------------------------------------------------
00:35:06.560 RENDER : ----------------------------------------------------------------
00:35:06.560 RENDER : Rend: Fps:1000000.00 (0.00ms) | Present 0.00ms | Wait4GPU 0.01ms (graphical 0.00 + copy 0.01) | defrag 0.00ms
00:35:06.560 RENDER : Rend: DP:0000 DPI:0000 DPR:0000 DPID:0000 Tri:00000 Vert:000000 CSRun:00|AllV:00x(00000) AllI:00x(00000) BegV:00x(00000) BegI:00x(00000)|TRes:0291
00:35:06.560 RENDER : ----------------------------------------------------------------
guid 9d662355-6080-4cf8-b5af-4af984ff82fa if anyone's interested
Im trying to do a loadout saving mod and Im really struggling with how this system works. Why is c SCR_PlayerController.GetLocalPlayerId() always returning 0 on server. If I skip the check for ```c
if(playerId == SCR_PlayerController.GetLocalPlayerId())
when i had to toy with the loadouts i just made my own system as i found it less confusing
because server doesnt have player controller but it has if server and player is same, like in workbench. Dedicated server returns 0 always.
u should use GetLocalPlayerId for client side logic only.
so how does a vanilla dedicated server return the correct player id when a player has a saved loadout?
is DoSendPlayerLoadout and DoSetPlayerHasLoadout not actually run on a dedicated server? if not, what tells the server that there is a loadout and its valid?
I gotta be missing something cuz if that always returns zero, saved loadouts would not work in vanilla
do u know how netcode and replication work in reforger?
GetLocalPlayerId works only on client side, server sends DoSendPlayerLoadout by Rpc to all players and players locally filter message by "playerId == SCR_PlayerController.GetLocalPlayerId()"
yeah I threw a print in DoSendPlayerLoadout that is only showing on the server though. should be showing on client no? ```c
[RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
override protected void DoSendPlayerLoadout(int playerId, SCR_PlayerLoadoutData loadoutData)
{
Print("[CPL DEBUG] DoSendPlayerLoadout - playerId: "+playerId+", local playerId: "+SCR_PlayerController.GetLocalPlayerId()+" Local Loadout avail? "+GetLocalPlayerLoadoutAvailable().ToString());
if (playerId == SCR_PlayerController.GetLocalPlayerId())
m_LocalPlayerLoadoutData = loadoutData;
}
Im thinking Im just going to add an action to the arsenal to load their loadout, that will probably be much easier.
do u see this two videos about replication and how it works?
https://youtu.be/asWxIIHT6d0?list=PLfUcrRpCM_fKjkTrkV-bqnknVbFCPA3YU
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 know the basics yes
from what I understand that function should be executed on both server and all clients
but the print is only printing on the server
which makes no sense to me
It returns 0 on server if you call it on server because you are calling the server player playercontroller. Try getting the player id of the actual player or the id of the player from a player's player controller.
does it not execute on the client at all?
iirc Player controller instances of other players are not available to other players except their own
So broadcast is useless here
hah yeah I figured it worked fine in vanilla... ๐คทโโ๏ธ
But I might be wrong (I am rusty now on AR shenanigans) hence my iirc
iirc the player controllers in AR only exist on their specified clients
It is a bit janky in vanilla too though, so maybe I should just add an action to load loadout on the arsenal instead.
1st rule of modding (Unfortunately).
- Never assume.
Always ask / test
- debug and breakpoints are yours best friends ๐
This method is not in player controller class
It's on SCR_ArsenalManagerComponent
in vanilla
Which is on gamemode, which is on all players
So the broadcast must work
yeah I have no idea why its not printing on clients at all. Ive already spent days on this so Im just going to quit and do an action to load instead.
How did you call the rpc?
You should have called it from auth
Vanilla function calls it, away from PC rn
Its called in two places: vanilla OnPlayerAuditSuccess() and vanilla DoSetPlayerLoadout()
How do I tell if those are called from authority or not?
How does one force a player to face a certain direction live? SetYawPitchRoll does not seem to be doing the trick alone. Offering 2 cookie for example ๐ช
There's RplRole, forget how to get it lol
what would be the best way to pass (or fetch) a value to a user action from another?
i have a user action to skip time and a user action to adjust the time between 1-24 hours but i have no idea how to get the time value to the first user action
any help would be much obliged
Quick breakdown:
User actions trigger on server and client for that set entity instance. Think of it like broadcast, so all players in the area run the script locally even if they aren't the one that pressed the button (this is also why it gives you a pUserEntity so you can filter). This can be used to have a user action trigger for everyone when one person pushes it, but it won't trigger again when a new player joins the game, so desync happens.
Depending on needs, in your example you probably want time set globally, but you need to get current time locally. UserAction has a function called "GetActionName" which you can override in your version of the action to return the current time (for the action text). Get the current time probably from ScriptWorldClock. Set on server (technically ScriptWorldClock says set world time only works on server so might be ok just calling it directly and not having to mess with the other methods to disable local broadcast/sending data locally).
in my case itll only be used in sp probably shouldve mentioned that sorry
ive also already got the time changing with screen effects and stuff setup i just dont know how to communicate the 12 hour sleep time to the script that does the main stuff
class ZEL_ExampleSleepAction : ScriptedUserAction
{
ZEL_HourSelectAction m_HourSelectAction;
override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
{
ActionsManagerComponent AMC = ActionsManagerComponent.Cast(pOwnerEntity.FindComponent(ActionsManagerComponent));
m_HourSelectAction = ZEL_HourSelectAction.Cast(AMC.FindAction(0));
}
}
Trying throwing the broadcast in a gamemode component
I've had issues calling broadcasts from the PC even if it was on the authority
see here: #enfusion_scripting message
Is there a way to add visual gizmos i cant find any methods that work
Like a ring around an area
Ah my bad, send the code where you call the Rpc on the server for the broadcast
Anyone managed to have Debug.KeyState working?
Trying to get left shift state with Debug.KeyState(KeyCode.KC_LSHIFT) but its always 0
Wrong context perhaps?
Using in _WB_AfterWorldUpdate
Tried adding Debug.ClearKey(KeyCode.KC_LSHIFT); before of after the check, same picture
Hey all, has anyone figured out how to extract name of MapDescriptorComponent? I'm trying to scan the map for all the cities and extract their names
Nvm, if anyone has this problem I resolved it using SCR_EditableCommentComponent, it's usually assigned to the same entity that MapDescriptorComponent points to
when i set building on map there is grass inside can i do something like grass cutter or so, or is something in options?
Why doesn't _WB_GetEditorAPI work (returns null) on some entities like GenericEntity but works on say SCR_DestructibleBuildingEntity?
It works on everything but it depends on where you are calling it from, as the documentation on it says. Example code please where you expected it to work but did not
Any direction to add a new comsumption type inside ResourcePlayerContoller for arsenalitem request? for exmple a persistance bank account for player.
any specific RPL operation need to be cared?
Tried to repro it but got confused even more, _WB_AfterWorldUpdate of a component only fires when its on GenericEntity if its in a Workbench tab, but not when its in World Editor
But if I attach same component to SCR_DestructibleBuildingEntity, event function _WB_AfterWorldUpdate fires in both Workbench and World Editor
This explains why API was null because function was firing inside workbench and not world editor
It may be setting some flags that cause it to activate
๐ค
//! Called after updating world in Workbench. The entity must be visible in frustum, selected or named. You can use editor API here and do some edit actions if needed.
Is your entity visible, selected or named? ๐
Maybe releated to ```
//------------------------------------------------------------------------------------------------
override int _WB_GetAfterWorldUpdateSpecs(IEntitySource src)
{
return EEntityFrameUpdateSpecs.CALL_WHEN_ENTITY_VISIBLE;
}
My bottom line is that generic entity or others are not inheriently different, their setup simply has a lot more configured. So check what is the minimum needed to get it to call by looking at how others did it
on generic entity it says
//! Called after _WB_OnInit or also later when editor needs to know whether _WB_AfterWorldUpdate needs to be called and when. Return value can be either 0 (event will not be called at all) or any combination of EEntityFrameUpdateSpecs. Avoid CALL_ALWAYS flag whenever possible to prevent performance issues
event int _WB_GetAfterWorldUpdateSpecs(IEntitySource src);
so it returns 0 by default which means it will not be called at all as the docs says.
No way to enable that from the component so I don't have to touch the entity I assume?
Using my component under generic entity is a no go then it seems
Anyway, thanks for the explanation
Hello, I have a replication of a variable and the players change it's state by pressing a button, should I keep the call on local client when publishing the project update ?
I don't remember if players can play reforger without internet connection and if yes, if the replication work also without internet
Can you provide a concrete example for your setup?
SP requires similar considerations like hosted server. For instance, the method specified at onRplName has to be called manually for the server.
Here the file! This is very small
In this one I have to call it also on local client otherwise I couldn't test it anymore outside of MP environment
tysm this worked perfectly ๐
any secret stuff make it to the hotfix?
i responded to the wrong message earlier (thanks for the help regardless) but this worked thank you ๐
wouldn't be a secret anymore if everyone knew ๐คซ
Is there any way to access pathfinding api from script? (i.e. to calculate on-road distance between points)
After installing the ConflictPVERemixedVanilla2.0 addon, I get this error when I try to test the conflict scenario I made. Does anyone know how to fix this?
I'm guessing because you don't have any ambient vehicle spawn points setup?
Is there a way to grab an image of what a camera is looking at?
Thank you very much!!!
Or project a camera onto a material
@ocean kernel I believe you've done something like that
I think I may have found it in SCR_CameraPostProcessEffect
is there any way to change the players angle? just want to force them to look in a specific direction
only thing ive found that sorta works is CharacterControllerComponent.SetHeadingAngle but is there anything that takes a vector? every other method ive tried hasnt worked or something has prevented it
At this point it's hard for me to think about what I didn't do
Was the UV for your screen just the whole 2048x2048 texture
Or does it even care about the UV Map
I always try to make sure the screen is separate mesh then it has its own material
UV is how texture is projected on model
anybody can help, when i jump from aircraft car. in water i die is there fall damage to edit?
You can use inputs and override them
Just override the lookup/lookleft inputs until character looks at sth
screen to world position to see how far from center the position is
CharacterAimingComponent t_Comp_Aim = GetAimingComponent();
CharacterHeadAimingComponent t_Comp_HeadAim = GetHeadAimingComponent();
if (t_Comp_HeadAim && false) {
float t_fRightAngle = t_Comp_HeadAim.GetAimingRotation()[0];
float t_fUpAngle = t_Comp_HeadAim.GetAimingRotation()[1];
bool t_bIsGoingUp = t_fRightAngle > 0;
if (t_fRightAngle > 1 || t_fRightAngle < -1) {
float t_fMissingFromMid = t_fRightAngle;
float t_fChange = t_fMissingFromMid;
if ((t_fRightAngle < 5 && t_bIsGoingUp) || (t_fRightAngle > 5 && !t_bIsGoingUp)) {
t_fChange = 5;
};
t_fChange = t_fChange * dt;
if (true) {
t_fChange = 0 - t_fChange;
};
// f_ActMan.SetActionValue("CharacterFreelookHorizontal", t_fChange);
// Print(t_fChange);
};
// float o_fUpAngleLimitUp = 1;
// float o_fUpAngleLimitDown = -1;
float o_fUpAngleLimitUp = 10;
float o_fUpAngleLimitDown = 5;
float t_fUpAngleMid = o_fUpAngleLimitUp - o_fUpAngleLimitDown;
t_fUpAngleMid = o_fUpAngleLimitUp - t_fUpAngleMid;
float o_fUpAngleLimit2Up = t_fUpAngleMid + 5;
float o_fUpAngleLimit2Down = t_fUpAngleMid - 5;
// if (Math.RandomFloat(0, 100) > 95) {
// Print(t_fUpAngle);
// };
I did this once to make the character look centered in the car once
f_ActMan.SetActionValue("CharacterFreelookHorizontal", t_fChange);
f_ActMan.SetActionValue("CharacterFreelookVertical", t_fChange);
basically simulates moving the mouse(or any input) in freelook
SCR_CharacterControllerComponent > OnPrepareControls
There's an example of overriding this function in vanilla somewhere too
legend ty
Yes, this looks fine. RPC do work in SP, but again it basically behaves like for the host of hosted servers.
would anyone care to help me understand what relates to player aiming/raising weapon. im trying to create a zone that prevents shooting and use of grenades but having no luck finding what actually controls that
SCR_CharacterControllerComponent > OnPrepareControls
You can just block the inputs
f_ActMan.SetActionValue("CharacterFire", 0);
Basically you do this every update and it will force the characterfire input to be 0
Even if a player clicks left mouse, the input in-game will be 0
so gun wont work but if they click UI in same zone it will work?
Yea
you OG
This ActionManager manipulation is really good and can do a lot with
Thank you very much!!!!!
Thank you
i add the component to my playercontroller correct?
https://reforger.armaplatform.com/workshop/60DB77CE6F1FE61D-MouseDriving
Download this and load it in workbench for an example.
You modded class SCR_CharacterControllerComponent
and override OnPrepareControls
Set the material BCR map to $rendertarget (like on a 2 polygon screen)
Use SetRenderTarget with layout (with items nested under RTTextureWidget) to put GUI > any $rendertarget on the IEntity
Put camera on the GUI layout using RenderTarget under the RTTextureWidget.
Searching the terms I've given you should fill in the blanks - don't have it in front of me. MFD Framework does this (except cameras for now)
Don't suppose I can change camera far plane max distance?
For player or in scripted camera?
player. SCR_CameraBase
Oof, think engine holds a deathgrip on it tbh
Thank you this helps a ton
Also with all of this work on cameras how do you propose deconfliction? @desert escarp
Working on some camera stuff right now and I know cameras are also used by some other mods and I can see an issue with two components colliding on the same camera index. Not sure if there is a good way haha
Idk if this is the solution but for me I spawn cameras only on the clients that need a camera, for instance my drones camera is spawned in whenever they connect to it and deleted after they disconnect. I've yet to see what this does to the IDs but this is just my personal practice to prevent conflicts
Its only on the client as well no one else gets the camera spawned
There isn't a "good" way to get if a camera is currently in use, as far as I can tell. My initial idea would be a gentlemen agreement to standardize index usage. The "camera entity" is just a wrapper entity that manages a camera with given index. As far as I can understand all cameras "exist" but only viewed when called by the RenderTarget widget's SetWorld method. The camera entity simply translates transforms to the camera, unfortunately.
Damn figured. Thanks.
Which is also why you only ever get the position from the engine with stuff like "GetCamera" it always exists, you just manage the position of it. They are never created or destroyed by us. SetWorld might do something under the hood to "activate it", maybe manipulation of the camera is not allowed before SetWorld is called - or SetWorld is simply a way to translate whatever index, it's data, from a given world to the layout, haven't gotten that far but it's my assumption.
Might be a weird question... in other languages you can essentially override or implement a way of hashing or comparing. Is there a way to add that to our custom types? I see the string type has a hash/compare function albeit it's an external thing?
Would like to have a type be used in a set or map, where checking for its existence doesn't need to be done by ref... if that makes sense
SetWorld is just to enable it on a specific world
You can have multiple worlds at the same time
Figured as much just didn't know if setworld actually tells the camera to instantiate in engine or if they just "exist" and have data based on the SetCameraEx - etc. functions.
How does one force a player to face a certain direction live? Offering 3 cookie for example
3 cookies now? Man that's a good deal, if I only knew 
How do I blacklist an item from being saved in a loadout
search blacklist in resource browser, its a config
"Can someone help me make a ShopSystem and Zelik_Banking so that I can buy from a Trader using ZEL_Cash?"
When spawning in a medical kit in my player's inventory via script i receive this message(and the items refuses to spawn)
'SCR_ResupplySupportStationComponent' needs an entity catalog manager!
Tho my game mode does not use any supplies or whatever, is there something i'm missing in the prefab's config that is preventing me from spawning theme or some kind of manager in the world ?
Is there a specific function I can call to find all entities by type? More specifically finding any vehicle on the map and storing that result into an array?
just mod this type and add it to some array on init
There happen to be a more minimal way to do this? Just looking to find them once in order to save them before the game ends. Need to find all vehicles currently on the map, save them, then server shuts down.
untested but feel free to try it
SCR_EditableEntityCore core = SCR_EditableEntityCore.Cast(SCR_EditableEntityCore.GetInstance(SCR_EditableEntityCore));
set<SCR_EditableEntityComponent> entities = new set<SCR_EditableEntityComponent>;
core.GetAllEntities(entities, true, false);
foreach (SCR_EditableEntityComponent editableEntityComponent : entities) {
if (editableEntityComponent.GetEntityType() == EEditableEntityType.VEHICLE) {
Vehicle veh = Vehicle.Cast(editableEntityComponent.GetOwner());
// ...
}
}
Btw are maps some sort of extremely underperforming data type? I dont see them often in vanilla code
Thank you going to give it a shot
Works in workbench, hopefully works ingame, thank you again
If the saving is related to persistence, then vanilla will take care of this in the near future ๐ We will also offer a way to gracefully save and exit from external rcon trigger. because without it the OS can decide to kill the server mid save game write on exit for DS
Yeah, mostly issues with different entity types, Characters, Vehicles, Items, saving at different times before the restart which players have utilized to dupe items 8^). Figure just finding EPF_PersistenceComponent on each entity that allows this and calling .Save() on it is a workaround.
Glad to hear that'll be a vanilla feature in the near future too. We end our game with a timed call to GetGame().RequestClose(); atm, with our docker container set to restart: unless-stopped to get it back up.
they are what you can expect from a normal hashmap. but theyy only make sense once you have many things to search for and a key that allows good spread for hasing
GetGame().RequestClose() yup that is more or less what the new command will do, except also save and when it is all comitted to local storage or e.g. HTTP, then it will shut it down. And then docker or a batch script or what ever can restart it. rcon command will make it so that server hosts can control the server via web UIs and not kill the app but rcon connect to it to do stuff instead.
The problem is exactly why with EPF shutdown saving is sadly not as reliable. there might be some changes beteen last auto save and shutdown, and not all data might be written on shutdown before it gets killed
The commitment to the storage is the tricky part I had to wrap my head around, figure let it loop through saving, give it a few seconds then Close. And yeah what I read in EPF it did look like it was handled automatically, but as the dupes arose, we realized it wasn't all saving everything as it should have. Characters are always where they should be, while you'd find your vehicle a few minutes back
Wouldnt for example a map of enum to something be faster than 10 if statements?
It depends. if checks do not need to allocate memory, the map allocates a lot of it for the meta data and the data itself. it is a data structure and not a method of program control flow. You would not use a map for that either in other languages. usually instead a switch case
I mean just the time taken to make a decision. With map it would be constant time vs longer depending on how many statements you go through.
constant time
depends on hash algorithm, number of collisions, how data is spread across memory and etc
Switches in enforce script get compiled into if else if in the order of the cases

ok map<enum, ScriptComponent>
vs if (...) { return ScriptComponent; } 10 times
So it's okay to stop making fun of our other developer for not using switches over if else ;-;
Why enum?
I'm giving an example to get a straight answer to my question
It depends on your data
even for continues enums?
Ok forget it I'll just measure it on my own and never tell anyone the results
Its always compiled into the if else if combo
No matter what
and this is useless, because you can make array of arrays, where enum is index in first dimension, it will be faster
Thats the way
Jokes aside, the best is always based on your data
There is no magic thing that works best for all
Okay so
map<string, string> 10% slower than a chain of 20 ifs
map<int, string> faster
I guess it's hashing those strings
makes sense
Did you check arrays? They likely outperform maps when you got so few entries.
I always assume maps are faster tahn arrays especially when accesing random eelemnts
This always depends on the size of the array and its allocation
Simple arrays are usually king. Dont over complicate it. The pc also wont like it
It sucks a bit because maps are really convenient for me
foreach and looking for the
t_Data.m_sDataID == "DataIDImLookingForTonight"
over an array of data class is better than using a map
with <string, data> and just using map.Find("DataIDImLookingForTonight",t_Data)
?
I always assume map find is faster because forEach stuff menas more actions executed in scripting
anybody can help with trader Clothing
Depends on actual data: yes map have O(1) access and array need O(n) for searching, but O isn't fully describe complexity, map can have collisions and heavy hash algorithm, and array may be used for very few entries with short id
So, you need to test on your data, as mario said: #enfusion_scripting message
You have set it up incorrectly
I created a simple entity with the following code, and EOnInit isn't being called for some reason. Did I do something wrong?
[EntityEditorProps(category: "GameScripted/Misc", description: "")]
class M_TestEntityClass : GenericEntityClass
{
}
class M_TestEntity : GenericEntity
{
//------------------------------------------------------------------------------------------------
override protected void EOnFrame(IEntity owner, float timeSlice)
{
// remove if unused
}
//------------------------------------------------------------------------------------------------
override protected void EOnInit(IEntity owner)
{
Print("Init Test Entity");
}
//------------------------------------------------------------------------------------------------
void M_TestEntity(IEntitySource src, IEntity parent)
{
// SetEventMask(EntityEvent.INIT | EntityEvent.FRAME);
}
//------------------------------------------------------------------------------------------------
void ~M_TestEntity()
{
// remove if unused
}
/*
override void EOnActivate(IEntity owner)
{
super.EOnActivate(owner);
SetEventMask(owner, EntityEvent.FRAME);
}
override void EOnDeactivate(IEntity owner)
{
super.EOnDeactivate(owner);
ClearEventMask(owner, EntityEvent.FRAME);
}
*/
}
Ah, forgot to uncoment SetEventMask(EntityEvent.INIT | EntityEvent.FRAME);
This helped
Another question, how can I have something only run when the game is actually running and not just in the World Editor?
if (GetGame().InPlayMode())
{
// do stuff here
}
Yes
I am trying to use a ScriptGameComponent, and it fires on server but not clients. Do you have a solution for using a component across GenericEntity AND GameEntities? Curious to know your approach.
OnTicksOnRemoteProxy, obviously
BaseWorld::proto external bool QueryEntitiesByAABB(vector mins, vector maxs...
What are mins and maxs relative to here? Am I right to assume they're opposite vertices of a cuboid with world 0 being the center of it?
So say Vector(0,0,0), Vector(12800,12800,1000) would cover the entire Everon?
Is there no GetVariableValue in World Editor API? No way to say read directly from the edit controls?
Attempting to do something with VolumeEntity, hoped to read its BoundingVolume values off workbench controls at set them to accessible member variables during editing as there are no proto functions to access it otherwise. Are my attempts futile?
Tried doing this on an entity (tried both child of GenericEntity and VolumeEntity) to no luck:
[Attribute(uiwidget: UIWidgets.BoundingVolumeEditor)]
protected ref BoundingVolumeScr m_bbTest;
Still no volume widget working. Is there a trick to it or my attempts are futile?
Copy pasting the size manually works, if only I could make it paste size to accessible member class automatically
Waiting for a dev to tell me its futile and I'm wasting my time
inb4 code your own bounding box manipulation widget
I do not understand what the issue is
I want to use Bounding Volume Tool to easily edit volumes
VolumeEntity has bounding volume property but its hardcoded and inaccessible
Rigidbody
And set bounding box maybe?
Also Diagtool should have this info, maybe I'm wrong 
So I tried having my own bounding volume property (BoundingVolumeScr) and then
a) Have bounding volume tool work on the property directly ([Attribute(uiwidget: UIWidgets.BoundingVolumeEditor)])
b) Copy VolumeEntity's hardcoded bounding volume to my own property through API tools but there is no property getter only setter (SetVariableValue)
Neither of these worked:
a) Widget doesn't appear no matter what I did
b) No getter to script-copy hardcoded volume to accessible volume property
That's an overkill, I only want XYZ volume and being able to edit it easily in the world
This does not work on scripted attributes in the version of enf that AR has rn.
It's there on Engine rn, just not on AR version
You mean uiwidget: UIWidgets.BoundingVolumeEditor doesn't?
Yeah it won't work from scripted attributes

There is no way to copy the volume data produced by the widget to scripted attributes through WB API either, right?
Not through attribute proto getter but through API somehow similar to how you can edit by path through WorldEditorAPI::SetVariableValue?
Base Containers
Read from there and many messages below
Thanks, I'll check it out
Morning, is there a build in method, to check if the character is inside defined bounds?
Where do I get the RTTextureWidget of the actual object?
Or would I need a HUD on the player with an RTTextureWidget at all times?
and just reference that and set it throught that
Anyway, which you can create a layout, you can then set render target to your entity
Look up SetRenderTarget method, used to be called SetGUIWidget, in the script editor
So I use SetRenderTarget to get it working and then use SetRenderView to set the camera it renders?
Pretty much, one widget type is for the set render target which will be the parent widget, and then your camera will be the other widget which supports the set render view method
class SAL_DroneCommandStationComponentClass: ScriptComponentClass
{
}
class SAL_DroneCommandStationComponent: ScriptComponent
{
Widget m_wRenderWidget;
override void OnPostInit(IEntity owner)
{
SetEventMask(owner, EntityEvent.INIT | EntityEvent.FRAME);
}
override void EOnFrame(IEntity owner, float timeSlice)
{
if (!SCR_PlayerController.GetLocalControlledEntity())
return;
if (vector.Distance(SCR_PlayerController.GetLocalControlledEntity().GetOrigin(), owner.GetOrigin()) > 30)
{
if (m_wRenderWidget)
delete m_wRenderWidget;
return;
}
if (!m_wRenderWidget)
{
m_wRenderWidget = GetGame().GetWorkspace().CreateWidgets("{8B20F97E05A3E8E4}UI/CommandStation/CommandStationViewer.layout");
}
if (m_wRenderWidget)
{
RTTextureWidget textureWidget = RTTextureWidget.Cast(m_wRenderWidget.FindWidget("RenderWindow"));
textureWidget.SetRenderTarget(owner);
textureWidget.SetRenderView(owner, GetGame().GetWorld().GetCurrentCameraId());
}
}
}
Tried this and it's not rendering anything in the window
This is the layout
Hi, does anyone have an idea, why my entity is not showing in the Entity Browser in the World Editor?
appearently there was an issue with another script, which caused the scripts not to reload properly
The use of plural is prohibited at the end of combined keywords: e.g TAG_NotificationsComponent โ TAG_NotificationComponent
What if my component defines lots of notifications in it? And I don't need several components per each notification. Convention still applies in that case?
Are we allowed to commission jobs here?
Happy to drop $100.
Really need a mod that api calls my backend to fetch user rank level.
Than using that level display the matching png rank symbol next to there name in the scoreboard, group menu, chat, voice chat, nametag ect.
So I would host the 100+ rank pngs in the server which the mod can use to display on the user.
I have the api/config setup
https://reforger.armaplatform.com/workshop/65D4909D9907A616-ZSURanks
Just completely lost for doing the above.
Basically end goal is to achieve insurgency sandstorm ranksystem thay fetches that info from my database.
So if anyone is happy to build this mod for me and hand over right to the code. Ill purchase it for $100 USD.
If this isn't allowed than my bad, Please remove ๐ซก
Really wish it comes to AR, I tried having a deep dive into Enfusion back in 2023 but got stuck on this exact issue, seen VolumeEntity but couldn't get it to be useable, and that was the end of that attempt.
Gonna have to hand type the numbers and hope they fit the volume I need manually for now
Would appreciate some help with this, being able to modify debug info depending on pressed key would be a great help.
Can there be another way to draw debug for a component attached to an entity which doesn't have this enabled? Modifying GenericEntity just to enable this (even only for workbench) could be an overkill(not possible). EOnFrame doesn't work unless you're in play mode, any other per frame functions that runs in world editor edit mode?
Does component EOnDiag work at all? No matter what I do I can't trigger it to run.
Diag menu World -> Entity diag is true
No, that is not allowed sorry. either find a volunteer or.. dive into the workbench
afaik, it should be on on some specific entity, not generic (mb gameentity, don't remember)
Tried it on ScriptComponent, no luck
So few options to draw debug from component side in world editor edit mode
Do I have to create my own entity on ArmaReforgerScripted constructor and have that do the drawing each world editor frame then?
About to try, unless somebody stops me and tells a better way
No
You can just do it on the component itself
For WB, you must use the __WB methods
How?
EOnFrame - only during play mode
EOnDiag - doesn't work at all
_WB_AfterWorldUpdate - needs _WB_GetAfterWorldUpdateSpecs on the entity itself, can't have that on GenericEntity (Wrong it does, check msgs below)
EOnFrame version in WB Word Editor (Edit mode) is the _WB_AfterWorldUpdate
EOnDiag
There is a setup for this, let me dust it as I do not recall it
You can't enable that event from the component itself and I need it from component added to GenericEntity
?
You can do it on component
the _WB_GetAfterWorldUpdateSpecs override
Overloading event '_WB_AfterWorldUpdate' is not allowed ๐ค
override int _WB_GetAfterWorldUpdateSpecs(IEntity owner, IEntitySource src)
{
return EEntityFrameUpdateSpecs.CALL_WHEN_ENTITY_VISIBLE;
}
```in my component code
Wut, I'm mixing something up
I was doing something else and that's an error from that attempt
I swear I tried _WB_GetAfterWorldUpdateSpecs inside component but it was erroring out with something similar
You probably broke the compiler with something else somewhere (It happens)
I get why it didn't work, I copied it from SCR_DestructibleBuildingEntity which is an entity and component has different function signature
fml, I spent half of today finding a way to draw debug for a component, rearranging my entire setup, etc
Big thanks for making me try that again, I was sure this function is only for entities
Awesome, that works, thanks!
How do I know that furniture belongs exactly to certain house? It doesn't have Hierarchy component, so I can't reach either way. I see that SCR_DestructibleBuildingEntity does bounding box lookup for stuff to delete, I assume that's the only way?
What do you want to do with that furniture?
I want some furniture objects to be registered at parent building, but there is no way to get up the Hierarchy
you might tried it on the entity, which also has it and moved the code to component where the method name is the same but params slightly different because of owner being passed
Yeah that is why we added the hack with the bounding boxes, the house prefab setups are not really ideal but are unlikely to change any time soon
What do you think would be ideal setup in an ideal world? Hierarchy on all entities? Simplified hierarchy to tie furniture as children to building parent entity?
Hypothetically, just wondering what you'd see as best solution.
hierarchy on each would be ideal, but takes the most memory. having the root at least know all children would be neat so you can have some change to figure out the relationship in reverse for edgecases. it would have meant that if the house is destoryed we know which children to destory also ... we will see what solutions we come up for A4. it faces the same issues as AR in this regard
Can you let me know what methods or Scripts you used for visual debug?
To add on this, hierarchy on each also messes with runtime performance, and in some cases heavily with replication
So if anything. I would say just something to keep tabs, but not provide the same that hierarchy does
Since there is hierarchy discussion. Is there any performance (or memory, or any) cost to having this tick checked, if there is little to no parent-child assignment/unassignment happening.
Hierarchy is such a basic concept though? Like all the clothes of a character etc... I would have thought something so basic and frequent would be made to be very efficient?
Is there any better way to be able to troubleshoot issues with replication? Our entity delete bug is back and I'm thinking it's too much stuff being replicated. Did some things to hopefully fix it, mainly adding if(!Replication.IsServer()) return; to user actions. Which seemed to help a little bit, until our player base and invisible entities, like gamemode, our safezone, in a certain bubble get deleted again. Anytime we put the server up, its a ticking time bomb.
User actions have their own replication methods that determine if it runs on server or not
Actually I think it's pretty much only local or local+server, nvm
From my understanding from what's been said in here, if the user action isn't purposely isolated, it's automatically replicated on server and clients
Only within the replication range
Well, if the entity is replicated on clients
Doesnt necessarily mean only in range
Which our safezone is normally bustling with people and a ton of stuff happening so I'd imagine there's a ton being replicated already
Previously, the gamemode got deleted, we thought that was the issue so we moved it far far away from everything, then after a couple months of it not happening. It happened again but the gamemode wasn't getting deleted with the rest of em. It mainly happens around the safezone and anyone and anything within it seems to get shoved off the stack and poofed away
To be able to run the diag arma on a running server would be dope, but understandably it's a huge security issue
you can, but you need all players to be on diag also

Is there a method to get me the highest rank out of all items the player is carrying?
Or do I have to iterate over all items then get their rank
Its efficient, that does not mean you should exploit it
Add it everywhere and you lose it
The issue with buildings is that instead of only them being meshes and coliders on the parts of them. They are whole entities
Which means you have to do more expensive calculations, messing more with the scene tree which is affected more hwavily if the children entities are actually chindren and not flat. Same for replication if they happen to have rpl component. Among other things.
It is not the same as proxies on buildings lile in RV
It was just more convenient for env designers to work the buildings like this
You can, it just has to be running with the diag server
Any crash at all?
Also how do I completely reset the perceived faction thing? The intention is to load a loadout
No crash, entities just poof out of existence which then we stop the server
Dose the tryConsumption and trySpawnIntoPlayer function in ResourcePlayerController work on client side? And what can I do to add a additional consumption in it, to say a score/money account link to a serverside file
Could it be GarbageCollector?
@torn bane
Unlikely as it's not configured to be insert able. I have another person in my DMS with the issue. Let me check their log
But GetGame().GetGameMode() becomes null mid game, which can only really happen if the entity was deleted. I told them to put a logger component on it and this was the result
2025-07-12 19:41:18.710 SCRIPT : RL_GameModeRoleplay Other Delete
2025-07-12 19:41:18.710 SCRIPT : -- Stack trace --
2025-07-12 19:41:18.711 SCRIPT : ~RL_GameModeRoleplay() Scripts/Game/Core/EL_GameModeRoleplay.c : 12
So it was likely gamecode who deleted it. Very very odd
My only thought is that it is some script that is looking for entities at 0 0 0 from a query, and queues it to be deleted later by some mechanism which is fired from our code, so you do not see it in script. Move your gamemode to something like 123456 -6666 123456 where no world query would ever hit and see if it still happens?
i didnt even mod any of those
22:16:01.986 WORLD : UpdateEntities
22:16:01.986 WORLD : FixedFrame
22:16:01.986 SCRIPT (E): Usage of released BaseResourceObject 0x0000029EA9B8A020 in:
22:16:01.986 SCRIPT (E): -- Stack trace --
22:16:01.986 SCRIPT (E): HandleMeleeSound() scripts/Game/Character/Melee/SCR_MeleeComponent.c : 214
22:16:01.987 SCRIPT (E): ProcessMeleeAttack() scripts/Game/Character/Melee/SCR_MeleeComponent.c : 315
22:16:01.987 SCRIPT (E): Update() scripts/Game/Character/Melee/SCR_MeleeComponent.c : 472
22:16:01.987 SCRIPT (E): HandleMelee() scripts/Game/Character/SCR_CharacterCommandHandler.c : 20
22:16:01.987 SCRIPT (E): -----------------
22:16:01.987 ENGINE (F): Crashed
22:16:02.085 WORLD : FixedFrame
22:16:02.085 RENDER : ----------------------------------------------------------------
22:16:02.085 RENDER : ----------------------------------------------------------------
22:16:02.086 RENDER : Rend: Fps:1000000.00 (0.00ms) | Present 0.00ms | Wait4GPU 0.01ms (graphical 0.00 + copy 0.01) | defrag 0.00ms
22:16:02.086 RENDER : Rend: DP:0000 DPI:0000 DPR:0000 DPID:0000 Tri:00000 Vert:000000 CSRun:00|AllV:00x(00000) AllI:00x(00000) BegV:00x(00000) BegI:00x(00000)|TRes:0357
22:16:02.086 RENDER : ----------------------------------------------------------------
stack trace doesnt tell me anything, I didnt touch any of those
gg
Trying to wrap my head around replication a bit.
I have a server-side system that sets a custom class variable in a component. Custom class has the replication methods set up (inject, extract, etc.). I have the variable set up as a RplProp in the component, and when I go to set it from the server-side system, I do Replication.BumpMe() (in the component) upon setting the variable. But still, the variable returns null on client.
What am I missing? Assuming it's since I'm setting it from a server-side system
returns null? What are you RplProp-ing?
A custom class
With some janky testing Rpc'ing, I can get the variable to return as not null with a key press, but can't get it to set properly like I need to from the system.
And then additionally either way, can't get the variable to not be null when trying to perform a useraction unless I do Replication.BumpMe() in the useraction, which not sure about that 
I think it was you who recommended me the same and I got the same result. We have moved the game mode which stopped it from showing it being deleted in the logs. On everon we have our gamemode even farther than that I believe, far asf in the NE or NW direction of the map. Which leads me to believe it's something with replication because it doesn't happen to everyone, just player entities mainly in the area of our safezone and our safezone entity.
When I am able to tonight I'm going to add some logging components to the character and anything else that seems to be affected. Vehicle don't seem to get deleted
The variable itself should use the extract, inject, etc...
But the RplProp should be the class itself
like [RplProp()] SAL_RplClass m_RplClass;
As an example
Then just change the variable in the class object and call replication bumpme
Also should use RplSave and RplLoad so it replicates as well
I think you misunderstood or I was hard to understand.
The variable is a custom class. So protected ref CustomClass m_CustomClass; And that variable is setup as the RplProp.
The custom class has the extract, inject, etc. methods is what I was saying.
Very new to setting up a custom replicated class, so definitely learning as I go. I watched the bootcamps on replication, but I guess what I'm trying to do wasn't really covered and that's where I'm getting stumped a bit.
And not many vanilla classes to reference for my situation ๐ค
I just need to ask more questions, but hate hogging up this channel with so much stuff ๐
Here's an example
This is one we use to have slot data for our gamemode
Immensely helpful, actually, thank you! ๐
Errors are general. Not always tied to your mod
Something did went wrong during that call. Thats it.
Any ideas why removing from my map says false? .Remove returns false,
protected ref map<IEntity, int> test = new map<IEntity,int>();
override event protected void OnPostInit(IEntity owner)
{
test.Insert(owner, 69);
Print("Contains: " + test.Contains(owner));
Print("Value: " + test.Get(owner));
Print("Remove: " + test.Remove(owner));
Print("Contains: " + test.Contains(owner));
}```
Results in:
``` SCRIPT : Contains: true
SCRIPT : Value: 69
SCRIPT : Remove: false
SCRIPT : Contains: false```
Not a big deal, but was confusing
anybody know how i can reduce Fall Damage
not OFF
can someone help with Fall Damage Reduction? i die when jump just from house
override
{37578B1666981FCE}Prefabs/Characters/Core/Character_Base.et
And then try editing these variables
yeah but there is speed i dont know how i have to set up it to make distance dont deadly by 4meters House
This one is, but the errors dont lead me in the right direction
thx fixed now can jump from house 4meters ๐
it was hard work ๐
Because it is not a direct error but indirect
Ok cool I'll just give up on this project I've put a hundred hours in then
Even on our side on the cpp level, it wont twll you directly
Report the crash instead, then we can have a look
Indirect crashes are not something you could get a direct pointer to
They would not be indirect in those cases
So when you arrive there then is huge pain
It could at least tell me the class name of the resource object or something
Set the log level to max
And check
Is there something beyond spam?
spam isnt even mentioned on wiki
I feel like it cant
Released object is telling you that you tried to use a resource that was invalid (cleared)
The fault is most likely at what tried to use it on that callstack
Not checking for validity
Couldnt the type be inferred from what it was trying to use?
Resource objects are handles to resources
If the handle is invalid, it lost all info
Are you doing Resource.Load somewhere in your mod?
I did press send
No I don't believe so. It happens after a custom character dies.
Or gets melee damaged apparently
Guid here #enfusion_scripting message
The return description is quite unfortunate. What it was actually trying to convey is that it will return true if the element was actually removed after the call, and false if it didn't exist and failed to remove.
Ah I misread. That is odd. I will check
They both are actually related
. In terms of how they happened.
It happens when there is a Trace check for when doing damage or so.
TraceParam.SurfaceProps is what is causing the issue.
In those cases, that is the BaseResourceObject that was released before you were finished using it
Out of curiousity.
Are you doing something on client while it is far away from something else (Like long distance hit)?
Or deleting an entity after it or something else being hit?
@ocean kernel Main issue is that the scripts there expect it to not be released
If anything the vanilla scripts in the callstack are faulty
I will report internally. These errors are bad.
Should be sorted quickly. If you see more of this kind please report them
I'm trying to achieve what the AttachTo function did on Arma 3 by spawning a prefab and using AddChild to attach it to a vehicle.
Basically trying to add cargo to trucks... However, if the two objects collide, the physics goes all weird.
Is there a way to make the child object not collide with other objects? To more closely simulate how the AttachTo function worked?
The attached object is purely cosmetic
If you use slot manager, it wraps that AddChild script and it can use merge physics as well
Or the other options to disable physics interactions
Leave yourself of pain and use the slot manager
Think of them as memory points with slot setup like in A3
IF you get the slot from scripts, you can dynamically attach things to it iirc
Yeah you can
EntitySlotInfo.AttachEntity
Get it from SlotManagerComponent.GetSlotByName
Have the slot itself set to merge physics on the configuration
Thanks, I'll check it out
How can you work with world editor hierarchy? I can't seem to find proper commands in World Editor API
WorldEditorAPI::ParentEntity - add children to parent
WorldEditorAPI::RemoveEntityFromParent - remove children from parent
These are all setters, but where are getters?
Oh, its in BaseContainer, expected it all to be handled through API
@minor agate Can I ask for your wizard advise on Debug.KeyState? Does it not work at all at this point?
this is in your map right?
i read it allready in google its normal that this in log coming
yeah its a custom Map
but i have next problem with GameMaster i dont know how i can activate them
that i can log in on server
and i have no idea how to make Zelik Banking use by ShopSystem
i cant find any info what i have to do, maybe u need some scripts to get work it...
One of them happened when I drove over a character, the other when one character melee attacked another
you can fix it by manually editing your layer file or updating the prefab used
Search for:
$grp PowerlineEntity {
Replace with:
$grp PowerlineEntity : "{613763D114E7CD1C}Prefabs/WEGenerators/Powerline/Powerline.et" {
./Worlds
Hey do you only do scripting or do you use blender at all ?
I use Cinema 4D, so I can't help you with Blender
Damn fair enough, was gonna ask how to go about uv mapping your models haha. Algoods
Just find some tutorial online idk
Yeah fair
Am I right to assume that entity initialization order is not guaranteed and can change at any time?
Yeah seems so, my gamemode components sometimes init before other entities, sometimes after.
It only happens to my custom character which uses metal materials for its colliders
wonder if thats the issue
Yeah I shoot the robot in the head and my game crashes
might be head collider
Hi, I'm having a problem with systems, as they are not running properly for me (im following the guide here: https://community.bistudio.com/wikidata/external-data/arma-reforger/EnfusionScriptAPIPublic/Page_WorldSystems.html)
I don't get any logs, neither are the breakpoints reached
I did:
- Create a System Class which inherits BaseSystem
- Override InitInfo
- Add it to the Config + Run with this config
If "Run with this config" means this -- it seems like this thing doesn't work, at least never worked for me, and i saw other people also complaining. I ended up overriding vanilla systems config and adding mine there.
With overriding, you mean this?
Same, the docs seem to be outdated, the only way to run your systems is to override ChimeraSystemsConfig.conf in your mod and add your system there and then restart the workbench.
yes
that did it, thanks!
The problem was ragdoll head game material
Thought I was getting weird entity world return on Workbench opened prefab, but it seems that World Editor inits the entity twice for some reason??
Open prefab in Workbench:
ENTITY : Create entity @"ENTITY:1" ('SCR_BaseGameMode') at <0.000000 0.000000 0.000000>
SCRIPT : !!! Constructor :: ENT world = 0x0000024584F44020 {}
SCRIPT : !!! Constructor :: No WE API, no WE world!
SCRIPT : !!! Constructor :: GAME world = 0x0000000000000000 {}
Press Edit Prefab:
ENTITY : Create entity @"ENTITY:3" ('GameMode_MyMode1', SCR_BaseGameMode) at <0.000000 0.000000 0.000000> @"{2E59B96BE0446D05}Prefabs/MP/Modes/GameMode_MyMode.et"
SCRIPT : !!! Constructor :: ENT world = 0x000002456865C520 {}
SCRIPT : !!! Constructor :: WE world = 0x000002456865C520 {}
SCRIPT : !!! Constructor :: GAME world = 0x0000000000000000 {}
ENTITY : Create entity @"ENTITY:3" ('GameMode_MyMode1', SCR_BaseGameMode) at <0.000000 0.000000 0.000000> @"{2E59B96BE0446D05}Prefabs/MP/Modes/GameMode_MyMode.et"
SCRIPT : !!! Constructor :: ENT world = 0x000002456865C520 {}
SCRIPT : !!! Constructor :: WE world = 0x000002456865C520 {}
SCRIPT : !!! Constructor :: GAME world = 0x0000000000000000 {}
Well, apparently it just initializes the world in World Editor twice over, still weird though
Anyone knows why I get this error: Undefined function 'BaseWorld.FindSystem' for GetGame().GetWorld().FindSystem()?
You need to cast BaseWorld to ChimeraWorld
ChimeraWorld.CastFrom(GetGame().GetWorld())
thank you! some guides seem to be pretty outdated 
Is there a quick way to tell if entity world is Workbench world?
BaseWorld().IsEditMode() is true for both workbench and world editor
Can't see anything like IsWorkbench()
Check Entity World != World Editor World I guess
Line 15 returns NULL, is there another "init" method for entities, instead of the constructor, where the Systems are expected to be initialized?
You need to check if your world is ChimeraWorld, if not that CastFrom will be null
ChimeraWorld world = ChimeraWorld.CastFrom(owner.GetWorld());
if (!world)
return;
```How vanilla does it
ahh okay, got it!
Nevermind my comment about WB and WE, You're doing GetGame().GetWorld() that alone will return null and you'll be casting null and then calling a function on it
GetGame().GetWorld() is not null only during play mode in World Editor and in game
2025-07-13 12:45:40: Scripts/Game/vehicles/ScreenToggleComponent.c:44 Function EOnFrame
2025-07-13 12:45:40: SCRIPT (E): Virtual Machine Exception
2025-07-13 12:45:40: Reason: NULL pointer to instance. Variable '#return'
2025-07-13 12:45:40: Class: 'ScreenToggleComponent'
2025-07-13 12:45:40: Function: 'EOnFrame'```
Anybody know what would be causing my server to spam this error? Seems to be having a large effect on server FPS
Looks like its trying to call a vanilla script but cant find it?
I want to create a DoT area (essentially "burning ground"). What's the most preferable way to check if character went inside this area (to apply DoT effect on him), or I really should just do QueryEntitiesByAABB check within EOnFrame event handler?
I noticed that barbed wire applies bleeding damage on collision (contact) here, maybe I could spawn something like invisible passable sphere and apply DoT effect in similar manner?
upd: seems that there's no way to create trasnaprent-passable area that could trigger EOnContact
Hi! Is there a way to update entity when i edit basecontainers at runtime? ent.Update() not helps.
It was an issue that was fixed internally, it was always returning false
So far only the one config works, selection and making your own has been finished internally and will be delivered in a future major update ๐
Share whole code
I have a attribute in my class:
[Attribute()]
protected ref PointInfo m_vCenter;
```Any way for it to initialize to `PointInfo` by default? Not sure what could be in `defvalue` for that.
You can't as attribute, but in constructor you can always check if it is null and if so create one
Still doesn't show it in properties
if(!m_vCenter)
m_vCenter = new PointInfo();
Guess I need to set it through World Editor API?
Hi guys, does anyone know what triggers a character's ECharacterLifeState to change? I'm trying to revive a dead character
Where would I place utility code? In my case: I want a method, which returns a specific system. Would I just put it in a class with a static method?
i usually put a static getter into the system to get by singleton or get by passed world.
a singleton in the system is a good idea!
Whatever you do in the class itself is done at runtime when the game is running.
So this will only initialize the default when it's called when the game is running
There is no way to do proper custom object default other than null through the base container system
Forcing values the other way you mentioned is quite hacky and I suggest to not do it as we at any point take the ability to do that.
Do what NiiRoZz mentioned
I've got down a bit of a rabbit hole with reviving dead characters. Can any bohemia peeps tell me if I'm wasting my time / death changes things that can't be accessed by scripts?
devs why u troll me like this
loading loadouts in a test world loads guns without flash hiders
on arland loads fine
god

I think too many systems rely on dead event meaning dead for all. There is no revive in that sense, though it may be possible by duing a lot of work
Better to just keep them uncon and then un-uncon. Maybe you could even do it without changing animation to uncon so they remain ragdolled.
I considered keeping them uncon but don't wanna mess with the vanilla damage to death. If there a way to make them uncon instead of dead when they would normally have died?
Lol it actually does it in singleplayer, if I run with peertool then flash hiders load fine ๐
Anyone know if I should be able to serialize WorldTimestamp with JsonApiStruct? Simply trying with RegV makes it ignore it. Looking at workarounds, WorldTimestamp has a ToString(), but I don't see anyway to reverse that.
No you can not with any context currently. As it is int64 and needs explicit support to be serializeable. not in script ... i shall have a look how to make it possible, i think i can add support for it in the serialization contexts
Just stringify it
You cant read it then tho

Damn I just tried to pass a reference to world editor api from edit mode to play mode and wiped out workbench
@torn bane There happen to be any solution to the entity delete issue? Or do you know what information I could get that could help further pinpoint the cause of this?
Hi, I'm wondering on how to spawn a Mechanized Infantry Group. I can only find on-foot infantry in Prefabs/Groups.
Is there a certain way to spawn vehicles with infantry in it?
Hi, I am in dire need of assistance. I am having a hard time understanding how would it be possible to modify the Death Screen overlay. I found a template I like made by someone named Iron Beard, essentially I would want to pull information out through DataInvestigator and IEntity.
Problem is, I have no Idea how to properly apply those values. Do I need to go through the mission template too ? Any assistance would be welcomed.
Trying to understand custom class replication some more. ContainerRplId and ReadyForItems come up null in Inject() and PropCompare() on peer. Trying to set them from a server-side system. Could the issue be coming from setting it in the system or more so from the custom class replication?
class CE_SearchableContainer
{
protected RplId ContainerRplId = RplId.Invalid();
protected bool ReadyForItems = true;
bool RplSave(ScriptBitWriter writer)
{
writer.WriteRplId(ContainerRplId);
writer.WriteBool(ReadyForItems);
return true;
}
bool RplLoad(ScriptBitReader reader)
{
reader.ReadRplId(ContainerRplId);
reader.ReadBool(ReadyForItems);
return true;
}
static bool Extract(CE_SearchableContainer prop, ScriptCtx ctx, SSnapSerializerBase snapshot)
{
snapshot.SerializeInt(prop.ContainerRplId);
snapshot.SerializeBytes(prop.ReadyForItems, 4);
return true;
}
static bool Inject(SSnapSerializerBase snapshot, ScriptCtx ctx, CE_SearchableContainer prop)
{
snapshot.SerializeInt(prop.ContainerRplId);
snapshot.SerializeBytes(prop.ReadyForItems, 4);
return true;
}
static void Encode(SSnapSerializerBase snapshot, ScriptCtx ctx, ScriptBitSerializer packet)
{
snapshot.EncodeInt(packet);
snapshot.EncodeBool(packet);
}
static bool Decode(ScriptBitSerializer packet, ScriptCtx ctx, SSnapSerializerBase snapshot)
{
snapshot.DecodeInt(packet);
snapshot.DecodeBool(packet);
return true;
}
static bool SnapCompare(SSnapSerializerBase lhs, SSnapSerializerBase rhs, ScriptCtx ctx)
{
return lhs.CompareSnapshots(rhs, 4)
&& lhs.CompareSnapshots(rhs, 4);
}
static bool PropCompare(CE_SearchableContainer prop, SSnapSerializerBase snapshot, ScriptCtx ctx)
{
return snapshot.CompareInt(prop.ContainerRplId)
&& snapshot.CompareBool(prop.ReadyForItems);
}
}
I like finding random nuggets in the scripts while I go insane looking into making my own GM camera.
Link is broken but there is a heatmap generator for FPS on maps?
ar-heatmap.bistudio.com
hm, well, I think this is probably my issue with doing the system server-side only https://community.bistudio.com/wiki/Arma_Reforger:Systems#Current_Limitations
This doc is outdated
You can do Rpl on sytems.
See the Replication Bootcamps for example. We replicate a system in one of them.
All your methods here mismatch on the sizes of the data you are handling
Just do it manually, don't use the helpers as rather than help they damage more because of this, and they are way slower performance wise as well
@inland bronze Saying that.
This should do it
class CE_SearchableContainer
{
static const int DATA_SIZE = 5; // ContainerRplId (4 bytes) + ReadyForItems (We'll send it as 1 byte)
protected RplId ContainerRplId = RplId.Invalid();
protected bool ReadyForItems = true;
bool RplSave(ScriptBitWriter writer)
{
writer.Write(ContainerRplId, 32); // 4 bytes * 8 = 32 bits.
writer.Write(ReadyForItems, 1);
return true;
}
bool RplLoad(ScriptBitReader reader)
{
reader.Read(ContainerRplId, 32); // 4 bytes * 8 = 32 bits.
reader.Read(ReadyForItems, 1);
return true;
}
static bool Extract(CE_SearchableContainer prop, ScriptCtx ctx, SSnapSerializerBase snapshot)
{
snapshot.SerializeBytes(prop.ContainerRplId, 4);
snapshot.SerializeBytes(prop.ReadyForItems, 1);
return true;
}
static bool Inject(SSnapSerializerBase snapshot, ScriptCtx ctx, CE_SearchableContainer prop)
{
snapshot.SerializeBytes(prop.ContainerRplId, 4);
snapshot.SerializeBytes(prop.ReadyForItems, 1);
return true;
}
static void Encode(SSnapSerializerBase snapshot, ScriptCtx ctx, ScriptBitSerializer packet)
{
snapshot.Serialize(packet, CE_SearchableContainer.DATA_SIZE);
}
static bool Decode(ScriptBitSerializer packet, ScriptCtx ctx, SSnapSerializerBase snapshot)
{
return snapshot.Serialize(packet, CE_SearchableContainer.DATA_SIZE);
}
static bool SnapCompare(SSnapSerializerBase lhs, SSnapSerializerBase rhs, ScriptCtx ctx)
{
return lhs.CompareSnapshots(rhs, CE_SearchableContainer.DATA_SIZE);
}
static bool PropCompare(CE_SearchableContainer prop, SSnapSerializerBase snapshot, ScriptCtx ctx)
{
return snapshot.Compare(componentRplId, 4)
&& snapshot.Compare(componentRplId, 1);
}
}
gotcha, will give it a shot, I appreciate it! I get confused easily on the bytes and what should be what ๐
Would SCR_PlayerLoadoutData.c be good to reference on how to handle replicating arrays? https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~ArmaReforger:scripts/Game/GameMode/Loadout/SCR_PlayerLoadoutData.c
No
Just do what I said
That other codec is not good example, and has some flaws
Give me an example of what you want to do and I will amke the codec for you, then explain
But about those serializeInt, ReadInt, etc helpers
Always use the RAW bytes or bits ones
Again, watchs the Replication bootcamps
We actually replicated an array there, of custom data to use for blips on a radar
I watched the first one but missed the second one, I believe. Will give it a watch as I'm also doing an array of custom data ๐
Additionally with the code you provided, in PropCompare(), it should be
snapshot.Compare(prop.componentRplId, 4) && snapshot.Compare(prop.ReadyForItems, 1)
``` yeah? With the `prop.` before each variable?
As well, with those adjustments, still getting `componentRplId` returning as null on client in `PropCompare()` only, which could be my error somewhere tbh
static bool PropCompare(CE_SearchableContainer prop, SSnapSerializerBase snapshot, ScriptCtx ctx)
{
return snapshot.Compare(prop.ContainerRplId, 4)
&& snapshot.Compare(prop.ReadyForItems, 1);
}
``` is what I have currently
This is fine
Dont check it there
Check it at runtimw else where
Dont use codecs for anything other than codec stuff
Do not do logic on them for your system or feature
Leave it strcitly for replication alone
Oh I mean it throws an error when launching the peer client saying it's null, I don't even get far enough into game to check afterwards
like I'm not doing a print or anything
Can you show me the error?
23:25:59.689 SCRIPT (E): Virtual Machine Exception
Reason: NULL pointer to instance. Variable 'ContainerRplId'
Function: 'Compare'
Stack trace:
Scripts/Game/CentralEconomy/CE_SearchableContainer.c:200 Function PropCompare
``` and what I sent is lines is 198-203
could it maybe be more so with if I'm not doing the Rpc's properly from my system...?
That is odd, null should work
How are you doing it?
Rpc(RPC_AskSetContainerRplId, rplId, container); // called from another method
[RplRpc(RplChannel.Reliable, RplRcver.Owner)]
protected void RPC_AskSetContainerRplId(RplId id, CE_SearchableContainer container)
{
container.SetContainerRplId(id);
Rpc(RPC_DoSetContainerRplId, id, container);
}
[RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
protected void RPC_DoSetContainerRplId(RplId id, CE_SearchableContainer container)
{
container.SetContainerRplId(id);
}
Owner means nothing on systems
Systems only broadcast
So only need the broadcast method then?
oh, from testing, don't even need to Rpc it, it seems? Doing just container.SetContainerRplId(id); works with printing in client logs, but still getting the null error on client launch
How do I get explosion scale from warhead prefabs dynamically when said warhead is spawned
Do I have to do some weird prefab container source reading
globally via config override on garbage systgem in chimerasystemsconfig or via garbage system config component added on the gamemode for per scenario changes which config to use.
i have found it in chimerasystem
my Vehicle is gone, so i try config
now damaged vehicles stay or?
what about abandoned ?
That will change it so any damaged but not entirely destroyed will stay, and nearby players do not cause the vehicle to stay even if destroyed
Hover over the properties for tooltips what they do
i off the life time by player distance and
so now damaged vehicles should stay
and destroyed deleted without of lifetime of check player?
A player standing near a wreck of a vehicle will not make it stay is what you configured
my vehicle just gone so i look how to fix it, Car was just deleted i think by Garbage Manager but it was not/low damaged so i try now with only Destroyed and check player dont need
there is Mode in Workshop
but i have no idea where u can edit Abandoned vehicles
After latest arma update no longer works NOTE:
And when i shoot at cars added by mods no Smoke coming some cars dont take damage i dont know whats happend
need i prefab or what or edit some config
that by 50% lower start smoke just exploding by high speed crash
I ended up with the same solutikon related to projnectiles before, yes, container reading
I can give an example if you need something to get started
So for example warheads have explosion scale and tnt equivalent
Would be dope to get those numbers
holy smokes I think I should cache results of this
@azure pebble Maybe you know?
Yes thats what I do with a MAP ๐
Technically the best would be to generated the data in workbench
Or on init or sth
And generate for all prefabs etc...
Oh that's smart. But I would need to have a list of all warhead prefabs.
Hmm...
Especially if I want to do it for modded
yeah currently you have to get it from container. Apparently you are first person that needs that
Is there a easy way to get all prefabs?
I could cache it on server and client, and client could get server's cache on connect ๐
The longer the server runs the better the initial cache for players would be
// Grab reference to ResourceManager
ResourceManager resourceManager = Workbench.GetModule(ResourceManager);
if (!resourceManager) {
return;
};
array<ResourceName> selection = {};
resourceManager.GetResourceBrowserSelection(selection.Insert, true);
// Verify if something is selected - if no, exit method & print error message
if(selection.Count() == 0){
Print("No elements are selected in Resource Browser");
return;
};
can grab all hilighted resourfcees
But I don't know how to query all prefabs in-game???
//! Object used for holding filtering params for ResourceDatabase.SearchResources() method
class SearchResourcesFilter : Managed
{
string rootPath; // Exact path format expected (e.g. "$ArmaReforger:Prefabs/Weapons")
ref array<string> fileExtensions; // File extensions without leading dot (e.g. "emat")
ref array<string> searchStr;
ref array<string> tags;
bool recursive = true; // When enabled, we wil search whole sub-tree
}
//! Callback used for processing results from ResourceDatabase.SearchResources() method
typedef func SearchResourcesCallback;
void SearchResourcesCallback(ResourceName resourceName, string exactPath = "");
typedef func FindFilesCallback;
void FindFilesCallback(string fileName, FileAttribute attributes = 0, string filesystem = string.Empty);

I was thinking about making my explosion camera shake dynamic instead of preset
That sounds a lil better maybe
where is it ๐ญ
Is it intended or a bug that EOnContact does not work in Dedicated for player character colliders? It processes vehicles fine but player character colliders are a no go. Or is it simply because the server is not processing physics for player characters since they're owned by the player and the player is responsible for physics updates 
anyone know how to unpack the .pak files ? i want to grab all the scripts and open them up in visual studio code
It's serverside for AI and host and clientside for players in which case you'd have to rpc info over I guess
Already went through this with my mech when I was making it break trees and fences walking into them
Yeah.. it's what I gathered.. Kind of sucks but sort of makes sense from a flow standpoint. Trying to create a bouncing betty mine and it's going to be janky communicating back and forth adding unneeded delays.
https://reforger.armaplatform.com/news/modding-boot-camps-introduction
This Modding Boot Camp seminar was originally held on the Arma Discord Server on November 20th, 2024.
Join Modding Supervisor Mario Enrรญquez for our first Modding Boot Camp, where he gives a quick overview of the Arma Reforger Tools and Workbench.
00:00 - Modding Boot Cam...
Ah because you are using contact to detonate the mine?
Yeah sort of, the contact starts the animation and yada yada.
You probably dont want clients to have authority to detonate the mines
Server will detonate the mine as it should I'm just going to do what you said and have the player responsible for the contact tell the server to start the whole chain.
Right so hackerman can then remotely detonate all mines on the server
Deal with enough of them roleplaying they're in the Wanted universe* curving their bullets 
Tbh add serverside anticheat, if player position is > 50m but they somehow collided just instaban
is there a method which resembles C#'s String.PadLeft?
SCR_StringHelper.PadLeft
Is there a scriptmodule resembling javascript's is-odd
Can't find variable 'SCR_DateTimeHelper'
How is it not there, when the class literally exists? ๐
yes. someInt % 2

What script module is your script in?
scripts/GameLib
moving it into scripts/Game seems to work. But shouldnt it also work in GameLib?
No
They are layers
Core module gets compiled first
Gamelib module gets compiled second, and has access to Core module.
Game module gets compiled third, and has access to Gamelib, which makes it have access to Core
Ahh okay, got it, thanks!
Wait till they learn about GameRef module 
Can I have DIY namespaces if I just make global variables and nest instances in them
I did that some time ago in DayZ. So I had CF.FeatureName.FeatureClassName ... it was magical - and so annoying we simply switched back to CF_ prefix
One huge QOL upgrade would be to stop having to Class.Cast and have it inferred by the compiler from the type declaration of the variable or parameter type
Also collapsing code blocks for god's sake
Why do you give him ideas?

Implicit casting only works for downcasting. on upcasting the user must make an informed decision or else you can accidentally upcast into something that it not actually possible by easy mistake
Then throw a VME, it's my problem at that point
I'm just sick of MyType myVariable = MyType.Cast(something)
do auto mytype = cast then
Does autocomplete work when its auto?
I'm okay with typing variables, but the cast is just annoying
Especially since the compiler knows what type I want
So MyType myVariable = (auto)Something could hint to the compiler to use the type from the variable definition
It doesnt have to try to be smart
Implicit upcasting is only a thing in unsafe type languages, anywhere else you have to do an explicit cast. and the difference is that you need to write "Cast.", the typename and surrounding () is the same usually. var meh = (Type)base;
It is not about not knowing or smart or not, it is an intentional design decision to protect users from bad actions



