#enfusion_scripting
1 messages · Page 4 of 1
Hm I would have thought that spawning a heli on a helipad would be handled by entity spawner component but it seems like it doesnt handle it, why is it called spawner if it doesnt spawn?
Any reliable place to grab the server name and not just the mission header?
There is no reliable place. Server config is the only one but that's not reliable. Mission header doesn't store server name.
I'd be alright parsing the config for it. You mind sharing how you reference the path for it?
You can try getting it out of the CLI Params unless the backend api call for it works somehow
Also Math3D.MatrixMultiply3(A, B, R) does actually seem to do R = B matrixMultiply A. Maybe it's intentional though to swap the order so that the vectors in vector[3] are treated as column vectors 🤷
You can get it from: SCR_DSConfig();
CLI was a good lead though
Pretty sure none of that is accessible
At least it wasn't last time I tried.
Seems to be working right now
Share code lol
{
private static string s_sCachedServerName = "";
private static bool s_bServerNameReadAttempted = false;
//------------------------------------------------------------------------------------------------
//! Reads the server name using the BackendApi's running configuration.
//! Caches the result.
//! \return The server name string, or a default/error string if reading fails.
//------------------------------------------------------------------------------------------------
static string GetServerName()
{
if (s_bServerNameReadAttempted)
{
// Print(LOG_PREFIX_UTILS + " GetServerName: Returning cached name: '" + s_sCachedServerName + "'", LogLevel.DEBUG);
return s_sCachedServerName;
}
s_bServerNameReadAttempted = true;
s_sCachedServerName = "Unknown Server (Config Read Error)"; // Default fallback
Print(LOG_PREFIX_UTILS + " GetServerName: Attempting to get running config from BackendApi...", LogLevel.NORMAL);
BackendApi api = GetGame().GetBackendApi();
if (!api)
{
Print(LOG_PREFIX_UTILS + " ERROR: GetServerName: Could not get BackendApi instance.", LogLevel.ERROR);
s_sCachedServerName = "Unknown Server (No BackendApi)";
return s_sCachedServerName;
}
// Create a DSConfig object to be populated w placeholder data
SCR_DSConfig runningConfig = new SCR_DSConfig();
if (!runningConfig)
{
Print(LOG_PREFIX_UTILS + " ERROR: GetServerName: Failed to create SCR_DSConfig instance.", LogLevel.ERROR);
s_sCachedServerName = "Unknown Server (Internal Error)";
return s_sCachedServerName;
}
// Call the BackendApi function
if (!api.GetRunningDSConfig(runningConfig))
{
Print(LOG_PREFIX_UTILS + " ERROR: GetServerName: BackendApi.GetRunningDSConfig() failed.", LogLevel.ERROR);
s_sCachedServerName = "Unknown Server (Backend Read Failed)";
return s_sCachedServerName;
}
// --- Extract the name ---
// Check if the 'game' object and 'name' property exist and are valid
if (runningConfig.game && !runningConfig.game.name.IsEmpty())
{
s_sCachedServerName = runningConfig.game.name; // Get name from populated object
Print(LOG_PREFIX_UTILS + " GetServerName: Successfully read server name from running config: '" + s_sCachedServerName + "'", LogLevel.NORMAL);
}
else
{
Print(LOG_PREFIX_UTILS + " WARNING: GetServerName: GetRunningDSConfig succeeded, but 'game' object or 'game.name' was missing/empty.", LogLevel.WARNING);
s_sCachedServerName = "Unknown Server (Name Missing in Running Cfg)";
}
return s_sCachedServerName;
}```
Kind of of hacky workaround but it gets the job done
Is it normal for Arma to be added as a dependency of my mod? I override a couple of compositions which presumably triggered it?
Yea
Yes, it makes it so that your mod loads the game first. (Which by itself is also a mod/addon)
And you will see, that Arma Reforger also has Core (addon/mod as dependency), which is the engine provided one.
Why don't action value's/events get updated when you have a UI open? I've created actions and listeners for them, and they run correctly normally, however as soon as I open a dialog they no longer run. Is there a way to fix this?
The context for the UI is higher priority
When changing things in configs you need to restart workbench sometimes
CharacterGeneralContext has a priority of 10
InventoryMenuContext has a priority of 120
Things in CharacterGeneralContext aren't "triggered" when InventoryMenuContext is active because they are at a lower priority
My custom input context is priority 9 and my ui context is 10
Priority typically means lower number has higher priority... is that now how reforger does it?
Hm reforger keeps quietly crashing, things still seem to work but I cant exit the sim, maybe thats having an odd affect
Making the input context 999 seems to allow it to detect inputs, thankyou for the suggestion! It also seems like I was re-creating the listener every frame by mistake which was causing the soft crash! Thankyou very much for your help Zelik
Hey Zelik since you're around, mind telling was that code related to metabolism you posted in here a while back for a new mod you're making or a feature coming to your character mod?
From a modded class, is there a way to call the vanilla.super implementation of the function? If we pretend Foo extends some class Menu, neither of the below examples seems to invoke Menu.Bar() -- it'll always invoke the original Foo.Bar() function.
// Example A
modded class Foo {
override void Bar() {
super.super.Bar();
}
}
// Example B
modded class Foo {
override void Bar() {
vanilla.super.Bar();
}
}
Define some method in vanila.super class that will call required function and call it
Is there any script built in method to generate a UUID?
Anyone worked on / made .layout files? Specifically a menu
I believe this gets the ID ```C
int playerId = GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(pUserEntity);
PlayerController playerController = GetGame().GetPlayerManager().GetPlayerController(playerId);
good thinking
I think they're talking about random UUID generation.
Yeah trynna make player groups persistent and it would be a lot easier if I could override them to be tracked by a UUID string instead of an int that increments and starts from 0 every time server restarts
SCRIPT (E): Virtual Machine Exception
Reason: NULL pointer to instance
Class: 'SCR_InventoryMenuUI'
Function: 'SetStorageSwitchMode'
Stack trace:
scripts/Game/UI/Inventory/SCR_InventoryMenuUI.c:884 Function SetStorageSwitchMode
scripts/Game/UI/Inventory/SCR_InventoryMenuUI.c:714 Function OnQueueProcessed
scripts/Game/UI/Inventory/SCR_InventoryMenuUI.c:701 Function ProcessInitQueue
scripts/Game/UI/Inventory/SCR_InventoryMenuUI.c:726 Function OnMenuUpdate
What am i missing here?
if a UUID method doesn't exist I suppose you could probably use RandomGenerator to just generate one manually. SCR_Math.GetMathRandomGenerator(). if your scenario depends on some kind of RNG determinism though using the resulting generator would alter RNG state ofc
yeah I guess a really really really really big random number could kind of work as well
just generate 16 random numbers and format as hex. note, not tested:
// returns 16-byte hex string
static string GenerateUUID()
{
const string hexChars = "0123456789abcdef";
RandomGenerator rand = SCR_Math.GetMathRandomGenerator();
string hexString = "";
for (int i = 0; i < 16; i++) {
int value = rand.RandInt(0, 0xFF);
int hexDigitHigh = (value >> 4) & 0xF;
int hexDigitLow = value & 0xF;
hexString += hexDigitHigh;
hexString += hexDigitLow;
}
return hexString;
};
I think I'm just gonna try persisting the m_iLatestGroupID to file and init it to that value on startup which should hopefully achieve the same result of avoiding newly created groups after a restart getting IDs that collide with previously persisted but not loaded ones, but if it doesn't work I'll give that a try thanks 🙂
?
I swear I saw you post something about a metabolism system a while back and was wondering what the go with that is
though in trying to find the post I found Hydro Skunk's metabolism mod which sounds like pretty much what I was after
I don't recall posting anything about it in here but, I'll be releasing mine soon enough.
Can you use RplProp in a game system, vaguely remember reading about gamesytem and networking. I only remember it can use Rpc (Obviously Server->Client) so I assume it supports RplProp..? 
You can yes.
Also you can watch the replication bootcamps (There is two) on youtube for a video intro to replication.
Including examples of these on systems
Yeah I have adhd, those videos don't cut it for me. I'm more of a skim-reader with good ol' brute force trial and error. I thought as much tho just figured I'd ask to be sure before I find out it didn't and have to do something else
thx
Preach
Im trying to follow along with this video and im getting a issue i dont really understand. I copied the scripts and changed a few things like vehicle name but now im getting an error.
heres the script
this is the vid
Get #ArmaReforger now ➡ https://reforger.armaplatform.com/buygame
Community videos and cinematics (also known as machinimas) have always been a part of Arma and DayZ platforms. Vladimír Jaške, director of the #ArmaReforger launch trailer, will show you step-by-step tutorial workflow for creating awesome cinematic and VFX effects in the next...
I cant get it to preview like in the video
something here seems off?
That is an unfortunate error 🙂 hard to overlook _ vs - on this tiny font honestly
Sure would be nice to have a Replication.Refresh and Replication.RefreshEntity for no particular reason
Like bumpme?
Yeah but on the client end
Just forcefully restream in an entity or all in network bubble
sus
🤨
Yeah let me let the player do that.. totally wouldn't be abused...
I mean there's already dudes teleporting around
There's a lot more those dudes do..
rplComponent.EnableStreaming(true);```
Hi,
I have a menu script that works fine in the editor and offline, but it doesn't open at all on the server. Can you help me identify the issue?
{
if (!m_GarageComp)
return;
int playerId = GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(pUserEntity);
string playerGuid = GetGame().GetBackendApi().GetPlayerIdentityId(playerId);
if (!playerGuid)
return;
PlayerGarageStorage storage = m_GarageComp.LoadPlayerGarageData(playerGuid);
MenuBase menu = GetGame().GetMenuManager().OpenMenu(ChimeraMenuPreset.AGW_GarageMenuList);
AGW_GarageMenuList applicationMenu = AGW_GarageMenuList.Cast(menu);
//if (!applicationMenu) return;
Print(m_GarageComp.GetStoredVehicles(playerGuid));
int x = 0;
foreach(auto vehicle: m_GarageComp.GetStoredVehicles(playerGuid)){
GarageVehicleData vehicleData = vehicle;
applicationMenu.insertContent(vehicleData.vehicle_prefab,vehicleData.vehicle_icon, vehicleData.vehicle_name,playerId,x,m_GarageComp);
x++;
}
//m_GarageComp.LoadCar(playerId, m_iVehicleIndex);
}```
This will replicate it to all clients globally regardless of bubble. streaming = uses bubble.
PlayerGuid is null for client
Better than @KJWs Minecraft font
Any way to increase API call timeout?
Currently no
That has nothing to do with scripting, this isn't a feedback channel.
Hi there, I'm new to Arma Reforger Tools.
I'm trying to automatically spawn a prefab based on the faction that owns the control point in a conflict mode (if the US owns the point -> spawn prefab HelipadUS for example).
Does anyone know how to fix my problem. If i put this in mine Server.Json: "missionHeader": {
"m_iControlPointsCap": 42,
"m_fVictoryTimeout": -1,
"m_iStartingHQSupplies": 9001,
"m_iMinimumBaseSupplies": 500,
"m_iMaximumBaseSupplies": 10000,
"m_bCustomBaseWhitelist": true,
"m_aCampaignCustomBaseList": [
{
"m_sBaseName": "TownBaseMontignac",
"m_bIsControlPoint": true,
"m_bCanBeHQ": false,
"m_bDisableWhenUnusedAsHQ": true,
"m_fRadioRange": 500
}
]
}
},
the base disepears
That has nothing to do with scripting
Anyone have a .gitignore template they like to use for their mod repos?
Okay how to fix it?
The client can't get the Player guid
calling that function on the client does nothing.
Is there any performance concerns with having a map thats hard ref and contains a resourcename and class? im not sure how many resources will be in it yet but im guessing atleast 30-40.
Anyone know how to fix my json
Wrong channel dude. This channel is for scripting.
I noticed that at the start of the match, inSCR_NameTagData::SetGroup() the m_NTDisplay.m_CurrentPlayerTag.m_iGroupID is always -1 for the group leader.
When the next player joins though, I can see that there are two people in the group -- yet the leader still has its own name tag data reflecting -1 for its group ID. If the group leader creates a new group and the other player joins the new group, everything is fine.
Is this a known issue?
Oh is it a race condition? or just tag is initialized before the faction? This breakpoint is hit right when you press "Deploy" for the first time
We had some guy come into our server and was promoting some docker lua program he made to one of our admins and was selling hat claimed to do recurring system chat messages on an unmodded server. Can you shed any light on this?
Still suirprised not support in RCON yet though, along with IP. We've had to scan log files with our own in-house program to log IP info and associate it to details collected via RCON
Oh so basically a server hack
Battleye RCON gives ip
We got it, but VPN
Is IEntity's Get/SetTransform same thing as Get/SetWorldTransform?
I wrote this when drinking beer and modding so apologies in advance but it works.
Is this really the most elegant way to select the component that is explicitly a BaseTriggerComponent and not an inherited one?
SetTransform calls SetWorldTransform
That is it
They are the same
difference is that SetWorldTransform is just faster because it is direct
Thanks
Sounds 
Why do you need that specifically?
You are already searching for the derived class
IsInherited will do the same
If it's not it then it will give false
I have multiple trigger components and I need to find the one that is BaseTriggerComponent. If it selects a CollisionTriggerComponent it breaks
If I just do a simple cast, it is possible to cast CollisionTriggerComponent into BaseTriggerComponent which will cause a problem
Also for some reason I need to have all the other trigger components as child components of the CollisionTriggerComponent or otherwise it wont work. At least for the TimeTriggerComponent
But using this might be more elegant I guess
@coarse pine Just do
temp.Type() == BaseTriggerComponent
Yeah...I have no idea why I converted it to string...
Thanks
You can't just create your-own TriggerComponent and search for it?
I could but that would require even more work 😅
What Mario suggested seems to work well enough for my needs
Hello everyone I have a question. I have a scenario that uses large trigger entities to function as a restricted zone. When a player of a specific faction enters the zone, a pop up notification show on their screen warning them to turn back or be killed. The problem I am having is that when the pop up notification occurs it displays as a global server message. Everyone sees it instead of just the local player. I am trying to fix this issue without writing any scripts but I'm starting to think this is going to require a script that calls to the to the local player only. I just don't see any way in the editor to target the specific player. Does anyone know how to do this in the GUI editor? Thank you:)
Why cant server command name have a slash in its keyword?
Lol
// works
override string GetKeyword() { return "sat_plugins/json"; }
// doesnt work?????
override string GetKeyword() { return string.Format("%1/json", super.GetKeyword()); }
Note: super.GetKeyword() returns "sat_plugins"
Is there are way to make an action show that is added to a gadget that another player holds in their hand?
For example when player 1 has a grenade in their hand, player 2 could do an action on the held grenade.
PULL THE PIN 
Thanks for the mentions on this. Much appreciated. Is there a link to a BI issue tracker, or known issue list about this one, whether it's addressed in a recent update? Thanks!
https://reforger.armaplatform.com/news/update-april-10-2025
Changed: Changed behavior of "-autoreload X" CLI parameter where X>0 means mission will restart after X seconds, X=0 immediate restart, while x=disabled means that mission will not restart. The server will fully shut down after the scenario ends and relaunch as the same instance.
Thank you. What function are we to call that kicks off that logic? Current we either GetGame().RequestClose() to shut down entirely (not desired here -- we don't want to disconnect people) or GameStateTransitions.RequestScenarioRestart()
It is done via startup cli params
Understood. If I use that param, then I call GetGame().RequestClose() the scenario will restart?
No you do not call anything manually, you use the cli param exclusively
So then my question is more basic. How do I tell the game my scenario (which is highly custom) is ended?
Anyone have a lead on the .conf that defines player/controller markers on the map? Having a hard time tracking down where those come from 😅
It is triggered via SCR_BaseGameMode.EndGameMode()
If you want the server to physically restart then you will also need to set -autoshutdown as cli param and -autoreload disabled or -1
@torn bane sorry for the ping but while you're around, I was asking before about the format used by SCR_BinSaveContext and whether it's something standard like BSON or CBOR or if it's a proprietary format. I saw you suggesting folks use this in the past -- are you able to share any insight?
Custom bitstuffing compression, not intended for parsing externally. If you want the exchange data, use json
Thanks for the info
Was anyone able to get -autoreload 0 to work after calling SCR_BaseGameMode.EndGameMode() ?
I think at the end of the day, it still calls GameStateTransitions.RequestScenarioRestart()
I have an issue that seems to be an engine side error and I have no idea what it means or how to fix it. Any ideas?
It happens when a regenerating hitzone on an entity I have takes damage. Seems to randomly do it so I can't pinpoint the exact condition but the result is the health gets instantly nulled out and no longer regenerates if I click abort in the above error box
Hey i have next problem by using CE
by github it says
Run the server ONCE to generate the default CE_ItemData.json file (file can be found in your server profile folder, and goes $profile/.CentralEconomy/CE_ItemData.json).
bei Nitrado hosting i have no file found but loot spawns
Any EPF users had any issues with persisted character entities getting deleted between it being spawned in LoadCharacter and attempting to handover control of it in OnCharacterLoadComplete?
The entity seems to spawn fine initially but by the time OnCharacterLoadComplete callback runs it has been deleted. Could possibly be some bad override or mod I have running but I don't think anything I have should impact that, almost seems more like the entity just gets deleted by ref counting or GC on next frame
It has to be something that you've overwritten.
Ok cool guess I just never noticed / repro'd it until 1.3 so thought it was maybe something recent
when making a component, when should I use child components?
I drop/spawn an UAZ452 Ambulance on the map. The inventory has arsenal in it and I'd like get rid of that. Is that defined in the vehicle prefab or does that come from gamemode? Can I disable it on the spawned vehicle? Or set it to zero?
Look in the prefab to see. No need in having someone else to do it for you. Lol
You're right and I did that. I could not find anything related to it so that's why I'm asking. Not sure which component it should be .. nothing seems to be related to arsenl.
Well if you looked and there isn't anything related to the arsenal in the prefab what does that mean...?
i'll point you in a direction. if there is an action for it, you might be able to remove/find out more about the action in ActionsManagerComponent
SCR_ResourceComponent might have some stuff in it too
SCR_ArsenalComponent exists on other arsenal related objects
SlotManagerComponent has a virtual arsenal slot for the UAZ452
Thanks, I was playing with resource component as the SCR_ArsenalComponent did not exist. Never knew about the virtual arsenal slot. This works.
You got a vector that has inf or NaN as a value. It just raises an assert to tell the user something was used incorrectly. Safe to click "abort" and never hear from it again for the rest of the session - unless it is from something you perhaps did during modding then check your vector/matrix math
The issue is that it renders the regenerating hitzone I have useless until I get a new one. It's pretty consistent in doing it, too, so I can't really ignore it
does anyone know if there are reforger/enfusion equivalents of these, and other functionality adding script packages that i can add to reforger missions?
https://github.com/HakonRydland/A3-HR-Garage
https://github.com/Jeroen-Notenbomer/Limited-Arsenal
https://github.com/HallyG/HALs_Store
why is it that I dont have a mouse when my .layout file is shown?
I don't think a question can get any more vague than that...
Place a 🪤 and it will show up
Could you elaborate?
probably need to use thee menu for interacting with the layout with a mouse
or script a new mouse using the inputs and block looking around
Someone knows the place where a VON direct speech/message is send and received?
Like what or is there something triggered in script the moment a player talks?
Set a breakpoint in SCR_NameTagData::OnReceivedVON to get an idea of who calls it
But from looking at surrounding code it seems like the player controller has a SCR_VoNComponent.
Yes this is what i was testing with so far.
Will give the NameTag a try.
Thank you.
does anyone know of a method to convert a string hash back to a string?
Send a video or screenshot.
Where does the hash originate from? You should have the original there you can read from
Yeah, I’m using String.Hash() in the script editor console to set enums, was just underwing if there was a method to convert that enum hash back into a string for scripting purposes.
Been looking around and can’t find anything.
Well, hashes are supposed to be one way
Might be missing the point to this also, why convert it to a hash and then back anyways? Just reference it directly
Was just for something really niche, converting a string into a int then converting it back to a string.
This would’ve just eliminated a step for the script and made it easier for other systems that use the variable.
Ahh, unsure as to what is available for that but you'll probably have to make a function that takes the string as an argument, assign the letters to certain numbers and return that
Can you show an example of that?
I'm confused as to why you're doing that.
You should setting enums by either int or string
When using string SCR_Enum has a function to get the value iirc
bassically, I was converting the string into a hash to set a enum as a "string" without actually having a string since that's not possible:
the basic idea was to store the string as a int then convert that int into a string later down the line.
Edit: Was confused as to what he's trying to do.
Maybe i'm confused as to what you're actually trying to do because it makes no sense to me.
Oh, I think I understand now.
You're trying to use enums in a way they arent meant to be used
enum values are ints
Clearly you know that lol. That's why you're trying to have them be hashed strings
Just store your strings in an array, and use the index each has in the array as identifier
yeah, this is the solution im looking for, all praise Mario
What would be the best way to save the player that armed a mine. Im guessing in a component of the mine? Maybe SCR_MineWeaponComponent?
Could always have a map of all the enums with a string tied to each enum.
I just did something similar with vehicle component. I think wherever the script is to place the mine and handling of that. You could mod it to send that info outwards.
Yeah I think Im going with an array of all players who have armed the mine's in the mine weapon component. Im adding XP for disarming a mine and am trying to prevent exploiting the XP by repeatedly arming and disarming. So if the player is in the array, it will not process the XP reward.
With the hash stuff, isn't the number hes getting from hashing his string an int or is it not because of it being negative and/or a larger number than, I believe int32? Looking to correct myself if my thoughts are wrong on this
Or is it because the enum itself is a string which equals an int
It is recomended that he does not use that as identifier as it is very easy for it to collide, on which he will have no power to avoid
unlike resolving collisions in a hash map for example
Hello everyone I've been modeling a scuba tank but have No idea how I would get a script to work with the prefab has anyone got any clue how I could go about doing it?
And the hash method from string API, it is just if I recall correctly
string a;
int hash;
if (a.IsEmpty())
return;
hash = a[0];
for (int i = 1; i < a.Length(); ++i)
{
hash *= 37;
hash += a[i];
}
How and where depends on what you want to do.
What do you want to make it do?
Make it so you don't die under water for a period of time
You want to mod the part of the game that handles that, mod the method that makes it so that you die, and filter it out in there to not do that if you detect that the player is on your scuba tank
Hmmm, that’s a good idea
@minor agate okie makes sense I have no programming experience just modelling and texturing so trying to mod scripts is new to me. I'll try find the file your talking about and sus it out thankyou for your advice king
override
SCR_CharacterControllerComponent::UpdateDrowning()
Make sure in there, that while you are in your vehicle to set as well, and avoid calling the super of it. But do not forget to call super if you are not in your vehicle!
m_bCharacterIsDrowning = false;
Okie thankyou so much @minor agate I appreciate it
modded class SCR_CharacterControllerComponent
{
override protected void UpdateDrowning(float timeSlice, vector waterLevel)
{
if (isPlayerInYourScuba)
{
m_bCharacterIsDrowning = false;
return;
}
super.UpdateDrowning(timeSlice, waterLevel);
}
}
@viscid fiber Although, based on what I see in that method
You can set CompartmentAccessComponent to be water tight
And if player is on that compartment, then this is done automatically for you
So it can be set on Compartment Slot
What prefab should I base it off then you reckon
No, your vehicle has seats right?
For that you must have used Compartment Slots
According to the code here, there should be a Watertight setting
I've seen it on that component
Enable it so that you do not drown if player is in it
Should be a float from 0->1, 1 being completely air-tight
There's another one somewhere then that has a float think I seen it on the brdm2
So I need to make my scuba tank a vehicle ?
No, I think he just assumed you were making a mini sub?> 
The modder way, since Operation Flashpoint 
Yeah
I assumed it was a mini sub
Well
Someone told me actions stop working underwater, that still true..? 
how do you replicate a variable that contains an IEntity? RplProp throws a ton of errors.
trying to sync a IEntity in one of my components to all clients' versions of the component
What do you mean by sync IEntity?
You'd be better off using RplId
[Attribute("1", UIWidgets.ComboBox, "Defibrillator Emulation Type", "", ParamEnumArray.FromEnum(ACE_Medical_EDefibrillatorEmulation))]
protected ACE_Medical_EDefibrillatorEmulation m_EDefibrillatorEmulation;
ACE_Medical_DefibrillationSystemSettings m_Settings;
static const ref array<ACE_Medical_ECardiacRhythm> shockableRhythms = { ACE_Medical_ECardiacRhythm.VF };
// Offset variables
protected float m_fAnalysisTimeOffset = 1;
protected float m_fChargeTimeOffset = 0.0;
// Analysis variables
protected float m_fAnalysisTime = 1;
protected float m_fAnalysisAmount = 0.0;
[RplProp()]
protected bool m_bIsAnalysing = false;
[RplProp()]
protected bool m_bIsAnalysed = false;
// Charge variables
protected float m_fChargeTime = 5.5;
protected float m_fChargeAmount = 0.0;
[RplProp()]
protected bool m_bIsCharging = false;
[RplProp()]
protected bool m_bIsCharged = false;
ACE_Medical_DefibrillatorSoundComponent m_soundComponent;
// Needs replication
//[RplProp()]
IEntity m_patient;
need to send m_patient to all clients for user actions
Use RplId instead
and replicate that
IEntity m_patient;
[RplProp(onRplName : "OnPatientReplicated")]
RplId m_iPatientRplId;
protected void OnPatientReplicated()
{
m_patient = Replication.FindItem(m_iPatientRplId);
}
alright I'll try that. second question:
the call:
networkComponent.RequestDefibrillatorNotification(ENotification.ACE_MEDICAL_SHOCKDELIVERED, GetOwner(), SCR_ChimeraCharacter.Cast(defibrillatorComponent.GetConnectedPatient()));
void RequestDefibrillatorNotification(ENotification type, IEntity defibrillator, SCR_ChimeraCharacter patient)
{
Rpc(RpcAsk_GetDefibrillatorNotification, type, Replication.FindItemId(defibrillator), Replication.FindItemId(patient));
}
//------------------------------------------------------------------------------------------------
[RplRpc(RplChannel.Reliable, RplRcver.Server)]
protected void RpcAsk_GetDefibrillatorNotification(ENotification type, RplId defibrillatorID, RplId patientID)
{
SCR_ChimeraCharacter patient = SCR_ChimeraCharacter.Cast(Replication.FindItem(patientID));
if (!patient)
return;
ACE_Medical_CardiovascularComponent cardiovascularComponent = ACE_Medical_CardiovascularComponent.Cast(patient.FindComponent(ACE_Medical_CardiovascularComponent));
if (!cardiovascularComponent)
return;
IEntity defibrillator = IEntity.Cast(Replication.FindItem(defibrillatorID));
if (!defibrillator)
return;
ACE_Medical_DefibrillatorComponent defibrillatorComponent = ACE_Medical_DefibrillatorComponent.Cast(defibrillator.FindComponent(ACE_Medical_DefibrillatorComponent));
if (!defibrillatorComponent)
return;
switch (type)
{
case ENotification.ACE_MEDICAL_SHOCKDELIVERED:
{
SCR_NotificationsComponent.SendToPlayer(m_pPlayerController.GetPlayerId(), type, cardiovascularComponent.GetShocksDelivered());
break;
}
// add more
}
}
I can't seem to get it to find the ID of the defibrillator entity. it always comes back as -1. what are the things I need to go back in check?
This means that whenever you set your patient ent, you need to find it's RplId
But there is a gotcha
Nothing gets registered into replication unless it needs Rpl
Entities by default do not have rpl layout
So most of them do not have RplID
Safer bet here, is to get the RplComponent one
Then sync that
static IEntity GetEntityByRplId(RplId id)
{
if (!id.IsValid())
return null;
Managed instance = Replication.FindItem(id);
if (!instance)
return null;
RplComponent rplComponent = RplComponent.Cast(instance);
if (rplComponent)
return rplComponent.GetEntity();
return IEntity.Cast(instance);
}
static RplId GetRplIdByEntity(IEntity ent)
{
if (!ent)
return RplId.Invalid();
RplComponent rplComponent = RplComponent.Cast(ent.FindComponent(RplComponent));
if (rplComponent)
return rplComponent.Id();
return Replication.FindId(ent);
}
then on the method I did there
I use those methods for getting RplId of an entity
Do RplComponent instead then GetOwner to get the patient ent
The Component part is just type casting you'd have to change it up to uhh
alright, I'll try to implement the above
oops wrong chn
Yee def will keep it simple for any use case I have, would rather not confuse myself on simpler systems just to obfuscate(which is what I see is the main reason behind this topic)
I can't seem to get to the second breakpoint. First breakpoint is reached on clients fine, but it doesn't reach the ask method on the server. I believe I followed other examples to the T.
The client that requested/tried to send the RPC has to be the owner
Start jamming everything on the playercontroller 
something like this?
Wait are you using an action? You can sort of simplify this and override CanBroadcastScript and HasLocalEffectOnly, Return false for localEffectOnly and false for CanBroadcastScript (I think..?) And that code in the performAction should only be running on the server. Otherwise you'd have to setup multiple rpcs in a component that would go on the playercontroller and use that to talk back an fourth between server/client/client(s)
yeah all the defib actions are on the defib except for one... this connect patient one which is on the character. its what is throwing me for a loop
Well you can do like I said and the action would run on the server, depending what all you're doing it should be... fine..
back to formula
I'd look at the description and functions on the ScriptedAction thing (can't remember name exactly or functions to override)
maybe what was confusing me was I was assuming that actions were local to the client
It depends
Normally when you do an action that you want to execute on a server, you set it so it's not local and check ownership or the dirty Replication.IsServer
Setting CanBroadcastScript to false means it won't tell other clients to also perform that action
Probably safe to still check if authority/owner of the pOwnerEntity to be 100% sure
does CanBeShownScript function in a similar way or is it always local?
CanBeShownScript is local to the client
yeah so that's where the trip up is. I have to check and see if a patient is connected with GetConnectedPatient, but if I call it directly like this, it pulls from the local version of the component which would always be null unless I replicated the entity. All other defib actions have similar checks as well. It seems like my replicated bools and floats replicate fine without any extra stuff, but replicating and entity on the other hand...
So wait what part is failing exactly 
Everything works fine as the authority (listen server) initiating the actions. GetConnectedPatient() always returns null on my proxies. I can't get m_patient on the defib component to replicate to all machines, and if I initiate the connect patient action on a proxy, it will not replicate to the authority's version either.
And this connect option is connected directly to a character entity?
And the Defib component as well?
connect option is not on the defib's action manager. only analyse, charge, shock, disconnect. connect is only on the character
I got everything functioning correctly in SP, and now I'm working MP into it
https://streamable.com/bcch5c - before the refactor and file structure
🤨 I'm bored and this is interesting, if you want we can hope in a call and show me the full chain and I can help you figure it out. I have to see the full flow to understand where to correct 
you got the ACE discord? i have a dev thread on it
I do not 
and call later. its 322am here so I need to get some sleep. just being stumped is fueling my staying up lol
Night time is the best time.. I joined and pulled up the branch 
got a bunch of stuff in prog and not committed, basically moving things down in hierarchy to allow for more extensions later, but the logic is still the same
I created a script that spawns vehicles randomly in a radius, what's the cleanest way to check for collision before spawning (Buildings, objects, other vehicles etc?)
What's the difference between
.SetOrigin
.SetWorldTransform
.Teleport (BaseEnt)
And does all of them called on the proxy where character is local?
or can i make my spawning system favour roads, might make more sense...
"FindEmptyTerrainPosition"
Make them just spawn 1 vehicle then put a ton of spawners around your world in places that make sense
Add one to each garage prefab then every garage in your world can spawn vehicles
I also put vehicle spawners on the repair ramp prefabs
You'll need to use the Teleport->activate physics method used for placing entities in Build Mode to be able to place them on top of non-solid non-terrain meshes though, snaptoground method puts them in the middle of the repair ramp which I guess makes sense given its name 😂
does it have any sense and logic? 😮
thanks for the help!
How would one count all vehicles on the map?
No, Chat GPT or whatever AI you used doesn't know what it's doing.
Also, how about testing it out before posting it here? AI generated script that you didn't bother to test otherwise you'd know it doesn't compile.
also to make things in the editor, you'll have to edit the text file of the layer, adding the entity
SCR_MapMarkerEntity defines the position prop as:
[RplProp(condition: RplCondition.NoOwner, onRplName: "OnUpdatePosition")]
protected vector m_vPos;
I've got some logic in the OnUpdatePosition callback but since this is marked as NoOwner I never hit the breakpoint in the debugger.
What I've done for now is override the EOnFrame function, test if the var changed, and call the callback manually. Is this the right approach for testing?
do you know how to debug your clients using the ports?
No, got a guide?
also to note the other thing is that the workbench instance doesn't trigger the behavior. I'm unsure if this is something that would happen in a real scenario? or if this is unique to how the workbench is set up
well the workbench is the authority when you are using it to debug
On top of this, also with rpcs. It makes no sense to tell the autprity to receive it when it already has it
So those things do not get called on auth
if you go to your peer tool or dedicated server tool, set up your params with a debuggerPort. you can then in the script editor, select custom and put that port in. now your console is linked to that client
ahh amazing thank you. This will be very helpful for debugging another issue
Appreciate it
Is this a typo in SCR_MapMarkerEntrySquadLeader? group.IsPlayerInGroup(playerController.GetPlayerId() == playerId) would be equivalent to group.IsPlayerInGroup(0) or group.IsPlayerInGroup(1) no?
//------------------------------------------------------------------------------------------------
//! SCR_AIGroup event
protected void OnPlayerRemoved(SCR_AIGroup group, int playerId)
{
PlayerController playerController = GetGame().GetPlayerController();
if (!playerController)
return;
if (m_bCurrentSquad == group && group.IsPlayerInGroup(playerController.GetPlayerId() == playerId))
{
m_bCurrentSquad = null;
UpdateToolEntryState();
SCR_MapMarkerSquadLeader marker = m_mGroupMarkers.Get(group);
if (marker)
marker.UpdatePlayerAffiliation();
}
}
Fake news
Does anyone know of a function to get the material the player is standing on/looking at? For example Grass or Sand emat? I know you can get the object the player is looking at .GetPlayerCamera().GetCursorTarget()
It's the reason why i asked - if there is sense into griding this AI with other scripts until it learn 🙂
Or invest the time to learn for yourself so you, ya know, can do it yourself.
you always have to start with scratches - that's what I am doing, need a sketch, now gonna eliminate not logical things and maybe gonna learn smth 🙂
The game has 4 million "scratches" to learn from.
Try starting with something basic and work your way up from there. It's very easy to get "lost in the sauce" with Enfusion when you try to do too much at once especially when you're new like me 😂
@teal vapor if all you need is to see console logs inmediately, just press left shift + ~ and you will see the console in the game itself
For some reason in this map marker mod I'm working on for showing players on map, everything works good... but only after the master client opens their map? Otherwise peers 2 and 3 never get the entities replicated.
As soon as I opened the map however, I see the replication event + clients agree it should now be visible:
18:44:29.289 WORLD : UpdateEntities
18:44:29.289 RPL : rpl::Pip::ProcessNetToGame
18:44:29.289 SCRIPT : Is master: 0
18:44:29.289 SCRIPT : Tag for player 2 should be visible. Global visible? 1
I've also tried just forcing the issue by making them immediately visible regardless of my logic and they still don't work. Player ID 1 needs to open their map first.
Any ideas why the other players don't get the markers synced immediately?
Can anyone elaborate on the difference between TracePosition and QueryEntitiesByOBB? Which should be used when?
All of that literally depends the functionality you wrote.
yeah I know it's a bit hard without seeing the code -- I basically copied squad leader markers and repurposed functionality based on individuals. I was moreso hoping if this is some known caveat of markers or maybe a workbench quirk
No one would really know unless they've tried what you're doing.
the lifecycle of the markers upon clients joining just isn't super obvious to me and unfortunately debugging this specific scenario* is a pain in the ass
oh, found the problem unfortunately. its position doesn't get sent or updated correctly 
is there a guide or write up someone has done on json? im trying to start a small db for storing playerstats and info. ive never touched json before so im lost even after reading documentation. like is there a way to make a json template as a reference for enforger to duplicate?
what's the disconnect? like just understanding json syntax, schema or what?
if you want the "official" JSON docs: https://datatracker.ietf.org/doc/html/rfc8259
Ok so my map marker problem summarized: I was only attempting to call SetTarget() on the marker when it was being created. Since I'm tracking players, sometimes the PlayerControlledEntity wasn't available. Had to double-check and yes I was missing a marker.SetTarget() on player spawn.
The reason why the marker appeared in the corner of the map is because it's the null vector. and EOnFrame had no entity to use for updating positions, so it remained null.
Well using the arma methods etc. json looks pretty simple. Just confused with all the different classes and methods. Like creation and packing of json files. Plus formatting as well inside reforger script. Like having the hierarchy based on one string object. I’ll have a read on that documentation and see if it helps. Mostly just stuck on proper creation, expanding etc. also would a game mode component suffice for having the json file be written server side?
Mostly just stuck on proper creation, expanding etc. also would a game mode component suffice for having the json file be written server side?
I'm the wrong person to ask for this since I just recently started modding but I think so?
Like having the hierarchy based on one string object.
if the formatting of the serialized data is throwing you off, try pretty printing it in your favorite editor or in an online prettery printer. It's just a nested dictionary at the end of the day.
{"key": "value", "key": { "oh look": "another dictionary" } }
Are you manually constructing the data with SCR_JsonSaveContext or a JsonApiStruct? If you control the data structures I'd say just use the latter to simplify things: https://community.bistudio.com/wiki/Arma_Reforger:JsonApiStruct_Usage
Step 1 of json in reforger is dont use JsonApiStruct
SCR_JsonSave/LoadContext can handle Map<K,V> for K=int, string, (ResourceName, UUID -> in the future). It can also handle nested maps
Excuse me, can someone help me please for solve the whole code for me, because I tried all the solutions and did not find a solution
Hi,
I have a menu script that works fine in the editor and offline, but it doesn't open at all on the server. Can you help me identify the issue?
{
if (!m_GarageComp)
return;
int playerId = GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(pUserEntity);
string playerGuid = GetGame().GetBackendApi().GetPlayerIdentityId(playerId);
if (!playerGuid)
return;
PlayerGarageStorage storage = m_GarageComp.LoadPlayerGarageData(playerGuid);
MenuBase menu = GetGame().GetMenuManager().OpenMenu(ChimeraMenuPreset.AGW_GarageMenuList);
AGW_GarageMenuList applicationMenu = AGW_GarageMenuList.Cast(menu);
//if (!applicationMenu) return;
Print(m_GarageComp.GetStoredVehicles(playerGuid));
int x = 0;
foreach(auto vehicle: m_GarageComp.GetStoredVehicles(playerGuid)){
GarageVehicleData vehicleData = vehicle;
applicationMenu.insertContent(vehicleData.vehicle_prefab,vehicleData.vehicle_icn, vehicleData.vehicle_name,playerId,x,m_GarageComp);
x++;
}
//m_GarageComp.LoadCar(playerId, m_iVehicleIndex);
}```
how to use rpl or rpc for getbackend api from server to client
thats good to know, so I could map a resource name as a string and an int as a quantity?
Id uise jsonsavecontext?
yes
id use https://community.bistudio.com/wiki/Arma_Reforger:Serialisation then hey?
im assuming this is what you use to create new entries automatically and recall info from them. oh man.
What TracePosition is actually tracing? If i use callback which just returns "true" it catches entities which are not even within the OBB (as if it traces against entity's AABB instead of geometry/colliders). If i use null callback it doesn't always catches entities which geometry/colliders intersects OBB. I've tried different flags, different layermasks/targetmasks. Last resort asking here.
with "true" callback this already gives tracedEnt wardrobe
with null callback this doesn't catch the wardrobe, though if i put it a bit deeper it catches
How do I get the savecontext to format nicely instead of minified? do I have to run it through a format method?
Snippet from one of my projects
static bool JSON_SaveToFile(string path, Managed data, bool useTypeDiscriminator = false) {
ContainerSerializationSaveContext saveCtx = new ContainerSerializationSaveContext(false);
if (useTypeDiscriminator)
saveCtx.EnableTypeDiscriminator();
PrettyJsonSaveContainer container = new PrettyJsonSaveContainer;
saveCtx.SetContainer(container);
if (!saveCtx.WriteValue("", data)) {
PrintFormat("ServerAdminTools_Util | Serialization of '%1' failed for file '%2'", data, path, level: LogLevel.ERROR);
return false;
}
return container.SaveToFile(path);
}
how can i read or view crash/dump **mdmp **file of reforger?
thank you
You can't but we can. You can send it to me, or better submit a crash report and send id so I can see details all nicely prepared in our crash analyzer
i just ask it for future. I want know is it software or hardware issue when players ask me.
As example here:
21:26:25.807 RENDER (E): func: m_pD3DDevice->GetDeviceRemovedReason()
21:26:25.807 RENDER (E): C:\jenkins\cpu\workspace\continuous_branches_stable_1.3.0\ARGamecode\Enfusion\Enfusion\src\render\enf_rendmainimpl.cpp(3138): enf::RendererImpl::EndFrame
21:26:25.807 RENDER (E): Device removed, reason: DXGI_ERROR_DEVICE_HUNG
21:26:25.808 ENGINE (F): Crashed```
I mean, it looks like the graphics driver/card is having some sort of issue here causing it to crash. If this is on your end, reseat your gpu or update drivers
Hey all, for QueryEntitiesBySphere
How do I filter for vehicles specifically?
You can cast to the Vehicle class and check if null
In your filter method
Got it thanks!
Trial and error 
what is the best path to ensure that the file is in a good spot for server side logging.
Probably in your $profile:logs
mm let me rephrase, for storing a database of player info.
im assuming its best practice to have a seperate json for each player, stored in a stats folder?
EPF seems to do it in profile/.db I'd assume anywhere you have access to is good enough but better to be organized
wondering if I should just move over to epf. probably makes keeping track of stuff way easier.
Definitely makes things simpler but with larger files it seems to cause replication crashes.if you can try to do a more personalized persistence framework
Got this working too, thank you!
Anyone know if there is a SurfaceType equivalent for enfusion?
I would like to know if a position is on a road, dirt or asphalt
You need to get the SurfaceIndex...
// tarmac 1000-2000 | Dirt 2000-2310 | Forest Coniferous 2310-2312 | Forest Deciduous 2312-2500 | Gravel 2500-2700 | Pepples 2700-2800 | Sand 2800-2810 | Beach Grass 2810-3000 |
// Grass 3000-3121 | Grass Tall 3121-3122 | Cropfiled 3150-3152 | DryGrass 3152-3500 | Grass2 3500-3800 | Seaweed 3800-5000 | Wood hollow 5000-5110 | Wood solid 5110-6000 | Metal 6000-6110....
howdy folks! Could someone explain:
/*!
Forcibly enables simulation of vehicle, only meant for cinematics, not to be used in any game logic!
*/
proto external void ForceEnableSimulation();
why it is only meant for cinematics, not to be used in any game logic ?
How i can move vehicle with animation and other things from script? Mb IEntity the only ones option for physic move/or not??? Sry for english, and thank's for advance
Hey,
At the moment, I'm working on a stats webpage that tracks player progress in vanilla server. I’ve already built the full data structure for player saves, but I need your guidance on two key areas:
1-How to control or customize the timing of player data saves.
2-How to track and capture the killfeed data.
When you find out Killfeed, let me know. So far ELAN are the only people able to do it. There is also no Killfeed for vanilla.
Only ones you know of
track and capture killfeed data??
What happened when you asked them
doesnt killfeed data just come from a gamemode component?
They trolled me
Vanilla scenarios do not log who kill who with what tho
ahh
Tell me how 
couldnt you just modify instigatordata to capture the weapon used by the killer when the other player dies. or something similar?
wouldnt that be how they are kind of doing it? capturing the killers weapon or capturing who dealt the damage and with what. I havent looked into anything so im just spitballing.
The trick is vanilla, no mods at all
Can't change anything just gotta use what's available. Maybe there's a trick for more verbose logging
ohhh
How does one get SurfaceIndex?
I am trying to test a config file in workbench but I am having trouble getting them to populate in the profile folder. Any settings that I need to check? I
My guess is server-side code injection to do a server-only mod. Find the engine routine that allows for executing a script from a file -> inject native code into the server process -> execute the engine routine.
but my understanding is this breaks the EULA so...

