#enfusion_scripting
1 messages · Page 27 of 1
There is a spawner entity which creates the vehicle instance which includes these functions
Yeah so check if it's a vehicle through cast or something
Worked like a charm, thanks 🙏
Is there a way to trigger a weapon to fire from an action? We're developing a smoke countermeasure system (which is already set up and working), and we want it to be launched from a button in the vehicle using an action, but I haven't been able to figure out how to trigger the weapon to fire
so when\how does this happen with characters and vehicles
server is owner, controller is authority?
hey folks!
Could somebody explain me how actually AddActionListener is working, please.
I want to create a simple terminal with command line. I could handle the Inner logic behind it, but I don't understand how to add simple action on Enter button (KC_Return if i'm not mistaken).
Let's say, I want to print "Debug", when pushing Enter.
the code below doesn't work for me =(((
GetGame().GetInputManager().AddActionListener("PcEnter", EActionTrigger.DOWN, DebugPrint);
void DebugPrint()
{
Print("Debug");
}
I also added PcEnter to Actions in chimeraInputCommon.conf, restarted my workbench. But nothing has happened 🙁
the action has to be in a context that is currently active
I added it to CharacterGeneralContext, but nothing has changed 🙁
If you followed everything that I mentioned before then it should work
If it doesn't then you've done something wrong.
Thanks! Will be investigating
Okay Im getting lost now
So I am facing the right way, AKA the parent prefab is at the right angle, but my child prefabs, the plane object is SLIGHTY off angle
Nothing is done differently
And this only happens on dedicated servers
It's not like it isn't getting rotation
It has rotated from where it's spawned
But it's just slightly off from the rest of the object
Okay
For some reason scaling the model up by 2 caused it to be off by exactly 15 degrees
But if it was 1 it was fine and lined up perfectly with the parent
Autority is always server, otherwise entity will be fully local to client (no replication at all). When you begin control of character or enter vehicle as driver, you become owner of them
You can script a custom UserAction and then whatever your script is can call from the UserAction
Yeah, I get that part for sure... But I can't figure out how to trigger a weapon to fire using a script and then call that from UserAction, that's what I'm asking
I don’t have much experience with weapon scripting but I’d have a poke around some of the weapon components, there’s got to be a method somewhere
Is there a way to automatically reset the Base AI limit on server restart?
Current situation:
I host a server for Gramps Conflict PvE, I had noticed that when players log off, their model will still get saved by the game. I want their models to dissapear when they log off. So I installed a mod called 'AIPlaceholderDeleter', which seems to work.
However, when I restart the server, that mod also deletes all the US AI troops that have been spawned in using the Base AI limit by players. When it deletes these US AI troops, the Base AI limit stays at 100%, meaning that players cannot spawn any troops to guard against counter-attacks.
Does anyone know of a way to reset that limit automatically on server restart?
P.S. I don't know if this is the right channel to be asking this question, if not please redirect me to the right one! Thanks 👍
is there a way to script an AutoDoorOpener for vehicles so they spawn with the doors opened pls? ty
also is there a way to simulate shaking on a vehicle + driver camera ?
do i gotta use : SCR_GenericCameraShakeProgress ? i got it nvm
Yes
pls tell me
Looks like you're sol these days, opening vehicle doors doesn't work like it used to.
The requirement now is a CompartmentAccessComponent on a character
swap the door close and door open anims
cars will spawn with doors open visually but the action will say closed, then you can change the actions to be correct
might also have to swap the character anims
might be somewhere in the anim graph where u can set initial state, not sure tho
anyone knows any way to do silent footsteps?
like turn the footstep sounds off for everybody?
or turn them down\off while not wearing boots?
Thank you I'll try this
Hello
What component/module/whatever is required to enable building from engineer trucks?
I have action on truck, but after clicking - nothing
yeah unfortunately that is currently the only way. you can make a feedback ticket @sour prawn to add an option to open a door via compartment manager so you can do it on vehicle init code and such
That would be cool yes thank you mister developper
Can you link me the feedback ticket pls
howdy all.
in the process of building a RP server for AU/NZ area, created a few things for it so far, right now im working on some civ jobs, specifically deliveries, i was wondering if there was anything that would allow me to have a visual marker show on screen, not the map, for the delivery point location? if there is anything that anyone knows of, that would be helpful.
Cheers
am I right, that the only way to create new .json file is to call SaveToFile from SCR_JsonSaveContext?
I'm suprised there's no CreateFile method in FileIO 🙁
if you want to write json, use it. it provides you all the convenience.
you can manually open files too, there is no create, you open a file, and if it does not exist it will be created.
oh! thanks!
How to reconnect back to dedicated server tool from peer client?
Via the IP the server was registered with. may be your home networks public IP. localhost works if it was registeded with local
"publicAddress": "local",
"publicPort": 2001,
I would guess it's the nulls that you passed.
I'm replying regardless of you deleting the message. Lol
yep! I tried to add Parent node unsuccessfully !
Pass nothing for no parent lol
trying to recreate unix-like filesystem
string dirName;
ref array<ref Dir> folders = {};
ref array<ref File> files = {};
ref Dir Parent;
ref Dir NewDir(string dirName)
{
Dir dir = new Dir();
dir.dirName = dirName;
dir.Parent = this; //problem was here
return dir;
}
Too many instructions per function
How to find real root cause or fix? In logs classes and functions which are not used in my mode
Wdym in your "mode"?
it means compiler actually doesn't know whats wrong but if you poke around you'll find the code, it was probably something you added recently
or an infinite loop maybe, not sure
Subject: Best practices for Player Escorting/Dragging System
"Hi everyone, I'm currently developing an Escort/Dragging system for my mod. After researching and testing, I found that the most stable way to handle player synchronization and physics is by using an 'Invisible Proxy Entity' (essentially a hidden vehicle) that the victim gets moved into.
I've noticed that many existing mods (like others) use a similar approach because it seems to be the only way to bypass the engine's current limitations with player-to-player physics.
My question is: Is this still the 'Standard' way to do it? Or is there a more modern approach using the new Enfusion updates that doesn't involve proxy vehicles? I want to ensure my implementation is optimized and follows the community's best practices regarding IP and performance.
SCRIPT_MISMATCH if it only just said which mod in that message that would help so much 🙁
Because mosly the fix is delete mod and rejoin. But since this message is generic = DELETE ALL MODS and now you need to delete 17GB again xD
If I focus more on logic and less on 3D modelling, will I be able to make simple procedural kinematics work without rigging bones to meshes?
Usually happens if you have the editor open, using that mod. And also have the game open and download a new version of said mod
Delete smallest mods first then work up
If you have the advanced blood mod that seems to cause the same issue for a lot of players, delete and redownload. low chance but might aswell throw it out there since that has been an issue ive been seeing
I understand, but it would be really helpfull to put it in the message.. right.. feels like an easy win for devs? 😄
Well easy win for us, but easy to implement 😄
Hi everyone,
I’ve been trying to find a proper way to drag or attach a player and move them to another location (specifically an escort system), but so far I haven’t found a reliable method.
The only workaround I’ve seen—used in mods like ACE Carry and Narcos Life—is placing the player into a vehicle and then moving the vehicle. I’m a bit concerned about using this approach in case it could cause issues or violate any rules.
If anyone knows a better or more proper method to achieve this, I’d really appreciate your guidance.
violate any rules
What do you mean?
As far as attaching one player to another goes, vehicle compartments is probably still the only possibility. Directly attaching players to each other was broken the last time I tried.
I think the dragger mod takes a different approach. Probably updating the position on each frame or manipulating the physics, but it can be a bit laggy from what I've seen.
Yes best way vehicle compartments
And alternatively to building an escort system from scratch, you could use ACE Captives or mod it if you need adjustments.
Oh, thanks! I need to check if it’s open-source or not.
It is, it's GPLv2, so you could even run it on monitized servers.
Hello. I have client script, user action. How to get IEntity user rank or XP without using server? only on client
You probably can't.
It so bad
No, it's good. Embrace authority!
that mf is cooking some cheats
I want to restrict vehicle driver seats by rank. Any ideas how I can do that? Tried with user action, but can’t 🙁
Huh? I just checked SCR_CharacterRankComponent and it looks like the rank should be replicated, hence accessible to clients.
let me check. Thanks for hint
Hi I'm looking for help on a script I'm writing. I would like to make a new type of voting. I have made my class like CLINTON_BotsVoting : SCR_VotingReferendum. The idea is that normally a vote contains one int like SCR_VotingReferendum.m_iValue to store the thing that's being voted over (this int usually stores the playerID of who's being kicked or promoted to GM) However, I would like an Array of Ints and each player has the usual vote or abstain options (not like SCR_VotingElection, the array don't matter as long as the data is being stored). I have the notification working and I can get the vote to pop up on a peer's screen, and it ends which runs CLINTON_BotsVoting.OnVotingEnd(). However, my member variable which is the array of int's is set to null when I try to use it in OnVotingEnd(). I'm not sure what's going wrong. (I can paste my code into the chat, I'm just avoiding spamming large chunks of text). What I'm doing is making my own versions of the functions in SCR_VotingManagerComponent. Like I've copied CreateVotingInstance(EVotingType type, int startingPlayerID, int value) into my own function like CreateVotingInstance_Array(EVotingType type, int startingPlayerID, int value, array<int> units_in_faction). The only difference from the AR code to my code is inside CreateVotingInstance_Array I have the lines
CLINTON_BotsVoting voting = CLINTON_BotsVoting.Cast(template.Type().Spawn());
voting.InitFromTemplate(template, startingPlayerID, value, remainingDuration);
voting.SetValues(units_in_faction);
...
m_aVotingInstances.Insert(units_in_faction);
(I'm happy to paste my code into the chat if needed just avoiding spam)
@forest arrow did you need it to not use the server at all? It sounds like you could get the client todo a RPC to the server, server checks the players level then somehow does a RPC back to the client
I found hooks for guns in general and for grenades. what is event handler for mortars?
I want to know everything about a base service entity that was built, how can I traverse up the parent hierarchy of it when it's built?
Example, a vehicle depot was built: Who built it, who placed the blue print, base name it's at, the prefab name, map coordinates, time it was built, the building faction, its unique ID, etc.
Traversing is done via GetParent / GetRootParent
Info on who placed it can be obtained from an editable entity component in any gamemode that supports it.
Working on an occlusion-based rendering porthole script. Slow but steady progress! Trying to make working tank portholes that don't require camera changes or PiP.
You know what would be nice, some git diff view in the scripting files, so I can see what changed and maybe revert some thing
Oh cool, is this like a plugin or how to install this?
There is config for that in workbench, but I haven't figured out how to use it yet
Plugins > Settings > VCS Configuration
Presumably you can just replace those with git commands, but I haven't tried it as I just use VSCode diff atm
How to check if entity inside another entity?
i want to check if player is inside rock
im using SCR_WorldTools.TraceCylinder and world.TraceMove
i think there another trick to better implement this?
protected bool IsPositionClear(IEntity entity, vector position)
{
vector mins, maxs;
entity.GetBounds(mins, maxs);
float height = 4.0;
float radius = 1.0;
vector checkPos = position + Vector(0, height * 0.5, 0);
// Method 1: TraceCylinder - checks player-sized collision
if (!SCR_WorldTools.TraceCylinder(checkPos, radius, height, TraceFlags.ENTS | TraceFlags.WORLD | TraceFlags.OCEAN, GetGame().GetWorld()))
return false;
// Method 2: IsInsideEntity - checks if inside large entity (rock, building)
return !IsInsideEntity(position, entity);
}
// Checks if position is inside any entity (rock, building, etc.)
protected bool IsInsideEntity(vector position, IEntity excludeEntity)
{
BaseWorld world = GetGame().GetWorld();
TraceParam param = new TraceParam();
param.Flags = TraceFlags.ENTS | TraceFlags.WORLD;
param.Exclude = excludeEntity;
// 6 directions: +X, -X, +Y, -Y, +Z, -Z
array<vector> directions = {
Vector(1, 0, 0),
Vector(-1, 0, 0),
Vector(0, 1, 0),
Vector(0, -1, 0),
Vector(0, 0, 1),
Vector(0, 0, -1)
};
int hits = 0;
foreach (vector dir : directions)
{
// Trace 50m in each direction from position
param.Start = position - dir * 50;
param.End = position + dir * 50;
float result = world.TraceMove(param, null);
// If trace hits something (result < 1), increment hits
if (result < 1)
hits++;
}
// If 4+ traces blocked, we're inside an entity
return hits >= 4;
}
If you don't mind that they can only be placed without a roof, you could first do the cylinder check and then send a tracer up to the world y bound.
NavmeshWorldComponent::GetReachablePoint is also an interesting method, but it can fail if there are large cliffs and navmesh islands got generated within them.
Thanks, is there an easy way to call all the items I listed? I'm looking for a way to track everything each faction builds using a simple array e.g.:
{UniqueID_012345AB, entity_LightVehicleDepot.et, base_Montignac, built_GiantsFan123, placed_EaglesFan2020, faction_USSR, time_0905 PST, coordinates_12.0_55.5_3.0}
is this all the source scripts or only ones that have changed?
How can I pull more information about placed prefabs to get everything I want about them? I think I have 4 ways to do it (2 ways for two different .et files), but dunno what to use to get info about them. I thought I'd be able to at least get the Faction with SCR_EditableEntityComponent, but it just returns Null 
modded class SCR_FuelNode : BaseFuelNode
{
override void OnInit(IEntity owner)
super.OnInit(owner);
[...]
owner.ToString(): GenericEntity<0x0000027C9BB4C348> @"ENTITY:6917529027641082048" ('GenericEntity','Assets/Props/Military/Fuel/FuelPump_USSR_01/FuelPump_USSR_01.xob') at <1126.298584 39.051060 2729.769043> @"{EAE7EE94ECB73285}PrefabsEditable/Auto/Props/Military/Compositions/FIA/E_LFD_FuelService_FIA.et"
SCR_EditableEntityComponent.GetEditableEntity(owner): SCR_EditableEntityComponent<0x0000027D29BE5930> (Owner : @"ENTITY:6917529027641082048" ('GenericEntity','Assets/Props/Military/Fuel/FuelPump_USSR_01/FuelPump_USSR_01.xob') at <1126.298584 39.051060 2729.769043> @"{EAE7EE94ECB73285}PrefabsEditable/Auto/Props/Military/Compositions/FIA/E_LFD_FuelService_FIA.et")
SCR_EditableEntityComponent.GetEditableEntity(owner).GetFaction(): NULL //WHAT!? Player-built fuel depot
owner.GetParent(): GenericEntity<0x0000027C9BB4C030> @"ENTITY:6917529027641082006" ('GenericEntity') at <1126.293579 39.051060 2731.563965> @"{3C9FC8943BE4E63B}PrefabsEditable/Auto/Compositions/Slotted/SlotFlatSmall/E_LFD_FuelStorage_S_FIA_01.et"
owner.GetRootParent(): GenericEntity<0x0000027C9BB4C030> @"ENTITY:6917529027641082006" ('GenericEntity') at <1126.293579 39.051060 2731.563965> @"{3C9FC8943BE4E63B}PrefabsEditable/Auto/Compositions/Slotted/SlotFlatSmall/E_LFD_FuelStorage_S_FIA_01.et"
Faction affiliation component
Can someone fill me in on the enum values for KickCauseGroup + KickCauseGroup2? Is KickCauseGroup2 essentially modded KickCauseGroup and the numbers just go up with each group?
Referring to this
If its generated enum
Then it could be preset to different values from CPP than what you would see in script code
Magic
What's the point of SCR_EditableEntityComponent.GetEditableEntity(owner).GetFaction() if it isn't going to print a faction?
Does the thing have a faction affiliation component?
If not, then it doesn't have a faction.
Yup it does, these are fuel storage compositions
You should see what SCR_EditableEntityComponent.GetEditableEntity(owner) prints
I would assume that is somehow an entity without a faction affiliation component
Hello, i have questions about dependencies tree.
I'm currently creating a mod that overriding Arma class but WCS do it too. So i put WCS as dependencies in my mod to be sure that my mod override WCS modification and i can be compatible too with them.
In a dream world, i would like that my mod is without dependencies but how can i be sure that WCS (if used) is not overriding my class.
- Is this order in mod dependencies have importance ? Like import (0) WCS, (1) My Mod. And i'm sure that my mod is priority
- Should we import it in layer mod dependencies ?
Order is important
In the mod list the last mod loaded will be the one to "rule over" when overriding a method tho if you call the base it will eventually climb back up to other mods
What their actual doing and how their doing it is also important
Also good to note that the mod order in server config is bottom to top.
Yea that was part of my post here trying to pull as much info as I could: #enfusion_scripting message
What is this behavior? It's not hitting "AAA" or "BBB" but it's in the function????
SCRIPT : *In GrabBaseName SCRIPT : IEntity ownerEntity = GenericEntity<0x0000022EEB27E868> @"ENTITY:6917529027641082103" ('GenericEntity','Assets/Props/Military/Fuel/FuelPump_USSR_01/FuelPump_USSR_01.xob') at <1133.506958 38.280960 2774.692383> @"{DCDE1C94BF386854}PrefabsEditable/Auto/Props/Military/Compositions/USSR/E_LFD_FuelService_USSR.et"
void GrabBaseName(IEntity ownerEntity)
{
Print("*In GrabBaseName");
Print(ownerEntity);
if (!ownerEntity)
Print("AAA");
return;
Print("BBB");
[...]
what is this, I just needed an else {} and it suddenly works? 💩
Missing {} for multiple statements in branch
It's not python
I thought you could use no curlies if it's 1 line + return
If it's just one line yes*
the return statement is out of the if statement's scope so you will return regardless here
why is my vehicle showing this while im trying to set it up, all the compartments and action contexts have been set up as close to the documentation as possible
what documentation are you following? Might be better to ask in #enfusion_model
The official wiki
link?
last updated 2 years ago, probably needs to be updated here and there. If you can point out where it is wrong, @queen silo can update it
I have no idea how to even set it up lol thats why I was asking
I think you'll have more luck asking in #enfusion_model since they work on the game models there
Ok
1. How can I reliably parse this output?
SCRIPT : owner.ToString(): GenericEntity<0x00000234EC71C138> @"ENTITY:6917529027641082063" ('GenericEntity','Assets/Props/Military/Fuel/FuelPump_US_01/FuelPump_US_01.xob') at <1109.140137 38.999966 2713.393066> @"{1D09F6DDE5595017}PrefabsEditable/Auto/Props/Military/Compositions/US/E_LFD_FuelService_US.et"
**2. How can I dereference what's at memory locations like this with enfusion? **
SCRIPT : string m_LastSpawnedPrefab = 'SCR_EServicePointType<0x000001D34272B4B0>'
-
There is nothing for you to parse. You can just get the individual Infos separately.
-
You don't
For item 2 how can I know what was spawned when I just know its memory location?
There is no concept of memory locations and pointers in script. there is no going back from string debug to entity reference
Read what methods are available for your instance - it's not just ToString
Goto declaration in Script Editor or Jump to script definition in World Editor can help you
yea im trying, some things i dont know wtf it's telling me or why it even exists. Like the memory location of an entity i apparently cant use for anything or dereference
Someone should make a C file of pre-made, efficient queries called MakeShitWork.c
is it possible to get the world position/transform of a specific bone on a character using the bone name or bone ID?
it's just for debugging nothing more, forget about it
Yep, you have to go over their matrices. I did that for my posing tool https://github.com/Hexomanya/screenshot-toolbox
I think the BoneOverlayRenderer file has the logic in it.
You get the transform matrix of the entity and the local matrix of the bone and multiply them. The result should have the global position in it, if I remember correctly.
awesome, thank you. i'll give that a try
hey all, been trying to create the EXILE mod from scratch, right now we are hung up on the trading systems and banking, we are using Dynamic economy, however was wondering how would we set up the shops to be organised and one trader sell guns in one menue, ammo in next, and then clothing inanother tab and then have a diffrent trader sell cars,trucks, ect. and how would be get it so we can edit the starting money from the base 1k
that is way too much for a discord conversation. break it down into smaller pieces
well first we are trying to get the trader menues to show the list of buyable itmes, and a set price into one catagory
2. change the ammount money you spawn with
Wondering if anyone is willing to help, im quite new too the enfusion tools and im just trying to create a script as a component class. I followed the wiki. I saw in a video that you have to place the script into the game directory files but I cannot create a folder in there or create a script it does nothing when I press add new script. Ive made my script in my mod folder and I validated and reloaded scripts. Any help appreciated.
[ComponentEditorProps(Category: "Killroy", description: "Hello World")]
class KLR_HelloWorldComponentClass : ScriptComponentClass
{
}
class KLR_HelloWorldComponent : ScriptComponent
{
override void EOnInit(IEntity owner)
{
super.EOnInit(owner);
Print("Hello World");
}
}```
Eoninit is only called if you turn on the flag for it. Override onpostinit instead
EONInit is only to be used when you need to do something after the entity is fully initialized
Also make sure that your folder structure for component is like so
YourProjectName > Script > Game > ComponentName.c
That too
I actually just did that and it is showing now. Also thank you for the advice. I got a lot to learn haha
It showed with the EOninit?
well it showed up as a component i dont think the hello world is going to work
Ohhhhh
I read it diagonally didn't know you were having trouble finding it as a comp. So my answer was out of subject then lol
Yet, still helpful!
were cooking gang
Is using script as component class like this the best way to execute script? Or is that best for using it say on a object as a trigger or something maybe
Best way to use it as a script
Then there are also game systems but those are a little different
Ok makes sense, what im trying to do is modify the deploymenu to be able to choose a slot instead of the player just taking the first slot when they click on squad. Im guessing Ill want to choose that script here in the spawn logic when I have it finished or would it be ok to just add it as a componentclass to the game mode?
I have never toyed with that UI before so i can't really help you with that rn, but essentially there are two ways to do it, either you override the existing script to add your own logic to it or you create a whole new squad menu and replace the old one.
Ok that makes sense, so I guess my final question would be if I modify an existing script is having it in my mod directory enough for the game to just pick up the modded version?
You should take a look at everything related to scripting on the wiki. Knowing the keywords will be incredibly helpful. I see Kex typing. So I assume he's giving an example of using the modded keyword lol
There are two ways to modify existing scripts: modded keyword and file patching. modded behaves similar to inheritance, but your class will be the one that is used, while inheriting from the original. File patch happens when your copy has exactly the same path, which will replace the whole vanilla file by yours. Preferably, you should go for modded and make sure paths are not identical.
No, just mentioning file patching 😅
Copy that big appreciate guys. I'm gonna start breaking stuff and figuring it out haha
I'd suggest you watch the arma bootcamps video related to scripting especially the two on replication. Those are incredibly important
Btw, there's a "fill from temple" plugin/tool for scripting. Makes spitting out components pretty user friendly
Wished i knew about it
There's also a "new script" plugin/tool
They both use configs iirc
So if you had a script that you would be making a lot of you could add your custom component or whatever to the config
I also write all my boilerplate from temples, or rather the thing between them
Is there a way to ask from a prefab (.et) it's main class and if it has some component attached to it without spawning it?
For example, I want to check if {2013579FE0B109F3}Prefabs/Vehicles/Wheeled/M923A1/M923A1_engineer_MERDC_filled.et is of type Vehicle and has component BaseRadioComponent in it?
Yes, you can inspect a prefab via BaseContainer.
Can I go deeper with inspection without spawning the entity?
I find that there is SCR_EditableVehicleComponent. It has Faction assigned to it. I'd like get that information.
Yes, see SCR_BaseContainerTools::FindComponentSource for getting the BaseContainer of the component.
This is amazing. A big thank you!
Hello ! Anybody wants to make Arma Reforger life roleplay ?
I already made a working base using Typescript & Postgres
Make sure to follow the template
Are you then fully working with the http/api calls ?
Yes exactly, I find it easier to work like that
Currently trying to get the .emats in the materials of the mesh object on a sight
IEntity sight = sightComp.GetOwner();
Resource loaded = Resource.Load(sight.GetPrefabData().GetPrefabName());
IEntitySource entitySource = SCR_BaseContainerTools.FindEntitySource(loaded);
if (entitySource)
{
for(int nComponent, componentCount = entitySource.GetComponentCount(); nComponent < componentCount; nComponent++)
{
IEntityComponentSource componentSource = entitySource.GetComponent(nComponent);
if(componentSource.GetClassName().ToType().IsInherited(MeshObject))
{
Print("MESH");
BaseContainerList materials = componentSource.GetObjectArray("Materials");
Print(materials);
for (int i = 0; i < materials.Count(); i++)
{
Print(i);
}
}
}
}
This is not working it seems
It prints MESH but no numbers indicating actually values found in Materials
Why not use IEntity::GetVObject and then VObject::GetMaterials?
Need the actual resource name
Reading further up I see it’s currently bugged getting the default materials from a mesh object
Yeah, get materials doesn't actually get the materials. It get's the "material slots"
Yeah. Closest you can get is hope prefabs are set up with overrides at all times for runtime finding, otherwise you can read xob headers in workbench
I meant to link that hours ago and got distracted.
Believe that only works when you have access to the meta file. At least I tried that on for instance a base 4x20 scope and had no success.
It only works when what Agent said has happened.
Specifically the mesh object has to have the material overwritten
Either way I was trying to edit the blend mode mid game and it seems like an engine bug when you do
As in it straight up doesn’t work, all it does is make the sight darker and not translucent. I set the AlphaMul to 0.4 as well to no success
Being able too get the assigned should always be a thing regardless of a new one being assigned or not
But it doesn't work like that for some reason
¯_(ツ)_/¯
How are you trying to change the blend mode?
By changing the value in the base container?
If so, that only works on the server regardless.
You could do mag repacking in a single player game mode using that method.
Base classes should never be spawned
So you can override the base and just change the material to whatever you like
Thus making the children "override" the material in said material slot.
Then what I liked above would work..
Would still need to change the child materials, oof
You would have to override the base, and then the first child that the variants all inherit from.
Really lame..
Using GetOrLoadMaterial on the Material class. Then just using the SetVariable methods. They returned true so they were setting it and I could see the scope changing its color. The transparency just was not supported for on the fly changing like that.
Probably just an absurd edge case as what dude would want to change the blend mode mid game to make an object transparent
Any of those values should be changeable, just like in material refs.
But it seems that the update that added all the extra stuff to materials did some changes to what could be changed at runtime as well.
Try switching GlobalLayerMode
I know it works
So if that doesn't work for you then you're doing something wrong.
Will do, whenever I get back to smashing my head against the wall again
Let's say I wanted to add the weapons slots to the blocked slots section of the base loadout cloth component, how would I do that?
Those are 2 different things.
Weapons aren't clothing, they don't get "attached" the same way.
Darn, is there a way to make it so when a piece of clothing is equipped it would block both main weapon slots?
Not sure tbh. Never tried to do that before.
There's a 1.6 glitch that prevents you from selecting anything in inventory, so there might be an "accidental" way to do it 😄
Maybe check the stuff you added to base game too?
I have nothing to say about it besides what i did on the PR this originated from. His responses on there and this mod are a complete waste of time https://github.com/Arkensor/EnfusionPersistenceFramework/pull/67
Should we make a GitHub page documenting the issue like you did when Bohemia wouldn’t respond to the vulnerability you found?
Arma Reforger workbench arbitrary code execution and credential leak vulnerability postmortem - AR-ACE-CRED-PostMortem.md
The proper way would have been to reproduce the crash, report that, as a script issue should never be able to crash the whole game, just throw and VME, then let me know about the mod issue, which he did and I fixed it, and then lastly find the mod using EPF as dependency that tried to submit the malformed data. Even with the change applied it will error out elsewhere. But if he wants to use me as frustration vent he can, I just don't care lol.
Oh i see now you made the commit later but the pr says unmerged?
PR adds 2 checks -> Ark accepts one but not another -> Ark makes his own commit that adds accepted check -> PR is left unmerged 🤷♂️
I am not merging a commit thats technically incorrect. I explained why, said I fixed the data access aspect and closed the PR because its completed. Not sure what else was expected.
I see . Not worried about it, he’s a good dog
Has anyone encountered a situation in Arma Reforger Tools where the application crashes immediately upon opening a project? The project behaved normally during development; however, if a specific script file exceeds a certain line count—sometimes triggering a crash at 2,000+ lines in some projects, or 5,000+ lines in others—the tool crashes during the reloading and compilation process.
Send me the crash GUID and I casn hint you where to begin your troubleshoot
02:33:55.790 CRASH REPORT : Sending Crash Report!
02:33:55.791 CRASH REPORT : Sending Request...
02:34:00.566 CRASH REPORT : Report Result: - SUCCESS - Crash GUID: ce006aa3-a2ff-4c75-a416-932c2e9cc179
02:34:00.567 CRASH REPORT : Crash Reporter Finished!
Definetly related to compiling scripts
I agree with this point of view; however, under normal circumstances, a compilation failure typically does not cause the entire application to crash..🤔
the best thing to do when you can reproduce it reliably is pack up the local mod, and send it over
I'd be happy to—so, how should I send it to you?
zip
I've had that happen to me constantly when i tried passing too many params through RPC calls instead of using codecs normally.
I heard the same for files too big but if your components is 2'000 lines long you should likely consider splitting it into multiple comps/classes.
the base game has over 5000 scripts, how long does a script with 3000 lines actually take to process?
i have one thats ~3000 lines, runs fine.
it's not about runtime, it's mostly that if your comps reach over 3000 lines you should most likely split it into multi single purpose/feature components.
At least that's the way I do it to keep my scripts easier to maintain
and im out here scared to write too many lines, keep everything as modular as possible, and reusable elsewhere if applicable
Don’t stress it. Remember that everyone else will think your code looks like shit regardless, and the entire world is built off of spaghetti and unwieldy codebases 😂
ive started too less, my api is a lot messier than the code i write for arma but ive come to embrace it. either way it gets what i want done. Started to change the way i write after coming back to pieces of code and not understanding whats happening even with comments
I know that all too well, even with years old stuff I’ve maintained 😂
I got crash too when open his project. 5800X and 7800XT, win11. The log shows that application crashed during compiling.
static functions ftw
when i get the chance to refactor imma stuff what i can into those. Didn't learn about em until i already had a method down
I suggest putting them into a helper class.
yee already got one going with a fair bit of stuff in it, as i look through old code though i just see the opportunity. just dont have the time to change it atm
lots of improvements to the backend/api recently to prepare for a much better front end, one day i'll be able to get back into mod work 
Also, If you can't understand what a function is doing based off of it's name, you need better naming conventions lol
Who cares what other people think of your naming conventions, if they work for you, that's all that matters..
the naming conventions are pretty good nowadays, its mainly when looking at the actual logic of the code. If i don't look at it for months or even up to a year or 2 then i gotta really break it apart, find some bugs that way too. Come back after learning a bunch and stuff jumps at ya. Ig thats also another huge thing is i've still be learning as i've been going on both ends, no schooling here just doing project after project
Make sure you name your variables with single letters and mix case all the time in function and class names
Also use auto everywhere
Stop making fun of my precious auto. It is beautiful and deserves respect.
Can it count to 1000
+1, use everywhere)
Can I somehow read the array of traits with SCR_BaseContainerTools (m_aAuthoredLabels and m_aAutoLabels)? The information is in SCR_EditableVehicleComponent.
You can read any and all prefab information, even if they come from game code, via the base container api. it can read array<type> etc too.
I succeed in reading information like faction affiliation from FactionAffiliationComponent, but I'm missing smth on reading the traits.
The information is in SCR_EditableEntityUIInfo within SCR_EditableVehicleComponent.
Is SCR_EditableEntityUIInfo a IEntityComponentSource?
Get("m_aAuthoredLabels", ..) should work?
no you need to grab the component source of the vehicle, then get the ui info object, then get the array from it. but usually all info you are supposed to use is exposed via script for the editable stuff, so if its not exposed, then you probably should not access it
then get the ui info object
How is this done?
GetObject
Thank You!
Using pixel grids for importing images at runtime only solution?
I saw some hinting at server only code coming a few months ago. Is this still something in the works? Any updates on this?
Don't expect it any time soon. It's just a concept we are discussing, but nothing beyond yet
Got it, thanks for the quick response. Glad to know it wasn't just a rumor at least!
what about having workbench just obscure scripts that we designate as private. and allow us to do our own version of proto external. maybe proto SCR external.
What you mean is extension support, which will never be an option for any scripts that run on the client. For servers it's a maybe, but again nothing is done yet in that regard beyond the idea discussion.
Yeah that just crashes my tools
Wait nvm Im just dumb one sec
Yeah that worked
Changing the blend mode mid game must just be busted
Did someone here have luck with setting "Flags" via a workbench script in the last few months?
I still have the problem that everything I try just resets the flags to default, when the same vanilla script works (https://feedback.bistudio.com/T195816).
do you mind if i ask why it will never be a thing for modders but maybe a thing for server owners?
Most likely has to do with letting end users know(if they wish to) know what's running on their local machine.
Also helps knowing if someone yoinked your code.
That's just a guess tho
I am talking about client vs server, not communities. Consoles won't ever support client side extensions and I don't see us adding support just for PC players as it is a risk for users and attack vector for cheat makers. Yes there are a handful of nice use-cases for Arma 3 like teamspeak plugins, but I am not sure if they will justify an exception. There are many people here strictly opposed to ANY support to it, so getting them for dedicated servers on windows and linux would already be a lengthy process. The idea already floats around for years now and that it's still not there should tell you a lot.
ok i think i understand the reasoning behind it
Hi! How can i give default value for typename in parameters?
With a fast OOP script language and native http client included a lot of use cases can be covered already. What is left are "fun" projects we saw in A3, that are definitely cool but never saw any "real use" in any gamemode, and a few who want to integrate the game with other services. Who knows, maybe its not that much more to allow it on PC and if people want to make a PC only server so be it, but we'll walk that road when we get there.
You can assign null as default or the class name directly I believe? Or is it not letting you compile it then? It might take func(typename type = "Bruh".ToType()) then. Not sure.
Having these things available to pc only communities would be great. Many that have moved from A3 are PC only and intend to remain that way in perpetuity.
Are there going to be any new plugins to make certain tasks easier (https://discord.com/channels/105462288051380224/1486981568370053150) as well as better scripting documentation?
I agree http covers 90% of use cases, and certain ones like "port flight model from A3 to enfusion" could just do it via a mod, though there is a need to see serious improvements or a generic/extensible vehicle controller/simulation/nwkmovement component, that's what is stopping a lot of gameplay mods right now imo.
Oh my fail, typename typeName = SCR_BP_PossibleBasePrevComponent worked fine,
but how can i use typeName for class?
not too big problem if its not possible, i have several other solutions... i only curious
void getPositionsFromPBPComponents(out array<vector> outVector, IEntity base, typename typeName = SCR_BP_PossibleBasePrevComponent)
{
array<Managed> baseAPossibleBaseComponents = {};
base.FindComponents(typeName, baseAPossibleBaseComponents);
foreach(Managed managed : baseAPossibleBaseComponents)
{
typeName component = typeName.Cast(managed);
if (component) outVector.Insert(component.getPosition());
}
}
typeName in line 4 working fine
problem in line 8 "Unkown type"
how can i use typeName for classname in this case?
You can not use it like that. But what you are doing is expecting a base class of at least SCR_BP_PossibleBasePrevComponent and then some more specialized filter, but in the end you only take the position data. so i am not sure if you need this filter at all, and if so, just check the typename inheritance is at least from SCR_BP_PossibleBasePrevComponent, and then later for the outvector cast to SCR_BP_PossibleBasePrevComponent instead
ok, thanks
@torn bane Sorry to ping you directly, but this error is driving me crazy and is breaking half of my editor scripts. Do you have any idea why calling
api.SetVariableValue(entitySource, {}, "Flags", newFlags.ToString());
might reset unchecked flags back to checked if they are enabled by default? Right now, it makes it impossible for me to turn off the RELATIVE_Y flag via script.
The value of newFlags does not matter, if the entity has RELATIVE_Y set to true by default this call will reset it to it.
I do not know, maybe worth a report on feedback tracker if you think it is a bug. otherwise @minor agate
You should feed it null if it's data directly on top level object, not {}
But just to make sure, how are you calculating newFlags?
null or {} does not seem to make a difference in this instance. Both have the same outcome.
This is the relevant code:
EntityFlags lastFlags, newFlags;
lastSelectedSource.Get(DAB_Names.FLAGS, lastFlags);
entitySource.Get(DAB_Names.FLAGS, newFlags);
if(lastFlags & EntityFlags.RELATIVE_Y) {
newFlags |= EntityFlags.RELATIVE_Y;
} else {
newFlags &= ~EntityFlags.RELATIVE_Y;
}
//Flags
api.SetVariableValue(entitySource, null, DAB_Names.FLAGS, newFlags.ToString());
But even you even have the reset behaviour if you leave newFlags umodified. So just get and set and the flags still reset.
Same if you set newFlags to 0. Also tested it with "Flags" instead of the const DAB_Names.FLAGS
<@&105621371547045888>
I also did a report some time ago (https://feedback.bistudio.com/T195816). But it is not a full reset anymore, just a reset of all flags that are turned on by default.
you are a moderator 🤣
hmm, weird
I will pass it around
Thank you. If this turns out to be a bug rather than an error on my side, it may be worth noting that the script (and the corresponding function call) was working normally until an update shortly before the report was created.
In a Workbench tool, is there another method to get a keypress other than checking on OnKey Events? The problem with this method is that you can only use keys that are not used in the workbench already.
Are there any other commands besides GetIlluminationFactor() for checking how much a unit/item/object is illuminated? It's quite strange that in this situation, my character is supposedly completely illuminated. 
Trying to set up keybinds?
Or just any key pressed
Keybinds
@trim aurora
Dumb question, is there any simple way to make it so scripted cameras can render entities from very far away? Like buildings ai etc
Simple way, likely not. And especially not for ai, player, vehicle etc.
Those are limited by the network view distance
Does this method only work ingame or also in the workbench?
how can i script a button that need to be hold and then ajust value with scroll wheel ?
You can make new action in chimerainput.conf, then need add to ingame context. Activate by inputmanager.AddactionListener(..) and put your scripts to callback part.
I think he means scripted user actions that are scrollable to set the "progress" of it, eg the rhs (or wcs) sliding the sight along the rail
yeah
exactly
how ?
i think they sets enable Perform per frame in Action and uses scrolling input in scripts, maybe they predefine some attach points too but i'm not sure. if workshop mod licences allows, open and check it
better if you ask original modder who made it
i wanted the money :(
It is what it is
What did I miss? lol
awww man. I love money lol
I take it if I want SCR_MilitaryBaseLogicComponent().GetBases() I can't be a cheap date and call it directly like in the screenshot, but I gotta assign it to an object first then call it
im going to petition BI make enfusion script be more like javascript
Class() is constructor notation. I assume you want to get the bases of an existing component on some entity?
SCR_MilitaryBaseLogicComponent comp = SCR_MilitaryBaseLogicComponent.Cast(entity.FindComponent(SCR_MilitaryBaseLogicComponent));
if (comp)
comp.GetBases();
You do not technically need to do the variable assignment, it can be done in one line directly after Cast(), but you usually should so you have the null check.
Yes I've been trying to get the base name for service stations that are built/placed by GM, but they're always NULL.
Maybe show your full code?
It is messy but here it is. Maybe im not using the correct map mode in WB to grab the base names.
modded class SCR_FuelNode : BaseFuelNode
{
override void OnInit(IEntity owner)
{
super.OnInit(owner);
Print("----In SCR_Fuel Node: " + owner);
//Prints "GenericEntity<0x000002A6A9C86760> @"ENTITY:6917529027641082754 ('GenericEntity','Assets/Props/Military/Fuel/FuelPump_US_01/FuelPump_US_01.xob') at <1012.185730 37.873810 2817.788818> @{2DF0C0623E207C7E}PrefabsEditable/Auto/Props/Military/Compositions/US/E_LFD_FuelService_US_Conflict.et"
// TODO If I know base name is not in a array of base names, set its fuel very low.
SetFuel(10.0); // Affects vehicles, fuel cargo, and gas stations
// Get as much info as possible on the prefab
Print("owner.ToString(): " + owner.ToString() + "\nowner.GetPrefabData(): " + owner.GetPrefabData());
Print("owner.GetParent(): " + owner.GetParent() + "\nowner.GetRootParent(): " + owner.GetRootParent());
Print("SCR_EditableEntityComponent.GetEditableEntity(owner): " + SCR_EditableEntityComponent.GetEditableEntity(owner));
//Print("SCR_EditableEntityComponent.GetEditableEntity(owner).GetInfo(): " + SCR_EditableEntityComponent.GetEditableEntity(owner).GetInfo(owner).GetUnformattedDescription()); //Null ptr error
GrabBaseName(owner); // See below for func
}
}
What do you want to achieve, overall?
At each base when a service station with the first fuel service station is built, it has 100% fuel in it. Otherwise, there's 0 fuel. I already have the fuel svc station prefabs set with a fuel manager component, like fuel depot, vehicle depots, helipad.
so im trying to pull the base names to be used to see if a fuel svc was already built there or not
here's another i've been trying to get to work. I call this function with the override above.
//Get base name when svc point is built by player or placed by GM
void GrabBaseName(IEntity ownerEntity)
{
// Get the entity this fuel node belongs to
if (!ownerEntity)
{
Print("LFD: GrabBaseName !ownerEntity");
return;
}
// Find the SCR_ServicePointComponent on the owner entity
SCR_ServicePointComponent servicePoint = SCR_ServicePointComponent.Cast(ownerEntity.FindComponent(SCR_ServicePointComponent));
if (!servicePoint)
{
//Print("LFD: GrabBaseName !servicePoint");
return;
}
// Get all registered bases
array<SCR_MilitaryBaseComponent> bases = {};
servicePoint.GetBases(bases);
Print(bases);
if (bases.IsEmpty())
{
Print("LFD: GrabBaseName bases.IsEmpty()");
return;
}
// Cast to SCR_CampaignMilitaryBaseComponent and get the base name
SCR_CampaignMilitaryBaseComponent campaignBase = SCR_CampaignMilitaryBaseComponent.Cast(bases[0]);
if (!campaignBase)
{
Print("LFD: GrabBaseName !campaignBase");
return;
}
Print("Fuel depot is at base: " + campaignBase.GetBaseName());
}
maybe the map im loading isn't calling the base name bc there isn't one 
Fuck javascr*pt
ok ok, golang or nim🧌
ok this has to be why the base name is always null. It doesnt look like any of the WB worlds use what MP servers use for bases (command tent)
Hey, question.
If you are trying to change entire charachter HP to something similar to ArmA 2 DayZ mod blood system, what would it inherit?
Or would you need to make idk something new entirley?
I have a simple concept in mind but never really coded for an actual game before 
Rejected before even asking for it 
I'm stuck on figuring out how to make prefabs properly equippable, and then how to add the custom eat/drink actions when in hand. Thanks for any help
Def look at how a radio works
I'm confused, why not look at one of their prefabs?
our server keeps crashing and this is the error it keeps giving.
anyone has an idea where its coming from, or how to fix it?
Log /home/container/profile/logs/logs_2026-04-25_21-19-16/crash.log started at 2026-04-25 21:31:37 (2026-04-25 21:31:37 UTC)
25.04 2026 21:31:37
Virtual Machine Exception
Reason: Maximum number of attempts exceeded!
Class: 'SCR_TurretControllerComponent'
Function: 'RpcDo_ACE_ForceReloadWeaponWithServer'
Stack trace:
Scripts/Game/ACE_Core/Components/SCR_TurretControllerComponent.c:84 Function RpcDo_ACE_ForceReloadWeaponWithServer
Scripts/Game/game.c:866 Function OnUpdate
Runtime mode
CLI params: gproj ./addons/data/ArmaReforger.gproj config ./config.json profile ./profile backendlog nothrow disableShadersBuild rplEncodeAsLongJobs logVoting logStats 600000 maxFPS 60 freezeCheck 120 freezeCheckMode kill autoreload 30 autoshutdown addonTempDir /home/container/tmp
Looks like something to do with the ACE_Core and RPC
@dire sinew So you're aware.
I added that VME myself for when the scripted reloading fails. Reforger just throws any VME into the crash log, even those way before the crash. If you don't have a stack trace to enforce script at the very end of the log (which is very often the case), you don't really have a chance to pinpoint what it is.
So no, this is very unlikely what caused the crash.

I mean look at the timing. if the script issue is not on the exact same millisecond as the crash they are unrelated.
Also that you can see the VME multiple times. If it were the issue, it should have crashed the first time.
Oh we still going? well I'll smooth brain this past all of you! the last thing in the crash.log is the crash 
Crash.log should be renamed to vme.log, the crash traces mean nothing there anyway
Ehh.. I've had a few that were clear as day what and where the issue was, it was so out of the norm that I thought that was a bug till ark confirmed it lol.
cehck
can you help me, with adding VME logging or explain how it works to implement it?
It's just Debug::Error or Debug::Error2.
It will throw a VME pointing to that line with the message you pass.
Are you seeing anything that says "too many instructions per function"?
Hello. Cant execute rcon command from rcon
[RCON] Process Command: #rconkick 4b4a2ac0-fb5c-4c33-99d1-ee387a6fce08
also tried rconkick, but without #, same result
By log I can see that server received command, but cant understand why it not start processing it
Rcon configured and has admin permission
log without #:
[RCON] [CLIENT: 0] Received Game Command: rconkick 4b4a2ac0-fb5c-4c33-99d1-ee387a6fce08
21:35:25.749 BACKEND : [RCON] Process Command: rconkick 4b4a2ac0-fb5c-4c33-99d1-ee387a6fce08
Like in file I have a lot of logs, no logs i can see on server after command executing + player is not kicked
Don't suppose you are using AI for this and it's just making stuff up?
Half of the functions you mention here seem like an AI trying to apply Unity game engine features to Reforger
If I have a ScriptComponent for example that I want to be shared and accessible by scripts and code how do I get a reference to it? I want to do something similar to a global singleton, I just need one instance to keep some shared data. How can I get a reference to it?
Usually singletons would have a static method on the class which returns the instance (or creates it if it doesn't exist)
You could look at some of the vanilla component classes attached to the GameMode entity to see how they do it
Make it a game mode component
Or depending on your use case if could be handled better in a game system
It really just depends
But there's no need to make an entity to hold a component, just to have a singleton
Or you can just do a non-component class that has a static ref to itself.
Many different ways to do it, just depends on your use case tbh
I tried going down the SCR_BaseGameModeClass route but that was really difficult to get working and setup a brand new prefab in my World. Is it possible to just extend like the GameModeSF so I can use all of that existing content as well as the prefab? I suspect I went too far "down" and should just leverage more of what's already available.
Yeah you can inherit the GameMode prefab (and class?) and then make your own changes on top
If anything I think it is recommended to do this as otherwise you are gonna have a hard time maintaining it when the vanilla stuff changes
Any chance there are tutorials or examples on this that people are aware of?
I can't speak for tutorials since I haven't really looked, but I've been trying to learn how to do this by looking at how the Conflict and CombatOps modes are implemented
You can use that as an example of how to make game mode derived from the base gamemode
If you are inheriting from the scenario framework mode instead of the base gamemode it should be fairly similar, maybe simpler since a lot is already set up
that's a good idea, thanks
Yes, just override/inherit/or duplicate the game mode prefab.
Depending on your use case
Making a prefab from scratch is for when you really know what you're doing and know WB very well
Looks like ai slope, don't use ai
Yeah its ChatGPT gibberish
How does NwkMovementComponent work exactly? Does it only sync movement when authority moves it? Does it always sync, like should I only have Simulation enabled when needed and disable when idle?
I am not sure if this helps you but if I add NwkPhysicsMovementComponent my physics based authority moved entities are lerping around instead of teleporting
I put it in my AI planes
Was testing Interpolation Keyframe if that teleports it, but that just crashes the PeerTool 🙃
So defines made in other mods working only in workbench is a bug? Or is that intentional
Guuuys, pls help 🙂
Whatever it's the FUTURE Old man!!
I want to be a doctor but don't want to attend med school
Stop gatekeeping
Hello guys, is there some people working with PeerTools ?
I don't know how to use on each instance a different uid for tests purposes ?
Most probable your doctor uses AI assistance every day. 4 in 5 do.
Yet nobody thinks that AI can replace medical school, because that's absurd.
Yet plenty think it can replace learning in modding/scripting, which is equally absurd.
average vibe coders
My doctor is old asf and doesn't rely on SlopGPT lol
Too old to be a slop zombie
2 local health networks have mandated it into workflows, it’s no longer an option. Crazy time to be alive
a carpenter could hit nails in with his hand but it speeds things up to use a hammer
he just needs to learn not to smack his hand with the hammer
I get why Enfusion Workbench modders are turning to Chat Jipperty. There is no structured learning tools out there, so everyone is asking chat. The Assets tutorials are set out from beginner/intermediate/advanced, but the scripting tutorials have no progression labels which can stump most people.
Please tell me how to write my script correctly so that it works, and how to check if it works?
Hi! Is it possible to separate server-side and client-side scripts?
I tried to implement something similar but got the error
RplConnection::ValidationError remote script source code checksum does not match!
As far as I understand, this is only possible in debug mode.
It would be convenient to have the option of not publishing the server source code.
There is script modules, that you can load dynamically like "dlls"
Or just move it to web server logic and use restapi
Thanks! I didn't know about this, but it looks like a super crutch 😅
Apparently the only adequate way to switch to restapi
This pretty much sums the whole thing up pretty neatly
So Server can sync the velocity via NwkPhysicsMovementComponent to everyone but the pilot, cause they get ownership of the vehicle and that cant be moved by the server? If I remove ownership it breaks input, but it starts moving on the pilots side 
Is it a vehicle entity? In that case maybe one of the vehicle nwk movement components
Yeah its a vehicle but the vehicle nwk move also dont seem to work
and they require a vehicle simulation component
do you need physics for the NwkMovementComponents ? or can it work without that ?
I put an empty one in mine lol
As in wheeled but no actual drivetrain
That doesnt instantly crash everything?
It doesnt when you add a dummy engine, gearbox and whatever else there was
Where did you get that metric? Link to source please
Or is it you thinking you know everything again?
Prob got it from AI 
How many do you want? 80% metric though is regarding integrated health record systems. I'd bet it above that figure by now.
https://www.ama-assn.org/practice-management/digital-health/2-3-physicians-are-using-health-ai-78-2023
https://jamanetwork.com/journals/jama/fullarticle/2840175
https://www.healthaffairs.org/doi/full/10.1377/hlthaff.2024.00842
1200 doctors is like 2 hospitals
Can anyone give me tips how i can get ammo that is curently loaded in chamber(not in magazine) all i can think of is making some script that writes down ammo from used mag and checks if bolt is cocked on reload
Thats how studies and statistics work, extrapolation of data from a sample size.
ironnically thats how a.i. works
Get the current ammo count of the mag and then get the count - 1 element of the ammo configs array
Oh wow, i will try it in the morning but this is actually so simple, thank you very much
Not sure if there is a function for it already, but if not the above will work depending on your use case
Didnt find one when checked magazinecomponent and muzzlecomponent, will try this one out, i think it will work just fine
After all its much better then what i was thinking to do
Doesn't have to be in either of those components. Could be almost anywhere
hi im new to enfusion and looking to connect my players to my API for persistence how do i access IdentityID for store unique ids for players. When i call it in editor its blank im guessing because it is obsolete now? What is the best way to get/create id for players
string uid = SCR_PlayerIdentityUtils.GetPlayerIdentityId(playerId);
Only work server side tho
this is great its only for server side thank you so much
Yw, good luck
Anybody knows max pixel grid size ?
I know it’s a value betweeen 64 and 1024.
Nevermind I understand now.
It’s not a polygon cap it’s a lifetime issue
web-to-game image transfer, no more images in the mod files, all dynamic
so you send them from server to client to display?
Kinda cool
Likely Inefficient but really neat
this is very low res but works fine
its not inefficient why would it be ? its simple encoding
I meant for bigger image use as the restapi limit is like 2MB
u can chunk stuff
And i didnt mean it as a criticism
I'm aware
i know sorry didnt mean to be rude
I'm learning the scripting side of things and I'm falling flat on my face. I was trying to get a players name (done) then I want to display it in a notification - like where the killfeed is. Can someone point me in the right direction?
How can I increase the duration of action and after what?
WELL i tried and found out i know shit how to properly do this in this game, mb you worked or know some mods that use that method so i can go check how its used to understand it
There are quite a few optimizations that can be done. You can transmit a 512x512 image with optimizations for 20kb. Now the primary issue believe it or not is the canvas widget/draw commands. So the optimizations I’ve done into this area of research focuses on encoding as a series of rectangles, and when you control the encode/decode pipeline you can get rid of a ton of useless data basically. TLDR: the issue is not the size of images, it’s rendering them optimally in game.
Action Manager for normal actions
how do I make my component not function in a preview world?
GetOwner().GetWorld() !== mysystem.GetWorld()
if(GetOwner().GetWorld() == ArmaReforgerScripted.GetWorldEditorWorld())
^ return;
That's not the preview world. That's editor. Preview is in gameplay. Compare the entity world against GetGame().GetWorld() or cast to chimeraworld to check
Ah, I thought of workbench preview world
Hello. Can anyone help?
The command is just kick https://community.bistudio.com/wiki/Arma_Reforger:Server_Management#kick
Also doesn't take player id instead of the identityId?
yeah kick takes playerid cause the player has to be on the server
you can technically do a one second ban to "kick" by identity id
#360noscopeintomordor
Truthnuke
actually I just remembered you can't do a 1 second identity ban xD
because it doen't kick the player
only by name or player id does
xD
I had to make an override of the ban command to have it use the playerId to kick when using identityId
Are you sure it doesn't?
yup
I've never used rcon bans only playermanager bans, and using the PM a ban is a kick with the ban as the dosconnection type
yeah I'll see if i can grab the code its pretty funny when I found out
Would be really silly if that's still the case
So like would the player only be banned when he'd disconnect? Or like after a few minutes?
(Without your modifications)
yeah once they disconnect they wouldn't be able to reconnect
I even tried it on my server as I didn't believe it at first
I hate to be the type of guy to judge but i wonder what was the thought process behind that
Giving a banned player their last meal before they're gone 😭
The handle section:
// Handle Create Result
case SCR_EBanSubcommandArg.EBSA_CREATE:
if (m_iBanPlayerId > 0)
GetGame().GetPlayerManager().KickPlayer(m_iBanPlayerId, PlayerManagerKickReason.BAN);
return ScrServerCmdResult(string.Format("Player '%1' banned!", m_sPlayerName), EServerCmdResultType.OK);
and image is the ban command
m_iBanPlayerId is not set when EPIT_IDENTITY is used, so when you reach the handle the PM kick is not triggered 
That is sillly

Yup so made a new sub ban command that just always get the ID and kicks no matter what EPIT type is used
and use that instead
Is there a different way to get the children of an entity instance? i.e Place generic entity into world, then another one as its child. Because doing the norm fails
IEntity parent = GetGame().GetWorld().FindEntityByName("ParentEntity");
IEntity child = parent.GetChildren();
No and it probably fails because your entities are missing hierarchy components
That'll definitely probably be it..
Edit Yep that was it, Thought I was going crazy... Thx
hi i need some help ive tried everything but i dont find my tm62asset in browse entity i put a screenshot of all my attempt if someone have an idea i take it 🙂
read this https://community.bistudio.com/wiki/Arma_Reforger:Game_Master:_Editable_Entities_Configuration & https://community.bistudio.com/wiki/Arma_Reforger:Asset_Browser_Mod_Integration and learn how to do it from memory with your hands before using claude for it
ai should be used to augment what you already know, its always going to mess something up and you need to be able to spot it by knowing how it should be done
I agree I was trying to limit test it it's usefull for the script but not for enfusion it's so hard to learn I lost myself x) I will take a look on those wiki thank
Avoid using AI slop it doesn't work for reforger
world editor hierarchy is just a nice to have to edit them together. unless they have a hierarchy component on them at runtime they are spawned independently
I'm totally confused 
😢
my mod is SP
but it's interesting point of view
I have a lot of things in my GameMode. But except this - everything works fine
damn, it's almost impossible to debug: I would have to upload mod anytime to find out was it fixed or not
Does it work with peertool?
Plugins > Settings > Peertool clients
nope
so in the workbench everything works just perfectly
~23 minutes mark
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...
but yet again, mod isn't MP. Do I need to concern about replication even if my mod is SP?
But thank you anyway. I will try to call playmusic from clientside
Is there any way to use #ifdef with class names?
how do i check API to see what's possible? like if there a function to see if something is inside a building or actions for AI
for now ai api is not much, you can use tracemove to check whether ai is below soemthing or above something and cast it to check if its on building or not
Just checked. Replication isn't related to this issue. This must be something else
do you use different sound settings in game? for example: i turn music off
omg. sec
Thanks!!! lol what a disgrace! 😱
omg
weve all been there.
Is there a callExtension alternative for Reforger?
No, Reforger does not currently support extensions
What you can do is check if something exists. For one of my mods I check if a resource from another mod exists, if true then I know that mod is loaded.
I also have 2 mods where I set a variable in one, then in the 2nd that uses the first as a dependency, I set that variable to something, and that only happens when that 2nd mod is active. For example, I set a variable called m_bIsModEnabled = false; but when that mod IS enabled, I set it to true.
Not exactly sure what you're trying to do, but I hope this helps!
Only issue is compile time that if you do something like (pseudocode):
if(ResourceName == "SomeModsResource") {
SomeModClass entity = SomeModClass.Cast(ForSomeReason);
}
You will get compile time error.
So best practice I advocate for is for modders with scripts to #define TAG_ModName
And for others to do:
#ifdef TAG_ModName
SomeModClass entity = SomeModClass.Cast(ForSomeReason);
#endif
that's if you check for a classname. Check for a resource name (string)
That only works if you don't need to access any of the modded classes though right?
I think they mean that using the define way is less limiting in what it allows you to do
Yes, because checking if it exists is fine, but you can look no touching
Yeah I suppose that would work only if you're modding vanilla classes.
really depends what youre trying to do
Yeah, depends on what you are trying to do, but if you want a script to pull data from a mod depending on if it is loaded or not, and if that mod doesn't expose such data in a vanilla medium (signals, etc.), then a #define is the way to go, otherwise prefab overrides, signals, and generic things of that nature should suffice.
Hi, I have a script that detects certain arsenal actions. On certain actions, I would like a server-wide message to be sent. Originally I did something like
// --------------------------------------------
// Let Everyone know!
// --------------------------------------------
[RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
void RPL_RequestServerMessage(string message)
{
if (!Replication.IsServer()) return;
Print("[RPL] Message Sent");
PlayerController pc = GetGame().GetPlayerController();
if(!pc)
{
Print("[ERROR] INVALID PLAYER CONTROLLER");
return;
}
SCR_ChatComponent chatComponent = SCR_ChatComponent.Cast(pc.FindComponent(SCR_ChatComponent));
if(!chatComponent)
{
Print("[ERROR] INVALID CHAT COMPONENT");
return;
}
chatComponent.SendMessage(message, 0);
}
Which worked when testing in Workbench w/ PeerTool, but does not seem to be working on a dedicated server. Any thoughts or guidance?
Is this all that gets called and where is it being called from? Might need to Rpc to server first then server->broadcast
All the Arsenal actions I am tracking are wrapped in if(!Replication.IsServer()) return; So, it should all be getting called from the server-side, unless I have a fundamental misunderstanding. The tracking is working because there is also a command that shows tracking values are getting updated and players are able to use that and see it reflect the correct data.
I am still learning how replication works so someone more knowledgeable feel free to correct but I think the idea of Broadcast RplRcver is that the server triggers the broadcast RPC and the Rpl method runs on the proxies
So having the if (!Replication.IsServer()) return at the top means that your notification is never being triggered on clients? I would have thought it would not work with a peertool client if that was the case though
Yeah, I tried removing that and 1) it didn't fix the issue, 2) it may have started causing replication errors on the server. I'll go back to re-reading some of the replication docs, thanks for the input 🙂
try calling this function in place of the call to the broadcast, which this will call the broadcast
[RplRpc(RplChannel.Reliable, RplRcver.Server)]
void RPL_RequestServerMessage_S(string message)
{
Rpc(RPL_RequestServerMessage, message);
}
Is this a "make sure the server knows" kind of thing?
I have a script rn that even though its locked down to run on the server using if(!Replication.IsServer()) return; that updates a variable that is required to be updated by the server, i need to Rpc that call to the server still to properly update it
Interesting
it might just be
How are you testing this code?
Are you running this from the viewport instance?
I test in workbench w/ Peer Tool, and it worked. Then we got it on a community server and the tracking works, but the messaging doesn't
So my thinking is most likely some Rpl/Rpc disconnect in my understanding. Or worse a mod conflict. This mod purely relies on vanilla, but the community server has quite the mod list some of which definitely impact ChatComponent, etc.
When you were using peertool were you using two instances of it?
That early return is definitely a cause of the issue but remember at all time that in the workbench the viewport instance act as both the server and a client, so your !Replication.IsServer() will be false on the viewport instances and from other clients it won't work.
Also remember that only the server can broadcast a message, clients can ask the server to broadcast cast it for them
There is the native spin up of the instance + a secondary peer client. So two playable characters. Are you suggesting adding another? In workbench the message displays on both the in-workbench player and the peer client player
When i test network code in the wb i always run two peertools, and always run the action from one peertool instance to another.
The viewport is misleading
Yeah it is... Ok I will try that too! Thank you
Yes, this is the issue exactly. I need preprocessing to work so that only a certain chunk of code runs if a class exists. I don't currently see a lot of mods using the #define tag unfortunately.
Just create submod that depends on both and patch required scripts
Sorry, but what do you mean?
First of all Im on EXP branch. Im modding a class and overriding a static function, however it refuses to use my modded class and insists on using the original unmodded class with the non-overrided function. Am I doing something wrong or is this a bug? I'm so confused, never seen this happen before.
Can you show exactly what you did?
Its very strange, I'm overriding a couple different mods, some overrides work for some mods, but overrides in another mod don't. Does the order of dependencies in the project settings have an influence on whether an override is used or not? The one that does not seem to work is at the bottom of the list under ArmaReforger.
I'm calling a function that I simply added a print to. The print does not display, but I know the function is getting called as it's doing what it's intended to do in game, but it's not printing the print I added.
I just moved the mod that wasn't using the overrides to the top of the list but it's still not using the overrides and I have no idea why. This is pretty much all I'm trying to do: ```cs
modded class CustomClassBelongingToAMod
{
override static void DoAThing()
{
Print("[DEBUG] DoAThing() Called");
super.DoAThing();
}
}
The Print does not print, but the thing is doing it's thing. (I can see the thing happen in game) I am also set to logLevel spam, so I would think I should be seeing everything! I am seeing all my other prints added to other mods overrides.
Optional dependencies are much cleaner though in terms of being able to load any combination of compatible mods and not have to worry about specific compat mods
Can you show me the classes with the methods from the other mods
Please
Show exactly what you had
Dont modify it. Even the names
It sounds like either a parser bug or a mod that does not call super
Replication authority is not present in a user action, a good rule of thumb is that if you have the words "Rpl" "Replication" in a user action, it is probably written wrong. The correct way to incorporate native user actions is to override "HasLocalEffectOnly" to return false on your user action, and then defer to a component on a replicated entity (which will have a RplNode) that can then talk to the server - or a system. Non server calls are automatically dropped, so logic like (pseudo code):
System Version
MyUserAction : ScriptedUserAction {
override bool HasLocalEffectOnlyScript()
{
return false; //By itself, this is the default and it means that user actions when triggered, trigger on server, client, and broadcasts to other players within the area.
}
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
{
TAG_YourServerSideSystem yourSystem = GetWorld().FindSystem(TAG_YourServerSideSystem);
if (!yourSystem) return; //If the system is serverside only, this is one trick to have logic only trigger on server
yourSystem.BroadcastMessage("Message");
}
}
Component Version
MyUserAction : ScriptedUserAction {
override bool HasLocalEffectOnlyScript()
{
return false; //Action can trigger on server.
}
override bool CanBroadcastScript()
{
return false; //Action will not trigger for other players locally whenever it is triggered, only locally and on server.
}
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
{
TAG_YourComponent yourComponent = pOwnerEntity.FindComponent(yourComponent);
if (!yourComponent) return; //Standard null check
yourComponent.BroadcastMessage("Message");
}
}
//Then the component handles authority like so:
TAG_YourComponent : ScriptComponent {
RplComponent rplComp;
void BroadcastMessage(string message) {
rplComp = GetOwner().FindComponent(RplComponent);
if(rplComp)
{
if(rplComp.Role() == RplRole.Authority)
{
//Broadcast message if we are the authority (server in MP, player in single player, host in listen server)
}
//If not authority, ignore.
}
}
}
sure thing, the mod I'm modding here is a dependency of my mod: ```cs
modded class KSC_ParadropHelper
{
override static void EjectPassengers(array<SCR_ChimeraCharacter> characters)
{
Print("[DEBUG] EjectPassengers() Called");
GetGame().GetCallqueue().CallLater(EjectStep, PASSENGER_EJECT_DELAY_MS, false, characters);
}
}
All of my other overrides modding other mods work just fine, just this particular mod is not letting me mod it for some reason.
mmm, are you able to join a call with me and show me on workbench?
Does anyone know how to add a new category to the building menu? Initially, it has 3 tabs, which are shown in the screenshot. When adding your trait, the tab does not appear, do you need any other actions?
Is EEditableEntityLabel only needed?
Hey all, I'm a newbie to Enfusion. I managed to write a script but have been struggling to test it in a map environment. I'd love it if someone could join VC and help me figure it out. Thanks for your help
IDK how to add a new tab like you need, but traits might not be what you need to modify.
Give me a minute, I'll write to you in the BOS if possible so as not to clog up the channel.
"override static" never works
or maybe
Any proficient Enfusion scripters looking for paid work? I need some scripts added to my server and willing to pay.
Against TOS
Only scammers and vibe c*ders will dm you
Ok, anyone willing to teach me so I can do it myself?
Mario helped me get it working last night. Ended up having to move the static override to the same file where I was calling it, but above where I was calling it as well. Placing the override below where I was calling it prevents it from working. The devs are looking into how to solve that on their end. Hope that makes sense!
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...
There is no scripting covered in this video, already watched it
Then watch the ones about scripting and replication 😭😭😭
hi folks! a quick question regarding performance improvment.
to spawn a big town i'm using chunks spawn script. It spawns a big city entities by chunks (also have to use calllater btw, because my game crashes if I'm trying to spawn all at once)
And after i'm leaving this area - I call EntityHelper.Deleteblablabla
So the question is - does it make any sense? 😆
I was thinking about - maybe long distanced entities aren't being loaded to memory and don't have any effect on performance?
Does anyone know if any events are fired off on the client when a predicted bullet hits a target? I know a particle effect gets spawned but I'm not sure how that ties into the DamageEffects as described on the bistudio wiki (if it does at all).
yea direct file/path override works always, scripting keyword says the call override static need use class identify, its not static anymore
Doing it like this in the same script file will work and print TEST: ```cs
modded class ClassOne
{
override static void DoTheThing()
{
Print("TEST");
super.DoTheThing();
}
}
modded class ClassTwo
{
override void DoAThing()
{
ClassOne.DoTheThing();
}
}
But doing it like this will ignore the override, and will use the non modded class ClassOne: cs
modded class ClassTwo
{
override void DoAThing()
{
ClassOne.DoTheThing();
}
}
modded class ClassOne
{
override static void DoTheThing()
{
Print("TEST");
super.DoTheThing();
}
}
can we please have the script editor lag fixed? the alt-tabbing focus delay/lag is very annoying
I see the issue has been on the backburner since 2025
I'm assuming it's either related to some indexing defect or there's an editor function like spelling, autocomplete, etc, that slows it down and these things execute when the script editor gets focused
Disable auto rebuild scripts in workbench settings
it's off, still same issue https://www.youtube.com/watch?v=NrYfJpw_X9Y
Ah, so you have the lag from having lots of dependencies
It was added when we added modded class introspection on the script editor
Unfortunately bigger problems are being solved right now so that is waiting
For now, just load the specific mods you need. If not possible then you have to deal with it for now
There is no workaround to the issue
Maybe when we release the visual studio code plugin
here's a vid without the cyan and easier on eyes mouse preview
https://www.youtube.com/watch?v=Wh2VmYb6CSU
Please fix it soon, a lot of community servers make missions and need to script where many addons need to be loaded in order to make the mission 😭
I know a lot of developers in my community Global Conflicts are suffering from this defect
Yeah the script editor window lag is horrrrendous
Click away, click back a second later, takes 15 seconds to respond
It’s so bad that I just edit the script in notepad+ and restart the editor(takes less time)
Really became noticeable with 1.6
And seems to have gotten worse
Almost feels like it’s doing some kind of auto parse when focusing the window
Even with auto rebuild off
Always load minimal mods what need, i don't think you need more than 1-2mods for scripting
I’ve even run into this same situation over and over where if I have a compile error and then fix it, recompile. It will print the same exact error again unless I restart the entire editor
So now I just edit with notepad and open the tools when I’m done
Are you loading every mod that runs on your server? Or just the ones you need for the mod? I tried every mod I run on my servers once and that was the only time I had those lag issues, but that's to be expected with so much loaded. I think the most Ive ever had was like 6 dependencies. 2 of which I really needed, but they each had their own dependencies, bringing it up to 6 total.
He is loading a lot of them, look at the scrollbar too 😅
So yes, he is subject of that issue
WOW! There's two map mods just in the A's! That really shouldn't be necessary! No wonder they're lagging!
you do if you're making a mission for a server which uses different addons for maps, loadouts/gear, vehicles, etc
so if i want to add a script for telling AI to mount up in a vehicle, since scenario framework doesn't let me mount QRF AI into vehicles, then it lags the script editor
Since I need to make a mission with all the mods loaded
vid of QRF not mounting up https://www.youtube.com/watch?v=d8qPhcLRq0E
2026 05 01 19 12 15
For anyone wondering, I was looking to see if I could hijack predicted damage on the client to do an RPC on the server to effectively hack in client-side hit registration. Unfortunately from my breakpointing, it seems like there is likely code in the engine guarding the client from calling any damage functions during their prediction, and all the damage calc I was able to hit was only in rpl::Pip::ProcessNetToGame. It would be really nice in my opinion if we were given the option to get access to the client simulation state here given the sometimes extremely poor state of hitreg. I'm new to reforger modding but do professional game dev for work, so apologies if I'm misunderstanding some of the logic flow.
I did do some digging in the debug UI but all the hitreg/damage logging functions seemed to not output anything to any of the log files, so not sure if those are stubbed or I'm just looking in the wrong place.
You don't need any dependencies loaded to mount QRF AI into vehicles. I wrote a script that does that and it takes about 70 lines only using vanilla functions. I'm doing a lot more than just that in those 70 lines as well.
The point is I'm working on a mission that depends on a lot of addons and to write scripts onto the entities in that mission I need to use the script editor with a lot of mods
You gotta break it down into smaller parts. Like if you have this AI QRF feature, make a mod that does just that. You don't need a map loaded, it has no script to help with that feature. You won't have this lagging problem either.
The AI QRF thing is from scenario framework, in the base game, to help with AI management in the mission
yeah exactly, it does not require any dependency mods, yet you're loading like 50 mods causing all that lag.
Yea i load full pack only 1x when i check where need modify or extend something, then load only that and i test it on MP test terrain for fast loading. Not accetable loss for me wait more than 20s of reload / compile.
When i learned Enfusion scripting 30min scripting taked 30min testing time. Maybe wasted 30% of my 4587h WB time 😄
I wonder if the vibe coding epidemic is also present on arma 3's modding side
Or if they were spared from the plague
Who is smart in the ways of scripting and doesn't mind helping me out? I need something short and sweet. I have like 100+ wearable variants that I want units to be able to have randomly chosen for them. But I don't want to make 300+ variants of a unit just to do that
What about making 299 variants
sounds even worse 😭
298
Id raw the line over 15
makin progress
A script would be preferable however. That way I don't spend the rest of my mid twenties making a bunch of permutations of uniforms
Don't have issue with 24 whenever I load our all in one dev 😅
Hi! Could you tell me how to add a cooldown to a vehicle? How do I set the time? Thanks in advance!
I don't think what you are trying to do is possible without modifying scripts. Afaik cooldowns are only tied to ranks and not to vehicle types. The cooldowns per rank are specified in the provider's SCR_CampaignBuildingProviderComponent.
If you don't want to modify scripts, you could make separate providers for group of vehicles you want to have different cooldowns.
is obfuscation and GetGame().RequestClose() if not using a key hash for your mod allowed? I didn't think it was
It isn't
But atp i'm kinda disappointed that i didn't obfuscate some of my mods ngl 
thought so, a mod we've been using has recently decided to do this so unless you have the key it will shut the game down and you also can't read the script as it uses some block comment obfuscation 🙃 rather than just have a license stating "don't use without perm"
Very kind of them
AFAIK that is not allowed. You can only make it so the game operates as normal if you don't have the key, you're not allowed to shut the game down like that. I don't think they are very fond of obfuscation either as most of the time it's because someone is trying to hide stolen code.
yea I know what you're trying to do, I don't think scripting handles that but rather a config somewhere. I'd ask in #reforger_workbench and show them the same screenshot
I've already figured it out, including thanks to TandemHEAT, I'm still learning the tools.
As it turned out, it was necessary to override eeditableentyticore and make your own tags, and then work with them through the config
glad you got it figured out!
Hi, I wasn't sure where to ask this but I believe scripting may be a good starting point. I was making a radio with preset channels and wanted to be able to name them based on their frequency. Similar to how the Game Master editor radios have faction labels (US, USSR, FIA) or Faction-based Group names.
I have a lede with the SCR_VONMenu and SCR_VONEntry but am unsure of what I am actually doing lol.
update, i have found vonentrycomponent and vonentryradio and that seems to be more applicable to what I am trying to do, still lost
a more clear example of what I am looking for, the functionality of how 48MHz says "Platoon Channel" is exactly what I would like but with different selected frequencies
the only thing I can see that is related to what I am talking about is the "Faction Radio Frequency" which is not what I am looking for
Wild behavior 😂
I think i found what you were talking about, or at least i assume so, with the predefined groups? it isn't what i had been wanting to do with the radio though, but it may be a temporary solution that does achieve the same goal, testing it at this moment
Yes group presets are there but u can also select the platoon freq and the encryption key (which lets u talk to other factions via radio) and i believe radio range and other things for that faction
but that is only the one platoon channel for that faction, i am wanting to be able to name multiple channels/frequencies and not just the one
Ok got u, can u see if there is an add option anywhere? Maybe where u pick platoon channel?
i have scoured(?) what i was able to see and couldn't find anything except some scripts that may allow me to do what i am wanting to do but am just unfamiliar with scripting currently
Yeah honestly the way I set groups and radio freqs is via script
But I’m positive there is a easier way maybe in the vanilla config files
i mean i don't think the script should be super complex, just giving a title/channel name if frequency is equal to whatever integer
but i have been looking though literally everything lol
Yeah u need to look at how to properly set it up. Check the vanilla script files and you’ll find clues for sure
my predefined groups don't seem to work and i have no idea why
Is this where you can see them but not join them?
I have also had issues with the predefined groups I couldn't work out
i cannot even see the groups i have predefined in the faction's group selection in-game
Did you maybe set them in the group role presets instead of the predefined groups
no, but am i supposed to make the predefined groups in the factionmanager_editor? i don't know what it does verus the faction_us.conf
Whichever one you have in your scenario
it's just a normal game master scenario
Are you overriding the _Editor faction manager
i am now
okay i figured it out, it was the factionmanger i needed to do it in
no idea what the US.conf file does/is for in the faction folder but /shrug, this is only a temporary thing lol
I think it is the way the prefab is set up
If you used the .conf in your own prefab it looks like this but since we can only access the locked version of the base game prefabs it just looks like normal properties
now i get to find out how to change the callsign for those predefined groups lol
Anyone know the difference between SCR_AICharacterSetting and SCR_AIGroupSetting? I am trying to set custom settings on waypoints via script
When I use SCR_AICharacterStanceSetting.Create(SCR_EAISettingOrigin.WAYPOINT, SCR_EAIBehaviorCause.ALWAYS, ECharacterStance.CROUCH)) even with the cause set to ALWAYS it seems to have no effect
If I instead use SCR_AIGroupCharactersMovementSpeedSetting.Create(SCR_EAISettingOrigin.WAYPOINT, EMovementType.WALK)) it works fine
Something to do with SCR_EAIBehaviorCause maybe?
// WP creation code
vector wpPos = TTS_AISpawnHelper.GetRandomSpawnPositionInRadius(50, 200, spawnPosition);
array<ref SCR_AISettingBase> settings = {SCR_AISettingBase.Cast(SCR_AIGroupCharactersMovementSpeedSetting.Create(SCR_EAISettingOrigin.WAYPOINT, EMovementType.WALK))};
SCR_AIWaypoint wp = TTS_AIWaypointHelper.CreateMoveWaypoint(wpPos, settings);
group.AddWaypoint(AIWaypoint.Cast(wp));
// TTS_AIWaypointHelper.c
static SCR_AIWaypoint CreateMoveWaypoint(vector position, array<ref SCR_AISettingBase> settings = null)
{
ResourceName waypointResourceName = GetWaypointPrefab(TTS_EAIWaypointHelperWaypointType.MOVE);
return CreateWaypoint(waypointResourceName, position, settings);
}
static SCR_AIWaypoint CreateWaypoint(ResourceName waypointResourceName, vector position, array<ref SCR_AISettingBase> settings = null)
{
Resource waypointResource = Resource.Load(waypointResourceName);
if (!waypointResource.IsValid())
{
PrintFormat("TTS_AIWaypointHelper.CreateWaypoint: Failed to create waypoint, waypoint resource is invalid! (%1)", waypointResourceName, level: LogLevel.ERROR);
return null;
}
EntitySpawnParams waypointSpawnParams = new EntitySpawnParams();
waypointSpawnParams.TransformMode = ETransformMode.WORLD;
waypointSpawnParams.Transform[3] = position;
SCR_AIWaypoint waypoint = SCR_AIWaypoint.Cast(GetGame().SpawnEntityPrefab(waypointResource, GetGame().GetWorld(), waypointSpawnParams));
if (!waypoint)
{
PrintFormat("TTS_AIWaypointHelper.CreateWaypoint: Failed to spawn waypoint prefab! (%1)", waypointResourceName, level: LogLevel.ERROR);
return null;
}
if (settings)
{
foreach (SCR_AISettingBase setting : settings)
{
waypoint.AddSetting(setting);
}
}
return waypoint;
}
Hey, who is allowed to spawn RocketProjectiles?? Even when im spawning the prefab on Master/Auth i got warnings, that this is not allowed, because its Replicated?
I suggest use BI's SCR_AirstrikePrototype, put it prefab add Rpl component and works like dream.... ofc they used 100m rocket start altitude in private variable but easy to fix it.
Rocket prefabs needs rpl comp. RPG rockets works fine, some helicopter rockets maybe make error (but not all).
Whats different between heloRocket and RPG Rocket?
Don't know, i just searched rocket entites by name like: Ammo_Rocket_..... .et and not all worked.
Ammo_Rocket_Hydra70_HE_M229.et works fine
script will give vme if no RPL comp on rocket
I have a replication question:
When RplSave called if Entity or my GameMode's RplComponent setting on Streamable disabled?
i not seen manual call for RplSave.
I use RplProp() and BumpMe() now. Keep it and need forget RplSave?
RplProp does not remove the need of rplsave and load
It depends on what you are doing
i just want 6 RplProp() vars put in to RplSave, because its only once refreshed at game start.
Its ok, I only want to update people living in the same bubble as me anyway
i see 70 RplProp in whole AR scripts, i have mod with 32 RplProp, maybe mot need keep update all on every BumpMe().
Is there a way to get the value of a client sided variable without Rpc calls ?
Like for example let's say I have a script that set a string variable for the current context the player is in and from the server i want to fetch it. How would i go about doing that without rpc calls if possible ?
RPC is the only way for you
Don't do RplProp then
If it's not mutable then only do RplSave and RplLoad
If you disable streaming then you will make it worse
Because your entities will be replicated and active on all clients all the time
I plant use this way, main question is RPL save when runs? If variable in Gamemode and RPLcomponent streaming disabled how rplsave called?
Multiplayer scripting page says in example:
"// Called on the authority when an entity gets streamed"
I calculated 6 random variables by server in OnGameStart() event. is it runs after "gets streamed"? Or there is a point what is runs before streaming but world is ready?
OnGameStart() random variables different on client and server, this is what i need sync, but maybe not in RPLProp.
i'm going reread RplDocs.c file :]
Trying to figure out how to get garage2 by kodii working, or something similar. I think it relies on components like
AH_Currency component, JOB_jobcomponent, JOB_impound manager, and a few other components. Does anyone have any experience with this? My guess is it needs kodiis RP to actually function
These are its dependencies
Yeah so to reiterate with my question, even with those dependencies I am still having errors within workbench missing those specific components
Not sure what I was doing wrong yesterday but had no issues with this today, must have been user error lmao
But if anyone was curious about this like me you can still use bothSCR_AICharacterSetting and SCR_AIGroupSetting in the group/waypoint settings, but when it is a CharacterSetting the group will automatically apply the setting to each group members SCR_AICharacterSettingsComponent instead of the group's SCR_AIGroupSettingsComponent
Hi all,
I am implementing my own PvP GameMode, and I would like to access to the groups I placed in the subscene.
It looks like SCR_AIGroup.RplLoad registers the group into groupsManagerComponent with SCR_GroupsManagerComponent.RegisterGroup at runtime.
But I fail to find the groups when mission starts, can you tell me when the RplLoad is executed?
RPLLoad is executed on clients who recieve the changes from the server, so when the group is created on the server or when you join the game later on
Okay, I am trying to load groups into my SCR_BaseGameModeComponent.OnWorldPostProcess(), it is too early (testing into the workbench)?
The groups manager is primarily intended for player groups and not AI placed on the map. But yes, it is too early. If at all, attempt to find them during gamemode start
I just want to place on map for players only, detect all the slots them and create a lobby. Thanks for your help 🙂
post the error messages you're getting.
I just made my own garage mod no more issues lol
Custom titles for class attributes aren't possible at all, right?
Hate that you can't see the value for UIWidgets.Flags attribute unless you unfold it
What I mean, displaying selected flags when attribute is folded (using random enum for test her)
Feature request worthy, but it'll get on the back burner like my request for the search bar to work on arrays in .config files
Is this the best way to manage arrays of two different types? The data should persist for both but only one changes size.
class MyArrays {
vector <string> dynamic_names;
ref array <string> static_names;
};
ref array<string> is dimamic, you can use static arrays too if not need increase size
string str[4]; it is static
ref array<string> is dyanmic but array <string2> is not dynamic? I thought vector <string> was dynamic
vector is dinamic array in C++
is ref just a special enfusion script feature?
ive seen all that, but this makes more sense with what Im doing: https://community.bistudio.com/wiki/Arma_Reforger:Scripting:_Automatic_Reference_Counting
ref is keep things alive
oh i see what you mean, enf vector is junk for my use case lmao
Vector means three floats. Not the bullshit c++ is doing
The length isn't the really BS though, as proper mathematical vectors can have any length, but they don't support mathematical vector operations, so that is that 😅
There are some followers of Bjarne Stroustrup 🙂
How did C# come about? they only renamed struct to public class 😛
Stupid question to ask so late into scripting but :
does a double == comparison already take into consideration a certain epsilon or not?
Im a amauteur in enfusion, I am currently having issues spawning enemies on structures in the ocean. Does anyone have a method to spawn enemies in a exact position? Because the ambient spawners will ignore collision and spawn enemies at the bottom of the ocean.
You should be able to snap it to the structure, or you can script their XYZ spawn to be just on top of the structure. They show this in their YT modding bootcamp vids
character prefab by default will be snapped to terrain which is not what you want. you'll need to go in the prefab and disable that first.
Only then can you spawn them in funky position
Nope, we don't have doubles. Only floats. float.AlmostEqual is your friend
meant to say float* just finished some java bullshit i have double in mind sorry
Thank you
Thanks aand thanks @red cedar I will try both these methods really appreciate it
I noticed that equipping an item such as binos make them reset the flag invisible. any easy workaround to that ?
found a workaround
🧦
So I've only done this using the "Relative Y" flag on the entity of the ambient spawn points on the prefab in the world. But maybe you can do it via script using the enum for that: EntityFlags.RELATIVE_Y and IEntity.GetFlags() & SetFlags() Hope that helps!
is there a way to check if an entity is already invisible ?
i hide the entity using :
entity.ClearFlags(EntityFlags.VISIBLE, false);
I would search SCR_Enum.HasFlag
amazing love you
anyone know a good approach to create a anti combat log script? i.e so the character stays on the server for a period of time after the user disconnects
its possible to control reforger server fps through script?
(-maxFPS commandline?)
I think you can simply do it in the workbench's settings
i want -maxfps 15 during start,
and after specific trigger
remove -maxfps 15(enjoy -maxfps 60)
-maxFPS sets max FPS limit - useful for a server, or to force a client's max FPS.
yea,
but i need it by using scripts set server maximum fps value, then change it back
-maxFPS i don't find how to implement it in script
Did anyone here get GetWaterSurfaceY() or TryGetWaterSurface() to work with rivers or lakes?
I am trying to test if an object in the workbench is in a body of water or not. It works with the ocean, but lakes or rivers do not work.
Yes, I got the latter working for lakes. The key is to provide a proper altitude to the position you pass.
For reference: https://github.com/Kexanone/ArmaReforgerMods/blob/9525e6908c520e0b79e85e83b0204e3ab4b2d126/addons/KexScenarioCore/scripts/Game/KSC/Helpers/KSC_TerrainHelper.c#L6
Did you ever try this in the workbench or do you mainly use it ingame? Because I do the same thing as you (the only difference is that I get the world from the WorkbenchTool) and it does not work. My current guess is, that river/lakes only detect correct ingame but not in the workbench 🤔
It's been a while, but when I did work on this method, I tested it in the workbench. Maybe something has changed.
I think I tested Heifer pond on Arland.
Just tested it again and my method still works there in workbench.
Weird. Do you call it over a plugin or tool?
Oh wait, I get your point. You're trying to do it in the world editor, not in the play mode 😅
Yep ^^
Found another way. You can do a Trace with params.TargetLayers = EPhysicsLayerDefs.Water; from the ground up and just check if you hit anything. From my brief testing, this seems to do the trick.
But thanks for your help. Your GitHub also saved me some time for the road detection. ^^
Anyone know of a way to grab the magazine prefab you are currently loading?
In a codec how do we go about encoding a map ?
for example :
ref map<int, int> m_playerBalance; (example)
First count of items then key value n times. There is no util to do this for you
ok so i tried to make a basic codec which contains this map for example :
ref map<ECharacterHitZoneGroup, int> m_bodypartsHit;
static void Encode(SSnapSerializerBase snapshot, ScriptCtx ctx, ScriptBitSerializer packet)
{
// irrelevant stuff
snapshot.EncodeString(packet);
snapshot.EncodeString(packet);
snapshot.EncodeInt(packet);
snapshot.EncodeInt(packet);
snapshot.EncodeInt(packet);
// MAP encoding
snapshot.EncodeInt(packet); // m_bodypartsHit.Count() ??
// Can't access non-static member
foreach(ECharacterHitZoneGroup key, int value : m_bodypartsHit)
{
}
}
But since the method is static i find it very confusing to know for example how many times i need to encode it.
in this particular case i know there is at most 7 key, val pairs.
But still it is a confusing for me to understand how to encode those as i can't access the member
Has anyone tested building playable areas under the map? I want to make a large underground complex under arland for my custom server scenario and am wondering if I may encounter issues doing this
wrong channel
As expected i failed LOL :
Server-side :
SCRIPT : -----[KittenEye] Broadcasting stuff
SCRIPT : -----[KittenEye] Stats for HideoutKitty (0)
SCRIPT : -----[KittenEye] Head : 6
SCRIPT : -----[KittenEye] Lower torso : 7
Client-side :
00:02:14.334 SCRIPT : -----[KittenEye] Stats for HideoutKitty (0)
00:02:14.334 SCRIPT : -----[KittenEye] Head : 0
00:02:14.334 SCRIPT : -----[KittenEye] Lower torso : 0
i'll crash out
there is bug sometimes when you cannot reload weapon, and you can't drop this gun, basically whole weapon slot is bugged.
Is there any method how to fix it?
Animation State?
I am trying to debug some code. Using the remote console, it will only let me print variables from my own classes but not any of the base game classes.
Also, I am trying to enable custom loadouts on command trucks. All I do is remove a check for custom loadouts in SCR_CampaignSupplyRestrictedSpawnPoint.CanReserveFor_S(...).
But it still won't let me spawn with a custom loadout.
Can anyone offer some help either of these two issues?
You can look at TDL code which seems to work in most cases in terms of codec, though I am doing manual byte measurements due to mario saying something about base game helpers being a bit unreliable.
If there is logic in encode/decode (other than encoding/decoding values) generally something is wrong though
I'd just recommend doing arrays and constructing maps with the decoded array
You can place a breakpoint on the base game code, then hover over the class variables or method variables to see what they had up to that point
Or you can go into the watch tab while the breakpoint is hit and in debug mode
then you can see the entire instance data accessible to scripts
You can also mod the class and add your print if the class is moddable
Also. As apparently not everyone knows this of the script debugger, breakpoints and the remote console.
If you hit a breakpoint, on any class. After the process freezes with a breakpoint hit, given that the script vm is single threaded, it will safely internally have a cached variable for this that is used for many things, one of those is the remote console. So when you are on a breakpoint, this will be then the same instance where you have your breakpoint on. Meaning that you can use it in the remote console to call other methods from the class, or call and print variables from it, or change it's data. Or pass it somewhere else. Test results of methods on the remote console, etc.
Example:
You can use it to modify behavior of method in a sense, before doing any modding of it
Or changing the state before method processes after certain point at runtime
You can call/use anything from the method, local vars and also private/protected members (Method and varibles) of the class. And anything outside
I just noticed this a little bit ago. thanks.
So I am walking back up the callstack. Does the this variable update its context? (im about to this myself)
If you mean by clicking on these?
THen no
It has to be in the specific context the breakpoint is on
Sorry not the breakpoint
but the state of the debug
It will change based on where these lead you to
You can also technically change what this points to. But beware that it is locked to the current variable type it originally had, meaning it will accept only original class type or inherited
this = someOtherInstance;
Is there a particular reason why QueryEntitiesByOBB is not correctly using the angles of a transform on a modded map? It works as aspected on a normal map like Arland but doing the same thing on a modded map and it just completely ignores the angles info..
Your map might not be centered at "0 0 0"
that'll really do it in? Yikes.
And it might not have on itself identity matrix for the basis vectors
Well. that is the origin point for everything
people often avoid in games to have transform on world
As you can avoid an extra transform for everything else 3d math related when you need to account for world
It simplifies the math, and unfortunately most people also never take into account that world itself might have a transform
So even then it's safer somehow to not have it 
So am I just screwed with this approach?
I am not sure if this is exactly the issue, but it's very common problem.
You could update the entities you have positions if not dynamic on the grid by offsetting it by the world transform
A question I dont expect an answer to: Why did bohemia hard code No Custom Loadouts in conflict rather than giving us a game mode setting/toggle?
I found my issue
Thanks for pointing out the watch context!
It really helped!
Most likely no one thought about it
Modding on Arma 4 is thought of from Design to the end of the dev process with modding in mind. So ideally this should be better on features later on. But we have architecture there that makes such changes easy later on
In general you can't think of everything for modding, but you can accomodate for it
Of course. It was probably a patch for a balance change in the vanilla conflict. And its easy (when you know where to look) to change it for modded.
I aint really comlpaining. I just got over a frustrating and now satisfying debug session 🙃 😁
Many of the mistakes for modding on AR are know, same for older games. And are being taken into account on the current engine and the future of our games
It might seem that AR in some places is a rocky road for modding, but it's the experience and experiment before you can better it
It's actually invaluable for us to get feedback on the problems faced
Always mention the struggles and things that seem bad modding wise
Try/Catch?
Otherwise we might never figure out
I R&D this
Figured out that does not exist today 🙂
Oh really?
Yeah 😅
I also wanted it at some point, then found out how big of risk it is later on
Performance wise or... software infrastructure wise?
stability wise lol
It's better to cause the crash or vme
than to try to band aid it, or handle it somehow when it comes to modders
The main issue is the non technical modders
And the extra problem we have with it, is that you can modify functions
rather than normal inheritance or partial classes
Which is what caused the msot trouble
modded / override methods caused trouble?
Yes because you can bypass the original try/catch process
try catch end up being hardcoded in a sense forcing to what we call "hard method override"
Also you can hide away problems
Which we know modders will try their best, we prefer the game to crash on these things so that we can find issues
It sounds backwards but it's the safest to mantain long term stability
Broken mod should stay broken and unused if abandaoned
Have you seen the ressurect crash guard mod?
It has a bunch of null catches for common null pointer crashes
The only thing we are toying with is for catching nulls
that we might provide
But no general one for any VME
Yeah, these seem like good mods for people
But they are regression on stability
It hides the problems
But the problem is that players wanna play, even if bugged
so people make these
Does crash report automatically upload to let yall know about the null crashes? Or do you need people to send them in?
Another problem is that many features did not account for modded additions, and when modders add or remove things they land with null pointers
So it is important that we get these reported
On vanilla the null pointer might never arrive, but it will on modded
Crashes and VMEs are your friends, not enemies
They are that harsh friend that tells you the truth 😅
(not snarky) Try telling that to my fellow server admins and regular players 😁
They panic over every crash
Only big problem are the big crashes that do not produce logs
As I said, players want to play no matter what 😅. I was a modder for long time on DayZ before joining bohemia, I know that pain
Looking through logs just to find Unknown exception 
By the way, if you want to save yourself on null checks for a method that you provide something on. You can make the method return type have notnull on it
notnull SomeType GetSomeType()
{
return something;
}
oh sh didnt know you could use that keyword in front of methods. Thought it was just for the args
That means CPP based
Will that protect it from a crash? or just expedite the crash?
bet i'll keep that in mind
or mention it to @brazen sphinx
What is CPP?
C++
He is a programmer dedicated for Arma Reforger modding problems
I can help from time to time too but unfortunaly I am often busy with company related stuff
Normally if the question is thrown there's someone to respond either way. Which most if not all of what you say is invaluable since it actually gives insight to how the engine works.
I thought so. So how can I debug through unknown exception crashes with CPP?
read the above messages, mario mentions that
beyond htat though, i get the time the crash happened and look through the other logs to see if something was happening during that time. 80% of the time the issue can be solved through the other logs
I am one of the biggest complainers in the company, dont worry 
a squeaky wheel gets the grease
But it's feedback, not a complaint
and even then if complaint, it's usually rooted on a problem
and we want to hear about that problem
i just go to the feedback thing and post everything i come across
Is there a way me and my friend can both publish updates to the same mod?
Add him as contributor
can someone point me how this selecting window work?
I was wondering if its possible to transfer this to something else like Changing entity faction and having list selection from factions from factionManager in world?
VMEs and null pointers dont crash the game so calling a null pointer fix "crash guard" is dishonest
I'll take a look, thanks a lot.
Also TDL refers to tactical datalink ? Right
still couldnt figure it out so i'll do it a stinky way
(derogatory)
ok so turns out....
The reason it was not working was because... i was trying to RPC to early on and the clients weren't ready to receive rpc stuff
well deserved
RIPT : -----[KittenEye] Stats for HideoutKitty
SCRIPT : -----[KittenEye] Head : 6
SCRIPT : -----[KittenEye] Lower torso : 7
SCRIPT : -----[KittenEye] Echo
SCRIPT : -----[KittenEye] Stats for HideoutKitty
SCRIPT : -----[KittenEye] Head : 6
SCRIPT : -----[KittenEye] Lower torso : 7
Finally thanks a lot @fringe prairie and Arkensor
Agree on the VMEs, but null pointers could technically crash the game if passed to some proto function that doesn't handle it properly 😅
hey kex, would you mind if i use your shots fired code? (the detection part of it)
Are you talking about the OnProjectileShot event handler? 😅
the RegisterPlayerCharacter method yes
Yeah sure, go for it.
That system has been scrapped anyway, so that way it was at least not for nothing 😅
lol
Also would you know what would be the most elegant way to get Server sided data that i cannot use as an RplProp to a client sided menu ui ?
is it possible to find the menu's instance or should i implement a quick singleton for the "callback" ?
If you don't want to use RplProp, then use RPCs instead. Client sends request (either it owns the object or via its player controller) and server sends back data to update UI.
If you need regular updates while the UI is active, you could also just implement a single request for starting updates until you request termination. We do this for the GM context menu tooltip for medical, for instance.
i'll give it a shot, i don't need it to update just load and display the data when the Menu opens basically
ty
What the fuck ?
I'm getting a VME with this saying there's a Null pointer at the bottom function, how can I fix it?
// Class with a static array
class LFD_Arrays
{
private ref const array <string> LFD_files =
{
"{1D09F6DDE5595017}PrefabsEditable/Auto/Props/Military/Compositions/US/E_FuelService_US.et",
"{5B61FA25DD8DFA54}PrefabsEditable/Auto/Props/Military/Compositions/US/E_FuelService_US_Large.et",
};
bool get_prefab(string iprefab)
{
if (LFD_files.Contains(iprefab))
return true;
//Else
return false;
}
}
// Logic start
modded class SCR_FuelNode : BaseFuelNode
{
LFD_Arrays Arraycheck;
override void OnInit(IEntity owner)
{
super.OnInit(owner);
string prefab = owner.GetPrefabData().GetPrefabName();
bool bmyprefab = Arraycheck.get_prefab(prefab); // VME here: Function OnInit, Null pointer to instance
if (!bmyprefab)
return;
}
}
Does scripting have server side, client side, and shared?
Arraycheck is never initialized
slap a
Arraycheck = new LFD_Arrays();
at the beginning of your OnInit
or
you should be able to get away with making your class statics
Server, Clients, Proxies etc
how do you know if the script is running server, client, proxie?
well when you're writing down your script you should just know.
However you can prevent the script from running on the client side for exemple by writing something like :
override void OnPlayerSpawnFinalize_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, SCR_SpawnData data, IEntity entity)
{
super.OnPlayerSpawnFinalize_S(requestComponent, handlerComponent, data, entity);
if(!Replication.IsServer())
{
return;
}
[...]
that was it, thx. whats the different between that and LFD_Arrays Arraycheck; ?
LFD_Arrays Arraycheck; just means "hey i plan to use a global variable of the type LFD_Arrays named ArrayCheck"
But you haven't instanciated the class, writing Arraycheck = new LFD_Arrays(); assign the variable to a new instance of the type LFD_Arrays
Does waypoint creation, entity creation, or Resource.Load cause the most lag?
Entity spawning causes the most lag
is there a way to ease it?
Especially AI or vehicles
Limit the number of vehicles spawning or reduce the amount of activated components, both come at a cost
As for players logging in, nothing you can do about it without sacrificing some number of slots
anyone know why this sometimes doesn't work when a vehicle of crew get spawned? crewOccupants becoming empty.
// Collect current crew in vehicle
array<IEntity> crewOccupants = {};
compartmentManager.GetOccupantsOfType(crewOccupants, ECompartmentType.PILOT);
compartmentManager.GetOccupantsOfType(crewOccupants, ECompartmentType.TURRET);
// Keep only entities from THIS spawn batch
for (int i = crewOccupants.Count() - 1; i >= 0; i--)
{
if (!occupants.Contains(crewOccupants[i]))
crewOccupants.RemoveOrdered(i);
}
if (crewOccupants.IsEmpty())
{
Print("No crew occupants found to split from vehicle group for QRF Dispacher", LogLevel.ERROR);
return null;
}
I think change array<IEntity> crewOccupants = {}; to ref array<IEntity> crewOccupants = {};
On an actual map with lots of mods crewOccupants is empty, but not on 1 mod + mptest basic (it's not empty then which is what I want)
also wouldn't it be array<ref IEntity> instead?
perhaps, I just know ref stops arrays from clearing
id try it on GM or HQC Arland in WB, I always have issues getting things i need from the MPtest maps
