#enfusion_scripting
1 messages · Page 25 of 1
Looks like it's registering to the coordinates of the command tent. annoying, but I could probably use that instead of base names
SCRIPT : GenericEntity<0x000002A6BCE7A340> @"ENTITY:6917529027641083271" ('GenericEntity') at <2769.705322 76.283035 1638.779663> @"{C02498D55CF377AF}PrefabsEditable/Auto/Systems/Compositions/BaseLogic/E_MilitaryBaseLogic_US.et"
Continue to look through the scripts, that logic is attached to a military base at some point.
SCR_MilitaryBaseLogicComponent or SCR_MilitaryBaseComponent? Pulling the unique ID for them from SCR_MilitaryBaseLogicComponent .RegisterBase(), guess that's better than XY coords. SCR_MilitaryBaseComponent.GetCallsignDisplayNameOnly() probably has something, gonna need to make a whiskey run
Still not sure what you're trying to actually do, if this is in regards to the fuel stuff, I pointed you in the right direction for that in vc that one day.
yea we got the prefab localstring being spawned (changed it to the filename since updates change my prefab configs), but i dont think we finished what base name they're registered to đ
Well, the U.S. ones can only be spawned by the U.S, if you're wanting to have only the first one be full and the next ones to be empty the logic is pretty simple, it seems as though now you're trying to limit based on the specific "FOB" that's spawning them?
that's correct, the first built at each base is set to 100%...otherwise they're empty.
so if it's the first fuel depot/light veh depot/heavy veh depot/helipad built at each base, it's at 100%. Else they're empty
future version will let GMs turn that on/off/custom setting, but thats off in the future
Anyone have the script location to disable players from commanding AI into entering a Vehicle/emplacement
Real quick question, are there any ways I can add lines to a script without outright replacing the whole script? I see this being an issue for mod compatibility, so I'm asking. I know in modding software, you can usually add hooks, but im not too sure how to do something similar here.
you can do a partial override only replacing specific methods of a class
modded keyword is like the partial keyword in c# for class modification. If you want to mess with a method, you would override it with possible super if you want to use it.
Okay so, i just need to spend more time learning c# keywords
thank you!
C# translates well. There's a few missing features but the gist is there
yeah general best practice with overrides is you should call super.Method(args) of the same method so you don't "clobber" any underlying logic from vanilla game or other mods, unless you specifically want to skip logic from the inheritance ancestry you're overriding
in some cases there is a script invoker or event you can bind a callback method to which is ideal to hook logic into something, but a lot of classes don't have them so you'll either need to add your own or add your logic to method overrides directly in those cases
okay yeah. i should've just watched forward in the dev video. I really like getting ahead of myself lol
Is there a way to add components to prefabs (vanilla and editable) via scripting? Right now I have to add 2 components and alter 1 existing one via GUI.
no, just override prefab
Yes, through a workbench plugin, at runtime no.
Unfortunately that does not work, I found a bug that @minor agate confirmed that essentialy borks the Editable prefab I need working: https://feedback.bistudio.com/T195843
Are you using the plugin for making changes to editable entities or are you just trying to edit them?
For making changes to the Editable entries. I modify vanilla first, then generate the Editable. Then edit the spawning items that Editables have
Both variants use the same Component settings, but the Editables don't always work like their counterpart does.
Yes I know. The Editable does not generate properly when using Override, and with Duplicate the Editable prefab won't always work the same like the vanilla prefab.
so if i can set it all via script, I can avoid dealing with the prefabs directly and hopefully that works
You can't add components to prefabs from script at runtime.
That will never be a thing you can do.
dang it
anyone got any clever ideas on how to remove clouds at a specific time with scripting (or any other way)? I tried this which works perfectly in the editor, but does not work in the actual game.
Can you not just override the existing editable prefabs or their ancestor directly? Why do you have to generate new ones?
Tbh I always found most of the generator plugins unreliable so always created my editables by hand
You are changing the material directly on the local client, so you need replication for it to be synchronised. Look at logic of time and weather component for an idea of how vanilla game sets and syncs weather
That's a question that I've been asking ever since I started my mod. I've accepted that the prefabs just won't work correctly without doing Workbench gymnastics.
Should have specified, but this is in a 2dsight component so i want the effect to be local to the player using it
Does anyone know any good videos over understand scripting in a simple way
Not really, I watched the modding bootcamp and RS vids on YT and it still takes time getting used to. You just have to keep poking at things and working in the editor.
If you aren't familiar at all with C++/C#, it's gonna be even more difficult x10
can someone help me out with this it keeps brakeing
I assume it's a dictionary? To get a value you only feed it one key
do you know how i can fix this bc i try chatgpt to fix but it to dumb to fix it
-_-
I can't help you when you only share one like, i don't even know what you use as key, well what gpt uses
bc this is the script and it keeps brakeing
"it" doesn't "keep brakeing", it doesn't work because it's poorly made AI slop, in the case of the dictionary to fix it simply use the key, change GetBankMoney to
int GetBankMoney(IEntity player)
{
return BankBalances.Get(player);
}
Now for the rest i am sorry but I am unwilling to debug AI code as from that screenshot alone i can see it hallucinated a LOOOT and basically made up a bunch of code that will never work and isn't even close to working.
Best of luck !
You're welcome
Is there a function for check entity inside building? Like A3 "insideBuilding" command
I don't find example how AR check where need rain effect.
Closest match the SCR_DestructibleBuildingComponent's bool IsInside(notnull IEntity entity) function, but need find the closest building for it.
Its too many performance drop in user action's CanBePerformedScript function.
Or just need use TraceMove or TracePosition or UP vector?
avoid using AI for scripting. >75% of it is wrong, or a ridiculous hallucination. It provides no benefit except to see what sloppy code looks like
đ The system has started successfully (optimized version)
You end up spending way more time correcting it than actually producing anything that works
NONE = 0,
BANDAGE = 1,
MORPHINE = 2,
SALINE = 3,
TOURNIQUET = 4,
AMMO = 10,
MG_AMMO = 11,
AMMO_MORTAR = 12,
FOOD = 20,
FLARE = 30,
BINOCULARS = 50,
COMPASS = 51,
FLASHLIGHT = 52,
RADIO = 53,
WATCH = 54,
BAYONET = 55,
EXPLOSIVE_CHARGE = 56,
MINE = 57,
DETONATOR = 58,
NIGHT_VISION = 59,
GPS = 60,
HAND_SLOT_ITEM = 61,
IDENTITY_ITEM = 70,
What do the numbers represent?
If it's an enumerator it really doesn't matter
Unless it's used as a bitmask.
fair didn't think of that
Iâm evaluating different data storage approaches for a growing multi-server RP network: JSON files, MongoDB via Enfusion DB, or external MySQL through an API.
From a performance, async handling, and long-term scalability perspective, which architecture would you recommend?
Would waiting for 1.7 make sense in case there are improvements to persistence or database systems?
What's the best way to cast one object to another in enfusion if I know what the type is? e.g. from type Resource to type EntityID:
Class Example
{
void foo(Resource in)
{
Print(in);
EntityID in2 = in;
Print(in2);
}
};
Where do i start learning scripting?
I want to make new animations
I know arkensor is hard at work for persistence improvements for 1.7.
Right now the server I'm with is using json since that was patched recently to allow more than one 16mb file, but we'll be swapping to MongoDB or an external source as soon as its officially stable in workbench. I'd recommend an external source or mongo, but only after 1.7 sees some improvements to persistence.
Scripting isnt exactly the same as animations, animations and its related workflows are a bit more down the creative software pipeline, i.e. blender. There are a handful of youtube tutorials, some officially by Arma, titled 'Bootcamps' that might be able to help you out
i can animate, and have followed the bootcamps, but not sure how to do the technical side of for example a 'drag person' animation
I think you are confusing some terms here.
IEntity is an thing in the world, this is very distinct from a Resource (which is basically though not technically a file, like e. g. a prefab, a material or a config).
You can cast classes using the Class::Cast(Class from) method, here is an example:
IEntity e; // some entity
SCR_ChimeraCharacter cc = SCR_ChimeraCharacter.Cast(e); // cast entity to character (SCR_ChimeraCharacter inherits from IEntity)
Print(cc); // will print a character entity, or NULL if either e was not a character or e was NULL itself
If you want to check simply whether a class inherits from another class, you can also use Class:IsInherited(typename type) instead of casting.
If you want to actually check what class a Resource contains (different thing), like for example whether a prefab is a character, you can do:
Resource r; // some resource
BaseContainer bc = r.GetResource().ToBaseContainer(); // base container
Then use BaseContainer methods like GetClassName().
However if you are indeed still confusing these terms, I recommend getting a more solid understanding of the foundations first, e. g. by reading https://community.bistudio.com/wiki/Category:Arma_Reforger/Modding/Scripting.
Thx, was trying to get the unique in-world ID from a spawned prefab. I think I found what holds it while doing some print debugging đș
You mean the ID of an entity - IEntity::GetID()? This is not directly related to prefabs or resources.
No, not the prefab ID...was looking for something that ties back to the base a spawned asset is registered to (long discussions about it if you scroll up)
You are looking to find the prefab an entity was created from? Otherwise I'm not sure what you mean.
Oh you mean base in terms of Conflict, nvm
I can't find the correct output where I found the ID that relates to the base it was spawned at, but it was similar to the below:
"GenericEntity<0x000002A6A9C86760> @"ENTITY:6917529027641082754" ('GenericEntity','Assets/Props/Military/Fuel/FuelPump_US_01/FuelPump_US_01.xob') at <1012.185730 37.873810 2817.788818> @"{2DF0C0623E207C7E}PrefabsEditable/Auto/Props/Military/Compositions/US/E_LFD_FuelService_US_Conflict.et"
I think you're better off just generally describing what you're doing and want to achieve.
My mod makes fuel depots have limited gas. When a player builds a fuel depot or any service station that provides gas, I want to know what base it was created at and add the base name to an array. If it's the first fuel pump station built at the base, it's full of gas. Otherwise it's empty.
Setting the gas level is already figured out, it's grabbing the structure that was built and which base it was built at that I'm working on
How do I add custom attributes to an entity for GM to chage
post the github of what you have so far
I dont use github, but I'll post tomorrow when I can. Heading off for the night
do i need to learn scripting to make a new option for dragging and carrying someone?
Yes
how indepth is it? how long will it take me to learn?
It will take awhile I don't know how long but it's not just a simple couple buttons thing. Nothing really is.
You have to see how all the different files work together.It will seem convoluted at first, and it's boring tedious stuff.
ok, where would one even start? at this rate i might ask someone to do the scripts for me if theyre interested in my mod
Start where the video starts, and learn about overrides and duplicates and inherited data. There is a page for it on the bohemia site
If a dev can answer me this. Are the new Attribute reflection functions part of typename staying for the future? And is .Spawn() staying?
Yeah
x2
ScriptModule staying?
They are staying
Yippie
I recall in the past there was a comment on the .Spawn function saying it was bad or something and that brought my mind to asking about it
As long as it's not abused
it's better to create with new keyword
It's never better even on other languages to do similar
plus spawn does no respect all constructors
Any chance of getting a better physics api for modders?
But spawn is useful if you for whatever reason got some typename from a string
And you are unable to do some switch with cases for them
You get pretty much the same as devs on that
What do you feel it is missing?
To add on to my "experiments" I have found a way to work with threads even after the script module is reloaded so they don't leak uncontrollably
Ok i'm not sure exactly.It just seemed like the public methods were very few.

Why are you using everything we tell people to not use
but combined?
Oh you'd hate me
NOOOO