alright, how do I troubleshoot:
Kick cause code: group=1 'REPLICATION', reason=1 'SYSTEM_FAILURE'
when using dedicated server tool on my clients. I'm assuming I have an error in my replication somewhere, but the replication works fine on a local listen server with the peer tool. Not getting any other logs in console or compiler to go off of.
how to make an automatic detonation timer like a lighting projectile
Only for rockets and Cmponent Rocket Ejector 
do you have something in the search bar?
resolvedf
Can you please help me? I've been asking for weeks in the troubleshooting channel (at this point it's begging) and all I'm getting is ignored... ```
Crash GUID: d5c8d231-428a-4782-9e44-823111790136
Yes there is a certain method to doing that available, but it breaks EULA. So unsure how they would be getting away with it...
I've been down this road before but I gave up on making a stats page similar to ELAN, many other projects to power on with haha
oops thank you
Why does TracePosision of OBB (blue box) picks up this wardrobe? The depth is > 0 but it still detects a hit.
This happens only if I use callback (even with just true in it). If i use null callback there is no detection until the box hits geometry, which is what i'd want.
I've tried QueryEntitiesByOBB but it also gives me false positives.
Is there any way to do union types or make a type nullable in Enforce? I have a prop typed as ResourceName that I would also like to be able to unset back to null but doing so gives me "Incompatible parameter" compiler error
Lots of ways this could be done w/o any mods. Could packet sniff for relevant RPL data (player join/disconnect, kills etc), DLL injection, just dumping and analyzing memory of the game server process
Because it is using aabb of the mesh, which is always bigger
Thanks for the reply. If i want to retrieve all objects within OBB with precision (not their AABB), then without using callback is my only option a recursive TracePosition with null callback? I've just tested it and it seems to mostly work, but it seems a bit ugly and just ...wrong.
maybe a stupid question. Can I spawn an ambient patrol spawnpoint through a SF slot? Or how can I modify the slot script to check closest player and spawn an Explosive effects aroud the player.
for example, I modded the ambient patrol system to make a ambinet explosive system, how can I disable it according to a task state (e.g. destroy a mortar placement).
It is probably that the default callback is doing a bit more stuff to check it precisely, I can check later
ResourceName is a string, so just make it empty
I'll have a look and get back to you as soon as I can
Yeah that's what I ended up doing. So weird though because it's totally happy to initialize the property as null but doesn't like setting to it.
Would feel a lot cleaner if I could just do a union type like ResourceName | Null m_itemPrefab; or if there was a generic type like Nullable<ResourceName> then I could just set it back to null
Would give much better type safety TBH because then the compiler knows that something can be null and warn you if you try to access it w/o null check instead of you just finding out from logs/crashes at runtime
I just looked at call, and if there is no callback, filter entity just return true all the time, so it should not have different behavior, if you return true as well in your callback
Is ProximityTriggerComponent a working trigger? Otherwise, regardless of the distance, it immediately activates. The only thing that breaks it is Safety Distance
Or is its essence triggered by the distance traveled, not by the distance to the ground?
how to use rpl or rpc for getbackend api from server to client?
Great question
Is there a way via scripting to set limits for different vehicle types?
string playerGuid = GetGame().GetBackendApi().GetPlayerIdentityId(playerId);
how yo get in server and send to client?
There is already a library for it, not keen on pushing limits of the EULA
Anyone know why EPF takes a hissy fit when I add a map spawn in pants on the character using the storage slot component?
Is there something else i should be doing?
Send to client from server? Have it ran on a component that is server and send the value to player.
this is completely irrelevant but what's your use-case for the client knowing their GUID?
@fickle ingot
Gentlemen, I'm an aspiring screenwriter here, could you help me? The essence of the dilemma is that I need data on the direction of the cannon (mortar) firing, namely the angle and distance that will be read if the cannon's position changes and a timer signal is sent to the projectile so that it explodes according to the ballast table. The task seems to be clear, but I can't figure out which component to access, I just figured out how to give a certain time to the projectile from the turret to the projectile, I was asked to help, and I just need to write a regular program on a computer, not a script in a game where I don't really understand who is working with what.
That's outside the bounds of this channel and this discord.
https://chatgpt.com/
Fur, I would understand how to write anything at all, but they don't know the whole basic structure of the gods, so I wanted to ask about the small things that the lord probably knows here. Where to get the data on the direction of the sight, mortalinfo and I used a table, but even in no way.
Are you trying to make an external program? Or something in game.
I make a script.
The script from the position of the mortar reads the position, angle, azimuth, distance.
The script then gives the projectile time before exploding, via a timetrigger component.
"I just need to write a regular program on a computer, not a script in a game where I don't really understand who is working with what."
That is, I pointed the gun at 2 kilometers, fired, and the shell should explode as a cluster.
You probably misunderstood me.
I meant that I write mainly programs for office employees.
And I was asked to help with such work experience, in modification.
I'm researching the mother part that was available on the wiki, but alas, there is no reference material for every component, module, class, etc.
The game is the reference material
Yes, open the script every time, and there will be a million more scripts.
Yeah that's how games work
In any case, where do I get the position of the mortar/turret sight to matter?
When I script mortar stuff in my scenario, I just use a waypoint for the target, I believe the calculations are done engine side where we can't see?
This is for ai using the mortars.
Ah, I hope I understood your logic correctly. But I will voice my thought even more correctly.
Let's imagine primitively, I have a mortar in my hands, to put it as accurately as possible Multiple launch rocket system, I aim the sight at a distance of 5,000 meters, at this moment the script works and every time the position of the sight is changed, it updates the data in order to program the missile for a certain time of explosion, so that the explosion occurs in the air, and not in the ground. And thus, checking the data through the ballistics table, he takes the time before the explosion from there and instructs the missile to explode in 30 seconds (conditionally).
SRC_VonComponent::OnReceive() takes a float quality argument that I was trying to examine. I set a breakpoint here but the call stack is just this function so I'm assuming the logic which calculates quality is determined in the native side of the engine?
I would take a look at these two classes: c class SCR_AIStaticArtilleryActivity class SCR_AIGetArtilleryAimDistanceCompensation This is where I do artillery stuff for my scenario as far as aiming and setting a new waypoint. But now that I think about it, I wonder if it would work if you just lifted the target waypoint off the surface and into the air for it to explode above the ground, or if it actually needs to hit something to function? 🧐 ```c
AIWaypoint_ArtillerySupport.et
Heavy calculations for me, I'm a noob in this matter, so the initiator of the explosion will play time trigger, and then a lot of fragmentation grenades will fly out, which, when they hit the ground, begin to explode and scatter fragments.
Thanks for the tip.
I will let you know if it helped me. In any case, maybe the bm-21 cluster will be made faster.
Follow-up on this. Unless I'm mistaken it seems to me like much of the VON system is done in core engine rather than scripts. So let's say I want the server to identify when someone is speaking. I don't think there's a direct method of this that's observable in scripts today? So I think I'd need some component or system to hook m_OnCaptureVON in SCR_VoNComponent and RPC to the server.
Does this align for other who may have looked into this?
VoN is prettry much mega limited and handled CPP side
yeah ok that tracks
I think I can do what I desire by just doing a client-side RPC to the server to notify my script
May i ask what are you doing with the VON stuff?
Yes it is done in game code
OnVoNUsed callback is called on server as well I think
@torn bane sorry for the ping, any idea what I’ve done to cause EPF to explode 😂
Your issue is rather strange, it might be a bug in my code. Please send me a reproduction example in dms
If i want to make something move and rotate with a signal do i need coding experience or is there another way?
No, just create an animation, create an animation variable, and then in AnimationControllerComponent, you can bind an animation variable to a signal, so animation variable value will always be equal to the signal value
does this work for animations made in procedural animations or the normal animations
Attempting some kind of “radio direction finding”
@torn bane what are common reasons why EPF would crash Workbench to desktop with no log on saving data when exiting play mode?
I’ve kinda determined it to not be any of the save data classes, as commenting out the methods within them still produces a crash every time on exiting of the play mode. Using the JSON database format, can provide any other info necessary 🫡
Of course, definitely open to revisiting my save data classes if I’ve missed something and provide code if needed
Those components that are used for the save data are connected to a GameSystem as well, not sure if that effects that
Hard to tell, submitt crash reports and send me guids so i can see why
The crash report submit option doesn’t show on crash, but maybe that’s a thing I’ve set to ignore or something 
I'm assuming you meant SCR_VONController::GetOnVONActiveToggledInvoker? That function doesn't exist
How could I submit a crash report? It doesn’t seem to pop up the option when it does crash
I don’t have any launch parameters set to disable it either
whats making u crash? opening procedural animations?
No, something related to Arkensor’s Enfusion Persistence Framework
Procedural anim editor is broken at the moment and has been for a bit, if I recall
oh i read it now
If the reporter does not open thats unfortunate hmmm. I will need to reproduce it then on our debug binaries. for that please try and collect the necessary setup, zip the exact mod code zip and db used if relevant and make a feedback tracker ticket please
@torn bane I looked over my scripts again and I believe I solved the issue, which was writing any scripts after midnight lmao. I appreciate the help and insight!
Also, I noticed with EPF that the EPF_PersistanceComponent is not added to the Handwear_Base.et prefab and subsequently any inherited prefabs, is there a reason for that?
Assuming you've not had the time yet to look into my server crash guid? This is a reminder if you forgot.
How can I replicate or copy something from a client to the server and server ti client, or broadcast it from the server to all clients, or from one client to all other clients?
IEntity spawnedVehicle = GetGame().SpawnEntityPrefabLocal(vehicleResource, GetOwner().GetWorld(), params);
i use this but only client show
IEntity spawnedVehicle = GetGame().SpawnEntityPrefab(vehicleResource, GetOwner().GetWorld(), params);
and use this but not run in client only server
because gloves did not exist when i made the mod lol. will have to fix that. please make a ticket on my github
So you want to replicate the entity in the end? You'll have to convert the entity to the RplId, send it on the network, then change it back into the entity on the client. I'm not at my computer for another 7ish hours so I can't exactly show you, but I'll link my files for you to look in if I can get GitHub mobile to cooperate.
@red escarp
So when the entity is changed on the server, it will convert it to id, network it, then call the function to convert it back to the entity.
Is there a way to inject code like this into vanilla without needing a packed script?
I assume packed script means a mod, right?
I can no longer reproduce this, I think it was a dodgy clothing mod that I have since removed.
Having an issue with a GameSystem, whenever I unregister a component from it, it throws a Index out of bounds error on my foreach loop, when I don't think it should, unless I'm overlooking something..? Check interval is set to 1 second.
override event protected void OnUpdate(ESystemPoint point)
{
float timeSlice = GetWorld().GetFixedTimeSlice();
bool nullValuePresent;
m_fTimer += timeSlice;
if (m_fTimer >= m_fCheckInterval)
{
m_fTimer = 0;
foreach (CE_ItemSpawnableComponent comp : m_aComponents)
{
if (!comp)
{
nullValuePresent = true;
continue;
}
comp.Update(m_fCheckInterval);
}
if (nullValuePresent)
{
for (int i = m_aComponents.Count() - 1; i >= 0; i--)
{
if (!m_aComponents[i])
m_aComponents.Remove(i);
}
}
}
}
``` Any insight would be greatly appreciated
protected ref array<Material> SlideArray;```
Trying to get emat resoure names into an array by selection them
How do i define the array correctly
Array of resource names, you can restrict selection to materials like this: [Attribute(params: "emat")]
Should also be using array<ResourceName>
And ui widget should be UIWidgets.ResourceAssignArray iirc
My guess would be that it's because you're caching the value of m_aComponents.Count() at the start, then in the loop you're removing entries from that array, which if doing that re-orders the array (unsure if it does that or just nulls-out the value tbh) will mean that eventually you try looping over indexes that no longer exist
Why not just call .Remove(component) on the component directly in the method that unregisters it rather than in OnUpdate?
normal
No on the VonCOmponent
Is it possible that the update method of the individual components could cause the system to be called? Because e.g a new entity is spawned which registers itself? That would mess with the known array indices as you change the array during iteration.
Also the removal of null should not be needed. Register your component during postinit and unregister it ondelete and your system will never have nullptr accesses
Is there something that triggers whenever a player is talking ( Radio or Direct )?
I've already tryed many breakpoints in multiple methodes of SCR_NameTagData and SCR_VoNComponent.
For some reason none of them triggers when using PeerTool and speaking.
I can see the Direct chat icon and everything when talking so no clue how or where to get the speaking event... 
What function can I use to retrieve an object's properties? I'm trying to retrieve an ItemPreviewManagerEntity instance's default render attributes so I can use those properties at runtime for function calls.
All attributes are simple class's members m_AttributeName, but mostly they are protected or private, so you need to find method that returns it or mod your own
},
{
"modId": "5965550F24A0C152",
"name": "Where Am I",
"version": ""
}
{"modId": "5D1880C4AD410C14"},{"modId": "621D3771875C1D3D"},{"modId": "5E0AB16BEB16D6A4"},{"modId": "625113D08F47AB6C"},{"modId": "622120A5448725E3"},{"modId": "61C93085D1BECD63"},{"modId": "5AE50EC5B8D6F4AE"},{"modId": "62EAD0E26762CE0F"},{"modId": "629B358C38E73FB7"},{"modId": "5CCCC1DFB9C93581"},{"modId": "5C961A93A16EB866"},{"modId": "5E389BB9F58B79A6"},{"modId": "5E193315C8E82019"},{"modId": "5AAF6D5352E5FCAB"},{"modId": "5CF0C3158AB2337E"},{"modId": "5965550F24A0C152"},{"modId": "6243491A7D2ACCFD"},{"modId": "5B383D4CB27E0D54"},{"modId": "629B2BA37EFFD577"},
{"modId": "5C721177A220B42F"},{"modId": "5DF42518F3C3210D"},{"modId": "5F244258B6AD0AB4"},{"modId": "64F869693699EEA7"},{"modId": "64D6B51E4CA6CF65"},{"modId": "6108BB22767D4D58"},{"modId": "606B100247F5C709"},{"modId": "6276E6E3CC97A22B"},{"modId": "60ED3CC6E7E40221"},{"modId": "61F62542BF6DBA74"},{"modId": "5A78300A9F2D7A65"},{"modId": "64B063B94348F5C8"},{"modId": "647978F120DCFE12"},
{"modId": "60CAFAA76E027A42"},{"modId": "64511E38125A67B6"},{"modId": "6334E929FA792895"},{"modId": "6303360DA719E832"},{"modId": "63120AE07E6C0966"},{"modId": "5E0AB16BEB16D6A4"},{"modId": "61957C5C6FB7A773"},{"modId": "61A2FDEE636A1CD8"},{"modId": "60629E954144D73F"}
I need help this is driving me crazy
Is there anyone that could show me how i Connect a Action to a animation?
im trying to create a bridge and both the Open/Close animations work, i just cant seem to figure our how to connect them to a action
Pretty sure at minimum you also need the name, although it can be anything. Version you can leave off for sure.
This is also not scripting. #reforger_servers would probably be better for this
name is optional
Just read error message, it contains all you need
OnCapture and OnReceive for VoNComponent, both triggered for me
I’m getting this error when launching my server. Anyone know what it is?
Can't compile "Game" script module!
scripts/Game/UI/RadUI/HCA_RadUI_HUD.c(1343): Overloaded function 'AddElementsFromCategory' not compatible
Runtime mode
Just script error in one of mods that prevent scripts to compile
Line and file where is error - you can see in message
Where can we make suggestions for improvements to an API? ItemPreviewManagerEntity has some serious limitations :/
It does everything it needs to do...
It's member instance of PreviewRenderAttributes is not exposed. Which means the only way to modify it is to pass in a custom one... but guess what there's only 3 exposed methods on PreviewRenderAttributes... So no it doesn't do everything it needs to do.
You get the PreviewRenderAttributes from the prefab or the entity. You're supposed to be passing it a custom one.....
The values from the entity are not being used when loading the model to be previewed via script.
In the script you showed in GUI, you're not even passing PreviewRenderAttributes to the function. So of course not.
You shouldn't have to, it's a property of class.... And even when I pass in a custom PreviewRenderAttributes you only have the ability to change the rotation and the fov... Not everything else. What about distance to item like the prefab is able to do? What about dynamic objects like the prefab can do? What about animation instances? Not seeing your point.
Anything that is gonna be "previewed" is expected to have PreviewRenderAttributes in it's prefab already set up. Not sure what is so hard to understand about that.
I don't think you are comprehending the problem, thanks for trying though.
I'll just submit the ticket as I was planning to before you interrupted. Thanks!
Is it possible to override the attributes of the map gadget component? I haven't done scripting in Reforger before, but I know what I want to change.
I'd just like to change a couple attributes in the SCR_MapGadgetComponent.c
I found the Wiki for it, all good now.
Only thing I'm curious about is if you can change Variable Values in a Modded Class, or do you need to make a new variable and override the methods they are called in to use the new variable?
Especially if it is protected?
Has anyone ran into issues with IEntity::SetYawPitchRoll() recently? Probably since 1.3 release? Does it need to be replicated now?
Are those triggering for you while speaking or whenever you enable or switch a chat channel like from radio to direct?
You tested in PeerTool right?
Yeah, I'm pretty sure 1.3 messed it up.
It seems to be pretty random when it wants to work
Is there any way to debug malloc(): invalid size (unsorted) error on dedicated server?
Yeah I'm wondering if it's maybe an RPL issue as I am unable to reproduce it at all in WB/Peertool and it seems to happen more often on dedicated servers I have high ping to
this bug is some spooky poltergeist shit 😄
Whatever triggers this issue with SetYawPitchRoll also seems to be breaking SnapToGround from working on the same entity
It also seems specifically related to weapon entities, other stuff like clothes and tools are rotating and snapping fine
classic WB 😄
gotta finally start testing with dedi right away
yes both triggered for radio and direct speak, and yes its peertool
Alright many thanks. 👍
May i messed something up with my mic or anything.
Yeah i believe you.
Thank you for proving me anyways. 🙂
Highly likely my fault...
I've got PeerTool working the first time just couple days ago.
So yeah still many parts for error from my side.
Do i need the knowledge to Code if i want a action to execute a animation? i created a prefab with a animation and it works, i just dont know how to connect it to a Action (Pressing F something to Open/Close the animation.
how to SpawnEntityPrefab only in PerformAction i need use in any method not only PerformAction
how to send it on the network?
Does anyone know a way to check, if the local controlled entity is reconnected or connected the first time.
Did you watch the bootcamp videos on replication
Can anyone from BI say if there are any plans to make BaseLoadoutManagerComponent scriptable or support variant randomization on the item prefab slots?
You can't inherit that component to your own class for modification?
It doesn't expose any component lifecycle methods to override and trying to set a constructor gives some error about overloading even though I'm pretty sure I used the correct method signature
or maybe I'm just doing something wrong idk
I'm trying to find a way to check if a position is inside a building (=inside the building walls). If the buildings were cubes, the bounding box would work but that is not reality.
Oh wait there are more args on the prototype that compiler unhelpfully decided to not tell me about
yes i watch the videos Replication and Advanced Replication 10 times but my brain doesn't understand it
please someone give me example for client press button in ui after this spawn vehicle
client press button after press send to server Because server only can spawn
https://community.bistudio.com/wiki/Arma_Reforger:Multiplayer_Scripting
You either make the value you want replicated an RplProp or you manually pass values in Rpc to a method
It sounds like you want to do an Rpc from client to server, read the linked wiki article section on Rpc method
okay i have methode spawn vehicle but player in performeaction can be spawn in this method cant
okay how to give client ownership or authority
I'm gonna change my script editor font to comic sans again
RplComponent.Give / GiveExt but if doing it on something that is already meant to be owned by server or client transferring ownership could potentially cause weird side effects breaking other stuff so you might wanna avoid if you're overriding something that already exists
Minecraft font
Post what you have so far
I want to make a series of missions where destroyed cities will remain as such in the following scenarios.
Does anyone have any ideas on how to get the state of buildings, trees and other objects?
Hm, does server saved session contain destruction info?
spawn from server is very good but in client not spawning
i am soo bad in Replication in arma reforger and Unreal engine all good but Replication
What does your code look like so we can help?
Could someone tell me Where the connection is between a open/close Door action of a vehicle And The Animation? For example: action: "door_l01" must somehow be connected to this
Is there a script that executes this or something else? so yes, what is the script called?
this vehicle is s105
I know there is a VehicleAnimationComponent, but this still doesnt show the direct connection between the Action (Pressing F on something to open/close) and the animation
wut dis dooo
2spoopy4me
Shiver me timberlands, its an attribute without a description 
in the vehicle's SCR_BaseCompartmentManagerComponent, door_l01 is gonna be the PilotCompartment, and looking at the compartment action with it, so SCR_GetInUserAction.
Within the action script, line 44 under PerformAction, it's an engine-side method called GetInVehicle() with multiple options with it, so must all be engine-side specifically
i dont want to enter the vehicle im only trying to find the connection between door_l01 Action (Opening/Closing) And the animation
so then SCR_OpenVehicleDoorUserAction I believe
CompartmentAccessComponent::OpenDoor() line 39 of CompartmentAccessComponent.c script
Other than setting the door index and ECharacterDoorAnimType, I think the actual connection is behind engine
Yea thanks tho, was hoping this was a bit easyer haha
Dind think i needed the coding experience to run a animation when pressing F on something 😭
Are you making a new vehicle? Or what are you trying to achieve exactly?
Also, take a look at https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~ArmaReforger:Configs/ControlHints/AvailableActions.conf , specifically under actions. it might lead you somewhere
Trying to make a simple bridge I wanna press f on something to that it will open/close i already have both the animations and they work i just dont know how to connect them to a actionhttps://imgur.com/a/DtzwC5Y
Simplest way would be a custom ScriptedUserAction, with a button or something that has the action context
Also that link u send dind work
Top-left of the main Workbench window, press Workbench, in the window pop-up, click Workbench at the top, then down at the bottom of the window, press Register "enfusion://" Protocol
then retry the link 😄
its no longer giving me a error message but the screen is just grey lol idk if firefox is supported
it'll open the file in Workbench after confirming it's okay to in your browser, so check there. Firefox should work because it does for me
ooh now i see haha
But I wouldn't even pay attention the the config file I sent the link for. I would just look at how ScriptedUserActions are done in script
I guess this isnt for me its like looking at chineese characters
But thanks for ur time 👍
No problem!
Things can only be spawned by the server.... Unless you're spawning locally which has no merit for much in a multiplayer environment.
i need how to use SpawnEntityPrefab
in client
You don't, if want to spawn a vehicle. The server has to do it.
okey but i have menu for spawn vehicle and this menu get from file
in client how to send to server vehicle prefab and server spawning my prefab
prefab from client after this give to server after this spawn
Why do you need to give anything from the client?
client have prefab name to spawn vehicle
but i use SpawnEntityPrefab in preformaction is good
after this i use SpawnEntityPrefablocal not good
I don't need in action
I don't need it from the action because I have a function. This function brings me the name of the car from the client side
after this i need only spawn to all player
in my function i use SpawnEntityPrefab give me null or not spawning
after this i use SpawnEntityPrefablocal not good spawn in client only not all players
i need give client Authority for spawn vehicle
Trying to dress up a character spawned into new world, but SCR_CharacterInventoryStorageComponent.FindSuitableSlotForItem returns NULL
If I run identical script but without new world, its all fine and slot returns
I thought I'm missing some world entity in preview world "{4391FE7994EE6FE2}Prefabs/World/Game/InventoryPreviewWorld.et" but using other worlds doesn't help it.
Any tips what could be done? The character I'm using is "{836E7E39AAC5888B}Prefabs/Characters/Factions/BLUFOR/US_Army/Character_US_Base.et", the uniform is "{EB0D74A43F74B522}Prefabs/Characters/Uniforms/Jacket_Denim_01/Jacket_Denim_01_strippedShirt.et", as I mentioned it all works properly in the main game world.
Why does the client have the ResourceName but the server doesn't?
Are you trying to dress them in the same method call/frame that spawns them?
I'm doing something kinda similar atm giving AIs randomised slots upon spawning and have found it to be super race condition-ey to whether it works or not so am thinking might need to defer interacting with inventory components long enough for them to fully initialise or something
No you need to send an Rpc from the client to the server asking the server to spawn a vehicle, you can pass the ResourceName selected by the client in the Rpc, the server then loads and spawns an entity with that name
I'm still concerned as to why the client knows the prefab and the server doesn't
Hmm, gonna try some with delay. Its all instant if character is spawned into main game world though
Yes. I know there are better ways to do it, like making a full character prefab with all needed gear and spawn it instead, but I'd like to know if I can script it from ground up.
Isn't that what Bacons thing does?
Nope, no luck:
SCRIPT : IEntity m_Character = SCR_ChimeraCharacter<0x00000210F16911B0> @"ENTITY:15" ('SCR_ChimeraCharacter','Assets/Characters/Basebody/Basebody_Male_01.xob') at <0.000000 0.000000 0.000000> @"{836E7E39AAC5888B}Prefabs/Characters/Factions/BLUFOR/US_Army/Character_US_Base.et"
SCRIPT : IEntity m_Uniform = GameEntity<0x00000211170EFAB0> @"ENTITY:19" ('GameEntity','Assets/Characters/Uniforms/Jacket_Denim_01/Jacket_Denim_01_item.xob') at <0.000000 0.000000 0.000000> @"{EB0D74A43F74B522}Prefabs/Characters/Uniforms/Jacket_Denim_01/Jacket_Denim_01_strippedShirt.et"
SCRIPT : InventoryStorageSlot slot = NULL
SCRIPT : --- 10ms delay ---
SCRIPT : InventoryStorageSlot slot = NULL
Getting the slot:
SCR_CharacterInventoryStorageComponent inventory = SCR_CharacterInventoryStorageComponent.Cast(m_Character.FindComponent(SCR_CharacterInventoryStorageComponent));
InventoryStorageSlot slot = inventory.FindSuitableSlotForItem(m_Uniform);
Print(slot);
What thing? Gonna search it now.
Btw I tried just providing slot id (1) into the TryInsertItemInStorage but it fails, so slots aren't initialized at all, thus my assumption that world needs some entity that does something
I guess its Bacon Loadout Editor, gonna check it out
Oh if you're trying to equip uniform pieces I think SCR_CharacterInventoryStorageComponent is just for putting items in storage of your inventory slots (e.g. inserting into pockets or backpack) but not for actual clothes on the character. Equipped clothing is all managed in BaseLoadoutManagerComponent afaik
So it would make sense that returns null on a character without any clothes yet since they don't have any inventory slots
EditablePrefabsLabel_CharacterRole::CheckLoadout has some logic for reading slots from BaseLoadoutManagerComponent which is what I've been basing my thing on
It works in the main game world though, with the same code 🤔
oh wait nvm i was thinking of SCR_InventoryStorageManagerComponent is the one for inventory management but it also looks like that has a bunch of game code methods for equipping gear like EquipCloth / EquipWeapon as well
reall doesn't help there are like 8 similarly named classes that all appear to do similar or the same thing until you try using them 😄
Help me, I've been struggling with this stuff for a week.. WHAT SHOULD HAPPEN IS that the ROCKET explodes at the appointed time through the ballistic table, but either it happens that the rocket does not explode or, on the contrary, explodes automatically through the timer trigger (if the value is 1, then the explosion occurs after 1 second).
Why does SCR_InventoryStorageManagerComponent.EquipWeapon() attach it to their feet?
that's not how you equip a gun
Because its only related to inventory holding of it. Equipping it is done via CharacterControllerComponent right hand methods. This assumes the weapon is already in inventory then
hey guys, is there a way to hide a string in the project so no one can see it ?
No. Load it via fileio from $profile:secret.txt or System.GetCLIParam
Ah ok so I need to call this first to put it in their inventory then CharacterControllerComponent::TryEquipRightHandItem to actually equip it in their hands? Thanks mate will give it a go
what is System.GetCLIParam?
Method that allows you to access to startup parameters
So you can define you own -myparam ABC and use it via this method
where do i add this params
server.exe -param ABC
that worked beautifully thanks Arkensor ya legend
I feel threatened by this image
Why are you enabling this 😆
QueryEntitiesToRemove = {};
// server only
RplComponent rplComponent = RplComponent.Cast(owner.FindComponent(RplComponent));
if (rplComponent && !rplComponent.IsMaster())
return;
BaseWorld world = GetWorld();
world.QueryEntitiesBySphere(owner.GetOrigin(), m_fRadius, QueryEntities);
// Removes all entities. This is a hack, until the original SCR_PrefabDeleter works correctly
foreach (IEntity e : QueryEntitiesToRemove)
{
SCR_EntityHelper.DeleteEntityAndChildren(e);
}
// destroy self
delete owner;
Hey guys i updated the SCR_PrefabDeleterEntity Pre.1.3 which there was no problems at the time and worked as intended. Now there is a JIP replication error after 1.3 as seen below:
15:38:56.919 RPL : rpl::Pip::ProcessNetToGame
15:38:56.919 RPL (E): IReplication::JIPError: Inconsistent item table on Slave connection. Item is missing or different item was loaded in its place. (item=0x40006959 layout=ChimeraAIWorld)
15:38:56.919 RPL (E): Expected:
15:38:56.919 RPL (E): cpp_layout=_GenericEntity_Layout
15:38:56.919 RPL (E): s_layout=script::Game::PS_GameModeCoop
Any ideas how to fix this?
delete owner
I'm not sure that this is a good idea
This is from the vanillla one i hadn't changed
There are valid uses for it. If it is used for malicious purposes or against our EULA he and his mods are simply banned. I saw the report from you already and we will have a look 🙂
I usually answer questions regardless of who asks. So I saw only now.
It wouldn't be causing the RPL error right?
Either way at that point of the line the script is done and wont run again
they were getting payback on me for all the times I spawned them with a gun stuck to their feet 😄
🫡 calm response, appreciated thankyou
Also i struggle to understand this part:
// server only
RplComponent rplComponent = RplComponent.Cast(owner.FindComponent(RplComponent));
if (rplComponent && !rplComponent.IsMaster())
return;
Anyway, make sure you code is running after loadtime and entity itself is runtime (or at least do actions both on server and client)
override void EOnInit(IEntity owner)
It runs on EOnInit
You would want to remove the remover entity the same way you do the found entities. Not by calling delete directly. As that indeed messes with replication release of it
It would even be fine if it was during load time as long as it removes the same entities for every client. Which usually should be the case unless there is an object on the very edge of detection spere due to floating point issues. So ideally your query sphere should always be a tiny bit larger than the furthest away object you intend to remove
If your "deleter" has replication and machine isn't authority+owner then don't do anything, otherwise it may brake something
Authority here being the server?
Authority is where entity is created
It also may be client, but in this case it will not be replicated to anyone else
I mean from this prespective EonInit is set spo that covers that part and (If I understand you explanation correclty it is running on both the client and the server?
reading this again my deleter does not have a RPL Component
It will be called where entity is exists, so if entity is placed in worldeditor or replicated, then it will be called both on server and client
So your deleter will be called everywhere
If placed in worldeditor
And because of EOnInit it will be during loadtime, so if you delete some entity on client and not delete it on server or delete on server and not delete on client - you will get JIP error
What is a better point to do this then? other EonInit
You just need to somehow strictly "define" what and how you delete
To make sure that taken actions for clients and server are same every time
Use a system 🤓 worked without a hassle for me when I used it the first time today
Well i query by sphere and then delete every object returned by the query , i cant see how its executed differently
Starting to have good docs as well
Also mb it will be better to delete in next frame rather than in EOnInit
but Arma xD
#enfusion_scripting message - read about floating point issues
Also I'm don't sure if all entities is initializing in same order
So mb on one side some entity is exists later then you code, so on this side you don't delete this entity
So it would better lets say that i make the server run the query generate the list and then that list is executed by everyone else
rather than each client doing the query
Figure why your deleter is delete differently on different machines will be enough)
Transferring entity Ids from server to client is easy way, but not better)
EOnPostFrame is this what you mean my next frame
As the EOnFrame is every frame which i think is not something we want
@pliant ingot EonFrame did not work i randomly tried EonActivate that worked any idea why or what
by worked i mean the client did not get a RPL kick
EOnActivate may be called after JIP check, so if it's still doing something wrong it will not generate error
Looking to skip the Animation Finish Event Sync in the Gadget Manager Component.
Making a Faster Map Opening Mod, and I removed all delays aside from when Gadget Mode Syncing happens via Animation Event. Map opening is snappy in gamemaster, but not when controlling character.
Trying to skip the wait for animation and looking for a little help.
CanChangeGadgetMode() and SetGadgetMode() are the methods I figure have to do with it.
kinda going crazy trying to find this base game functionality,
what controls the visibility of supply crates on vehicles????
Like the physical crate? Or the inventory?
the physical crate
SlotManagerComponent has the crate storage slots
yes so when you spawn a humvee, you can see the crates, but when you hit play the crates disapear, what controls this?
Just so I'm clear with it, if I attach a entity to a slot via slot manager and then I'm not able to interact with my actions on the child entity. Would this be because the new child attached is not the owner?
If so, is there a way to essentially make it a 'dummy parent' or something?
ResourceComponenet
SCR_ResourceComponent if you disable it to test, you'll see the crates appear and stay
The issue was WB yet again
Now TryInsertItemInStorage returns true but item doesn't actually gets equipped 🤔
Slot is there, command returns true, not specifying the slot (-1) has no difference. Running Update() on the character or cloth item does nothing 
TryInsertItemInStorage doesn't help it either
Testing in both fresh WB and using peer tool client
I'm looking for the Method which calls Gadget Activation after the Input?
Not able to find it. Makes me think an Animation Event Calls it, but can't find that either. Particularly for the Map Gadget.
Odd question, are you spawning in the entity prefab to then be equipped? Because if so, the entity has to be spawned in the network bubble of the player to be inserted into the inventory properly
Yes. I'm using SpawnEntityPrefabLocal on both the character and the clothing item inside separate game world though, not sure how this logic could apply there.
Hmmmmm, I’m not sure when it comes to separate game worlds, I’ve not touched SpawnEntityPrefabLocal specifically, as well not at my PC to look at what it does and see examples properly to give you an idea. I’ll try to help more when I wake up if it’s still an issue you’re having
Under the diag menu there is an inventory section that allows you verbose logging of any reason why inventory might have failed to do something. The Try methods on replication environment only return true if they could send off their RPC, it could still fail on the server
INVENTORY (W): Call not allowed, wrong data provided
Doing these commands as server
Also tried another way, spawning a prefab with loadout items already on it, can't get the helmet and the vest to update even doing m_Character.Update(); each frame.
Is there a way to Shape.Create on stable?
What's with "Goto Declaration" randomly not doing anything? Is there a trick to it?
Damn, I wonder how you reached that part. It may be that the local items are a problem. The inventory system is generally replicated, so perhaps it failed to read it. There should have been an assert Wrong replication data provided if you were doing it in diag workbench. But I bet it works as soon as you try with proper replicated items. There should be a way to do it though, you should check the loadout previews in the respawn screen and see how they do it. I believe those are locally spawned
Sometimes it just gives up, it is just buggy
Shape draws are diag apis so only use for workbench and diag client
So to draw say object's bbox in stable i would have to use something like model with semi-transparent textures and scale it accordingly?
Is there a trick to getting actioss on a child prefab to show after attaching it in runtime? The contexts are still their, but the actions move to the parent entity? It's like pointinfo is being ignored
Tried with SpawnEntityPrefab as host, same error, same picture.
Show your code please
Make sure parent and child have same actions/names/points
And check the allow cross hierarchy
I found that it only works if the xob’s have the same memory points, if u are creating them in engine it won’t work
Physics.EnableGravity(false) doesnt work on vehicles
SCRIPT (E): Virtual Machine Exception
Reason: Attempted to call persistence operation before setup phase. Await setup/completion u
Anybody know where to point me for this EPF error? I broke it somehow in the last couple hours didn't even touch it, but touched character_base prefab for some other things.
SCRIPT (E): Virtual Machine Exception
Reason: Attempted to call persistence operation before setup phase. Await setup/completion using GetOnStateChangeEvent/GetOnActiveEvent.
Class: 'EPF_PersistenceManager'
Function: 'CheckLoaded'
Stack trace:
Scripts/Game/EPF_PersistenceManager.c:700 Function CheckLoaded
Scripts/Game/EPF_PersistenceManager.c:259 Function FindPersistenceComponentById
Scripts/Game/EPF_PersistenceManager.c:249 Function FindEntityByPersistentId
Scripts/Game/Entities/Character/EPF_CharacterControllerComponentSaveData.c:191 Function OnGadgetInitDone
Scripts/Game/Components/Gadgets/SCR_GadgetManagerComponent.c:931 Function RegisterInitialGadgets
Scripts/Game/Components/Gadgets/SCR_GadgetManagerComponent.c:1087 Function InitComponent
Scripts/Game/Components/Gadgets/SCR_GadgetManagerComponent.c:1252 Function EOnInit
RENDER : RENDER : ObjectsHeightMap::Build
set a delay or wait until gamestart
On what? It's not my script just the default one do I still need to?
You are not modifying anything?
Nope. I was messing with a HUD layout with widgets from metabolism asset, but I deleted my override and its still happening.
Wait I just found another one
No luck. I may just delete that mod and re-add it. I know it adds an entry for saving in the epf
Maybe delete the database files in profile
Hello! I'm trying to create a capture logic system for my Arma Reforger scenario. I'm using ChatGPT to help, but I feel like sometimes it gives me solutions that don't actually exist or aren't supported in the game.
I've created a generic entity, renamed it, and attached the script below. But I can't get it to activate in-game. It tells me to go to SCR_ScriptComponent and Script File, but I can't find those options.
Can someone tell me if I'm doing something wrong or completely off track?
Chat gpt will have u debugging things 90% of the time unless you train it correctly
You need to have some understanding of the game script in order to even instruct it correctly
It's hard to know where AI is going wrong if you don't know the subject matter you use it for
It's not a shortcut to scripting
it's not the script itself that's wrong — I followed all the steps it told me to do. I feel like I'm on the right track. The only issue I have is that I can't get my script to activate so it can run my capture logic for the PvP scenario.
Anyone know if you can you get the spline data (path along) roads during runtime or do you cache the data that you get about that with world editor / workbench scripts? I want to spawn stuff randomly on the side of the road. Obstacle detector stores something like that. The other stuff I see for GeoJSON is maybe close to what would work and is running in as a world editor / workbench script. Crossroads may be available, but you would still have to do scan / trace to see where the rest of the road is, and it's hard to track that on the fly. The RoadNetworkManager doesn't seem to have much except where the roads start.
make a generator that spawns the prefabs you want and add it to your splines
u can add multiple generators to splines\polylines
Would this be moddable without needing to mod the specific map?
no, as you would have to have access to the splines in order to add more generators as children
the way around that would probably be what Lochleg was talking about where you would have to pull the spline\polyline data and then spawn your stuff
ty, that helps a lot
When/How does this get called for Gadgets?
The Callstack starts here when I breakpoint.
https://youtu.be/KjCKfzCB7Co?si=50n-b7bQLhTQev98 @tough cave
Grâce à la "Spline Shape Entity", on reboise la map et on crée en quelques clics une forêt super dense !
Where should I be creating my scripts for a project? Right now inside my project folder I have it in a Scripts/Game and dumping them all in there. Is there any recommended convention?
example
scripts/Game/addonNameHere
subfiles:
Components - for components
Helpers - for other stuff that helps components
Network - for notifications and such
Settings - for settings for your systems etc
UserActions - user action stuff
try to kinda follow the workflow of the base game for organization
Perfect, that's really helpful thanks.
Hey guys any idea why when players leave my server they are stuck on the loading screen and need to close their entire game?
Hi! Any one knows how to make yourself, your team members and squad visible for the player on the map?
Is there some tweaks in the workbench for that already?
scripting only
there are 2 mods for making urself visible on the map on the workshop
ones called "Where am I" and the other one is actually mine, called "YouAreHere"
for squads idk if theres one publicly available
Oh okay thanks!
I need a script to undermine the height of the Terrain
im sorry but this is a discussion channel not a „I need this“ channel
I'll give that a go, thankyou
i have same issue =\ cant figure it out
SharedItemRef m_WorldRef = null;
BaseWorld m_World = null;
void PreviewTest() {
RenderTargetWidget widget = RenderTargetWidget.Cast(GetRootWidget().FindAnyWidget("RenderTarget0"));
// World
m_WorldRef = BaseWorld.CreateWorld("PreviewWorldTest", "PreviewWorldTest");
m_World = m_WorldRef.GetRef();
Resource rscWorld = Resource.Load("{4391FE7994EE6FE2}Prefabs/World/Game/InventoryPreviewWorld.et");
GetGame().SpawnEntityPrefab(rscWorld, m_World);
// Cam
m_World.SetCamera(0, "0 0.9 -2", "0 0 0");
m_World.SetCameraVerticalFOV(0, 90);
m_World.SetCameraType(0, CameraType.ORTHOGRAPHIC);
m_World.SetCameraNearPlane(0, 0.001);
m_World.SetCameraFarPlane(0, 4000);
// Character
Resource rscChar = Resource.Load("{836E7E39AAC5888B}Prefabs/Characters/Factions/BLUFOR/US_Army/Character_US_Base.et");
IEntity char = GetGame().SpawnEntityPrefab(rscChar, m_World);
char.SetYawPitchRoll("180 0 0");
char.Update();
// Cloth
Resource rscUniform = Resource.Load("{EB0D74A43F74B522}Prefabs/Characters/Uniforms/Jacket_Denim_01/Jacket_Denim_01_strippedShirt.et");
IEntity uniform = GetGame().SpawnEntityPrefab(rscUniform, m_World);
uniform.SetOrigin(char.GetOrigin());
uniform.Update();
// Wearing
SCR_InventoryStorageManagerComponent storage = SCR_InventoryStorageManagerComponent.Cast(char.FindComponent(SCR_InventoryStorageManagerComponent));
SCR_CharacterInventoryStorageComponent inventory = SCR_CharacterInventoryStorageComponent.Cast(char.FindComponent(SCR_CharacterInventoryStorageComponent));
bool test = storage.TryInsertItemInStorage(uniform, inventory);
Print(test);
// Render
widget.SetWorld(m_World, 0);
}
INVENTORY (W): Call not allowed, wrong data provided
SCRIPT : bool test = 1
Okay you just do not see the assert, strange, I thought those are enabled on diag workbench. Yes it will refuse to do any inventory operation on items which do not have a replication setup. It finds a rpl component on the item but it has no valid ids assigned
This approach won't work no matter what you do then. Best to see how the loadout selection preview screen did it. I do not know and lack the time to dig into it for you right now, but it should be all in script
Thanks for the answer, I guess I'll have to do it another way
Trying doing it another way, having all gear already in place on the character prefab, but I can't get the gear to update its position to match the character.
Yes ideally you do it all on the prefabs and not dynamically. For clothing items to be correctly worn you need to add them on the right components. base loadout component is the main subject. do not attempt to insert directly into storage component slots. Only weapons in hands etc will not show as you might want to
Spawning "{4FBA24F7BB43E17D}Prefabs/Characters/Factions/BLUFOR/US_Army/Character_US_Sergeant.et", can't get items to animate
Tried going through all storages, getting all IEntity items from them and running .Update() on them to no success
Continous running of .Update() on the characte doesn't help it either
Spawning a car and it properly animates its parts with .Update() though 🤔
How can I send a message to the chat window when player killed AIs, e.g., Player A has killed 5 AI without death. Which tutorial and class should I check?
Create some counter somewhere for each player and store killstreak there, like a map indexed by player id
Increment it inside onplayerkilled ondestroyed of a character editable entity component I think
Or I guess player id could be extracted from instigator data somewhere
Hi, i would like to make an entity with action, that is triggering read form database. It is possible to access data on server-side and set it only to client that executed the action ?
or for startes, any data, not even db
TY. I find something inside notification sender components, and it sends killfeed with the editable Entity ID.
I know 😄
So I've got a script that runs on the server and I'm trying to use the built-in SCR_HintManagerComponent to make a hint appear on the client. It appears though, that I need to do something because it's returning null because it's running on the server. Do I have to do some sort of RPC from server to client to make this work?
Yerp
In which case, where do I write the script for this / where do I give this to the player? I guess it's in a player prefab or something?
Is there a reason Breakpoints don't go off on the Radio Components? Tried setting some for Toggle, Change Frequency, ect, and never fired off.
Regarding the collision between two entities. Is there a way to disable them (Character and a vehicle).
I've tried using the PhysicsBlock and also to set the interaction layer : m_CharacterPhysics.SetInteractionLayer(EPhysicsLayerDefs.CharNoCollide); but it doesn't work so far.. I don't know if i'm just misunderstanding the way it works or what's happenning. Any help would be appreciated..
My code :
[RplRpc(RplChannel.Reliable, RplRcver.Owner)]
void DoRpc_EjectClient(EntityID entityId)
{
IEntity entity = GetGame().GetWorld().FindEntityByID(entityId);
if(!entity)
return;
IEntity playerEntity = GetGame().GetPlayerController().GetControlledEntity();
ChimeraCharacter character = ChimeraCharacter.Cast(playerEntity);
CompartmentAccessComponent seat = character.GetCompartmentAccessComponent();
if(!seat)
return;
// disable collision with the vehicle
m_CharacterPhysics.SetInteractionLayer(EPhysicsLayerDefs.CharNoCollide);
seat.GetOutVehicle(EGetOutType.TELEPORT, 0, ECloseDoorAfterActions.INVALID, true);
// Enable the collision after a second
GetGame().GetCallqueue().CallLater(EnableCollision, 1000);
}
Are there any tricks to getting PeerTool to behave nicely in the CTI_Campaign* maps? The slowest part of my iteration loop at this point is the PeerTool client getting dropped with Another connected player with the same identity found.
works fine consistently in the coop campaigns which has me wondering if there's some component added to the CTI world that's causing this
@torn bane i use your project but cloth in bots not wearing
Would there be a place to request Modding Feedback from Devs?
Wanted to ask about having the Radio Component, and Transceiver Script Modable.
BI feedback tracker has a project specifically for modding tickets
Cool, I'll go check that out. Thank you.
You need to use INHERIT_PARENT_SKELETON flag on VObject for that
I'm not on my computer for 2 days, so can't check exact API
Thanks, it did something
TF2 Soldier
Oh nevermind, I guess vests work already while armored vests dont, so nothing really changed apart from me testing another prefab
Did that on all inventory entites, no change
char.SetVComponentFlags(VCFlags.INHERIT_PARENT_SKELETON); => Resets animation
item.SetVComponentFlags(VCFlags.INHERIT_PARENT_SKELETON); on all storage items => Nothing
There's a preview entity function that will Just Work when called with a character
But I dont have context on what you doin
Me neither, I just wanted to render a character in a widget 🤔
In general, the idea was to display character figures in different gear sets in a menu, similar to what I did in A3 with pre-rendered images but dynamically
Do you use ResolvePreviewEntityForPrefab for this?
or SetPreviewItemFromPrefab
ah I just checked how I do it in my loadout editor, I call InventoryItemComponent.CreatePreviewEntity
And that creates the player in my preview world
Where the frickin frick do you remove all occupants from a vehicle by script 
For armoured vests with multiple slots aka pouches, you need to attach the attached entity to the character directly and use this flag as well
Found it stop looking
I posted a part of a script doing that i can send you the rest if you want
Btw if anyone knows how to disable collision between two entities (or between a character and a vehicle) please let me know.
It would help me a lot as when I eject people people from the mh6 little bird it happens that they spawn on the main rotor which sometimes results in the main rotor exploding.
hehe
I'm just rte doing my one
Ill flick it over
Oh that’s really nice to hear, may I ask what methods you’re using for that?
Vest and helmet are all part of the prefab that I create with SpawnEntityPrefab, not separately.
Using SpawnEntityPrefab(Local) into new world
Hey. If i call a Method from InputAction which is bind to double press. The Method will be called 10 - 15 times (but only pressing twice). How do i need to set this, to make sure its only called once?
have you checked that the AddActionListener is only ran once per client ?
Changing the interaction layers should do the trick.
Do you know to what enum particularly ? And would it have to be ran by the authority or client ?
(i'd like it more if it's doable by only the ejected clients)
We use FireGeo to disable it between characters. Also not sure if it is recursive. You may have to specifically set it for the rotor.
Also it has to be set on the owner machine.
Why does the script editor keep freezing for me when I alt-tab to it?
You're a life saver.
Thank you !
whenever you change of tabs to smth else(eg : world editor) it reloads your scripts, verify the synthax etc...
can I disable this behaviour?
i'm not sure. i didn't see an option for that in the settings
Is it possible to add ping latency between localhost + peertool in world editor?
Make sure you set it to udp ofc
Is there a script that shows your server being verified so you know it’s real and not a fake
Has anyone tried doing anything weird with the TimerTriggerComponent / CollisionTriggerCompoment? Im trying to make a new one that essentially merges the two, so you can set a round to have a varible timer trigger, but still also trigger on impact. I initially tried just making my component inherit off collision, and then add the methods from the timer trigger, but I cant figure out how / where it should set the timer trigger to be live, or even where any of that info gets set for them period, since there really isnt much in any of the components to compare to or look at. If anyone does have more info or can point me at something else to look at to try to get it going, Id appreciate it.
You can just have EOnContact in your script and force activate the timed one when something hits it
So itd be eaiser to inherit off the timedtriggercomponent, and then just override the EonContact
This is what I get for modding at 1am
Hi, Question: i have two keybinds on "F" Single-Click and Double-Click. If i now like to run the method which is bind on the Double-Click, it always runs the one from the Single-Click. Does anyone know how to fix this?
are you using this filter inside chimeraInputCommon.conf?
Or how did you set it up
Yes correct i use the InputFilterDoubleClick and the regular on the other
so you are using singleclick on the other and wondering why its running when you double click the button?
But this also works on FreeLook... Alt = FreeLook, Double Alt = Toogle Freelook
hmm you compared the logic for this / setup inside the cfg with urs?
unfortunatly cant tell out of my head, never had this before, but if its already correctly setup base game multiple times, eg spring / double click for locked sprint it should def. be possible
screw this: "def. be possible" 
Does anyone have issues when game ends it will not auto restart you have to hard restart is that a script issue
When a magazine is empty in a turret it disappears?
I noticed if I set ammo count on a magazine that is empty it doesnt throw errors but doesnt load bullets into the mag/gun
RESOURCES (E): Failed to open
RESOURCES : GetResourceObject @"{F503F71C08BE3F7D}Prefabs/Vehicles/Helicopters/AUS_MH60/AUS_UH60_armed.et"
RESOURCES (E): Failed to open
SCRIPT (E): Cannot create entity, error when loading prefab '{F503F71C08BE3 any ideas
How do I inform the game the max number of players on a server so that "Spawn random children based on player count" works properly? As of now No children spawn at all when I test in my server, but they do spawn when I test in workbench
All mags disappear when empty
The ammo count after u shoot a mag is also not exposed as a specific prefab
Math3D.IntersectionLineSegments() exists, but is there a function to get where they intersect?
also, is it not possible to express this in Enfusion?
array<vector[]> lines = {};
vector firstLine[] = lines[0];
Gives me Incompatible parameter 'firstLine'
What the heck kind of notation is this array<vector[]>? What your you trying to do?
it's a 2d array, but the 2nd dimension is static
this is one of those times where I feel like it's appropriate to say that it doesn't really matter what I'm trying to do, no matter how I try to do multidimensional arrays I get a syntax error
Just do array<vector>, I assume this is what you mean
But you didn't specify the size of the static one
syntax doesn't allow you to
this syntax is how you pass fixed-size arrays as arguments too 
yeah I could flatten it. it'd be nice if I didn't have to though
Either you misunderstand the notation, or I don't get what you're trying to do
array<vector> is already an array of vectors, with components that can be accessed using e. g. v[0] without any [] in their declaration
huh?
a vector is a fixed-size array containing x,y,z components no?
an array of vectors would therefore describe some shape
this is an array of shapes essentially
Yes, and you can declare such an array of vectors using array<vector>
Ok, so in this example I essentially have an array of shapes. I've described shapes (in this case a triangle) as an array of vectors (points) with 4 elements. Basically two line segments.
How do I now create an array of shapes as you propose?
again I think this is losing the plot a little bit. the root of the question is how do you syntatically declare a multi-dimensional array
It doesn't look like there is a way to do it. array<vector[]> is useless, as it throws null pointer exceptions when you try to insert a static array
did you initialize it?
array<vector[]> arr = {} is not the same as array<vector[]> arr;
This doesn't work, and neither does ref vector[]
Same error.
Has nobody really tried doing multidimensional arrays before in the scripting engine..? The only instances I see sampling ][ is with vector[]
Still not really working. It only seems to store the first vector
actually I see a array<ref array<string>> format;
Multidimensional arrays are definitely a thing, as I said simply search for "array<ref array"
ahhh ok this does actually work, I didn't change the line that indexes into the array to have the correct type
the error message was the exact same so I didn't even think about it
anyone got a write up on what a signal (SignalsManagerComponent) is, how to use them, and why would I use them?
Did you see the audio bootcamp? It also covered signals. Besides audio it can also be used for a lot more like controlling procedural animations.
I was actually just watching it because I want to modulate the speed of which a sound plays based on a variable. But they only touched on player speed which was already built into a signal. so if I have a var that I'm already replicating, then I add it to a signal as well, I have two replication instances? why wouldn't I just keep everything in signals then?
I guess it's a matter of design choice. If the variable is used by a lot of other systems besides as a signal, you may not want everything to be couple to signals.
How are people desiging mods? I trying to work on some simple mods to get a grip of how the engine works, but I'm having trouble on finding helpful resources
Hi there, I am trying to extend the enum list ELightType to add an extra option. The attached image shows all the code for the enum I have written. I have also got a new action to trigger this light type but it isn't showing in baselightmanager component
Does anyone know where I can get a guide for making a custom spline generator for marking trenches out?
Most people here need to watch those videos. Kex on the other hand doesn't.
Responded to the wrong guy*
Look up the arma reforger bootcamp videos
Thank you lol^^
I was literally getting ready to say that.
The entire game is a resource.
You can learn 95% of everything you need to know from the game files.
It compiles?
Yes
the option appears when configuring the user action but not on the lights
Left is the user action config, right is the light type config
Have you restarted the tools?
You definitely shouldn't have to go that far.
Is the modded enum being loaded after the baselightmanager?
I am not sure how to confirm that
Are you sure that right menu is defined by enum? It looks like just a bunch of manually added bools
My assumption was that, but I can't find any bools in the code for the boxes, i will chgeck this aswell tho
That's how the UI looks for bitmasks
Then mb you need manually define bit for enum value
Mb it's collided with any other enum, and because of this don't show
Should the original enum
Show*
@oblique lynx try to define some value with single bit for your value, that doesn't collide with other values
My guess is, just like clothing attachment types were early on. That attribute is "hard coded"
ah thats very annoying
I'm trying to get all mapItems in an area with:
SCR_MapEntity.GetMapInstance().GetInsideCircle(mapItems, pos, distance);
This works nicely in WB but on dedicated server it returns 0 items. Why is that?
Because maps are GUI and those only exist on the client. What you intend to do is a query on GetGame().GetWorld()
So, QueryEntitiesBySphere and then filter in callback those with SCR_MapDescriptorComponent?
I had a question, is there a big performance difference between saving an instance(of per example the world) and reusing it or is it pretty much just the same as always using the GetGame().GetWorld(). same for controlled entity etc. Or is it negligeable ?
I think it's inlined by the compiler
If my understanding is correct then it will actually be faster if you use the functions in your script than if you create variables
Yeah but whebn you do so, then those pouches are created children of the vest, and they should be children of the character
Depends on the getter, all getters in C++ are just return a variable, so it should be fast, sometimes getter are doing more expensive stuff, and you should check if it does, then you can think about caching it or not
Only getter written in script with only 1 return line are inlined, otherwise they are not
Ah ok
Do you know if there is a way to make AI Agent run a behavior tree from script?
Feels like a basic feature to have
Thanks a lot for the info.
So overriding the EOnContact doesn't seem to work, or at least I can't seem to find out why it's not doing anything. Is there something else missing from the trigger component that needs adjusting, or other parts somewhere that need to be changed? Even looking at the other components, it doesn't seem like anything really changes, so I'm not 100% script wise what get changed where to make each component do their specific thing.
But I know it clearly should work, since it the pressuretriggercomponent and such all do overrides, and also have an inheritence that leads back to the basetriggercomponent
You have to set the event mask and the flags
How do I go about triggering a client script from the server, for example making a hint appear? Is there a good example somewhere of this taking place?
Rpc from server to the client.
Any good examples @river imp?
Would anyone know why the name tags do not pop up at the right distances haveing an issue with that on are server
So how do the components work normally then, if we need to set them when modding them, but they don't sent them in the script for the default ones?
Or is it a case instead where anytime your override it, you then have to re-set those event masks and flags, to get it to update?
Watch the two replication video also, they're life savers.
https://community.bistudio.com/wiki/Arma_Reforger:Multiplayer_Scripting
This Modding Boot Camp seminar was originally held on the Arma Discord Server on January 23rd, 2025.
In this session, we explore the fundamentals of replication within the Enfusion Engine, highlighting key concepts and common challenges. Through detailed examples and clear...
Ah this is excellent, thanks
Ok, seems to be specifically an issue somewhere with the EOnContact; I cannot for the life of me get it to do anything, even after setting the event masks, ect, unless I am missing another step outside setting those.
Not showing your script does absolutely nothing except leave people in dark.
No one can tell if you're doing it right just because you make vague posts on Discord.
Is it possible that a server under heavy load fails to call a method that has been queued(server side) ?
The server i was in was in the middle of an intense gunfight and an event was triggered. but for some reason a method that was queued was never triggered after the delay.
And when i had tried before(and after) on a low population server the script worked just fine ?
(The logs show no errors)
So I've tried all three of the following, with no luck. Now, when I try and do stuff via EOnInit just to see if that will do anything, it does in the same setups, so that's where my confusion is.
{
override event protected void EOnContact(IEntity owner, IEntity other, Contact contact)
{
GetGame().GetCallqueue().CallLater(RPC_DoTrigger); // Delay it to next frame, cannot delete entity in EOnContact
Rpc(RPC_DoTrigger);
}
void ICR_TriggerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
{
SetEventMask(ent, EntityEvent.CONTACT);
}
[RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
void RPC_DoTrigger()
{
BaseTriggerComponent baseTriggerComponent = BaseTriggerComponent.Cast(GetOwner().FindComponent(BaseTriggerComponent));
if (!baseTriggerComponent)
return;
baseTriggerComponent.OnUserTrigger(GetOwner());
}
}```
{
override event protected void EOnContact(IEntity owner, IEntity other, Contact contact)
{
OnUserTrigger(owner);
}
void ICR_TriggerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
{
SetEventMask(ent, EntityEvent.CONTACT);
}
}```
{
override event protected void EOnContact(IEntity owner, IEntity other, Contact contact)
{
ICR_TriggerComponent trigger = ICR_TriggerComponent.Cast(GetOwner().FindComponent(ICR_TriggerComponent));
trigger.OnUserTrigger(owner);
}
void ICR_TriggerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
{
SetEventMask(ent, EntityEvent.CONTACT);
}
}```
detonates on the timer trigger fine, does nothing at all with the contact
override void EOnInit(IEntity owner)
{
owner.SetFlags(EntityFlags.ACTIVE);
}
void ICR_TriggerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
{
SetEventMask(ent, EntityEvent.INIT | EntityEvent.CONTACT);
}
Still not working, even with those additions. now looks like this:
[ComponentEditorProps(category: "ZEL/Components", description: "An Example Component")]
class ZEL_ExampleContactComponentClass : BaseTriggerComponentClass{}
//------------------------------------------------------------------------------------------------
class ZEL_ExampleContactComponent : BaseTriggerComponent
{
//------------------------------------------------------------------------------------------------
void ZEL_ContactComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
{
SetEventMask(ent, EntityEvent.INIT | EntityEvent.CONTACT);
}
//------------------------------------------------------------------------------------------------
override void EOnInit(IEntity owner)
{
owner.SetFlags(EntityFlags.ACTIVE);
}
//------------------------------------------------------------------------------------------------
override private void EOnContact(IEntity owner, IEntity other, Contact contact)
{
Print(other);
}
//------------------------------------------------------------------------------------------------
}
This works
if yours don't then perhaps your prefab isn't set up correctly
All I've done is swap the CollisionTriggerComponent on a 40mm grenade for my component
and it functions fine on the timer part
That's probably your problem


