#enfusion_scripting
1 messages Β· Page 24 of 1
Anyone else struggling with performance in the enfusion script editor? Are there particularly bad mods for performance I should avoid and is there a profiler for the editor I can use to track down the problem?
In general I find running it with a ton of script mods makes it lag out really bad especially with debugger enabled
Does anyone know if its possible to attach a local Camera to a Vehicle which is not owned by the player? AddChild is not working...
When parenting happens, somewhere down the line AddChild gets called. That's literally the function that adds children to an entities hierarchy.
What can i do if this is not working? Bone ID was found, but nothing happens. I also tryed the call AddChild on Master by RPC the camera RplID.
I guess what I'm trying to understand is what in the mods is causing it to lag out - Is it the number of scripts or script overrides in particular?
It also seems like a weird behavior that it would be stalling only when the script editor window is focused... Something is definitely wrong in here.
The behavior is strangely similar to the lag you see when opening the arsenal during gameplay - particularly when you view it through the resource monitor and watch the CPU spikes.
Hello, how can I install Arma Reforger mods on Nitrado??
just run the server it should automatically download them
as long as you are using the parent mod in the server config it should download the dependancies
What do I need to put in the script?
"bindAddress": "0.0.0.0",
"bindPort": 2001,
"publicAddress": "192.168.9.10",
"publicPort": 2001,
"a2s": {
"address": "192.168.9.10",
"port": 17777
},
"rcon": {
"address": "192.168.9.10",
"port": 19999,
"password": "changeme_withoutspaces",
"permission": "monitor",
"blacklist": [],
"whitelist": []
},
"game": {
"name": "Server Name - Mission Name",
"password": "",
"passwordAdmin": "changeme",
"admins" : [
"76561198200329058"
],
"scenarioId": "{ECC61978EDCC2B5A}Missions/23_Campaign.conf",
"maxPlayers": 32,
"visible": true,
"crossPlatform": true,
"supportedPlatforms": [
"PLATFORM_PC",
"PLATFORM_XBL"
],
"gameProperties": {
"serverMaxViewDistance": 2500,
"serverMinGrassDistance": 50,
"networkViewDistance": 1000,
"disableThirdPerson": true,
"fastValidation": true,
"battlEye": true,
"VONDisableUI": true,
"VONDisableDirectSpeechUI": true,
"missionHeader": {
"m_iPlayerCount": 40,
"m_eEditableGameFlags": 6,
"m_eDefaultGameFlags": 6,
"other": "values"
}
},
"mods": [
{
"modId": "59727DAE364DEADB",
"name": "WeaponSwitching",
"version": "1.0.1"
},
{
"modId": "59727DAE32981C7D",
"name": "Explosive Goats beta",
"version": "0.5.42"
}
]
},
"operating": {
"lobbyPlayerSynchronise": true,
"joinQueue" : {
"maxSize" : 12
},
"disableNavmeshStreaming": [
"Soldiers",
"BTRlike"
]
}
}```
Because I tried to install Anizay, but my server won't start anymore.
My server won't start, can you tell me what's wrong plz ?
"dedicatedServerId": "nitrado_ni12582850_1",
"region": "EU-FFM",
"game": {
"name": "Eroforger",
"password": "eroforger25",
"passwordAdmin": "",
"scenarioId": "{1A07351573BDF963}Missions/GM_Anizay.conf",
"maxPlayers": 18,
"visible": true,
"gameProperties": {
"serverMaxViewDistance": "1600",
"networkViewDistance": "500",
"serverMinGrassDistance": "50",
"disableThirdPerson": false,
"battlEye": true,
"VONDisableUI": false,
"VONDisableDirectSpeechUI": false,
"VONCanTransmitCrossFaction": false
},
"mods": [
{
"modId": "65EAE3654D22184A",
"name": "Anizay-MANW 2025",
"version": "1.0.3"
}
],
"crossPlatform": true,
"supportedPlatforms": [
"PLATFORM_PC"
],
"admins": []
},
"operating": {
"lobbyPlayerSynchronise": true,
"joinQueue": {
"maxSize": 10
},
"slotReservationTimeout": 60,
"disableAI": false,
"aiLimit": -1
}
}
Wrong channel for this
A sorry
Also if you want to use this for a public server
By sharing this you just leaked your server password
Itβs not a problem
Also
YOu are using MANW version of tha tmod
Which might be outdated already
Add child should work without ownership iirc but maybe your transformation flags are not good/coordinate system is wrong
However FindItem must find an item to attach it to, so if the item is out of streaming range a RplId is useless until it is streamed in
Has anyone ever found a fix to the script editor being barely usable when many mods are loaded?
I am referring to the long freeze (good part of a minute with many mods) that happens whenever the window becomes active.
I assume this is just another issue with the Workbench and not avoidable, just checking in to hopefully be proven wrong.
You have other editors open at the same time like world editor?
Seems to just be inherent with WB having a ton of scripted mods loaded at once, in particular it seems to be caused by many mods applying overrides to the same classes.
My work around was to move all non essential/third party dependencies to another mod that I only open to integrate things or update dependencies, when working on my own stuff I only have my own mods loaded
Happens even when there is just the script editor.
Well this was how i fixed my script editor lag, when i had world and behavior tree editor open while messing with script editor.
I also do this whenever I can, but in some contexts having many other mods loaded is unfortunately required for working effectively.
Like for example debugging an issue that occurs in the context of a large mod list, where you don't know what exactly is interfering.
I find the issue quite unbearable, e. g. with ~100 mods, every time I move to a different window and back in, I have to wait over 30 seconds, and that's despite having a relatively modern CPU.
I suspect the root issue lays somewhere in Script Editor's LSP (or whatever equivalent system it uses for typing/autocomplete) backend struggling to complete calls in a timely manner when it has to merge too many overrides.
Like if you have 10 mods overriding the same method, script editor has to merge all 10 of them to get the final type info for that class to present correct autocomplete suggestions to you when doing your own override. If you have 100's or 1000's of stacked overrides it starts to add up
Does it do anything or just freeze?
Freeze + CPU load, completely unresponsive
I would have said maybe the auto compile script thing.
It hard freezes WB entirely
I don't think it's even compiling anything. Also compiling is way faster lmao
Nah it happens with auto compile off
Sorry but 
Like I was saying I think it's related to script editor's LSP or equivalent functionality
The editor needs to basically be compiling scripts constantly in the background to give proper type information/autocomplete etc and I think it's this process that starts to chug on codebases with lots of stacked overrides
Perhaps, though idk why it would need to redo this every time the window becomes active. Maybe also bad code, who knows.
I wish I could say I hope this will get fixed soon, but the issue has existed for so long now despite coming up every now and then that I'm not that optimistic
I'm not sure if devs would fix/look into this if it requires 100+ mods.
Its rly a lot.
Happens with less mods too, but to a lesser extent.
its this
script editor started lagging profusely after 1.6
even if its off it still does it
like i mean its not turning off
Well i don't rly have a lot of experiance with using this many mods at the same time, but for me the auto script compile thing works.
Its pretty much the very first thing i always disable whenever i reset workbench.
Maybe there is something in the background i'm not aware of but at least i don't get the auto compile anymore.
There's a feedback ticket made in mid 2025 (https://feedback.bistudio.com/T192816), I have not talked to anyone directly
One thing I remember which would go against that theory is that even completely empty script files seemed to greatly affect freeze duration when I did some testing last year
Simply the presence of an empty script file could significantly increase the duration
Ah okay yeah it's probably something else then. I was making assumptions based on the fact a few mods have tons of scripts w/o causing WB to lock up, I've only really noticed it myself when having lots of mods with override scritps
so probably not specific to stacked overrides but maybe still related to how script editor merges scripts or something
That would be my best guess 
Either way, nothing we can do but suffer
Its lagging rly badly even with just 13 mods?
so weird that it tanks WB perf so hard but actual compiler speed seems unaffected
Why does SCR_PlayerIdentityUtils.GetPlayerIdentityId(playerId) sometimes randomly return an uppercased UUID for peertool clients? This breaks player UUID checks (e.g. I have their lowercase UUID tracked, trying to find that UUID in a map using an uppercased version returned later fails)
First log showing lowercase UUID is being called in a persistence deserializer, but when I later try to get player UUID again later inside an SCR_GameModeComponent it gives uppercased UUID
I'm having an issue where the ResourceNamePicker does not want to choose a file sometimes. Sometimes it does, and then sometimes it refuses until I change the name of the file to something else and back again:
[Attribute(defvalue: "", uiwidget: UIWidgets.ResourceNamePicker, desc: "xyz where space is the separator", params: "xyz", category: "Import")]
protected ref array<ref ResourceName> m_sImportDataFilePaths;
bug? or should I use a different widget. It has to be an array widget
If that's exactly what you were trying to run, maybe invalid params is causing it to break? Looks like you're telling it to only show xyz extension which if the file you're trying to pick doesn't have that extension would explain it
[RplProp(), Attribute(desc: "Whitelist of EntityCatalog entries to filter for this trader", uiwidget: UIWidgets.ResourcePickerThumbnail, params: "et", category: "Dynamic Economy - Traders")]
ref array<ResourceName> itemWhitelist = {};
works as expected for me
oh wait you're using ResourceNamePicker, I used ResourcePickerThumbnail. Maybe give the thumbnail one a try and if that works it must be some issue specific to the name picker one?
yeah I'm only using xyz files for it currently
oh that's an actual file extension? I just assumed it was some placeholder value lol
no and discord will mute you if you put the . starting so be careful
but xyz file is a point cloud data file
ah ok, if the thumbnail picker doesn't work either it could be something specific to that extension type. Does that same issue happen if you change it to select some extension native to Enfusion like .et instead for that property?
FileNamePicker also fails. These files can be infinitely big depending on how many trees people generate in gaea. I'm just trying it with 20k lines, but some people have done 600k lines
okay so... filenamepicker and making the array an array of strings instead of ResourceName and then casting it later is working more consistently
Enfusion types work in mysterious ways π€£
Sounds like maybe another case of type auto conversion maybe not working as intended if the only difference between working and not is whether you type it as ResourceName vs string
yeah so i changed the import array to strings, then I did a cast later:
ResourceName filePath = (ResourceName)m_sImportDataFilePaths[fileIdx];
//later
ResourceName filePathStr = filePath.GetPath();
so I can use GetPath()
since ResourceName doesn't have a Cast method. No compiler errors
And it all works fine in runtime?
I swear I remember someone from BI saying ResourceName is just a string, which clearly isn't the case if you can get different behaviours between typing something as that or string
i mean its a child class of string with some added engine methods
because i am using our new hexdecimal to string converter which is upper case by default. but it should always be the same, it does not change when called.
the uuids starting with 00bbbddd mean they are peertool placeholders. the other ones are from your workbench host or other real players with associated steam accounts.
You tolowered your string somewhere to get the first print line. i'll change the util to be lowercase consistently with other uuids. did not notice, thx
it is just a string for script, but we handle them differently under the hood. It is possible that the xyz files have no corresponding .meta files and as such are not resources to the system and stay empty when being passed around engine methods. string would work as it just grabs the file path without knowing what it even is
I did not use tolower anywhere until I ran into this issue and added it to places where the UUID was being returned uppercase
the wrapper method always returns the same format, hash maps do not care about a mixed case, it will just work when you pass the same key every time
The first UUID was exactly as returned by the util, as I mentioned it seemed to return a different result depending on where I called it.
That is not consistent with the behaviour I observed
As I mentioned in my first post about it, I got lowercase UUID when calling it from a serializer, but uppercase when I called it from a gamemode component
There is no code path that would allow different return formats.
The only reason I discovered this oddity in the first place is my lookup for the UUID later was failing, because it was trying to look for uppercase UUID but lowercase one was tracked, map.Get() returned null
Reproduce it and step through with a debugger to see whats going on.
Using scripts could I allow a player on this stretcher to be worked on (Ace Medical) by someone not inside a compartment like the doctor compartment inside ambulances? Allowing CPR and all the other ACE Medical things.
Hey curious if anyone knows of a script or could help me make sense of a script that would only allow you to join a faction on a server if you were recruited from within a radius at there base? Trying to utilize this for a survival type server
I have been struggling with the same thing - It's pretty infuriating having to wait 30s every time you focus the script editor window.
I've been trying to see if there's some EInit code or something that's getting run during edit time or when the scripts reload that might kick off some log info.
Any telemetry around this problem would be useful at this point.
It's suspicious to me that the thread stalls look similar to lag you see when loading the arsenal sometimes so I'm thinking it has something to do with loading resources from disk.
Anyways, I'm continuing to debug this as it's getting in the way of our server development, so if you find anything or want to collaborate on getting a solution, feel free to DM me.
At this point I doubt this is something we can fix on our end, would have to be solved by BI probably
Which so far they haven't, but who knows, maybe someone is reading along and decides to finally have a look
Perhaps - It might help motivate someone over there to fix it faster if we can narrow down the problem - at the minimum we'll be better equipped to engineer around it.
Does anyone know what the default element size is for an array in enfusion?
What do you mean by that?
The size of the element in bytes?
Sortof - A managed array by default will have a certain number of elements reserved - That will be the size of the unmanaged block of memory that backs the array. If you keep adding elements to the array, eventually the underlying system will re-allocate the backing array to accommodate the extra items, so it has to move all the old items into the new contiguous array.
It's why they have a Reserve() call on the arrays.
If it's relatively small and people call .Insert() for large list items one at a time, there's a good chance it's re-allocating the arrays multiple times before the inserts finish... so it'll be really bad for performance and memory fragmentation.
array<string> Array = new array<string>();
Print(Array.GetSizeOf());
SCRIPT : 56
seems to be 56 regardless of element type
I think in c# it's like 4 elements... so if you have 1000 items being added to a list and you add them 1 at a time without reserving, it would allocate:
array[4]
array[8]
array[16]
array[32]
array[64]
array[128]
array[256]
array[512]
array[1024]
so basically an extra 1020 elements and 8 extra managed objects that need to be cleaned up by GC immediately after the operation completes.
Rather than just
array[1024]
If you were to call array.Reserve(1000) before inserting.
It seems to be 0, with 56 bytes being for the container itself.
Yeah I can't seem to get the underlying size - There may be some pooling system in their virtual machine for all the array types.
I ran some tests on size and it's always the size of the elements + 56.
This gives you the class instance size on itself (On script layout only), not the array as iinstance
//! Get actual size of instance including size of all referenced objects.
Yeah but it won't take the size of the array into account
as it's on CPP side
There, you are getting what the array object itself takes
And getting the size of a populated array shows a size increase. Am I confused about something or what?
I can't seem to demonstrate any performance benefit to using reserve...
Very weird.
Reserve is only called like 150 times
It's not the actual size is what I mean
Oh, okay.
Kinda weird to have a function called GetSize, that doesn't get the actual size lol
For this to be an issue, you have to have really crippled memory allocation already. So super fragmented memory and being done super often
Otherwise the alloctor will just move the offset limit ptr around tand that is is
It's usually fine for regular scripted classes
I thought about that - Tried allocating new arrays to see if it was the array pool. It might be the remote console's runtime that's stopping it from showing anything.
Container classes in Enforce, are not really inheriting from Class internally even
It shows like that, but it is not on the internals
So they behave differently
They are also quite legacy so it uses so old stuff that still has to be updated
You might be surprised with some of the performance of enforce script π
Oh, Mario the FT thing we talked about the other day, I forgot to do it but, did you want me to sub you to it?
Here's the test I ran:
int InsertTestSize = 100000;
int NumTests = 100;
array<array<int>> Arrays = new array<array<int>>();
Debug.BeginTimeMeasure();
for (int test = 0; test < NumTests; test++)
{
Debug.BeginTimeMeasure();
array<int> Array = new array<int>();
//Array.Reserve(InsertTestSize);
for (int i = 0; i < InsertTestSize; i++)
{
Array.Insert(i);
}
Arrays.Insert(Array);
Debug.EndTimeMeasure("UnReserved 100000");
}
Debug.EndTimeMeasure("Total");
Yes, I forgot what it was already π
haha
π
Do bigger test
hundreds of million
100K isn't shit for Enfusion
IF you want to see anything
I would still expect there to be a measurable difference between reserving and not... /shrug
I ran with 10,000,000 - Same results.
bytecode of this if interested
Thank you that's extraordinarily helpful actually - How do I get access to the bytecode for my own stuff?
For now you can't
Dev only tool for now
It's heavily optimized over years, coming down from enforce engine (Even older than RV engine)
So you should not worry much about it
Yeah I thought maybe it could be contributing to that stall out with the script editor.
The slow down when having multiple mods loaded in script editor?
Nothing to do with scripts
The parser seems to freak out a little after some changes to it sometime ago
Does it run like intellisense? EG some background task that tries to parse the scripts before compile-time?
Yes
Gotcha - I'm assuming this is on dev radar then and to just sit tight till next release or something.
Having the autocomplete parse run on callback for the window focus seems to be the most frustrating pain point - Is there a way to disable it? Not fun waiting for 20s every time I switch back and forth from discord...
Other bigger problems are being worked on first
Like the game issues, other bugs from engine that affect the game as whole and workshop upload issue
I don't supposed I could convince a producer to schedule in a toggle to disable the autocomplete in the script editor options could I?
Maybe on the Feedback Tracker as a feature request
But good luck
How many dependencies are you using? I've never had that issue before.
about 80 - It adds up quick - Ace and WCS are like 30 mods combined.
Is your mod actually dependent on all of those?
Often people use mods as a dependency when they don't actually need to.
I'm not sure - I'm helping debug some issues from a server config that someone else is managing.
A lot of it is modifications to the arsenal, so they need to understand all the objects that get added.
I would say that 95% of those mods don't even need to be a dependency and they can just be used on the server.
Unless your(or their) mod is actually using things from those mods in a particular way, then they aren't actually dependent on those mods.
Is there a way to check the references to see what I can remove?
Not 100% sure
I know i've seen some context menu that has "find references" somewhere but, i've never actually used it.
Think about it like this though, a dependency is literally something your mod is dependent on. I.E. My mod is dependent on Redline_Core if I need to inherit from one of their classes or one of their prefabs.
No, I get it...
Yeah, a lot of people don't though.
That's how you end up with mods that have 80 dependencies.
The child dependencies still need to be included as well right?
Indirect dependencies do not have to be added to your project explicitly, they are loaded implicitly.
However they are added explicitly to the Workshop uploaded addon for some reason (which can be quite annoying).
Any dependencies of dependencies are added afaik
As they should be
Ya
Will indirect dependencies be loaded if I kick off the in-editor play button to test stuff?
They kinda have to, do they not
that's what I would have thought - But if they aren't added the mode might just throw shittons of errors and die.
If I use "Redline_SuperCoolHilo" as a dependency and it requires "Redline_Core" then I need "Redline_Core" as well.
And those affect the editor stall right?
Like reducing the dependencies is the overall dependencies - not just the direct ones.
I would assume so, they have to be loaded for their dependecies to be loaded.
Idk if this has hit stable yet tbh
But newer version of Workbench has Workshop integrated to it and allows you to manually download mods from there or automatically when you load some addon. Same for updating
Is there a chance we may get more shapes for BaseGameTriggerEntity? spheres are nice and all but I really need a cylinder so i can make the zone uniform from ground to skybox while still being able to get and set the radius dynamically.
The bounding box doesn't have any options to adjust the size once set, and polyline seems to not work at all with the same constraints as the bounding box.
Or is there another way to get players inside a defined area that doesn't require checking every player in the server in batches (like the restrictionzones do) to see how close they are to the zone?
Put any dependencies you don't need to override/integrate directly in a separate mod pack, so you only have all those extra mods loaded when you are making changes to the modpack, when working on your own stuff you just have your core stuff loaded
You can check the distance between the player and entity and if its within a certain range, execute code
Yeah still have to check every player though to see how close they are to the entity, where as the BaseGameTriggerEntity does some engine magic it seems to detect only the enities within the trigger that you can then filter.
so anyone outside of the trigger it doesn't even see or care about
"The bounding box doesn't have any options to adjust the size once set" uhh Yeah it does.
You channge the bounds....
"skybox while still being able to get and set the radius dynamically."
you cannot change it dynamically by getting the radius there is no GetBoundingBoxSize(), SetBoundingBoxSize() etc.. like there is for the sphere with GetSphereRadius() and SetSphereRadius()
Why would you need to?
Because I want the zone to dynamically adjust
Example I want the zone to be 50% of the distance from MOB to the first capture point (capture points will not be the same on every map), the sphere can do that but It would be great to have the zone be a cylinder instead of a sphere so that its uniform from ground to skybox. Currently you can get closer to the center of the zone without being inside of it due to the curve of the sphere
Yea, I misinterpreted what you meant when when I skimmed over your post.
You're only real option is to write custom functionality.
Polyline could maybe work, But I don't think we can create them at runtime.
They also don't have anything drawn for debugging, I had to write my own functionality for that.
What exactly are you trying to do to everyone in that zone?
All good, yeah I just hate that custom functionality would be having to check all players to see if they are in the zone (Like the contaiment/restriction zones do) while the above entity doesn't need to do that and only cares about entities inside of it, I guess i'll have to keep messing with polylines then 
If you give a clear example of what you want to do to those players, there way be a more convenient way to do whatever it is you're trying to do.
pretty much an inverse restriction zone so you don't die when leaving but you cannot enter unless you are of the correct faction, which makes it more of a warning zone if you are getting to close to the enemy main base.
I have every thing else for it good and working with the sphere It just that if you are flying a helicopter you can be high enough to fly over the sphere since it doesn't go to the skybox, and if the sphere is to big it ends up convering areas you don't want covered
the restriction/containment zones do this by checking every player on the map in batches of 10 to see if any in that batch are in a zone which to me is just ineffienent, since we have this method that checks just who is in or enters the zone and everyone else on the map it doesn't care about so it doesn't even waste time checking them.
If you're trying to limit players from being x meters from x MOB, the height should be taken into consideration as well if you ask me. So the sphere would be the best approach, If the limitation is 50 m and i'm 60 m in the sky, i'm not too close. MOBs are "hardcoded" are they not? So why the need for dynamic size changing. if you know exactly where they're gonna be? If you don't wanna use the sphere use the bounding box and make it incredible tall and x size. If the first capture point is 500 m away and you're doing dynamic sizes, you're gonna have a huge sphere.
the first capture point is 100 m away, it's "trigger box" is the red one, alternatively the first is 500 m away, it's "trigger box" is blue.
In this example, lets say the first one is the one thats 500 m away. it's sphere would then encapsulate the other capture point. Meaning the enemies wouldn't be able to be at a point that they currently control. I don't play the game but, I just realized that the capture point's may or may not be "in order" depending on the game mode. If they are ordered, The dynamic sizing approach won't work for the above reason. Otherwise, that approach would work, assuming the closest one is considered the 'first" one.
On the other hand, if you use a bounding box trigger shape, with no intention of altering its size. You would get a result like this, and it would work every time.
In this example. the limitation is 50m in either direction around the MOB and 500m vertically.
the issue is I don't want people to be able to be 60 meters over the top of the zone, it should be 60 meters from the center from gound to skybox. which is where a sphere would be great cause then I get the height benefits of the bounding box but the exact radius I want as well which can dynamically update depending on the values I give the zone and the map being played.
Not sure what you mean by mobs being hard coded but the idea is it doesn't mater where the mob or first point is, for any scenario i can tell the sphere to make itself a percentage of the distance to the first non-hq point, you can't use a bounding box cause then if there is a map/scenario with points within 500 meters of the mob the bounding box is now in the wrong spot and covering a capture point.
Capture point order and all that doesn't matter.
if BI adds the cylinder option it would pretty much give the best of both worlds just surprised it wasn't a default shape to use
If capture points are ordered and the "first one" is 500 m away and there is another that is closer then your sphere could encapsulate that capture point if it's big enough. Ordered capture points do matter, your functionality of making the radius 50% of the distance to the first capture point could in fact end up with a different capture point within it.
The locations of the MOBs are static, are they not?
The distance to the "first" capture point is relevant, if the capture points are ordered. Idk, what game mode you're using, if you're using a game mode that has the capture points chosen randomly and their capture requirements are in order then your logic is flawed regardless.
I could make a scenario with mobs or capture points anwhere on the map they are not fixed
No because my sphere would stop at the closer point
i do not calculate the radius of the sphere based on capture order
its on the point closes to the mob
but again
all that logic is down pat
its the fact i want a cylinder
so you can't fly above the sphere and be over the top of the MOB that the sphere currently surrounds
You didn't say that originally, you said the "first" point. Not the closest, and depending on the game mode, first doesn't always mean the closest.
be to make itself a percentage of the distance to the first non-hq point,
is what i said
the first would be the closest
the first would only be the closest if the game mode works that way.
"Example I want the zone to be 50% of the distance from MOB to the first capture point "
If your game mode makes the first one the "closest" then you logic is fine. You've never expressed that is how the game mode that you're using works though.
Ok so I guess to calrify it will always stop at the closest point
still need it to be a cylinder
xD
so I will just have to hope we get that
maybe come arma 4
π
Doubtful but maybe.
Regardless, If you lose the entire idea of dynamic sizes you can simply use a bounding box trigger.
You could even make a few of different sized and just choose which one to spawn.
sizes*
Yeah but thatβs not happening as the dynamic size is needed
No it's not lol
You just want it. lol
When I can just calculate the distance and make a circle
That goes the same height to the sky
You wouldn't make one for each map, you would make maybe 4. And use the size you need depending on the situation.
and then what if the map maker makes a new scenario with a point closer and that new point is within my bounding box
Then you choose a smaller one to spawn.
so instead of having 1 prefab that can self adjust no matter the map, situation, scenario. I make 4 fixed ones?
You can argue how that's not "great" or whatever but prefabs are kbs in size.
And they can all inherit from a single parent making the child prefabs even smaller.
Does anyone know of a mod like a 5-minute game start timer where they can't turn on the vehicle?
Does anyone know of a mod like a 5-minute game start timer where they can't turn on the vehicle? zonesafe
HQ
It's for multiplayer, like in conflict, 5 minutes of preparation, the Barbies get made up, and then only leave the main area with all the vehicles
uhhh, I don't know of any mods. But I think I made a timer that started only when the game mode began
Oh man, what a mess lol
I'll post the important bits here. Do you know anything about scripting a component @queen furnace ?
protected void WaitGameStart(IEntity owner)
{
float TotalDuration = (m_iSeconds * 1000) + (m_iMinutes * 60000);
if (isGameRunning())
{
Print("The vehicle will now move");
ClearEventMask(owner, EntityEvent.FRAME);
GetGame().GetCallqueue().CallLater(GrabVehicle, TotalDuration, false, owner);
}
else
Print("The vehicle is waiting for the game to start")
}
override void EOnFrame(IEntity owner, float timeSlice)
{
//There are issues with stopping the checks for every frame. Please fix this.
m_fCheckDelay -= timeSlice;
if (m_fCheckDelay <= 0)
{
m_fCheckDelay = m_fCheckPeriod;
WaitGameStart(owner);
}
}
protected bool isGameRunning()
{
SCR_BaseGameMode checker = SCR_BaseGameMode.Cast(GetGame().GetGameMode());;
return checker.IsRunning();
}
Add components to the game mode by generating scripts if
Anyway, in that thing about scripting or what I mean with ChatGPT lol
The script or mod for that timer is to put it in the campaign gamemode, right? Or directly in the base?
I'm still an expert at checking the workbench console log and seeing if the script is going well, but I don't know how to create it; otherwise, with AI I would already make it haha
uhh, I was thinking that you would put the component into the vehicles that you want to stay locked until the timer has expired
The code I posted is just part of something else. What's important is the IsRunning() method
within the SCR_BaseGameMode class
Basically You want to check if the game is running. If it is, start the timer. If the timer has expired, set the cars to unlocked.
oh, can you not post links to the BIKI anymore?
I can help you make a component if you want. But I don't currently know how to lock and unlock vehicles. If you don't have time right now please look at the component tutorial at the BI community wiki
You can't use masked link, just post it as plain text
Pre game and post game components already exist
Exactly, that's what I want, but along with the timer, I mean the HUD should say "5 minutes for battle preparations," and along with that, the vehicle HUD, maybe add a rule so they can't start them and can't move to a point, but have to wait for the timer to finish, and only then does the PvP begin.
Not only lock and unlock, but also allow them to get in normally but not be able to start the vehicle so they don't move forward and respect the 5 minutes
Why is this only working for PC, not PS5? PS5 users can supposedly ADS with no issues at all. Untested on Xbox. Anyone got a clue lmao, this is insane
Is there an external plugin that can do code mapping like in Visual Studio? https://learn.microsoft.com/en-us/visualstudio/modeling/use-code-maps-to-debug-your-applications?view=visualstudio
Hello i'm new to enfusion scripting (but not at programming things), I attached a prefab to another (static object to a truck) and i would like to know how to retrieve the attached prefab object from the owner IEntity, api docs does not mention a suitable method for this. just saw FindComponent but i do not think it is correct for my use
Attached how?
by adding BaseSlotComponent and then a RegisteringComponentSlotInfo
saw in the tutorial wiki (the mounted gun on the car)
oh well, now i see, may be the RegisteringComponent... so i need to use IEntity#FindComponent ?
You need to find the component you attached it on, so your base slot component.
did you find it out? I'm wondering the same
is it normal for SCR_CharacterDamageManagerComponent to only ever have 1 instance count no matter how big the inheritance chain of prefabs is? all the other components on the character will count up to however deep you are, starting at Character_Base. Like, you could be 14 deep on most components, but this one will always say 1.
If you are refering to the number you see in the object properties
That is telling you how deep you have to go to find a modification of the component
yea, it's usually a sign of broken inheritance, but I wasn't sure.
It can have any number
It does not mean it's broken
It just tells you on what level the last modified version of the component is at on the inheritance tree path
It has nothing to do to instances count
well, that was the wrong word, but it should be counting up unless it's special. just making a note of it because I was looking (something was broken with hit reg somewhere in my mods I use).
components can't affect this
You must have modified it somewhere to reduce the count
I am in an empty test mod. so, no mods, just messing with base game prefabs
Or someone removed the component on the base
and added it again
Whcih essentially creates it again but with diferent ID
Meaning yours will be broken now and treated as new
But in this case you would see it as two components on the prefab
Sometimes our own devs mess up and do that
and it affects mods like this
would it be possible to make commanding menu entries for firing ScenarioFramework triggers?
@brazen sphinx You handled a modded crash like this before iirc, do you recall if it was Damage related?
So, figured out that it was not a PS5 / Console issue (kinda) but actually was an issue with controllers. Can anyone help me figure out how to properly block ADS actions from controllers?
Is there a way to change the root prefab class from static to dynamic (or kinematic) to make the (atm static) object rotate via scripts? i tried overriding EOnFrame and set the appropriate Flags but it seems not doing anything
You can set the rigidbody to kinematic
Why does i tneed to be kinematic if all you want to do is rotate it?
Yeah just make it inactive / no gravity probably be fine unless you need kinematic for a specific reason.
Why is the position of SetBoneMatrix being added instead of set? 
because it works on top of recurring anims
It sets the offset of the bone basically
Not the state
Wait is it the same with rotation then?
Yes
I canβt remember the details much, but the thing youβre recalling was fixed, if I remember right. I can take a look on DamageManager later.
Think of it as similar to slapping the procedural nodes in Anim Editor
Thats why my bones are flying all over the place
Should be called AddBoneMatrix then 
It's just engine semantics
The matrix is fixed
And that matrix is used to make the animations's poses
In math terms, it's what is used as basis
All I want is to make a bone look at a position
So I guess I have to convert everything to local offsets then
The answer is to do it with anim editor and not script bone API
If anim graph is running, then use anim graph
If it's not the use the barebones low level bone api
the fabrik ik node in anim editor has no limits so im trying to make my own solver with limits 
rip performance due to scripts
its the only way
Are you sure it has no limit?
According to docs, it has
Yeah thats one value for all bones
Use IK2 Target with chains then?
I have a IK2 Target
I need to set the min/max rotation for each axis for each bone, cant do that anywhere currently
After the path of the IK target
Use a Constraint node then
Limit it there
It's under procedural node group
Hmm will check that out, thanks
But is a script for that really that bad for performance?
See it like this
Small script that animates player for just moving forward is slower than almost whole player graph
Graph gets compiled, and working on more directly and lower level
It will always be faster
But I need a script for setting the ik target position anyway
Plus it does many optimizations that simply you can't do on scripts
Just tell the graph what it is
You can feed info to the graph from scripts
Im doing that already, but if I add a little bit of math and move some bones, cant be that bad, not like im spawning 1000 mechs
You are forgetting the part of whole scripted solver every frame
Use the graph, it will save you time
Yeah "little bit of math"
and it will be more stable
Too late for saving time, solver works, just not the bone rotation
And I recommend it because there was some talk before to remove SetBone and so due to they having no need to be there
its there due to legacy
So it could be removed at any point
You know I am surprised that has not been requested internally
The vector thing
And that for every IK Target
You could use predictions for this I gues?
I think you can set predictions from script iirc
Also if setbone getting removed no point in finishing my cloth simulation I guess π
We can add the methods to others
Well that would be great
Looks like it wa added when needed when someone was working on characters and added it there
instead of base
Btw is there anything to like include modders in these decisions? I guess if its not really good for performance no need but would be nice to see
Main reason its not gone is because when it was mentioned I mentioned modders using it
but that was also the reason it was wanted to be removed
for misuse
But if it start to be misused badly
And cause instability then that forces the hand
Its just way easier to setbone via script than use and make a whole anim graph for it
This is also why the modding department is embedded everywhere too
So modding is taken into account, specially recently
But modders themselves will not be added into these things
Not viable
But you get the mod dept as representative/voice
What about making βgetprojectilesimulationβ a thing ? π₯Ήπ₯Ή
Ouch, that actually I forgot to bring up
Thank you for the reminder
Hi, is there a way to make it possible for AI bots to trigger the Area Trigger Resource?
At the moment it seems to work only on Player for me..
Hi. I've been trying to detect grenade explosions ( at minimum just want to know where the grenade goes off ). I've tried various things including attaching components to the grenade prefabs ( also the warheads) but I don't even seem to get calls to EOnInit . Is there a simple mechanism to do this? ( the BaseDamageContext does not seem to include grenades as a damageSource either if using DamageManager components.) I must be missing something here?
I think for EOnInit to work you need this in there
super.OnPostInit(owner);
SetEventMask(owner, EntityEvent.INIT);
}```
ahh. thanks that did it.
Lol anytime, this has been a pain in the backside to try and create custom projectiles. Especially since we cant fully edit them to how we want ( from personal experience) it would be nice to soon be able to fully edit them, as a lot of Sci-fi mods rely on it, especially the big ones like auto turrets and Gf
Nice to see the acknowledgment
thank you
Hi, I am looking to make an AI vs AI tug of war.
I have set up an Area that has a Layer that has a Slots which spawn entities.
the Area has a Trigger resource
{2CB3F93211D06F83}Prefabs/Systems/ScenarioFramework/Triggers/TriggerDominance.et
and is set to Dynamic Despawn when nobody is in the trigger
It works when Player enters the trigger area,
But when AI units enter trigger area nothing spawns.
To find out if it is because of the trigger itself I have put the trigger separately and put some spawn code into it, and the trigger worked regardless if Player of AI entered it. But I dont know who to make it spawn a Layer with lots of Slots or even a single Slot, at the moment I can only spawn one entity per one trigger.
So if I could make an Area Trigger get activated by an AI Bot or get a custom trigger spawn a Layer, that would be very helpful.
Thank you
I have 2 scripts with the same class name.
modded SCR_AICombatComponent : ScriptComponent ( the first )
and
modded class SCR_AICombatComponent : SCR_AICombatComponent( the second )
Is this okay-ish or bad: ( Its working but i like to make sure )
Oh rly?
I did not know.
Thank you. π
Is there anything earlier to detect a players id joining than AuditSuccess? OnConnected seems too early for the uid to be read and compared
Currently the audit success event is the exact on that is fired upon identity availability.
why eventprovider is limited to just new stuff from world systems? scriptinvoker is way better...
how to get join code on DS? Or parsing log is only way?
How to find which weapons (and what ammo) is available on e.g. helicopter "gunship hedp"? Trying to use GetWeaponsSlots() returns nothing.
Would you expect that a trace excluding the player entity would exclude that players vest and helmet?
It seems like currently even thou the vest/helmet are children of the player, they are not excluded? Any easy way to exclude them?
Scriptinvoker aren't better, sometimes they even fail to trigger properly because of scriptinvoker explosions or whatever it' called
I just checked if the hit entity had a base cloth component and recursively scanned until I hit a valid object or hit nothing
But this was for client sided code. As client side players do not track children of other entities it seems
Got it. will just stick with children method then
protected array<IEntity> GetAllChildern(IEntity parent)
{
array<IEntity> childern = {};
IEntity child = parent.GetChildren();
while (child)
{
childern.Insert(child);
child = child.GetSibling();
}
return childern;
}
Maybe inventory items are different. In that case you could just do GetRootParent and see if it casts to a ChimeraCharacter
Hello, could you help me with replication? Currently, when the player triggers "void TogglePower()", the action is played locally, but other players and the server don't see anything. If the server triggers it, then all players see the same thing. How can I make the client push to all players? I tried to follow the example in the RplRpc and RplProps Wiki, but it doesn't work... Thx for your help
class FRM_ScreenCoreComponentClass : ScriptComponentClass {}
class FRM_ScreenCoreComponent : ScriptComponent
{
protected IEntity m_Owner;
protected bool m_bPowered;
// ------------------------------------------------------------
override void OnPostInit(IEntity owner)
{
super.OnPostInit(owner);
m_Owner = owner;
m_bPowered = false;
m_bBootFinished = false;
LoadLayout(m_rLayoutPowerLess);
ApplyTextureAt(0);
}
// ------------------------------------------------------------
void TogglePower()
{
m_bPowered = !m_bPowered;
Rpc_TogglePower(m_bPowered);
Rpc(RpcClient_TogglePower, m_bPowered);
}
// ------------------------------------------------------------
[RplRpc(RplChannel.Reliable, RplRcver.Owner)]
protected void RpcClient_TogglePower(bool PoweredRPC)
{
Rpc(Rpc_TogglePower, m_bPowered);
}
// ------------------------------------------------------------
[RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
protected void Rpc_TogglePower(bool PoweredRPC)
{
m_bPowered = PoweredRPC;
if (m_bPowered){
//m_bBootFinished = false;
LoadLayout(m_rLayout);
ApplyTextureAt(0);
}
else
//m_bBootFinished = false;
LoadLayout(m_rLayoutPowerLess);
}
etc next of the code......
I don't know if this will solve your issue or not but first of all i do see that you're calling rpc_togglepower like a normal method
The way you should call it would be Rpc(Rpc_TogglePower, arg1);
Oh nvm
You did it just below
Also if togglepower is client sided a client cannot broadcast anything
You'll need to go from client -> authoritx -> broadcast
if I can't attach EventProvider to what I want, but can do same for ScriptInvoker - ScriptInvoker is better, even if it's broken, because I can use it.
And I haven't encountered any situations where it broken yet.
Currently, the actionManager is on a prefab that is a server, the action is trigger by the client, and
[RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
protected void Rpc_TogglePower(bool PoweredRPC) and make the transition, right?
Iirc clients can only Rpc to the server if the method is ran in a component directly attached to the player controller
It's not better
It's a really bad antipattern that unfortuntely is everywhere in AR, and due to that it kinda forces you to use it
We do not use script invoker at all in A4 for example
I believe that scripted user actions are ran server side if i'm not mistaken
Just event system, and even system came from needs of A4 for proper systematic events
AR got it as a nice bonus if someone wants to use it
In AR, only systems and controllers have the event system
So I need to spam world systems/if id == wantedid everywhere to just make callback for many small instances?
Oh... so what should I do? Because my entity is a prefab screen.
and these two, are supposed to be the soruces of all logic in Enfusion
So anythingt aht should trigger an event, should come from that
not entities, not components, not a random class
Not using systems, and not using proper events is the source of the initialization issues you face currently, or the need to do "CallLater" to do something after next frame and so
Also, events should be simple side effects. Ask yourself if you really need to make an event to make your class talk to another Related class
Events should not replace direct calls
Events are convenient sometimes
not optimal but convenient
You should only make events, for when you want to expose a side effect to an UNRELATED class
Yeah but convenient often means cutting corners
and cutting corners lead to issues
Event System is the answer to keeping events, but keep them still systematic and controllable
And people cutting corners is the reason it has strict restrictions
That's a problem for future me 
(Jk future me already happened)
If you want to somehow port your system/feature a bit nicer to A4 later on
I recommend to start already by using systems and event system
ScriptInvokers will not be a thing at all in A4
ScriptInvokers allows you to very easily by it's design to fall into recursive events, or event hell
And such thing is cause of compilation error in Event System
And VMEs
Which architectural wise, is not easy to solve depending on complexity
Also event system handles memory properly
So it won't mantain your classes alive by accident like how it happens with ScriptInvokers
Or cause corruption when you pass a pointer class
Could create a ClientToAuth manager in the player controller with
void TogglePower(bool power, RpcId tabletId)
{
Rpc(Rpc_TogglePower, power, tabletId)
}
[RplRpc(RplChannel.Reliable, RpcRcvr.Server)]
void Rpc_TogglePower(bool power, RplId tabletId)
{
IEntity tablet = Repliaction.FindItem(tabletId);
if (!tablet)
return;
//find your tablet component
//Call the broadcast method here like you would.
}
You can get replication RplIds by doing Replication.FindId(ITEM).
Also sorry if its wack, sudo code Im typing on my phone off the top of my head.
Plus they are faster
And you can define order of execution
Less memory usage as well
And less clutter in code
Question about arma 4, will we see more vanilla "system" we can lean on for modding , such as for example radar implementations, guided missiles logic etc?
I feel like currently it is quite a shame that modders have to make their own which then cause compatibility issues, either you use an existing framework such as wcs_armements or do your own thing, idk i just feel like those should come with the base game
I don't think these are questions taht can even be answered
It's impossible to foresee what a modder might want to do in all cases
Systems are made with moddability in mind since the beginning, if that might answer your question
ok i see but in my case is not an item in inventor, is a screen prefab on the world like house, etc so findEntity not work..
It does somewhat but not entirely ^^
My biggest concern is that modder will have to do a lot of work to bring back similar features we had on a3 and then face compatibility issues / poor implementation issues.
Radars and missiles were my first thoughts but yeah i understand it's difficult to predict what modders will do
Yes it would, the only thing that can cause it not to be found is if the screen prefab is outside of the RplBubble of the entity trying to find it.
So if I need to trigger an event on specific entity, you suggest using if (entity == wantedentity) ... everywhere for EventProvider or implement my own subscriber class?
Well, it's not Arma 3
So you should not expect it to be copy of Arma 3
There might be things that are not planned at all
different games
It's not Arma 3 Remastered (Enfusion version)
For any answer on what will be in there
You have to wait for the roadmap
You won't get answer on design features here. Only some tech perhaps but not design
Ahhhh, I see. Perform a bubble search around the player to find the entity that has "such a component" for example, to assign it an RPL ID?
It looks like we are forced to use A3-like mission event handlers instead of A3-like object/display/... event handlers
No
Use filtered events for that
Give the entity as filter
Also is it possible that in A4 we will see custom class be Rpc compatible by default without implementing a codec?
I feel like a LOT of mods in the workshop kind of cut corners in that matter and would rather just send a bunch of vectors, int float string etc rather than use proper classes because of it.
Or is it simply not doable / worth the time?
hm, ok I will try...
filter can be any int/enum, or pointer (Give any class instance and it will use it's pointer as filter)
On later update you will get possibility of using string on it
Will we ever get void pointers and function pointers?
I have it on backlog of Modding R&D to see how this could be made safer without sacrificing performance.
There are ideas to remove codecs in general for a long time.
Never
There was one time i was so lazy i converted the class to json, sent it to the server then serialized it back to a class
(i'm lazy asf)
It will make a mess of scripts, specially for those modders that are careless or not technical
It's the same reason we are not providing lambdas too
Feels to me this required more work
When you connect a event connection with a filter
Just beware that when you throw the event
The would be first parameter to feed the provided event is the filter
So that will be used to know which filtered event connections to call
So that mean that the event signature has to have the type arg for it too
Which is a way to enforce you on passing around the filter to received events. which you can use for further tracking if needed
It's also used for static compile time event type and signature checking
So no more random invalid connections being added like with invokers later on corrupting things
i tried settings the correct flags but it wont rotate via scripts, idk if i doing it right way but in short term i am overriding EOnFrame and added the script as component to the prefab. then placed the prefab in the test world but it just stay there and wont rotate. For rotation i manipulated the Angles via getAngles() and then setAngles()
Why are you doing anything on frame?
That's not needed to rotate an entity
Could just give it an animation loop and use the animationplayercomponent
Add one bone, weight mesh to it, record 360 degree spin anim, import all, add anim to player component.
Created ticket with screen snip. Looks like a base game misconfig: https://feedback.bistudio.com/T197409
This seems like a pretty poor reason imo, there is already no shortage of ways to write bad code, it's not like the lack of first class functions is some kind of pillar upholding community code quality
It's common bad misused pattern in development in general
So we prefer to avoid it
It has good uses, but it is more often abused and breeding ground for misuse.
And that will be found out more on a development environment where not everyone is technical
not to mention to make such things even more complicated for those non technical modders
We aim to provide a simple scripting language, not a full feature set language with all the tools that there could be.
Are there any plans in BI to train an AI model on Enforce scripting?
Is there a way project a camera onto a material? For example a mirror or tv screen?
rendertarget
and its expensive
Also i saw an example from i think bacon. Where he had a keypad and could the numbers on said keypad. How is that done?
you create a layout for both of these. but the keypad numbers can either be a txt widget or you could do an imageset and use image widgets in the spots where the keys would be on your layout
something like that
how do you get a layout on a material?
set the bcr to $rendertarget
in the material
can click the little dropdown arrow where u put in edds
thanks for the tip. still learning this. and whats to use to make it rotate by player? like the mounted gun on vehicles
π€£ I don't think you realize how silly this question is. Training an AI model that is useful for anything costs > $1000,000,000
That said, BI should surely embrace AI tools, because like it or not modders of all skill levels will use them for modding.
the modders themselves are already agentic. they display Aggregate General Intelligence and communicate over a Discordful API. also, free.
you can train your own model on this.
im not going to go into detail on here, but there are plenty of free models out there that you can add a knowledge base to.
Morning Folks, Trying to get this parajump from the DC3 working. I'm trying to spawn a player directly into a moving aircraft's passenger seat via script. I have the BaseCompartmentSlot and the player entity, but I can't find the correct API call to move the player into the compartment. I've tried MoveInVehicle, GetInVehicle, SetCompartment, MoveEntityInside, and OpenCompartment but none exist. What's the correct method to programmatically place a player into a vehicle compartment?
How can i override the input of the helicopter to assign a value ex: 0.00 and block any further inputs ? for ex : the cycling
Having a weird issue with in game entity browser (GM). I have defined spawnable helicopters (modded) in
...Mod\Configs\Editor\PlaceableEntities\Vehicles\Vehicles.conf . All good in WB - works as expected and the helicopters are found in GM. Opening this in game (SP or MP), shows nothing. I'm missing smth somewhere but what?
Solved: Dang, this was a #me-issue. I did not have all the files in my development branch.
How to find which weapons (and what ammo) is available on e.g. helicopter "gunship hedp"? Trying to use GetWeaponsSlots() returns nothing.
that isnt silly question at all. Building a new LLM from scratch, however, not what I'm asking.
i know, i just want BI to do it and support it π
they are a game studio not an ai company.
player
I think we're all forgetting that BI doesn't want their IP be used to train AI
If there is ever a MillerGPT then it would come from us. You don't have permission to provide our scripts to other parties for training
The one unreal has is pretty damn useful, if enfusion had one then it would be very useful for new people to do the correct things instead of trial and error for months for lack of documentation
I don't think any of the providers that scrape every single line of code put online care about license/permission. Reforger scripts will be used to train ChatGPT, Cluade, Grok etc like it or not.
Good reason to ban ai code from the workshop then 
here we go with you again, embrace the future my guy
If I wanted slop I'd go to Chipotle
That would imply it has "correct" code to train on... On a code base that is constantly changing how things are implemented.
Fr every major and even minor update would require the model to be retrained
Not completely but a good chunk changes, honestly this topic is a back and forth argument, there are those who don't see the point of ai slop in modding and those who believe it's the future.
There is no point in arguing it i just enjoy to throw one or two jabs every now and then^^
I'm trying to figure out how to find a random position within a ScriptedGameTriggerEntity, but not sure if a trigger is the right entity to base this off? Any pointers would be appreciated
Itβs built into unreal
Itβs shipped with a ai that is pretty much a tutorial agent
A replication agent would be all that I want 
Finding the absolute truth for how some Enfusion stuff works is a task in itself. You got this discord and a few wikis.
Most modders I see are learning through trial and error
That's the only use I could see for any ai agent. The docs are pretty good and if you can read code it's very easy to find out what's happening, besides the occasional engine magic.
So many projects I have that work in workbench but don't work in a DS environment. Which is just an issue of my own misunderstanding/writing code how I want to vs how a game engine wants it
Yeah we need some good examples of multiplayer replication to learn from
A sample mod that does that would be amazing
They can just ask here
No need to guess
Just beware
That there is no permission at all from us to use our data/code to train AI
Examples with explanations, the exposed code already has the examples. Just taking that an applying it to your own system seems to get a bit mismatched.
But it's not allowed, our license does not allow you to that
I'm not talking about applying it to AI if that's what you're talking about. More so just, how do I write a custom replicated feature, I tend to look at the game code to try to do it right. All by hand, no ai
A sample mod we could reference instead of waiting for responses here would help
Simple working examples
There are more sample mods being created, but don't expect them to be for every feature
at that point you spent the same time to rebuild a example game which is not worth it
sample mods re basic, like weapon as sample and so
For the rest, docs and the game should suffice
Mp replication needs more attention for explanations
Check the Doxygen docs, it's more complete
And the modding bootcamps for replication
They teach you everything you need to know as modder.
This is the approach we are taking on docs now
So no sample toy mods
hello
Iβm trying to edit here, but I canβt. What is the reason?
We are making them reference actual current game features and impl
Yeah soo make the stuff from the modding boot camps, sample mods
Which is why we are phasing out wiki
and go with doxygen as we can valiate things automatically there
See if it breaks right away
It's a locked file, override it and insert just your addition
No sample mods as I said
We are taking different aproach, sample mods as people have said to us before
are useless as they often miss key things
Or do not really get them anywhere
Better to show based on actual game
It's also best to not edit the enums, but to add your own custom ones as stuff into he base game could break
I think you are heavily missing the point
Do you mean creating a new script with the same name?
What I am saying is, we are showing these tutorials (Like the one you find for sample car) not on sample mods anymore
But on actual things that are in game
So that is is actually more true to how things were done in game
Half your modders are very hands on
And changes propagate after updates
That way is true to how things are set up
not artificial
And they do not become outdated quickly
It's just better reference material
I do not see how that is worse
You are still provided with the tutorial/guides the same
Just with actual game content
and with no pipeline that is often not the same used as game that is done in samples
a "cheat sheet" would be nice to have like 100 examples on how to call things, set them, etc. Example: see players held weapon name; view players inventory item names; check if player x is at base y; check base y if any players nearby; get count of vehicles player x has spawned; get name of base where prefab xyz was build by player; ...
This means, that for those features/impl we take as base. Their sources will be provided
But no more synthetic sample mods
Yes, I'm not at my computer but should be something like this ZHZ_EEditableEntityLabel.c
Inside:
modded class EEditableEntityLabel
{
custom_enum = 101,
}
if u want ur own label, choose a random numb.
A good percentage of people modding would rather look at a sample mod than have to search through 100s pages
This, give yourself an offset so it doesn't collide with other stuff

You are not reading it seems
I am reading I get the point but I donβt agree
I am not trying to be annoying here, but read again please
It will be the exact same as sample mods
Just the sample will not be a toy project
It will be an asset or whatever that is actually in game
Better quality base, something that is in game
Tbf a lot of this can be done, that's a majority of what I work on is data collection, soon item ownership and ownership transfers are going to be done so we can see who owns and who has owned some items
You get the tutorial on it more grounded to actual reality
But that restricts it
Take the gun sample mod for example
The bull pup
How will that restrict it?
Thatβs not in the game and itβs showing how to make something entirely new
We can combine multiple things
I am not saying for some things, we will not add new things
I am just saying that the target now is to try to use actual game as base for samples
compared to how it was done in the past to have samples separate completely
Which very quickly makes it obsolete and pain to mantain
Thereβs still no tutorial for vehicle animations
I am telling you docs and so are being worked on
Tbh I got tired already of this conversation
Seems like going in circles
BI still didnt figure that one out themselves; every update got broken animations on at-least one vehicle.
We are aware docs are not ideal right now, many are being created. Different systems for it are being set
But we tell you we are on it, and complain about the same right away
Is there a way to replace the FIA forces with other forces?
No offense but you guys have βbeen on itβ for a few years on some stuff
Sorry if Iβm not immediately taking your word
Yea that's all my mod is, watching what's built and responding to it. I'm spending most time trying to figure out how to get what I need rather than actually getting it. I just wanna make a mod to make the game more challenging, not be a Enforce script expert
You have been told what is being done about. New people got hired to do it.
At some point you will receive it.
It's not lies. We gain nothing on that, just more resentment towards us.
So I will leave it there with you, seems we must show it, not say it.
I love you and Iβm sorry for bringing it up
Don't worry, I understand the frustration.
It's my job to take that, and remove it.
On your case is actually providing thsoe things. It just went in circles so no need to spam anymore π
@minor agate is it possible to have weekly update discussions in the voice channel? Just for awareness of what's happening BI side that would be of concern for modders, but not a "my mod isn't working plz halp" session.
It is viable yes
Bit I am not sure how productive it would be all the time
But we can try
Itβs just some general things are rather difficult to find, Iβll try to make a list of stuff that could be made more obvious I donβt got anything off the top of my head
At least it would be nice way to connect modders to us as a person reather than corporate/company thing
Modding Bootcamps Q&As were heaviliy liked
When I did the modders united discord where we held roundtables voice chats with 25 devs where modders could ask anything was also extremely liked
yes those really helped get me started working in WB
Please, note them down and send them to me
i'd 100% attend these and watch recordings even if i dont have anything to say
Usually you can just ask here and you'll have your questions answered by people with way more experience and knowledge than you have, i've asked a bunch of stupid question about good practices etc and learned a lot from them.
The community is quite amazing in that regard
Someone talked about it
https://www.youtube.com/watch?v=1Oy4QBr-8nA
Support the stream: https://streamlabs.com/biggrampa
The recent meeting with Bohemian Interactive information and good and bad news
Feel free to chat and ask questions that is what I am here for guys
i have a full time job and starting a small business so I'll ask 100 dumb questions without regret π
we invited around 300 modders, and 25 devs were around (Even those that are not even here in this discord, so a bit more unique than usual)
Open stages where people could talk to us, get answers, discuss problems and solutions
etc
25 devs might be overkill for a weekly update/round table/karaoke session
This might be too much to always make (It was quite insane to pull off), but we can do smaller ones from time to time here
But it showed what I wanted to show internally with this, that personal contact to modders is better than corporate contact.
As modder myself before, my biggest gripe was feeling unheard/left out by devs.
So that is why there is a lot of direct involvement of devs here
You can always ask us for things
It was really good, both sides liked it
Same for the modding bootcamps Q&A
Even our own devs hosting them really liked it
Many have asked if it can be done again
Issue is that for regular devs, there is the risk of them breaking NDA
by accident
Maybe for every big release a well organized large one is done prior the release, while the others can be small and just to relay information
HINT: That is why the stages and channels for modding bootcamps are still open π
Seems it was really anticipated by modders, many mentioned on the open chats that they even took day off from work for it
Might be better to ask in #enfusion_configuration
I'd take a day off work too, beats sitting in meetings π
ok
I am actually surprised that everyone behaved
Except when someone mentioned mod monetization
You could probably get the Twitch Reforger content partners involved, im sure they'd find it cool playing with/talking to devs and modders. Though i dunno if modders are gonna be as social as they are π
We have plans to perhaps sometime this year start modded playtests with modders
To test their mods with us, check issues and performance more directly
Both for bonding and finding/solving/spotting issues
But I can hop to voice chats from time to time, just no one asks most of the time
In any case, any change/improvement for modding should/must reach me
So you can always ask me anything
or request
So do not be afraid of breaking the discord rule of no pinging/dm BI devs, as I am exception to that.
That I'm unsure of, haven't dabbled with that stuff at all
Soon you'll start to get used to reusing certain inherited classes and it'll become a lot easier. I'm no expert but I can build out stuff just off of memory pretty quick now
im getting used to object oriented coding, i've only ever used py API calls when I need something π
Ahh, definitely a learning curve. I enjoy the challenge that comes with modding, got used to the syntax fairly quick. Coming from coding crypto bots with python, jumped into web development and now this.
Definitely a learning curve with scripting, I thought working with the prefabs was enough of one lol
grok is this true
Hello everyone, i've a small issue.
On my spawnLogic, i create the entity and then setInitiamMainEntity via playercontroller.
(I also notice the respawn component that i've spawn) but i've always this black screen.
Can someone help me ?
Thank you !
This looks like the loading placeholder which is normally destroyed automatically when spawn requests are handled. if you made your own spawn logic you may either disable it in the attribute settings of the spawn system on gamemode, or clean it up on the client aftet the spawn is completed https://enfusionengine.com/api/redirect?to=enfusion://ScriptEditor/Scripts/Game/Respawn/Logic/SCR_SpawnLogic.c;595
We do it for reconnection to an existing char like this https://enfusionengine.com/api/redirect?to=enfusion://ScriptEditor/Scripts/Game/Components/SCR_ReconnectSynchronizationComponent.c;45
Oh I see ! Thank you for the informations
Hi, If I insert a scriptinvoker in the constructor of a weapon animation component, am I obligated to remove it to avoid memory leak ?
I spawn an entity and to make sure it's destroyed when the weapon become inactive, I copied the system of the flare anim comp. I have trouble to understand if I shoud .remove and how I can do that since there is no OnDelete() or similar method in the generic component
SN_WeaponComponent weaponStateComp = SN_WeaponComponent.Cast(ent.FindComponent(SN_WeaponComponent));
if (weaponStateComp)
weaponStateComp.GetOnWeaponStateChanged().Insert(OnWeaponStateChanged);
In the flare anim comp, it seems like .Remove(OnWeaponStateChanged); is never done, or I can't find it
wtf?
code:
instigatorCharacter.GetFaction().IsFactionFriendly(playerCharacter.GetFaction())
1st photo: in caller of Faction.IsFactionFriendly - different factions
2nd photo: in function SCR_CampaignFaction.DoCheckIfFactionFriendly that called by Faction.IsFactionFriendly - same faction
π€―
You have a "Spawn point" with the right faction?
Maybe wrong spawn logic or something mixed up.
Already happened to me as well.
Something is broken... π
auto a = SCR_ChimeraCharacter.Cast(instigatorContextData.GetVictimEntity());
auto b = SCR_ChimeraCharacter.Cast(instigatorContextData.GetKillerEntity());
Print(a);
Print(b);
Print(a.GetFaction().IsFactionFriendly(b.GetFaction()));
Print(b.GetFaction().IsFactionFriendly(a.GetFaction()));
auto af = a.GetFaction();
auto bf = b.GetFaction();
Print(af.IsFactionFriendly(bf));
Print(bf.IsFactionFriendly(af));
Result:
1
1
0
0
Only thing i could think of is to Print af and bf, to check if it is, what it is supposed to be. 
its literaly same code x.GetFaction() in one call
Yes i know.
But you have to start somewhere.
its full vanila
Its the only thing you have no print for.
I only mod this function to add Prints, no other mods presented
I bellieve this is something we recently fixed in the engine, but it will take some time to get into the game. the problem is with making the same native call to two different instances in the same line. put them seperate and it will work as it should
Hi! Could you please tell me how to find the code that deletes empty magazines?
Try using the symbol search, make sure methods is toggled, and search magazine. That's basically how you'll find anything in huge cobweb of OOP.
Thanks for the advice, but I couldn't find anything about deleting magazines. I tried searching for conditions that would delete a mag if it's empty, but I couldn't find anything either.
I'm asking here in case this is hardcoded into the animation or something like that, and there's no point in searching through the code.
I believe this is not part of the scripts, instead handled in game code. you may raise a feedback ticket for this to allow modders to decide if and how they want to handle the empty magazine, because i assume you want to keep them to fill them with individual bullets later?
Yes
Until, the feature request I put in is added (if it ever is) doing so is kinda pointless tbh. You would only be able to fill the ammo and not add ammo in different patterns.
yeah it would be amazing if engine allowed us to manually pack mags like in Tarkov. Also subsonic ammo is something we're still missing
What's it whining about when I want to grab the string a function returns, but an error says the function has no return statement?
** No return statement in function returning non-void 'SCR_MilitaryBaseComponent.GetCallsignDisplayName'**
I would like to use some methods in my mod from another but without dependency. it means that I want to check if external mod is loaded on server and if yes, then use those external methods. is there any way to do that?
Make sure to check the licensing on the mod you wish to do this with. You'll have to add the mod as a dependency either way, there's no way to not use something in a mod without having the mod as a dependency
Show the exact code and error message, not just some small code snippet
SCRIPT (E): @"Scripts/Game/RpLife/Core/EconomyManager.c,21": Operator '-=' not supported with array accessor []
SCRIPT (E): Can't compile "Game" script module!
do anyone know why im geting this
Error message is clear enough
The operator -= isn't supported with array accessor
you're welcome
Doesn't it mean "postfix" or that it is only called after a specific moment?
Like OnPlayerInitialized_S means the player has fully finished initializing iirc
Ahhh ok nice thanks.
modded class SCR_MilitaryBaseComponent : ScriptComponent
{
override LocalizedString GetCallsignDisplayName()
{
super.GetCallsignDisplayName();
}
};```
The code in the graphic is in SCR_MilitaryBaseComponent.
You are missing a return in front of the super call line
return super.GetCallsignDisplayName();? Uhhhh, why does return need to be in front of super?
Because the signature of the method indicate you need to return a localizedstring
Currently you're not returning anything, so you're returning void, which is incorrect
By returning super.MethodName() you are basically allowing the base method to "resume it's normal work"
Why wouldn't super.GetCallsignDisplayName(); already do that since it has a return in it?
Because you were discarding the output instead of piping it back out
I'm not on my pc so i can't give you a full example, but it's pretty much because the base method and yours are two separate method.
If i have for example
Void main()
{
Print (a()); //outpot = 0 (won't even compile)
}
Int a()
{
2+B();
}
Int B()
{
return 3;
}
A need to be
return 2+b(); so that it can return the total of 5.
If the result of the call to super method doesn't get returned or output by your override any way then your override is effectively trying to swallow the output
Just because b has a return doesn't mean that it will impact every other method that calls it
If your return type is different than void you will ALWAYS need a return statement in your method
im gonna need a Ghost drink to digest this
Just think of it like your override is composing a call to the other method
The other method still does it's return in your override's call to super method, then your override does nothing with that instead of returning it
Have you ever worked with OOP before?
yes python, rarely needed to utilize classes
If not then yeah i feel you, inheritance is one of the most confusing thing to learn for most people but as soon as you'll understand how it works you'll never forget it
For code clarity
Python is a bit different unfortunately here you're closer to java / c# oop
yea, learning cpp as i go with a book, and brocode, and modding
This is similar pattern to composing functions in functional programming if you're familiar with that
i think i get it, just weird im returning a super of a method that has a return in it already
yes i primarily do functional programming
Think of it executing over the input like
pipe(vanilla.method, override.method)
Is the same behaviour as calling super.method in your override, but never returning in your override would be like override.method in the functional example returning nothing and nuking any data from the previous function
This allows you to also cache the result of the vanilla functionality and apply mutations on top of that value before returning a different value, in your original override you could do return super.GetCallsignDisplayName() + " test"; to return vanilla callsigns suffixed with test
so essentially if I override any method with its own return, I need to have it as return super.method()
bc otherwise the Method() will just have its return go to super
If you override any method that is typed as returning a specific type, compiler will expect your override to also return that type.
Basically super.method() is only returning a result out of its context back into your override, your override still has to return that value or it's own value that matches the expected type
No, super.GetCallsignDisplayName() gets you the value when executed of the parent method. a string. what you do with it is of no concern. but the method you override expects you to also return some string, it can be something unrelated, but there must be one
Otherwise code that calls GetCallsignDisplayName() expecting a string and getting void from your override would break
Whether or not you actually call super.method() will depend on if you want your override to still execute vanilla logic, sometimes you will want to do it before or after your override logic or not at all, but your override has to be compatible with the original method's input and output types
think i get it now, just weird since the super call is pasting code back in so i wouldnt have thought of needing a return for it
It isn't pasting code back in
That would be php require
The way a method is called is with some silly things happening in the stack, basically toying with the program counter to make execute bit of code from somewhere else and then come back to the point it was before the call.
But this is irrelevant to you rn, that's only really relevant to people doing assembly prπ€’gramming (eww)
you mean the address in instruction register after popping the base and stack? π
I'm not an assembly expert you might no more, all i know is that you save parameters and the program counter (which is not really the same as the address once it is compiled in opcode) regardless i won't spread my science too much on that i don't understand this subject enough to confidently affirm anything.
But with the exception of some methods that are "optimized" by the compilator calling the base or another method isn't the same as copy pasting it
Enfusion script was v easy to learn inheritance with
Anecdotal
I understand inheritance, it's just figuring out how to call things in other files to use in logic, using types, and return issues like above
Ahh, instances are very fun. Get ready to really learn client vs server
Very basic but a static class can be used like this:
GSE_AddonUtils.GetPlayerName(arg)
Else you have to instance the class you want to use which varies depending on where the class you want to use a method is in
GameMode gameMode = GetGame.GetGameMode()
gameMode.Method()
What if I'm trying to pull something not static and is protected, I know it will change? I get errors trying to just pull the name of the base/callsign of where something was built no matter what I try: Inheriting, overriding, inline calls (below).
// Trying to grab from a protected string in SCR_CampaignMilitaryBaseComponent.c from myfile.c
string baseName = SCR_CampaignMilitaryBaseComponent().GetBaseName();
Print("The base name where new service station built: " + baseName);
// SCR_CampaignMilitaryBaseComponent.c
class SCR_CampaignMilitaryBaseComponent : SCR_MilitaryBaseComponent
{
// Code ...
[Attribute("#AR-MapSymbol_Installation", desc: "The display name of this base.", category: "Campaign")]
protected string m_sBaseName;
// Code ...
//! Returns the name of this base
string GetBaseName()
{
return m_sBaseName;
}
};
Non static mean it's in instance of class, you need to get instance of this class first. And for Components you can not simply instantiate it by yourself, you need to add component to entity and FindComponent
In other words, get the mil base entity first, then grab its mil base component, then you can mess around with it.
SCR_CampaignMilitaryBaseComponent milBaseComp = SCR_CampaignMilitaryBaseComponent.Cast(someEntity.FindComponent(SCR_CampaignMilitaryBaseComponent));
if (milBaseComp)
{
// milBaseComp.DoMyMethod();
}
is the FindComponent(SCR_CampaignMilitaryBaseComponent) looking for "someEntity" by a unique GUID, prefab GUID?
someEntity is just a variable name, that must be at least of type IEntity, the easiest way to get it is to use FindEntityByName function which is on World, that you can get by GetWorld from Game which can get by GetGame function.
And of course for this method entity must be named, but not all names that you can see on left side of World Editor is real names... you need name that can be set in top right corner of World Editor when you select any entity...
Do you mean this? I enter a name and save then try a test run, the game just crashes with a VM NULL pointer . Checking back at the editable prefab, the name field is empty again.
I might need some kind random GUID to get the base name, or find the closest base to the built prefab, so they get treated properly
These prefabs are duplicated to replace the vanilla ones, so I'll see if I can yank their other name
dang, still says it's null
@minor agate What magic trick do I need to do to rename this prefab model and make it stick? it's an **E_ prefab **that's a duplicate of the vanilla. It won't save what I renamed it to if I reopen the prefab in the editor, even with a force save
World.FindEntityByName??
void GetName(){
IEntity findprefab = GetGame().GetWorld().FindEntityByName("LFD_FD_US"); //LFD_FD_US named on E_prefab, left side of World Editor
SCR_CampaignMilitaryBaseComponent milBaseComp = SCR_CampaignMilitaryBaseComponent.Cast(findprefab.FindComponent(SCR_CampaignMilitaryBaseComponent));
if (milBaseComp)
{
// milBaseComp.DoMyMethod();
Print(milBaseComp.GetBaseName());
}
}
its not saving the name so maybe thats why it's null
You renamed the entity in the world right? Not in the prefab?
did both, i get a VM crash when doing it in world
You can't rename an entity in the prefab iirc, only in a world, the name must be unique, if the vm crash at runtime it's likely because you're not checking your values and calling methods on null variables
Dang it. It does stick in world, but adding another of the same object will make it crash
This mod is meant for PvE and PvP, so each thing will need a unique ID to identify what base it's at
Or just whatever base is closer to it
I'll be heading to bed now so can't really assist you longer but make sure the names are unique in the world
Check that before calling methods on your entities / comps you check that they're not null, also usually there are many other ways to find entities than doing a findentitybyname.
Usually you can make it so that the entity itself announce it's existence to a game mode component for example which means you won't need to name every tent / base.
ok, many thanks for your help!!
Looking at screen with entity - why are you trying to get CampaignMilitaryBaseComponent on FuelStorage? It's definitely not a base, it's fuel.
Naming prefab is useless, this name will not propagate to world
I need to know what fuel prefab was built, and which base it was built at.
Military base component does not exist on buildings themselves, only on the base entity. Conflict service buildings register themselves to nearby bases. Check vanilla scripts for stuff like arsenal or vehicle maintenance sign to see how they find the base they are registered to
Does anybody have a decent way to detect or prevent hackers getting on the server and doing stuff like spawning buildings? We've been having issues recently were people are able to get on and then they will spawn in buildings not even available on GM etc
So i don't think detecting a GM would be enough
ok will do, thanks!
What buildings are they spawning in? If it's something not in the GM spawn menu, you can probably go off that to kick the player.
also ensure your Admin password isn't something like "password"
There are no logs when cheater is doing something bad, you can only guess
Random map buildings like churches and stuff, obviously we kick and ban the player but you have to see them do that to know who it was
I was wondering if there's a component or function somewhere when things are placed that I could use to check if its allowed and stop it / kick that person
It's definitely not them gaining admin as its passworded with only like 4 people knowing it and we change it regularly plus they don't show up as an admin in game
I mean, B.I. should breach their contract with BattleEye or whatever because it apparently hasn't worked in the 30 years they've been using it.
I use this to grab what's being placed, maybe you can use it to see what's getting placed and go from there. Player placement uses SCR_CampaignBuildingPlacingEditorComponent.
modded class SCR_PlacingEditorComponent : SCR_BaseEditorComponent //GM placement only
{
override protected void OnEntityCreatedServer(array<SCR_EditableEntityComponent> entities)
{
foreach(SCR_EditableEntityComponent Comp: entities)
{
string gm_spawned = Comp.GetPrefab();
Print(gm_spawned);
}
}
};
There's something else that can give you the unique instance ID and vector coordinates of placed entities in the world viewer output, I'm not sure what library it is though
Hello. I have two points. Is it possible to find road or road points between them? For road or roads which are connection both point
Is it possible to connect enfusion to external APIs
Via RestApi class yes
@torn bane maybe you can help π pls
Tsm
Is it possible to return the mins and maxs of the GenericTerrainEntity bounding box? I tried returning it with
GenericTerrainEntity terrain = GenericTerrainEntity.Cast(GetGame().GetWorld().FindEntityByName("Terrain"));
terrain.GetBounds(mins, maxs);
But they just return <0,0,0>
are you wanting to do this in game or in the editor?
In the game. I'm basically trying to do a QueryEntitiesByAABB to find all entities of a specific class
What specific class?
Querying the entire map is the worst way to do what you're doing
Custom entity thats based off GenericEntity. I was trying to see if there was another way of achieving this as qurrying the entire map did seem a bit ridiculous
In your class define a static array of that class then each entity can add itself to it when created and removed itself when destroyed.
Ahh that makes sense. Thanks for the advice
What exactly are you trying to do? Because the question you're asking would require a lot of not so optimal functionality.
So if not optimal, then need to skip idea. Currently Iβm using random roads in some radius and works not ideal, but fine
You're not explaining the outcome of what you're asking to do, if you explain that then there might be some optimal way to do it.
If you think that(the way your're suggesting it be done via your question) is the only way that it can be done, in most cases you would be incorrect.
There are numerous ways to do things, and have the desired outcome.
ctrl + click no worky anymore
To drill into items? it does, but it's picky what it'll do it to now
Does anyone know where the script that enables helmets from being shot off players' heads is located? https://www.reddit.com/r/ArmaReforger/comments/1nr34aa/shooting_helmets_off_in_16/
I suppose it'd be SCR_HeadgearInventoryItemComponent::DetachHelmet
How can i get navmesh data on a building? Basically i want to find a reachable position in a building
World Systems have RplLoad/RplSave stuff or I need to manually sync through World Controller? (Because there is no definition for them in base class like for entities and components)
They do too
They do not have to be in base class
If they are rpl enabled, then rpl system will look out for those, if defined
Do I need to script physics to be active for an item so that it falls down when game starts or the entity is spawned?
I thought setting rigidbody to active would do it but guess not
If you find a good way to do this, please share.
how does the RHS vehicle NV component works and how can I bind a custom key to activate it ?
Right click it and go to script to see how it works?
Some lightweight way would be to use bounds min/max of the building and create a random position within the building bounds.
If you like a real checked position it will require quite a lot of additional messing around with trace and stuff.
The easy way always worked pretty well for me so far, by using pretty little code.
Even if the position is not reachable, the A.I. will move, as long as it can towards the position and cancell, whenever it reached a dead end.
sadly can't be random position as there can be empty voids inside a building that aren't actually reachable
Kex from Game Master Enhanced has created some very specific building position search.
His stuff is open-source, so may you like to check it out. π
It's very complex to say the least, but working pretty well.
Hi! How to get vehicle attachment in proxy if i spawn it to empty slotmanager slot by server side script?
Slotmanager's slot returns null for GetAttachedEntity() in proxy, works only in server however i see the replicated object on vehicle.
And i not see it in IEntiy childrens list.
NVM. I found it in childrens.
Pretty sure you have to replicate that yourself per client the server doesn't do it. Since the server owns the vehicle and controls it things seem synced up.
How do i change the position of where a grenade is thrown? Is it hard coded?
For example i want to create a underhand throw. I see overhand throw in player_main.asi, but don't understand how the overhand throw is triggered. And how it could change the actual position of where the grenade is thrown from?
Does someone have a idea how can I replicate a map ? Using RplProp ? Or any other solution ?
Use dynamic markers, then you can disable/enable it in clients. Or old mapdescriptors what is initialized on every client.
Hello hello ^^
Since the changes made to restCallbacks I'm wondering what would be the cleanest approach to callbacks.
A mod of mine has a LOOOOOT of different callbacks and using .SetOnError() / SetOnSuccess and pointing to a method in the class isn't a viable option for me. I guess i could create a static class and point it there but i'm not sure.
What would be the best approach? I liked the approach we previously had with creating a class and overriding OnError or OnSuccess
Hello I try to use the dedicated server tool. But when I use It I can't get the player's UID. But when I work with the WB It works.
Does someone have an idea ?
Thank you
That's normal
So how can i do ?
on the WB fake uids are being generated.
Using dedicated server tool you're emulating the way a dedicated server would work, the issues are
- Uids are only available after OnAuditSuccess_s
- Only one instance can have a UID, since all of your instances are linked to the same instance, so the other one won't have a UID assigned iirc
Inside my custom SpawnLogic I tried after the OnPlayerAuditSuccess_S.
And the SCR_PlayerIdentityUtils.GetPlayerIdentityId(playerId) return ""
So how it's possible to have the first instance UID ?
I'm trying to find a tutorial on how to edit entity attributes through a script mod, can't seem to find a tutorial. Want to be able to keep a character in an unconscious state through the attributes menu when in the properties tab on a character entity
I assume a script mod can add a toggle button in the attributes menu
i'll quickly test smth out regarding this gimme a sec
@buoyant peak actually i believe UIDS are simply not available on DS tools, if you want to create fake uids you can use that instead :
static string GetPlayerUID(int playerId)
{
if(!Replication.IsServer())
{
return string.Empty;
}
string uid = SCR_PlayerIdentityUtils.GetPlayerIdentityId(playerId);
if(!uid)
{
return string.Format("bbbbdddd-0000-0000-0000-%1", playerId.ToString(12));
}
return uid;
}
This way it generate a fake uids when you can't retrieve it from the backend
Okay thank you !
Since 1.6 there is a script utility for identity in script, use that, not something custom made. https://enfusionengine.com/api/redirect?to=enfusion://ScriptEditor/Scripts/Game/Utilities/SCR_PlayerIdentityUtils.c;7
Hey arkensor,
Can you give me your opinion on how i should proceed with this small issue i have ? #enfusion_scripting message
i had written all of those callbacks before they were marked as deprecated and i'd like to know how to properly update them.
Thanks in advance
Hello I've used it, with on dedicated server I received a empty string too
Are you running the call server side or client side?
because personally i've never had an issue fetching a UID
Server Side
On dedicated server I can't recover the uid but in the Workbench I've my real player UID (Not a fake one)
Make sure you are using the debug server executable not the regular one
The debug executables have some kind of polyfill to make UIDs work in local testing
the server needs to be connected to the backend properly or else it will not retrieve any identities of players. config.json of the server must have public address etc
Only the regular one or the debug too ?
both need to be backend connected, there is no magic on the debug one
Do we have script functionality to force a character entity to use an animation, anm file? With no changes needed to animation component. Literal "play this anm on this entity"
Oh right that was debug client needed for use as peertool to get the fake UUID, idk about DS tool
I noticed today that if two different mods declare a variable with the same name, it doesnβt trigger any compilation error. Instead, one mod can end up interacting with the other modβs instance of that variable.
Is this intentional behavior?
The issue I ran into was that Senβs Discord Player List mod declared a RestContext named m_RestContext, and my mod used the exact same variable name. A server happened to be running both mods simultaneously, and what ended up happening was that my mod was sending requests using his RestContext instead of mine and occasionally maybe flooding his logs (oops).
Once I identified the root cause, the fix was straightforward. However, it still feels like the compiler should either:
-
Properly encapsulate each modβs variables so they canβt interfere with each other,
-
or throw a compilation error when duplicate global variable names are declared across mods.
Why doesn't this give an error?
string buildingSearchPurpose "BuildingGarrison";
It's missing the =.
Maybe good to know for the compiler or whatever does the error stuff.
There is 1 or 2 other script things i've noticed, which doesn't give an error, when they should.
strange Print output
SCRIPT : string buildingSearchPurpose = ''
It throws a console warning.
Good to know, guess i'd know if i played the game
Hehe
global variable, as in outside of class?
If so. Don't do that
global methods and global variables are not emant to be modding friendly
And should not be used by modders, it's there more for very specific usages for us
we both had a global variable withing SCR_BaseGameMode named m_RestContext, i guess it was a really unlucky coincidence but still
On classes, they replace each other
it's a modding mechanic for them being there since DayZ
Allows people to change the value of them on other mods
what's the benefit of one variable replacing another if the mod isn't marked as a dependency ?
Is it to make "soft dependencies" possible or?
mod dependency is not a thing on scripts
only the exact path of the script files is hwat is used to define compilation order
exact path is the path like Scripts/Game/...
I'm just still confused since i don't really see the benefits of having a mod being able to replace another mod's variable like that and in my case it ended up having unexpected behaviors.
It's just old decision from a really long time ago that is problematic to change now with the resource database and project ordering
fair enough, was pretty confusing to debug
It's why I add tags to modded vars and methods too. It's easy to mod gamemode and think same about naming
I see
I guess I deserve it for assuming i was the only one to name my restcontext m_RestContext in a vanilla class (very clever i know)
What could cause the following to occur (simplified the code)
- Server can find an NPC using his name
- Client can't find the NPC using his name
- This is all being run in a component attached to the PlayerController (where I attach most my components)
- NPC is properly replicated, this block of code only begins when the client interacts with the NPC
{
string npcName = "testGuy";
IEntity npc = GetGame().GetWorld().FindEntityByName(npcName);
if(npc) Print("Server found testGuy");
Rpc(RpcDo_ClientFindTestGuy, npcName);
}
[RplRpc(RplChannel.Reliable, RplRcver.Owner)]
protected void RpcDo_ClientFindTestGuy(string npcName)
{
IEntity npc = GetGame().GetWorld().FindEntityByName(npcName);
if(!npc) return Print("Can't find NPC");
}```
I have a slight feeling that that call FindEntityByName, is meant for server side usage only
Are you able to pass the IEntity through the rpc call or does the compiler yell at you about codecs?
Just have the server send the RplId of the entity to the clients and the clients resolve the entity through its RplId
That's also not working, server is returning -1 when I call...
Print(npcId);```
It's really odd because I use this exact same NPC to place a map marker with the client finding it by name. But for some reason that's not working here, and I can't even get its RplId from the server
Does it have an RplComponent?
Yes, it's a mapped placed Entity too, idk if that matters
https://i.imgur.com/Otg38ZW.png
Has a prefab but has been placed on the map and renamed to use findByName, which works when the client searches for him to place a marker on him.
Hmm can't remember if map placed entities are replicated or well registered in replication right away, technically speaking all clients should know about them. I haven't personally messed with a setup like that too much so I have no more ideas.. Only other idea is if you're using this entity for other things on the client you could have some logic setup and when the entity is created register it to that logic which will serve as a tracker for it. But I don't think that's really needed someone who does have experience with that might chime in 
Thanks for trying, the bit that really messes with me is that I'm doing this exact same code, in a different component, for the same NPC to find him by name, with no issue.
The components are both attached to the player's PlayerController, I can't see what could possibly be different between the two, but thanks anyway
Very strange indeed 
If the name is being set at runtime, it will not be found on the client.
Setting the name isn't replicated
They're renamed in the editor.
I changed their Rpl State Override to None and the client can find them now by name, however all their clothes are sitting on the ground at their feet π
What if I just need the base name where a service component was built, not all the bases it's registered to?
Need help with working a component script i need to show up in 'add component'.
How do you work the component class to get it to show up as a component?
In this script i want to play a sound when the player spawns in.
https://imgur.com/a/lw74o09
Is it in the correct directory? Scripts/Game, have you validated/reloaded scripts?
it is in scripts/Game/GameMode/Components
I am unsure on how you work the ComponentClass structure to be able to use the SCR_SpawnLogic parent to work the OnPlayerSpawned_S() method
iv tried it in scripts/Game as well
Are you reading this?
https://community.bistudio.com/wiki/Arma_Reforger:Create_a_Component
I have read it.
i just need to inherit from SCR_SpawnLogic
But everytime i try the 'add Component' in world editor it cannot find the script
the structure of the Component class structure at the top is something i just cant get my head arouind
Make sure you go to build tab up the top and 'Validate and reload scripts' just mentioning this again because It got me when I first started and I didn't know why my actionScripts weren't showing up
shift+F7 for shortcut
A question about creating NPCs to use as shops in my game mode.
Parent is GenericEntity, he has a BaseLoadoutManagerComponent that I use to put clothes on him.
This worked fine, however because the RplComponent had 'Rpl State Override' set to runtime, clients could not find the NPC by name, so I changed that to 'None'
Now when a client sees the NPC, the clothes are sitting in a pile at their feet and they're in their underwear.
So I've fixed the issue of not finding the entity by name, but now they're all naked.
Any ideas?
Not sure if you know this or not, but this idea of yours has already been done and guess what? Adam had the exact same issue. IIRC myself and maybe some others have found ways to combat this issue. Search this discord, maybe search his shop system thread and you should find some sort of workaround.
SCR_SpawnLogic and classes that inherit from it aren't components.
This is returning a function address like in the comments below, how can I get it to cough up what's being returned?
modded class SCR_ServicePointComponent : SCR_MilitaryBaseLogicComponent
{
override ScriptInvoker<SCR_ServicePointComponent, SCR_MilitaryBaseComponent> GetOnBaseRegistered()
{
if (!m_OnBaseRegistered)
m_OnBaseRegistered = new ScriptInvoker<SCR_ServicePointComponent, SCR_MilitaryBaseComponent>();
Print(m_OnBaseRegistered);
// Returns: ScriptInvokerBase<func> m_OnBaseRegistered = ScriptInvokerBase<func><0x000002A71C20E0F0>
Print(m_OnBaseRegistered.Type());
// Returns: ScriptInvokerBase<func>
return m_OnBaseRegistered;
}
}
What?
hi guys, can some help me with a thing? Im trying to add a script into GameMode_Campaign.et using the onverride method but I dont know how to do it
GetOnBaseRegistered is returning a script invoker
oh lawd another thing to read up on 
If you want something to happen when the base is registered, then you'd get that script invoker and insert a function into it that would be called when the invoker has Invoke() called on it
Pretty sure script invokers are covered on the wiki.
thanks, ill check into it
Having just looked, the wiki is wrong lol
yes
They're calling Insert and Remove on TAG_EventHolder
and instead it should be .GetOnScoreChanged().Insert/Remove
Hello! Is there someone that could help me with a loading screen mod I am creating? Specifically I am trying to create a Random Loading Screen mod, where the loading screen changes at every loading you go through. I've tried to implement a lot of different systems, but none have worked... I am not even sure if something like this would be supported by the engine.
Fixed, and I did write it myself, dangit! Thanks
Appreciate it.
Whats a quick simple way to get what base a service station is built at, because im getting nowhere in SCR_ServicePointComponent. I could pull its XY coordinates to do +/100m, but that just sounds painful
actually that'd be kinda funny, then I can make a mod where a heli has to refuel everything

