#enfusion_scripting
1 messages · Page 10 of 1
You can also just do vector mat[3] = {"1 2 3", "4 5 6", "7 8 9"};
Would be the correct version of this, it was just missing the brackets
Works with strings but I need curly braces to do statements inside
the what now
You can replace the string with Vector(1, 2, 3), string is just the short form
I guess I meant expressions
Huh, I thought I tried that and was surprised it didn't work. I guess that's it
turns out it was just me not check the parent node checkbox in RplComponent
Maybe vector was lower case
Thanks, that's exactly what I wanted!
what could be the issue if my EOninit /OnPostInit of a prefab is not running after spawn via script 🤔
With EOnInit, you have to enable it first:
void YourComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
{
SetEventMask(ent, EntityEvent.INIT);
}
OnPostInit should work without that.
thanks, i'll try
Is it possible to make it so that consoles have a mouse cursor in a menu ??
Or can they only tab in betweens buttons etc ??
How do I get IEntityComponentSource of a component that is a child of another component?
Nvm, IEntityComponentSource::GetObjectArray with "components" as variable name does the trick.
I guess you might be the only person trying to run tools on Linux, so you won't find any support.
That is incredible sad(
@toxic lichen
I'm using workbench on Linux mostly okay but it probably heavily depends on distro and hardware
It's possible to edit scripts with VSCode or other third party editors but the workbench script editor is the only way to have good support for the language / global context in WB that I've seen
Turned out, all I needed to do was this: ```c
modded class SCR_CampaignMapUIBase : SCR_CampaignMapUIElement
{
override protected void SetIconName(string name)
{
super.SetIconName(name);
if (m_Base && m_wBaseName && m_wBaseNameDialog)
{
Color defaultColor = GetColorForFaction("");
Color fiaColor = GetColorForFaction("FIA");
Color ussrColor = GetColorForFaction("USSR");
Color usColor = GetColorForFaction("US");
if(m_Base.GetFaction().GetFactionKey() == "FIA")
{
m_wBaseName.SetColor(fiaColor);
m_wBaseNameDialog.SetColor(fiaColor);
}
else if(m_Base.GetFaction().GetFactionKey() == "USSR")
{
m_wBaseName.SetColor(ussrColor);
m_wBaseNameDialog.SetColor(ussrColor);
}
else if(m_Base.GetFaction().GetFactionKey() == "US")
{
m_wBaseName.SetColor(usColor);
m_wBaseNameDialog.SetColor(usColor);
}
else
{
m_wBaseName.SetColor(defaultColor);
m_wBaseNameDialog.SetColor(defaultColor);
}
}
}
};
it's pretty crappy in all honestly, i tried it on arch (and like stated you may have better luck on a different distro), but i just ended up caving in and setting up a windows partition. there's really not much of an advantage to running the workbench on linux though - even if it did have proper, full support
at some points when trying to edit script i would even have odd common occurences of caps lock turning on/off randomly, and when trying to type , it would type / instead lol
What's the best path to go down with importing a custom heavy weapon such as a turret?
Is it easier to just use the base prefab or a prefab and replace the mesh object with my mesh? Or do I start from scratch considering I'll probably have to do some custom animations to make it half decent?
I have copied a tripod prefab to the T and it still won't fire.. I imagine it's Todo with different bone names that are not triggering events?
If you use the Editor on Linux and it keeps crashing .. check what're using .. are you using proton/wine? (Idk if this shit runs natively also .. should as it is written in C or C++) may it misses some libs or the wine prefix is wrongly setup, some wrong or old versions of libs .. You should've also a crash log .. check it also out.
What type of turret I guess, just a M2 tripod reskin?
Nvm it’s a held weapon
mmmmmmmm
nahhhh
I've started redoing the skinning for a different tripod tho
tryin m60 as its more setup for my needs
The tripod graph is actually better I think
It can use custom height info, though the tripod will be stationary
Yeah I did come across something for the height
yeah just use tripod
for reloading maybe you can like
make it so they need to exit the turret
and load it through an action or something
play the car fixing/wrench animation
for reloads
that'll work

Does anyone know if the "roles" enums need to actually do anything? Or could I create my own enums in there to split players into "roles" without it actually having any perms tied to it
Interesting question I have. I can edit a material in workbench while in play mode and my material edits apply within the play mode. Is there an API of some sort that will allow me to do this with code (without using SetMaterial as it is actually just ReplaceObject).
Yes
Material mat = Material.GetMaterial(MaterialResourcePathHere)
Then use mat.SetParam(paramName, valuehere);
It will change it FOR ALL meshes using said material at runtime
It can be used in normal game as well
Ok, that fits my usecase perfectly. I saw that earlier and wasn't sure if that would work. I'm doing something pretty hacky modifying emissive properties of a material using ParametricMaterialInstanceComponent. The issue is that if the original material's emissive color is not set white, SetEmissiveC/M has no actual affect on the material. So what I was doing was setting the emissive to the value I'd like it to be at, but then setting the emissive multiplier to 0, but because this only runs on my component it would leave items emissive such as with item previews, etc.
This should allow me to leave the base material's emissive properties alone, and just modify with code on the fly.
I would say avoid ParametricMaterialInstanceComponent if using it on a prefab type that is quite common around
As ParametricMaterialInstanceComponent wrecks object instancing
If this works, I shouldn't need to use it at all ideally. Assuming instancing a prefab with parametric does stuff with hierarchy/needs overhead on engine side for the material settings?
As soon as you use ParametricMaterialInstanceComponent, or what actually wrecks the things REFs in the material then you break object instancing for that
Many objects of the same shape, same material, same properties, etc they get loaded once, then copied around with changes to certain extent to improve performance.
(It's more complicated than that but that gives you the gist)
This
The one i told you with the Material class does not mess this up
What would be the simplest way to detect any projectile hits at the object with no damage manager/destruction component?
Hate to bother you but what is expected for void value on SetParam. The .emat file doesn't give many clues. I have tried passing string "1 1 1 1", Color.White, {1.0, 1.0, 1.0, 1.0} etc. for Emissive and nothing seems to take effect though using ResetParam does function. Same with EmissiveLV - where the level doesn't seem to change no matter how I try to pass the (float?).
YOu have to feed it a variable
Anytime you see void on a method, you should feed it a variable
In case of that one
has to be float value[4]
(Depends how it is stored in the emat)
If its 0 1.0 0.5 0.5 in the emat
the nyo uhave to do that static array of floats
Open the emat in text view and check
For example
I was passing a variable to the function, but I guess my confusion hinged on how to instantiate the array of floats. So instead of:
protected ref array<float> newEmissiveColor = {1.0, 1.0, 1.0, 1.0};
I needed to do:
protected float newEmissiveColor[4] = {1.0, 1.0, 1.0, 1.0};
That fixed it, makes sense it should be fixed length.
that is what I meant about static array
float newEmissiveColor[4]
that
not static keyword
Yeah, feel like a noob on that one. Coming from JS has been a pain but I'm trying haha.
Is there some obscure way to alpha fade a mesh into terrain?
Light a tiny gradient instead of sharp cutoff
Maybe use multiPBR and set one of the channel textures to match the terrain and manually set UV via script?
¯_(ツ)_/¯
Would have to know the material below the object
can i send replication command ( Rpc(..) ) with data to specific player, not for all players?
specificy a playerId in the Rpc inputs then just add
if (SCR_PlayerController.GetLocalPlayerId() != playerId)
return;
this is about traffic size not players filter. I can send all massive to everyone but its not good for traffic optimization.
I don't believe there is a way to achieve what you are doing currently to my knowledge
Without that quick check in a broadcast
Get the player controller of that player (or any other entity that they own) and send to owner
This is the best I could do and it's pretty bad #enfusion_terrain message
Well, it’s something at least.
Got it, thanks. Apparently I had a bad experience with my distro
I tried it on Arch, too. It didn't work for me at all, ok the crashing and windowing issues, stuff happens. But it couldn't even start workbench console 😦
😂
Natively it doesn't run at all, through proton it works, but very badly in any way
just make a vm with gpu passthrough for modding idk, lunix is unsupported so not sure why waste time
unless just for the fun of it
No I like to hurt myself as example
😂
But I just do not like Windows
if you're not the average consumer, it's somewhat likely you aren't a fan of windows
only reason why I tolerate it is because I used a heavily modified iso
I've found some also .. but I am to paranoid to install an external ISO with the ability to control anything on my Mainboard
I had also scripts for reedit etc .. but they always break bcuz of update and to lazy to keep updating the script just to have windows not use 10% of your hardware already .. if not more.
gotcha, the iso im using wasn't anywhere public from github or anything. my buddy made it and gave it to me
I hope he is a really good buddy 
💀
RIP try breaking your formula into parts
I wish we would get some HTML support or something in between like ASP.NET for UIS
This is just way too confusing
it was simple cond1 && cond2 && cond3... 20 times... 
thanks to AI - one prompt and it rewritten into "if !cond return false"
Yeah I figured out the limit once, I wanna say it's like 16? Any more and you'll get that error. I'm surprised ai was smart enough to help you with that. Most ai code for reforger I see simply doesn't work.
@red cedar I'm having some trouble with PeerTool, it's silently failing to connect a new client. No errors on the console.
Log File^
You need to add each and every dependecy you are running with the -addons GUID1,GUID2 params
Can you just send the console.log maybe?
Sure
I'm currently rolling just the MpTest.ent without addons just to get the peerTool working.
And the peertool just closes?
I get this. It looks like it's starting up another client. And then it just silently crashes.
You want to point to ArmaReforgerSteamDiag.exe in your game files(not the tool’s files)
You’re welcome, make sure to drop every graphic settings down on the peertool and drop the sound audio to like 5-10%
I was actually able to get this running, but it's still terribly inconvenient
Anyway. Is there a script responsible for the logic of character movement, for example, when walking? I'm looking at different controllers and components and can't connect where the direct logic is handled
class CharacterMovementState
{
int m_CommandTypeId; //! current command's id
int m_iStanceIdx; //! current stance, only if the command has a stance
float m_fMovement; //! current movement (0 idle, 1 walk, 2-run, 3-sprint), only if the command has a movement
float m_fLeaning; //! leaning state (not all commands need to have all movements)
float m_fDynamicStance; //! current adjusted stance 0.f - 1.f, only if the command has a adjusted stance
ECharacterDataState m_DataState; //! simulation state flags
}
It's the closest thing I've found
Try using proton-ge with gamemoderun if not already
Actually already using
Good afternoon. Could you tell me if it is possible to override the method or component responsible for the walking logic? I would like to influence all the characters with my mod, and therefore it would help me a lot to override the method (if it exists alone):).
I apologise for the ping after three years
https://community.bistudio.com/wiki/Arma_Reforger:Entity_Lifecycle has no EOnActivate for Components, yet there is
/*!
* Event when component is activated.
*/
event protected void EOnActivate(IEntity owner);
```in `ScriptComponent` and vanilla components seem to have it too in few places. I tried adding this event to my component but it never triggers. What is going on with this event for component?
I had trouble with it depending on if you are using `ScriptComponent' or 'ScriptGameComponent'
If you are then using it on the wrong entity it will not fire (GenericEntity or GameEntity)
I'm doing tests with -nds 1 -nwkResolution 10 server/workbench settings from recent replication bootcamp and peer tool client never gets script spawned objects streamed in for them. Only world editor placed entities stream in and out at close distance but server script spawned never do.
Spawning through remote console:
IEntity p = GetGame().GetPlayerController().GetControlledEntity();
vector t[4];
p.GetTransform(t);
Resource res = Resource.Load("{B1C6B4A379D1BB77}Prefabs/Structures/Houses/Garage/Garage_E_01/Garage_E_01_Base.et");
IEntity veh = GetGame().SpawnEntityPrefab(res);
veh.SetTransform(t);
veh.Update();
I wonder why
What exactly are you trying to change? Movement of entities is usually in c++
Claude has gotten a lot better over time, ChatGPT still sucks. Claude will occasionally try throwing in a try/catch and I have to remind it that doesn’t exist in enforce lol.
Good news, our script wizard cast some spells and in one of the next major versions (likely not the very next one but the one after) this will be supported, so you can feature toggle using gproj and track those changes in your version control to share with collborators so you do not need to sync which cli param you all use. Thank you for the reminder about this 🙂
Is QueryEntitiesByAABB faster than QueryEntitiesBySphere on large area checks?
how can i know that player already connected and created on client side?
I use **OnPlayerConnected **or **OnPlayerRegistered **and send Rpc to client, but this client isnt init and hasnt name and id yet. **GetLocalPlayerId **returns 0 randomly, but its all ok when i use delay in 3-5 seconds.
Peer client logs without delay:
14:46:20.421 SCRIPT : string message = 'DEBUG: SCR_PlayerController.GetLocalPlayerId 0'
14:46:20.421 NETWORK : ### Creating player: PlayerId=2, Name=Player (0)
14:46:20.421 NETWORK : ### Updating player: PlayerId=2, Name=Player (0), IdentityId=

SCR_EntityToolbarItemEditorUIComponent
OnPlayerAuditSuccess?
thx. Ill try that
it doesnt work for peer client, because peer client fails audit all time, but it can works for normal clients and flow
15:46:16.749 NETWORK : ### Creating player: PlayerId=2, Name=Player (0)
15:46:16.750 NETWORK : ### Updating player: PlayerId=2, Name=Player (0), IdentityId=
15:46:16.753 SCRIPT (W): UpdateBlockList failed. Another request in progress.
15:46:16.853 BACKEND (E): [RestApi] ID:[7] TYPE:[EBREQ_GAME_ListBlockedUsers] Error Code:400 - Bad Request, apiCode="InvalidInput", uid="DELETED :D", message="accessToken can't be empty"
15:46:17.021 BACKEND (E): [RestApi] ID:[9] TYPE:[EBREQ_WORKSHOP_GetVersionSizeDiffWorkshop] Error Code:401 - Unauthorized, apiCode="Unauthorized", uid="DELETED TOO :D", message="Unauthorized"
OnPlayerAuditSuccess is not called for peertools.
What you can do is have a
#ifdef WORKBENCH
and call it OnPlayerSpawnFinalize_S(keep in mind this will be called every time the player spawns)
I’m not sure what you’re trying to do but most things can be done either in a OnPostInit or OnPlayerConnected(for the peertool)
Peertool clients will always fail the audit as you only have one identiy id.
but it doesnt call **OnPlayerAuditFail **too 
Ok. I understand. I will test audit on normal dedicated server.
Is there a way to change movement speed through scripting?
I was able to scale the character but when the character is larger than a certain amount animation and speed are weird
on dedicated it'll work smoothly
that's a bit of peertool jank for you
I want to make a mod that tracks the player's equipment and, in particular, inflicts minor damage if they move while their shoes are off. Literally damage from bumps on the ground)
I thought the easiest way would be to modify the component responsible for direct movement, but if there is a better way, I am willing to change my approach, because there is only script option
modify the component responsible for direct movement
By modify the direct movement, do you mean the character movement speed and stuff?
Yes, some classes that describe logic of a movement. I thought there are some of them written in Enfusion Script
Are there some debug shapes in vanilla AR similar to A3's arrows and spheres? I did quick search but couldn't find any.
Having to use crackers right now
class shape
But they only work in the diag executable
override void _WB_AfterWorldUpdate(float timeSlice)
{
if (m_bVisualize)
{
auto origin = GetOrigin();
auto radiusShape = Shape.CreateSphere(COLOR_YELLOW, ShapeFlags.WIREFRAME | ShapeFlags.ONCE, origin, m_fRadius);
foreach (DoorStruct door : m_aQueriedDoors)
{
auto arrowShape = Shape.CreateArrow(origin, door.owner.GetOrigin(), 0.1, COLOR_GREEN, ShapeFlags.ONCE);
}
}
super._WB_AfterWorldUpdate(timeSlice);
}
``` etc
Yeah I've seen it, but I needed standalone entity. I guess I'll have to make one
There are debug spheres but they tend to hurt your eyes, you can also see them through any terrain or object
What should I search for?
iirc
protected ref Shape m_dbgInfantrySphere;
m_dbgInfantrySphere = Shape.CreateSphere(
ARGB(255, 0, 255, 0),
ShapeFlags.WIREFRAME | ShapeFlags.NOZBUFFER,
iCenter,
iRad
);
Ah, that's debug shape, thought there is a model or an entity
Then i’m unsure sorry
There's a plane, cube and sphere in core->system->wbdata->materialEditor, but this is honestly more for showcasing materials I assume
Trying to find better ways to optimize mass entity spawning.
Is it possible to have entities spawn and a game system perform during the preload of the server or are we restricted to on init or post init?
I know there's the PreloadManager, which will handle prefabs and in-turn those entities, but I guess my issue is more so figuring out the game system in preload, unless I'm misunderstanding how the game systems work 🤔
Maybe on init is good enough, potentially
what about spawning 10 entities per frame, just run it on game mode start?
Are you also doing persistence at all?
I thought preloadmanager was to preload assets into memory or sth
For this case, no persistence. And was previously doing 1 entity spawning every half second, but the processing needed to determine which item is gonna spawn and which spawner was bogging down performance quite a bit, even with a bunch of limiters set (not a professional coder by any means).
So looking to do a mass spawn of items at server start to get all the entity spawns out of the way when basically no players are connected, and then go to work on the processing itself to reduce the performance drawn each time it checks afterwards for entity spawning.
But talking about possible 4500+ spawn locations across the map, with processing from a config with about 500+ possible spawnable entities total
Takes quite a bit processing power to sort through all of it 😅
Also probably mistaking PreloadManager from what it actually does
Ahh, so you need a script that runs when the server starts the mission/game mode
And you need for the server to start the mission/game mode without any players connected.
I think you can just have a component in the game mode and call stuff from there
be looking into this on the wiki and it's been helpful and kinda drives me in the way I need to go for optimization https://community.bistudio.com/wiki/Arma_Reforger:Scripting:_Performance?useskin=darkvector
What is the slowest part ? Generate that once and save to .json 😄
If you want an entity you need go make one. If you want to debut visually use debug shapes on diag exes. They have added benefits like no zbuffer to be visible through other objects if you want it
That article is a bit of a troll since most of the code doesnt even compile
I have an explosion my player spawns whenever my drone crashes into a player, is there anyway to set the player as the instigator of that explosion, I can't seem to find anything exposed to us
So it is fully imposible to do? So if I want to affect some player with a damage bevcause of walking should I use another technic?
I would check the mortar script, to see if it sets instigator
Mortars are bullets still
demo charges then?
Hmm maybe I'll look there actually
For what you want to do all you need is any new component on the character base prefab with logic that uses the character controller to get info about locomotion and inventory to check if he wears boots or not. You don't need to modify any existing code
Okay, I'll try. Thanks
Trying to set-up the enfusion persistence framework, could use some assistance
Look at the base trigger component, there is a function override instigator (something like that) for when another player shoots a mine for example, it will set them as the new instigator
Yeah gotta find some voodoo wizard magic aka constructors to try and set the instigator on all clients at once whenever the drone explodes
Rpc_DoTrigger
Yeah that has time tho to set whoever is setting the trigger to the mine
My explosion is instant
Take a look at my proxy mines, I made my own custom trigger, may be something useful in there for u
Object detonates almost immediately after creation so the client has to get that change before it detonates easiest way is like I said just using a constructor
I'd like a review on my mod (just two small scripts), the intent is to only allow Squad Leaders to transmit on platoon net and to limit the number of squads.
https://github.com/Prontious/EffectiveCommunications/blob/5b09f7e2825f96fe0b15eabd45d4e6f16b797984/Scripts/Game/GameMode/Squads/Modded/SCR_VONController.c (SL Transmit)
https://github.com/Prontious/EffectiveCommunications/blob/master/Scripts/Game/GameMode/Squads/Modded/SCR_GroupsManagerComponent.c#L6 (Limit Max Squads)
This is my first mod so will probably need a chunk of feedback. This works well on peer tool.
Thinking about using CircleGridMap, is there a quick way to get bounding sphere radius or I have to calculate/guesstimate it using IEntity.GetBounds?
I'm confused about component events, I see that vanilla component scripts do stuff like
override void OnPostInit(IEntity owner)
{
SetEventMask(owner, EntityEvent.INIT);
```but its already inside "post init" event, didn't it need a mask set beforehand somewhere? (like in component constructor)
Another thing, component set event masks to parent entities, not each individual componet. Say there is an entity with 10 components and 1 component sets FRAME event mask on constructor, does it mean because of 1 component engine will try to call EOnFrame on each 10 components?
Or does calling proto external int SetEventMask(notnull IEntity owner, int mask); sets the mask just for the component it was called from and not entire entity and all its components?
If there is an article explaining it that I missed, please point me to it. "Entity Lifecycle" doesn't.
Okay, so I tested it and indeed it seems that proto external int SetEventMask(notnull IEntity owner, int mask); is contextual to the component its called from, it sets the event mask for the component itself AND entity, but not other components. What a strange system.
OnPostInit seems to be always called on components, I guess by the engine and not a script somewhere?
Question: in the script MapDescriptorProps.c. the function cs proto external void SetImageDef( string name ); lets you choose the icon. What imageset does this function refer to? there are many imagesets in the game. I input an icon name from the conflict imageset but on the map it shows a different imageset. Would be nice to know what this functing is referring to. Anyone know about this?
On first look:
- add ".gitignore" file and put "resourceDatabase.rdb" in this file and delete "resourceDatabase.rdb" from git - this will help u in future.
- rename "SCR_GroupsManagerComponent.c" to "MYTAG_GroupsManagerComponent.c"
- rename "SCR_VONController.c" to "MYTAG_VONController.c"
- replace "private const int MAX_SQUADS_LIMIT = 2;" with [Attribute(defvalue: "2")] parameter
- add check for "groupsMgr" and "factionMgr"
- using multilevels "if" inside "if" with 6 calls same "return super.ActivateVON" is not good, i think
it can use any imageset and "SetImageDef" uses item name from that imageset file i think.
well i used a name from an image set and it returned a different icon on the map. I do not think there is a way to define which image set to use though. Ill take a look at the quad section, as i just hovered over the icon on the imageset and used that name. I assumed the string that displays when hovering over the nemae would be the same string you put in the script.
this is the one i used in the script
If u cant find parameters in code, then try search in configs ? Can it use this ?
{FF6B20825D4A566C}Configs/Map/MapDescriptorDefaults.conf
{4FFDB559B60FC7BC}Configs/Map/MapDescriptorVisibilityDefault.conf
this is what shows up
ahh ok ill look into this
nothing in the config relevant
so it is pulling from this imageset
the weird thing, the icon is it showing is a completley different string than what i set it as in the script
cs item.SetImageDef("Task_Evac");
lol its a ghost script too
found this ```cs
[Attribute("0", UIWidgets.EditBox, desc: "imageset Index, determines to which imageset should be referred for its image", "0 100 1")]
int m_iImageSetIndex;
it is in the script `SCR_MapDescriptorDefaults.c`
ok so SCR_MapEntity i guess deals with the default imagesets. ill chekc into that.
MapDescriptorProps and GetImageDef, SetImageDef ?
I just searched m_aDescriptorDefaults and found it in mapentity.c
in that .conf file i see this, but man...i dont know what the value for each imageset is
bascially, how i have it setup is I am using the Icon entry from the MapDescriptorDefaults.conf
it is using imageset index = 1
you can use 0 - 100. i just wonder what exactly the image set index value refers to. like is each imageset linked to an index value? or does that mean how many imagesets are used? idk.
found another clue
configObject is a config object ..
🤣
OnPostInit happens after components have been initialized, attributes set, etc
Constructor happens before, first step on init
EOnInit happens after WHOLE Entity and ALL components get initialized
It only gets set to the specific instance that it was called from
Quite wasteful to enable for all don't you think?
Also you can enable and disable on select components at runtime at will
Meaning that no need to do if checks on a boolean like (IsEnabledFrame) to work on frame
I thought components didn't have their own event mask and there was only entity event mask that applied to each and every component of the entity
Is there a system for component to have init executed after some other component? If I want to run my component init after another initializes
Sometimes I might depend on some data from it that is not available yet
ScriptComponentClass.DependsOn() events are called in order, so if your component depends on another one it is created after that in the internal component array and all events happen on the other one first. If you also need the other component, and it is not just optional processing after it in case it was there, do also specify Requires
What would be the neatest way to check if entity has moved more than X meters since last position saved?
Methods I can think of:
- A component to query to save the position and the check if parent entity moved, seems excessive for just one thing
- A Managed to vector map? I guess using entity as key is possible?
All you need is 50 lines of boilerplate and you're good to go. Since systems dont have a way to poll every N frames or seconds.
But I would use a system to register those entities and track their position changes over time
map<MyScriptComponent, ref MyClassThatIsAStructForMyData>
of course it can be a vector but I like to assume more data will be collected than just position in the future
Thanks, gonna try going map route
Of course you could also store all this data inside the component itself and just do array<MyScriptComponent> but I like having that data in the system
IEntity p = GetGame().GetPlayerController().GetControlledEntity();
map<IEntity, vector> test = new map<IEntity, vector>();
test.Set(p, p.GetOrigin());
Print(test.Get(p));
```works out
Thanks for the advice, still just doing babby steps
Just be careful with the entities being deleted etc
Speaking of deletion, I have a grid map (CircleGridMap) with few objects in it, if I delete one (with SCR_EntityHelper.DeleteEntityAndChildren) and then query the grid map (FindEntitiesInRange) it crashes the game. I assume I need to make sure to Remove the entity from the grid map manually?
Added grid map Remove on entity deletion and it no longer crashes. Kinda expected the grid map to handle null entities by itself, SQF spoiled me.
Is there a way to iterate through all prefabs available in game?
you can check koth reforged code 😄 there is a KOTH_PostFrameSystem class that does this check
Thanks, simple Entity-Vector map worked out for me
Hellloo 😄 Question: foreach() { continue; } <-- does continue means the same then "return next" so, skip the current item and resuming the next in the loop?
This works but poetically a component on said entity would be better and neater.
Also big fan of your past work
Generally maps should be avoided when possible and you’d just create an array of a custom class(or component) if needed.
Does anybody know how to get the list of materials used by a base .XOB. I can get the materials from a prefab only if that prefab overrides the default materials for the object. I've searched in here and only seen people talk about it but no implementation. I would assume I would just use base container again on it? Or do I need to inspect the meta file?
yea we really need standard getters for this .
Depending on what prefab container can be unreliable
mayber you could open a feedback ticket about wanting to get materials
Yeah I tried basecontainer on the XOB and it didn't work (no surprise there) - because I'm sure the intention is to use VObject then GetMaterials (which gives me material names not resource paths), and without a way to resolve resource paths if I want compatibility with what I am doing I have to manually go to each prefab and overwrite the materials on the mesh object.
Hey guys, do anyone know how to edit richtext in layout via GM? 😅
is it possible to add an action to something with ActionsManagerComponent programatically?
No. You would use isavailable and isvisible to change when the action is available/visible.
Why though, what downside you see here?
I need ideas on tracking physics corrections of a vehicle
ie. when you desync from server and server corrects you
I suppose I can track changes of position that are not in the general direction of the object's velocity
Just make them explode with the sound of an incoming rocket.
This way they think they died fairly and won’t blame desync
Hey guys, do any of you know if it is possible to capture a screenshot automatically from a manualcamera component in my world? If so what are the mechanics of that, like where would it be stored?
Thanks so much
Also
Need milliseconds unix timestamp
Also where is the logic for moving entities around as game master
Like dragging them around
Not specially a downside but a way you can do it better. You should lean into OOP when possible. Not sure what your doing but if i wanted to check a players position against something. I would first move it client side to preserve server performance(unless you can't/have other concerns). Then a component would check player position and keep a variable for the last position, do any logic actions, ect
I feel so close but so far. XOB files are prefixed with FORM, which means using base container tools gives error:
09:57:40.459 SCRIPT (E): Unknown class 'FORM' at offset 5(0x5)
So it can read the file, and if I could just read the file as text, I can substring hack my way to reading the materials (they are right there!!!), but it just crashes the game here. So then my next idea is FileIO or figuring out how to get LoadContext.ReadFile to accomplish the task.
dont you just love being rewarded with a crash for compiling your scripts
OOP is OP. 
I am reading XOBs as strings using FileIO
But will that work on clients
Whenever i use my monitor on my pc screen i get massive stutter and fat crashes, sometimes i have to restart it through the power button.
It’s decently smooth when i use my laptop screen
Does anyone know of a way to prevent players from taking off armbands from loadouts such as the WCS armbands?
like its locked to their loadouts
It will not work in game, you can only interact with filesystem like that in workbench (please test it though in case I'm wrong)
You are probably right but I’ll test just to see. Really battling file.Read stopping randomly so I have to figure out how to extract the material names. If it’s not one thing it’s another.
I've made those changes. Again, just to restate the goal: Only allow Squad Leaders to transmit on platoon frequencies and limit the number of squads that can be created.
Does this look like the correct approach? I'd love some folk to help test. I'm willing to help test other mods in return. @minor agate on the off chance you fancy doing a code review.
https://github.com/Prontious/EffectiveCommunications if you prefer GH.
Is there anyone available that can dm me, im currently trying to write script for a harvesting system but keep getting errors and idk why... any help would be appreciated
figured it out. That function seems to only reference this imageset {F7E8D4834A3AFF2F}UI/Imagesets/Conflict/conflict-icons-bw.imageset
can we override that imageset ?)
i am assuming yes, however i dont know how to edit it or add to it.
yes you can override
Hi guys, can you help,
can i in Server Admin Tools in
"repeatedChatMessages": [
{
"message": "Example",
"intervalMinutes": 1
},
Make more messages then one?
I’d assume so as that’s an array. Just copy the curls brackets and make sure there is comma separator
Anyone got a good tutorial video on how to make armor function?
Because I cannot for the life of me find anything
Is there a way to have instances of things per player? I'm wanting to have an instanced interior without having to have like 60 under the map to tp people to individually
You can spawn it locally sure
is it possible to create a readme file in my mod project ?
who ever check marked, how can i ? i dont see it
does it include all txt files? what about md files
open in vscode or file explorer
i think you wont be able to open it in the tools tho
You can view txt files in the ArmA Reforger workbench
I haven't found a way to write them nor create them though.
(directly through workbench)
Anyone know how to get in touch with this mods creator? Exactly what I have been wanting with the exception of the status icons in top left corner. Would like to make those go away if its possible.
You can create a txt file in your windows explorer
In your mod source directory
Look who created the mod, search for their name in discord here. Otherwise gotta find their bi account
Is there anyone available that can dm me, im currently trying to write script for a harvesting system but keep getting errors and idk why... any help would be appreciated
Hey, unfortunately I doubt many people will take their time to DM you and offer you full support(at least I won't), what I would recommend you do is that if you have specific issues then post some snippet of the code that would allow us to debug it here as well as the errors you're getting.
I'm having an issue with one of my trigger entities for some reason the bIsEmpty is alwys true even when i get rid of the AddClassType or when i'm inside of the sphere.
override void EOnInit(IEntity owner)
{
m_PlayersInside = {};
m_UplinkComponent = ToW_VehicleUplinkComponent.Cast(
owner.FindComponent(ToW_VehicleUplinkComponent)
);
if (!m_UplinkComponent)
{
IEntity parent = owner.GetParent();
if (parent)
{
m_UplinkComponent = ToW_VehicleUplinkComponent.Cast(
parent.FindComponent(ToW_VehicleUplinkComponent)
);
}
}
AddClassType(ChimeraCharacter);
SetUpdateRate(2);
EnablePeriodicQueries(true);
super.EOnInit(owner);
}
override event protected void OnQueryFinished(bool bIsEmpty)
{
vector servPos = GetGame().GetPlayerController().GetControlledEntity().GetOrigin();
float distance = vector.Distance(servPos, GetOrigin());
Log("Distance: " + distance.ToString());
if(bIsEmpty) // bIsEmpty is always '1' even when I am inside of the sphere,and even when there is no class filter
{
return;
}
super.OnQueryFinished(bIsEmpty);
array<IEntity> entities = {};
GetEntitiesInside(entities);
Log("Entities in circle : " + entities.Count());
}
Any help would be appreciated !
screenshot of trigger options in world editor
Use ScriptedEntityFilterForQuery function to print in logs all entities in yours trigger
those are the options of the trigger entity
I'll give that a try.
#1 - set ChimeraCharacter in classes filter
if doesnt help
#2 - set Every query and checkbox
I enable those in the EOnInit but i'll give that a try.
It works fine for my other trigger entities somehow.
try to use GetGame().GetCallqueue().CallLater(OnEnableTiggerLater, 1, false); in init to check (move enable code to OnEnableTiggerLater func
Or u can try put super.EOnInit(owner); in top of init function
The periodic queries are enabled, that's not the issue, every 2 sec I get a hit on the OnQueryFinished, the problem is that the boolean "is empty" is always set to true.
My breakpoints and debug print for the distance are properly called.
They are not queried tho (disabled the return statement on Bisempty
@half patio if you do this, note that the txt file will not be packaged and shipped with the mod, so it's not there for people who download it
Hmmm I might just make a .c script file and just do // and write the readme file there
Cause I’m making a chat moderation bot and the readme will explain a lot to people who might download it
Best me too it ahah
So the Workbench basically has a big gitignore equivalent right?
It's the opposite, it only packages certain things
I fail to understand why it doesn't detect my character while the radius of the sphere is 1.5KM and i'm right on top of the center...
did u set classes filter?
Yeah I've tried with AddClassType(ChimeraCharacter); and AddClassType(SCR_ChimeraCharacter);
try to remove all enable/disable/set trigger code and make it from prefab options and check it
does it work with prefab settings?
You mean with the prefab filter ?
boring tbh, should put it into layout files with cool formatting
yes. set paramters in prefab - not in code
ok
No success so far :(
It’s the first trigger entity that i have that’s acting up. It’s so strange
do you have another mods, can they change trigger class?
Scripts aside that’s a dope image ngl 😂
I do have other mods but they don’t affect the logic of the trigger entities. The others trigger entirely work flawlessly.
I think i’ll just redo the prefab from 0 this way hopefully i won’t do the same mistake
Lol
It’s true tho 😂 saw an image awhile back that this guy created a full on bar area inside of a house no one will visit on the edge of the world, the amount of detail he did was insane
Wish I saved the image 🤷🏼♀️
FileIO does not work on clients :)
It's APL-SA, you can edit and modify under the same license
just edit the .layout file if you don't know how to code
You can drag the file to script editor
https://feedback.bistudio.com/T193097
Ticket is in for the feature as I have given up on trying to get original path, just going to have to throw every material into a config.
Your thing is weird, remap should take the same name as GetMaterials returns you
Yes, remap was just an example, really I need the base material names so that I know what materials to edit
For example I opened BeeHive_Red and you can see that SourceMaterial is BeeHive_01_Main which is the name of the source material that you want to remap
and GetMaterrials should give you BeeHive_01_Main
I don't necessarily need this for remap, trying to do material editing by modifying the material directly - as SetObject breaks animations.
I need the resource name for that, the name doesn't help me much.
I'll edit the ticket to be a bit less confusing in terms of purpose
Then material editing is also the same, you use material name not material path
static proto ref Material GetMaterial(ResourceName matName);
So this will resolve a material given only it's name without full path or GUID info?
No this is just to get the material from path of the material
If you want to have default material path assigned on a mesh, I don't think there is any API for this
I guess you could maybe assign the xob directly on an empty entity, and maybe there is an API then to get the materials from it
This is moreso what I meant. The ticket is worded kind of badly but I have looked through base container, etc. and I also couldn't find any API to get the default material path. I tried a hack reading the xob file which includes that data, but obviously it is not effective in production environment.
Yeah just saying that you want default assigned material to a material name seems easier, but I gess the last method API kinda says that
But reading the MeshObject will not give you anything, only new assigned material not all of them anyway
But why exactly you need original path? Because anyway if you dont put it in remap it will just use original, you want to do what exactly with it ?
@minor agate Did you ever make that character on moving patform feature you mentioned a while ago?
I guess I need to put in another ticket but if a material's Emissive color is set to black (default), the ParametricMaterialInstanceComponent does not successfully change the emissive color via the emisive user parameter. Was also informed by Mario that using that component creates issues anyways and for my use case I want to take a given IEntity, get it's materials, edit them during runtime. End state is being able to create different effects for weapons, vehicles, etc. Remap can't be used because SetObject breaks animation or cause game crash depending on object size, complexity, components. I am aware that editing a material edits all instances where it is used, that is my intention for this use case.
way to get bone/socket programmatically?
Hey lads. I am looking for someone who is knowledgeable in scripting to create something for me. It isn't a commission, just voluntary work. I have an idea that I'm sure could be possible, I just do not have the time to learn scripting to do it
Hey @river imp sorry for reaching out here but need some help with your Zeliks Persistent Storage mod. just wondering if this mod is good to go out of the box just by adding the prefab to the world in workbench? or do I also have to set up EPF in some way? thanks!
Wrong place, create a post with the details here: #creators_recruiting
Gotcha. Thank you 🫡
how can I detect if the AI are in combat or not?
Did you check out the AI modding boodcamp video? The part about messages might be helpful for this.
I did not, I thought checking for a move activity would be enough, but I guess they are still in the move activity when they stop to engage enemies. I'll have to give that a watch I suppose.
What about checking known targets?
Let me check the method. I recently was trying to cluster enemies based on all known targets to decide QRF priorities.
foreach (AIGroup group : component.GetManagedGroups())
{
SCR_AIGroupUtilityComponent utility = SCR_AIGroupUtilityComponent.Cast(group.FindComponent(SCR_AIGroupUtilityComponent));
if (!utility || !utility.m_Perception)
continue;
foreach (SCR_AITargetInfo targetInfo : utility.m_Perception.m_aTargets)
{
SCR_AITargetInfo latestTargetInfo;
if (!compiledTargets.Find(targetInfo.m_Entity, latestTargetInfo) || latestTargetInfo.m_fTimestamp > targetInfo.m_fTimestamp)
compiledTargets[targetInfo.m_Entity] = targetInfo;
}
}
They are on the perception component
Ok cool, Im currently trying GetCombatModeActual/external under the group utility component.
Combat mode is not the right thing, that's basically behavior on contact. You're looking for control mode:
SCR_AIGroupInfoComponent groupInfoComp = SCR_AIGroupInfoComponent.Cast(group.FindComponent(SCR_AIGroupInfoComponent));
bool groupInCombat = groupInfoComp.GetGroupControlMode() == EGroupControlMode.AUTONOMOUS;
Does the setter for it work? Could be interesting as a GM attribute if it does 😎
Oh nvm, it actually already is an attribute in vanilla 😅
That does look right compared to what I was seeing in testing! Thanks!
hmm, so its not perfect, apparently they can still be in EGroupControlMode.FOLLOWING_WAYPOINT and in combat at the same time. Maybe the target check would be better for this. I'm trying to write a check to respawn stuck ai, I just need to determine if they have stopped for a firefight or they are actually stuck.
👆 Arma 3 AI convoy disaster flashbacks activated 
This is very strange, now they seem to just go idle after they no longer have a target. This is turning out to require a lot more scripting than I thought it would take!
is there really no, Im done with the fight, now Ill go back to what i was doing? This could be yet another reason my AI are getting stuck!
is there a way to check paint on terrain beneath character
and what is the method if so
is there a way to run scripts in play mode without the ENF_WB and related workbench defines? trying to simulate a real server while still being able to debug
Thanks again guys! I ended up getting it going with: ```c
SCR_AIGroupUtilityComponent utilComp = group.GetGroupUtilityComponent();
if (!utilComp || !utilComp.m_Perception)
return;
bool groupInCombat = false;
if (utilComp.m_Perception.m_aTargets.Count() > 0)
{
groupInCombat = true;
}
And also @sweet badger thisc
SCR_AIGroupInfoComponent groupInfoComp = SCR_AIGroupInfoComponent.Cast(group.FindComponent(SCR_AIGroupInfoComponent));
bool groupIsIdle = groupInfoComp.GetGroupControlMode() == EGroupControlMode.IDLE;
Take a look at trenches, they get the texture below
I’m looking for some help getting started with some proof-of-concept scripts in Arma Reforger. I want to set up my Workbench so I can test things in a proper multiplayer environment, but I’m not sure where to begin.
I tried this before but got frustrated because I kept spawning as a camera entity instead of an actual player, so I couldn’t really test what I needed.
My goal is to experiment with mods like a vehicle ownership and lock or unlock system that ties to player IDs.
If anyone has tips on setting up Workbench or testing ideas like this, I’d really appreciate any advice.
Thanks a lot for any pointers.
Is there a way to debug EOnInit methods for entities without Enfusion Studio dead locking itself?
At the moment I have my custom entity in the world with EOnInit method and I have break point in that method. Now when I run Validate and Reload Scripts in Script editor whole Enfusion Studio will deadlock since I will have the loading bar open and break point triggered in Script Editor. I'm not able to click anything to continue from the break point. Only thing that I can do is kill Enfusion Studio and next try remember take those break points off...
Or is there is something I do fundamentally wrong here?
There's a default test world for multiplayer that's pretty useful to start with.
Ok would love to get started with that.
There is logic to check if it’s in game. Somthing like isingame or somthing
Place if (!GetGame().InPlayMode()) return; before breakpoint, or just don't set INIT flag with same condition
Thanks I'll try that.
I don't know how many times I have faced this issue and just never started again Enfusion Studio because I got frustrated 😂
Use one of the smaller test worlds. Either MPTest.ent or SF-Tutorial-Navmesh.ent (the latter if you need AI). Both worlds spawn you immediately as a character. For actual MP testing later, you gonna have to use the peer tool or the dedicated server tool, so that you can set up clients.
I don't think I understand
You want a list of all materials in an XOB?
Would like material resource names yes
Which you can get from a prefab, but it’s not reliable in the case for objects without any material overrides - where the prefab data for materials appears to be empty.
prefab or xob?
I would like to get it from the XOB ideally. Getting it from prefab was my fallback because sometimes it has the current materials.
Not possible currently. Any addition to have this in the future will take months probably as well due to release process
My mood
So we can't promise it anytime soon
We can add it no issues, just the release of it might take time.
I can read from xob with fileIO because the materials are front loaded in the file but obviously there is no current API for it that works in production. I also tried to force the material data into the prefab by manually adding the material overrides, but if it’s the same material as the XOB workbench saves over the prefab to remove the references haha.
How did you try to load it with FileIO?
With resource name or filesystem (Not the same)?
Use exact path
As mentioned here
You can see there what an exact path is
resource name is not filesystem related fully
The underlying system makes use of it
But it is not the same
I’ll double check what I tried. I think I found that info when I implemented my attempt
ResourceName and such is for ResourceDatabase related things
FileIO is mostly for Filesystem operations
Which can be problematic to use ResourceName as that can resolve to something that you do not want
And the API does not have it clear that it might be trying to read for Disk Filesystem or from virtual filesystem with ResourceName
FileHandle file = FileIO.OpenFile("Assets\Items\somemodel.xob", FileMode.READ);
Also full transparency I only tried this on clients after testing in workbench/peertool (Xbox/PC on dedicated server), if FileIO is only supported on dedicated server itself this might still work.
That is local path
Hm, so I should prefix with $ArmaReforger:, or I need to find the mod that it comes from? I feel a bit silly rereading now
It has to be the mod it comes from
Because if you have say
a file with same absolute path in ArmaReforger, and in ModA
then if you do $ArmaReforger: it will then load ArmaReforger one
instead of ModA's with $ModA:
This is also why we say as well the ResourceName is not a path
It's more complicated that than
It's also why File APIs do not use ResourceName
👍, makes complete sense. I guess now I have to figure out what mod a given IEntity comes from.
ResourceDatabase.SearchResources
Then on callback you get

HM that helps a lot thanks. And using this approach should work on clients, ideally?
ResourceDatabase is used to make override, duplicate, inherit, etc happen to some extent
It's part of what resolves how it gets done
So it will give you that information, as it is part of the database of registered resources
Well it's working so far, still giving the FileIO dangerous warning in workbench, but exact paths are being used so we will see how it works when published.
I assume you know what you are doing now, so the warning can be ignored 
enjoy
ResourceName t_rName = f_IEnt.GetPrefabData().GetPrefabName();
string t_sResNamePath = t_rName.GetPath();
// open old file and steal line 1
FileHandle t_File_Old = FileIO.OpenFile(t_sResNamePath, FileMode.READ);
???
No resource names with FileIO

ResourceName.GetPath();

ResourceName t_rName = f_IEnt.GetPrefabData().GetPrefabName();
string t_sResNamePath = t_rName.GetPath();
// open old file and steal line 1
FileHandle t_File_Old = FileIO.OpenFile(t_sResNamePath, FileMode.READ);
if (!t_File_Old) {
Print("no old file opened");
// t_File_Old.Close();
return null;
};
array<string> t_aSrc = {};
array<string> t_aMat = {};
bool t_bIsInMesh = false;
bool t_bIsInMat = false;
string t_sLineCurrent;
while (t_File_Old.ReadLine(t_sLineCurrent) > 0) {
if (t_sLineCurrent.Contains("MeshObject")) {
t_bIsInMesh = true;
continue;
};
if (!t_bIsInMesh) {
continue;
};
if (t_sLineCurrent.Contains(" }")) {
t_bIsInMesh = false;
continue;
};
if (t_sLineCurrent.Contains("MaterialAssignClass")) {
t_bIsInMat = true;
continue;
};
if (!t_bIsInMat) {
continue;
};
if (t_sLineCurrent.Contains(" }")) {
t_bIsInMat = false;
continue;
};
if (t_sLineCurrent.Contains("SourceMaterial")) {
t_sLineCurrent = t_sLineCurrent.Substring(23, (t_sLineCurrent.Length() - 24));
t_aSrc.Insert(t_sLineCurrent);
Print("S:" + t_sLineCurrent);
};
if (t_sLineCurrent.Contains("AssignedMaterial")) {
t_sLineCurrent = t_sLineCurrent.Substring(25, (t_sLineCurrent.Length() - 26));
t_aSrc.Insert(t_sLineCurrent);
Print("M:" + t_sLineCurrent);
};
};
t_File_Old.Close();
ResourceName works on string as it is a meta class (Yes, we have such things)
You can pass a string as ResourceName as well for the same reason
But on how they are intended to be used, and what they could hold. They are different
the correct usage is to use the GetMaterials for the xob and the entity once that's added in arma reforger 2
I don't even believe this openFile stuff works on normal clients, I never tried it
Is there a way to reference a class object from another mod, but only have it use it if that mod is loaded
Trying to use the RHS Thermal system for my mod but don't want to have it as a depen, is there a more elegant way then a Compat mod
It works! @minor agate thank you I will try to use refs responsibly now
@ocean kernel pinging you for visibility, FileIO does work but exact paths must be used as discussed earlier in conversation.
it works ingame?
ill try to get a log just to make sure
im doing many things to get materials lol
its not crashing me like it did before, so I'm assuming it is working
Changing from "Assets/mymodel.xob" to "$somemod:Assets/mymodel.xob"
Nvm celebrated early, turns out it failed anyways
Time to use refs irresponsibly
Maybe it works on a server
If it works on server, if I really want to use this idea I will have to do XOB material discovery on server and somehow propogate that to clients... seems like a lot of work until that API is implemented in a couple months (if it's added)
If it doesn't, generate a json file in the workbench and have that in the mod
Yeah I could figure out a way to do this but the system I am using needs to know what materials are actually loaded (some may not be but a massive array of materials will not be good for VRAM or performance)
I'm not going to bother having server do it because there is no efficient way to surgically give that info to clients.
@ocean kernel Sorry for ping but I was hoping you could help me understand something with the ServerAdminTools.
Right now our ban list contains a little over 1100 players. We are now unable to unban players through the tool, we unban them and whenever it refreshes the list, it places them back in. I tried to remove the banned players from the config file while the server was down, but when i put the server back up it just loaded up the old list.
Do you know some way we'd be able to get around this issue without us having to remove ServerAdminTools and put it back in?
I've tested it with more than that and it was fine
So looking like removing and adding it back in might be the solution for us? We do have a secondary ban system but your Tools generally help with that and information about the server so for now we'd rather keep it in.
???? I'm saying I tested the mod with more than 1100 bans and it worked fine
So unless there's some change in vanilla that makes this not work anymore the problem might be somewhere else
Also, you said that the mod loaded the old list when starting - it does not magically load old list, it loads what's in your config file
It's not smart enough to keep backups
Idk i shut down the server completely, switched out the old list with a new one. Started the server back up, the new list was shown for a few minutes, then it started to show the old list. Looks like removing the mod is the only solution then
The mod loads the ban list from your config, what you saw was loaded from your config.
Does the config do exact name matching? Just incase something messed up I savee it as serveradmintools_config_backup.json
So that and the normal file are sitting in there
There is only one config file. There is no loading alternate config files or keeping backups in the mod. No such functionality.
Which that config overwrote itself. I just might not understand how arma caching works in general if it loads the old list instead of the new one.
I've ran into somewhat the same issue when trying to migrate database entries for players with EPF. After the server starts back up, it loads the old entry.
Configuration will be overwritten when there is an error loading it, and you will get an error logged to the config. There is no magical rewrite cache old list loading out of thin air in the mod.
I understand that, but it's what's happening
You are welcome to open the mod in WB and check the scripts, I'm not going to argue with you about how my own mod works.
Not tryna argue, just trying to get some insight on the issue, which I do appreciate. From what you say it's something that is happening on our end essentially
If you have discovered a bug then provide repro steps without any other mods loaded and I'll look into it.
That might just be part of the issue, we do have 20 some dependencies iirc.
I am personally not aware of any mods that make server admin tools randomly rewrite configuration files with data it doesnt know about, but maybe there is something like that
Like I said too, we do have the same issue with EPF when trying to migrate entries even when the server is completely down. Could be the DS we use at this point if another mod is having the same type of issue
Some server providers have ultra garbage systems that dont allow direct access to files safely, maybe it's one of those
This atleast points me away from the wrong direction. We don't use nitrado or any provider like that, ran on a Linux box so I have complete control
Do destructors fire when an entity goes outside of a clients Rpl bubble
If i want to call a method periodically is there a better and more clean way to do it than using the call queue or not really??
if its fast use system if not call queue is only solution AFAIK
yes, for replicated runtime entity
I've been getting around CallQueue by utilizing anything that runs on frame/tick to update TickCount
Class variable:
int timeTillNextUpdate = 2000(ms);
int startTime ;
In the init,
startTime = System.GetTickCount();
In the update function, before any logic happens
if((System.GetTickCount() - startTime) < timeTillNextUpdate)
return;
startTime = System.GetTickCount();
Everything below will have to wait 2s to actually run
Unsure if it's a better way over CallQueue but what i've understood from some of the things mario says about it, is to not over use CallQueue and this is how I get around it for periodic updates.
How can System be used like CallQueue? Unless what I said is how it can be used
https://community.bistudio.com/wiki/Arma_Reforger:Systems (just linking for others)
some logic like you said ye
Too bad we dont have millisecond precision for unix timestamp
Then making systems that run every N millis would be ez
I mean it's still ez, I just want less boilerplate
boilerplate is so 1995
Add cron jobs to admin tools V2
Thank you
thanks
Anyone worked with the explosive system. I currently have a script that uses an explosive trigger component however after switching to this it seems that the explosives damage is GREATLY reduced. Any input in why this may be happening.
Like before I could hit in the middle of a wedge and kill a whole fire team but now I have to direct hit to maybe kill
Interesting question, can you script inputs, such as that for vehicles via script - better do it from server perspective?
Talking about stuff like driving a vehicle manually (turn wheel left, increase gas, etc.)
Is this change happening across different test environments? Like PT and Dedi etc?
Nah it's the same
Its so weird, cause I just added the trigger component that now spawns the explosive instead of manually doing it and now it's fucked
Can someone help me better understand the collab on the Arma tools ? I’m wanting to do a project with my mate but I’m having a hard time how the collab feature works ?
Will we be able to edit things in real time together or only one at a time or is it solely on my side if I’m the project owner ?
If that’s the case what’s my best options for collating with someone on a project ?
Ima steal this 😂
Hello Im working with EnfusionPersistenceFramework and have been trying to attach a persistant component to my character controller / chimera character. I have been able to have it work fine with world components just not players. Anyone have any cases of this. cheers
Asking here as I don't know if this is a data or config question. Does enfusion/reforger have support for post process effects like in a3?
Trying to make a personal lighting aware material that acts as a mask on the player ui
Hi,
I've got this function that runs on gamemode start:
modded class PS_GameModeCoop
{
override void OnGameStart()
{
super.OnGameStart();
Print("✅ PS_GameModeCoop started successfully.");
}
}
I'd like to find every instance of a particular prefab that is currently on the map, similar to something like nearEntities in A3 - Can anyone point me in the right direction?
World systems
The link that Sen sent
Not possible with 32bit ints, you have too little resolution:
Current unix ms: 1751702456504
Max int32: 2147483647
If you want to track milliseconds, use WorldTimestamp wrapper, that can do it
@ocean kernel you know of anyway to protect certain scripts from being practically ripped by others? im wanting to protect certain scripts from people from simply opening up the arma tool and copy and pasting said script?
Report them if they publish their mod.
No way to hide scripts or the like.
Script module¿
If your script is serverside and does not run on player games then use a scriptmodule. Otherwise anyone can open it up and copypaste. If they do, report them for license infringement if your license prohibits it.
everytime you add an item to the shop you need to configure its options and payment method. so if you want to buy Rifle_ak74.et with only cash you can just delete the other two entries for bankcard and bankcard+cash.
@west prism \
process will be. 1. add item 2. add payment method. 3. fill out relevant amounts. and tick relevant boxes
you only need one merchandise entry and configure everything in that single entry. if you don't you're just gonna end up with duplicates
only one payment
never used that mod but there's no items in your shopping cart and i assume the total is calculated from that my guy
you're better off asking in #enfusion_configuration or somewhere else, this is not scripting
or viewing docs on the mod (if provided)/viewing source and seeing how it works, or asking the mod creator
Hey guys, I what to manage the bases in conflict mode so only a specific group of bases will be seizable/show task. And I update the target group once all bases in this group are cpatured by players. What class/functions should I check?
IIRC the tasks are generated based on what enemy radio sources are in your radio network proximity and capturing requires the seizing component, so you could probably prevent bases getting tasks and being capturable by disabling their radio transmitters + seizing components then toggling those back on when you want them to come into play
thank you. I find something like what you mentioned in Gramps/bacon linear capture mod and Ironbeard's Conflict RAAS System.
I'm on day 3 of trying to figure this out
Im trying to set a custom faction's loadout, but when i go to test in game, when i select the faction in the respawn menu on the World editor (just testing in base game GM arland scenario), this pops up
this is what comes up when i hit debug.
As far as i can tell, this is a base game script, that i did not edit or even open until this error appeared
this does not happen with other modded custom factions i have added to the Mod as a dependency so i can compare to, so i have zero idea what im doing wrong or what needs to be done to fix this issue
i get error
Scripts/Game/Entities/SCR_AIGroup.c(1): error: Unknown type 'SCR_AIGroup'
Do I have to do something to a mod to build / publish /prepare it for XBOX, PC, PS5?
Are you on PC? You will require ARMA Reforger Tools available on steam, and then using the wiki as your Bible to get setup.
https://community.bistudio.com/wiki/Arma_Reforger:Mod_Project_Setup
https://community.bistudio.com/wiki/Arma_Reforger:Mod_Publishing_Process
@lean yew
Where can I find information about how to use the Enforce Script language in Arma Reforger?
How do I made and add script that compare two Supply Depots and return the bool?
This may be a complex question, but does anyone know if possible to do the below, and if so, how difficult it would be?
Is it possible to add a switch to the base radio model shown below that would effectively cycle between all RadioBroadcast.acp files listed in the Component?
You could use one ACP and use a sound bank with randomized sounds within it if that is what you are looking for.
No, trying to achieve something more complex and suspect this is actually the most likely solution.
I want to be able to have channels/stations/playlists on the radio that players can cycle through
We've also been discussing this in the audio thread and it seems like overriding the base entity doesn't force a refresh of the music playlist times either. To refresh them, you'd have to manually refresh when placing the broadcast manager in the game world
Is it possible to learn programming by modding this game?
I have some minimal experience with programming in python and I know my way around AR Tools modding some other stuff.
Where would I need to start if I wanted to learn it?
In the bohemia wiki there are plenty of pages but I dont think there is a fully features intro. But once you cross the barrier of entry and make your first component it will get easier over time.
So basically I need to grind my way through these pages?
https://community.bistudio.com/wiki/Category:Arma_Reforger/Modding/Scripting/Guidelines
By the way this is 'C' programming language right?
It's called Enforce Script
They made their own lil language
It looks loosely like c#
To me anyway, having experienced c# doing unity stuff
Okay thanks. Can I use this resource on Enforce Script which is for DayZ but they use Enforce script too?
https://community.bistudio.com/wiki/DayZ:Enforce_Script_Syntax
Also what would be managable entry level mod to try making as a noob? 😄
There are some differences between dayz and reforger. I would say step 1 is figure out how to create a scriptcomponent and attach it to and entity and have it do something. Anything. That should tell you more or less how the game engine works with scripts. Then I would suggest trying to mod an existing class or component and make it do something differently, which would teach you how you can influence things that are already there.
Maybe could flip those two things around in order since modding existing class is actually easier.
You also need a solid understanding of this https://community.bistudio.com/wiki/Arma_Reforger:Prefabs_Basics
You can do a weapon modding tutorial just as an exercise to go over how the prefabs work
More practical
This one would show you how prefab inheritance works https://community.bistudio.com/wiki/Arma_Reforger:Weapon_Modding
It's important to know your way around the editor, no need to bother doing retexturing or models to figure this out
Will check it out. I actually already played quite a lot with prefabs when I was creating Drone Jamming Antenna for Salamis Realistic Combat Drones mod, but I was winging it the whole time. I don't know how i didn't come across these resources before, will definetly need to go more in depth . Thank you so much for all the information and help. Absolute legend!
You hardly have any thoughts on this @ocean kernel as someone who's very familiar with Enfusion?
You can do exactly what Agent mentioned below that message, instead of playing randomized sounds tho, you can make a "play next song" or something. You could even have a user action for each track you want to play attached
The broadcast.acp files can only have one signal (from what I've seen) which means I need a separate broadcast file per station that would be matched to its own broadcast manager to ensure broadcasts are syncing correctly across clients.
Modding is a great way to learn programming. As bacon said use wiki and find examples of what you’re trying to do. Depending on you experience level c# learning YouTube videos are good. Don’t use Ai to write your code but it’s good to ask theory questions to understand better.
Based on what I've seen of AI, if you're capable of asking it questions properly, it can absolutely write some code to get you a starting point to test with if you're coming in blind.
I've used it on several occassions for VBA as I haven't any knowledge of how to use it
Yes but also using ai to write code isn’t a substitute for learning and knowing why/what.
I'm going to attempt using it as a first pass for what I'm doing and see how far I get for now.
What I'd be curious to see is whether someone who really understands Enfusion and C is able to look at the code and see if they understand what it's trying to do.
can we get a shorthand form of .Cast because im going nuts
Type declaration is fine with me I just hate the ClassName.Cast everywhere
You don't like doing SomeReallyLongClassName.Cast(entity.FindComponent(SomeReallyLongClassName)) 
wait, can't you already do that like (SomeClassName)myinstance
or am I dumb
I only know SQL and python so I can't relate to any of this since I'm not coming from a development background
if i'm setting a bool on everyones player controller via gamemode component when the auditsuccess is called, do I also need to rpc setting that bool so the player themselves actually know about it?
Pretty sure that's server only so yes
Where is the enum for common item types? had it yesterday but can't find it now lol
too long
it needs to be smart enough to auto cast to the defined type
Nearly all method should be like this as simple as possible. Things should be easier.
In fact include it in the find component as well
There's a limit on the number of diags?
I learned almost all my knowledge from codecademy heavily recommend their C++ and C# courses for people trying to get into coding
i've noticed that in my game mode the killfeed is only shown to kill in which the player is involved or are in proximity off, does anyone know what might be causing that and how to fix it ?
Found it, go in the game mode component -> SCR_NotificationSenderComponent
Is it possible to somehow check if Hierarchy component exists in the entity at runtime? There is no "Hierarchy" typename .
Can i override defvalues of attributes in a subtype?
Tried other way around. Both entities have Hierarchy component, both components Enabled, but why do i get null when i try to GetParent() of that barrel?
That one annoyed me enough to make a little template class that does this for me 🙂
I tend to do auto var = STRONG_TYPE_HERE.Cast() to at least cut it down in half.
Si template very handy.
I hope one day we can get method templates, that would make a lot of things easier and allow for the convenience you ask, but for this all planets need to align correctly
Dont do these calls on init .ethods
It's not on init, it's on UserAction. But anyway, GetRootParent() did work
GetParent should not return null then
Rootaparent can be itself iirc
So you do not have parent still i guess.
Is this spawned by gm?
Editor
Gm?
World Editor
Ok
That is odd
Hierarchy comp and checking if it exists is useless
As all it does is call Addchild on the ent on init
So i have these barrels, they both initially had Hierarchy component enabled. They are part of a composition. I put GetRootParent() into CanBeShownScript, so if hierarchy enabled it doesn't show the action.
And this seems to work. But if i use GetParent() it doesn't.
Oh, hold on a sec
My bad, GetParent() works... Gosh
Didn't reload scripts
You were modifying on entity level and not prefab

Similarly common mistake
Still
😅
brainmelt
That would be sick to have... I have a few use cases that it'd help compact some things down with..
Sometimes asking a question here automatically fixes stuff at exact moment you gen an answer. Bang your head against the wall for couple hours/days, then FINE, I'LL ASK, and as soon as you ask it instantly magically fixes itself. But it only applies to the answered questions. Unanswered ones never fix themselves.
Just to confirm. You are asking for sonething like GetComponent<MyComponent>()?
In software engineering, rubber duck debugging (or rubberducking) is a method of debugging code by articulating a problem in spoken or written natural language. The name is a reference to a story in the book The Pragmatic Programmer in which a programmer would carry around a rubber duck and debug their code by forcing themselves to explain it, l...
Yeah, explaining to yourself by explaining to someone. Noticed that myself but didn't know there's a term for that.
And for the cases where it does actuslly fix itself
https://en.m.wikipedia.org/wiki/Heisenbug
In computer programming jargon, a heisenbug is a software bug that seems to disappear or alter its behavior when one attempts to study it. The term is a pun on the name of Werner Heisenberg, the physicist who first asserted the observer effect of quantum mechanics, which states that the act of observing a system inevitably alters its state. In e...
Yeah something like that would 🥺
Idk if i am okay with that. Maybe make methods like that resolve to the returned type. Like how .Cast does
class Refinator9000
{
template<Class T> DoStuff(T variable);
}
``` please 🙂 We can make one template class per method otherwise which is just omega ass backwards 🙂
Don't tease with stuff like that 
korean mmo devs do enough with breaking my heart, can't handle any more.
So you are asking him to never ask then? 
I see
Yes. Search for child / sibling
Does anyone know how I can get the array for the filenames listed on SoundComponents in prefabs for the radios?
Thanks, already sorted
i.e. where is this data stored?
Hi for all ^_^
How can I change this default value for this attrubute?
m_iXpRewardTreshold
I tried like this, but can't select modded SCR_CampaignBuildingManagerComponent
Click the dropdown by entity instance and it will let you see the default prefab(s) that you might need to edit
Goal:
Changes values from components with mods
Mod A enable - use their value
Disable - value from default setting
Well why can you not make your own? I played around with this a long time ago and added music to cars where the driver and passenger could change songs. Just use a sound bank and then with that I'm sure if you look at the scripts, there will be a way to get the index of sounds in that bank to do what you want
In your case, were you just using a single radio broadcast manager, with a single broadcast.acp and then configuring the radio to let you press a button to change songs I take it?
What I'm trying to do is let an additional button on the radio cycle through separate broadcast files entirely.
Unfortunately, my ability to script isn't great as I don't know any C, and I'm getting very confused looking at stuff trying to figure out why things aren't working as I'd expect.
I'm at the point now where I have the action correctly triggering what I want on the radio, but it isn't actually playing any sound from the next broadcast file in the sequence when cycled
seeing in workbench that spawning an entity with SpawnEntityPrefabLocal is spawning 2 prefabs, with one being at a weird angle.. any idea what might cause this? it's only being called once through a local action on PerformAction
Attribute/Decorators lack moddability in general
(Its being worked on, but as of now they are not moddable)
Its why you see a static method returning the default variable for something in some attributes
So that modders can do what you wanted. But this class does not havw that
What you can do isntead which is not complete by any means but will work to some extent is to override the OnPostainit method, detect if the variable is on default value then use yours by setting the variable there. Or just force yours no matter what.
Inheriting my own sealed classes wouldve been dope
modded keyword can also be used to seal a class
You could seal it right after doing your inheritance i guess
anybody know how i do this BLue box lines deleted?
i use Shop System
after i buy a car its persistence on the map to see
There is a debug toggle inside the code, but that line should only show in workbench
Also again sealed keyword has nothing to do with mods
So do not expect that behavior to be added.
sealed is to block inheritance. So being able to inherit does not make much sense
Is there going to be a better alternative to protect classes from unwanted modification?
As sort of drm no
Sealed is all you get. Which is basically a final class
Replacing a file is also not going to go away
Is there a way to calculate an entity size without spawning it into the world? I see IEntity has a function for getting size, curious if there's other ways
I have a dynamic spawn system, and would like to categorize based on size. Doing it by type isn't good enough.
By size you mean?
Bounding box

Figuring out size so I can determine if the vehicle will fit in a spawn point without colliding things
Not really afaik
Darn. Right now the workaround has been to spawn those vehicles in the background somewhere, get size, then despawn - caching the result.
Trying to categorize things so I can safely spawn things. For instance, a small garage/storage building can fit a jeep.... but spawning a BTR in there is uh... not recommended. lol. Hilariously it will destroy the building amongst other things
If you are going to spawn them, then Spawn them LOCALLY. And under the Preview world then delete them.
I would say to do it on some init process, do it once and cache the values.
Hold up there are multiple worlds? IS the preview world the one that's used when you see the.... ghosts of compositions?
The Preview world is the one used for items, character inventory UI, etc
And yes, there are multiple worlds
oooooohhhh Interesting. Didn't realize there were multiple worlds active at once
Which is why it is wrong to usually do GetGame().GetWord()
And also why I keep saying that Systems are NOT singletons
lol... I feel called out now 🤣 . Noted.... gotta stop doing that
There can be the same system 4 times if you have 4 worlds at one
And caching them in a static variable will clash them
etc etc
Whenever dealing with anything, always keep track of the relevant world
For example, if you will register an entity to a system. Then do not use GetGame().GetWorld()
use entity.GetWorld().FindSystem(...)
etc
omg that could be why I couldn't find the darn system. I was just learning about BaseSystems today. Found it werid it'd work in workbench but when in playmode the system didn't exist.
That is because there is no world in World Editor 😅
Game world that is
And systems run on worlds
Mind blown. I had put the system into an override version of the game systems file. Had it loaded/active in the project. Will have to fiddle with it some more.
don't look at my code. you'll prob cringe
And each world, has it's own configuration for systems
It might be set for one, but not for another
No worries
The vanilla codebase does not place a good example on this either
If it works it works. But if you want to do things properly then now you know how
Including my own code 
The only bad practice you will not find on what I did though is bad ref usage 
I'm shocked my spaghetti code at this point runs 🤣
Looking for examples is admittedly not easy. I did find a WorldDocs file somewhere, I'm not sure how I found it but it was basically an entire file of documentation but that didn't explain it as well either. I learned stuff but didn't feel equipped to implement it myself
We just increased our resources for Documentation so you should expect some revamp and increase in this regard.
Now that... that'll be fantastic lol. Teach us the ways
I want to document Engine first, then Workbench and related tools, then Game features/Systems.
Excited. Will certainly help bridge the gap between knowledge only the devs have vs the community.
Then the age-old problem.... keeping it up-to-date 🤣
This is why I am also making the decision to not use the wiki anymore.
Something more manageable, with releases, versioning and nicier distribution.
Some system that is the same for us, than for the modders would be best.
Otherwise the conversion work takes qutie a lot
It's nice when you can generate static sites from the codebase documentation. Have it be filterable and what not.
template mod for loading screen on workshop
Which world ChimeraSystemsConfig.conf systems are created in? All worlds (preview, custom, etc.) or only "main" game world?
They are created when you press "Play", but not in Preview
Not sure about custom
Logically it should only be main world, but I still wonder
Logically I need to create them in Preview 😭
This got me wondering, as if any world creates all the systems for it all over (and potentially overwriting singleton instance)
Currently all, soon you can have custom configs and we will split smaller setups for e.g. preview world from the rest
Huh, interesting
What's the best place for DiagMenu.RegisterMenu menu definitions? I need to debug behaviour of my custom components and system that works these components. Can't have that in system as they don't exist in preview mode. There is no static constructor/init that's called once to register the menu.
I guess using gamemode manager component would fit but I'd like to debug my components without gamemode and manager component present
I do this in OnInit of System
Oh, it does get called along with constructor in preview mode!
They allow to run Systems in Preview?
2 month ago, it was not
-wrong-
is there any way to get if entity is local for current client that executes the code?
Find rplcomponent and check role
there's also a IsOwner method (and bunch of others)
Is player character entity local to it's corresponding client?
Nevermind, neither system contructor nor OnInit run in Preview mode, only until you go into Play mode
What you mean by "local"?
In enfusion there are authority, owner proxy and remote proxy
well, I need to execute code in EOnInit only for, I guess, owner of the entity (in this case - player character entity), to initialize a bunch of local HUD displays and event handlers only for this player without doing it on other machines
previously I used player controller component, but I noticed that it's components are upper in initialization order and I can't reliably grab player character there as it may be not spawned yet
I guess I just need to check if code execute environment is owner of the entity
You can subscribe to OnControlledEntityChanged
On a scale from 1 to NOPE how bad of an idea is to put your diag menu inits into
modded class ArmaReforgerScripted : ChimeraGame
{
void ArmaReforgerScripted()
{
// Here?
}
}
I'm not sure if you even can mod this class...
Mb static member of class itself will be better
you can
thats where i do it, just use gamestart instead of constructor
modded class ArmaReforgerScripted
{
override bool OnGameStart()
{
super.OnGameStart();
#ifdef WORKBENCH
KOTH_DebugMenu.Init();
#endif
}
override void OnUpdate(BaseWorld world, float timeslice)
{
super.OnUpdate(world, timeslice);
#ifdef WORKBENCH
KOTH_DebugMenu.UpdateMenus();
#endif
}
}```
hello all i have little trouble i modded for dayz and i have this error come to me :
Binarize started
Note: 'BuildingSuper' is declared, but definition was not found. Creating empty class
Someone knowing the trouble?
You can ifdef entire file if it's just for debug purpose)
i know, there is other unrelated stuff i removed in there 🙂
Hello! It's been 4 days I'm trying to identify why my newly created scripted aim modifier is perfectly working in single player environment but in MP the new position of the weapon is not replicated for other players, I think that's because I didn't make replication, this is an aim modifier attached to the MuzzleComponent, using a bool variable to allow calculation the new aim, I get this bool from a public getter in a modded class of playercontroller, with a keybind that control it. Should I do a replication of this bool variable ? Does this would work like in the replication bootcamp ?
- This is resolved
When i mentioned preview. It was refering to a special world that is used for the preview models for inventory
I usuggest you do not call world editor edit mode preview
when open it in Enfusion tools it works fine, when i host on server i can only store Cars but cant get them UI stop to work...
Thanks, I've seen it working, I was wondering if there are downsides to it. One I can see there being no base construction function so two mods may overwrite each other
Anyone?
I'm trying to toggle capture zones mid game via set conditions or timers
unless there's an easier way to enable/disable the whole zone rather than play with active triggers?
How do i set the proper angle of a world.CreateDecal? When i just use the characters rotation, it doesn't work right. The actual decal is all over the place and does seem to have any relation to 0-360 degrees
Decal decal = world.CreateDecal(
trace.TraceEnt, // Entity
spawnPosition, // origin vector (position)
-trace.TraceNorm, // project vector
0.0, // nearclip
3, // farclip
character.GetAngles()[1], // angle
0.35, // size
1, // stretch
mat, //emat path
-1,// lifetime, if <= 0 the decal is created as static
color); //color of decal
Can I hide Attributes in a subtype?
Does it even work ?
Constructor of such class is so soon
Thx for answer ❤️
Like this?
modded class SCR_CampaignBuildingManagerComponent
{
// [Attribute("5", UIWidgets.EditBox, "How many times player has to perform build step to gain a XP reward", "")]
// protected int m_iXpRewardTreshold;
//------------------------------------------------------------------------------------------------
override void OnPostInit(IEntity owner)
{
//if (SCR_Global.IsEditMode())
//return;
// SetEventMask(owner, EntityEvent.INIT);
super.OnPostInit(owner);
Print("SCR_CampaignBuildingManagerComponent::OnPostInit::m_iXpRewardTreshold = " + m_iXpRewardTreshold);
}
}
THX!
IT WORKS 
howdy y'all! Anyone here familiar with the Conflict gamecode? I'm trying to find someone to help me add a little something to it and I know from asking around it's definitely on the more challenging side
i'm trying to a group prefab field to SCR_GroupPreset, then parse out the character prefabs and assign them to the group member slots, and of course then spawn the player with that character prefab
it would live here (first shot), below, say, Group Size. And then the UI (secomd shot) would need to be tweaked by adding the character prefab name to the slot you're joining so you know what you'll spawn as.
on the plus side, if this is over everyone's head at least i won't feel bad for not figuring it out myself (c isn't something i'm comfortable with) 😆
There's an identity selection mod that I just started using. I also made a mod to add it to the radios in every factions hq tents in conflict game mode. You can read more about it here: #1360555442148999322 message
that mod is super cool but i'm looking more at this as a way to prescribe roles in a squad, like you can in previous titles. There's a mod that lets you configure multiple loadouts but it wouldn't allow for the granularness i'm looking for. And Reforger Lobby does it but it's not PvP/Conflict compatible
Thinking about what i'm doing above.... instead of pulling a prefab group it could just be a list and you select the character prefabs right below where you setup the group. Don't need to parse a group prefab at that point.
maybe you can take a look at how that mod did it so you can incorporate the same into your own mod (without stealing code of course).
for sure. I'll give it a look!
Seems to work for diag stuff
I guess it might not work if you need to init something that relies on world entities and such, but declaring diag menu could be OK it seems
@craggy jolt surely you have some info on this, please 🙏
Sorry, I'm not the one to ask, still learning
Looking to start a project in the coming week,
Anyone able to highlight vanilla script files relating to the scoreboard and ingame name tags.
Looking to add a little rank image & number at the start of players names (Like insurgency sandstorm)
take a look at the bohemia usage of it inside of SCR_FiringRangeController.c
Hello scripting magicians😁
Is it possible to limit one building so it can only be built on main base, with scripts?
I was looking if there is a way to change it through configs and didnt find anything. Any help is greatly appreciated.
I have drone station and would want to limit drone spam in this way.
Hey Cyborg, I’m sorry for pinging and I hope you don’t mind me asking but how do you guys prevent weapon fire in your MOB?
I’d need to implement something similar if you don’t mind me asking.
Is implementing a "server key" script to a mod allowed? So only specific servers can use it?
Guess like whitelisting people but for servers
As long as it doesn't crash there game
You could make a layout popup every x I guess (PTSD from A3 flying helicopters without dlc
)
Annoying popup would still be not allowed, once is fine, interfering with gameplay is not
what if its a different cat meme everytime?
if I have an array with 5000 elements should I sort it myself in N items per frame? or just call Sort()?
Or you use a sorted array object to begin with.
Nah I use a map but I want to sort it for the purpose of displaying and paginating UI
When are we getting the ability to put methods inside maps? and pass them as parameters?
having a map with 10 methods to call based on some enum is better than 10 if statements
How much slower is this than calling the actual method directly?
Looks like it's 2.2x slower than direct, scriptinvoker with 1 method is 2.1x slower
Slow
See this example vs their bytecode.
void SomeMethod(int fisrtValue, float secondValue)
{
Print(fisrtValue);
Print(secondValue);
}
void RunSomeMethodNormally()
{
const int fisrtValue = 1024;
const float secondValue = 0.1;
SomeMethod(fisrtValue, secondValue);
}
void RunSomeMethodDynamically()
{
const int fisrtValue = 1024;
const float secondValue = 0.1;
GetGame().GetScriptModule().Call(null, "SomeMethod", false, __void, fisrtValue, secondValue);
}
Bytecode
SomeMethod()
000252:0x00520558: icall Print(fisrtValue, _i8):__void
000253:0x00520568: icall Print(secondValue, _i8):__void
000253:0x00520578: rts
RunSomeMethodNormally()
000260:0x005205d0: call SomeMethod(fisrtValue, secondValue)
000260:0x005205e0: rts
RunSomeMethodDynamically()
000267:0x00520660: call GetGame()
000267:0x00520668: icall GetScriptModule(#return):#return
000267:0x00520678: icall ScriptModule.Call(null, _s'SomeMethod', false, __void, fisrtValue, secondValue, _c00000000, _c00000000, _c00000000, _c00000000, _c00000000, _c00000000, _c00000000):#return
000267:0x005206b8: release #return
000267:0x005206c0: rts
How much slower would MyMap.Get("something")() be? than direct
You know, if this was a thing
I assume faster than GetGame().GetScriptModule().Call
That is with const
And faster than a chain of 10 ifs
See this example without const vs their bytecode.
void SomeMethod(int fisrtValue, float secondValue)
{
Print(fisrtValue);
Print(secondValue);
}
void RunSomeMethodNormally()
{
int fisrtValue = 1024;
float secondValue = 0.1;
SomeMethod(fisrtValue, secondValue);
}
void RunSomeMethodDynamically()
{
int fisrtValue = 1024;
float secondValue = 0.1;
GetGame().GetScriptModule().Call(null, "SomeMethod", false, __void, fisrtValue, secondValue);
}
Bytecode
SomeMethod()
000252:0x00520548: icall Print(fisrtValue, _i8):__void
000253:0x00520558: icall Print(secondValue, _i8):__void
000253:0x00520568: rts
RunSomeMethodNormally()
000258:0x00520610: imove fisrtValue, 0x000400
000259:0x00520620: imove secondValue, 0.10000
000260:0x00520630: call SomeMethod(fisrtValue, secondValue)
000260:0x00520640: rts
RunSomeMethodDynamically()
000265:0x005206c0: imove fisrtValue, 0x000400
000266:0x005206d0: imove secondValue, 0.10000
000267:0x005206e0: call GetGame()
000267:0x005206e8: icall GetScriptModule(#return):#return
000267:0x005206f8: icall ScriptModule.Call(null, _s'SomeMethod', false, __void, fisrtValue, secondValue, _c00000000, _c00000000, _c00000000, _c00000000, _c00000000, _c00000000, _c00000000):#return
000267:0x00520738: release #return
000267:0x00520740: rts
its cool if I dont need to modify it
can we get this in the script editor thanks
Do we have access to create gizmos at all in the editor?
What?, the Bytecode listings?
Yes sir, pleas sir 
Imagine how much clearer and easier it is to understand how thigns work
Hi, how can I configure the distance of stream in / stream out in for the dedicated server tool ?
I'm testing the replication of an animation variable for the weapon
how do I make a class with template that I can pass to other classes as parameters? whats the syntax for this
I used -nds 1 -nwkResolution 5 as launch parameters. -nwkResolution is the distance, but it is 500m minimum on a dedic, won't go any lower even on diag. For workbench you can set it with no restrictions.
In the replication bootcamp the stream in/out was set at 10 meters while using the dedicated server tool, nwkResolution is the stream or I misunderstood ?
Maybe i misunderstood, iirc it was peer tool, not proper dedic, lemme check
This is peer tool no ? I think there is confusion ^^
yes, that is dedicated server tool
but in workshop he runs it from workbench, so that would be peer tool
Oh ok
So workbench exe is server, and nwkResolution 10 works. But on proper dedic it never worked for me.
It was in March, maybe something changed since, but i haven't checked
I'll try, thanks for the help!
whats the actual script wizard website?
how do I get the number of callbacks inside scriptinvoker?
lol I have a phantom scriptinvoker
it keeps calling itself every frame after I stop calling it
idk
freezes wb
I have no clue what calls it
All the print calls in places where I actually call it stop printing but the invoker still runs
Nvm not actually invoker, the method that calls the invoker keeps running
However the method I use to call the looping method stops printing
Ok found it whew
Wher do i look for detecting projectile collisions/hits with rigidbody?
EOnContact
That is for rigidbody against rigidbody, i need projectile hits
or will it catch that?
Ah you're right that doesn't detect projectiles
Only projectile related thing is BaseTriggerComponent, it has EOnContact, but i'm not sure if it's what i'm after
but what if rigidbody being hit doesn't have damage setup
ProjectileEffect, because it is what causes the hit effect
HitSoundEffect is there
Ok, i'll take a look
override event void OnEffect (IEntity pHitEntity, inout vector outMat[3], IEntity damageSource, notnull Instigator instigator, string colliderName, float speed) {
Where did chimera come from anyway was it like a codename for the game or something?
Codename yeah
Cool thanks. Been curious about it for awhile.
Been looking into cameras, I sense a great despair with this API
Like script camera constructor taking a config and a parent (parent is unused)
It's there for emotional support
there's probably a few different approaches, we opted to target the action triggers and just have an array of base actions we want to block
if (am.GetActionTriggered(action))
{
am.SetActionValue(action, 0.0);
WCS_NotifyPlayer(ENotification.WCS_SHOOT_MAIN_BASE);
return;
}
all the code for this is inside the WCS_SpawnProtection mod along with other stuff like blocking mortars from being fired from main base etc
and we just hook into conflict and check if the player is inside a HQ
Ok thank you.
Am i allowed to dig a bit into some of your spawn protection code to find something that would fit my case or not really ?
go ahead
Nice, thanks a lot !
Man I hate that you had to go to such lengths to do this
I'm facing an issue with the radios :
Because of the way my game mode works I have to spawn in the radio whenever the player select a new class.
The issue is that on the workbench i'm properly using a default channel tho on dedicated the radio seems to not be set properly.
Is there a way to force a default channel ?
WORLD : NotifyEntitiesInitialized
SCRIPT : GetResourceName 'Scripts/Game/CentralEconomy/GameMode/CE_WorldValidationComponent.c,38'
RESOURCES (E): Wrong GUID/name for resource @"{0000000000000000}$profile:/CentralEconomy/CE_ItemData.conf" in property "m_sDb"
since I'm loading a config from the server's profile folder, is there a way to get rid of this error..?
Doesn't break anything and config loads fine, just annoying to see lol
this is what it corresponds to:
protected const string DB_DIR = "$profile:/CentralEconomy"; // directory name in the server profile folder
protected const string DB_NAME_CONF = "CE_ItemData.conf"; // config file name in the server profile folder
string m_sDb = string.Format("%1/%2", DB_DIR, DB_NAME_CONF);
Resource holder = BaseContainerTools.LoadContainer(m_sDb);
This error shows up on clients, or server?
I check if it's server or client, so should just be server logs. Will verify in a moment. Doesn't spam it, just posts once on server launch, so not an issue realistically, just trying to clean up loose ends if possible
yes, can confirm now, just once in server logs
Hm, interesting it tells you that error and loads correctly
also getting this warning spammed when opening inventory through a useraction, anyone encountered such? Useraction works fine otherwise
14:56:30.382 SCRIPT (W): [AnimateWidget.PrepareAnimation] AnimateWidget entity instance is missing ImageWidget<0x000001E044E3F2F8> { Name: 'Saline_icon' }.Saline_icon
14:56:30.382 SCRIPT (W): [AnimateWidget.PrepareAnimation] AnimateWidget entity instance is missing ImageWidget<0x000001E044E3F500> { Name: 'Morphine_icon' }.Morphine_icon
Code:
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
{
SCR_InventoryStorageManagerComponent userStorageManager = SCR_InventoryStorageManagerComponent.Cast(pUserEntity.FindComponent(SCR_InventoryStorageManagerComponent));
if (!userStorageManager)
return;
userStorageManager.SetStorageToOpen(pOwnerEntity);
userStorageManager.OpenInventory();
if (m_StorageItemAttributes)
m_StorageItemAttributes.CE_SetVisible(false);
}
Seems like it may be a vanilla issue, but doesn't spam when opening inventory regularly in-game
Solved: UserAction wasn't inheriting from SCR_InventoryAction and wasn't performing the storage opening within PerformActionInternal()
Quick question: is it possible to have a script that disables the first sub component of a particular type on an entity, then perform some base user action, then enable the next sub component of the same name, then perform the same user action and so on?
How does one force a player to face a certain direction live? SetYawPitchRoll does not seem to be doing the trick alone. Offering 1 cookie for example 🍪
I add a warzone checking in reconfigure relay action CanBePerformedScript. It works fine in workbench but not work in dedicated server.
Are there any tricks to quickly indent group of lines in Script Editor? Getting tired of copying blocks into another text editor to do that.
select lines + TAB?
wtf, I was sure I tried that
This explains why tab doesn't replace selected text with tabulation, was going to complain about that lol
Shift+Tab also removes indent, nice
Damn, I feel like I tried all combinations and was sure this wasn't working
Thanks
shift+tab for reverse, but only if you select multiple lines
I also was mind blown for commenting out multiple lines with \ on numpad
Is there a cheat sheet with these somewhere?
Also how do you uncomment it back?
Reselect the lines and push it again
There is a shortcuts menu somewhere on the titlebar, I'd have to have a look at where exactly to say for sure
There are some there that work sometimes but not all the time cough auto complete cough
Having some unicode symbols in the script makes auto indentation on line break stop working
Copied some logs and put them into comment in my script, turns out it also compied some invisible unicode characters and it broke auto indentation
So if that breaks means you have some invisible unicode crap above somewhere
Ticket submitted
I'm trying to set a variable within an entity's component through script, and it works fine until the entity is the child of another entity. It finds the component fine, but the variable won't set.
In this instance, my GenericEntity with the component containing the variable is the child of a SCR_DestructibleBuildingEntity. The GenericEntity has a RplComponent and a Hierarchy, I'm not too sure what I could be missing. Has anyone else encountered this?
You can also highlight and press single quote 3 times ‘’’
What are you trying to set? Does it involve prefabs?
Trying to set a Enum-based variable in the component with an entity inherited from ScriptedTriggerAreaEntity. Basically, querying entities inside of the trigger area, if entity has the component, set variable in the component. Both the GenericEntity and the trigger area entity are a child of the building.
The GenericEntity with the component is a prefab, and so is the trigger area. And then the building is of course
Works perfectly fine when not a child of the building, like if I individually place the trigger area prefab on the ground and the generic entity prefab inside of that area (not as a child), it’ll set it perfectly fine, no issues from what I see
I had just hopped off my PC for the night, so can’t paste code directly, but it’s in my GitHub backups. Referencing the CE_UsageTriggerAreaEntity and the CE_ItemSpawningComponent.
Its a little bit of a mess atm because going through a rewrite and was debugging trying to solve this issue
kind of a weird question but is there a way to have a UI Dialog appear when users join the game.
my mod will require a step by step on how said mod works and that they understand everything etc.
it'll only appear once per session
i do not see anything immedatiely wrong with the code. debug what is happening. also consider moving attributes and shared data to the class class so all triggers who share the same setup can reduce their memory usage
Use server admin tools and edit the greeting server message
I’m not hosting a server, this is for when my mod is published, dw I found the answer I needed :))
I like using SCR_ConfigurableDialogUi for those, but the downside is you cannot really open one on top of another without the bottom one disappearing
I define a varible and a getvalue function in base manager. If I changed it in gamemode, Its value would be the same on server/client side? Or need a RPL function for client?
e.g. I check it in seizing component and user action script
rplprop on gamemode will be sync
Since realistically there can only be one main game world, can't I just compare the world on system constructor and store that in static variable?
Thank you bacon. I think it works fine in seizing/task generation component, because I can disable those bases outside the warzone (compare the value). similar to your linear mod. But it is not working in reconfigure raley action when I run the mod in dedicated server (local workbanch is fine)
Make sure the value itself is only changed on the server, and make sure to call Replication.BumpMe when it changes
Just print the value on clients to see if it changed, you can define onRplName function
If the value changes but you still dont get expected result then your problem would be somewhere else
So at least points you in the right direction
Also figure out peertool so you dont have to mess with dedicated
Instead of
//------------------------------------------------------------------------------------------------
static SomeSystem GetSomeSystem() {
World world = GetGame().GetWorld();
if (!world)
return null;
return SomeSystem.Cast(world.FindSystem(SomeSystem));
}
Do this
protected static SomeSystem s_GameWorldInstance;
//------------------------------------------------------------------------------------------------
static SomeSystem GetSomeSystem() {
return s_GameWorldInstance;
}
//------------------------------------------------------------------------------------------------
void SomeSystem()
{
if(GetWorld() == GetGame().GetWorld()) s_GameWorldInstance = this;
}
So its a singleton for system instance that matters
By the way did you know you can use g_Game instead of GetGame() lol
thank you sir. It helps a lot.
Global variable 
even if you delay the second one from appearing till the first dialog is closed ?
g_ARGame even
The dialog system only supports one visible dialog at a time. My suggestion is to do all the things you need to do inside one dialog or create your scripts in a way that they call another dialog when first one is closed.
I'm running a Print on system contruction and it doesn't seem to show twice for you say open an inventory (which should create preview world for items and create all systems again for it?)
This is basically the most DO NOT we have internally
actually thats smart since the user will need to activate a prop on their armor for the mod to work and thats where id need them to read a dialog to accept the terms. thanks for the helpful tip man or should i say a bacon tip
Just get your world from the entity your are working on
Or component
And do FindSystem on it
Here is how it works when you have multiple dialogs, you can see 1 is active at a time only... so I just call display of previous dialog when necessary
FindSystem is fast anyway
Why not, if system is designed to be singleton and only apply to main game world?
It's not
There can be the same system in multiple worlds
fair enough. yeah ill look more into when im at the point in my mod to start looking at dialogs. more then anything it work do a dialog window the moment you join the game
If my system runs in more worlds than just the main one then that's a bug you need to sort out
I mean that specific system implementation, not systems in general
It's not a bug
If you design it to be singleton, store singleton instance of the game world's system
it's intentional
but the good thing about SCR_ConfigurableDialogUi is that they are EASY to setup, so I'll still use them
You could have an inv system, both present on purpose on the main world vs preview world
But they are separate, their own
Same class, different instances
Hence why the static variable is cause of issues
It seems you guys seem to believe that more low level and super nuanced = better. It's not. Modders want convenience and things to work. You should not develop modding systems in a way where we have to remember 51 different quirks as if modding was a doug demuro video.
This is for game development
You can not use it if you want
We develop the game partly in scripts
IF you want we can make everything CPP and give you nothing
Find me a modding use case where a modder wants their system to be in preview worlds
Or give you more limited scripts
Animating items in preview world



