#enfusion_scripting
1 messages · Page 8 of 1
Is this some kind of setup? Or the command in the script ?
Backend service on another machine
I'm need transfer data > 1mb, and yeah i can divide data, but I'm wondering how I can bypass the default buffer and network limits
(For example, use an additional application/agent that will read and write to a file, so that the Arma Reforger sends data through a file, and reads another to receive data)
I mean i have arma reforger server (which write data to file.in), and agent(addable app (in python for example)) send data about network, and second - file.out which use for receive data
Mb named pipe or some of that...
The method name.
Use serialisation base context and not JSON API. Then you are not limited beyond what script strings can store
Though if you want to use http API there are still some limits which we need to remove in a future update
Are you going to remove the restrictions? And also, can you please suggest the name of the class or file so that I can look at the serialization context?
Are u mean that?
Yes
Thank u very much ) I'll dig into the code tomorrow
New to scripting... how do I tag specific assets in a script?
Does anyone have any idea how I can block players from accessing the box here?
I've been trying a few ways, one of the ones I managed to do is remove the Universalinventory component, it really disappears from the TAB player but it also doesn't allow me to open the box.
If anyone has any idea how to do it
I assume it's one of the VIP_UniversalInventoryStorageComponent.
Not sure why the prefab has 3 inventory storage components.
I'm actually not using it anymore
When I do this I can't use the box but it goes out of view when the player presses TAB
Now I need to make the box work
Why are you using this component?
It's a base component which should usually not be used directly
If I remove this component from the arsenal box there is an action script > open box and it doesn't work
Just use one SCR_UniversalInventoryStorageComponent
Is the bug that you have to restart workbench to clear some console errors known? Even if you fix the script and reload scripts it wont clear the console error half the time even if it is fixed until you restart workbench. Sent me on many a wild goose black rabbit hole chase until I figured it out a few hours ago.
Not sure if its new in the last patch or 2 or not.
Verified it 20x today though since I figured it out.
no problem, however I can hide it when the player presses tab
Why do you even want a storage component that's not accessible by the player?
players are using TAB to access , and it is blocked by a script when trying via "F" action
Basically some players are allowed to access via action "F", those who shouldn't have permission can enter via TAB
I definitely need to hide this arsenal presentation in the inventory TAB
Restricting the interaction is the wrong approach, you would want to inherently restrict storage access.
Read the SCR_UniversalInventoryStorageComponent class and its parent classes, they'll likely have some inventory rights related method.
Everon Life mod has EL_RestrictedInventoryItemComponent
I use it for a hidden cash slot that players cash goes into
oh
I will look at this mod to understand
I managed to make a script here UHULL, thanks guys
guys what is the function to return all capture point militarybases of a faction?
Hey everyone,
I'm developing a radio jamming system and need some help with compilation issues.
System Goal & Approach:
The aim is to inject jamming audio into radio transmissions via the VoN (Voice over Network) system, effectively jamming frequencies for nearby players.
We're using:
RadioJammingComponent.c: Manages the jamming state, frequency, and range, orchestrating the overall process.
SCR_JammingVoNComponent.c: Inherits from SCR_VoNComponent. This component handles the actual audio injection. It creates a dummy BaseRadioMessage and uses the entity's BaseTransceiver to "transmit" it on the specified jamming frequency. On "successful transmission," it plays a designated jamming audio file.
We believe this approach should work because by using BaseTransceiver to perform a "transmission," we leverage the game's existing radio propagation and reception mechanics. This should allow nearby radios on the same frequency to "receive" our jamming signal and play the associated audio.
Current Problem: SCR_VehicleRadioJammerInteractionComponent.c See Errors.txt
I'm facing multiple compilation errors in SCR_VehicleRadioJammerInteractionComponent.c, which is a ScriptedUserAction to toggle the jammer from a vehicle. The errors are primarily "Broken expression (missing ';'?) " and "Expected ',' or '}', not a ';')".
To help debug, please see the attached text file Errors.txt for the full list of compilation errors and the content of the SCR_VehicleRadioJammerInteractionComponent.c file itself as well as the other two scripts.
Any insights or suggestions for fixing these syntax errors, or improving the ScriptedUserAction implementation, or perhaps a better method to achive my goal would be greatly appreciated!
in MilitaryBaseSystem: c int GetBases(notnull out array<SCR_MilitaryBaseComponent> bases)
thank you. Then I can check the faction and iscapturepoint based on the list.
yep i do similar stuff with a good ol foreach!
How would I search for nearby rocks and trees, FindEmptyTerrainPosition does not seem to be doing a very good job with that. Im using TraceFlags.ENTS, should I be using TraceFlags.WORLD?
SCR_WorldTools.FindEmptyTerrainPosition(pos, pos, 25, 4, 4, TraceFlags.ENTS, GetGame().GetWorld());
``` maybe this is the issue, it doesnt find a spot in the areaRadius? ```c
\param[out] outPosition Variable filled with found position. When none was found, areaCenter will be filled.```
Ill try to increase the radius for better results i guess
On another topic, if I script a live mine on a road and then use ```c
void RequestNavmeshRebuildEntity(IEntity entity)
What function/class is used for when a base is being captured?
SCR_CampaignTask I think is what you're looking for. Finish is called when it's capped and I think ShowTaskProgress shows the progress bar.
ShowTaskProgress might not be exactly it, but that should be a decent starting point. Otherwise you can open the diag menu (win + alt + control), disable localizations, and find the capture progress localization id to point you in a better direction
Thank you very much 🤟
CampaignMilitaryBaseComponent: ```c
bool IsBeingCaptured()
nope, doesnt seem to work like that.
spawn a dummy entity with a huge collider
request rebuild
swap with mine
?????
but if this works then you gotta remember to rebuild again when entity dies?
I guess you could skip the swap part, the huge collider entity could be a child of the mine prefab then gets deleted after rebuild
yeah ill have to try something like that tomorrow night, im headded to bed! 💩 😴

arsenal refund (selling back) calculates weapon attachments supply refund value twice because it sees them as both attachments (additional cost / value) and items in storage. solved by just ignoring storage inside when it comes to weapons, which is better than allowing supplies to be exploited.
if it works, it would be very helpful for PVE scenario making. So the AI will no boom himself when driving.
Can anyone help me with that?
No ; there, i assume this is the output of some AI model? Also user actions are usually not called components. have a look at other user actions to see about naming and right structure. you are nearly there
What about the API methods used to get von on a radio frequency?
Also yeah I couldn’t get the component to work so I had Claude chew at it, I see it went off the rails now lol! but I realize now it’s a different subfolder in the directory…
USERACTIONS
Hello, I have a technical question, I created a modded class of PlayerController, the amount of features made the script become quite big for me and it would be easier to separate things into several files, will it cause problems if I make between 4 and 6 modded classes of PlayerController?
I guess there is a way to create methods in separate files that I could call from the PlayerController, would that be better than stacking modded classes or does it not change anything?
will it cause problems if I make between 4 and 6 modded classes of PlayerController?
Yes. For this class that is used quite a lot. It would deteriorate performance
As every modded class counts as a new inherited class, and each super in there counts as new context and extra script method calls. Which are expensive.
Ok thank you !
Why it's so strange;
TestDto test = new TestDto(
"test123",
"test",
);
test.Init();
test.Pack();
Print(test.AsString());
Print(test.param1);
SCRIPT : {"param1":"€d6\u000E?\u0002","param2":"€d6\u000E?\u0002"}
SCRIPT : string param1 = 'test123'
SCRIPT : ScriptDebugger: remote script executed successfully.
class Any: JsonApiStruct {
void Init() {
typename variableType = this.Type();
int variableCount = variableType.GetVariableCount();
for(int i = 0; i < variableCount; i++) {
RegV(variableType.GetVariableName(i));
}
}
}
class TestDto: Any {
static string param1;
static string param2;
void TestDto(
string param1,
string param2,
) {
this.param1 = param1;
this.param2 = param2;
}
}
Why are they static?
Oh fuck, you're right, my yestard test's (Thx 😅 )
is better than jsonApiStruct?
yes
But i need unique methods for get value by field...
After all, my wish is an auto serializer of any object inherited from a special parent... Will it work?*
Some of typename.GetVariableValue(Class, int, out Class)...
But thank u very much, it's looks more interesting than JsonApiStruct
yes it can automatically handle custom structs with nested complex properties also etc
jsonapi struct is mainly used for fixed simple json we use to communicate with backend services
I just don't quite understand how i will desiarilize to object... When i need use some of typename.GetVariableValue...
i can't get pointer to value to use as a parameter for reading from context
SCR_JsonLoadContext loadContext = new SCR_JsonLoadContext();
loadContext.ImportFromString(dataString);
string stringValue;
int integerValue;
// order does not matter for JSON as it uses key names
loadContext.ReadValue("key2", integerValue);
loadContext.ReadValue("key1", stringValue);
ah i see you are still trying to implement an any type. forget about that. it will not work. i tried before
Either way if you want to try and continue and find out yourself, you can simply read and write an object as a whole with ReadValue("", objectVar)
Thank you very much, you are very helpful
Also, if you try add Any or any sort of dynamic typing into Json, you can use my custom json parser on workshop, its ugly but works
It's not about json, im mean i try create deserialize like - any object from json... but
I didn't find a way considering that there is no possibility to get a pointer to a class field at runtime
With my parser you can deserialize any object
Just beed to write function that will create instance and get all values from json object
yeah, but i mean -> if u know like deserialize/serialize in Java with jacksonObjectMapper, or some of c# libraries... i mean, when u haven't function in every class... it's not good
when you're have object, easy serialized from JsonSaveContext, but when u try deserialize, u can't desirilze into object...
class MyObj {
string param1;
}
string test = {"param1": "test123"}
u can't set field into MyObj like
MyObj newObj = new MyObj();
typename type = MyObj.Type()
string varName = type.GetVariableName(0);
typename varType = type.GetVariableType(0);
auto varValue = varType.Spawn();
type.GetVariableValue(newObj, 0, varValue);
you don't get any value or reference because auto doesn't work in this context
You can not spawn primitives, only complex classes. and you can not hold a complex and primitive type in the same wrapper. as complex needs strong reference, primitive CAN NOT have one.
you must setup template magic for each of the primitive types and then Class or better Managed for holding any non primitive
yeah it's my bad, but the point is that I couldn't spawn a string or any primitive normally in dynamic
?
just do ""
Or am I missing something?
You will have to check the varType and depending on each result return a primitive any wrapper type from some sort of factory method ... i dunno it was all so against everything the script language was made for that i gave up on making one type to rule them all
Yeah the language is supposed to be strong typed
so better to forget trying to stay away from that
It wil just make everything harder and slower
.Spawn(); was supposed or planned to be removed iirc btw
Strong typed it's not about good solutions... We're could thank bohemia if they gave at least some access to reflection...
good solutions?
Generalism usually means bad solution
But I guess it is hot topic
If there was minimal access to getting the field reference, that would solve everything
Depends on what you want to do
If I had my ways we had more dynamic reflection coding already, but I fear the things I myself will create with them 🙂
Generalism is often extremely bad for performance, and maintenance in many cases
BUT IT LOOKS COOL!
But it has its nice aspects too
As everything it must be used WHERE it actually makes sense
Of course, if you don't know how to use them
I mean, it's not about u...
It's like - user don't know how to use right
Sorry for my eng 😅

I have done my fair bit of misuse of reflection too
this is the fate of all developers on the way
3 years ago I put the service down by writing the reflection method in the wrong place)
not everything is always performance critical, and sometimes performance is the very last criterion. there's lots of use cases where it doesn't matter if it executes in 0.01 or 0.02ms, but it matters that the code is readable, flexible and/or concise. like always, it depends
are there other fundamental features besides ScriptInvokers that are considered for removal too? 😄
@torn bane
What are u think?
class SConverter {
static void ReadObject(string json, Dto obj) {
SCR_JsonLoadContext ctx = new SCR_JsonLoadContext();
ctx.ImportFromString(json);
if(!obj.IsInherited(Dto)) {
return;
}
typename objType = obj.Type();
int variableCount = objType.GetVariableCount();
for (int i = 0; i < variableCount; i++) {
typename variableType = objType.GetVariableType(i);
auto value = variableType.Spawn();
string variableName = objType.GetVariableName(i);
objType.GetVariableValue(obj, i, value);
if(variableType == SString) {
ctx.ReadValue(variableName, SString.Cast(value).value);
}
}
}
}
string json = "{\"param1\": \"test\"}";
ref TestDto testDto = new TestDto();
SConverter.ReadObject(json, testDto);
Print(testDto.param1.value);
SCRIPT : string value = 'test'
SCRIPT : ScriptDebugger: remote script executed successfully.
How do I tag assets in a script?
I would like if bohemia allowed us to use keywords only they can use like passing functions as parameters, or storing functions in variables
This is also blocked for our own scripters
Its only a thing from CPP
CallLater can accept function as parameter
It comes from cpp
Yes. But the system was defined in cpp
I'm sure you could make it work if you wanted
I had a question regarding the guidelines about modding.
So i'm working on a game mode which is fully dependant on my API, the thing is.. for obvious reason the endpoint and logins info are not saved in the mod.
Am i allowed to make it so that the gamemode does not start when the authenthification failed ? or should i implement some kind of minimal compatilibity in case if the authenthification fails ?
UpdateLimited / AddMode in SCR_EditorManagerEntity is one of those infinite recursive scriptinvokers still, on server anyways when running peer tool, u can't #login on the non-workbench client without triggering it
It's not recursive anymore because it's canceled by the VME 
is there any way to get metrics in milliseconds for an operation?
Sounds an awful lot like you're trying to paywall something. I'd review the new monetization rules
no. just trying to get so people can't run request on my API.
the game mode won't be eligible for monetization since it uses RHS and WCS mods.
I don't want anyone to be able to run the mod without a token given by me.
The sky is the limit with scripting, so I'm sure it could be done. But I'd definitely drop your use case inhttps://discord.com/channels/105462288051380224/105792634995388416
Ok thank you, i was not aware of the existence of this channel.
No worries, finding anything here is a nightmare so I get it
Nothing malicious can be done is the policy iirc. Cant crash the game or do anything weird. Just gracefully end the gamemode and its probably fine
Ok so RequestClose should be fine
How can I force BaseInventoryStorageComponent.GetAll to always work on peer? I've noticed that it only returns something if peer has opened the inventory UI recently, and then disappears again after some time. So there must be some lazy replication going on.
if I understand the spirit of that policy correctly, that will be fine as long as you only gracefully exit when your gamemode is in use. if someone loads your mod, but launches a completely unrelated scenario, it should behave as if it wasn't there. but I am no authority on this matter @red cedar
Has anyone messed with using chatgpt to script for enfusion?
You are not able to cause a server to stop through a mod or crash it. You can create a mod that does not function (without stopping/crashing servers).
so i just don't handle the auth failure and let the game figure it out ?
I imagine if the mod/server fails to contact your API it just sits idle doing nothing. This is fine. What you can't do is what some modders do which is "no license found, imma crash your server now k thx bai"
ok lol. Sounds good, thanks for the info 👍 .
Me again... How do I tag/reference assets/prefabs in a script?
How do I make the script editor not take 15 seconds to focus when having more than a dozen mods loaded in WB?
Today we have solutions to allow a map rotation or vote to occur, without having to restart the server, and that does not cause Jeep ERROR?
Today we know that a server with many players, when finishing the map, is having to restart the server with the new map, because the scenario reload and map voting end up giving Jeep Error
does anyone know if the RestApi is also available for consoles or just PC?
why are such basic things blocked? do you see some security exposures in this functionality?
is there a concept like setting/getting variable on a namespace (like a specific entity) during game runtime in enfusion, similar to a3 setVariable/getVariable?
No
This was before your clarification ^^
No consoles, and no clients at all in future if not yet (#enfusion_scripting message), so only server side
Just add component to it
I think I've noticed it happens when I have multiple mods loaded that I can edit
The minute I moved those to a different part of my drive so the WB only used what I downloaded from the workshop and therefore can't edit it is when the performance fixed itself
This was 2-3 months ago so it may have changed since then tho test it out
you can use cli parameters for the token and if not found just disable the mods functionality
Does anyone have any idea how I can set a player in the preferred queue?
put them in the admin list in your config. but they will also have admin
thats also not scripting
Does RequestRoadNetworkRebuild() work? Im spawning in a building and using that function to try to get AI not to drive over scripted mines, but they just keep driving straight into them.
Does anyone know where I can find a script or something to do adding props inside houses?
Hello, can anyone help me with Kodiis Building System?
I can build, the file is written but when I start it again the objects are not displayed in the game, I have already checked and it is as if the game could not read it to load. But everything is "fine"
No idea, just the usual "is it running on authority" question, kind of like asking if it's plugged in but it's worth asking.
Has anyone resources/videos to get into reforger modding (scripting). I have Development exp. But not in games. And I can’t get into by my own. Has anyone some helpful links? How to script UI interfaces e.g. or mod configs to limit spawns etc.
I tried to study the wiki but after the tutorials I still dont know where to do what.
Let's start with asking what you want to do
I would say I‘m a total beginner in game scripting. I wrote a little mod for cyberpunk but arma is more dev friendly 😉
I have two things for now. I want a simple UI window with info when a player spawns. And the second thing is to save/ make some things persistent when the server restarts
And later I would to do something where the player can interact with. Like a UI with buttons
So the UI thing should be easy. The. Persistent part needs a DB and a connection from the game to it. How can I connect the game with the DB on my server
If you think this is a bit to ambigues for beginners, I would be fine with some other ideas to learn
It doesn't have any native DB drivers but you can use a HTTP API to interact with your DB. For most simple use cases writing to a Json file should also be sufficient. If you want an out of the box solution look into Enfusion Persistence Framework
IIRC Arkensor said some similar functionality will be added as Vanilla and EPF will be deprecated eventually but if you just want most things persisted in a FFA game mode it's the easiest way to get that up and running currently
If you haven't already, watch first few episodes of modding bootcamp series released on YT by BI. TPMTactical also has some really good YT tutorials for new modders. Watching both of these will help you learn your way around workbench to get a better idea of where to do what
@midnight talon thanks. E.g. when I want to write class that sends the info to the db. How can I add this class or where I need to add this class? To an event when a player does something?
if doing your own persistence yeah you'll have to find the appropriate methods on relevant classes to hook into, entity lifecycle wiki page might be useful for that https://community.bistudio.com/wiki/Arma_Reforger:Entity_Lifecycle?useskin=darkvector
how about despawn the explosive when no player nearby
Hey fellas, i'm having issues with the code below. I'm getting an error that reads "Scripts/Game/Character/WZ_AltitudeSick.c(16): error: Can't make callback from unknown method 'radius'". I have tried multiple times to define Radius as a float value of 10000.0 both in a separate declaration, and in the actual parameters for the QueryEntitiesBySphere function.
// comment
world.QueryEntitiesBySphere(foundEntities, "0,0,0", radius, EQueryEntitiesFlags.DYNAMIC, SCR_ChimeraCharacter);
player lock
Hello. I have AreaClear to set task to kill all enemies in area. But after finish I want to call script method created by me (just call a custom script). How can I do this? I'm using SlotClearArea from ScenarioFramework
Thanks. Whats the diffenrence between components and entities? Both can be placed in the world as I understood
How can I listen to animation events in my script?
Heavily depends on what you are using
Is it a vehicle, character, ai, clothes, gun, gadget, etc?
I found it in character controller 😄
GetWorldTime() is in sync with server for clients?
They cannot have admin commands, but only the function that the admin has in the queue, can I get this function from the queue only?
Nothing regarding the server queue is scripted.
but I understand that if the admin gets this priority, there is this library, I can't use it?
even if I use the admin logic that already has priority and try to remove the GM ?
Nothing regarding the server queue is scripted.
I had seen a server that made an API that can set a player to have priority in the queue
I imagined it had
The class that handles all of the server queue related things is sealed, and all of the functions are external.
They can't be modified by scripts.
That is how you give people priority in the server join queue.
Whats the best way to get where the eyes of a character are pointing? Look direction? Head aiming component only gives heading or something wrong with what I'm doing
lmao nvm it has GetLookAngles lets give that a shot
I thought about it, and create a way to block admin commands, then it would be good
I'm applying transform to a bone and the angles are kinda multiplied by 2
Just want to copy world transform of one bone and paste into another
Thing is that it is handled by that value. But how it gets used for the final transform is clamped/limited and controlled by the anim graph
So if you really want what the eyes point to, you have to get the transform of the eye bones
I have the direction now which is correct, but it seems it's not possible to force a bone to have the same transform as the one I want because angles get multiplied by 2 or whatever
I turn 90 degrees and the bone turns 180
Are you using correct units?
I am using GetTransform and SetTransform
You tell me, is SetBoneMatrix local or model space?
That is the space, not the units
Are you handling angles at any point?
Then converting to matrix transform?
No.
What are you doing?
It's local iirc
I have two bones. I want bone 2 to have same angles as bone 1. So I tried Get...Matrix and Set...Matrix and angles of bone 2 multiply by 2
Just beware, that what is front for you might not be the front axis of the bone
See what they are in the skeleton preview on the xob
Its my bones lol
Select the bone, see orientation
Everything is fine except looking around multiplies its angles by 2
Show photo of the skeleton hierarchy
I am telling you because this is always cause of "issues" when people are trying to deal with transform of bones
Actually I lied. My source matrix comes from PointInfo with one of the other bones as pivot.
also show code
rest in peace
This gets me the correct world space and model space matrix
Can't really help without seeing the setup, and code
Whatever you have there affects whatever we might provide you
do you have to mess with the sound component to stop a vehicle horn, including over the net? CharacterInputContext methods not a help. I used action listeners, but it was messy because setting the value to off / zero makes the listener retrigger, which isn't true to the state of the button (still held). extra timers are needed to track and ignore some the retriggering.
This is the code
m_AimPointBase.GetModelTransform(m_vAimPointBaseMatrix);
m_vAimPointBaseMatrix[3] = vector.Zero;
m_Animation.SetBoneMatrix(this, m_Animation.GetBoneIndex("RightHandProp"), m_vAimPointBaseMatrix);
I have ScearioFramework area created, but want to disable it by default to do not spawn\create inside world, then from script create\spawn it with all childs and despawn\delete when I need also from script using SCR_ScenarioFrameworkArea
How its possible?
Not sure if using scripts is different but at least using Scenario Framework you can't disable an Area to spawn it later
Yes the Area itself has to be OnInIt but the layers/slots can be on trigger activation
Okay, so I need to play with activation\deactivation, to control spawn of children units
yes and if you want to control spawning and despawning dynamically you have to activate Dynamic Despawn on the layer or slot and on the game mode config
Yes, but it will do it automatically based on player position\camera. I want to control it manually. Now I configured Activation condition for Area and control it by variable value. SetVariable and then Area.DynamicInit() to reinit it with new variable value.
But it doesnt work when I want to deactivate Area. Area is still active. Why?
I can activate it by set variable to 1, but cant deactivate by set variable to 0
Lol CharacterHeadAimingComponent.GetAimingDirectionWorld() only returns aiming direction across one axis
Wait no it gets worse
Cant understand how to despawn. I have few Area. Each contains layer with childrens Slot or SlotAI.
I want from script spawn childs for Area1 or Area2.
For example when I'm typing command to chat, I want to spawn\activate Area1 childs. Then from next command remove from map\despawn\deactivate all childs from Area1 and spawn\activate all childs from Area2
Cant find a way to do it. In docs cant find method how to control it for Area\Layer
BaseWorld.c
/*!
Query for entities touched by sphere.
\param center
Center of sphere
\param radius
Radius of sphere
\param addEntity
Callback method. called when another Entity is intersected during Query methods.
\return Return true, when query should continue, False when you want to quit query call.
\param filterEntity
[optional] Callback method. Called when another Entity is encountered during Query methods.
Some light-weight filtering could be implemented here, prior to intersection test \return True when entity has to be further tested, False otherwise
\param queryFlags Various flags See EQueryEntitiesFlags
\return
False when query was canceled.
*/
proto external bool QueryEntitiesBySphere(vector center, float radius, QueryEntitiesCallback addEntity, QueryEntitiesCallback filterEntity = null, EQueryEntitiesFlags queryFlags = EQueryEntitiesFlags.ALL);
Isn't foundEntities not a valid parameter? Hence it is reading center=foundEntities, radius=``"0, 0, 0"`
Does anyone know why this error occurs and disconnects?
reminds me of that one time...
CharacterHeadAimingComponent t_Comp_HeadAim = HCA_CM_m_CharacterController.GetHeadAimingComponent();
CharacterAimingComponent t_Comp_Aim = HCA_CM_m_CharacterController.GetAimingComponent();
float t_fUpAngle = t_Comp_HeadAim.GetAimingRotation()[1];
float t_fUpAngleAim = t_Comp_Aim.GetAimingRotation()[1];
Did you already try the aiming component too?
Does anyone have info or script on whitelisting doors to individuals?
I think that’s better discussed in https://discord.com/channels/105462288051380224/976119935875026964
But we have the same issues, so might honestly be vanilla
Just ran into this, think I see why
Replication.IsServer() returns true on peer tool client
Is the JIP error for RequestScenarioChangeTransition being fixed? It's not on the known issues?
Is there anything we can do to help?
https://reforger.armaplatform.com/known-issues
Is there any way to allocate more static memory to a ScriptModule?
which script specifically handles camera position/movement when character moves around? in third person
CPP iirc
oke doke
I’m using AudioManager.PlaySound()
In WB works fine, but on server can’t hear sound. As sound using default sirens, not mods or custom uploaded
class CharacterCamera3rdPersonBase
//-----------------------------------------------------------------------------
override void OnUpdate(float pDt, out ScriptedCameraItemResult pOutResult)
{
pOutResult.m_vBaseAngles = GetBaseAngles();
bool isLinked = m_CharacterAnimationComponent.PhysicsIsLinked();
//! update fov
m_fFOV = GetBaseFOV();
//! yaw pitch roll vector
vector lookAngles = m_CharacterHeadAimingComponent.GetLookAngles();
if (!m_bIgnoreCharacterPitch && !isLinked)
lookAngles[1] = lookAngles[1] + m_OwnerCharacter.GetLocalYawPitchRoll()[1];
//! apply to rotation matrix
Math3D.AnglesToMatrix(lookAngles, pOutResult.m_CameraTM);
//! base bone pos
if (m_iBoneIndex != -1)
{
vector boneMatrix[4];
m_OwnerCharacter.GetAnimation().GetBoneMatrix(m_iBoneIndex, boneMatrix);
pOutResult.m_CameraTM[3] = boneMatrix[3];
}
else
{
pOutResult.m_CameraTM[3] = "0 0 0";
}
Do you mean this part?
What devious things is bacon doing with the camera??
Has anybody made a script for conflict game mode where players get rewarded for repairing vehicles? Also rewarding players for decommissioning random spawn vehicles not ones that are spawned in by players
Does anyone have any script for a RP life server?
I saw it and the usage is sane. This time

I actually just needed the third person camera to behave for testing, in published mod it wont be used
If you use search here there have been reports that this doesn't play on clients, so if you are using it from the server you need to find a way to run that script on a client
SoundEvents are pretty easy to use imo, if your usage allows it
Is there a first person equivalent? Or better, just way to get the players active camera and its vector?
You can get current active camera from the World
Hi, what does this means and how i can fix it?
2025-06-06 21:09:02: WORLD : Frame
2025-06-06 21:09:02: SCRIPT (E): Virtual Machine Exception
------> 2025-06-06 21:09:02: Reason: ScriptInvoker: Recursive call of Invoke!
2025-06-06 21:09:02: Class: 'SCR_HelicopterDamageManagerComponent'
2025-06-06 21:09:02: Function: 'Invoke'
2025-06-06 21:09:02: Stack trace:
2025-06-06 21:09:02: scripts/GameCode/Components/SCR_DamageManagerComponent.c:1311 Function OnDamageStateChanged
2025-06-06 21:09:02: scripts/Game/Modded/REAPER_DamageManagerComponent.c:131 Function OnDamageStateChanged
2025-06-06 21:09:02: scripts/Game/Components/Damage/SCR_VehicleDamageManagerComponent.c:1657 Function OnDamageStateChanged
2025-06-06 21:09:02: scripts/Game/Components/Damage/SCR_HelicopterDamageManagerComponent.c:33 Function OnDamageStateChanged
2025-06-06 21:09:02: scripts/GameCode/Components/SCR_DamageManagerComponent.c:520 Function Kill
2025-06-06 21:09:02: scripts/GameCode/Components/SCR_DamageManagerComponent.c:1311 Function OnDamageStateChanged
2025-06-06 21:09:02: scripts/Game/Modded/REAPER_DamageManagerComponent.c:131 Function OnDamageStateChanged
2025-06-06 21:09:02: scripts/Game/Components/Damage/SCR_VehicleDamageManagerComponent.c:1657 Function OnDamageStateChanged
2025-06-06 21:09:02: scripts/Game/Components/Damage/SCR_HelicopterDamageManagerComponent.c:33 Function OnDamageStateChanged
2025-06-06 21:09:02: scripts/Game/Components/Damage/SCR_VehicleDamageManagerComponent.c:1629 Function ProcessCollision
2025-06-06 21:09:02: scripts/Game/Components/Damage/SCR_VehicleDamageManagerComponent.c:1485 Function OnFrame
Good point. Helped a lot, but now I cant stop the event. How to do it?
Is there a channel I can drop a link to my debugging console errors video?
I'm sure it will be quite helpful to many members of the community.
OnDamageStateChange keeps calling itself infinitely
Ok i think this is because the super call. Will check it. Ty
Already tried deleting and rebuilding fresh script
Try adding ; on the last }
how to get remote console to work
SCRIPT : ScriptDebugger: remote script executed successfully.
SCRIPT : ScriptDebugger: remote script executed successfully.
SCRIPT : ScriptDebugger: remote script executed successfully.
i'd really love to know how the fuck it's doing this when i don't even have the game open
😹
your code is null safe 😉
Workbench has a game running on its own
And the script debugger is connected to it by default
Any idea of ETA for supply becoming very laggy over time fix to reach stable? Really needed on public vanilla servers.
Why after every update/every new project i create peer tool is just a hassle to setup, I hope whoever made it this difficult gets sand in their socks
Was there somewhere in the debug menu to display rplids? I cannot find it 
20 minutes of super fun debugging workflow. There are several good tips and quirks in there that I run into during it show how to deal with. If not allowed delete or tell me a better channel to post in. Peace.
Debugging 101 For Enfusion Arma Reforger Tools + ChatGPT
Tips if you feel so inclined. Every dollar goes towards me not having to take other work so I can do this stuff more.
Appreciate it, hope the 20 mins is worth it
For sure. You will get the gist in the first couple minutes but watch all the way through if you want to see the little quirks that you might run into so you don't have to chase them for hours and hours like I did before you figure it out.
This is a new one. Any ideas?
21:01:28.961 RPL : rpl::Pip::ProcessNetToGame
21:01:28.961 RPL (E): Item was removed from replication on local machine but there are still RPCs targeting it. This may be sign of very serious issues! itemId=0x800102A7, identity=0x00000000, rpc='Rpc_ProxyIncrementalUpdateCtrl_BCNO'
21:01:28.961 RPL (E): Item was removed from replication on local machine but there are still RPCs targeting it. This may be sign of very serious issues! itemId=0x800102C7, identity=0x00000000, rpc='Rpc_ProxyIncrementalUpdateAnim_BCNO'```
WTF
Why is entity with rplcomponent transform different on client than on server
It seems like on client "Auto Transform" is always on
???
Or maybe I am the bug here
Actually I am not the bug, when entity is streamed in it's like Auto Transform is checked 😦
what is this
and why it only happens in peerclient never on server (wb)
Crash GUID 14cdf452-dc95-4e18-8158-7addcd7e952d and 2de29bdc-0cd5-4de9-a014-ef63ee467fb7
Blockers, can't release mod until it tells me what is wrong
I'm just amazed you actually got the peer tool working. I gave up way too much of a hassle for what it is.
I'm sure I can get it working if I wanted to put five or ten hours into it , but no thanks.
Hopefully that will be the biggest priority for That position they have open.
Not sure the hassle. Select the correct exe files and choose where it loads mods from.
They own the engine and the game. It should be a lot more streamlined.
Is that the shitty tool you would make if you were doing it?
And it's not that hard you're right but it's just annoying having to find the right parameters and all that stuff when it's unnecessary really.
I guess I will not release this mod because the game throws errors without telling me what went wrong and crashes, guess I've wasted another saturday on trying to make a mod
It's a bit weird how it only does it when a client gets involved but I guess since the logging is desinged to be as unhelpful as possible I will not be finding out what goes wrong
At least it's printing error 🤣
I can't believe that modern software would require me to press completely random buttons to fix a problem, apparently logging what is wrong is impossible in 2025

is there a string or smth helper to retrieve UID from resource name ?
"{GUID012345678910}Prefabs/Characters/Factions/Faction/Character_FactionName_NLAW.et"
-> {GUID012345678910}
with or without brackets dont care and im lazy
Just substring it
lazyness increased
i found FormatResourceNameToUserFriendly() and hopped 😄
I remember such thing somewhere, it should be called with External or Internal
sealed class ResourceName: string
{
proto external string GetPath();
//!Has GUID and store-name with extension
proto external bool IsExternal();
//!Has only GUID, not store-name
proto external bool IsInternal();
}```
you thinking about this i suppose
SCR_ConfigHelper.GetGUID
And path part with ResourceName.GetPath
Hey fellas, what function are we using to deal direct damage to a player through a ScriptComponent, if any?
Im working on, and very close to finishing, a Script to simulate Hypoxia during freefall, and the only part of it left to sort out is to cause the player to actually take damage when their oxygen gets low.
HandleDamage afaik
on DamageManagerComponent
just make DamageContext and call it
Awesome, thank you. That is what I needed
Wow now it just freezes, not even any errors
You set wrong mins vector for bbox
Mins have to always be less component wise than respective maxs components
Mins[n] < Maxs[n]
EDIT: nvm I think it's a me issue
line 6 no ?
share more or we cant help
I think I figured out the issue but I for sure hate this compiler... it doesn't show the errors like gcc or clang and it's very confusing when coming from actual c++...
Anyone ever use the CharacterMovementComponent in script? It seems to crash workbench anytime I try to attach it to the base player
SCR_CampaignFaction used inconsistently in SCR_CampaignBuildingEditorComponent. some code was changed to use SCR_Faction, but not all.
Is it possible to check if a define is set at runtime without the preprocessor?
How do i get Shape.Create to work in base regular game?
https://discordapp.com/channels/105462288051380224/976155351999201390/1363428198058033203
Ugggg whyyyyy. Didn’t realize like none work
override void OnPostInit(IEntity owner)
{
SetEventMask(owner, EntityEvent.POSTFIXEDFRAME);
SetEventMask(owner, EntityEvent.SIMULATE);
m_InputManager = GetGame().GetInputManager();
m_InputManager.AddActionListener("DroneUp", EActionTrigger.VALUE, DroneUp);
}
override void EOnSimulate(IEntity owner, float timeSlice)
{
vector upThrust = vector.Up * m_iCurrentThrustRPM;
if (m_iCurrentThrustRPM > 0)
Print(upThrust);
owner.GetPhysics().ApplyForce(upThrust);
}
Any reason why whenever I change the thrust here it just stops running the EOnSimulate member
What's even weirder is this worked once and then never again
No change
Twas the EventMask it seems
Where did I set it
It doesnt matter now since the mod freezes client now
I know I'm pushing the boundaries of cyber bullying, but I do hope whoever made UX for peer tool steps on Lego's (yes, plural, I'm mad).
It's possible to use ScriptBit* for your own Rpc function? So you can encode delta of some complex data and decode it on receiver side rather sending entire instance or calling multiple Rpc functions for each changed property?
17:45:26.000 NETWORK (V): RplConnection::Rpc_Validation_S sent
17:45:26.091 RPL : ClientImpl event: disconnected (identity=0x00000000), group=4, reason=2
17:45:26.091 NETWORK (V): RplSession::RplRuntimeEvent: Error
17:45:26.091 NETWORK (V): RplSession::RplRuntimeEvent: Disconnect
17:45:26.091 NETWORK (V): RplSession::Terminate
17:45:26.091 RPL : Pip::Terminate
17:45:26.091 RPL : IReplication:: Terminating
17:45:26.192 RPL : Pip::Destroy
17:45:26.193 NETWORK (E): Unable to connect as client to ''
17:45:26.294 PLATFORM (D): Steamworks: SteamAPI_Shutdown()
17:45:26.391 ENGINE (E): Unable to initialize the game
17:45:28.878 INPUT (V): InputManager: deactivated
17:45:28.883 NETWORK (V): RplSession::Deleted
17:45:28.904 ENGINE : Game destroyed.
17:45:28.904 DEFAULT (D): HttpClient::Cleanup() HR = 0
17:45:28.925 RPL : Pip::Destroy
17:45:28.935 AUDIO (D): Audio loop exit
how does one simply figure out wtf is wrong with peer tool 
Swap projects, and budda bing budda boom we are no go on the peer tool working again. Probs easier for me to publish and test
I have a script that looks for all entity catalogs from all loaded addons, works perfectly reads all the prefabs.
EXCEPT catalog.GetCatalogType() will ONLY return 0 or 100, even though its going over containers with other values. E.g.
Resource res = BaseContainerTools.LoadContainer(resourceName); // resourceName is the .conf file
if(!res || !res.IsValid())
continue;
BaseContainer container = res.GetResource().ToBaseContainer();
if(container.GetClassName() != "SCR_EntityCatalogMultiList" && container.GetClassName() != "SCR_EntityCatalog")
continue;
SCR_EntityCatalog catalog = SCR_EntityCatalog.Cast(BaseContainerTools.CreateInstanceFromContainer(container));
catalog.InitCatalog();
Print(resourceName + " , " + catalog.GetCatalogType());
I wonder if its some magic here or something im missing
[BaseContainerProps(configRoot: true), SCR_BaseContainerCustomEntityCatalogCatalog(EEntityCatalogType, "m_eEntityCatalogType", "m_aEntityEntryList", "m_aMultiLists")]
class SCR_EntityCatalog
{
[Attribute("0", desc: "Type of the Catalog", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EEntityCatalogType))]
protected EEntityCatalogType m_eEntityCatalogType;
{3B679F1799D55F6F}Configs/EntityCatalog/USSR/Characters_EntityCatalog_USSR.conf , 0
with face, multiple times. also, whoever named IMPORT settings "EXPORT" - is surely has to go get IQ test
Wait until you have to create an entity that's visible in game master. For a character, you need to set its faction to match your faction in three different places plus you also have to set it in three places inside the group prefab if you haven't done it already
If you expect that the Faction Affiliation Component would be the only place this information is stored in, you're wrong. It's also in two places in another component.
How do I use action listeners to influence in EOnSimulate
override protected void UpdateLocalPlayerController()
{
InputManager inputManager = GetGame().GetInputManager();
super.UpdateLocalPlayerController();
inputManager.AddActionListener("DroneUp", EActionTrigger.VALUE, DroneUp);
inputManager.AddActionListener("EnterDrone", EActionTrigger.DOWN, EnterDrone);
}
void DroneUp(float value, EActionTrigger reason)
{
SAL_DroneControllerComponent.Cast(GetGame().GetWorld().FindEntityByName("drone").FindComponent(SAL_DroneControllerComponent)).DroneUp(value);
}
Adding a Print statement in DroneUp makes this work due to the delay its adding but how do I do this naturally
Basically why I've given up on trying to get faction changing working (and I assume why BI did too)
Too much going on in the backend and on the client to get it working properly
Okay confusion setting in even harder
If I restart the workbench it works
But then if I reload the scripts it no longer works
what the hell
Is there a function somewhere that will do something like "go into game master, then focus camera there"?
Ended up just being whatevers going on in the background of the engine, offloading all my members for input into EOnFrame fixed this
have a question not sure if possible lets say there are multiple towns or locations on map is it possable for an object lets say a car to randomly generate in one of those location each match
For players, don't you just have to change it on the affiliation components on the character and player controller?
I imagine you'd want to change the player's faction as if they selected it in spawn menu? Not sure where that's stored
That's stored on the affiliation component on the player controller
Had to figure that one out when I tried to fix the reconnect component not properly restoring the player's faction for my marker mod 🙈
Maybe have a look if you find the code for the open GM keybind. Or the open building mode user action on command posts, as it's just another editor mode.
Yeah I was just hoping I don't need to make a mess with calllater
No camera creation/switch event you can hook to?
Or a static method on the editor camera to pass its initial position that should get set on init.
Like moving the camera spefically?
I more or less do that with my GM Tools #mc command. If its typed in by an admin, it will put them into gm mode and then move to the camera to the target location
SCR_ManualCamera and SCR_TeleportToCursorManualCameraComponent
Hey guys, is there a way to change an emat UV offsets using scripts within the game?
Is there a way to show a hint to all players on a dedicated server?
could probably add some kind of "deep link" logic to GM mode by adding a public property for the focus target position, override the GM mode open method to call same focus method F keybind does on that position after opening if it's set. Then from your context outside GM mode you just set that new prop on GM mode entity/component and open it directly
I'm currently setting it on SCR_PlayerFactionAffiliationComponent and in SCR_FactionManager, what's the third place that I'm missing?
Oh, SCR_EditableEntityComponent so it shows as correct faction entity in GM mode?
It's not just GM. It literally controls how the character is perceived in general (AI, boarding, ect.)
Third place is probably on the group that is used for AI joining you, but that might be handled automatically when assigning a player group.
When you create a group through vanilla Conflict group menu IIRC it will set the group's faction upon creation but yeah you're right it will need to be set on SCR_AIGroup entity if being managed manually too
Just create and assign a new player group and you should be fine I guess.
Yeah for group creation at least it's all handled automatically in groupsManager.CreateNewPlayableGroup(faction)
If the player is not controlling a character when its triggered against them (say like the deployment screen or respawn screen), it will bug out and need to be refreshed via replication
You mean like posessing an existing character w/ a different faction and updating its faction?
I'm pretty much framing my issues up with conflict exclusively here. But, I'm talking about changing the affiliated faction for the player
If the player is already possessing and entity, they can be swapped easy enough. Swap them and when they go to respawn they will be on the other faction. But if that player is currently at the deployment screen or respawn screen and a change is attempted it will not allow the player to deploy or respawn without some additional replication telling the client UI to refresh all the faction associated components
The only time I ever got it working was a very delayed call later to do just that. Otherwise I just changed the players faction and killed the controlled character entity and they went to the new faction respawn screen without any issue
SCR_PlayerFactionAffiliationComponent fac = SCR_PlayerFactionAffiliationComponent.Cast(playerController.FindComponent(SCR_PlayerFactionAffiliationComponent));
if (fac)
fac.SetFaction(playerController, faction);
SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
if (factionManager)
factionManager.UpdatePlayerFaction_S(fac);
^ calling these seems to set & sync player's faction correctly for systems like welcome screen/deploy menu/group menu/player menu
at least for my case of integrating those with EPF which by default overrides-out most of the vanilla spawn logic system events
Have you tried that on a dedi server?
I have to look at the last version that I ended up scrapping
yep, the _S method is the server-side call to update the player's faction which should also replicate changes to clients, at least for most things I've tested so far it seems to work fine
Yea I'm pulling those and it can execute totally fine, but is not replicated in the UI appropriately on dedi
those get called after a player w/ existing character connects and is loaded by EPF, since EPF doesn't persist/manage factions I manually set player faction on first join and reconnect. When player re/spawns their deploy menu etc shows them with correct faction assigned
If you're trying to use EPF in Conflict-based world as well you'll also need to call some other systems after player faction is set for them to be properly registered e.g. m_SpawnLogic.OnPlayerRegistered_S(playerId); for deploy menu etc to work properly
back to smashing my brain against it
can we test JIP / reconnect with peer tool or dedicated tool? there's no obvious way to connect to a Diag server manually
there's a setting to not autoconnect peer tool, but u can't do anything to trigger connect after that unless I missed something in the Debug "Diag" menu.
Why u guys troll me like dis
SCR_DamageManagerComponent.GetHealthScaled() returns actual health not scaled health
Bruh
Also OnDamage script invoker isnt firing now wut
Guys, I could really use your help understanding something.
I'm coming from an MVC and web dev background, and the game development paradigm is still pretty confusing to me.
I'm not sure how to implement server-client interaction with a REST API in a game context, or which in-game classes I should use for that. I'd be super grateful for any pseudocode or guidance!
Here’s what I’m trying to do:
Simple scenario:
- Player opens a menu
- REST API request is made
- Data is rendered in the UI
More complex scenario:
- Player opens a menu
- They enter some input into fields
- Request is sent to the server (maybe with extra data)
- Server makes a REST API call
- Server sends response back to client
- Data is displayed in the UI
Thanks a lot in advance!
Easy, there is none, client rest api calls from script on pc are only enabled by accident and may be removed at any time in the future. Xbox and PS5 do not have them anyway.
If you must get data to clients you can proxy it from the dedicated server via ingame replication and he can send and recieve data. but this will obviously fail on PC main menu hosted "coop aka listen servers" once the api is removed there.
If your goal is to render whole UI with markup it will be too much data. you must only transmit the info to hydrate the UI with what the server had to say.
However doing this when ever a client opens a UI makes it possible to spam traffic and take down a server easily by accident. This is why generally this approach is not a good idea.
What is your goal you are trying to achieve? What information does your web api have that the client needs?
Hey i cant get my head around a silly problem in enfusion reforger, i want to mod the "DoorUserAction.c" but when i copy paste it with the keyword modded before the class, i cant open doors anymore, nothing else changed...
` modded class SCR_DoorUserAction : DoorUserAction
{
//------------------------------------------------------------------------------------------------
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
{
DoorComponent doorComponent = GetDoorComponent();
if (doorComponent)
{
vector doorOpeningVecWS = pOwnerEntity.VectorToParent(vector.Forward);
if (doorComponent.GetAngleRange() < 0.0)
doorOpeningVecWS = -1.0 * doorOpeningVecWS;
vector userMat[4];
pUserEntity.GetWorldTransform(userMat);
float dotP = vector.Dot(doorOpeningVecWS, userMat[3] - doorComponent.GetDoorPivotPointWS());
// Flip the control value if it is above a threshold
float controlValue = 1.0;
float currentState = doorComponent.GetDoorState();
if ((dotP < 0.0 && currentState <= 0.0) || (dotP > 0.0 && currentState < 0.0))
controlValue = -1.0;
if (Math.AbsFloat(doorComponent.GetControlValue()) > 0.5)
controlValue = 0.0;
//Print(controlValue);
doorComponent.SetActionInstigator(pUserEntity);
doorComponent.SetControlValue(controlValue);
}
super.PerformAction(pOwnerEntity, pUserEntity);
}
//------------------------------------------------------------------------------------------------
override bool CanBePerformedScript(IEntity user)
{
DoorComponent doorComponent = GetDoorComponent();
if (doorComponent)
return true;
return false;
}
}; `
So I had some time to get this going. I did everything but the data only works in the dev. tools. In the main live server, the data doesn't show for some odd reason. Do you have any ideas?
Like more or less, the LVLs aren't displaying. Like in local environment it shows [LVL-1] Username but in my actual live server it just shows my name.
I added some debugs etc. the client is getting the correct level as well but displaying the level is just not working.
Something like live market, for example with filters and so on.
In that case you should likely refresh that data on the server how ever often it makes sense, but not autoreplicate all changes. instead register all people subscribing to the market data and push updates to them via manul rpcs to them as an array of receivers every x time. This also ensure fairness in the game where they all get the same data no matter if they just opened it 1 second before the update or 1 second too late. You can register for live updates via rpc from client to server when opening the menu which can send you the last known info everyone got. alternatively you broadcast the market info to everyone even those do do not have the menu open but only like every 60 seconds or so - really depending on the data sizes.
Also i would only sync full data to clients once on join and from there only send smaller updates.
Needless to say, building such system is expert level scripting for both external service usage and repliciation and UI. nothing you should attempt as first project
Could be everything from simple misused IsServer to race condition that fails in real environment
Is anyone familiar with an efficient way to draw polygons on the map? I'm trying to make a system to visualize territory control by different factions. I've seen some examples using CanvasWidget, but I'm a bit confused by their implementations
I have a good implementation in here. Ignore the InvertPolygon method.
https://github.com/Til-Weimann/tilw-mission-framework/blob/main/scripts/game/CoverMap/TILW_MapShapeComponent.c
It uses an existing CanvasWidget included in Reforger Lobby, but you can just create your own, it's trivial.
Oh awesome! I'll have a look now
Really the only thing you need to read is OnPostFrame(), CreateMapWidget() and some of the class variables.
The main ways to make it efficient are:
- Avoid recreating the draw commands unless it's absolutely required
- Only recalculate draw command vertices if the map was transformed, not every frame
This is a slick implementation, exactly the sort I was looking for
I'll keep that advice in mind. I'm aiming to create a very simple visualization using static areas, so the recalculation of draws should be rare over the course of a game session
It doesn't need to be rare, you can do it many times a second if you like. Just don't do it every frame if there is no reason to.
From a gamemode perspective, you will have to consider how to handle the vertex calculation: Do you calculate the vertices on the server and send them to the clients, or create them on the client based on existing information (or information sent from the server)?
I would go with the second option in your case, that's much easier and probably also less traffic.
Ya, I agree with going for the second option. No real reason to have the server handle the calculations in my use cases
is there an equivalent to GetWorldBounds that works when it's not an ocean map? something for dedicated servers to have the land / terrain bounds in script?
it's gonna be kind of funny if I tell client to send their map size if server doesn't have it
But frame spam is fun
You can get terrain size and offset from the map entity.
I am sure you are referring to creating a system and spreading its workload broadly across frames.
Offset and Size are empty (vector.Zero) on dedicated servers
Offset being zero is expected, but size shouldn't be
I don't think I have checked on dedicated server though
Yes
Causing unnecessary amounts of stress on the server for 0 reason is fun
im being sarcastic
ty. actually, maybe my code was messed up or something glitched out because now it's working, even though I just tested a minute ago
Guys, could you tell me if even though the Arma Reforger server is not officially available for Linux, to run a server the best case considering performance would be Linux or Windows? (If it is Linux I think only with Wine or proton)
server with mod in case
AMD - Linux
Intel - Windows
even having to do a workaround to make it work?
because it is not compatible with linux
I run hundreds of servers in docker on debian, I didn't really need to do anything
Since our machine will be AMD, I will follow your tip, I will install an Ubuntu without GUI
I think it has to be without GUI so as not to limit performance, right?
there are even guid how to setup on linux: https://community.bistudio.com/wiki/Arma_Reforger:Server_Hosting#Linux_Server
Thank you I will refer to this guide when setting up the 1000th server
LOL
not for you for him)
Ty man
What's the best method for updating an objects location among all clients.
Right now I have an RPC to the server, then to all clients that does
drone.SetTransform(transform);
drone.Update();
drone.OnTransformReset();
And this is not updating on clients
Try to make a client authority drone and kind of stumped as of right now
Can you tell me if I install a Debian with GUI, will it limit or drop performance a lot?
or can we say that this is a myth?
Both the server and client are getting the proper RPCs so I have no clue as to why the position isn't updating
I personally don't use a desktop environment. Performance-wise it matters if it is taking resources away from the server. If you have a modern CPU with many cores this is not a big deal until you start running enough servers to use the whole CPU.
[RplProp()]
vector m_dronePos;
void SetNewPos(vector pos)
{
m_dronePos = pos;
Replication.BumpMe();
}
void OnUpdate()
{
...
drone.SetTransform(m_dronePos);
...
}
https://youtu.be/asWxIIHT6d0?list=PLfUcrRpCM_fKjkTrkV-bqnknVbFCPA3YU
https://community.bistudio.com/wiki/Arma_Reforger:Multiplayer_Scripting
This Modding Boot Camp seminar was originally held on the Arma Discord Server on January 23rd, 2025.
In this session, we explore the fundamentals of replication within the Enfusion Engine, highlighting key concepts and common challenges. Through detailed examples and clear...
Or use unreliable channel to update position.
That's what I am currently doing using an unreliable RPC to broadcast the position updates
U dont need broatcast if u use RplProp
Would Replication.BumpMe() be way more intensive on network traffic rather than an unreliable RPC
U cant set data on server from client. U should send info to server by PlayerController and then server should update position and send new one to clients
Excatly what I am doing yes
void SendTransformToServer(vector transform[4], RplId droneId)
{
Rpc(RpcDo_SendTransformToServer, transform, droneId);
}
// === CLIENT → SERVER ===
[RplRpc(RplChannel.Reliable, RplRcver.Server)]
void RpcDo_SendTransformToServer(vector transform[4], RplId droneId)
{
Print("Updating Drone Server");
IEntity drone = RplComponent.Cast(Replication.FindItem(droneId)).GetEntity();
GenericEntity droneEntity = GenericEntity.Cast(drone);
droneEntity.SetTransform(transform);
droneEntity.Update();
droneEntity.OnTransformReset();
ReplicateTransform(transform, droneId);
}
void ReplicateTransform(vector transform[4], RplId droneId)
{
Rpc(RpcDo_ReplicateTransform, transform, droneId);
}
// === SERVER → ALL CLIENTS ===
[RplRpc(RplChannel.Unreliable, RplRcver.Broadcast)]
void RpcDo_ReplicateTransform(vector transform[4], RplId droneId)
{
Print("Updating Drone Client");
IEntity drone = RplComponent.Cast(Replication.FindItem(droneId)).GetEntity();
if (!drone)
return;
if (!SAL_DroneConnectionManager.GetInstance().IsDronePlayers(drone)) // Only apply if not the controller
{
GenericEntity droneEntity = GenericEntity.Cast(drone);
droneEntity.SetTransform(transform);
droneEntity.Update();
droneEntity.OnTransformReset();
}
}
SCR_PlayerController
SendTransformToServer gets called every 100ms in the controller
On the client controlling the drone
What's happening right now is the only player who gets the broadcast is the drone controller for some reason
Like the broadcast is not reaching the other players
buh
I got it
SCR_PlayerController only exists on the client
🤦♂️
That in fact work
btw. RplProp is faster than Rpc. RplProp works directly from engine ( c++ ). Information from boot camp video
Replication.BumpMe() only can be called from the server so you will still need an Rpc and you would already need to go through the player controller at that point
So in short yes
But I don't think that'd work for vehicle networking
you can install a DE and launch it only when you actually need it e.g. about to fire up a remote desktop. That way it would only impact performance when you're actively running it, otherwise server runs headless and DE is only using up some storage space when not running
Thanks for the tip, I think it's the best for me, because there are members of our server who need a GUI to use it.
Can I make a billboard or sign that changes its image every minute?
Render target on a sign and use a imageset
or remap emat
If I have a timer that needs to run on client+server in sync, what would be better?
Server timer + RplProp or somehow sync the client timer start with e.g a unixtime in the future so they start at the same time 🤔
use elapsed time from gamemode, it automatically sync every 10 secs by default
and it count from game mode start
I would sync the time the timer ends and then action resulting in timer end handled by server, client can visualize the timer on their end separately
Bonus points if your client handling of the timer factors in ping
Well the timer doesnt end
When getting all items on a character, is there a way to filter out the slots from the BaseLoadoutClothComponent? Currently getting the vest, plus all the pouches and shit along with it
GetAllRootItems() inside of SCR_InventoryStorageManagerComponent worked 
@high hawk @fervent cedar or just use the vanilla functionality in materials to switch the bcr
Yeah, I was just taking a guess from what I've seen in the past/heard or come across
What about setting it through script from imageset? thatll work though wont it?
Genuine Question as i am gonna attempt it now
There's no point in using a render target for that.
Unless you actually need to for your use case
But yes, images/imageset on a render target will work fine.
ah yeah, but a image in general and just changing the text and updating the display?
If you need dynamic changing text then a render target is the only optimal way.
happenees wwhen lloading said world in the play view mode
Hey guys. Can i learn the enfusion scripting language enforce from Dayz tutorials? I ask cause Dayz has a lot more info about it however i also know theres a difference from a quick Google search. Is it possible?
I mean can the Dayz stuff be used in reforger?
Doubt it. You are not modding enfusion. You are modding Reforger. So your learning should be Reforger-specific.
Damn thats what i thought thanks tho! Do you have any links for good resources to learn this?
As for any programming language, learning the language is usually the easiest step, but not enough. You also have to familiarize yourself with the libraries and code base.
As for your question: https://www.youtube.com/playlist?list=PLfUcrRpCM_fKjkTrkV-bqnknVbFCPA3YU
Will try those out thanks
Also specifically for scripting: https://community.bistudio.com/wiki/Category:Arma_Reforger/Modding/Scripting
Hi, im trying to make a script, that when you want to equip white armband, it wont let u, if u have a weapon in your inventory, same vise versa, if u have a white armband, it wont let you equip weapon.
Any tips and tricks? Im really lost and dont know, how to use Enfusion scripting.
Probably best starting point would be to figure out how the resource component and player's rank affect what items can be equipped in the arsenal and hope that it can easily be expanded with new conditions through overrides.
You definitely learn the language syntax and structure from DayZ.
But there are differences. It would be better to start on Reforger yes
well, it is failing on dedicated. not sure why or if it is an init problem besides being headless. so I just hardcoded the bounds per map
I would say inventory UI red blocking overlay thing, and various Insert / Equip overrides. this is for when u buy the item but equip it in the field later. it's complicated until u know all the storage scripts.
man their pages dont get updated enough, i followed this guide to the letter.. i even tried copy paste the thing and i still get errors :sadface:
is this vector calculation currect? I always get mortar waypoint directly on top of player header.
if(m_eTargetType == IPC_ETargetType.Player)
{
if(!m_targetPlayer)
return;
params.Transform[3] = m_targetPlayer.GetOrigin() + Vector(Math.RandomFloat(0,m_fDisperson), 0, Math.RandomFloat(0,m_fDisperson));
}
Can i write some values in config file in runtime?
You can use SurfaceY() methode to get the terrain ground position.
Like: playerOrigin[1] = surfaceY;
I rewrite the disperson code.
Looks good.
No, but the game rarely uses config files directly, but rather creates instances, which can be modified, but you may have to add a setter through modded.
Anyone know if there is a method to clean a stringtable item? Or would I just load it from the container?
define clean
not dirty
I left you something dirty in dm
is it
or
?
it's mostly
with a bit of 😭
I want it to go from like ##-This-SomehowTranslatesToSudanese_M16 to M16
WidgetManager.Translate or something like that
Do anyone know how to make a weed script where can pick up weed then process it then sell it
Do you care if I DM you? I'll send you what I have via like a hastebin etc. Thanks again!
UI's are always player 'owned' correct? If so, is there a way that the UI can be owner on another entity and I just access it?
UI is always local to where it's displayed
There is no owner because there is no replication
So if I have a UI attached to a storage, how would one controll the storage? Maybe when I perform the useraction on the entity to open the menu?
You control the UI on the machine you display it on
You can synchronize data for your UI via replication
I'm just trying to getitems from a storage into my UI, works fine on workbench obvs, but just didnt know the most effective way to achive it on the server
I'm just spitballing around to myself here but, If I get the storageComponent when I perform my UserAction to open the menu, I could pretty much controll it that way?
Good or no? I need da help
Is there logs somehow from Discord? Wondering if can get AI to sort thru all the questions and answers and compile a nice tutorial
script editor freezing for 5 seconds every time I click it
if i want to take dmg over time by entering a zone, which prefab do i edit?
Damage over time are done by adding derived classes of SCR_DotDamageEffect to the damage manager of the character. So you would either make a trigger or system that adds/terminates the effect when the character enters/exists the zone.
Hello
alright ty
i need more bwainpowah
you're a liar )
in principle you can even write directly to the prefab and it will be saved... I won't think that I'm trolling, I just managed to do everything I needed to before the answer
Is there a way to get the actual terrain height ( y ) when some terrain prefab is build on top of the base terrain?
Speaking about the "ErodedEmbarkment".
When i use SurfaceY it will give me the base terrain height but i need the height of the map with the "ErodedEmbarkment" taken into account so something like ATL from Arma 3 i guess.
With "ErodedEmbarkment":
Without "ErodedEmbarkment":
I know i can do some nasty stuff to get the "ErodedEmbarkment" entity and use entity.GetWorldBounds(worldBoundsMin, worldBoundsMax); to get the actual height but i was looking for a more simple way.
if i change this , it still wont load as the new character?
modded class SCR_EditorManagerEntity
{
protected override void UpdateLimited()
{
}
}
this is related to the scriptinvoker recursive spam that I see before server crashes. if you take code out like this, everyone has GM without doing anything. So I guess another piece of code is wrongly giving out GM, and the original code in this method keeps taking it away, and it just loops for no good reason.
about this nvm figured it out
What is Is Fired From Script" used for in WeaponSlotComponent ?
It tells the weapon slot component if it's fired from script
Jokes aside, afaik there is no way to fire that weapon from script, correct?
Correct
F* it. I'll just duplicate the weapon for the pilot
Whats the newest way to pause the world.
I want to not have it hear the ocean sounds from the default thing it does when you go into play mode, until the player has spawned from the menu.
I can't find my created components in the components list when im inside the world editor and trying to add a component to a character base et
Did you do Build>Validate and Reload Scripts in the script editor?
yes, still not found
Maybe restart the workbench then. Also from which class does your component inherit from?
From what I remember certain components can only be present once on an entity. In that case you would have to switch the existing one by yours.
it's a created class
... just copy and paste here the line that define thes class like class ACE_Medical_CardiovascularSystem : ACE_Medical_BaseSystem
class VitalsComponent : ScriptComponent
class VitalsComponentClass : ScriptComponentClass {}
Hmm, so you still can't find VitalsComponent even after you restarted the workbench?
yep
is there a certain spot beyond the project folder that i need to have this script?
Bruh... They should be inside scripts/Game, otherwise it won't even get compiled 😅
Yes
Maybe, scripts is not capitalized in the base game
i just started learning enforce script and still have hard time understanding..
Why do i get Unknown Type error on this code here:
||_modded class NW_GameMode : SCR_BaseGameMode
{
override void OnInit()
{
super.OnInit();
Print("NW_GameMode initialized", LogLevel.INFO);
}
}||
ok that msg didnt turn out how i wanted.. but the question still stands, thanks in advance
Because you are trying to mod class that doesn't exist
Or _ in front of modded
thats a discord typo, the _
The scripts folders in every mod i've created is capitalized and works without issue.
this
class SCR_BaseGameModeClass: BaseGameModeClass
is taken from SCR_BaseGameMode.c
Isnt it same syntax?
NW_GameMode is not exist, not SCR_BaseGameMode
You can't mod a type that does not exist. ^^
hm alright i thank thee very much
How to send data from client to server correctly? I want open UI on client, press button and update value on server.
There are two videos in the modding bootcamp series about replication and there is also this: https://community.bistudio.com/wiki/Arma_Reforger:Multiplayer_Scripting
... correctly ... open UI ...
im too stupid. i cant find any info on this wiki and 2+ hours of replication boot camp videos how to send action/data to server from opened widget on client without dancing around modding SCR_PlayerController or changing players prefabs?
You don't, because you absolutely need a replicated entity that the local client owns, as otherwise you can't make requests to the server. The easiest approach is by far modding SCR_PlayerController.
Anyone know how to resolve this?
Can't compile "Game" script module! scripts/Game/Campaign/WCS_CampaignNetworkComponent.c(70): Can't find variable 'm_vLastUnloadedAt' PROFILING : Script validation took: 1265.627700 ms
I am getting Game Script errors for both Enfusion and while trying to play on a modded server
it can be weird but it cant find variable i think 
Check **m_vLastUnloadedAt **in WCS_CampaignNetworkComponent.c file
Update or remove the mod causing it
void OnKilled()
{
StopWhisperLoop();
IEntity self = GetOwner();
GetGame().GetCallqueue().CallLater(() => {
GetGame().GetWorld().DeleteEntity(self);
}, 500);
}
what did i do wrong?
I don't think JS style anonymous "fat arrow" function expressions are a thing in Enforce Script. Try passing a reference to a method to CallLater
Would be really nice if we could have first class functions though
And just nicer patterns for callbacks/async operations in general
Delete entity that calls deleting function - is not best code architecture.
Well I'm just starting, so trying to do something. I'm working with little information
- Create clean up manager, like component for gameMode "MYMOD_CleanUpManagerComponent"
- Subscribe to entity death by ScriptInvoker
- Get callback that entity is dead and mark it for delete
- Delete entity on next frame/tick from "MYMOD_CleanUpManagerComponent"
or you can use another way:
class MYMOD_TestEntity: IEntity
{
void OnKilled()
{
MYMOD_CleanupManagerComponent comp = MYMOD_CleanupManagerComponent.Cast(GetGame().GetGameMode().FindComponent(MYMOD_CleanupManagerComponent));
if (comp)
{
comp.KillMeBaby(this);
}
}
}
class MYMOD_CleanupManagerComponentClass: ScriptComponentClass
{
};
class MYMOD_CleanupManagerComponent: ScriptComponent
{
private ref array<MYMOD_TestEntity> m_deadEntArr = new array<MYMOD_TestEntity>();
void KillMeBaby(MYMOD_TestEntity ent)
{
m_deadEntArr.Insert(ent);
}
protected override protected void EOnInit(IEntity owner)
{
if (!SCR_Global.IsEditMode())
{
GetGame().GetCallqueue().CallLater(OnUpdate, 1000, true);
}
}
protected void OnUpdate()
{
foreach(MYMOD_TestEntity ent: m_deadEntArr)
{
if (ent && !ent.IsDeleted())
{
SCR_EntityHelper.DeleteEntityAndChildren(ent);
}
}
m_deadEntArr.Clear();
}
} ```
Looking for some guidance - I’m trying to build a mission where players need to find intel to reveal hidden destructible objects (caches, mortars, etc), they need to find multiple pieces of intel to reveal all of the objects.
Objects will be placed in the world with a component in the world editor. My plan was to register the entities with the component somewhere in an array so i can loop over them, delete random ones, reveal random ones, etc.
Through the process I’ve learned about and tried building my own game mode, game systems that get registered via config, a standalone class, and conceptually learning about managers (like factionmanager, but i haven’t tried building anything yet for this).
I think i’m not sure about the best approach for building this out. I had a fully functioning prototype using my own class that doesn’t inherit from anything but i ran into some issues when I needed some replication. Also had some success with making a game system to store all of the methods and variables. Conceptually it feels like a new “game mode” but i’m not sure if game modes are meant for registering entities from components and doing stuff to them via script.
I think i’m just not sure what approach to take. Are there any guidelines kicking around for when to use a standalone custom class vs a custom gamemode vs a gamesystem vs a manager? does it matter? (this is my first reforger mod btw so i'm battling SQF brain a little bit)
use **ActionsManagerComponent **and "Additional action" field to add own action (MYMOD_CheckDocumentAction)
class MYMOD_GameMode: SCR_BaseGameModeClass
{
};
class MYMOD_GameMode: SCR_BaseGameMode
{
[Attribute(defvalue: 0)]
int m_piecesLimit;
[RplProp()]
protected int m_findedPieces = 0;
void FindNewPiece()
{
m_findedPieces = Math.Clam(m_findedPieces + 1, 0, m_piecesLimit);
Replication.BumpMe();
if (m_findedPieces >= m_piecesLimit)
{
OpenHidenCache();
}
}
protected void OpenHidenCache()
{
if (Replication.IsServer())
{
RpcBroad_OpenHidenCache();
Rcp(RpcBroad_OpenHidenCache);
}
}
[RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
protected RpcBroad_OpenHidenCache()
{
// show hidden treasures here
}
}
class MYMOD_CheckDocumentAction: ScriptedUserAction
{
override event void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
{
MYMOD_GameMode gameMode = MYMOD_GameMode.Cast(GetGame().GetGameMode());
if (!gameMode)
{
return;
}
gameMode.FindNewPiece();
}
override event bool CanBePerformedScript(IEntity user)
{
// place access check here
return super.CanBePerformedScript(user);
}
override event bool CanBeShownScript(IEntity user)
{
// place show action check here
return super.CanBeShownScript(user);
}
}
As example u can use that prefab to add own action
https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~ArmaReforger:Prefabs/Items/Misc/IntelligenceFolder_E_01/IntelligenceFolder_E_01.et
Thanks for the example, I should have specified I already got the intel folder working with a scripteduseraction, it reveals a random number of destructibles by placing markers on the map, and also have destruction working where it deletes the entity and removes it from the array of caches/destructibles onDestroy.
I’m more wondering if there’s a best practice for building out the main part of the code, does it make sense for it to be a new game mode that inherits from basegamemode, should I use a system that inherits from gamesystem, that kind of thing, what are the pitfalls of one approach over the other, etc. Maybe it doesn't really matter?
If u can make all with standard tools and you are satisfied then use standard tools.
Own game mode class or own component is better than modded game mode class as for me.
modded classes is last stand if you dont have another normal way. If your mission is small then dont worry but if you want to scale then use own classes.
Anyone know how I could troubleshoot this?
RplSchedulerError: Generated task provided id of removed or never registered item!
How i can clear cache for prefab/resource? What i need, a add some value to Prefab in runtime by BaseContainerTools, but in game i can't use new item...
For example is BaseLoadoutManagerComponent have a "Slots". i need add LoadoutSlotInfo with custom LoadAreaType, but it's not flushed when my character spawned
you can check "blackheart_six" (Arma Reforger Scenario Framework) channel on YT with videos about Scenario Framework. Who knows, maybe Scenario Framework will have enough for yours missions
Is there a methode to check which world is used?
Something like: if(world == "Eden")
@torn bane sorry for tag, but mb u know some about this problem... 😕
that's where i started but placing everything manually and keeping track of all of the activation actions and needing to connect things with layer/slot names was getting pretty tedious
you can try to use
GetGame().GetWorldFile()
Thanks. 👍
it sounds like your best option is implementing it as a system, look at other systems for examples but they provide patterns for things like registering connected entities/components, processing updates at a given tickrate etc
You can't edit prefabs at runtime. I think you could manipulate the entity source but that will also change all other instances. I don't fully remember the finer details. I just know neither is recommended
What's about entity source? I need manipulate all Instances) Add some data to all instances)
Recomendation is so bored... I got the Any type for the Json Serializer, although this is also not very recommended, and everyone writes repeated code in the form of WriteContext or something like that...
But it's fun to play around with the engine's capabilities)
The amount of boilerplate I have to write is crazy
I could solve it if I could do basic things like pass methods as parameters
Or use out void
But no, we want to make a powerful scripting language but we're not gonna give you basic things
One of the reasons why I wrote a lib for the Json Serializer Any type
powerful scripting language
not gonna give you basic things
where is my threads? 😭
The funniest thing is that even from compiled code, an infinity crash from tools can occur.
Usually I just make rest calls to an API that runs things on multiple threads and returns data back by connecting to the server and running rcon commands
The best solution)
The problem is that everything in this game has some sort of problem, and rcon connections randomly take 5 seconds to return the logged in packet
unfortunately it will require too many code and time on enforce side for serializing, waiting and deserializing answer...
and you can't easily access game data by this approach
thats why I send the output one array item per rcon command
Sorry for butting in, I may not have encountered this yet, but not counting time, what is meant by "a lot of code for serialization and deserialization", are u talking about writing and reading from context?
I'm talking about serializing and deserializing data to sent/receive in string format, you can't directly access to memory of game
the biggest PITA is custom types serialization for network. you practically have to copy/paste logically the very same block of code 4 times, and count all bytes manually on top of it. extremely tedious and error prone.
if I understood correctly, we are talking about approximately this possibility -
TestClass testObj = new TestClass;
SConverter.ReadObject(json, testObj);
string outJson;
SConverter.WriteObject(outJson, testObj);
??
not to mention lack of any form of exception handling. it's 2025, not the cold war.
yes, but not only about this
What I wrote above is possible with primitive wrappers, but what else is the usual problem?
In script it is
We would be better off with JDSL
what I wrote
Real code in enforce? so you just hide enforce loops and functions behind few line of enforce?
Yeah, use like usual dto in server side app.
class TestDto: Dto {
ref SString stringParam = new SString();
ref Int intParam = new Int();
ref Float floatParam = new Float();
ref Boolean boolParam = new Boolean();
ref JsonMap<ref SString> mapParam = new JsonMap<ref SString>();
ref JsonMap<ref DomTestDto> mapParamObj = new JsonMap<ref DomTestDto>();
ref Array<ref SString> arrayParam = new Array<ref SString>();
ref Array<ref DomTestDto> arrayParamObj = new Array<ref DomTestDto>();
ref SubTestDto subTestParam = new SubTestDto();
}
class SubTestDto: Dto {
ref SString stringParam = new SString();
ref DomTestDto domTestParam = new DomTestDto();
}
class DomTestDto: Dto {
ref SString stringParam = new SString();
}
with what is written above
unfortunately I have to use inheritance
well and additional methods that remove wrapping values in the string
so you solve only one problem - writing many code, but more things left - you are doing this in single-threaded blocking language
so you still need to write many code for waiting and you consume resources on changing format of data, instead of directly working on it
yes, this is already a really big problem) I was already thinking whether it would be worth doing reverse engineering to exchange data between my application and the server.
I agree, but personally I hate duplicating, so I choose happiness, at least a little bit
Has anyone encountered the issue of writing data to a component of an existing entity at runtime?
Like BaseLoadoutManagerComponent "Slots"
I can't add some value inside. Although it may be added, it does not work as it should in the mission... that is, even BaseContainer is added, but it does not affect the game
you need to change data on actual instances
BaseContainers and etc is just a holders for "setup" them
I do this using BaseContainerTools.WriteToInstance
right on creation
in EOnInit method of Chimera
eoninit - is already very far from setup from "config"
But if we are talking about writing to existing entities, I thought WriteToInstance would save me?
just change real instances - components or entites or whatever it is
Didn't quite get it? I just didn't find any methods to change it except BaseContainerTools... And it doesn't save in runtime
and by the way, can I get access to what's happening before the configuration, before OnGameStart in GameMode?
what are you trying to do?
two options,
-
I'm trying to write an additional slot to the Chimera prefab in the BaseLoadoutManager component... Which is successfully written, but because this prefab doesn't work.
-
I'm trying to write an additional slot to the BaseLoadoutManager component in runtime directly to the existing instance, but why doesn't this work either
don't piss on me, these are tests
ref Resource resourceCharacterBase = Resource.Load(CHARACTER_BASE);
IEntityComponentSource componentSource = SCR_BaseContainerTools.FindComponentSource(resourceCharacterBase, BaseLoadoutManagerComponent);
ref BaseContainerList slots = componentSource.SetObjectArray("Slots");
ref LoadoutSlotInfo loadoutSlotInfo = new LoadoutSlotInfo();
ref Resource loadoutSlotContainerHandler = BaseContainerTools.CreateContainerFromInstance(loadoutSlotInfo);
ref Resource loadoutAreaTypeHandler = BaseContainerTools.CreateContainerFromInstance(loadoutAreaType);
BaseContainer containerSlotInfo = loadoutSlotContainerHandler.GetResource();
containerSlotInfo.SetName(typename.EnumToString(SD_ELoadoutArea, loadoutAreaType.m_Type));
BaseContainer containerLoadoutAreaType = loadoutAreaTypeHandler.GetResource();
containerSlotInfo.SetObject("AreaType", containerLoadoutAreaType);
SD_ELoadoutArea type;
BaseContainer cont = slots.Get(8);
if(cont != null) {
slots.Remove(cont);
cont.GetObject("AreaType").Get("m_Type", type);
if(type != loadoutAreaType.m_Type) {
slots.Insert(containerSlotInfo);
}
} else {
slots.Insert(containerSlotInfo);
}
ref Resource resourceCharacterBase = Resource.Load(CHARACTER_BASE);
IEntityComponentSource componentSource = SCR_BaseContainerTools.FindComponentSource(resourceCharacterBase, BaseLoadoutManagerComponent);
ref BaseLoadoutManagerComponent comp = BaseLoadoutManagerComponent.Cast(FindComponent(BaseLoadoutManagerComponent));
ref SD_EmptyBaseContainer sdContainer = new SD_EmptyBaseContainer();
ref Resource sdEmptyContRsc = BaseContainerTools.CreateContainerFromInstance(sdContainer);
BaseContainer newContainer = sdEmptyContRsc.GetResource();
ref BaseContainerList slots = newContainer.SetObjectArray("Slots");
ref SD_LoadoutAreaType loadoutAreaType = new SD_LoadoutAreaType(SD_ELoadoutArea.MASK);
ref LoadoutSlotInfo loadoutSlotInfo = new LoadoutSlotInfo();
ref Resource loadoutSlotContainerHandler = BaseContainerTools.CreateContainerFromInstance(loadoutSlotInfo);
ref Resource loadoutAreaTypeHandler = BaseContainerTools.CreateContainerFromInstance(loadoutAreaType);
BaseContainer containerSlotInfo = loadoutSlotContainerHandler.GetResource();
containerSlotInfo.SetName(typename.EnumToString(SD_ELoadoutArea, loadoutAreaType.m_Type));
BaseContainer containerLoadoutAreaType = loadoutAreaTypeHandler.GetResource();
containerSlotInfo.SetObject("AreaType", containerLoadoutAreaType);
slots.Insert(containerSlotInfo);
I'm trying to do the second option with a full cleanup for now, for now... p.s. it doesn't work at all
First option is code for OnGameStart in gamemode
second is EOnInit in SCR_ChimeraAgent
thx, 1 sec
and looks like it is not a real problem (looks like Y in XY problem)
it has a constructor in Entity and since it is a modded class I can't override it
either I don't understand something...
scripts/Game/GameMode/SD_BaseGameMode.c(10): error: Overloaded function 'SCR_ChimeraCharacter' not compatible
I have a desire to move all the management to my server part, that's why I'm trying...
just copy paste constructor arguments from component or entity class
there are in genericcomponent and ientity as I remember
for what? giving inventory items?
for everything, taking into account the high-level server settings, for example, adding a slot through the admin panel, I can write it into the config for the UI, but I can’t write it into the component...
I didn't understand it right away, but the option via the component constructor doesn't exist yet...
why just not create slot in prefab and just allow/disallow to place items into it?
I wanted to transfer the slot management directly to the admin panel, since UI management is possible by saving conf when starting the game... I thought it would be interesting to add the ability to manage slots through the admin panel, so as not to touch the mission at all, and configure on the fly.
There was a desire to exclude any slot from the game if necessary, easily by pressing a button, or by restarting...
I still really don't like touching anything in mods since Dayz, it's better that they are as abstract as possible
Understand, my soul is dead after Dayz. although I didn't mess around with it for very long...
it would be interested
I just can't imagine where you need to remove/adding slot for vest or helmet completely on the fly, and why you just can't add some logic on top of it to just allow/disallow players to use this slot
Not helmet or vest, it's for addable slot's
addable? 1,2,3,...?
I try not to touch vanilla working and non-useless lines of code... 😅
i mean you are about this?
no no, im about
this will be the #infinity stage (i don't know when)
then just create your own inventory manager
and don't f*ck vanilla)
it would be interesting, but I couldn't find where these very slots for rendering are processed
in engine
and how can I do this then if BaseLoadoutManager is Generic, I can't even inherit 😦
but you can start with simple your own component with array of items
add you logic for adding/removing slots
add UI and etc
ah... you mean completely from scratch, taking into account rendering...
yes
Ok, I'll think about how much I want to get fucked up) It's a pity that vanilla is so crude...
Thank's for all the tips 😄
Context can already handle any type, nested ones too and also read polymorphisms back
SCRIPT (E): @"Scripts/Game/UI/Menus/MainMenu/A4L_MainMenuScreenContent.c,27": Undefined function 'ArmaReforgerScripted.RequestExit'
Does anybody know another way to clear this dumb error that gets stuck in cache besides uninstalling reforger tools and deleting the workbench folder in My Games folder then reinstalling tools?
U are trying to say that "A4L_MainMenuScreenContent.c" doesnt have "ArmaReforgerScripted.RequestExit" code on line 27 in yours project?
Yes and if I do the procedure I described it compiles. But it has a reference somewhere deep inside of there I don't know that once it references it and sees that then it does it permanently again until I do that procedure.
Chat GPT suggested it was the new get exit function or whatever it is called still has some kind of reference to the old reforger scripted thing. But I'm not sure if that's accurate.
vanilla "ArmaReforgerScripted" doesnt have "RequestExit" function.
ChatGPT and Copilot are stupid with enfusion scripts - they used found modded function as vanilla
Are u use mods in yours project?
Yeah we have a few. Probably get rid of most of them
And it's a triple mod structure r. Right now. Gameplay, core, and UI
That is mods problem can be. Be caful with mods order in dependency.
So I have to find what mod that function comes from?
Try to find is that function exist in your project : use "entire solution" in search options
Awesome thank you very much.
Yeah, but i can't write some code for spawn primitive type's, and it's a big problem when u working with auto serializer... I need wrapers for normal serializing like ->
class TestDto: Dto {
SString someValue = new SString();
}
The only one is in this script, but it's GetGame().RequestExit();
nothing about reforgerscripted
GetGame() returns "ArmaReforgerScripted" class
But sometimes it compiles..
Is there a better way you know of?
I'm using GameComponent workflow
it cants compile if u use uncreated function.
You have mods issue i think. Check connected mods and mods dependency for that function
Idk when the base explosion prefabs stopped actually making sound but what's the new method to explode an object and make it have a sound when it actually does it
It will automatically restore the previous value on read. You can also selectively implement the serialise magic callback method on ta a class to decide how to handle specifics but leave the rest of the serialisation if nested objects automatically.
Getting this spammed only on a dedicated server
This works in single player I am so confused
Literally just a duplice of the medium tnt explosion with sounds
[RplRpc(RplChannel.Reliable, RplRcver.Server)]
void RpcDo_SendTransformToServer(SAL_DroneNetworkPacket packet)
{
if (!Replication.FindItem(packet.GetDrone()))
return;
IEntity drone = RplComponent.Cast(Replication.FindItem(packet.GetDrone())).GetEntity();
vector transform[4];
packet.GetTransform(transform);
if (packet.GetIsTriggered())
{
EntitySpawnParams params = new EntitySpawnParams();
params.Transform = transform;
GetGame().SpawnEntityPrefab(Resource.Load(packet.GetExplosion()), GetWorld(), params);
SAL_DroneConnectionManager.GetInstance().ExplodeDrone(packet);
//SCR_EntityHelper.DeleteEntityAndChildren(drone);
return;
}
void ExplodeDrone(SAL_DroneNetworkPacket packet)
{
Rpc(RpcDo_ExplodeDrone, packet);
}
[RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
void RpcDo_ExplodeDrone(SAL_DroneNetworkPacket packet)
{
vector transform[4];
packet.GetTransform(transform);
EntitySpawnParams params = new EntitySpawnParams();
params.Transform = transform;
GetGame().SpawnEntityPrefab(Resource.Load(packet.GetExplosion()), GetGame().GetWorld(), params);
}
anything on RequestScenarioChangeTransition causing JIP errors being addressed? Been a thing since 1.3 dropped and is singlehandedly killing our community.
Forced restarts for 30min games instead of flowing into the next round really turns people off.
You can safely ignore this. This just shows up when you enter GM as admin in a non-Game-Master game mode.
ah okay
so where would i ask around here to get a GM scenario setup for a map so i can publish it? Or does it automatically come with a GM scenario? If that didnt make sense i mean whenever you load a map and it gives you the choice of GM or conflict
If you want a GM scenario for a new terrain, you gonna have to create one. Create a new world that uses the terrain as parent scene. You can then use the Game Mode Setup plugin in the world editor to get the required entities placed for you.
w h a t
im very new to this so that made little to no sense to me
well i figured it out and i thank you for your help
but is it supposed to get stuck on a loading screen?
I'd like to detect if a patrol that was spawned from a AmbientPatrolSpawnpoint has been eliminated or anything like that. Where can i hook into to monitor that? or is there an event that is triggered?
where can i find a list of reforger action names, sorry im new. im making a custom field manual, and i need the list of action names for displaying keybinds in instructions
wait nvm that wasnt it
im trying to find out what goes here for a custom field manual:
if i wanted to show the keybind for reloading your weapon
Ahaha. If u will find that information, then share it with me too
Damnit, i found 2 so far, but just in examples from scripting tutorials
characterReload, and characterFire
i tried to find same information when wrote vehicle blocking, then i gave up and wrote code that print current actions in logs
i might have to do the same
its crazy the wiki doesnt have a list of standard vanilla actions
yep. this is reality of enfusion scripting 
I sort of found it
This file contains a list of every vanilla keybind and the cooresponding action name
its all in there, just down a couple clicks per item
example, this is the action name for opening the radio channel menu:
i came to you for help, but i hope i helped you instead
yes. Thx. This is good information for me too.
17:58:12.773 RPL : ClientImpl event: connected (identity=0x00000000)
17:58:12.773 NETWORK (V): RplSession::RplStartupEvent: Started
17:58:12.783 RPL : rpl::Pip::ProcessGameToNet
17:58:12.783 NETWORK (V): RplConnection::Rpc_Validation_S sent
17:58:12.875 RPL : ClientImpl event: disconnected (identity=0x00000000), group=4, reason=2
17:58:12.875 NETWORK (V): RplSession::RplRuntimeEvent: Error
17:58:12.875 NETWORK (V): RplSession::RplRuntimeEvent: Disconnect
17:58:12.875 NETWORK (V): RplSession::Terminate
I cannot get peer tool to launch..
any help much appreciated
Does anyone know how I can track which patrol spawned from which ambient spawn? in script
I was wondering if someone could help me with scripting for a new faction, I have looked through every photo and explaintion I could find but I am still struggling, I currently cannot compile and reload my files due to a syntax error but have no idea how to fix this.
If it is truly just a syntax error, copy your script and paste it into ChatGPT, it knows C# and Enforce Script syntax, so it will be able to tell you where you have an improperly closed method etc. If its not actually a syntax error, it may be able to help you, but you will likely have to figure the bulk of it out on your own, using GPT as a guiderail, kinda.
Unfortunately no avail, I've done everything other guides do but it just doesn't like working.
DM me the script, I can take a look, but no promises. Im not a genius lol
Sent
he is there any eventhandler in enfusion that i can use without writing a completly new system? Like i want to get points when i kill a other character entity?
don't use Chat GPT, if you do yu'll be all messed up, Arma dont use C++, it uses ArmA Scripting
Enforce script language*
In most cases you need to know how to script to even instruct gpt properly
I've got my custom gpt trained pretty good for 1.4+ compliance.
Took some doing though for sure.
the guys in Disacord are my Chat GPT 🙂
Welp, if no one is answering we only have Chad GPT left as option...
if i wanted to create an ai, what's some of the things i would first do?
watch this bootcamp, gets you into the fundamentals of modding
https://www.youtube.com/watch?v=Fgl_mAHReP4&list=PLfUcrRpCM_fKjkTrkV-bqnknVbFCPA3YU
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...
they have some video courses on AI
Is there a way to disable ESC exiting the game inside of Reforger Tools? With the new bug I can't get out of the arsenal lol
rebind it to Shift Esc in workbench options
Thank you!
how can I access the patrol entities from a custom component in the ConflictMilitaryBase?
Depending on the setup, if you have your custom component on the main (parent entity) you could loop through the children and build a collection of child entities that have a unique component specific to Patrol_1 / Patrol_2 like so
array<IEntity> childrenWithUniqueComponent();
IEntity child = GetOwner().GetChildren();
while(child) {
if (child != GetOwner()) {
if (child.FindComponent(SomeUniqueComponentOnPatrol_1))
childrenWithUniqueComponent.Insert(child);
}
child = child.GetSibling();
}
foreach (IEntity patrol : childrenWithUniqueComponent) {
// do some stuff here
}
Another way is you can have a unique component on those patrol entities that will register them self to your component on the parent. Quite a few ways to do this just depends what all you're doing and what you want to achieve.
I’m working on some base building HQ spawn logic using the command HQ prefab E_Headquarters_S_US_01.et and inside it, the RestrictedDeployableSpawnPoint_HQ.et is placed as part of the prefab. This setup works and the base can be built and placed.
However, after a server restart, the RestrictedDeployableSpawnPoint_HQ.et doesn’t show up on the map or act like a proper spawn point. Also, immediately after initial placement, it doesn’t show either.
The only way to make it show up and function correctly is to manually switch its faction affiliation from US to USSR and then back to US.
Does anyone know why this happens or how to make the faction affiliation persistent and automatic on initial placement and after restarts?
have no idea where to even ask for smth like this
Thank you very much for taking the time to respond to my issue, I really have been struggling to get this to work. This code is similar to the code that I wrote but it never goes into the while loop. Attached screenshots are from a sample project that I've set up. My original code was like this but yields the same result:
override void OnPostInit(IEntity owner)
{
super.OnPostInit(owner);
Print("TestComponent: getting children");
IEntity child = owner.GetChildren();
while (child)
{
Print("TestComponent: child" + child);
}
}

that's one way to stall workbench if it did work.. First.. don't leave a while loop going like that... secondly you'd want to do that type of code well after things initialized so in EOnInit so something like this but you may have to get the children in a later cycle (delay it). OnPostInit will trigger the moment it starts initializing where as EOnInit executes once the entity and its components fully initialize or something like that. Not sure on child entities though which is why I said you may need to delay it.
override void EOnInit(IEntity owner)
{
m_Base = owner;
IEntity child = owner.GetChildren(); // Gets first child
while(child) {
Print("Child entity: " + child);
child = child.GetSibling(); // Gets next child (if there is none it will become null thus exiting the loop)
}
}
override void OnPostInit(IEntity owner)
{
super.OnPostInit(owner);
SetEventMask(owner, EntityEvent.INIT);
}
Thank you so much for teaching me this. I've been trying for almost two days to get my head around it. It did cross my mind that it was a lifecycle and retrieval issue, but still, I hooked into the wrong methods.
If I have a custom class array with RplProp(), it only replicates changed instances cause of PropCompare(), right? So I can Replication.BumpMe() without always replicating the whole array?
can someone explain to me about the GUID and where to retrieve? im a total noob and this
depending on the screen but usually right click the entity
gives the option to copy the guid
only specific files has this?
It replicates whole array
Always
If you have an array of 100 objects. Each of 100 bytes. And if 1 bit of those 100,000 bytes changes then everything is sent and the array along all of its contents gets destroyed and individually created every time it is replicated on the clients.
Avoid array of large data.
Use rpc instead.
Or a custom object as container (codec for this might be more expensive performance wise than just doing rpcs)
I see, my array is not that large but I guess rpc is the way then. Thanks 
Plus OnRplLoad/OnRplSave for handling JIPs or you still make it a RplProp, but never call BumpMe.
{
override void OnActivate(IEntity ent)
{
if (!ent)
return;
IEntity teleportTarget = GetGame().GetWorld().FindEntityByName("teleport_01");
if (!teleportTarget)
return;
vector destination = teleportTarget.GetOrigin();
ent.SetOrigin(destination);
}
};```
Is there a way I can add a fade in/out to this teleport script like we used to be able to with Arma 3?
hey need some help i want to register a function for a ScriptInvoker.
Thats my min. example:
...
` ref ScriptInvoker sample = new ScriptInvoker();
void RegisterSample(void callback) {
sample.Insert(callback);
}`
Thats my error:
scripts/Game/ExperienceSystem/sample.c(41): error: Can't make callback from unknown method 'callback'
Can i make a methode to register a methode or is this just not possible?
Have i do it the opposite way? To call the .Insert on the class where i want to insert the methode?
Yes, there is SCR_FadeInOutEffect. Have a look at SCR_FastTravelComponent if you want to see how it is used.
Keep in mind that you will also have to make a method on the player controller or on a component for doing owner RPC for MP.
Same goes for SetOrigin, as from I remember, it also has to be called on the owner.
Or call SCR_EditableEntityComponent::SetTransform on the server, which does the RPC for you.
Is there a way to check if an entity is loadtime or runtime?
On rplcomponent there's an override setting that's none or runtime. Not sure how to get it through code but I'm sure you can
why are you need this?
If you just want to know whether EOnInit gets called at loadtime or runtime for an entity, you can use Replication::Loadtime inside.
Got it, i believe this should work.
We use this for our modules to distinguish the case where GM places it or that it go placed in the world editor.
I want to disable display/perform of my custom action on a prop if it was spawned at runtime
yes, exactly what i need
though thinking of it now i might have a bigger issue with runtime spawned objects still having my component... duh
just fix action, or create your-own prefab and spawn it when you need this action
I'm overriding terrain props, i don't need anything to be spawned at runtime
How do i get proper world size? For example Everon is 12800x12800.
If i do this: GetGame().GetWorldEntity().GetWorldBounds(min, max); float widthX = (max[0] - min[0]); float widthZ = (max[2] - min[2]);
I get 14443.8 x 12900??? Why do the map /cords show 12800?
My goal is to get max x,z cord to i can select a valid point in the world position from 0-12800
GetGame().GetMapManager().Size()
Is there anyone here that would be willing to give some time to teach scripting for Fixed wing models? Already have the models built just need to import them with scripts to Reforger tools. DM my self if you are able can discuss further in DM's
Is there anyway to tell when a group is created? and by whom?
Would make our life easier to ban people with bad group names
trying to create my own custom notifications, https://community.bistudio.com/wiki/Arma_Reforger:Notification_Creation says to open ENotification enum and add your entry but when i do that the file is locked. Workbench won't let me override it, only duplicate and it remains locked after duplication. is there a way to add my own entries to the enum?
nm seems to work if i create my own file named something else and mod the class
Trying to get ResourceName from a prefab but the GUID is coming back as @"{0000000000000000}Prefabs/...
//------------------------------------------------------------------------------------------------
static ResourceName RoleToResource(CRF_EGearRole roleInt, FactionKey faction)
{
Resource resource = Resource.Load("Prefabs/Characters/Factions/" + faction + "/CRF_GS_" + faction + RoleToString(roleInt) + ".et");
return resource.GetResource().GetResourceName();
}
In the workbench I get the error:
SCRIPT : GetResourceName 'scripts/Game/Systems/Core/Containers & Configs/CRF_Enums.c,153'
RESOURCES (E): Wrong GUID for resource @"{0000000000000000}Prefabs/Characters/Factions/BLUFOR/CRF_GS_BLUFOR_PSG_P.et" in property "@s00"
but I Print the return It does give me the correct output
{6BB714F2C0835B67}Prefabs/Characters/Factions/BLUFOR/CRF_GS_BLUFOR_PSG_P.et```
On the dedicated server tool it returns the 0s. So very lost on whats going on, any ideas?
Or is this just not possible at runtime?
Can anybody tell me if this is all correct? Or if you have any suggestions for additions. It's for 1.4+ compliance

dont forget to call Update after SetOrigin
You are trying to get resource by resource name to take resource name from it
use code to check is resource loadedif (resource && resource.IsValid())
SCR_PlayerControllerGroupComponent::RequestSetCustomGroupName```
or
```GroupSettingsDialogUI::OnConfirm```
i know this but it doesnt helped for my question, the example are the other way around. There it inserted the func in the same class, but i want to give a func as argument for another class
We are not allowed to pass functions as parameters, only bohemia scripts can
ok thanks 🙂
Here's a script that I have to detect magazine size. The goal is to call it using an animation even node. The problem? It's never calling the script. I've tried a bunch of logging at different areas, none of them show up in the logs. What could be causing the magazine animation events to not run?
` override event protected void OnAnimationEvent(AnimationEventID animEventType, AnimationEventID animUserString, int intParam, float timeFromStart, float timeToEnd)
{
super.OnAnimationEvent(animEventType, animUserString, intParam, timeFromStart, timeToEnd);
if (animEventType == m_iMagazineDetachEvent)
PerformTacticalReloading();
// ────────── NEW: current‑mag check ──────────
if (animEventType == m_evtMagCurrentCheck)
{
int max = 0;
if (m_weaponComponent)
{
MagazineComponent mag = MagazineComponent.Cast(m_weaponComponent.GetCurrentMagazine());
if (mag) max = mag.GetMaxAmmoCount();
}
SetIntVariable(m_curMagMaxVar, max);
//SetPlayerInt("CurrentMagMax", max);
}
// ────────── NEW: next‑mag check ──────────
if (animEventType == m_evtMagNextCheck)
{
int max = 0;
MagazineComponent nextMag = FindNextMagazine();
if (nextMag) max = nextMag.GetMaxAmmoCount();
SetIntVariable(m_nextMagMaxVar, max);
//SetPlayerInt("NextMagMax", max);
}
}`
Hey guys, was trying to send a message into the chat when a player spawns. I cannot find in the docu how to do so or if its possible. I want that a msg ist sent each hour but to all players. I found this code but its just sending from the players chat: PlayerController pc = GetGame().GetPlayerController();
SCR_ChatComponent chatComponent = SCR_ChatComponent.Cast(pc.FindComponent(SCR_ChatComponent));
chatComponent.SendMessage("Hello", 1);
u can try to use notification, not chat
https://community.bistudio.com/wiki/Arma_Reforger:Notification_Creation
where do u use "OnAnimationEvent" function? what class?
OnAnimationEvent is under a modified WeaponAnimationComponent. Its checks for when an animation type in the animation graph is the same to do something. The problem is that it isn't even doing anything when the animation graph gets to the event, which is MagCurrentCheck in the graph.
WeaponAnimationComponent doesnt have OnAnimationEvent. U cant override it.
Is there any way to set another players profile image in a ProfileImageWidget or is that always my own?
My script is based on a colleagues script where he achieved this in a different way. I'm trying to make a universal version, I can post his script if it would help you understand how it all works. His is made for a thompson specifically though
You can check SCR_DetonatorGadgetComponent as example
charController.GetOnAnimationEvent().Insert(OnAnimationEvent);
charController.m_OnItemUseEndedInvoker.Insert(OnAnimationEnded);```
Here's the reference script, the purpose is so that the it detects what size of the magazine so that if you have one drum magazine and one stick magazine, you play two different animations:
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
This 100% works for his thompson mod. I'm trying to simplify it to where there are two functions, one that returns the current magazine max, and the next magazine max. So it can work for all guns based on common magazine sizes (like an m4 30rnd vs 100rnd).
he use custom component based on WeaponAnimationComponent. You should add own component to weapon prefab.
I do as well
did you disable original WeaponAnimationComponent ?
On the weapon? yes, it was swapped out for the new one. I'm uploading my script here one sec.
This is my script, it is doing far more than just this magazine function like ironsights flipping and moving muzzle devices based on barrel length, that stuff is working just fine.
Line 87 is where it starts
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Oh its. my fail. WeaponAnimationComponent has OnAnimationEvent 
What's weird is that none of the animation graph runs. I connected it up to the default reload path in the graph editor just to test it. It even with just basic logging it doesn't pop.
i have not problem with calling OnAnimationEvent on reload
{
}
class TEST_WeaponAnimationComponent : WeaponAnimationComponent
{
override event void OnAnimationEvent(AnimationEventID animEventType, AnimationEventID animUserString, int intParam, float timeFromStart, float timeToEnd)
{
super.OnAnimationEvent(animEventType, animUserString, intParam, timeFromStart, timeToEnd);
PrintFormat("OnAnimationEvent %1 %2 %3 %4 %5", animEventType, animUserString, intParam, timeFromStart, timeToEnd);
}
}```
Now define an animation event and add it to the graph so that it is specifically checked when the event node is hit.
ill try it and write if i find smf
Thank you
sorry another question, i got a user script on the Scr_BaseGameMode (Named the prefab GameMode_MM_Test) i want to reference the "GameMode_MM_Test_Class"
in
MM_LootSpawnPointManager lootSpawnPointManager = SCR_BaseGameMode.Cast(GetGame().GetGameMode()).GetLootSpawnPointManager();
but i got the error "cant find variable GameMode_MM_Test_Class".
class TEST_BaseGameModeClass: SCR_BaseGameModeClass
{
};
class TEST_BaseGameMode : SCR_BaseGameMode
{
void CallMe() { Print("CallMe"); }
}
/////////////////////////////////////////////////////////////////////////////////
TEST_BaseGameMode gameMode = TEST_BaseGameMode.Cast(GetGame().GetGameMode());
if (!gameMode)
{
return;
}
gameMode.CallMe();
not working i cant even edit it out off the {} i used the editor thingy to add it , maybe thats not the way to do it anymore ?
//------------------------------------------------------------------------------------------------
modded class SCR_BaseGameModeClass: BaseGameModeClass
{
[Attribute(uiwidget: UIWidgets.CheckBox)]
bool m_BoolValue;
void PrintStuffToo()
{
Print(string.Format("The bool value from %1 is %2",this,m_BoolValue));
}
};
//------------------------------------------------------------------------------------------------
modded class SCR_BaseGameMode : BaseGameMode
{
void PrintStuff()
{
SCR_BaseGameModeClass PrefabData = SCR_BaseGameModeClass.Cast(GetPrefabData());
if (!PrefabData)
return;
Print(string.Format("The bool value from %1 is %2",this,PrefabData.m_BoolValue));
PrefabData.PrintStuffToo();
}
};
//------------------------------------------------------------------------------------------------
What's the difference between affiliated faction and default affiliated faction in FactionAffiliationComponent?
I assume is that default affiliated faction is prefab value (for example, civilian vehicle has CIV faction) and just affiliated faction is dynamic value that could be influenced in runtime (so, when US players gets in into civilian car, it becomes US affiliated faction with CIV as default affiliated faction), right?
The term default would make me think that is the one that never changes and is set by the prefab, the "AffiliatedFaction" would be the one that changes.
So when a DefaultFaction(US) gets into a CIV car his AffiliatedFaction would change to CIV
and his DefaultFaction would still be US
Having looked through the scripts, the SCR_VehicleFactionAffiliationComponent does get it's AffiliatedFaction set when a player enters a compartment, and the Default isn't touched.
yeah, in the OnCompartmentEntered it just sets vehicle faction via SetAffiliatedFaction with characters passengers value, so I assume default stays with the prefab value
guess I'll test it to see, but feels like it should work
my case is that I need to get original faction for vehicle
the default is the value from the prefab
What controls the press space to spawn character as player behavior in GM?
It's bound to a context action. See Create player... in TempEdit.conf
I remember seeing something to do with AI, IIRC vehicles have default faction instead of faction normally so that AI don't target unmanned vehicle as hostile or ignore you as a hostile driving a CIV vehicle
Upon entering vehicle the actual faction value gets set so AI target the vehicle if they consider occupant hostile
So probably useful to think of it as default faction = vehicle's own faction, faction = faction of occupant
You could use: SCR_VehicleFactionAffiliationComponent > OnCompartmentEntered(); and check what the GetDefaultAffiliatedFaction() will return.
But yeah it should be whatever has been set in the config of the vehicle.
default of the prefab yes. you can set the faction at runtime and change it. defaults are used to compare for e.g. save-game data to store it only if it is differrent from the default.
also changing the affiliated faction does not propagate across all components that store faction information
not to all of them anyway, ie. character faction changes but my custom vehicle was still no faction
No, it just sets the faction on that component, nothing else. that is why changing factions is usually done through the faction manager and or other utlities
This is more of an issue of other components not reacting to changes in the affiliation component
What is the Bohemia Approved ™️ way to "just change the damn faction of this entity please"?
Would anybody be able to tell me the mathematical relation between the linear and angular scale vector in SCR_weaponAttachmentAttributes vs the base recoil scale slider found in the muzzle component of a weapon. I am trying to make it so my attachments bring the recoil back to a realistic value as these attachments are required for normal operation.
I’m working on a project for Dynamically generating missions and spawning enemies and the programming isn’t necessarily the issue I’m having but I am having a rough time understanding how to even get players to spawn. I’ve put down a faction manager assigned the factions. Setup a spawn point and all of that
Still when I click play in enfusion my camera is just stuck on the ground. There’s so many different entities and components that seems to be needed to make everything work.
Is vehicles teleporting/stuttering on collisions in multiplayer normal behaviour?
I’ve seen it quite often. Like when you get stuck on some rocks or trees and trying to squeeze out and it jitters trying to get out. Not sure if that’s a question for scripting but yeah.
Fair enough, i automatically asked here because i'm doing some scripting and in my case vanilla vehicle was stuttering heavily while colliding with modded/scripted objects, but when i tried to collide with another vanilla vehicle it also stuttered. Should've asked in Physics.
Yeah it happens. I usually notice it more on servers that have a lot of other stuff going on like a lot of vehicles driving and flying around.
I was testing on a local dedic, so i could imagine it is an absolute mess on the web server. At least i don't have to spend couple months trying to fix this.
is EonInit called before OnGameStart ? i want to register prefabs to a singleton prefabmanager, but sometimes teh prefabs get initilized befor the gamestarts and wont register to the manager and sometimes it works
i want to place spawnpoints in the editor then on game initalisation i want to first initialize a managementclass for the points, after the Manager is set up i want to register the spawnpoints to the Manager
but i have to ensure that the Manager is setup before the points call the register function
Use a game system.
modded class and how they work?
the documentation is not very good to be honest it was a lot faster to build it myself, and its working now, i got a bug with memory leaking after resume to editor and back to game without rebuilding it. But its fixed.
I learned that sizes are persistence through game restarts and i got a check if a element in the array is null then abort it...
My array was growing each restart from 2 to 4 to 6 ... with null in the first entrys and only the last ones where filled with data
GetGame().InPlayMode() and you can also use an ifdef workbench to check that only in workbench.
Constructors, destructors and post init run in editor as well.
Entity lifecycles documentation page shows what runs in the world editor
Honestly pretty annoying
Looking at any of the pre existing game systems is all the documentation you need to see how it all works. Game systems should be used when handling large numbers of entities or components.
How could I exclude one specific character from being spawnable via the press space to spawn player menu?
Is there a relatively efficient way to detect specific entities. Such as rockets from rocket pods, 30mm bullets, and other types of vehicle-fired ammunition when they enter a trigger zone, and delete them without putting too much strain on the server?
What is your overall goal?
I have a zone designed specifically for infantry combat, possibly with small vehicles like Humvees equipped with .50 cal turrets. However, attack helicopters, APCs, and similar vehicles can get close to this area, and I want to prevent them from engaging or strafing players inside the zone. The goal is to keep the combat focused on infantry, without interference from heavy vehicles.
Efficiency is indeed important for something as broad as this. I'm not sure what's the best way, but here's some approaches I can think of:
- Prevent the player from firing the vehicle while within a zone. This should be fairly efficient, but is not 100% what you're asking for as you can still shoot in from the outside.
- If you want to delete munitions when they enter the zone, you would have to perform very frequent checks, as their speed can be extremely fast. This is not great, on the other hand the approach only requires processing of relevant munitions. If you go down this route, you would probably create a system that registers certain projectiles and also zones (points with a radius for efficiency) from a component, and then batch compare the distances several times a second. The downside of this approach is that you can technically still fire from up close and have the projectile hit before it's picked up, but maybe it can also be combined with the other approach to avoid that, if the zones are large.
- Somehow do it before damage handling? This avoids having to keep track of projectiles, but you have to filter everything.
But you should definitely get a second opinion on this, I am not familiar with projectiles and there may be a better way that I don't know.
The second approach is also the one i had in mind but the refresh rate would have to be horribly fast -_-
Thanks a lot for your answer btw
Can i hide parent class parameter that has [Attribute()]?
There are server methods in the spawn logic/deploy menu classes named along the lines of "ask/can spawn", you probably wanna override one of those to return false if player ID matches the one you want to exclude
Oh wait you said press space to spawn I'm idiot and didn't read 😂
I think that placement mode is just based on game master / edit mode filters, so can probably exclude the character you want by overriding it's editable entity labels to lack whatever is currently matching
I've got a mod in the works that restricts the platoon net to just SLs. This was my implementation:
modded class SCR_VONController
{
//------------------------------------------------------------------------------------------------
//! VON activation
//! \param[in] entry which is being activated
//! \param[in] transmitType type of entry to be activated
//! \return true if activation was successful, false otherwise
override protected bool ActivateVON(notnull SCR_VONEntry entry, EVONTransmitType transmitType = EVONTransmitType.NONE)
{
// We only care about blocking radio transmissions, not direct speech.
if (transmitType == EVONTransmitType.LONG_RANGE)
{
PlayerManager playerManager = GetGame().GetPlayerManager();
if (playerManager)
{
// Get the local player's ID
int localPlayerId = SCR_PlayerController.GetLocalPlayerId();
// Check if the player has the SQUAD_LEADER role.
// If they DO NOT, we block the transmission by immediately returning 'false'.
if (!playerManager.HasPlayerRole(localPlayerId, ERoleCallsign.SQUAD_LEADER))
{
return false; // Block the transmission
}
}
}
// If the player is a squad leader (or if it's direct speech),
// run the original game's code for activating VON.
return super.ActivateVON(entry, transmitType);
}
};
I'm interested in any feedback if this is the correct way to do this and how one might go about testing this? I've loaded it up in the editor but only has one player, of course. I need a non-SL player to check it's blocked.
What I've usually done to test this stuff is load up one of the coop arland missions with a PeerTool peer.
Plugins > PeerTool > configure another user, then there's a game run option to run localserver + peertool
Thanks @teal vapor - i loaded it up and it didn't seem to load anything - the script compiles is there anything I need to add to the .gproj file or anything?
This video says deprecated but the steps are still the same: https://youtu.be/YSPg4MAhDfc?t=192
This video goes over how to use PeerTool in the enfusion workbench, it is used to create a new client instance so you can test multiplayer environments.
Params: -addonsDir "Path/to/your/folder"
Example: https://i.imgur.com/vfJEad7.png
Timestamps:
0:00 Intro
0:18 Creating new project (skip if you have one already)
3:12 PeerTool Explanation
3:56...
Instead of copying the game binary btw you can just point the PeerTool instance at the diag executable
you also don't need to set the mods dir. I would just show my config but currently on my work pc doing some stuff and don't really want to context switch
Is there an event thats called when an entity is shot
not like the character or a vehicle just like any entity
very useful thank you!
I half finished off a system that does this, but I gave up yesterday when there was no way (that I could find) to intercept mortar rounds
I can flick it over to you if you want?
You could add a component on the munitions you want to intercept that would query zones and determine if it is intercepted or not
I wonder if there is an efficient way to look up entities by region to query only the relevant zones instead of all
Gridmap
Hey, sure. Would be nice
This would require me to override every single bullets tho right?
Just the common parent perhaps
Ammo_MortarShell_Base and Ammo_Rocket_Base for example
I’ll look into it, hopefully rhs and wcs have made really distinct base objects for their ammo
i am new to reforger scripting and making a simple mod that needs to send messages in-game chat. am i getting this right? or there's a better way to send chat messages?
[RplRpc(RplChannel.Reliable, RplRcver.Broadcast)] - This sends to ALL clients
Rpc(RPC_SendMsgToClients, msg, msgType); - This triggers the RPC call
Mortars are undetected, it spawns the effect on contact, I am probs tracking it wrong
really the mortar just fires a fake shell?
I made a projectile track component that the system tracks, it's attached to them
Rockets and everything else works fine, but mortars are no bueno
i have been looking at a couple of mods that send messages / popups to players. it seems they all make an array of players and then loop over each player to send the message / popup.
wondering if that's the most efficient way to do it? or if there's an alternative function that lets you send a global chat message / pop up and warning to all players and so on

