#enfusion_scripting
1 messages · Page 12 of 1
SAT_RemoveGMAction would be the intended class name.
we need a custom macro / preprocessor that just compiles normal code into enscript
I can do this in my vscode plugin probably
imagine not writing your prefix everyh time you want to get a class/var
just base it on folder structure 😔
Yeah I will, I will reorganize the class names as it transitions from playground to production
On and off half a year of work 😅
also that way you can avoid using enfusion functions, just inline everything with pre-processor functions
Even less casting and tedium
This probably bothers me way less than not being able to collapse code blocks
I can do it in vscode but I cant compile from vscode
So

Enscript is not a thing
It's Enforce Script
*reforgescript
reforc
Was gonna change my name to SCR_BaseCharacterInventoryStorageManagerSystemComponent a week ago
Do it 
Remember, make it <h1>SCR_BaseCharacterInventoryStorageManagerSystemComponent</h1>
Really get that point across and make a few server owners mad.
Why not just set your ingame name to #AR-SplashScreen_Trademark?
Almost as wide as adam driver's chest in that one star wars movie
@ocean kernel 
I like putting load screen tips as group names to help other players play the game. Ie. #AR-LoadTip_053
Something like that
does anyone know a way to replicate voices where your camera is in game master, it only does so if your actual character is within distance. many thanks.
It's hardcoded
no workaround ?
Not as of 5 months ago, who knows about now
Now, don't start developing a commander mode now
Definitely don't add sling ropes or expose fire mode/rate / sway modifiers to WeaponStatsManagerComponent
It doesn't achieve the exact effect.
so yeah definitely DON'T add that in a future patch 
What are you trying to achieve with the sway modifiers?
hold breath