im having fun
But yeah, bone joints for things like hair and ropes would be dope
Your workshop account too, due to unsafety. 
It won't be removed but don't do features with that
At any point if it causes issues
We do go behind you and tell you to fix, help you fix it or whatever
if no fix and the thing is decreasing game stability then it gets banned
Servers count too
In fact server is worse
Unstable servers => Players unable to play in mass
But it has to be quite bad for that
Usually the issue can be resolved quickly
Well lets just say it will only work on my servers because its loaded by ScriptModule. And actually it seems pretty stable right now the way im handling it.
The stuff I release for public workshop use by other servers/players wouldn't have these things
@fervent stirrup btw I am just teasing with this
||Or maybe I am half serious|| 
It feels like a minefield sometimes lol.
Don't worry I won't crash people's games when this stuff comes out one day 
Like that Sum41 song haha
Kinda losing my mind a little, I can't get this area mesh's material for a trigger entity to properly replicate. I've looked at the RplDocs and examples on the biki, but still can't nail it. Anything I'm missing or not understanding correctly?
class CONVICT_CapturePointAreaMeshComponent : ScriptComponent
{
[RplProp(onRplName: "OnCurrentMaterialChanged")]
protected ResourceName m_sCurrentMaterial;
//------------------------------------------------------------------------------------------------
override void OnPostInit(IEntity owner)
{
if (GetGame().InPlayMode())
SetEventMask(owner, EntityEvent.INIT);
}
//------------------------------------------------------------------------------------------------
override void EOnInit(IEntity owner)
{
m_Owner = SCR_ScenarioFrameworkTriggerEntity.Cast(owner);
if (m_Owner)
{
m_Owner.s_OnTriggerUpdated.Insert(OnUpdate);
m_Owner.GetOnActivate().Insert(OnActivate);
m_Owner.GetOnDeactivate().Insert(OnDeactivate);
}
GetGame().GetCallqueue().CallLater(SetRadius, 1000);
GetGame().GetCallqueue().CallLater(DelayedInit, 1000);
}
//------------------------------------------------------------------------------------------------
protected void DelayedInit()
{
SetCurrentMaterial(m_sVacantMaterial);
}
//------------------------------------------------------------------------------------------------
protected void OnUpdate(float activationCountdownTimer, float tempWaitTime, int playersCountByFactionInside, int playersCountByFaction, string playerActivationNotificationTitle, bool triggerConditionsStatus, float minimumPlayersNeededPercentage)
{
if (!m_Owner)
m_Owner = SCR_ScenarioFrameworkTriggerEntity.Cast(GetOwner());
if (m_Owner)
{
if (playersCountByFactionInside > 0)
{
if (playersCountByFactionInside > 1)
{
SetCurrentMaterial(m_sEnemyWithinMaterial);
}
else
{
SetCurrentMaterial(m_sInProgressMaterial);
}
}
}
}
//------------------------------------------------------------------------------------------------
protected void OnActivate()
{
m_Owner.s_OnTriggerUpdated.Remove(OnUpdate);
m_Owner.GetOnActivate().Remove(OnActivate);
m_Owner.GetOnDeactivate().Remove(OnDeactivate);
SetCurrentMaterial(m_sFinishedMaterial);
}
//------------------------------------------------------------------------------------------------
protected void OnDeactivate()
{
SetCurrentMaterial(m_sVacantMaterial);
}
//------------------------------------------------------------------------------------------------
protected void OnCurrentMaterialChanged()
{
GenerateAreaMesh();
}
//------------------------------------------------------------------------------------------------
protected void SetCurrentMaterial(ResourceName material)
{
if (m_sCurrentMaterial == material)
return;
m_sCurrentMaterial = material;
Replication.BumpMe();
GenerateAreaMesh();
}
}
On this what's the whole situation on importing images from the web? Rough draft I made of importing external images
I believe Ark said so long as it wasnt abused and allowed players to import material against the games rating itd be fine. In this case itd just be offloading briefing images to a webserver the players can request from so our mod isn't bloated with gb of images.
I have this little method of mine that's guilty of causing memory leak impacting mostly server with lower ram available
[RplRpc(RplChannel.Unreliable, RplRcver.Server)]
void SyncCameraData(KE_CameraData data)
{
if(!m_spectateComps ||
m_spectateComps.Count() == 0) {return;}
foreach(KE_SpectateUserComponent spectateComp : m_spectateComps)
{
spectateComp.RpcDo_UpdateCameraData(data);
}
}
I assume the reason is because the data is sent every post fixed frame and that the server is basically instanciating ~30 instances a second of KE_CameraData , would there be a more optimized way to go about doing the same ?
Maybe rplprops with rplconditions ???
But even then the data still has to be sent from the first client to the server.
idk if that qualifies as an actual memory leak but it's def spiking up the ram usage a bit.
This won't work on consoles iirc
We already use TS for VON so thats not an issue haha
I mean the images
from web
But yeah if it becomes vector of abuse that could cause issues with the ratings, then it will be handled somehow
We'll deal with it if it happens
for now we want to just keep it open
Alright Ill have it locked down so there's not a rainbow six siege situation
Time to make a problem out of nothing, I love chaos.
@minor agate does set target transform work on non kinematic entities? I think an entity has to be kinematic for it to function because itâs the process of taking something that is physical but does not react to physics, and moving it to a different place. I think thatâs why it did not work for the helicopters when I tried using it.
What is CameraData?
I don't know anything about scenario framework trigger, but mb it's triggers on both sides? Did you try to set event handles only on server?
I should rename the class as it's kind of more general now, but it's a class that implements a codec and is meant to send client sided data from a player being spectated to "spectators"
Would it help if i send the whole class or not really?
At least we will know how much data you send and how encode it
fair, here it is (sent as a file to avoid textwalls)
Will give it a shot and see what it comes up with
With setting it to authority, the material does not change at all now, but seems that it's because OnUpdate isn't firing for authority?
- I think it will be better to make size static
- How you create, fill and pass to Rpc? Also it's Managed?
The way I'm filling it isn't really the issue, on the client's side i reuse the same instance the whole time, it's really just the server side that takes a slap from it, for most communities it's fine, it's an acceptable trade off but to others that don't have a whole lot of spare ram it becomes more of an issue
- Not sure how enforce align members, but if it's same as C/C++, it will be better to sort members from big to small
Hmmm
I'll test it out and see if i can see any difference
Thank you for your help, was kind of hoping there would be a magic trick to get around my problem đ
You can try to pass arguments directly to Rpc without your own class... at least it will not call custom codec
Then maintainability would suffer and i think i have too many variables now to send it all using params. I'll try out your suggestions and see if they help and if not then it's joever
okay so, it seems like the s_OnTriggerUpdated invoker is just proxy side (I guess would be the right term) through a network component in the scenario framework player controller. So what would be the best way to handle syncing it from proxy to authority?
I finally got it 
Had to create a world system with a world controller to sync the info from the proxy to authority. For reference, more info can be found here: https://community.bistudio.com/wikidata/external-data/arma-reforger/EnfusionScriptAPIPublic/Page_WorldSystems.html
Someone know's if the QueryEntitiesBySphere has a minimum radius?
Somehow it feel's like it doesn't go below 1.0.
I tryed 0.05 but it's still finding stuff not even close to this range.
If I remember correctly it filters bounding boxes, not physics collision. Some entity can have bounding box in places where nothing touches it. There is a bounding box diag somewhere.
If you want physics then do a line trace maybe?
Yeah that make's sense.
Many thank's. 
My dumbass sent this to the wrong channel
-> Would this be a proper way to implement request callback now since OnSuccess it obsolete ?
class SDS_ConnectUserCallBack : RestCallback
{
private int m_playerId;
void SDS_ConnectUserCallBack(int playerId)
{
m_playerId = playerId;
SetOnSuccess(ConnectUserOnSuccess);
SetOnError(ConnectUserOnError);
}
private void ConnectUserOnSuccess(RestCallback cb)
{
// do stuff
}
private void ConnectUserOnError(RestCallback cb)
{
LogBackend("SDS_ConnectUserCallBack.OnError " + cb.GetHttpCode(), LogLevel.WARNING);
}
}
also i noticed that if we disconnect a user shortly after a user is connected we get this silly error and some really cool nullptr spam at
SCR_PlayerFactionAffiliationComponent GetPlayerFactionComponent_S(int playerId)
{
return SCR_PlayerFactionAffiliationComponent.Cast(GetGame().GetPlayerManager().GetPlayerController(playerId).FindComponent(SCR_PlayerFactionAffiliationComponent));
}
nvm for the assertion failed, it just trigger whenever the peertool leave the game
basically yes
How long would it take someone (A complete beginner) to make a script for reforger?
Do you have coding experience? In other languages?
Yeah, i know how to code in HTML, CSS, C++ So far, i understand python
In that case if you have c++ experience it shouldn't be too hard(assuming you have actual experience on it not just printing hello world).
I think within 2 months you can learn the basics, how replication works etc. And after maybe 3-5 months you'll start feeling confident in the workbench and feel like you can pretty much do "anything you want".
You'll be able to get features done before that, but there will be a lot of guessing and banging your head against the wall
Anything you can recommend to speed up the process?
Watch the bootcamp videos, especially the ones relating to scripting and replication.
Watch it fully and pay attention/follow along, it's basically like a lecture.
Do not use AI it will sabotage you.
And also do not hesitate to ask questions, i learned literally by asking the stupidest question out there(just above there is an example of one)
#ArmaReforger #enfusionworkbench #PCGaming
Inaugural video for learning to script with enforce script! As Alice Cooper sang, "Welcome to my nightmare". Thanks for being here and I hope y'all enjoy.
Learning Arma Reforger Enforce Scripting! How to create scripts in Enfusion Workbench.
Chapters:
00:00 Intro
01:07 Possible projects
03:54 Star...
is SQF also like C#?
If you want to learn the fundamentals of programming and object-oriented programming (which is the paradigm of Enforce Script too), my uni offers a free deep dive online course https://java-programming.mooc.fi/ The language used on the course is Java, which is very similar to C# and Enforce Script indeed
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...
@red cedar @boreal swan im learning scripting for animations and keybinds, so i have an early goal to achieve, so think that will help
Well for the keybinds you will definitely need to save that
https://community.bistudio.com/wiki/Arma_Reforger:Input_Manager
What can i do with enfusion scripting? what does it cover?
- mission making
- gui
??
the sky is the limit. Pretty sure theres a showcase of them making an entirely different game in arma through their modding tools
- game logic for vehicles, building services, GM abilities, spawning, weapons, creating abilities not in base game (like sling loading, fire spreading) etc.
@open pier Sounds like its worth the effort, especially if it is transferable
No. Sqf is procedural. Not OOP.
@red cedar
1)Where should i start? i understand all of the enfusion tutorials and biwiki tutorials
2) How much faster can i learn following someone who can enfusion script?
If you learn how ECS works, you can jump right in.
What does ECS mean/stand for?
Entity Component System
It's how you'll find your entry points
Most game engines use ECS
Where do i learn this please
Use the AI tools to your advantage
Youâll still need to watch the bootcamps, or other tutorials to figure out how the workbench system works, but itâs all fairly easy.
Just so you know, if the LLM doesn't do it fully right, almost all of us won't spend time to fix it for you. You're on your own with it.
And before anyone comments on the LLM hate in this discord, it's not LLM, it's the "I asked chatgpt and it's not working, how do I fix" questions.
Honestly i can't tell you, it really depends on you
Personally what taught me a lot is trying to make something that's similar to what already exists
For example you can flush toilets in the game, look how it works in the workbench and do something like being able to "wash your hands" using a sink
where do i find the flush toilet script? will give it a look
Create a blank mod,
find one of the toilet prefab(won't tell you how).
Override it in your mod and open it.
Open "ScriptedUsetActionsManager" or "ActionsManager" and try to find it inside.
Alternatively you can open the script editor, set the search scope to "entire solution" and search by keywords like "flush" "toilet" etc, etc.
That's how you'll learn a lot
found it, but cannot open it? or duplicate it
You can open the script in read only
yeah but how
You should be able to just double click it?
ah my bad
ok im looking at the code, what do i do now? a nudge in the right direction please
look at the code.. try to understand it, etc..
If you haven't watched any of the bootcamp vid there isn't really a point to try and make features of your own, you've got to learn how to crawl before you can fly
have only watched the animation ones (#8..#9, #10), so starting from #1
watch the bootcamp
- 1 Introduction
- 2 Modding patterns
- 5 Replication basics
- 6 Advanced replication
- 4 User interfaces
And then the animations etc (if you want to focus on scripting first)
At the moment yes i want to focus on scripting first (animation design im pretty sure im ok), thankyou
best of luck, it's a bumpy road
you still think its a 2-5 month journey?
do you have any coding experience?
before you feel comfortable in what you're doing and can pretty much do features you want then yes, once again before that you'll probably get a few things done but with a lot of banging your head against the wall, and eventually you'll know where to look for to find exemple of code you can reuse etc.
yeah
then maybe not 2-5 months, all depends on how much you spend in the enfusion editor tbh.
That's also a good point, for me it took me about that time before i started feeling comfortable with replication etc, but i'm also studying on the side and don't have a whole lot of free time
but regardless it won't be a two week kind of thing
what are you studying?
Data science
new pfp
ive never had to deal with OOP but I know python and some powershell. OOP is just more sophisticated data management and control, i dont think enfusion script has pointers though FWIW
omg haii
using any spyder or jupyter?
you mean notebook ? yeah a bunch of it, tho i use the VScode extension because i hate the jupyter environment
and also a whole lot of lovely math !
Jupyter's biggest advantage is inline rendering of plots
Idk if it has any other advantages tbh
i mean, Jupyter looks and sounds cool
Slapping markdown documentation and being able to make python understandable to someone with absolutely no coding background
lets say i have finished watching the tutorials, what do you suggest i do then? just read code, like the flush toilet, and make my own like 'wash hands in sink', and keeping doing that until it all clicks?
Yeah aide from the modding bootcamp and resources on BIKI most of the learning happens by reading vanilla scripts and asking questions
For simpler scripts most of the work is finding the best entry point for your logic, so a good place to start is deciding on some small thing you want to change then dive in trying to find where/how you can change that
For most common things modders could want to do there is likely some example of similar behaviour in vanilla scripts you can use as a reference
ef328637-4efd-4d71-84e2-bf25a05f920d
Can someone (at BI) help me with this crash ID by chance? Seeing some more crashes with my mod and not sure what is instigating it. This happened in workbench while fiddling through the debug menu. Maybe it was related to that, maybe not.
this a fatal crash? unable to debug?
Yeah, console log showed the typical "illegal access violation" with addresses
Doxxed
Would it be possible to use dependency inversion principle (from SOLID) easily in Enforce Script? I'd assume that nothing prevents it but just wanted to make sure
I'm trying to set up DSTool to be able to try and implement my own RCON commands however it says my config is invalid, any idea what i'm doing wrong ?
I haven't really toyed with server configs a lot so i assume i'm doing something wrong but no idea what.
It is crashing while trying to show some visualizer mesh, so maybe some debug shapes you added or something. Can not really tell what it is in more detail
shouldn't modId be the UUID not a name?
also try pasting it into a JSON validator (tons of online tools and browser extensions) to make sure it's valid JSON
For published mod yes
Mine isn't on the workshop
I think even unpublished mod should have a UUID in its .gproj file right?
anyways if it detects and loads your mod probably that isnt the problem
They do, but the mod id is what i wrote in it.
It's also literally what you'd use to specify which mod with peertool and under the project settings tab it says "modId" that
The mod id is likely not the issue in here
It just says that the config is not valid then closes the server
Does scripting and config go hand in hand? or overlap? or?
You are mixing mod ID and name. We talk about the short unique ID that is generated when the gproj file is first created
A lot of configs are based on script classes because they are used by scripts later then. But a config must not necessarily be a script class
so i should use the GUID instead ? fair
So i can start tweaking configs once i learn scripting?
uh oh NUCLEAR BOMB
You can handle configs without knowing scripts at all.
I once launched ~20 instances at once to just fill up server with as much as possible clients (+few other people do same)
I launched them by mistake on my lapbottom was running at 2 polaroids by seconds
Is there a way to spawn a turret already being manned through script?
BaseCompartmentManager Component's SpawnDefaultOccupants or BaseCompartmentSlot :: SpawnCharacterInCompartment
awesome, thanks!
Where do i start? i want to learn scripting? animation based? Have watched the Bootcamps
any idea on what can cause my client to be stuck loading here (dedicated server tool), most relevant log i can find is Can't open config file "" but other than that i don't really know
ok so i got it to spit out logs, now the issue is.. it says -config cannot be used together with addons! yet i don't use addons in my cli params my cli params are
-addonsDir "" -nopause -debuggerPort 7778 -noBackend -config ""
and if i can't specify the addonsDir then i'll crash out
https://community.bistudio.com/wiki/Arma_Reforger:Create_a_Component
whats it asking me to do here?
making progress, now my issue is Addon 'KittenEyeCore' not found but i am pointing to the correct folders so i'm kind of confused.
I also tried renaming the folder so it match exactly the "KittenEyeCore" thingy but to no success
ok so the greedy ahh server was expecting to get the addons in HIS profile's mod folder ? even tho i pointed it to the workbench addon folder....
This greed is sickening
still the same loading error i give up
@red cedar Hi, anything else i should do to learn scripting quickly? im currently on this;
https://community.bistudio.com/wiki/Category:Arma_Reforger/Modding/Scripting/Tutorials
dddddddddddd
There's no way to learn it quickly dude. Lots and lots of hours it is the only way to do any of this stuff.
ahhhh, what do i do then once ive finished the tutorials @ https://community.bistudio.com/wiki/Category:Arma_Reforger/Modding/Scripting/Tutorials ?
Furbezzy, i'll be fully honest with you i find it pretty rude that you ping me all the time, and in multiple channels.
I understand that you're in the middle of a lengthy learning process, but still. I'm not paid for helping out i do it on my own free time when i feel like it.
Sometimes like now i work on my own stuff because i want to.
I also don't want to walk someone through the entire process, i gave you the basic to get started, now you're the one who has to put in effort to learn.
If you have specific questions or issues and need help i'll be happy to guide you a little (when i'm free ofc) but you can't just ping people to get assistance that's disrespectful.
Ok, will take the advice and know that it will take me months to learn, and there is no fast work around, đ
Weird approach tbh. More efficient to set some kind of specific goal (I want to make this or that) and try to work toward it than "just learn scripting"
i want to learn how to script for animations primarily
I don't think animations require scripting?
Tbf i never toyed with them but i'm pretty sure they have their own tool for that
scripting is required even in animation editor, plus, i want to include new animations that have actions behind them, e.g dragging a person, and medical
Oh okk fair
Signals and animation commands, events I guess
Animation system is much tougher to learn than scripting since it's designed to be annoying
I'm glad i haven't toyed with those yet then
btw bacon, if you have the time. do you have any idea what can be causing my dedicated server tool users to be perma loading ?
Im knid of crashing out i've been stuck at it for hours now :(
yeah peertool works fine
do you really need dedicated server tool?
I'm trying to set up RCON commands so yeah ig
just test them in chat
wait in this case why do you need users
rcon commands and chat commands work the same way just different method
mostly
you can also try just running the server using diag server exe
and connecting using diag client exe
i'll give it a try then
ty
i hate this DSTool... too complicated for my smooth brain
chances are it just doesnt work
well it did work until i introduced the config.json that i need to set up the listening adresses etc.
Now it doesn't so it's most likely a mistake on my end (probably?) idk i'm pretty confused
when i was simply sticking to giving it a world, scenario using the UI of the tool it was fine
Possibly a networking issue, check ports being used are open on loopback/localhost
welp seems like RCON isn't listening on DSTool ?? I could only see the port occupied with the actual ArmaReforgerServer thingy
HELL YES
i love you bacon
Me 2! 
What is better to update a Camera Transform on Proxy side?
GetGame().GetCallqueue().CallLater(REAPER_UpdateDisplayData, 1, true);
Or
SetEventMask(owner, EntityEvent.VISIBLE);
Hello everyone, I hope you are all well. I have a question. I am trying to write a script that makes changes using slots (enable/disable), and I get the impression that it is not possible to completely disable slots in the game. Have you ever tried this? If so, were you successful?
Second, tho i'd use onpostfixed frame
The first solution would be a war crime
Every server running your mod would make you EXPLODE with their MIND
I had it OnPostFrame, but such event is not running on proxys
But also depending on what you're trying to achieve, you could just add the camera to the entity's hierarchy and it'll move with it
Its a pipCamera and its already added as child. But if i not call ApplyTransform, it will not updated
i now use PostFrame with a limit to 25 FPS and will only run local on proxy.
postfixedframe is 30hz
so.. could do that
issue with the normal post frame is you can easily crash a client
(trust me i'd know)
i tryed "postfixedframe" but this will also not start. only PostFrame
i also run it on the Character itself. But:
```event protected void EOnFixedPostFrame(IEntity owner, float timeSlice)````
Do nothing when Set the mask as enabled
override void EOnPostFixedFrame(IEntity owner, float timeSlice) *
Error.. Override but no method
is your thing meant to work on AI too ?
Nope but it get only activated while joining my Vehicle as Pilot and if your the localPlayer (LocalControlled entity)
fair ig, in those cases i usually attach them as playercomponent component but that's just me, regardless even with postframe it should work
just make sure to rate limit it to avoid causing crashes etc
playerComponent?
If you're talking about character loadout slots yes they can be blocked/disabled
My future system is for vehicles, with the SlotManagerComponent
Someone know's if a trace is more expensive based on distance?
So the further it has to travel, the more expensive it get's or doesn't matter?
is it possible to hide mouse cursor at GM EDIT mode? anyone know? I was trying different ways but no effect. for example:
{
override void EOnCameraFrame(SCR_ManualCameraParam param)
{
super.EOnCameraFrame(param);
param.isCursorEnabled = false;
}
}
Funny thing, I want to do the same. Could not find a way to do it so I'll try with a ticket.
https://feedback.bistudio.com/T197639
đ give me message if you get answer, please.
What are you tracing for?
Trees.
I like to know if there are trees at a specific position.
Within 1 meter to the character.
Oh, If it were other characters I was gonna suggest a more optimized way to do it
You can tell anyway's if you like.
maybe i need it at some point in time.
This won't work with trees.
Doesn't matter.
IMaybe i learn something new. đ
But are you specifically wanting to know if one is behind the player or what?
I need to know if a cover position is a tree or a rock.
To determine the offset.
Rocks are bigger, so they need a bigget offset to make the A.I. get behind it.
What is the closest Event when streamed vehicles spawning, or JIP player get vehicles nearby?
My question was wrong.
I would guess the trace is doing some stuff/checks in the background while traveling.
So the longer it has to travel, the longer it will do thouse checks?
Or how does it work in the first place?
Yes i used them but they are not precise enough due to big bounding boxes.
They always return stuff which isn't there but the bounding box is.
Anyone got any ideas where i can start to learn script modding? have learnt the tutorials and what not
Jump right into "Script Editor" and practice.
Trial and error is the best teacher.
Maybe if you tell, what's your goal is you will get a more specific answer.
well right know im looking at the flush toilet script, aha, but my main goal is scripting for new animations
Okay.
Well i don't know about animations but may you better suited in here: https://discord.com/channels/105462288051380224/976155605100294224
i also want to learn scripting in general, as its very beneficial and it covers alot of stuff
True.
Well best is to just start practicing step by step.
If you already watched the Modding Bootcamps.
so literally dive in headfirst, and hope the water is deep enough lol
That's how most learn it.
There isn't really a step by step tutorial.
It's simply not possible to cover everything.
Yes that's it.
I'm going to try and give this sink the same 'flush toilet' action the toilet has.
But does the sink have a name? how would i find out?
That's something i don't know.
Where can I find the location of these names? I'm looking to add the names of my own ammo to them so the action manager will register them on the UI.
Its an action that's applied to an object using the actionmanager. Look up Toilet in the prefabs to see how its done. It adds an audio source to the object when the action is used.
i looked up toilet in prefabs, i did find it, but the entity instance gave me object name in end, anywho, read the ActionsManagerComponent, but it mentions nothing about audio, compared to if i search 'flush' on workbench resource browser...i find the script and the sound file, i try to find a reference to toilet_01 but nothing
This is in the toilet prefab in the actionmanager.
ok so i found that, what do i do from here if i want the skin to have the same action and sound effect?
You'd add an actionmanager component to the sinks prefab, then add everything from the toilets actionmanger component into the one you placed on the sink.
ah, that makes some sense
i cant find a way to duplicate the actions manager component and put it on the sink? dont i need to duplicate a file?
not quite there just yet, if i put aside a few hours a day, will get there
Sure thing. đ
You don't duplicate you add a new, with the sink selected click "+ Add Component" then search for "Actions Manager"
i think i meant the faucet when i said sink tbh
not sure what to do here, as 'add component' is grayed out
Have you created an override or duplicate of the faucet into your project?
one of these? which one should i do, duplicate i think?
If you want to apply your change to every sink in the game without having to swap them all I'd use override.
would you guys consider making a thread?
can others jump on the thread?
anyone can. but you have days of questions on the same topic, which is good for a thread
and there needs to be a level of self discovery for you to learn effectively as well. you've already pushed away one person I see #enfusion_scripting message.
how would i start making my first life game mode im new doing scripting
You can make modded maps persistent right?
For online play?
Is there a proper script for it?
These are in the string table in the WB string editor. I have not been able to figure out how to get the string table myself, maybe try #enfusion_gui
In my digging through the rabbit hole I discovered RHS has made their ammo show in the same format, alas looking through that mod was fruitless. I couldn't find any script, config, or anything that looked like it was the cause. I did get a hit from an old post in this discord that also had a link to the string editor biki.
Might be of some use? https://reforger.armaplatform.com/workshop/61B361DAAC593B43
Just found another "stupidity" flaw in the compiler.
If i miss the ; at the end of a line, it will not give an error but skip this line while executing.
So for example this: m_ConfigComponent.m_bConfigFilesSettingsOverrideExclude = m_bConfigFilesSettingsOverrideExclude will not give an error but it will be completely skipped.
Provide a full reproduceable example on the feedback tracker.
Okay.
I have made the ticket. đ
link it please so i can speed up the process of getting it before the eyes of script dude
This is not a good ticket. please include a full example script file that if loaded in vanilla will cause the issue
@torn bane not sure, if the breakpoint always skips the bool isTrue; ?
Somehow it does even with ; at the end.
So not sure if this is intended?
I did expect the breakpoint to break at every line/variable?
I updated the ticket.
And i don't know how to make this in a good vanilla example... đ„Č
the line does not do anything with the variable so you can not set a breakpoint on it
Okay.
But the example i gave above from the mod should.
I have no clue...
It should be false or true.
This is hard to understand what you are actually on about. skipping some unused bool variable is hard to evaluate. a string would be better so you know if it actually ran or is random memory
and the formatting is not good either, why not wrap it all in a code block
Okay.
I will try to get this done with a string.
I have no clue about the feedback tracker.
I will try to do better. đ
Sorry may i wasted your time... đ
Is there a way to get a item that a character has equipped in a specific slot?
It's a lot of fiddling around.
You can use BaseInventoryStorageComponent.
BaseInventoryStorageComponent has a lot of methodes to get specific stuff.
Then there is InventoryStorageSlot for slot stuff etc.
Best is to look for the methodes in vanilla and how they use it, to get an idea.
thanks i will take a look
i got an headache while understanding the process ahah
Same. đ
Guess it's by far one of the most annoying things i have messed around with. đ
Casting stuff back and forth all over the time...
yeah i dont really know why they choose this path... it may be simple than that
well for my use case it was fairly simple (at least i hope - testing in the following days will tell)
Lucky. đ
Everything is as modular as possible. If you want to change something very specific you can. Rather than changing the base class and it affecting every type of inventory
quite old problem, missing ; which compiles just fine are present even in vanilla code
Yeah i never really breakpointed them and was kinda suprised, when i saw the code/line was skipped, until i noticed the missing ; which i thought was the reason for the skip.
Unfortunate coincidence.
Good point. đ
Never really thought of it this way.
Good day fellow scripters
Could anyone help me improve a deployable squad radio a bit? I'm having a hard time understanding how the dropped radio turns into a deployed radio and how I can pass a variable to a deployed radio when interacting with dropped radio đ
can somebody explain to me input contexts. I'm at a loss. Lack of documentation is not really helping. I want to add custom action, I've figured the best place for it would be overriden chimerainputconfig. New custom action + new custom context. Both activated and listened to inside OnPostInit handler of my ScriptComponentClass and nothing happens. Change of priority didn't help. I just want to have global custom keybind that will activate scripts handlers.
Context are only activated for one frame unless you specify how long it should be activated for
In most cases you will just add your keybind to a currently existing context
am i missing something? i duplicated a prefab but canot delete its components...
workbench allows me only inside the original prefab...
oh, my god. Thanks that did make it work. what an odd behaviour for a scripted action
I mean it's only odd when you're not aware of it, as soon as you are it "kind of makes sense" but glad it helped !
anyone?
Try it without the this. keyword
Same result
If he can't find a component then it's not there. I am not sure what variable you are checking but there is a difference between Playercontroller and the character entity
Quick question: can persistence framework save tickets/score for both teams, buildings and supplies stored at each base and base locations if bases are randomized? Is there anything it cannot save? Thank you for your work!
Try to get it through the player manager. Not at my computer rn but play around with GetGame().GetPlayerManager().GetPlayerController()
It might take the playerId as an argument, cant remember off the top of my head though
Will do, been a while since I touched this mod (since Reforger release lol) so some things have broken in general, such as custom keybinds
Ientity entity;
SCR_ChimeraCharacter char = SCR_ChimeraCharacter.cast(dntity);
Char.GrtCharacterController(); or something like that
Yes there have been quite a lot of changes so expect to fix some things
Yeah just use the player manager or if you explicitly only want local client one you can do SCR_PlayerController.GetLocalPlayerController()
i think it's IEntity
I am trying to make a trigger that basically just removes bullets the second they are fired, I have a base trigger entity and I want it to activate when it detects a bullet. is that possible?
Ok, so with it being an event, how does that impact a trigger entity? Or at least how can I manipulate the trigger entity to activate in the case of that event?
Sorry if these questions are strange, this is my first project in en fusion
are you familiar with oop and c# events?
Yes mostly
oh I see, you are using the scenario framework? I haven't really messed with that and I don't want to give you a way more advanced guide when the scenario framework probably does it for you somehow
I was on my phone a missing capital E is the least of my concerns
Player controller isn't the same as char controller
It saves all these out of the box already. If can save anything if you add support for it. It's not magically gathering the information. Scripts tell it what and how to handle
For some reason, when using my custom component to spawn an optic rail on a rifle when an optic is attached, the optic rail lines up perfectly on authority (1st image), but not on client (2nd image). What could I be missing? The rail positioning is being handled through the SlotManagerComponent (3rd image).
Additionally, here's my script
I've seen a lot of ickyness trying to utilize SlotManager on a weapon entity. I've found it better to just make use of the AttachmentSlotComponent.
Is there an exhaustive example of how to pass all the things I need to the framework so that it would work? E.g. scenario randomly spawns bases on restart, is there an example how to preserve the same bases in the framework? Vanilla conflict is easier I believe, same bases, just different values, but with randomized it must be much harder?
The same logic that randomizes selection needs persistence added for it. If the mode was built on scenario framework as basis its already handled.
Hi! How can i ensure which code runs when i have 2 dependencie mod with same modded class, same modded function?
Breakpoint catch the wrong one, and what i need never runs.
Please ping me when you find out, I'm interested too
First idea is: Disable original manager or component in editor and change to my own inherited one, then maybe i can use override keyword on fuction and use my own codes without .super call. Main problem with this, need own world where i can change manually.
I try find other way for disable something in dependencies or use priority rules in mod hierarchy.
might have something to do with mod hierarchy if the one that is running doesn't do a super call
If you depend on the other mod it should go you -> mod -> vanilla. you could decide to go through vanilla directly by calling vanilla.blah instead of super, skipping what ever the other mod does. If you do not depend on the other mod you simply can not influence if and what it will do. you could tell the author of the other mod how to improve so their mod is not breaking others
Hello, has anyone managed to deactivate the function that can be built even if there are enemies in the area?
RPL : rpl::Pip::ProcessNetToGame
RPL (E): IReplication::JIPError: Inconsistent item table on Slave connection. Item is missing or different item was loaded in its place. (con=0x0)
WORLD : UpdateEntities
RPL : rpl::Pip::ProcessNetToGame
RPL (E): IReplication::JIPError: Terminating connection. (identity=0x00000000)
WORLD : UpdateEntities
RPL : rpl::Pip::ProcessNetToGame
Need some help on this if at all possible
Am i seeing it right that actions on the ActionsManager are static and can not be added or removed by script?
Yeah generally components not prefixed with SCR_ seem to be close to cpp code (often just sealed interfaces with no implementation to read or override) and have limited scriptability. In most cases like this alternatives seem to be things like creating your own custom class that inherits from the base one, or spawning a barebones entity with your custom action on its manager attached as a child entity to the bone of the parent you want the interaction on
yeah for what i wanted to do i would have needed to create actions by script but i guess i have to create a UI for this and not use UserActions at all. Would have been really cool because of immersion but seems i have to go the UI way.
What are you trying to achieve exactly ?
You could always have the actions be there already but disabled until they meet the right conditions
i am trying to create a presentation system where a controller can switch the screen thats displayed on monitors
would be possible yeah i have to think about this some more thanks for the input
yeah even though you can't dynamically add actions at runtime you can add them to base prefab and dynamically filter their usability/visibility (look at implementation of vanilla scripted actions for an idea), or dynamically spawn and attach a child entity with your desired actions
Hello. Maybe someone already implemented something simillar and can help.
I need to create a restriction system for some specific items in arsenal for specific players.
For example: Item1 is available to pickup to his inventory only for Player1. If Player2 will pickup this item from arsenal, or from world, or from trunck, system should delete this prefab from his inventory, or dissallow item creation in inventory
I implemented it with override SCR_UniversalInventoryStorageComponent.CanStoreItem, but it works good for vanilla arsenal UI by blocking user to drag this item. But it doesnt work for bacon loadout editor.
In bacoon I can see using of SCR_InventoryStorageManagerComponent.TryInsertItem, but I cant override it, as its proto external. I tried to use override for
protected void OnItemAdded(BaseInventoryStorageComponent storageOwner, IEntity item)
like this:
super.OnItemAdded(storageOwner, item);
if (item.GetPrefabData().GetPrefabName().Contains("Admin_Patch"))
{
Print("SteelPath >> Admin patch call");
if (!IsOwnerAdmin(storageOwner))
{
Print("SteelPath >> Not allowed");
super.TryRemoveItemFromStorage(item, storageOwner);
return;
}
Print("SteelPath >> Allowed");
}
But it doesnt work with vanilla or bacon arsenal. In logs I can see "Now allowed", but item is not removed from inventory
Can you paste the whole method override?
Which one? SCR_UniversalInventoryStorageComponent.CanStoreItem or OnItemAdded from SCR_InventoryStorageManagerComponent
try doing ```cpp CODE_HERE ```
My b im on my phone so was kind of hard to read. Why are you calling super.TryRemoveItemFromStorage
Remove the super.
super.OnItemAdded(storageOwner, item);
if (item.GetPrefabData().GetPrefabName().Contains("Admin_Patch"))
{
Print("SteelPath >> Admin patch call");
if (!IsOwnerAdmin(storageOwner))
{
Print("SteelPath >> Not allowed");
super.TryRemoveItemFromStorage(item, storageOwner);
return;
}
Print("SteelPath >> Allowed");
}
hmmmm, even with using the AttachmentSlotComponent, it still doesn't align correctly on peer 
Looks better. thanks for hint
hit enter after the cpp
Why remove super? super is a SCR_InventoryStorageManagerComponent main class
modded class SCR_InventoryStorageManagerComponent
{
override protected void OnItemAdded(BaseInventoryStorageComponent storageOwner, IEntity item)
{
super.OnItemAdded(storageOwner, item);
if (item.GetPrefabData().GetPrefabName().Contains("Admin_Patch"))
{
Print("SteelPath >> Admin patch call");
if (!IsOwnerAdmin(storageOwner))
{
Print("SteelPath >> Not allowed");
super.TryRemoveItemFromStorage(tem, storageOwner);
return;
}
Print("SteelPath >> Allowed");
}
}
did like this, no color formatting
i think you're leaving in the code block from the default Discord code formatting. its just 3 back ticks
modded class SCR_InventoryStorageManagerComponent
{
override protected void OnItemAdded(BaseInventoryStorageComponent storageOwner, IEntity item)
{
super.OnItemAdded(storageOwner, item);
if (item.GetPrefabData().GetPrefabName().Contains("Admin_Patch"))
{
Print("SteelPath >> Admin patch call");
if (!IsOwnerAdmin(storageOwner))
{
Print("SteelPath >> Not allowed");
super.TryRemoveItemFromStorage(tem, storageOwner);
return;
}
Print("SteelPath >> Allowed");
}
}
You're calling it inside of a different method. Just the remove item one
Cant understand. I have call to OnItemAdded, I'm verifying that items is not allowed and then i'm calling to remove it using same class, same component.
What do you mean by remove item one?
When you call super on a method, it's supposed to be there to ensure the base functions also run of that same method. So you don't need it on the TryRemoveItem
Oh, you mean just TryRemoveItem. Let me try
modded class SCR_InventoryStorageManagerComponent
{
override protected void OnItemAdded(BaseInventoryStorageComponent storageOwner, IEntity item)
{
super.OnItemAdded(storageOwner, item);
if (item.GetPrefabData().GetPrefabName().Contains("Admin_Patch"))
{
Print("SteelPath >> Admin patch call");
if (!IsOwnerAdmin(storageOwner))
{
Print("SteelPath >> Not allowed");
TryRemoveItemFromStorage(item, storageOwner);
return;
}
Print("SteelPath >> Allowed");
}
}
Something like that
On item added is too late for such thing. Then the item is already in transfer and it's hard to undo. Instead override the CanX checks
But can doesnt work for bacon.
The one option which I can see is to overrida CanX to cover vanilla arsenal and separatly override method from Bacon which is responsible for item insert.
But expected to have some generic solution on arma side, to cover all loadouts mods
Also doesnt work. Looks like ArkensoR is right, its too late phase for intercepting this
I don't know what he did. Permission to take items from arsenal should not be tied to storage. It's its own thing. The same way we check for sufficient supplies. CanX checks know nothing about it being an arsenal item with rank restrictions or cost. It only checks if the item can fit into the inventory due to volume and weight. The only thing that can fail afterwards is some unexpected things which is usually a programming or config error
But its not only arsenal. I think in my case it should be in storage. It could be pickup from world for example, from ground.
So its better to hadle in incoming storage, then all sources
Even if its not an override in his mod doesn't make the scripts in the components not run. Try to implement the same behavior where arkensor is saying to. The CanX scripts still run before the TryX
I already tried and it doesnt work with bacon
It works perfectly with vanilla arsenal, but not bacon đ
If the source is what makes the rule and it's always some storage you can avoid it being taken. If the item can be on the ground then you can avoid picking it up.
Either way I think there is a central method called in script by both inventory UI and pickup action. Maybe not. Check what the pickup action code does in script and see if there is a place to mod. I would normally say prevent pickup in the inventory but the actions would maybe bypass it if not also handled
maybe a dev has some possible input on this? I've swapped over to using the AttachmentSlotComponent for attaching and it's still an issue. Unsure where to go from here with it
I've set it to a Pivot ID, messed around with the RplComponent of the rail, tried various configurations in the AttachmentSlotComponent, and still is an issue 
It's positioning when attached is seemingly just not synced to the position of the weapon, because it'll follow the weapon correctly, just not in the position that is set in the AttachmentSlotComponent

SCR_EntityHelper.DeleteEntityAndChildren doesn't kill all children for some reason
And I don't understand why
They need to have the Hierarchy component
Wow! thank you so much!!
do map placed entities have const unique id's that can be referenced and found every runtime? I'm wanting to store then find some entities that aren't persistent and then do something with them on startup. I have a custom component on the relevant entities too
If you can identify the structure I'd think you'd be able to get a unique id for it at run time. i know for player/gm built structures they get a unique id.
I'd think everything gets a unique ID to differentiate itself from other entities of the same type
Store a static array of the entities in your component, when the component initializes add it's owner to the array, when it's deleted, remove the owner from the array. You now have an array that you can get that have your items in it.
no. they change on map edits
they have names tho, but if you have a component on them then you can register it in some system
This not being there is why maps are not moddable, only extendable
Iâm about to start looking through all the resources and any YouTube videos on scripting.
But before I start, any key things I need to know?
im in the same boat as you, i just started learning/scrubbing up on c# in youtube videos
Nice. If youâre down, we could share resources and help each other figure things out. Iâm getting more ambitious with what I want to build, but itâs still a bit overwhelming figuring out where to start.
Sounds good đ
How can I find the direction vector of where GM is looking?
you can get SCR_CameraEditorComponent and the SCR_ManualCamera is the GM's cam
Would this still have the issue of being different every startup or will it find it from the previously registered occurrence? Say the owner in a static array like zelik mentioned, would the owner be able to be found next start up from that array or would it change?
Thank you very much!
Hi, i attached a pipCamera to a Vehicle which will refreshed localy on FIXEDPOSTFRAME (30hz). But now i have the problem, that the camera clips into the Vehicle if you driving fast. I already set the nearPlane to 0.5. I do not like to refresh EachFrame, to save resources. Does anyone have a good solution? Thanks
Someone might know a bit more but it sounds like you'll have to do some compensation on the camera location depending on the vehicles speed. With the refresh rate being what it is instead on every frame it sounds like theres some desync happening
Is the camera even meant to move closer to the vehicle as its driving faster?
Yeah, because game is running with 120 FPS, but Transforms only 30 FPS. The idea with the speed is good! I will implement this
Working.. ty
heck yeah glad to hear it
Ah if you want to identify it between sessions then I guess entity name
Entity name is great, sadly you can't assign one to base scene entities.
Gotta do it at the right time in the frame, or parent it under the vehicle via child with auto transform
You can try looking at Tactical Data Link, I have a dirt simple camera prefab I attach to devices that seems to sync well, however for PiP display, it seems that even with such tricks, the vehicle you see and the data for where it is disagree and skip frames can cause camera lag. LODs are bad at distance anyways and limited by replication so might as well only use PiP in close by situations.
Engine quirk is what I chalked it up to since the PiP camera is almost like a ghost world that reuses what the âreal worldâ is doing so thereâs like a frame to frame delay with world renders > camera gets data and generates render data in copy world > data not ready to display that same frame > next frame the data generated in the previous frame is displayed on render target
For your use case though definitely attach the camera using add child with camera prefab like TDL, it will save you so many headaches. You will never get the timing right so let the engine do it for you.
How is damage handled after ComputeEffectiveDamage()?
I've overridden ComputeEffectiveDamage() to limit the amount of damage to not allow health to go below 5, but it just seems like there's some calculation to it afterwards that causes it to go below that threshold.
Going crazy a little bit trying to figure out why lol
What kind of damage exactly?
Projectiles have penetration which will trigger multiple time's iirc.
But not sure if/how this get's handled in term's of damage.
Testing with projectile damage currently. Basically just having a peer open and shooting it in the chest lol
I know this from the "Projectile Hit" event, where i went crazy cuz it always triggered multiple times, till i asked a dev and he told me the 2. event is from penetration.
But idk if this is handled somewhere else. 
Knowing my luck, it's probably all handled in C++
Goal is to not have the character die initially, but always go unconscious first
No matter how much damage is dealt to them
Want to give time for character to be defibbed within my custom gamemode
It was all working at one point in time, but I guess the devs updated something somewhere along the way that breaks respawning because of how I was handling it
I mean you could make him kinda invincible once ComputeEffectiveDamage() is triggerd and set the uncon state yourself?
After he is uncon you can apply the damage to what you like it.
Hmmm, could. Will give it a shot, thanks!
now I'm even more confused. I'm calling for disabling damage handling within ComputeEffectiveDamage(), and to return a damage value of 0, and it still drops my character's health to zero (but doesn't kill them) 
So that's pretty much what you were looking for.
But yeah strange behavior.
I haven't messed with this part for a long time, but when i did it worked as expected iirc.
yea
Did you read this: https://community.bistudio.com/wiki/Arma_Reforger:Damage_System ?
Iâll probably just have to either tackle it a different way or accept that it may not be fully possible now.
Iâve got it to a point now where it does what I want mostly, sometimes damage still passes through the invincibility when the character is being riddled with bullets and breaks it though.
Iâll look again when I wake up, itâs almost 4am so brain is fried
Maybe that Hijacking method is what Iâll need 
Hey everyone! In a prefab a vanilla class sets a hardcoded value to some variable.
I want that value to adjust to player numbers online.
How can I achieve that?
- I modded the vanilla class including that variable to calculste the value
- I didn't change the vanilla component in the prefab
- I tried to manually change the hardcoded value
What I get is the new hardcoded value in game, not the calculated one. Where could I go wrong?
Should prefab show a formula for the calculated value, not the hardcoded value, if i did it right?
In et file I see hardcoded one
Maybe show example, how you change vanilla variable to your variable?
Declared vars not changing by manual, you can override the calc methods.
Got it sorted, it was a wrong order of checking vslues and setting values đ
Nice read. đ
Hi! I have a math question. How can I scale DotCircle radius in different resolutions?
DotCircle's m_fRadius = 4000;
its 4000m on map at 1920x1080 resolution in my tests. (The marker's handler keep this size by mapzoom value.)
Horizontal scaling works but when i change vertical resolution too, the DotCircle changes.
How can i ensure the dotcircle keep 4000m in all resolutions?
Its already attached to a bone... But you had to all ApplyTransforms (see 2DPIPSight)
Will learning c# for unity help with enfusion and reforger/arma 4?
Only if you don't know much about object oriented programming. Otherwise it won't help you
Also "learning" C# with unity is gonna be mostly engine specific nonsense. If you are a noob to programming you may as well work on something a lot simpler like winforms or a console app.
I am actually going to hang myself wtf is that ? suddenly ALL the script got these errors on my project even dependencies scripts ?! wtf ?
what about experimenting with existing code and trying to mod? that the best way?
can someone plss help me
double left click the error and it should bring you to the line causing the code, its exactly what it says it is, you're missing a ; somewhere
brother it's on EVERY scripts, even the scripts of the dependencies like not my mods etc...
it appeared suddendly
i'm stressing rn
the ; errors are weird, check above where it says the error is at. Try restarting your workbench if you havent
If that doesn't work then whatever line you changed last, even if unrelated to the error, check that.
i restarted the engine removed the temp cache, restarted my pc
I also tried that
You'll have to look real close at your scripts then, can't pinpoint an error purely based off the error log without seeing the scripts that might be throwing it
It's pretty easy, assuming the workbench doesn't break on you and lie about what doesn't work
But like you should probably understand at least one language, and be willing to give up if something is too big for you to chew
Hey guys, I was wondering if you have any recommendations on what to watch or read when learning scripting.
Are there any tutorials, guides, or resources youâd suggest for getting better at scripting?
I believe I have it solved. Had to override HijackDamageHandling() in the character damage manager, calculate effective damage and the remaining health after the effective damage, then force unconsciousness and setting health to whatever value I'd like while returning true for hijacking.
As well (for what I wanted), I had to not permit unconsciousness on the character damage manager, then permit uncon through script before forcing uncon
took WAY longer to do than I feel like it needed lol
If you share no code no one can help you with syntax errors
you are right sorry, i was trying to troubleshoot and I think i've found the problem, i'll share it soon
sorry again
It seems like one of those odd cases where compiler errors do not give an accurate trace to what actually causes the issue, like when you try to RplProp a type that doesn't have native serialisation and get an error that takes you to base Rpl class instead of the class with bad RplProp
Generally when that happens the fix is to just undo your most recent change, using version control like Git will help a lot with these things
Hey, i get what you mean by its pretty easy, its readable, but the 'willing to give up if something is too big for you to chew', im sure, with time, ill get around it, but, what is this something id give up on, is it a part? or...
I have stopped making whole mods cause I wasn't ready for it yet. Some changes will just be a simple file edit, and some will be multiple files and tons of custom new code.
Cause you learn from failure sure, but if you can't get past that failure it doesn't help grinding gears
ah right yeah, dont bite off more than you can chew/grinding gears, will bear that in mind đ , was and still am looking for a scripter for my mod, and hopefully learn from
#creators_recruiting message
If I read your post right you are just adding animations? That requires very little scripting (usually).
Watch BI's modding bootcamp videos on scripting topics, read through BIKI pages on scripting will give you a general understanding of how most things work. From there you can search vanilla scripts for examples of similar things to what you are trying to do / usages of things you are trying to interact with in your scripts
For example if you want to learn how to do things with the inventory, search codebase for usages of inventory manager class etc
i want to learn scripting for animations and the rest, the rest meaning implementing the function behind the animation, e.g drag, a new medical animation,etc*
That's wouldn't be to terribly hard to learn, at least I don't think so. If you've done any programming before you could more than likely figure it out.
this especially when missing a semicolon, it sends you to the next line that tries to compile instead of where the error is actually at. God forbid you close a function right after that then you have more syntax errors
Or adding one by mistake:
for (...);. One can be quite blind to such.
There are also thouse error's, which appears in the log only but not directly as an error message.
If you don't know/notice, it's pretty much â°ïž
Just dont write bad code
Easy fix. đ
Quick question: Is there a way to check if a player has the map in their hand? So, a kind of gadget check.
Is there any way to prevent auto waking up from uncon without healing? Making it very slow would work too
I couldnât find any clear info on what makes a player wake up and how to slow it down or disable
Jfc
Yes there is.
If you need the code i can post somewhat later.
yes gladly
Try this in remote console when play in viewport:
int playerId = GetGame().GetPlayerController().GetPlayerId();
IEntity player = GetGame().GetPlayerManager().GetPlayerControlledEntity(playerId);
SCR_GadgetManagerComponent gmc = SCR_GadgetManagerComponent.GetGadgetManager(player);
IEntity gadget = gmc.GetHeldGadget();
Print(gadget);
if map in hands you will get map entity, then you need only compare of the 3 types of map entity.
or just check there is SCR_MapGadgetComponent in entity
Why go through the playermanager to get the controlled entity?
You realize the player controller does that?
Not tested but "should" work:
SCR_GadgetManagerComponent gadgetManagerComponent = SCR_GadgetManagerComponent.GetGadgetManager(owner);
if (gadgetManagerComponent)
{
SCR_GadgetComponent heldGadgetComponent = gadgetManagerComponent.GetHeldGadgetComponent();
if (heldGadgetComponent)
{
EGadgetType type = heldGadgetComponent.GetType();
if (type == EGadgetType.MAP)
{
//! Map in hand
// Continue...
}
}
}
Oh... đ€Ș
What should i learn first/more, C# and/or Java, and why, before i spend a ton of hours learning and headbanging please đ
works like a charm, thanks
Depends on the purpose, if you're learning it just for the sake of trying to use that knowledge in enfusion then it really doesn't matter, they flow the same way at the end of the day. If you're learning it to use it in a practical sense then I vote C#, java's environment is ass, setting it up is ass. Everything about it in my view is ass. But that's just my opinion that comes with a deep seeded hatred for it for over 14 years.
C# just works, java will make you hate programming for the wrong reasons
It's only one fast way for get player controlled entity in remote console. Have several ways, its only example.
I could have used camera manager to get the cursor target entity if want check other entity not own player.
My purpose for now is for animations, but then i want to learn more than just that, for giving function to animations, and also for cinematics and, new features, what not
Oh fair
I wrote so much garbage code (over two thousand lines) in one file that Workbench crashed immediately when I opened my project. It seems this isn't very friendly to someone like me who likes to write mountains of code....
AI code ?
i assume
That's partly the reason, but I think the main reason is that Workbench is inadequate, especially since I've done a lot of modularization work.
it is but tbh i have never seen a component of 3000 lines that wasn't written by AI, issue with AI is that when it fails somewhere it will keep appending new stuff to the file making the script further impossible to read or maintain and eventually reach that workbench limit
@shell quarry
m_fFoo
m_ -> class attribute
fFoo -> float foo (i usually skip that part)
you can also make sFoo for string bFoo for boolean etc but i feel like it is unnecessary
Program: C:\Program Files (x86)\Steam\steamapps\common\Arma Reforger Tools\Workbench\ArmaReforgerWorkbenchSteamDiag.exe
Reason: SEH exception thrown. Exception code: 0xc0000374 at 0x7ffd4e057665đ
Currently, the largest file in this project has approximately 1900 lines.
Hello! Do you know which script or method to call so that the AI cannot PerformAction to open the door?
thanks â€ïž
it was a simpel google search ahahah
1000 of it is comments every third line
Anyone got any experience with tweaking the respawn system customly? in short i've built a menu fot you to select your faction Civ EMS and police. after that it takes you to your faction you have selected and shows the spawns available for those factions. On death I tried just making the Faction based respawn system pop up but it seems to flicker / break and can't click anything on that UI. I had made my own custom gamemode, I have made my own custom MenuSpawnLogic is there something I am missing tweaking for respawning?
The general idea of menu spawn logic is correct, but you may be faced with refreshs that our vanilla menus do. i think you could make a similar one but inherit from the base logic, and stay closer to what auto spawn logic does.
Any idea would could be causing the respawn (2nd image) to open and close?
I just donât know where to inherit from either haha
I can get it to open but
It just flickers at like 60 times per second
maybe you are listening on the wrong the events on the client. hard to tell without seeing the setup. all i can tell you is the respawn system in reforger is a very fragile thing and not very nice to mod, so you need to fully understand what you are doing to get things working in the way you want it to be.
Is there a smart way to sort a SET ?
What are you trying to achieve in this case?
Alphabetical sorting, but i found a soloution
Sets are sorted by the type they contain to ensure uniqueness. Strings are sorted by alphanum, complex type by their unique instance adress. If you want a sorted array instead there is an SCR class for it you can use. and to turn it into a set you can inherit and add a check to not insert if already present
How can i convert a string (vector) back to a Vector?
vector vOrigin = localChar.GetOrigin();
string sOrigin = vOrigin.ToString();
vector vString2Vector = sOrigin.ToVector();
Print(vOrigin);
Print(vString2Vector);
SCRIPT : vector vOrigin = <1160.47,39.573,2825.63>
SCRIPT : vector vString2Vector = <0,0,0>
The ToString method has parameters for the vector to make them pretty or not. You need the format with "X space Y space Z". Then you can assign it from string back into vector automatically
Is there anywhere that fully explains how it works?
It's all documented in the code. Start at the gamemode player events, that calls the respawn system, that calls logic which calls consequent requests on the player controller whose responses get handled by the handlers attached as components to the respawn system.
Are any folks here doing development with Claude, Copilot etc. assistance? Is there enough Enfusion Script out there to enable the agents to write decent code? I've done a few tests in VSCode but the results aren't great. I wonder if an extensive set of skills prompts might help
He is messing with it as well i think: https://discord.com/channels/105462288051380224/1463106316510695514
At least to some extend.
I tested enfusion mcp yesterday with some random stuff and it actually works⊠donât know about complicated stuff but for basic thing seems to work, I used opus 4.6
Thanks folks, I will have a look this evening when I get some time.
Sorry I posted this in external tools too but I canât find a real answer anywhere. Can I capture a camera frame as image data from Enforce Script at runtime and POST it via REST?
Maybe, but it would be via a lot of code to manually get the data and encode it as string to send via http. Probably too big for a payload
Yes I know there is a limit at 8k something bytes
I reached it already with some stuff but I basically repair the truncated json on my end
But if u think thatâs possible I will try.
Is there any way to chunk the image data across multiple REST calls and reassemble on the other end? Or is there a better approach youâd suggest for streaming visual data out of the engine at runtime?
Is there a way to write image data to a local file from Enforce Script at runtime that an external process could read?
Something that always comes up with rest API is someone will mention it don't work on Xbox/PS5. You can use regular file api for read/write in profile folder
I already use the rest api. Works on all consoles and pc. Both ways.
Saving local files is PC only
Ok, well, BI people like saying it doesn't work on console even if it does lolol
Rest api is server only
Clients can't use it. Unless there's been an undocumented change
I run my own dedicated server does that change anything? The REST calls we already have work fine server side
Can the server write binary/image data to a local file using the file API or only text?
Scratch all this I understand what u mean, so the real question is: Can Enforce Script on a dedicated server capture a camera frame as raw data and split it across multiple REST calls?
Servers are headless. How are the capturing the "camera frame"?
REST calls work bidirectionally already, confirmed. The camera feed would need to be client side since the server is headless. can the client side of a mod capture a rendered camera frame as data and POST it via REST to an external URL?
rest works on pc clients accidentally
it can be removed at any time
But I have my system working for everybody⊠I can literally show you the data.. I posted a video a few days ago in external tools too
At this point my question is if there is an official supported method for thisâŠ.
Vlad is correct; not officially supporte
Omg đ
Are you sure that it works on pc clients and it's not specific to diag executables?
now - idk, at some point in past - yes, one of my friend already do some stuff using this when I send him message from above (but it was after few days)
Iâll have to change everything đ
But it worked great just letting devs know.. this was perfect
No performance issues at all
Thanks for the knowledge though â€ïž will fix this asap
We have no reason to remove it right now, but we simply can't assure you it won't be revisited in some update. We have a larger refactor planned to make it nicer for modders but that might be also the time it's switched to a new internal API handler for web requests which is definitely platform locked.
Hey guys sorry for the confusion I panicked reading the conversation. Just reviewed my code and all my REST calls run server side behind a Replication.IsServer() check. The server makes all the calls, clients never touch REST directly. So I think Iâm actually fine? The accidental client REST thing doesnât affect me. Thanks for the help anyway, learned a lot!
But you can't take screenshots on the server. But in theory you could take on on the client and try to send it via an RPC, but it's going to be a lot of work to split it to not choke up networking.
Im trying to do it first with a simple script that takes a single screenshot tries to encode it and POST it. Lets see
Ok wait if you say that then I had this pipeline in mind already:
Client takes screenshot
â splits into chunks
â sends chunks via RPC to server
â server reassembles
â server POSTs to Firebase
â app displays it
And from what I just read you guys lifted the 4k prc call cap
Yes but that does not mean you can send it all in one go. It will take for ever to transmit reliable which totally chokes out your server for the entire time
Guys, is there any advanced/specific tutorials about connecting scripts into animation editor? I need to get variable from scripts into animation graph, but official tutorial video only shows how to override existing one and not create new one. Maybe theres some text tutorial on bohemia site i missed that can help me
Thanks a lot, really! I i will update you đ«Ą
can someone come answer a few questions i have in a vc ADHD doesn't help me with reading so vc would be faster and better
People are more inclined to help if you just ask your questions here.
thanks for the reply
did something change regarding how to get components to appear under the script section for ui
I don't know what you mean by that exactly but, all scripts need to be in the correct module and you have to validate and reload(Shift-F7).
maybe a better question would be is there an already made component in the base game already that would allow me to put a character preview into my ui
Not really, that consists of using a ItemPreviewWidget and then using custom functionality to then render the character on it
hmm so then you cant just use the one used in the inventory
ahhh of course it does
If you want it to be controlled by a component then you must write a custom component.
ok i did that but when i tried to find the component in the place where you add a script to a widget it dident show up thats where my original question come in
Then either A) it's not in the correct module or B) you didn't validate and reload.
^
Don't use SCR as your prefix. That's for scripted classes provided by B.I.
Meaning, if they every decided to have a class with that name, your mod would break.
class CharacterPreview : ScriptedWidgetComponent
oh
lol
ok issue is still it wont let me attach it to a widget it wont show up in the list
There's no need to have the preview widget name as an attribute.
Put it in the correct script module.
In 99% of cases, it's the game module.
It's common for UI
Doesn't make it any less uncalled for.
i do so alot and it make everything so much harder
prolly from not having full understanding
also what do you meen by this im sorry
Put it in the correct script module.
In 99% of cases, it's the game module.
If you will make entire UI by your own, then yes, you can. But when you try to use 3rd party widgets and/or provide others to use your - it just blows up without simple widget name
Place all your scripts inside scripts/Game folder
ngl i think i dident even do the folder structure right if thats what your saying
Was pretty sure script modules were explained somewhere on the wiki in the scripting section.
ADHD doesn't help me with reading so vc would be faster and better
^
this
i learn from vids
ive tried to read small parts at a time ive picked up some parts but like i said reading doesent do anything for me in through my eyes and out of my head 
ok i get that but i have it here
YourModName/Scripts/Game/UI/MSFT_CharacterPreview.c
your saying it goes up one dir
and your also saying i dont need this [Attribute("CharacterPreview")]
maybe i dont have adhd i got the hard tism
ohhhhhhhhh
Hello folks.
I'm kinda new to Enfusion, and I'm facing a wall I can't find any information about.
I'm trying to make a new class inheriting from the built-in VehicleControllerComponent, which is a somewhat normal class as far as I can tell, but even tho the boilerplate looks correct according to what I can see on the wiki, I can't see my component at all when I try to attach it to a any prefab, even while inheriting (or overriding) it from the built-in Vehicle_Base prefab.
The script compiles fine, my other components appears to consider the class valid, but it's not getting listed as an attachable component, while engine's built-in components (inheriting from the same class, such as CarControllerComponent, ect...) do have the same file structure as mine, except they work fine.
I saw that these working classes are apparently generated, but once again, I can't find anything documenting it, and don't really understand what makes them work correctly while mine isn't.
Does anyone have any idea what am I doing wrong?
Share the code
You are probably missing the class decorator to make it available for editor use
Most likely your script is outside of /scripts/Game folder or missing *Class variant of your component
I got other components in the same folder that are inheriting from ScriptComponent instead and those are listed just fine
Then do what mario says
Nice pfp Mario. đ
Alright, just don't pay attention to the subject, I just wanted to try my way of doing it
Non-attachable component :
class JetControllerComponentClass : VehicleControllerComponentClass
{ }
class JetControllerComponent : VehicleControllerComponent
{ }```
Attachable component :
```[ComponentEditorProps(category: "GameScripted/Vehicles/Jets", description: "N/A")]
class JetBaseComponentClass : ScriptComponentClass
{ }
class JetBaseComponent : ScriptComponent
{ }```
From my perspective, the only difference I can see is the component I inherit from
is it not SCR_ marked?
in my tests SCR_CarControllerComponent inheritable but if you use CarControllerComponent not showing on "add component" or "change class" list at prefab @tidal elm
So I am trying to create a cinematic with a scene involving a helicopter crashing into the water. The problem is im having a hard time making a script to control the helicopter crashing. This is the script that i currently have that does work class Scene_1_Class: CinematicEntity
{
// user script
void OnKeyFrame_Heli_Movement_0()
{
vehicleGO("Cinematic_Flying_Mi1");
}
void vehicleGO(string entityName)
{
GenericEntity vehicle = GenericEntity.Cast(GetWorld().FindEntityByName(entityName));
if (!vehicle)
{
Print("Helicopter not found"); return;
}
SCR_HelicopterControllerComponent heli = SCR_HelicopterControllerComponent.Cast(vehicle.FindComponent(SCR_HelicopterControllerComponent));
if (!heli)
{
Print("Helicopter controller missing"); return;
}
heli.StartEngine();
}
};
What im trying to do is make it veer to the right and decened rapidly in a autohover style decend.
So I should inherit twice (VehicleControllerComponent -> JetControllerComponent -> SCR_JetControllerComponent), and this last one should work ?
I did tried that path, and still the same result
I also tried to inherit from the built-in "AirplaneControllerComponent", which crashed the editor during script validation and made the project impossible to load
And after that, I did go check out the R3DCore addon, just out of curiosity, and they did inherit from SCR_CarControllerComponent, so I'm assuming that it really is the only way to go to this date
Hi. For some context, I'm using client side modded SCR_MuzzleEffectComponent to detect shots from certain modded vehicles where normal server side approaches have not worked (eg most pilot operated guns in WCS tha don't raise the normal shot events on the server ). I use these for stats collection and it works fine. However, I've noticed that it is possible for multiple clients to report the same shots which i guess makes sense. the problem is that it is not easy to filter these as i can't get information about the vehicle /occupant who is shooting.
In order to filter out clients that aren't actually shooting, I need to be able to detect the vehicle that the muzzle effect is attached to, so i can then find the occupant. So far I have not worked out how to do this (I can get the owner of the SCR_MuzzleEffectComponent, but so far have not been able find an attached vehicle).
Can anyone tell me how I can find the related turret/vehicle (if this is even possible on the client side)?
Hello!
I have a strange error. If I add this code to a prefab and recompile the game, this error appears.
[BaseContainerProps()] class ARMST_ITEMS_REPAIR_COMPONENTS : GameComponent { [Attribute(ResourceName.Empty, UIWidgets.ResourcePickerThumbnail, desc: "ЧŃĐŸ ŃпаĐČĐœĐžŃŃ", "et", category: "Repair")] protected ResourceName m_PrefabRepairs; }
I can add this ResourceName to any component and still get the same error.
There are no errors upon first launch. If I recompile the game, the item disappears from the world at launch, causing an inventory error, for example.
This code is not even used anywhere, it's just that because of the reference to ResourceName, the item disappears from the world after recompilation.
Maybe that's why? When I recompile the code, I get this error. If I run the tools without mods, it's the same.
just ignore
I have a vehicle where I've added my own component. Player GM spawns the vehicle via GM entity browser. The GM player is looking in to certain direction (camera direction) and I can find this information in e.g. OnPostInit().
How can I store the camera direction (vector) in component for future use? Storing it in a member variable in OnPostInit() while on client side does not work.
What approach should I take?
I believe this approach is flawed, because a GM can freely rotate the entity while placing in the ghost mode. Your camera perspective on it has little to do with it. the camera is fully local, a dedicated server does not know about where you are and what you look at specifically. If you absoletly need to you need to grab the information on your client and nicely ask the server to handle/broadcast it for you by sending an RPC to it via your own player controller. you can not send rpc from the vehicle, as you do not own it, the server does
Thanks, makes sense and explains why RPC does not work.
I want GM to be able to spawn the vehicle and have the first waypoint towards the direction he is looking at. It is enough to know that we're looking 'north'. I turn the vehicle to that direction so I ignore any rotation the GM has done.
I need to send the information the other way around. I want server to know the camera direction when the vehicle was spawned. The direction to move to is vehicle origin towards the camera direction. Works perfectly in WB, but not when we have clients in the mix. đ
As I said, only the person who spawns it knows. So you need to hook into the placement process and grab the current camera info before the placement continues. Send it to server via your local player controller as new rpc you add there on a component. then on the server you can store the info. to apply on the next spawn. doing it on the entity post init might be too late because by then you can have already moved your camera.
In general this setup sounds strange and should not be something you do. If you want to auto setup something, use the direction the vehicle is facing, not the camera.
Thanks for the time to respond. Using the vehicle direction is so much easier, so I'll change.
Hello quick update, I made the image/video stream possible via base 64 encoding and endpoint decoding. Video is like 2 fps but itâs fine for what Iâm trying to do now The images arrived intact at the webhook. 63.1 KB. 0.002 seconds.
Brilliant. Now never show the code to anyone from the enfusion engine team so they do not die of shock. We need them alive.
Sounds a bit silly hearing BI employees allude to code quality when Reforger is the least stable and most buggy piece of software I've ever played with
Sir I am a programmer not a script writer, I am allowed to rant about them.
đđđ
Thanks for the great advice btw!
Hey guys
Can you tell me how GetHealth works in HitZone? Limbs have HP, and if you add them all up, what's the character's HP? I can't figure it out.
Youâll want to get the characters Health hit zone for overall health. Can use âGetHitZoneByName(âHealthâ)â or âGetDefaultHitZone()â, I believe
I'm probably talking about something a little different.
The HitZone class has GetHealth.
And DamageManagerComponent has GetHealth.
The second one definitely displays the character's total HP, but what about the first one? Does it show HP from arms or just anything?
I believe the hit zone GetHealth() will show the default hit zone, which would be the health hit zone for a character, or a specified hit zone if youâve casted to it
So is the difference between modded and override in classes just that modded is for adding functionality/data while override is for method overrides?
Like modded works with multiple mods, but override overwrites the function?
Modded class can let you change base game functionality/a mods custom class functionality(so long as licensing allows it). Inheriting from a class should be used if you plan to make your own custom functionality.
Like I mod the base game inventory classes for logging.
Yeah but what's the override keyword for?
I'm trying to change my classes to modded, and I haven't needed inheritance yet
For context most of what I'm doing is modifying another existing mod, not reusing it's components
modded is about the class itself â how it integrates with other mods.
override is about individual functions inside that class â replacing specific behaviour.
Overrides are more for the functions themselves.
modded class SCR_ChimeraCharacter
{
override void EOnInit(IEntity owner)
{
// super will run the base class/inherited functionality
super.EOnInit(owner);
// do your custom functionality here
}
}
Looks trash since I'm on my phone but thats the basics
Thank you, that is helpful
Oh that also explains why my own mod works now, I was using override on the class level, and at some point I swapped it for modded and it worked. gd
Well there's a time to learn everything
Well you kinda need to know how the scripting works before you can actually do it. Read everything you can about the topic on the wiki.
How can i make certain lights pulse/flash?
Nah we dive in with no knowledge and 0 direction. Docs? Who's that?
from script
EDoom renderer didnt kill them
So i dont think this will

Think about it this way. Whatever you have could be way worse
And it is always positive to aim for higher quality regarless of the situation.
Look at Cain library flickering light
Overall modders do very well but the bar is pretty low considering y'all release updates that crash the game when a number goes from 999 to 1000
can somebody enlighten me please. I'm kinda at a loss here. Does reforger not have any server side capabilities? And the only thing I can do is REST APIs ? So any script kid can just rip the whole server + client at any point ? Like everybody forced to do an opensource project ?
sorry if this has been discussed before, haven't found the definitive answer to this
You can put some capacity of code into scriptmodules and dynamically create them at runtime, but there are limitations with that and it is not worth the effort.
I see, thanks for the answer!
Hey everyone, I've found a GM action to disarm heli rocket pods. Can anyone help to implement a script to apply this action to every spawned heli with pods?
Same as if I called it on a newly purchased heli, but automated
I just need some guidance on my question, not someone to do it for me
Custom ELightType not working with SCR_LightSlot and emissives. Script recognizes it, but no glow. Do I need to override something to register it?
modded enum ELightType
{
Age_test,
}
Video encode from game and decode on browser or vice versa?
Light enums are handled in engine so while you can add your own there is no code accessible to you to turn them on/off
Hi.
Im looking for somewhere i can hook in and catch when an entity fires its weapon.
I am interested in catching from both player and AI entities.
Anyone know where i can do that?
I think the MuzzleEffectComponent on weapons has a OnFired() method, and a subsequent scriptinvoker in the SCR_MuzzleEffectComponent class.
Might be a better way, but that's from a quick symbol search in script editor
Much cleaner approach is the "OnProjectileShot" event handler on the character. Have a look at SCR_DataCollectorShootingModule::AddInvokers for an example on how it can be used.
make sure the material you want to glow isnt set to 0,0,0 on the emissive value (not LV) you want it to be 1,1,1 and then it will glow
Encode in game, decode on the receiver side. Screenshot captured in Enforce Script, converted to base64 inside the engine, POSTed via REST to an endpoint. Receiver decodes the base64 back to PNG.
Interesting, didnât think you could send screenshot data from the game since it always crashed me on next frame
Please let me know how! Haha
The trick is CallLater wait 1000ms after MakeScreenshot before you try to read the file. If you read it on the same frame it crashes. Give the engine time to finish writing first.
Found it but changing color doesn't do anything.
never played with that to be honest, just remmebered there was that light
Does anyone knoe how to apply a script to a newly spawned helicopter? I can't find how to catch that new heli to attack a script to it
Somewhere here: SCR_EditableEntityComponent i think.
GM spawned?
Purchased in a helipad
The idea is disarm all new spawned helis
I have a disarming script
But can't find how to apply it to a heli so that it's disarmed
Maybe there is a simpler way though
Adding this script to every heli prefab though migh be even wirse
Well shouldn't be that hard.
Simply check for example if the IEntity owner is a helicopter and if yes let it execute the script.
Maybe there is something more specific to helicopers/air vehicles, but this is the way i know of doing things like this.
I'm not sure what would be the most crash/fail proof solution to spawn a heli in a specific condition, e.g. without rockets and ammo. Before now the prefabs were edited that way but it requires to edit every prefab
I'm trying to spawn an entity flat on the XZ plane. Dropping it via GM aligns it to ground. I want to straighten it.
I've tried SetAngles(), SetYawPitchRoll(), SetWorldTransform() and then Update(). Nothing seems to have an effect on the orientation. What am I missing?
Doing this in OnPostInit and EOnInit has the same result.
vector it
What?
have you tried EntitySpawnParams?
Not sure if this is the right place to post or not, but⊠Iâm trying to inherit and edit EditorModeBuilding.et so that it calls custom prefabs for helipad compositions which have a subclass on them in place of SCR_CatalogEntitySpawnerComponent, so I can script my own additional cooldown timer for vehicle spawns. Only problem is: when I run it, the game continuously calls the GUID for the vanilla editormodebuilding prefab instead of my inherited one. Is there any way to make it call my inherited editormodebuilding prefab?
Can someone explain to me how i can get this variable out of eventhandlermanagercomponent, i need to check it in my sript when event raised but all i can find is just how to perform script when event raised and not how to get this bool out
I found a workaround for the editor stalls when working with large amounts of plugins in enfusion and opening the script editor -> That work around was to use VSCode with the enfusion plugin.
Is there a GetSurfaceY() function that takes in to account any entities at that spot and returns the height including entity height?
New to scripting. Trying to add two new area types. Iâm unable to inherit loadoutareatype I can only duplicate. Is this a thing or am I missing something?
Not to my knowledge, but you could cast a ray from the sky downwards
Ok. I succeeded with world.TraceMove().
how'd you fix this? also trying to turn on rcon in dedicated server tool
Hi , I have a question about the loadoutinventory. I created a script to insert, for example, the helmet cover into the helmet slot. The script inserts the cover, but once inserted, I can't see it in the helmet storage, so I can't remove it. Do you know which script I need to modify? Or is it just a simple prefab setting?
DStool doesn't listen to RCON you need to start arma reforger server on it's own as if you were hosting an actual server or get a server running and use it there
I just ran a local dev server using this -config and could connect with battlewarden, though that tool is hard coded to use commands for older arma games so it is not as useful.
{
"region": "EU",
"publicAddress": "local",
"publicPort": 2001,
"game": {
"name": "Arkensors little corner of fun",
"passwordAdmin": "xxxxxxx",
"scenarioId": "{68D1240A11492545}Missions/23_Campaign_HQC_Arland.conf",
"visible": true,
"gameProperties": {
"fastValidation": true,
"battlEye": false
}
},
"rcon": {
"address": "0.0.0.0",
"port": 5001,
"password": "xxxxxx",
"permission": "admin"
}
}
thanks for that tip. is it still not possible to combine this with local addons though? only way i've been able to get this to work is to publish my mod and add it to the config
No
thanks
Is there a Format Document option like in VSC ? I see only Basic Code Formatter which just does something and don't really format anything for me
You can open in vsc and format it)
Am I able to force a client to equip something in their hand through script? It seems no matter what I do it is getting blocked
Please ping me if you can help
If the character is controlled by a player you must send them an RPC so they take it in their hand, you can not manipulate their storage from the server side sadly
hmmm I have been doing rpc. I am trying to achieve equip item > use item > put new item in inv > delete original item > put new item in hand as a way to replace an item the player is holding. I can do all of it except for the last part. I am not sure if gadgetManager.SetGadgetMode(newItem, EGadgetMode.IN_HAND); is what I should use but it will work in the workbench just not on a server.
Call it from player controller
Trying to wrap my head around something.. I have a SCR_ScenarioFrameworkGet action that's supposed to pull an array of SCR_TaskExecutors from my missions entity in the world. It does so seemingly fine, so then I need to get the playerId and such from the SCR_TaskExecutorPlayer.
I'm able to pull the playerId, but GetGame().GetPlayerManager().GetPlayerControlledEntity(playerID); to get the character entity always returns null for a client-controlled entity.
What direction would I need to go in to fix it?
script is based originally on how SCR_ScenarioFrameworkGetArrayOfPlayers is set up
A player is the player controller. It does not mean that when you ask it controls any character. The task executor could have an old player id inside too.
How can I trigger a custom effect? ââIt needs to be added to the DefaultPlayerController in the HUDManagerComponent, right?
Theoretically they should be controlling a character, as theyâre only added to the main entityâs array if they have a gadget equipped, and removed when unequipped, etc.. And even in the case of testing with peer tool, when the peer definitely is controlling an entity and has that gadget equipped.
Itâs recognized in everything prior to getting the controlled entity from player manager (which could just be a workbench issue, but it doesnât work in a DS either, which is why Iâm working on it)
Might be a little deeper than that though, thinking now, because I canât get DS to print certain test prints I can get in peer tool 
I want to do things on player side when their GM view is open. I'm looking at SCR_EditorBaseEntity and related classes like SCR_EditorManagerEntity. I have a system that in Init() would do GetOnOpened() and GetOnClosed(). Works nicely in WB. With Peertool I can get the Init() to trigger in client side.
On the client side I just can't find SCR_EditorManagerEntity or SCR_EditorBaseEntity (...GetInstance() ). Returns null.
What entity should I look for?
Or should I have some other approach?
SCR_EditorManagerEntity is client side and override bool IsOpened() will trigger whenever GM U.I. is open.
Local for the GM client.
I found that when running sphere queries, if you delete found entities in the callback method, the query will fail to find unrelated entities that would otherwise have been detected.
int c = 0;
private bool AddEntity(IEntity e)
{
c++;
delete e; // c will be different if this line is removed
return true;
}
GetWorld().QueryEntitiesBySphere(GetOrigin(), m_fRadius, AddEntity);
Print(i);
Without the deletion line, the game prints c=10, with the game prints only c=6.
The issue is not that I am deleting child entities, it's regular independent prefabs like trees or props that are not found! The entities that were not found do in fact remain in the game and are not deleted. I can reproduce this reliably.
It would seem that deleting entities during a sphere query can somehow prevent the query from working correctly. Is this a known issue?
Thank you!
As expected, if you delete while traversing the entity query structure you will not find the rest as it skips indicies. This is per design. The vanilla prefab deleter needs to be reworked for the same reason. Collect every entity you want to delete and do that. Also do not use delete keyword unless you are 101% sure the entity is not replicated. use the DeleteEntityAndChildren helper method instead
Ah, makes sense, thanks. I already use DeleteEntityAndChildren, just used delete for the simplified example.
Ds tool / peertool does not perform like a live server. No matter how adamantly the devs say it does. It does not.
Best test results come from a actual dedicated server
There are a few differences, it comes down to being server and client at the same time. RplProp callback methods for example wont he invoked - as documented - so if you don't write your logic accordingly it won't work. But neither would it if you host a server from main menu.
Also, one more thing since you mentioned the needed rework for the SCR_PrefabDeleter.
It uses a CallLater from EOnInit to delay the query. In my own entity deletion script, if I omit this delay, there will be a mismatch when clients join.
Is the CallLater delay sufficient for avoiding this, or is there also a better way, like using another event or waiting for something specific?
No deleting until world post process event is raised. Afterwards it's safe
I still can't solve this. I've completely moved the entity script to a server-side WorldSystem, so that part has changed. But GetPlayerControlledEntity() continues to return null when there is clearly a character entity.
Anyone have an example I could look at?
in server side you need determine which player controlled entity
GetGame().GetPlayerManager().GetPlayerControlledEntity(playerID); is ok, always working in server side
i suggest print out varaibles and arrays step by step
Yeah, thatâs what Iâve been doing. Iâll post my code in a moment and see what I could be missing
I need some help,
I want to create an script that when you click on a button on the car, the smoke launchers of the car get fired.
I have the car with the switch already created and working, and connected to the script, but I don't know how to call the weapon's fire trigger..
(right now, script shows the weapon to be use on console).
(Smoke launchers were already working from turret, but we want to fire them from vehicle console panel).
Any help is really welcome.
Thanks
omfg I finally got it lol. Issue was because playerId was invalid, but only on DS, and not peer tool. Peer tool kept saying the playerId was fine when it wasn't. All my replication script I had was correct for getting the player controlled entity, it just wasn't correct (or missing, rather) for registering the playerId to the system
relatable
I say forget about Peer Tool for a very long time.
ArmaServer.exe is always giving the best results.
I was pretty much in the exact same situation, where stuff worked in Peer but did not on Server.
When i found out it did not on Server i was already pretty far with all the stuff, so i had to start from scratch. đ
So many things I've built that works in workbench but not on a DS. I've found the best way to test my stuff is uploading every patch and trying it on a test server in the same exact env as my main server
It's always recommended to stay away from peertool, 9 times out of 10 it's a trap. Though I have had some instances where DS or atleast the diag clients were a trap. Something could work perfectly fine on the diag client/server but the moment it went to a production environment it would crash 
Been there so many times. đ
What's the best way to lock a storage container so nothing can be inserted? RequestUserLock() doesn't seem to do the trick, unless I'm using it wrong
Goal is to just prevent items from being inserted before calling for deletion of the entity
But if the player is already in the storage when it's called, seems to still allow inserting items which ultimately get deleted along with it
Remove vicinity ability then gate the storage through An open storage action
Itâs like ten lines
Gotcha, seems easy to do, just figured there'd be a specific method for it
As far as Iâve seen I donât think thereâs vanilla stuff for that
What can cause BaseContainer::GetResourceName() to return an empty ResourceName string ('')?
It happened for instances of a particular but normal prop prefab that is placed in the map, it does not appear to have anything wrong with its resource name.
Is the inventory manager blank? If it has one?
It's a regular vanilla prop, {CC66836BF4E211F9}Prefabs/Props/Military/Camps/Duckboard_01.et
I can get the BaseContainer successfully, but when I called GetResourceName(), it returned an empty string
How are you getting it to begin with?
Sphere Query finds the entity, GetPrefabData(), GetPrefab()
BaseContainer doesn't even have a function to get a prefab name.
Unless you're using a helper function
It does, via inhertitance from BaseResourceObject
ohh I missed that
Regardless, if you get the prefab data you can just get the resource name from it.
IEntity PrefabThing = GetGame().FindEntity("PrefabThing");
Print(PrefabThing.GetPrefabData().GetPrefabName());
Right, but I want to use the BaseContainer one because I'm also checking ancestor names
I also wouldn't be surprised if GetPrefabName has the same problem
it doesn't
using the base container, if it doesn't inherit from anything it doesn't return a resource name
I am not sure what you mean by this
This method works for all kinds of other props
It has inheritance, you selected the component
And even if it didn't, GetResourceName should work regardless of that
IEntity PrefabThing = GetGame().FindEntity("PrefabThing");
BaseContainer BC = PrefabThing.GetPrefabData().GetPrefab();
Print(BC.GetResourceName());
That works for me.
I know, this works for me too, it's just that with this one particular entity it returns an empty string for some reason
The example i'm using is that prefab....
Maybe something else is interfering, I might do more testing tomorrow
After doing a few test, I am running into the same issue.
Trying to disable all actions on an entity, except ones matching a certain name, but calling SetActionEnabled_S(false) through server Rpc doesn't seem to make a difference, despite it being called on server (proven by prints).
Anybody else ran into this issue or see what I could be doing wrong?
Rpcs can only be sent to the server by the owner of the thing
Owner being the owning client not "GetOwner()"
OnBuriedStatusChange has to be called by the owner of the thing.
It is being set buried through a user action, which calls this from the action:
void SetIsBuried(bool buried)
{
m_bIsBuried = buried;
OnBuriedStatusChange();
Replication.BumpMe();
}
so would it not be called from the owner, being the server...? Or am I mistaken?
The OnBuriedStatusChange() and SetIsBuried() is within the component of the entity
Also, in the original code posted, I get those prints in the server logs and not the client, wouldnât that indicate the call is not being dropped by the server?
Hello. I am not new to scripting or programming itself. Coming from 5 years of the gta modding community. I am having a bit hard time to understand how server/client work and how to write code. In the other games we usually have like separate client and server files and they communicate via events. Now in Enfusion looking at it seems like itâs all in the same c file. How do I approach this without it turning into a mess whatâs client and server stuff. Thanks
If you haven't yet, I recommend watching the Bootcamp replication videos (https://youtu.be/asWxIIHT6d0?list=PLfUcrRpCM_fKjkTrkV-bqnknVbFCPA3YU) and looking at the Script API replication pages (https://community.bistudio.com/wikidata/external-data/arma-reforger/EnfusionScriptAPIPublic/pages.html).
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...
Oh okay thanks I will look! đ Btw in the enfusion is it possible to spin up a local host server + you as a client with separate consoles for server / client.
You can start both a local dedicated server and a listen (player hosted) server directly from the Workbench, using the Dedicated Server Tool and Peer Tool respectively.
Okay cool! First day today when I found out about arma reforger and enfusion. So just trying to get some stuff into my head about basics. Didnât see no extra console when I selected âLocalhost serverâ . Perhaps could be that I havenât got server package installed from steam.
(Selected it from the world editor or something at that play button in green)
Usually you don't select the "Server localhost" option, but the one with "+ PeerTool" which is first configured under Plugins->Settings->PeerTool.
If you want to start a proper dedicated server, which behaves differently in some ways, you can do it via Plugins->Dedicated Server Tool.
Gotcha, good info. Yeah I was thinking it might be good test with a dedicated server as my mods I plan to create will be for mp servers.
And will be easier to debug if I get a console for server and one for the client. So I can actually know what is what.
For example a medical system. I think of it as having your own vitals always âsyncedâ. But you wouldnât need all the data from every other user unless you are interacting with him (treating or checking injuries for example). Thatâs at least how i would have done it on other platforms.
Why are you digging through the actions manager instead of just handling it from the action in CanBeShownScript or CanBePerformedScript?
You're making this way harder than it needs to be.
BuryableItemComp with RplProp on m_IsBuried, Action for Burying, Action for Unburying, Bury Action, (if it's not buried, show and allow performing) Unbury Action (if it is buried, show and allow perform), in the perform of both of those move the item (bury or unbury it) and then have the server toggle the m_IsBuried on the BuryableItemComponent.
Because I want to disable ALL actions when the entity is buried. Iâve already got the buried/unburied part handled. This is for when it is buried, and to not show any actions but the unbury action