If those mines don't bounce then
https://streamable.com/tixird
You can disable the vanilla sway and add custom scripted sway :^)
Yeah i'm not that great at vectorized math 
override void OnCalculate (IEntity owner, WeaponAimModifierContext context, float timeSlice, out vector translation, out vector rotation, out vector turnOffset) {
It's not crazy haha
I've seen like 3-4 weapon handling mods on the workshop, it can't be that hard 😄
You can only shave off so much even then like I said the effect isn't a desired effect, it's a bit janky and meh. Idk why It should be exposed.. should be a base feature
Ye, seems like a common thing people want to mod 🙏
Recoil reduction is easy enough but messing with sway not so much.
Bro I would love if non-character ragdolls worked
Tried to make a cape, activated ragdoll, instant crash

Can't you just fake it till you make it with an animation?
I try to avoid animations since it just crashes all the time and discourages me
That’s kinda cool
Not from script you cant, I dont think
Can not for the life of me get visual area lines to stay on screen using Shape.CreateLine it just pops up once really fast and goes away. Tried all kinds of flag combinations.
it's being garbaged, save the reference somewhere
Tyvm its finally working
Is there a proper VSCode or Visual Studio Community addon for Enforce Script?
Nope, there are some, but they a not full
can someone explain how i set up a persistent marker on map like Trader and so.
you need to create a component that inherits from SCR_MapDescriptorComponent
(repost)
When spawning in a medical kit in my player's inventory via script i receive this message(and the items refuses to spawn)
'SCR_ResupplySupportStationComponent' needs an entity catalog manager!
Tho my game mode does not use any supplies or whatever, is there something i'm missing in the prefab's config that is preventing me from spawning theme or some kind of manager in the world ?
is there a way to assert that the parent's type is equal to a specific class? (they inherit GenericEntity)
parent.Type() == LB_EnemyHideoutBase; // <- type of this
In the future yes
can I somehow access entities within the same (world-) layer? i.e. find every entity in the same layer of type ABCD
would be dope if plans like this were publicly announced so that people like me dont waste their time doing double work
void RequestSetContainer(CE_SearchableContainer container)
{
SetContainer(container);
Rpc(RpcDo_SetContainer, container);
}
[RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
protected void RpcDo_SetContainer(CE_SearchableContainer container)
{
Print("proxy-side code");
SetContainer(container);
}
``` I'm calling `RequestSetContainer()` from a server-side system, which sets the container on server. Then Rpc's to set the container on peer, but it doesn't set on client when `RequestSetContainer()` is called from the system (additionally, the client isn't loaded in yet when it runs).
However, if I call `RequestSetContainer()` from the component with a debug key press when client is loaded, it sets fine. Am I looking more at a timing issue or still something off with replication?
I would think that it'd replicate since it's set on server (and called to be set on client) even if set before the player loaded, or am I mistaken?
Client has to be initialized rpl wise for it to start receiving stuff
Anything else sent before that is lost
Use RplSave on auth to know when you can send something to a proxy/owner
so would I just override RplSave and RplLoad in the component and write/read the container variable?
(E): ScriptBitWriter::Write: type 'CE_SearchableContainer' not supported not sure how to address this
I have to ask but did you watch the bootcamps or just skimmed through it?
Because it seems it was doing exactly what you are trying to do, but you are doing it in a weird way
Watched halfway through the advanced replication one earlier today, then ended up being busy irl until now. So gonna finish it in a moment.
I originally watched the first one for replication when it released, so probably wouldn’t hurt to touch up on it too.
But mostly been going off of vanilla scripts or the multiplayer scripting wiki section
I also struggle with learning things with just being told and shown, I gotta deep dive in most of the time and learn hands on. So I could watch it 50 times and still not retain much until I do it myself lol.
But yes, am watching it
Can I get some help. I cant see to figure out what Im doing wrong. Im trying to create a custom loading screen for my server. I altered the ScenarioLoadingScreen.layout but nothing changes. Is there something Im missing?
I asked there thank you
How do i make a player invisible? I tried setting the body parts to a transparent material but that didn't work?
When I set the faction the player is no longer invisible.
I notice in the video, the authority system is setup as a “both” system, being server and client, and then the proxy system as just client. What would be a potential case where you would use just a “server” system?
Because that’s what I’ve been trying to do initially (setting it up as a server system), and so far it seems like that’s where most of my issues are stemming from. Maybe I misunderstood when just a server system would apply, and it may not apply to my case
My system is being based around mass entity spawning
If it makes no sense to have something on server then just avoid it
Same for the other case.
The setting there, it makes it so that the system is only available whete you placed it
Setting it to server means that it only exists on server
Client to client, and both to client and server
In server and "both", the server is the authority
And in "both", you have access to proper replication through the system
Morning, if i like to add an force to an object (like an magnet), to lift it up. Does the force need to be apply on the top or on the bottom of the object? I try the CenterOfMass and added a force by vector.up * 200000, this should be 20 tons. But the object does not even move. Sim is on.
SCR_PushVehicleAction : ApplyForce method maybe good example, but its only impulse
Hi there guys awhile back I managed to get dynamic moving map markers such as the the ones in conflict game mode that a squad leader could see also I edited a line in a script to true i have to be honest I wasn’t really sure how I managed to enable this and I can’t remember if there is anybody out there that knows how to set dynamic moving map unit markers to visible for the squad leader with out writing custom scripts can you please let me know cheers
is object's rigid body set to active?
How do you get the weapon someone was killed with?
BaseWeaponManagerComponent wpnManager = BaseWeaponManagerComponent.Cast(instigatorContextData.GetKillerEntity().FindComponent(BaseWeaponManagerComponent));
if (wpnManager)
{
WeaponSlotComponent currentSlot = WeaponSlotComponent.Cast(wpnManager.GetCurrent());
if (currentSlot)
{
Print("KillerPlayerWeaponType", SCR_Enum.GetEnumName(EWeaponType, currentSlot.GetWeaponType()));
Print("KillerPlayerWeaponName", currentSlot.GetUIInfo().GetName());
}
}
This gets the current weapon the instigator has equipped, not the weapon that was used to kill them
For guns this will usually match
But if I kill you with a mine
It will show AK74
Since its what I have equipped
Do u kno wat I mean
Yes bracon
Apologies
Brilliant
Aren't there mods that do kill tracking already?
From what I've personally messed with, you either manually track it
or guess with what moose said 😄
Yeah there are but I did not open them to check how they do it
Tryna gather some ideas here
And see if there's a way to track it reliably
Looks like we need a feature request for the BaseDamageContext / BaseDamageEffect
It really should be integrated into the Instigator context or something similar, because dealing with separate systems for handheld weapons, vehicle pilot weapons, gunner turrets, and so on is a real pain
also dealing with distances after killer dies and then respawns whilst the victim bleeds out, or if the killer changes the weapon that is equipped
there's like a shit load of edge cases you need to account for
also vanilla weaponslotcomponent that are machine guns dont provide any context data at all if fired by pilot
Sure
modded class SCR_BaseBulletDamageEffect {
So basically you can at least have the same SCR_BaseBulletDamageEffect object.
But you need to manually track which one is which
So you need a script that fires when a gun is fired and on SCR_BaseBulletDamageEffect init.
Then when a SCR_BaseBulletDamageEffect is created on teh same tick as the bullet is fired, save the weapon name / position into the SCR_BaseBulletDamageEffect object.
But is it dynamic?
Then you can query it on HandleConsequences which runs when the damage is evaluated
Yes its the UAZ Vehicle
@ocean kernel scuffed position+char tracker 
modded class SCR_MuzzleEffectComponent {
override void OnFired(IEntity effectEntity, BaseMuzzleComponent muzzle, IEntity projectileEntity) {
HCA_H_OnFired(effectEntity, muzzle, projectileEntity);
super.OnFired(effectEntity, muzzle, projectileEntity);
};
void HCA_H_OnFired (IEntity f_Ent_Muzzle, BaseMuzzleComponent f_Comp_Mzl, IEntity f_Ent_Prj) {
HCA_H_s_iTick_Last_Mzl = System.GetTickCount();
Print("HCA_H_OnFired");
Print(this);
Print(HCA_H_s_iTick_Last_Mzl);
Print(f_Comp_Mzl);
Print(f_Comp_Mzl.GetOwner());
Print(f_Comp_Mzl.GetOwner().GetName());
SCR_ChimeraCharacter t_Char_This;
ProjectileMoveComponent t_Comp_MoveTesting = ProjectileMoveComponent.Cast(f_Ent_Prj.FindComponent(ProjectileMoveComponent));
if (t_Comp_MoveTesting) {
Instigator t_Ins = t_Comp_MoveTesting.GetInstigator();
if (t_Ins) {
t_Char_This = SCR_ChimeraCharacter.Cast(t_Ins.GetInstigatorEntity());
};
};
Print("HCA_H_OnFired---");
if (!t_Char_This) {
return;
};
if (!SCR_BaseBulletDamageEffect.HCA_H_s_Last) {
Print("HCA_H_OnFired:: no last bullet effect");
return;
};
if (
HCA_H_s_iTick_Last_Mzl == SCR_BaseBulletDamageEffect.HCA_H_s_iTick_Last_DmgFx
|| (HCA_H_s_iTick_Last_Mzl-1) == SCR_BaseBulletDamageEffect.HCA_H_s_iTick_Last_DmgFx
) {
SCR_BaseBulletDamageEffect.HCA_H_s_Last.HCA_H_m_vPos_Fired = t_Char_This.GetOrigin();
// SCR_BaseBulletDamageEffect.HCA_H_s_Last.HCA_H_m_IEnt_Mzl = t_Char_This;
SCR_BaseBulletDamageEffect.HCA_H_s_Last.HCA_H_m_IEnt = t_Char_This;
};
};
static int HCA_H_s_iTick_Last_Mzl;
static SCR_MuzzleEffectComponent HCA_H_s_Last;
};
modded class SCR_BaseBulletDamageEffect {
void SCR_BaseBulletDamageEffect () {
HCA_H_Test();
};
void HCA_H_Test () {
HCA_H_s_iTick_Last_DmgFx = System.GetTickCount();
HCA_H_s_Last = this;
Print("Init");
Print(this);
Print(HCA_H_s_iTick_Last_DmgFx);
// // Print(this.GetOwner());
// Print(GetInstigator());
// if (GetInstigator()) {
// Print(GetInstigator().GetInstigatorEntity());
// Print(GetInstigator().GetInstigatorPlayerID());
// } else {
// };
// if (!GetInstigator().GetInstigatorEntity()) {
// if (Math.RandomFloat(0, 100) > 50) {
// return;
// };
// GetGame().GetCallqueue().CallLater(HCA_H_Test, 522, false);
// Print("call later");
// };
Print("Init---");
};
static int HCA_H_s_iTick_Last_DmgFx;
static ref SCR_BaseBulletDamageEffect HCA_H_s_Last;
vector HCA_H_m_vPos_Fired;
IEntity HCA_H_m_IEnt;
//------------------------------------------------------------------------------------------------
protected override void HandleConsequences (SCR_ExtendedDamageManagerComponent dmgManager, DamageEffectEvaluator evaluator) {
super.HandleConsequences(dmgManager, evaluator);
HCA_H_Test2(dmgManager, evaluator);
};
void HCA_H_Test2 (SCR_ExtendedDamageManagerComponent dmgManager, DamageEffectEvaluator evaluator) {
Print("HandleConsequences");
Print(HCA_H_m_vPos_Fired);
Print(HCA_H_m_IEnt);
Print(this);
Print("HandleConsequences---");
};
};
Looks like muzzleffect fires 1 tick after SCR_BaseBulletDamageEffect is created
But I got the data
SCRIPT : HandleConsequences
SCRIPT : vector HCA_H_m_vPos_Fired = <1071.618408,38.411144,2924.195557>
SCRIPT : IEntity HCA_H_m_IEnt = SCR_ChimeraCharacter<0x0000000082FBF4B0> @"ENTITY:6917529027641082632" ('SCR_ChimeraCharacter','Assets/Characters/Basebody/Basebody_Male_01.xob') at <1071.618408 38.411144 2924.195557> @"{26A9756790131354}Prefabs/Characters/Factions/BLUFOR/US_Army/Character_US_Rifleman.et"
SCRIPT : Class this = SCR_BaseBulletDamageEffect<0x00000000B3EFBA50>
SCRIPT : HandleConsequences---
Also you can technically probably fire more than 1 bullet in 1 frame tick, so it's slightly flawed
Bro writes class and variable names the opposite way of me
What's the opposite way?
Least explicit way possible
m_MyCar_Bacon_IEnt
I wonder if I would have better luck extracting BaseDamageContext.damageSource and .instigator
damageSource is supposed to be the projectile
Like in your OnFired example
Could attach the weapon name to every projectile
Nevermind I've been Bohemia'd
Yes
But you know a funny silly trick ...
You can create a map that uses the projectile as key

I did thise before to know what weapon a projectile came from
HCA_m_mPrjToLaunchTime.Insert(f_IEnt_Prj, t_fTimeCurrent);
HCA_m_mPrjToWeapon.Insert(f_IEnt_Prj, f_IEnt_Wpn);

# scripts/Game/generated/EntityTypes/Projectile.c
class ProjectileClass: GenericEntityClass
{
}
class Projectile: GenericEntity
{
string m_sWeaponInfo = "Gun";
}
# some other file
modded class SCR_MuzzleEffectComponent {
override void OnFired(IEntity effectEntity, BaseMuzzleComponent muzzle, IEntity projectileEntity) {
Projectile.Cast(projectileEntity).m_sWeaponInfo = "Some Weapon";
super.OnFired(effectEntity, muzzle, projectileEntity);
}
}
modded class SCR_HitZone {
override void OnDamage(notnull BaseDamageContext damageContext) {
Projectile projectile = Projectile.Cast(damageContext.damageSource);
if (projectile)
PrintFormat("Damaged with: %1", projectile.m_sWeaponInfo);
super.OnDamage(damageContext);
}
}
We good
Thanks for the input
Wonder if this will work in the game
@fervent cedar @analog python

I will test it rq
Bummer, the Projectile override doesnt work on server, but nothing throws VMEs
Almost as if that override became a different class somehow
Oh I'm a dumbass
In the future you might be able to mod native classes, but we have to solve a memory layout problem on it first.
Its because the effect is set to disabled on dedicated server
ok it works
I made a custom muzzle effect component with a dummy particle and enabled that on dedicated
a bit hacky
but maybe storing weapon information in the projectile like that is good
not sure yet how to pass this information from OnDamage to OnPlayerKilled
Is there a way to make name tags not show civilians? Only the faction you belong to?
Just turn it off on the civ character base lol
It’s part of a PvE server that has civilians in towns
Hi, does anyone know how I can access entities within the same layer (like siblings)?
i.e. Access LB_UnitGroup from LB_EnemyHideoutBase?
Can't you also overwrite the scripts\Game\generated\Damage\Instigator.c file comeplettly anmd just add the string there? 🤔
I get the following error when adding a waypoint onto a group. Did I miss something to add to the world, except AIWorld?
Virtual Machine Exception
Reason: Index out of bounds.
Class: 'SCR_AIConfigComponent'
Function: 'Get'
Stack trace:
scripts/Game/AI/Components/SCR_AIConfigComponent.c:181 Function PerformGoalReaction#65166
scripts/Game/AI/Components/SCR_AIGroupUtilityComponent.c:197 Function EvaluateActivity
scripts/Game/AI/ScriptedNodes/Groups/SCR_AIDecideActivity.c:26 Function EOnTaskSimulate
void AddWaypoint(ResourceName waypointName)
{
logger.Log("Try adding AI Waypoint. " + m_aiGroup);
if(m_aiGroup)
{
logger.Log("Should spawn AIWaypoint");
Resource waypointRes = Resource.Load(waypointName);
if(!waypointRes)
{
logger.Error("Could not resolve waypoint: " + waypointName);
return;
}
AIWaypoint waypoint = AIWaypoint.Cast(GetGame().SpawnEntityPrefab(waypointRes, null, LB_Utils.GenerateSpawnParameters(m_spawnPosition)));
if(!waypoint)
{
logger.Error("Could not spawn waypoint: " + waypointName);
return;
}
logger.Log("Added waypoint to group: " + waypointName);
m_aiGroup.AddWaypoint(waypoint);
}
}
I've accidentally added AIWorld as entity and not the prefab. Now It's working 🤦♂️
In which update was the replication stuff moved to main thread?
None
It's just that if the replication thread, or any thread for that matter tries to use anything in scripts. Then they get blocked by the main thread which is where scripts run
I'm recently seeing more reports from server owners about desynced vehicle physics and teleporting vehicles
If main tread is blocked, and a trhead tries to use scripts. Then they also get blocked as they can't proceed.
That's fine, just tryna figure out what happened recently to increase this in frequency
Has anyone worked with radial menu before? I'm trying to make my own custom radial menu but I can't figure out which parts to work with. Thanks for any help.
Easiest way to make it happen is to shove the general script call queue with as many things as possible
So when did you guys do that?
. The more mods that do it, the worse it gets.
It's already in a bad state by the game. Becomes worse with each modder using it
Right. I'm trying to gauge when it became this bad.
we need headless client it sounds like
server should only have 1 job and 1 job only.
To network things.
Everything else should be on headless client
imagine having slow call que and tons of slow scripts, none of them affect the server
You can clear the entities VISIBLE flag from script.
There are headless clients
Just launch the server executable with the connect cli params to the master server
okay it says
🤔
ArmaReforgerServerDiag.exe -profile ArmaReforgerDS_Peer -client 127.0.0.1 -maxFPS 30
Soooo....
It's kinda undocumented what does headless do other than error?
Does it follow network range rules or is it special like arma 3?
This is ehat happens when people go with isServer or IsClient iirc
Just mod the method to detect when a server is a client
Is HasInterface a thing?
Ahh here we go
IsConsoleApp
It's the hasInterface test
Just write everything with IsServer & IsConsoleApp 
Like it's supposed to be
Also ai is engine locked as far as I know,
So I can't even run the ai on the headless anyway.
But at least scripts being possible is nice
Sry for reask but i need the "no" answer too for continue my new project :]
#enfusion_scripting message
any error in this code? I can not find the saved json file and path after running on workbench
find it. forgot to create the folder
hi, im trying to make a parameter optional via ... = null:
void AddWaypoint(ResourceName waypointName, vector position = null)
But I get the error: Incompatible parameter 'null' 
Vector is a value type and can not be null. Pass vector.Zero instead
Isn't that a method, not a parameter?
The parameter position inside the method 😉
ah right, well yeah, in that case the method parameter cannot be null - you can't have the default value for a waypoint to not exist, otherwise you don't have a waypoint.
What kind of attribute do I need, in order to have make a array of objects configurable? It's not showing in the .conf file like this:
[Attribute(uiwidget: UIWidgets.Auto, category: "Enemy Units")]
ref array<LB_MechanizedInfantryEntry> m_aEnemyMechanizedGroupPrefabs;
// LB_MechanizedInfantryEntry.c
class LB_MechanizedInfantryEntry
{
[Attribute(uiwidget: UIWidgets.Auto)]
ResourceName m_aInfantryGroupPrefab;
[Attribute(uiwidget: UIWidgets.Auto, category: "Enemy Units")]
ResourceName m_aVehiclePrefab;
}
Add the base container attribute on the class you want to select an array from
And you need another ref for the array elements
[BaseContainer()]
class LB_MechanizedInfantryEntry
{
[Attribute(uiwidget: UIWidgets.Auto)]
ResourceName m_aInfantryGroupPrefab;
[Attribute(uiwidget: UIWidgets.Auto, category: "Enemy Units")]
ResourceName m_aVehiclePrefab;
}
[BaseContainerProps(configRoot: true)]
class LB_Config
{
[Attribute(uiwidget: UIWidgets.Auto, category: "Enemy Units")]
ref array<LB_MechanizedInfantryEntry> m_aEnemyMechanizedGroupPrefabs;
}
Adding ref to either ``m_aInfantryGroupPrefab` or vehicle gives me the error "Auto-pointer 'ResourceName' must be class-type"
you don't need this, you need add ref to elements of array in LB_Config
Thanks, I got it working. For anyone wondering in the future on how to correctly attribute a array of objects:
[BaseContainerProps()] // <- This was missing
class LB_InfantryVehicleEntry
{
[Attribute(uiwidget: UIWidgets.Auto)]
ResourceName m_aInfantryPrefab;
[Attribute(uiwidget: UIWidgets.Auto)]
ResourceName m_aVehiclePrefab;
}
[BaseContainerProps(configRoot: true)]
class LB_Config
{
[Attribute(uiwidget: UIWidgets.Auto, category: "Enemy Units")]
ref array<ref LB_MechanizedInfantryEntry> m_aEnemyMechanizedGroupPrefabs;
// -------^ this ref was missing ------
}
I've just started out with reforger... never written in C before, and I'm browsing the mod project to try and find out where the first file is called and I have no idea where I'm looking... what file is called when the mod is initialized?
is bro looking for int main
yeah, any file... to get started. If you're not memeing, where is it?
Is there a reason why sphere shape works for triggers but not the bounding box?
I would look at base game mode file, there's a lot of comments at the top explaining how some things work. Really depends what you're trying to do though as that may have nothing to do with what you want to do. So what do you want to do?
Create a mod from scratch so I can familiarise myself with the capabilities. I'd be creating a dedicated server mod, and client eventually, but I need to know what I can actually do in it. Last game I looked at modding in C++ was bannerlord, and that had basically everything locked
Yeah that doesn't really narrow it down at all.
well basically, how do you get started... where's the init file? How does the mod know what to call and what classes to define?
at the moment, I've got a bare project with literally nothing in it... how do I get anything in it?
You gotta start with a goal in mind, not just "make a mod"
do I just start slapping mystical files into it, and it just reads them willy nilly one by one?
It's a script mod
No, first step is to figure out what you wanna do. Then maybe we can help.
like at server startup, how does it know to call anything?
I know what I want to do
Well I don't, so i can't really help. My break at work is over, back to the grind!
It's too vague. I can recommend you some files to read over for useful functions/methods
I'd read tools.c, Game.c, game.c, and IEntity.c. But we're here if you need help with something specific.
Yes please
https://community.bistudio.com/wiki/Arma_Reforger:Entity_Lifecycle
everything is centered around the ECS architecture. Entities exist in the world and can have components. Main gamemode logic exists on a gamemode entity, which you can derive and make your own gamemode from. Just make a new script and inherit base gamemode.
Systems are also important for global level control and behavior. Definitely use these, they are best practice and Mario will be happy. https://community.bistudio.com/wiki/Arma_Reforger:Systems
i have heard it is not good practice to use components for entity-level logic anymore, so only use components for data (or do whatever you want, it adds up but for sake of learning sometimes it easy to start with all logic in entity events)
Make sure to also read up on replication, best docs are in the comments of the replication class
Aside from entity lifecycle methods and systems Adam mentioned above, things more specific to game mode itself would be initialised in constructor or .Start() method of whatever GameMode entity is in the world the server loads. That would probably be your entry point for making a full game mode from scratch. Check out the source for Conflict (called Campaign in scripts) SCR_GameModeCampaign for a better idea
how do I bundle my custom data saved with SCR_BinSaveContext within the mod package? apparently json files get bundled, if I hack around a .meta registration for my .bin files they just get ignored.
trying to work around by saving a foo.bin.json and loading it with SCR_BinLoadContext doesnt work, it still tries to treat it as a json (yet another Totally Predictable API Behavior™)
Hey I got a question do anyone know how to make a script bc i been trying to make a script for weed where a player grab the weed buds then take it to sort it then pack it then sell it but I can’t figure out how to make a script for that Im new doing script and everything with arma tools
@rapid ferry @midnight talon thanks guys - this is exactly the information I was looking for 😁
There are two issues. First being that your custom .bin file is not included in the mod bundle - that I am not sure about. I wonder why it would be excluded. Have you tried .blob as extension? Maybe there is a whitelist of what assets types we include.
Loading blah.json even if it is binary content does not matter. Bin load context with load from file will treat it as binary content. it has no care in the world of file name or extension.
So transformation matrix is 3 orientation vectors and position vector? No scale vector?
Oh, scale is orientation vectors magnitudes
Is there a page on wiki about it at all?
it’s not enfusion specific really, you can use any math resource on transformation matrices. this also carries over to any other 3d engine
Guess so, I got too used to dealing with vectors separately in RV
Storag
yes.
Can I somehow draw gizmos in workbench? Like a red dot/line/cone, where an invisible entity is?
Shape.CreateLines and other methods there
Im trying to draw a sphere like this. However they are not showing :o
override void EOnInit(IEntity owner)
{
Shape.CreateSphere(COLOR_GREEN_A, ShapeFlags.FLAT, GetOrigin(), 5);
}
try creating a ref to it
Shift+Ctrl+F method name and see how vanilla does it
but yeah, you need to ref it or it releases
storing it in a ref worked, thank you!
any idea on how to only show this in Edit mode per frame?. I've tried _WB_AfterWorldUpdate and found an interesting dev comment:
Ah i was missing this:
override int _WB_GetAfterWorldUpdateSpecs(IEntitySource src)
{
return EEntityFrameUpdateSpecs.CALL_WHEN_ENTITY_VISIBLE;
}
no luck with .blob either. it'd be nice if the engine packed everything that has a corresponding .meta, I recall there was talk at least a few times about including .txt or .md readmes within mod files.
you're right about the bin loader though, turned out to be messed on my side. 3 AM dev work at its finest 😅
anyway, foobar.bin.json it is it seems
It is a standard transformation matrix as used in math in general. if you want angles, scale you use helper methods on 3dmath class. position is [3] on the transform
vector scale[3] = {
Vector(m_vScale[0], 0, 0)
,Vector(0, m_vScale[1], 0)
,Vector(0, 0, m_vScale[2])
};
Math3D.MatrixMultiply3(mat, scale, mat);
```Is there a quicker way to create that matrix out of scale vector? Some proto function perhaps?
Math3D.ScaleMatrix or something
In the forseeable future only file extensions that can also normally be registered in the workbench are copied into the build. So you must choose one of them for now.
Only by float, no vector scale
Looks like Shape.SetFlags adds flags rather than setting them 🤔
No way to remove flag once added
Does anyone know why my workbench crashes, once I compile this?
class LB_SpawnUnitsTriggerClass : BaseGameTriggerEntityClass
{
}
class LB_SpawnUnitsTrigger : BaseGameTriggerEntity
{
override void OnActivate(IEntity ent)
{
Print("Triggered: " + ent);
}
}
PrintFormat("Triggered: %1", ent);@wild glade
Also, on phone so don't know if phone changes it, but to format discord to c# use cs instead of c#
i cant move M60 gun to Alice BackPack can edit it?
IDK why, but reforger modding is so overly complicated it seems. How can I spawn a hat on the player using a script?
SCR_WeaponAttachmentsStorageComponent -> ItemPhysAttributes -> ItemDimensions & ItemVolume
Fitting name haha
Yeah, character storage inventory base whatever something
Start by adding a hat onto a character in world editor first, then try working with same components through script
thx i try now to set the same dimension as by ak74 for M60
dont work for me
backpack has volume has weight
dimensions is like ak74
maybe backpack edit?
It's wild how overly complicated this is though...
In arma3 it was "player.addHeadgear(<name>)"
In reforger... it's what feels like 1000 lines of code reading to see where the obscure definition is
Seems like SCR_FactionControlTriggerEntity triggers for every entity, not only chimera characters
thx it was not a volume it was demension because backpack has standart demension of 10 10 10 and the M60 is 30 30 30 found it
yeah u can go 2 ways but easy one is set the back pack demenision so u can carry all weapons
This is the only thing that has any uniform items bound to it on the chimeracharacter. Am I just being dumb here? Why is there no way to simply add a hat to a character?
EDIT: If I modify the entity directly, in that BaseLoadoutManagerComponent, it adds the hat to the guy... but I can't access that component in script.
Likely there is another class that inherits this one and has all the functions
Ctrl+Shift+F : BaseLoadoutManagerComponent to see if something inherits it
Nope
There's a usage of it in a workbench script to "check loadout", but it uses IEntitySource, which I also don't have access to, and can't find a way to it when I have the IEntity
which again, is absolutely wild af considering the effort gone into making the tools that they don't make things circular.
ClearFlags 🙂
Which only clears the ones you provide on it
I'm still a bit confused as to why scripts are all higgledy piggledy all over the place with my script objects getting mixed in with them... why was this the design decision? Is it to make it harder to have custom scripts like hacks?
Only the scripting part of the game is accessible in script. Devs choose what to expose to script. We do not have access to the engine and a bunch of game internals. Remember you are modding a game and not creating a game.
Which part of EntitySpawnParams.Tranform decides the rotation of the spawned prefab?
0-2
0 is x - 1 is y - 2 is z? if yes, how would I work with a vector if they are floats, or do i just convert?
Transform is 4 vectors, vector at idx 3 is position, first three vectors are rotation and scale long all axis. use math3d helpers for simple yaw pitch roll angles
do you have an example for setting/getting the angles in the code?
go into the class i mentioned and search for angle please
I mean putting a hat on a character isn’t exactly gonna win game of the year is it? 😂
IGN:
10/10 could not wear more hats
Undefined function 'Shape.ClearFlags'
I can't get ClearFlags to work properly. I call clear flag it updates that flags however the entity is still visible. If i keep calling it once i'm near the entity then it will actaully make it invisible. Is there some kind of Update i need to force on entity for the flags to work??
class GC_SetInvisible : ScriptComponent
{
override protected void OnPostInit(IEntity owner)
{
SetEventMask(owner, EntityEvent.INIT);
}
override protected void EOnInit(IEntity owner)
{
SetInvisible();
}
void SetInvisible()
{
IEntity entity = GetOwner();
if(entity)
entity.ClearFlags(EntityFlags.VISIBLE);
}
}
why does const Foobar x = GetSomething(); work, but const auto x = GetSomething(); gives error: Trying to modify write protected variable 'x'?
I would guess that auto makes the variable write protected lol
can someone say how i can setup a custom marker on map for Trader?
Are you in the modders lounge discord?
Actually hold up
dont think so
its easy to add marker custom ?
i just want to add trader mark.
You can thank @fringe prairie for his fabulous work
thank you for info
i try it now
Copy
I'll dm u the invite if you don't have it for the discord as well, some good knowledge in there
i will look into it
MyCustomMarker : SCR_MapMarkerEntity:
This line declares a new class named MyCustomMarker that inherits from the SCR_MapMarkerEntity class, which is the base class for all map markers in Arma Reforger.
To create a marker entry config class in Arma Reforger, you'll need to create a new config file and define a class that inherits from SCR_MapMarkerEntity
how would i go about getting every spawned vehicle (optionally occupied, can always be filtered) on the client?
Anyone have any idea what about this replication script causes my scale transform script to not take affect on servers?
May be a fairly simple one. How would I go about creating my own custom Attachment types?
Just create an attachment class:
MyAttachableAttachmentThing : BaseAttachmentType // I'm not near a computer, just double check what the other attachments inherit from.
{
}
Is this done within an existing script somewhere (ie override in my mod and edit?) or am I creating a new one somewhere.
Sorry I’m sure it’s stupied simple, I’ve just never dabbled with the script side of things
Create directory in your project root - scripts/Game/Weapon ("weapon" can be anything, it's the scripts/Game dir that matters)
Right click, add new "script", name it with your attachment type.
Double click the new file, you'll be presented with a blank script.
⚠️ MAY BE WRONG WITH THE FOLLOWING, IM GOING OFF WHAT I REMEMBER WITHOUT LOOKING ⚠️
Copy the following into your script, change "MyAttactment" to what you desire:
class MyAttachment : BaseAttachmentType
{
}
Then compile, if you have errors, post here. Apologies in advance, I have been away at work for 3 weeks and haven't opened the tools so it's a little rough trying to do it from my phone haha
With ScriptedUserAction::HasLocalEffectOnlyScript() set to true, does that mean no replication whatsoever is possible within the useraction? Or am I just doing something wrong?
Running into the issue of needing it to be set to true because it's opening the inventory of the user entity, but need it to replicate to a component of the owner entity that the action was performed. And RplProp seemingly isn't working
Does anyone know why Peer tools aren't receiving the correct values from instance attributes? My peer tool clients are only receiving updates after I apply to the prefab. Is this by design or a possible bug? I don't remember having to apply changes to prefabs in order for Peer tool to pick up the changes on an instance.
Is there something similar to WorldEditorAPI but for Workbench preview, that I can grab to traverse entity hierarchy there?
cant get this work
https://languid-atmosphere-e75.notion.site/Dynamic-Map-Markers-1ce1c757d7ff808c933fe4c471217f96
can someone help me with create ?
Ah, Shape
I thought you were dealing with Entity or Component
I thought its in a newer engine version and you're teasing us with a function we can't have 😁
Maybe I did and I am deflecting 
I will request for it to be added
Can I get an advise with this? Any way to go through hierarchy in Workbench (not World Editor) world?
What do you mean?
BaseContainerProps is not the class you need to search, it'll be the config class you created in script
so in that example, it'll be TAG_SuperConfig
need i create a script?
for a custom config, yes
What would be the best way to make dead bodies unlootable?
Do you mean the Play Mode world? (There is no workbench world)
Is it? I was logging entity world and it was different from world editor world
Workbench Edit Mode has no world.
The World entity might be there, but it is not the active world
The World Entity is there because you created it for the world file you have open.
But no world is running nor assigned.
For example GetGame().GetWorld() should return null
The constructor of the entity and such will fire up yes, but at that point it is just that. An entity
Component constructor log:
Workbench:
ENTITY : Create entity @"ENTITY:1" ('GenericEntity','Assets/Props/Crates/BoxWooden_01.xob') at <0.000000 0.000000 0.000000>
SCRIPT : TEST ent world = 0x0000024802269020 {}
World Editor (Prefab mode) of same prefab:
ENTITY : Create entity @"ENTITY:3" ('GenericEntity','Assets/Props/Crates/BoxWooden_01.xob') at <0.000000 0.000000 0.000000> @"{2B1D0128ED660BE9}Prefabs/Props/Crates/BoxWooden_01.et"
SCRIPT : TEST ent world = 0x00000247E6D5CEA0 {}
ENTITY : Create entity @"ENTITY:3" ('GenericEntity','Assets/Props/Crates/BoxWooden_01.xob') at <0.000000 0.000000 0.000000> @"{2B1D0128ED660BE9}Prefabs/Props/Crates/BoxWooden_01.et"
SCRIPT : TEST ent world = 0x00000247E6D5CEA0 {}
Logged twice for some reason
Yeah that misled you into believing world is active and meaningful in Edit Mode
In Edit Mode, it is just an entity like the rest.
WorldEditorAPI api = entity._WB_GetEditorAPI();
bool isWorkbench = !api || (owner.GetWorld() != api.GetWorld());
```This is how I determine if entity is inside that workbench "world"
Anyway, my main goal is to get entity children, there is no Hierarchy component on them so that's not an option. There is no WorldEditorAPI so I can't use that. Any other option?
IEntitySource
This is flawed for WB EditMode
Because of what I told you
Just do WorldEditorAPI.IsEditMode()
From my test it worked properly, I could tell if entity is in workbench "world" or in World Editor world
I'm dealing with Workbench entities, World Editor is closed and API is null thus !api check
Thanks, gonna try it
I would think that you'd mod the SCR_LootDeadBodyAction or just simply remove the action from the ActionsManagerComponent in the Character_Base.et prefab
Action script:
https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~ArmaReforger:scripts/Game/UserActions/SCR_LootDeadBodyAction.c
Character_Base.et
https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/~ArmaReforger:Prefabs/Characters/Core/Character_Base.et
@craggy jolt I see what you mean now, I thought you were asking about Game active World
Oh, it is flawed in a sense that owner.GetWorld() != api.GetWorld() does nothing, there is no API even if you have World Editor open, thought it would return the API even for Workbench entity
So just !api for workbench check is enough
If there is no hierarchy, and the entities are not calling on the parent AddChild (Which is what Hierarchy component does) then there is no nice way to get it
Haven't tried IEntitySource yet, wont work in Workbench?
GM PreviewEntity does this iirc
It works everywhere
It goes to the source where the entity was created from
Which means you get the configuration it had
Got it, will try
IEntitySource entitySource = entity.GetPrefabData().GetPrefab().ToEntitySource();
Hmm, looks like I get BaseContainer children, no way to get real entities built out of these in workbench world I suppose?
Nothing like WorldEditorAPI.SourceToEntity
Guess I'm out of luck to easily get child entities in workbench then
GIB WorkbenchAPI
Oh nice thanks!
What do you think those are in the config 😅
But yeah there is no mapping
The thing is, that what you see in the world editor on the left, is for management purposes
Well, at least I can figure out what entity is root through that
It does not tell you anything about hierarchy
Hierarchy is not a thing there
Think of them as layers and sublayers
Yeah I get that's its just a template to build playable world out of it, I was making editor tools for myself and needed that hierarchy outside of play world
@minor agate May I bug you with something I can't figure out?
I store my data in component's class class and get it with TestComponentClass cl = TestComponentClass.Cast(GetComponentData(owner)); inside component. When viewing same prefab in workbench and world editor, root entity component produces and points to difference instance of that class class data BUT child entities with their own component and data point to same instance of that class class data
I built a quick repro project if you're interested, not sure if I'm just a dummy and don't understand it before trying to submit it anywhere
How I found it - Shape.CreateLines is contextual and it was creating debug lines in a wrong world
Was visually debugging class class data
ComponentClass is for shared data
Yes, but why its different for parent/root entity VS child entities?
So it will be shared across everything using the same strand of inherited prefab or component prefab
They are probably different strands
ComponentClass is not the same as static
It's way more complex
Also when I edit child component data in the prefab, it becomes different for children in WB vs WE and remains different even if I revert the change until I restart Workbench 
Well, I guess I'll just live with it
Yeah it got cached
It's why we say to not test things in Workbench game
Just launch Dedicated Server tool. You will remove yourself from many issues.
WB playmode is more suited for world/terrain development
I guess I'll have to call my Shape.CreateLines from different context then and never from class class data config
yeah
Being able to specify world for debug shapes as you can for debug text would've been useful though
Any modification you do down the line, creates a DataClass instance
And anything that inherited in prefab from that
Would let me fix my issue without having to rearrange stuff now
useas that one
If you modify an entity in the world on the data class values, then that one in specific will haave it;s own
@craggy jolt if you want individual data to each component, then just do the attributes on the component itself. Not on componentclass
Yeah, I moved the data to class class on purpose because its 99% unchanged between prefabs and entities
Does a RplProp have to be instantiated?
For example, can it be like so:
[RplProp()]
protected ref MyCustomClass m_CustomClassVariable;
``` or does it always have to be
```cs
[RplProp()]
protected ref MyCustomClass m_CustomClassVariable = new MyCustomClass();
I ask because my PropCompare() for the custom class always returns null when comparing it's variables if not instantiated. But additionally, I can't get the RplProp to replicate properly even when instantiated, so may be related to that as well 🤔
I feel like if it's null it would just become instantiated when it syncs but I'm just guessing
I guess engine is not that smart
Or maybe the snapshots dont know how to compare when its null or something

I'm not smart enough
RplProp to replicate properly even when instantiated
Then problem somewhere else
None of my and most of the bis's props are not instantiated like your example
If you have custom encoding, you should handle the null case yourself of course, it will not do it by itself
I do have custom encoding, yes. It only seems to return null in PropCompare() according to throw errors, so would I need to handle it there? Or elsewhere? And is there an example?
If its null on client, and it gets replicated to non null, then it iwll be initialized
It destroys the object anyway whenever it gets synced
Then recreates it
Which is why you should never try to hold a weak or strong reference to the replicated object
As it it will be a new object every time it gets replicated to the receiver
Yes because if it was null on client, and the server wants to know if to replicate. Then you have nothing to compare props from
Do you have an example of how to handle it?
just return false when the class instance is null
beautiful, now if I can just figure out why the RplProp won't replicate when doing Replication.BumpMe()
yo is it possible to save file in $profile on console boys pls ?
You have to do it on the class that has to be replicated itself
You can't call it from outside a method from within the class
Replication.BumpMe() is context aware of where you called it
It has to be called from a method that is directly under the replicated class
What I'm trying to do currently is, in my gamesystem, I set the custom class variable that is within a component. Then when it's set in the component, I call (from the component, not the system) Replication.BumpMe(). So is that supposed to work or not work?
// in GameSystem (system is set to "both")
void method()
{
// blah blah
containerComponent.SetContainer(container);
}
// in component
[RplProp()]
protected ref CE_SearchableContainer m_Container;
void SetContainer(CE_SearchableContainer container)
{
m_Container = container;
Replication.BumpMe();
}
// currently does not replicate
``` am I misunderstanding how to do it? Because it's how I've achieved it in the past 🤔
I'm a little confused by your explanation, the way I understand your explanation is that `Replication.BumpMe()` has to be called from the RplProp class itself, like in this instance `CE_SearchableContainer`, which I didn't think was the case. But it's also 5am so lol
Replication.BumpMe() has to be called from the RplProp class itself, like in this instance CE_SearchableContainer, which I didn't think was the case. But it's also 5am so lol
No, it has to be by the class that has the RplProp you changed.
When did you call method()
If you do it before the component is inserted and initialized by replication then it won't be bumped and updated
?
Why is peer tool only getting prefab attributes? They don’t receive the instance attribute values.
Hello
Only after I apply changes to my prefabs do the peer tools get the changes.
They don’t receive instance changes. So if I wanted a prefab with slightly different values, peer tool can’t see those ???
Because replication replicates instance by its prefab only
So if your attribute is not synced elsewhere then it will be from prefab
So if it’s an instance value, I have to replicate it manually ?
For "dynamic" entites yes
Loadtime normally creates on both side with instance attributes
Hmmm ok, I guess I need to read the page on the differences with those again. Thanks for your help.
Is it possible to reference the mission header on load/postinit? I'm hitting this issue on mission load.
class
private string m_sAuthorName;
OnPostInit
SCR_MissionHeader header = SCR_MissionHeader.Cast(GetGame().GetMissionHeader());
m_sAuthorName = header.m_sAuthor;
Hmmmmmmmm. Okay, dug a bit deeper. This is only happening in the dedi server tool with the mission header defined. It does not happen on a live server enviro. 
Bug report worthy?
Don't set world and mission header. Mission header says which world. I think that might be an issue and it loads none
I think his point was don’t set the world, but set the header
Omg you're correct. Reading way too quick this morning haha
Same issue 
None the less, minor issue. Just makes checking some logging stuff a pain where I need to do it on the server so no worries.
anyone have any ideas on this?
So for testing features in workbench, is the peer tool the closest I can get to simulating an actual DS environment?
I used the Dedicated Server Tool to test some features, since from what I can see atleast, its the same exact setup as running a regular server. Through this testing, I got a feature to work, put it into the game and it didn't work. Really trying to get over this hill of, "works in workbench, but not ingame" but it seems I lack some understanding somewhere.
So in the resource browser in workbench, I can create scripts in my own mod folders... but according to the documentation, no scripts will be loaded that are outside the default locations - why do I have the option to create scripts in locations that can't run those scripts?
Anyone know of a way to check the terrain name a mission is being played on?
It's not exactly the same. First of all, workbench uses the diag version of executables and it could even differ more if the production server runs on Linux ofc. Tell as what you tried to accomplish, but doesn't work.
Well, you can add custom locations for scripts in the game project options 😉
Don't think terrain name exists as a concept to begin with in Reforger. The place where you configure any names are in the mission header.
Yeah, that's what I thought. I overrode the mission config and will just have mission makers add it for now.
Ty kex
Yeah, I'm still exploring everything at the moment. I've just had to fully uninstall the game and tools to try fix an issue because I can't create workbench plugins as it stands
It's also unclear if workbench plugins must reside in the workbench scripts directory, or if they can run / be placed in any directory.
The method() is called upon registering of the component to the system, which then processes the component into my custom class and sets the custom class variable for the container.
The registering of the component is called with a script invoker, that is invoked after TriggerAreas are done querying entities. And those trigger areas are set to start querying in EOnInit, which if I’m not wrong, is after replication is initialized..?
General question about scripts before I go diving into this new language (SQS veteran). Can scripts still create and/or destroy entities and/or prefabs in scenarios? If so: can scripts also create and/or modify specific components within named entities?
Example: a script, when executed, creates a capture point but is not initially capturable until said point is 'upgraded' via a secondary action.
You can spawn prefabs with Game::SpawnEntityPrefab and delete them with SCR_EntityHelper::DeleteEntityAndChildren. You can't add/remove components at runtime. You are stuck with the components the prefab you spawn has, but for what you want to accomplish, you don't need that. You could just have a member variable on the entity or component that marks them as capturable.
Or you go with an ECS approach and let a system do all the handling that makes the point capturable. The point would then become capturable by registering it at the system.
Does having spaces in a mission name cause a mission to be unable to save or load? We have an issue specifically with conflict. It's just a custom faction set in vanilla conflict. But unable to either save or load it
Good luck!
I couldn’t put a hat on my chap for 7 hours yesterday
Does anyone know how can I link the RankShortName data to TextWidget in overlay like PlayerName linked to Player's nametag data ?
How did they even linked it with player data
The pain and suffering has only just begun 
@ocean kernel is probably on his 39th mental breakdown/ARMA Discord vent for the month (guestimation)
"Is there an option to copy and paste a prefab?
I want to copy a Rigidbody and paste it onto another one, because I edited it, and when I set up a new one, I have to edit it all over again."
you can copy sections of it within the component, but don't believe you can copy the entire component
it'd be nice though
overpowered:P
u mean like this one_
?
like boris marshak
If copy-pasting doesn’t work, open both objects in the Inspector and manually copy over the Rigidbody values (mass, drag, damping, etc.).
- Save as a new prefab:
After configuring the Rigidbody once, save the object as a new prefab.
Then you can reuse this prefab as a base, and change the mesh or other parts without redoing the Rigidbody.
u mean this way?
Yeah, you can use it as a base and create inherited prefabs from it. It'll inherit the rigid body to every child prefab, so no need to redo it
also, this is probably more #enfusion_configuration
i think its not possible because of other configs in prefab and there is many...
Top right hand corner there should be an option to "copy all properties" if I remember correctly
I didn't know that :0, could've saved me so much time
open your prefab in text editor is also epic solution
any way to generate a dynamic forbidden zone in game?
upon further testing, it's not a timing issue as a test bool set as a RplProp replicates properly when called from that same method. So, something is up with the codec I have for the custom class, I assume
At this point share the whole project to see
Something somewhere is wrongly setup
@minor agate question about world systems, is it possible to register a component to multiple systems depending on the state? Or even something like sub-systems?
all available on my github 
Main GameSystem (Line 407 specifically where the custom class variable is set in the component): https://github.com/CashewSan/Central-Economy/blob/daily-backups/source/Scripts/Game/CentralEconomy/Systems/CE_ItemSpawningSystem.c
Component where the custom class variable is contained (Line 52 is variable, setter is Line 282): https://github.com/CashewSan/Central-Economy/blob/daily-backups/source/Scripts/Game/CentralEconomy/Components/CE_SearchableContainerComponent.c
Custom class script (a lot is commented out in the codec to try and locate the issue): https://github.com/CashewSan/Central-Economy/blob/daily-backups/source/Scripts/Game/CentralEconomy/CE_SearchableContainer.c
Can I register to receive events from an arbitrary IEntity (such as getting an IEntity's EOnContact without having my own component on said entity)? I want to figure out if an object attached to my vehicle collides with something, this attachment may or may not exist but there is a component on the main vehicle which needs this info.
I guess maybe a RegisteringComponentSlotInfo might do this? Tried search and just am not sure where to go with this.
Was thinking about it, that custom class is kinda… unnecessary anyways? The component can already store the info needed, no real reason to have it.
Though, still very much curious why I couldn’t get it to replicate. Would be nice to know for future reference
You should have done RplSave and RplLoad on the component, not on the custom class with codecs
I mean you can do whatever
If you can do it in a scripted manager instance, then you can do it in a system
@ocean kernel in restart server all loadout save hide but in profile i see baconloadout folder have saves
probably best to be discussed in #1110586149740748890 or his modding discord
ah, hm, if I hadn't removed the custom class already, I would've tested it to see. But I'll keep that in mind in the future, thank you so much for your patience with me 
Also, I'm running into the issue with a useraction of opening the user's inventory and having it open on all clients. Which is solved by setting HasLocalEffectOnlyScript() to return true, but at the same time, I'm needing to set a variable within a component on performing the action, but it doesn't replicate automatically because of it being set to a local effect. And since the user is not the owner in terms of rpc'ing, it gets dropped since I'm calling it from client, correct?
Is there a potential way to work around this? Or am I just thinking incorrectly?
Thankyou for the response master ref
spaces may very well b a problem, not sure as i lack info of what exactly is happening. but in general the saving capability in the game is very limited until a major update that adds a new system for it
(auto)Saves dont even use the name, only scenario GUID
Hi @torn bane - I have a quick question regarding scripting. If I want to create a whole new system/class, how do I get those c files read by the script engine so that they're acknowledged as new classes and types?
Add to scripts/game/... directory and then SHIFT + F7 for reload scripts
Ahhh ok that's what I was missing... haha
I had them int he directory, but everytime I called the command to test, it just said type not found etc
Thank you
Hello
I have asked Wyqydsyq for permission to do this.
I am having trouble with the random loadout script, everything works fine but on local server there is a clicking sound that happens when AI squad is spawned. I have narrowed it down to only when the weapon is equipped.
plus is there a way to make this code a little better for CPU usage ? my PC lags big time when AI are spawned and yet again the culprit is the weapon.
For magazines and spawning multple consider using TrySpawnPrefab on inventory storage manager, it has a count parameter too
I will look into your suggestion.
it may not be a scripting issue but any reason why the game makes a clicking sound when AI squads are spawned ? only on Local server (workbench & ingame) it doesn't happen on dedicated and it 100% related to this script when weapons are equipped by the AI.
Is the "click" a firemode change?
I don't think it it related to weapon sounds, I can hear it every time a squad is spawned, even if I'm ~1500m (1.5km) away.
let me try get a video of it.
This sound.
Looks like you are running with mods. Try disabling them before you try to repro.
It is only with mods... more specifically with the RandomLoadoutManager, whenever a weapon is Equipped.
Then the answer to your question is don't use the mod if the sound bothers you
we trying to find out what is causing the sound so we can fix it. it is not present on dedicated server only local.
Also do you mean the sound that plays once when you click? The vanilla UI placing sound?
is that clicking/Buzzing sound from vanilla UI placing ? the same sound plays even if the squad spawns via SF SlotAI not just in GM.
What's going on with event order after you recompile the scripts?
When you first open the World Editor its reliable:
- First all
Constructor->OnPostInit - Then all
EOnInit
When you recompile its all over the place, EOnInit gets called before other components Contstructor and OnPostInit
Log:
Component 1: Constructor
Component 1: OnPostInit
Component 2: Constructor
Component 2: OnPostInit
Component 1: EOnInit
Component 2: EOnInit
After recompile:
Component 1: Constructor
Component 1: OnPostInit
Component 1: EOnInit
Component 2: Constructor
Component 2: OnPostInit
Component 2: EOnInit
More specifically my entity components fire all their initial events before gamemode manager component events 😠
Can't use systems as I need this logic during WE Edit Mode
I have a score system run on server and a scoreComponent in player controlled Character. The component will register to the syetem onInit and unregister from the system onDelete. But how can I handle the situation when player disconencted and reconnect to the same character?
Tie score to player identity rather than units?
can I use onPlayerDisconnect and OnPlayerConnect Events? Will the player spawn a new character or just connect back to the old one?
you mean the Player controller?
Player index probably
int playerId
Don't delete the player score state when they disconnect, just keep re-using it when they rejoin
yeah. I have a json file with playerUID on server for every player. The problem is if a player disconnet and his charater is not deleted, when the player reconnect, I need to handle the register/unregister things, otherwise he will maybe have two score components or mixed his score.
Hey @torn bane a quick follow up question regarding scripting structures... why use core, game, gamelib etc...? What's the differentiation between those directories? Does it initiate the files differently? Does it determine when the script is loaded and executed?
and a follow up - if I placed a script in Core, would a script in Game not have any reference to it?
For example; if I were to create a new class in a script for a mod that runs only on the dedicated server host, and not any of the clients, would I create that in Core or Game?
basically everything you do goes into game
hello Arkensor, when player reconnected to a server in a short time, will he have the exactly same character entity and components when using find controlled entity function?
In what scenario would you use 'core'?
one you know enough about scripting at which point it will become clear to you what goes wherre 🙂
reconnect will give you the same entity back yes
lol but that's the point, I'm trying to learn this new enfusion engine stuff, and I'm not sure how anything starts at this point.
that is why you want to keep it simple and not worry about this until you need to 🙂
okay thank you. So I can use the onPlayerConnect()/Disconnect invoke in a component (in character entity) to handle player reconnect. the initial problem: #enfusion_scripting message
character might die and then your data is lost on respawn of a new one. save the data per player identity
Yeah, but these questions I've got aren't documented (or at least I'm really struggling to find them). Like I said, I want to create a new class system in a mod that's dedicated server host only, and I'm not seeing any documentation around this... this isn't a 'simple' endeavour, but this project is the only reason I've got reforger ahead of Arma 4 - to prepare for it 🙂
Like I don't want to go through weeks worth of scripting to find I'm actually scripting in the wrong place all along, and have to then convert and move everything and re-debug it all
The data structure wiki for example references the wrong directories for scripting; https://community.bistudio.com/wiki/Arma_Reforger:Directory_Structure
yeah I have a json file saving with UID. I need to handle the score component unregister when player disconnect/reconnect though to prevent the player has 2 score component
info on this is available by looking at what was placed where in vanilla and using search method here. what you put where for your game mods makes no difference
So whatever is loaded in 'core' is available in 'game' and vice verse?
core -> gamelib -> game -> workbench game
I think I can figure out it using OnDelected, OnConnect, OnDisConnect
but most of what you need is in game so any logic placed in core or gamelib is super limited. just use game for your mods
OK, thanks - I just wanted confirmation 🙂 Appreciate the help!
Ok so there is another way by comparing the user entity to the local player, yes the script will still trigger for players in viscinity but you have all players except the one using it disregard the action, but really the best way to do this type of thing is have action trigger component method with a server check, that component sets the RplProp
If someone have a solution to find current platform of a player (XBOX,PS5 etc...) on server side pls 😄 it will help me a lot !
try this
thx brother ❤️
Would anyone be able to tell me how I can make a list of world entities in a component?
I basically have some entities in the map, which are going to be Faction dependent whether or not an Faction USSR MOB spawns next to it, or US MOB spawns there.
So I want to place those entities in a component which is attached to the mob, and then compare faction after the game has started to set variables in the map entities.
I tried to make an [Attribute()] variable of "protected array<IEntity>" (ref also didnt work), but it won't show up in the Object properties tab to allow me to add entities to it.
try this maybe #enfusion_scripting message
Thanks for the super quick response, will check it out!
That unfortunately doesn't work, as it's connected to .config files and resources. I am talking about differentiating between map entities of the same prefab in a component
Looks like you need class with static array to collect "too yearly initialized" components 
Yeah, something like that
where can I find the menu UI script of vehicle service?
Try looking into the QueryEntitiesBySphere() function/method. You can fill up an array with whatever entities are around your sensor entity. Then use that array to determine the faction. I don't know how you'll probe which faction each captured entity belongs to though.
SCR_ScenarioFrameworkSlotClearArea
slotClearAreaComponent.m_aPlugins.Insert()
How to create instance of plugin? Or how to insert plugin to component from script?
For example, this plugin SCR_ScenarioFrameworkPluginTrigger
I think with my setup and how I need to process stuff through the user action, first option with the local player check is my best option. Thanks for the insight!
Welcome as to why systems and controllers exist in enf now. And why i mentioned to avoid doing logic on components
Pure engine stuff goes into Core, game agnostic APIs provided by engine for game usage goes into gamelib, actual game implementation goes in Game
Core gets compiled first and its main function called, gamelib gets compiled second and its main function called and core is available to gamelib. Then game gets compiled eith main func called, and gamelib is available to game and thus core too is available to game
As a modder, game is all ypu need
So for example, if we made a plugin to evaluate server performance, that would go into core?
No
Just use game
Pretty much nothing that is not engine related should not be in gamelib or core
Also if you do core, you cant access anything on game or gamelib
😭 why... this can get stuck in an infinite loop.. SCR_BallisticTableDisplay
And you will not have managed instances by default, by default you will have to manage your instances like plain pointers @wraith pagoda
Physics stuff if we were trying different things?
Or just stick to game
Do it in game
🫡
We might block those script modules in the future
wait what 
Are you asking or reporting?
complaint, it's done in two parts and can get stuck in an infinite loop when using it on a turret not setup like a mortar.
That is a sin among sins to have a while loop like that
Here is fhe wrong part (it will get lost, trust me)
Do it on feedback tracker
I hate the feedback tracker, been a year and my code fix to marker system still nothing done with it 
But whats this about script modules
pls no takeith
Pretty sure it's been over a decade and still nothing done about setvelocity causing violent crashing in a3, I can't trust the feedback tracker.
It would make sense to block them out if there's no design intention for the modders to use the namespaces
While I've got you here and posting @minor agate - can you confirm if we make a custom map, that the map would be available in Arma4 to port in?
There are way more issues than those that community have reported
Eventually they get fixed
Otherwise you would barely see bugfixing ont the changelogs
You would have to do quite some rework, specially if you used features and scripted entities.
But we plan to provide some tools to ease in the transfer.
Terrain stuff itself should not be too much affected except for references to script / classes that might not exist in A4.
Pure entities and pure terrain should be fine. Specially of your own.
Is the intent to align A4 with Reforger as much as possible in terms of script/classes?
No. That makes it quite hard to change things/improve
Some things will be similar, some wont. I suggest to mod based on that some update process will be needed.
Enfusion stuff might be similar, but game stuff is hard given that A4 is a new game, not an update to AR
Hi everyone, can you tell me if it's complicated to make a script for a server, that identifies a player who uses a key combination example “ALT + Enter” and if he uses it it does an action?
Think of it as pre 2.8 blender and post 2.8. Similar, but not quite
the idea is to create a script that kicks players who use the night vision glitch, ( alt + enter )
Found this in scripts, made me lol! ```
Typos+in+Workbanch+parametrs
You mean a keyhandler?
Yep
There are main func? 
Yeah but its not a main in the sense as the main method called to initialize the whole application
Its a method that each script module can call on its own when initialized
Function*, not a method
No, I already use it for my shitty json parser 😭
I said we migjht, I am not entirely set on it. But it was brought up at some point due to issues with it.
Like the one I mentioned were people are leaking memory because they do not know that classes in Core and Gamelib do not automatically inherit from Managed
- The confusion it makes to new modders
Can't have that in WE Edit and I need it there for debugging
I want to re-use same code to work in WE Edit and WE Play
I guess you can't have controllers in WE Edit either?
Generally, within the same class, is it better performance-wise to set/get variables directly or through a setter/getter?
Like for instance, doing:
if (m_Variable)
``` vs doing
```cs
if (GetVariable())
if it 's just a return var, then doesn't matter
what about if setting a variable?
not sure
personally I prefer to do direct access if it's defined in this class and there are no additional logic required
What would be the best way to create custom map markers for the in-game papper map, so i can display custom icons on the papper map instead of just text, also does anyone know why the in editor paper map wont open but the animation of me opening the map works, the papper map works outside of the editor just fine but not in editor
SCR_ScenarioFrameworkSlotClearArea
slotClearAreaComponent.m_aPlugins.Insert()
How to create instance of plugin? Or how to insert plugin to component from script?
For example, this plugin SCR_ScenarioFrameworkPluginTrigger
How can i off this arsenals ?
I wondered the same thing about the map not working in workbench.
It just shows nothing unfortunately!
That means the world doesn't have a map entity. For instance, MpTest.ent has this issue. Rather go with SF-Tutorial-Navmesh.ent, which is also small, but has both an AIWorld and MapEntity.
Quick question: Which one of these functions will be run on the server and which one in client?
The Component is a ScriptComponent within the PlayerController
[RplRpc(RplChannel.Reliable, RplRcver.Owner)]
void RPC_DoSetUnitsNearby(int friendly, int enemy)
{
Print("SetUnitsNearby: " + friendly + " " + enemy);
}
void SetUnitsNearby(int friendly, int enemy)
{
Print("RPC SetUnitsNearby");
Rpc(RPC_DoSetUnitsNearby, friendly, enemy);
}
weird hmmm
Yeah i have that entity in the world
From my understanding, RPC_DoSetUnitsNearby is Client-Side, and SetUnitsNearby is Server-Side. Is that correct?
Server can be owner, even on MP Dedicated environment
But given that it is PlayerController, you can expect RPC_DoSetUnitsNearby to be client that owns the PlayerController
Unless the client is also the server, like in WB playmode
got it, thank you!
"Does anyone know how to fix the ShopSystem Wallet? I can sell items without having a wallet.
and the money is simply gone."
$200 for some nails? Man, inflation really has gone through the roof!
@torn bane hey dude - sorry to disturb you again - I noticed you're the owner of EDF on github - and I can see that MySql is planned to be implemented in the mod.
Is there any intention to make database connectivity native in Arma4 so it's not a mod?
yes i try to make a wallet check
so before u can sell it check if u have a wallet
i think i got it
MySQL is something i will probably not be doing, though i will provide an example for relation database structs for the upcoming vanilla persistence system. document databases will be the better choice, also for A4. No we will very most likely NOT include any native database driver within the games and or servers executable, not even sqlite. Maintaining them across diffient distributions for linux is too much of a pain to justify and we would need to expose the countless options into script or else somone will complain that xxx flag operation is missing from the driver options.
Instead, a standardized http based data protocol is in my draft box right now with maybe some out of the box implementation for couchdb - as we use that ourselves at the company and it comes with a http api out of the box without the need for any middleware to translate request into query with connector and back.
We have improvements to the script exposed rest api client on our todo list as well. In Reforger we will try out this new built in persistence system and see how it integrates with community needs and adjust based on feedback. We will then very likely just port it to our shared projects to be used by Arma 4 and other future BI games that could benefit from such feature.
Not having native database drivers is a good choice
Would love to see what you guys come up with for the http request model
That sounds great! Never heard of couchdb before, but I'll look into that if it's something that's got an OOBE.
need help with wallet check by sell items
bool PlayerHasWallet()
{
SCR_PlayerController playerController = SCR_PlayerController.Cast(GetGame().GetPlayerController());
if (!playerController) return false;
IEntity player = playerController.GetMainEntity();
if (!player) return false;
SCR_InventoryStorageManagerComponent inv = SCR_InventoryStorageManagerComponent.Cast(player.FindComponent(SCR_InventoryStorageManagerComponent));
if (!inv) return false;
array<IEntity> items = {};
SCR_PrefabNamePredicate predicate = new SCR_PrefabNamePredicate();
predicate.prefabName = ""; // получаем всё
inv.FindItems(items, predicate, EStoragePurpose.PURPOSE_ANY);
foreach (IEntity item : items)
{
string name = item.GetPrefabData().GetPrefabName();
Print("DEBUG: Inventory item found: " + name); // Отладка
if (name.Contains("Wallet_era"))
return true;
}
return false;
}
when i sell item and has wallet is still says i have no wallet on me
there is a method on inv manager with deposit count by resource name that replaces all this code. Also the playercontroller only works locally like this and this code will fail on the server
u know how to fix it? i cant get it work
omg i think i got it to work i try now on server
now it works fine in enfusion tools
need to publish
GPTChat nevergiveup 😛
got it to work
but maybe u can help with this i try to off this option
How would I go about determining the rank of all the items the player is wearing, so that I can determine the highest rank item in their equipment?
Hey I want to overwrite enum EEditableEntityLabel to add a new vehicle type label for a water vehicle arsenal. I tried duplicating the EEditableEntityLabel.c but it remains read-only. How would I write a script to overwrite the enum otherwise?
I was thinking I could just add it to the end of the vehicle types list as it only goes from 51-55
VEHICLE_CAR = 50,
VEHICLE_HELICOPTER = 51,
VEHICLE_AIRPLANE = 52,
VEHICLE_APC = 53,
VEHICLE_TRUCK = 54,
VEHICLE_TURRET = 55,
Is there a way to prevent items from being put in a storage, and can only be taken from the storage?
Guess this might be more of a #enfusion_configuration question 🤔
There is a CanStore() (something like that) method I believe
CanstoreItem
I can't remember, just search canstore
Hm, I guess I need to be more specific. That works, yes, but not how I'm intending. Really need it to just not accept any player deposited items, but any deposited by script is fine
Don't know if there's a simpler way than going through the process of setting something in a component on the deposited item to allow it
You could delete the item once it’s removed from the inventory?
Nah, don't wanna delete it. Ended up going the route of having to add a bool in my existing item component to check when depositing items, whether it was deposited by my useraction or by player directly (restricting depositing if by player)
typedef func Log;
typedef func LogWorkbench;
void Log(string log, LogLevel level = LogLevel.NORMAL)
{
Print("----- KOTH: " + log, level);
}
void Log(int log, LogLevel level = LogLevel.NORMAL)
{
Print("----- KOTH: " + log, level);
}
void Log(Managed log, LogLevel level = LogLevel.NORMAL)
{
Print("----- KOTH: " + log, level);
}
void LogWorkbench(string log, LogLevel level = LogLevel.NORMAL)
{
#ifdef WORKBENCH
Print("----- KOTH (Workbench): " + log, level);
#endif
}
void LogWorkbench(int log, LogLevel level = LogLevel.NORMAL)
{
#ifdef WORKBENCH
Print("----- KOTH (Workbench): " + log, level);
#endif
}
void LogWorkbench(Managed log, LogLevel level = LogLevel.NORMAL)
{
#ifdef WORKBENCH
Print("----- KOTH (Workbench): " + log, level);
#endif
}```
wondering if there is a way to add current class / method / line to this ? like `__CLASS__`
I created a new script and copied and pasted the original enum with the new label
VEHICLE_SHIP = 56,
No errors but its not appearing in the drop down when i go to the Authored Labels in EditableVehicleComponent
NOTE: I tried defining the enum as modded at first but got weird errors that i didnt know how to fix
You don't need the original enums in there, just add yours ( VEHICLE_SHIP = 56, ) and put modded in front of the enum
also, when modding an enum class, it's usually best practice to just do VEHICLE_SHIP, instead of assigning it a integer (unless you just absolutely need it to be 56 for some reason). It'll auto allocate it's number and allows for compatibility with other mods that also mod the same enum class.
Because if two enums are assigned 56 from two different mods, it'll cause incompatibility issues for said mods
How to enable player movement while a menu is open?
I got it. Use SciptedWidgetComponent
You only have __LINE__ and __FILE__
For types, you need to get an instance of something, get the type then ToString()
Running into an odd issue...
I'm loading a config from the profile folder to a BaseContainer, then creating a instance from the container, and all loads fine most of the time (except there's always an error stating this, whether it loads fine or not):
RESOURCES (E): Wrong GUID/name for resource @"{0000000000000000}$profile:/CentralEconomy/CE_ItemData.conf" in property "m_sDb"
But besides that error, noticing an issue where, at random seemingly, it'll not load the config from the profile folder, and instead load a config I use as reference from my mod's internal config folder..?
Here's my code for loading it:
if (Replication.IsServer()) // only create the config or load config if you're the server
{
string m_sDb = string.Format("%1/%2", DB_DIR, DB_NAME_CONF);
if (!FileIO.FileExists(m_sDb))
{
CreateConfig();
}
else
{
Resource holder = BaseContainerTools.LoadContainer(m_sDb);
m_ItemDataConfig = CE_ItemDataConfig.Cast(BaseContainerTools.CreateInstanceFromContainer(holder.GetResource().ToBaseContainer()));
}
}
I'm just not sure how it's getting the idea to pull from the config in my mod's internal config folder? A config that isn't even named the same
Because thr guid might match
The path has nothing to do if the respurce is registered (meta file generated)
Engine prefers to use the guids
Also
Dont do stuff in profiles
Profiles folder on itself is also another addon/mod
Game directory is treated as its own addon/mod as well
They don't, seemingly. The correct one I need isn't even registered (as that's why I'm getting the error in console), so it has no GUID. And the other one is registered and can guarantee it's GUID isn't 00000000000
Any override you place there, will take effect like a nornal mod
If both have no guid, then the engine resorts to path
On which it obly cares about the path without your project dir
If you load it with local path, the the one that loaded last will take over
On which if no dependencies are set, can be random
If you want to avoid issues, register them
Ehat are you feeding here in the file path?
Dont do a guid of 0, that is still technicslly valid
Just ignore the {GUID}
Also if you are using $filesysten then thr guid makes no sense
the goal with the mod was to allow config adjustments without the need to override in a mod, which only seemed possible with creating the config file in a external folder (like profiles) and then pulling it from it. How would you recommend otherwise?
Guid is for resource database resolution, which should not be used with exact paths
protected const string DB_DIR = "$profile:/CentralEconomy"; // directory name in the server profile folder
protected const string DB_NAME_CONF = "CE_ItemData.conf"; // config file name in the server profile folder
string m_sDb = string.Format("%1/%2", DB_DIR, DB_NAME_CONF);
``` m_sDb being the container
so no GUID is even present in the pathing
And why I chose config over JSON? Config is easier to adjust and understand when loaded into workbench, and less likely to error when adjusting
Config is the right choice here
Dont use json except for when dealing with restapis and need to generate a file for them
Or for external services
I will go to pc and check your stuff later. Rn on phone and hard to focus rn
All good! I appreciate it 
I suggest you do not make such functions with common names under no class
Very easily to clash with others, or even us in the future
"I need to know how to find which part of the car each collider belongs to."
which file of car i need to open? i cant find Engine
open .xob file / colliders
thx found it
What exactly is WorkshopApi.GetInGameScenario and why might it return null for workshop downloaded scenario? I'm trying once again to get my scenario save/load to work (for third time).
Hi, is there a function or method to tell if a Character is unconscious (server-side)?
CharacterControllerComponent.IsUnconscious()?
Am I supposed to be able to debug the actual game with this? I have never gotten it to connect.
I guess you need to run the diag game. Not sure exactly about the details.
@torn bane Couldn't find an answer, are systems planned to be made available in WE Edit Mode world too?
Having to host logic that should be in a system in a gamemode component right now so its accessible and debuggable during edit mode
What a bad decision
😭
Can't easily use components as singletons => Use systems
Can't use systems during edit mode => 
Might as well abandon systems all together then
And just do everything in components
Just make a static manager of some kind, then you control when it is instantiated and when it isnt
If you rely too much on vanilla things you will suffer
Yeah, ended up doing that, pretty annoying having to check if components are trying to call static methods from another world each time
Was also thinking about BaseWorld->Manager maps so static method redirects to proper component in that world
does anyone know if you can specify a custom / dynamic EDF_DbName in the persistence framework?
Everything I've seen is just running [EDF_DbName.Automatic()] which I think uses entity type, but I'm wanting to have them named as specific strings applied at run time
It's probably a bit more complicated if your manager actually requires the world for something
Mine doesnt so I can just spawn it from inside the game mode entity if it doesnt exist and it's fine
Yeah, map could be useful if you really need that manager in another world, not my case so far
Still, very bad idea to not allow systems in Edit Mode world, the world has everything except simulation, no reason it can't have non-simulated systems in it
Make systems have _WB methods similar to entities and components so they can be initialized and debugged during edit mode
Anyway, guess I'll just do it all in components
Thank you. That works.
when i have no Engine inside? its hard to make engine collider?
okay when i use this code
modded enum EEditableEntityLabel
{
VEHICLE_SHIP
};
it says scripts/Game/Editor/Enums/SHD_EEditableEntityLabel.c(1): error: Unknown type 'EEditableEntityLabel'
PM sent. This question better in model part:
https://discord.com/channels/105462288051380224/976159912679850004
Why does MissionHeader.ReadMissionHeader return null for valid mod mission header? Think it is what is blocking my scenario from being able to continue sessions.
omg its because mods are not loaded in main menu.
Is that an oversight? I can't be the only one who has ever tried to get save/load working locally.
so should it be
modded class enum EEntityEditorLabel
i feel like 1 line of code is kicking my ass way harder than it should
Even with -addons I still can't continue session due to the other thing. #enfusion_scripting message
devs plz 😭
No it's not, You are trying to mix two things together that were never meant to be
WE stuff should stay within the WE update loop, which is different than those intended for game
WE should be tooling only
Workbench stuff should always be kept separate from game stuff
You can't debug the system without running it then? Do you just make a copy of a system as say component to say simulate how system gets setup when its gonna be run for real?
Both sides work differently as well, so they are not nicely interfaced by a single way
?
You can debug it, just run the game and connect the debugger to it
Or what do you mean?
It's not advisable to try to setup a test of this kind on Workbench Edit Mode
It works very differently than the normal game, it is not the same by any means
For quick testing, use MPWorld or a very minimalistic world
That way you do not have to wait minutes for even being able to test
For example for Campaign, we test on Campaign world. not on arland or so during dev
I get that, the issue that its very inconvenient that you can't test system setup and initialization outside of play mode
What do you mean by this?
Do you want to test for misconfiguration?
In my case I have components all over the map, I have areas designated on the map, my system will go through all components and configure them depending on components nearby, which areas they're in, put it all into gridmaps etc. But since there is no system in WE Edit mode I can't see how this initial configuration will work out, write the tooling to prepare my components and areas better, make system run through initial configuration again on changes, etc. I have to go into Play Move, do start menus, toggle diag menu bool (if it wasn't), go into Game Master, fly all over the map to see how it all works, etc. Then go back into Edit mode to adjust something and repeat it all again.
I don't want system simulated and doing frame events or anything like that, I want an instanace of it in edit mode, so world entities and components can call it and do the same inital data processing that system will do in play mode
You can make Workbench plugin for this
If there is a better way to do this, let me know. So far it all points to just not use the systems and use manager entity/component as it works in both edit and play modes
And copy paste code from the system there?
You could share the logic if you compose it I guess, depends how heavy you made it into game update loop
Split that logic elsewhere and have both WB Plugin and System call it? Might as well just have it in a manager that's already available everywhere.
Well, I don't hope you guys will change your minds on systems, I'm just sharing that I think its wrong.
Systems can init on and operate world entities and components and it makes no sense to me why edit world with entities and components doesn't have a system that can at least init
YOu have the game for that
If you want to test game stuff on game env, then do it there
If you want to setup things, do it in WB. If you want to test setups, do it in WB.
Game systems should not run in WB
As workbench is just a tool to build the game, and should be external and not tied to the game
That is why on our side, you also do not see us making this sort of interface.
If you want to test configurations, then we do plugins. Which run the neccesary sanity checks.
There is also the thing with workbench on that you should never deal with IEntity instances
That is just wrong, which makes the systems, component, entity thing not valid
In WB you use EntitySources and ComponentData
It's why I also mentioned this on the first or second modding bootcamp
As it;s common mistake
I showed an example of why not as well
I get the design philosophy of it, but not having the system at least initialize (call constructor, OnInit) is going against it if you ask me
There is no ECS in WB
Imagine if you said no components can't be initialized in Edit Mode, run Play Mode for that, the best we can do is display a mesh from MeshObject for your entities.
If you really want this, easiest way is to create a test world
And a plugin that auto runs it with the tests
If you are really dependant on the systems that is (Because or linkage or many other things)
So, you do not want the systems running. Just initialized in WB?
(Asking as if it makes sense to the design then it might be well to request it)
Yes, I excepted it to run initialization in the same way as entities and components do
To be honest I'd be fine with a manager entity/component if not for unreliable initialization order
Did you try overriding ShouldBeEnabledInEditMode to true in the system?
Should do what you want
Hmm, just tried it, no constructor running, FindSystem finds nothing in Edit Mode
WB restarted and such, no change
Only single usage in AnimateWidgetSystem, does it even work at all in our version of Enfusion?
Seems to have been something added by game team, but not supported by design by engine
So treat it as obsolete i guess
From a enf dev related to this
Entities and components exist in the world. Systems do not. They are just meant to do the game simulation, and there isn't one in edit mode.
There are some plans for visualizations and testing based on what systems are setup. But that is probably too far in the game for AR
Very inconvenient that you can't see how system initialization will behave in Edit Mode the same way as you can test initialization for entities and components
It's just not there for AR
Same as with world controllers or the rest of world system
AR version is quite outdated for this
Thanks for checking it out for me!
Btw I might sound a bit negative about it, but I am just trying to make sure you understand that it is not a thing supported right now and why. But the idea of checking these connections and setups are valid. Just not in the way of running the systems as that implies there is game simulation in WE.
But the data is there, if it's there then it makes sense to be able to peek automatically. It's something that has been asked about internally as well so it is not so much of a corner case
Glad I could express my point and maybe even influence it a little bit
~~Did you ever get a chance to peak at it? Here’s the GitHub link to the script handling the config loading https://github.com/CashewSan/Central-Economy/blob/daily-backups/source/Scripts/Game/CentralEconomy/GameMode/CE_WorldValidationComponent.c
Oddly, I seemed to notice a pattern earlier with it that it somehow uses the wrong config if my spawner entities are a child in a building prefab. One’s that are alone (only in the case of testing) seem to be fine. It’s as if the incorrect config is cached somewhere? But the only way to pull the universal config is directly through the component I sent the script for, so I’m entirely unsure. I’ll have to comb through it some more. Registering the config in the profile folder makes no difference, nor does directly assigning the config through an attribute~~
solved it, was due to a static variable that shouldn't have been static
Was additionally thinking that maybe it could be a client vs server issue, as client is never set to pull the config. But even testing just as server localhost (no peers), the issue persisted
Here's my most recent attempt. Now error says it cant inherit the orginal enum
error: Can't inherit class 'EEditableEntityLabel'
Can I get some info on this 9f768299-3838-4ce1-ab06-b661573d7adb curious how bad I screwed that one up 
nvm on that.. but doesn't seem decal is the way I want to go... Anyone have any suggestions I am stumped and extremely tired.
embrace your long exposure feature https://images.unsplash.com/photo-1620245503040-e4fc17ec5368?fm=jpg&q=60&w=3000&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mnx8bG9uZyUyMGV4cG9zdXJlJTIwY2l0eXxlbnwwfHwwfHx8MA%3D%3D
looks dope 🤣
trying to fake it till I make it.. LightEntity is too limited so i'm trying to recreate it but hit a wall with how I should go about doing the projection
Give up
Not saying this because I want to discourage you, but decals until the next engine update are kind of bad for projecting them on things that arent terrain
I mean I hope, I don't actually know
maybe in arma reforger 2
Anyways what are you tryna do in the first place?
Make a IR laser beam of course. I already use LightEntity for it but LightEntity sucks ass. I guess I can just go with option B which is spawn a little glowing ball lol
the way I did it for giggles was drawing a mesh between the gun and the traced hit position
you can't use light for IR because then AI spots you
Here are some of my experiments
#1088551349752434798 message
Well currently all my light sources are not done like how people normally use them, they're actually spawned locally for each client but what i'm doing right now is locally spawning in a small mesh, stretching it to the end of the trace and now I need to fill in the final gap which is the end projection. Decals seems to be going horribly wrong and I guess if I have to I'll just spawn a secondary mesh and put it at the end.
I was able to draw like a 1 km long beam but collision detection is wonky
Or I guess I could put it into the current one..
that means your mod is... multiplayer only? since in singleplayer they'd spot you
Suppose so but I never put single player in mind

I'm a multi-player only person 😁
But with the new one it'd work.. since its just a mesh with a tiny emissive source or well the one i'm trying to work on.
That sounds fair. Lights are cursed as well, they go through certain objects.
Yeah, that and they're limited to 100m so that's why I'm trying to break away from the lightentity whenever possible. The only thing that wouldn't work in SP I guess is the illuminator part but oh well, not my prio.
If you draw/scale a mesh for the beam then AI dont care but it'll look quite weird on the receiving end
I think that's how arma 3 did IR lazors
you got a suggestion for me or what
Ended up just attaching a small ball at the end, it'll have to do for now 😔
Since there's not multiple instances of a gamesystem class in the world at a time, if I called a method in the system from multiple components at the same time, would they overwrite each other?
since i's singular instance, you'd just be calling that method, you aren't overriding anything doing that.
Obviously duplicate logic probably can just get handled by system and the methods simply give updates to the components
Did you try asking the SCR_EntityCatalogEntry what rank the items are?
Apologies
Gotcha. I think I have a case where I have multiple components calling the same method in a system, and that method returns a custom class of mine to be added into an array in each component. But it seems that because the components are calling it at the same time and the system is a single instance, the returned classes are getting mixed up between each other. If that makes sense?
That's probably the issue I'm running into, it makes sense why it would be I think at least, but I guess testing is needed to prove it
So yeah if you are returning data others might manipulate first, that would be one reason
but each call of the function is a unique instance, there shouldn't be any time where it's shared if that makes sense, the runs are sequential but order is not easily known in this situation
yeah, from testing, it actually doesn't seem to be the issue. So now I'm even more confused
My configs, that are separate instances of the same config class, are somehow getting mixed up in initialization sometimes and I can't figure out where or why
Solved it, I think. I had, at some point, set a variable in my custom class to static and didn't revert
Seems to work now
curious to why the design decision was made to make notifications function off of defined configs instead of displaying a passed string
I guess I have to iterate over all the items the player has, is there no way to do this more efficiently?
Seems decal deletion crash
Does someone have an idea on how AnimateWidget.Value works? I can't get it to work properly
@torn bane Got a, hopefully, quick question: with EPF, how could I go about preventing a persistent entity from spawning if a variable is set within it's component save data class in the database?
I assume I would need to override EPF_PersistenceManager::SpawnWorldEntity() and get the component save data through the entity save data, but I also assume it wouldn't be as easy as returning null if it's set and then all is well 😅
Ideally by overriding the data during save. you can already call a method there to override self spawn and disable it. you should set that as soon as external code sets the variable you are looking for. that way on load it will not attempt to respawn a car that has e.g. "in garage" variable set
Gotcha, will give it another look when I wake up. For now, it is 
I appreciate the quick response!
For anyone having the same question, I got it working by creating a new Animation class (in my case for a progress bar):
// Copied mostly from WidgetAnimationValue
class WidgetAnimationValueProgressBarCurrent : WidgetAnimationBase
{
protected float m_fValueDefault;
protected float m_fValueTarget;
protected float m_fValueCurrent;
protected ProgressBarWidget m_pProgressBar;
protected override void ReverseDirection()
{
float f = m_fValueDefault;
m_fValueDefault = m_fValueTarget;
m_fValueTarget = f;
}
// Changing this part to the needs (setting current value in ProgressBar in my case)
protected override void Animate(bool finished)
{
m_fValueCurrent = Math.Lerp(m_fValueDefault, m_fValueTarget, m_fValue);
if(m_pProgressBar)
{
m_pProgressBar.SetCurrent(m_fValueCurrent);
}
}
void WidgetAnimationValueProgressBarCurrent(Widget w, float speed, float targetValue, float defaultValue)
{
m_fValueTarget = targetValue;
m_fValueDefault = defaultValue;
m_pProgressBar = ProgressBarWidget.Cast(w.FindAnyWidget("LiberateUnitProgressBar"));
}
};
// Usage
WidgetAnimationValueProgressBarCurrent animCurr = new WidgetAnimationValueProgressBarCurrent(m_widget, 2, friendly, m_progressBar.GetCurrent());
AnimateWidget.GetInstance().AddAnimation(animCurr);
Hi,
I have the following plan:
We would like to have a live map of the players where you can see how the players are doing and, in addition, a replay function so that you can better understand whether it was an intentional TK or an accident. We also want to use this for our group reward system.
Since I don't want to send the position data of 128 players to an API, I want the client to do that. The idea is to have the client load the current pos. data into an array every second, for example, and send it to the API after 10 seconds. (The API backend is not a problem (I can also validate whether the player is actually currently on the server). Do you have any tips? I have now created a script component for the player manager.
Do you have any tips?
my tip would be to do it on the server side, not on the client, which is a very, very bad idea
- it is a security risk (how do you know the request really comes from player X)?
- you expose yourself to a DDoS
- cheaters will just disable or fake this
- BI has stated in the past the API client in future will be server-only
- single request from your server carrying 128 data points is much less overhead for your backend
Does anyone know an example or implementation of polygons/shapes on a map? In my case: I want to draw a circle (showing an Area of Operations) on the map
Hi, when I try to retrieve the uid of the player in an interaction on workbench it works but when I try on a server it doesn't work, do you have any explanations, to retrieve the UID I use this : GetGame().GetBackendApi().GetPlayerIdentityId(playerId);
Well biggest flaw in that is letting the client have access to the api but excluding that pretty sure only the server can utilize the REST system so... yeah.. There's a few ways to approach this and one alternative that comes to mind is having a schedular on the server and a system on the client. The clients system will collectively record whatever data you want and the scheduler will periodically go through players and request the stored data from them, the client will respond and then empty their result to start collecting new while the server sends off what it received.
But honestly having the server do all of that isn't a big deal, its already actively collecting that type of information anyways look into the stat system there's a module specifically about calculating travel distance you can modify that to achieve what you want.
Backend stuff is only accessible by the server so if its executing on the client it won't work, you'll have to have the server do it or tell the client who they are.
so the interaction with the ActionManagerComponent is on the client side? and for this to work, how do I go about it? do I have to make a component attached to my player, or can I call a function that makes a call to the Rpc to retrieve the uid on the server side?
Depending on how the action is setup its either running on the client, running on the server or running on all (client(s) + server).
These two methods determine who executes the action. If you want the client to know the UID the server will have to retrieve it on the actions execution and then through some method Rpc it to the client with the UID so yes some sort of component or add an rpc to the playercontroller. (The following below is the default setup for an action unless overriden)
//! Does this action only have client side effect?
event bool HasLocalEffectOnlyScript() { return false; };
//! If HasLocalEffectOnly() is false this method tells if the server is supposed to broadcast this action to clients.
event bool CanBroadcastScript() { return true; };
I understand, but how do you configure the actions?
By overriding those methods in your custom action and returning either true or false. (Waking up a bit more) seems the default config is already set to run on the server and client that executed it so you just need to check if server -> Get player id from User -> Get UID -> Send that to player that executed
Crude example that should work...? By no means should you cram a bunch of rpcs into the player controller, this is just an example of a very specific use case of server->client. Ideally you would have a component attached to the CharacterBase and use that for more complicated things.
class TAG_MyCustomAction : ScriptedUserAction
{
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
{
// crude potentially unneeded safety but brain isn't fully woken up yet
if (!Replication.IsServer())
return;
PlayerManager manager = GetGame().GetPlayerManager();
int playerId = manager.GetPlayerIdFromControlledEntity(pUserEntity);
SCR_PlayerController playerController = SCR_PlayerController.Cast(manager.GetPlayerController(playerId));
BackendApi api = GetGame().GetBackendApi();
if (!api)
return;
string uid = api.GetPlayerIdentityId(playerId);
playerController.TAG_SendPlayerUID(uid);
}
override bool CanBroadcastScript() { return false; }
}
modded class SCR_PlayerController
{
void TAG_SendPlayerUID(string id)
{
// Only the server should be using this method
if (!Replication.IsServer())
return;
Rpc(TAG_RPC_ReceivedPlayerUID, id);
}
[RplRpc(RplChannel.Reliable, RplRcver.Owner)]
protected void TAG_RPC_ReceivedPlayerUID(string id)
{
// do what you need to do
}
}
Is there a way to tell when an AIGroup goes "idle"?
Define idle? You might be fine with combat state for example, or maybe you need to know if they are just doing nothing? Not even moving to waypoint
Idle in terms of not fighting an enemy
I got you standby
HM actually group has only threat measure. Maybe you could loop over all group members and fetch current threat state from the AI Info Component
Is there a way to make it so the in game kill count, counts killing ai instead of player kills?
i see hmm
thank you though!!
There is something like has target, but I won't be able to share my code until after work tonight.
😔 You were right bacon, I give up on the custom light beam idea entirely. I got it to a point where it worked really well but unfortunately the performance impact is too high of a cost. I got the decal to work somewhat well but the only way to ensure it is with aggressive trace flags and layer masking otherwise the trace will sometimes slip through. I was happy till I seen my fps and went hmm.. that's a solid 60+ drop and i'm on a machine most don't have so yeah.. multiple sources
Back to the crappy lightentity I go 
@torn bane sorry for the ping, can I ask what dictates the file name of the save data jsons in EPF/EDF?
I'm wanting to hijack it and have a custom naming convention for specific data if that's possible
DbName attribute, you can set it via script too, just check how it was implemented
ahh I did see that, instead of running "AUTO_GENERATE" is it as simple as calling EDF_DbName("customString")?
yup
and that can be called in the save data dynamically in a function rather than above the class with [EDF_DbName(customString)]?
Basically wanting to have all the jsons in the folder name to 1/2/3 for example
Forget nested folder structures, they will not be supported in the new vanilla persistence. one folder per collection type maximum.
new vanilla persistence 
flashbang warning
gotcha, outside of nested then, I can just call EDF_DbName("customString") in a function within the save data? As like I say, i'm wanting specific formatted but unique file names
Something like:
{
string customString
void SetJsonName()
{
EDF_DbName("customString");
}
};```
If you absoletly want to you can do this in EDF and set the db name to something with a/b/. https://github.com/Arkensor/EnfusionDatabaseFramework/blob/armareforger/src/Scripts/Game/Drivers/LocalFile/EDF_FileDbDriverBase.c#L207
You can mod this class to do some lookup per iinstance if you want to https://github.com/Arkensor/EnfusionDatabaseFramework/blob/armareforger/src/Scripts/Game/EDF_DbEntity.c#L51
But I would recommend against any random names etc, as the code performs best when it knows deterministic names/ids and only the data inside contains randomization.
My code is opinionated to guide you to good decisions. if something is not possible out of the box or documented as feature then i probably had a reason against it. my two mods support every useless operation under the sun, much more than they realistically had needed
ah so if type is myData, then set that name to what i want
yeah I'm looking to tie an additional savedata json name to match a players GUID + customidentifier, which doesn't exist on the player, so I can then know that the data is tied to specific players
better idea, you can use the players id for multiple things. there can be a entry for typename "garage" and "character" with the same id, that way you know both belongs to the player. alternatively you store data on a meta struct per player and that knows character id, garage id etc and you fetch that first and then continue
a structure of ".db/players/ID/vehicles/vehicleid" is not gonna work out
that's kinda what I looked at too, but I couldn't work out how to set the "garage" typename to match the playerID
you name a garage save data class, automatic naming, then you manually call SetId(playerUID) on the persistence component or scripted state that holds the data
i did try that but I think i did it within the save data class for some reason
guessing it will work if I call that from a normal class...
Is there a timeline out of interest for this? And will it require substantial work to depreciate from EPF/EDF if that's being used?
i have a question, would it be possible to make a gamemaster mode where you can lock a specific faction? if so, any pointers?
Game Master gamemodes have faction managers which determine the available factions.
You could simply make a custom faction manager with only specific factions, this does not require scripting.
i mean lock the faction so you need to be whitelisted into it
i.e you have a FIA Faction, civ faction and US Faction. both FIA and US are whitelisted
No nested folder structures sounds more like a bug. People will pay heavy cost for listing files in those folders if they need or want to and the number of files accumulates. Not sure what the benefits of not having it nested are.
It can already be reproduced easily with the playersave folder which is never cleaned up!!!! and just hosts hundreds of thousands of files minimum for busy servers
God forbid you are using network storage, even fast network storage
Could add your custom filter to SCR_PlayerFactionAffiliationComponent.CanRequestFaction.
Can probably also filter them from UI. Maybe SCR_FactionRequestUIComponent.ShowAvailableFactions.
Not in the next major version but if all goes well the next one after. We will see. It's a big feature that touches nearly all systems in the game so I don't know yet what I might have broken hahah.
The new system is easier to use and while it will rewire some effort, it should be a matter of one afternoon of refactors no matter the project size.
Access starts by known keys and expands by joining other ids. No blind query into all available data. The system works for console clients too who do not support nested folders. The platforms save data is much simpler. One container, with many blobs inside. That there is one layer of folders is a quality of life we added for windows server administration that already required us to do a lot of hacks.
In theory you can create sub sub folders but they will not give you any speed advantages. Under the hood it is all flattened out into a singular list of blobs.
Usage of the system with files is meant for small setups, running vanilla gamemodes. Anyone wanting to store plenty of data across a single playthrough will want to connect it to e.g. couchdb
And if you dislike this then you are free to implement your own scripted serializer and storage in what ever format you want, relying on the normal file IO operations. This then of course will not work for console. But those can't host games anyway, so probably not your use case
That folder btw will be gone. Session storage in general will be removed in that patch. But yes it is not supposed to be cleaned up. It's storing player statistics for anyone who ever visited the server. We are just not really using them
Will it still support Mongo? 🙏
If this is intended for small scale usage then it should be capped in some form so it doesnt accidentally become large scale usage.
Is there an easy/quick way to enable/disable specific Prefabs, in SlotManager, using scripts?
For my intention is, for storyline and roleplay purposes, to create a custom action for the driver that once clicked, would "switch" one Prefab for another.
In Arma3 I used to do that A LOT, whether using "hideObjectGlobal" true/false , or just deleting using "isKindOf / typeOf x" and then immediately creating the new ones to be shown.
But I am completely lost regarding where to start to pursue similar results here in Reforger. I have performed several searches in Workbench, using "Jump to script definition", but got no clue at all. 🤦♂️
.
.
EDIT: I mean that checkbox in the picture, found within all slotManager's Prefabs. Either that or even creating/deleting a whole new slot using scripts, maybe.... 😬 🤔
Are you trying to swap out one entity for another or are you trying to hide the entity from players?
Is there any significant difference between using RplProp with a .bumpme to update values or using RplLoad/RplSave with a broadcast method to update values?
Like, is one more efficient, or should only be used in certain circumstances?
sorry I just reread what you asked.
Got it sorted, but I see it leaves the database entry in the database. How could I remove it from the database upon it not self-spawning as to not flood the database with unused entities entries?
My initial idea was to "fake-swap" by hiding one and immediately showing another - both would be already set as a slot in the main Prefab, so I would not need to create/delete any of them every time I wish to switch which attached object is shown.
For the single reason that it seems more easy and efficient from my point view - providing I don't even know whether it is possible. 😄
For instance, at the time of 07:40 in the video bellow (Arma 3), when I clicked to "release vehicle", several attached objects would be hid/deleted, and they would come back once another vehicle gets attached again.
https://youtu.be/K3pZV7kPZMo?t=460
This one is kind of tough. If you hover over one of the slots you'll find that it is an EntitySlotInfo class. Inside you'll find the IsEnabled variable, which I assume you can toggle on and off with a user action. But getting to it is something that I'm having trouble planning.
What exactly do these attributes do on SCR_ResourceComponent -> SCR_ResourceContainer?
Like what are the units here, or is it Resource Gain per Tickrate?
It seems like Resource Gain Tickrate is the interval in seconds, and Resource Gain is the resource generated per interval. Although i'm not sure (correct me if im wrong)