#enfusion_scripting
1 messages · Page 7 of 1
also if your item is attached to something else and its streamed in then your item also be streamed in
Im trying to do it for a vehicle
just curious, were some of the PS5 crashes fixed internally by BI or was it a problem with mods using certain scripting stuff that's less reliable?
So if I stream out my vehicle, all occupants are also streamed out?
Also does authority need to do that?
yes, only server can do this
Ohh I see
I don't known if occupants are attached to vehicle's node or not, but docs stays:
Because node hierarchy is the unit of streaming (in general, whole node hierarchy is either streamed in or out on a particular client)
Hmm not working for me
PlayerController pc = GetGame().GetPlayerManager().GetPlayerController(playerId);
rplComponent.EnableSpatialRelevancy(false);
rplComponent.EnableStreamingConNode(pc.GetRplIdentity(), false);

No they are not, since occupants are not in the same hierarchy as vehicle in replication, for optimization purpose
Well I didnt find a working way to force stream out anyway. But still good to know 
You can just try to disable spatial relevancy first, it should unstream the vehicle to everyone
Since it is not always relevant, and it is not in spatial map anymore
I want to unstream it for specific players not everyone, if thats possible
or unstream for everyone then disable streaming on a player so it gets streamed in again?
But then my code should have worked hmm
No your code is unstream for everyone, and stream for your specific connection
Yeah thats what I want
I mean from the message above you wanted to force stream out an entity, so EnableSpatialRelevancy should do that
Ah, yeah. So If I then EnableStreamingConNode(.. false) on an unstreamed entity, I should see it again?
Like it disables the "streaming system" and forces it to show again. Or am I misunderstanding EnableStreamingConNode 
Yeah exactly, if you do enable false with EnableSpatialRelevancy on an entity that is not spatial, it will stream it to you
Can I do that on same frame?
So its not fast enough to unstream and restream and just keeps it there? 
Yeah, it will be fine
The changes will only get process on next replication tick anyway
If you look at inventory virtual node (Prefabs\Items\Core\Inventory_Virtual_Entity.et), it is exactly how it is setup, so we can tell exactly which connection needs to have the inventory content or not
Alright, thanks alot 
Has anyone set up EPF with Mongo DB? I have 1 server box hosting multiple servers using the same mission/gamemode. I would like to not use the same DB for each mod. We were running Json but ideally would like to switch to Mongo.
Gotcha, thank you! Right now it’ll just pop up next to their name when they chat. But I am working on a separate stat screen. I’ll give this a try.
Yeah I had an external service of mongo running, I switch back to JSON as I found it more reliable
Oh really, I was hoping Mongo would have been A more reliable and B make writes a lot more efficiently. I have it running on my dev server and seems to be given a solid stable performance under a very light load.
Hmm only EnableSpatialRelevancy(false) does nothing for me 
I also tried to set it in the rpl comp directly like Inventory_Virtual_Entity has, but still showing for everyone.
Is there a script that uses Inventory_Virtual_Entity.et?
Doesnt vehicle get handled different due to thr Nwk component?
Do you have any other mods than yours ?
No just mine
And which vehicle? I will try to repro locally
And when do you call the method as well ?
Look tbh, I think it is, I just had a cheap sub to mongo cloud which was shared so I imagine not being dedicated would affect read/write sometimes (in my case it did) otherwise it was good
Any vehicle but this is the one I tested{1FBB492E86002BF5}Prefabs/Vehicles/Wheeled/UAZ452/UAZ452_transport.et
I tired on spawn frame but also delayed 100
Yeah I am using it locally and it feels good to be honest, only issue I need to tackle is I have one server box hosting multiple servers and the same mission. Currently this will all point to one database which I don't want happening
I am a bit lost, what is it exactly that you are trying to do?
Spawn a vehicle but hide it on certain clients
and then be able to show it on certain clients again
I also tried with visible flags, but then there is vfx and sound etc that I need to hide aswell, so I thought streaming out would be easier
I think I had support for multiple hives already. So they can share the same db. Just host one proxy for the mongodb instance and connect both servers. Check where to setup the hive id. I think I have it in my readme
Thanks Arkensor, I am actually looking for the opposite, I have 2 servers hosting the same mission. I want them to save on separate databases however as the picture shows, if I point them to the same port and Database name this wouldn't this save in one database?
Sorry Arkensor I have miss read what you said and my brain skipped passed the word multiple
https://github.com/Arkensor/EnfusionDatabaseFramework.Drivers.WebProxy.MongoDB see quickstart for full setup.
By default it will be hive 1, so if you launch both servers using the same db on hive 1 it can work. BUT there are some shared files, like the root entity collection that remembers what to save and spawn. those would conflict with each other and override. But if you configured it so ONLY players or unique ids are handled, then they can share it https://github.com/Arkensor/EnfusionPersistenceFramework/blob/armareforger/src/Scripts/Game/EPF_PersistenceManagerComponent.c#L103
i would personally recommend seperate hive ids for the two servers. your player data is shared anyway because it uses the accounts UUID that joins, so they can travel between. but items dropped on one do not appear on the other server
--HiveId=2 as cli param for the second server then
Thank you thats helpful.
Hey, my API is working, but i got the following Error in the Log:
09:30:47.529 BACKEND (E): SetHeaders - Number of strings must be even!
ApiCtx.SetHeaders("Content-Type: application/json");
ApiCtx.SetHeaders("Content-Type","application/json");
EDF implementation with mongodb works fine for my team and I. While there are some features I wish the framework had, we implemented our own custom stuff on top of the framework arkensor provides. Haven’t had any issues with it yet.
Thank you Connor, its working well nicely on just a dev box for me too
Using atlas and no issues on that front either 👍
Hey, if i do it like this, my GET is not working anymore
Well that's how you set headers
I think
name,value,name,value...
I might be misremembering tho
Are mods able to write to ReforgerGameSettings.conf or is ModuleGameSettings only for BI? 
In my mod called Keybinds Resetter I was able to delete InputUserSettings.conf on Xbox
Whether this works in current version or not idk
I tried it and it works, I can share video in PM if you want, I do EnableSpatialRelevancy(false) after 10 seconds, and it correctly disappear the UAZ452_transport on the client
How do I go about debugging Overflow in AABB, object removed from simulation? it doesn't give any useful trace in logs. Any BI can look into submitted dumps for me? it keeps intermittently crashing dedicated servers triggered by different entities, this time VZ58_stock_folding.xob') at <-nan -nan -nan> but previous few was some hedgehog barrier
Sure, would love to see it in action.
Btw does it work with host&play ?
Im really not sure what im doing wrong. But I cant get it to work 
New project, MP test map, only UAZ spawned with this comp:
class SpatialTestCompClass : ScriptComponentClass {}
class SpatialTestComp : ScriptComponent
{
//------------------------------------------------------------------------------------------------
void LateInit(IEntity owner)
{
RplComponent rplcomp = RplComponent.Cast(owner.FindComponent(RplComponent));
rplcomp.EnableSpatialRelevancy(false);
Print("EnableSpatialRelevancy(false)");
}
//------------------------------------------------------------------------------------------------
override void EOnInit(IEntity owner)
{
GetGame().GetCallqueue().CallLater(LateInit, 10000, false, owner);
}
//------------------------------------------------------------------------------------------------
override void OnPostInit(IEntity owner)
{
SetEventMask(owner, EntityEvent.INIT);
}
}
I'm validating the player to see if it allows opening the box or not and it's working using the button, but the player can access it using the TAB. Does anyone have a solution?
Override InventoryItemComponent::ShouldHideInVicinity
This method controls the visibility in the inventory menu for an item
Did 1.4 bring any updates to systems, like providing built in feature to efficiently register and unregister entities?
What's wrong with simple method Register(entity) or Register(component) which just add it to array?
I feel like unregistering it through RemoveItem might be slow when I get 1000 entities
Or when entities are quickly created and deleted
You can save index in entity/component or map<entity/component, int>
And on remove you just need to swap indices of item to remove and last and remove your item
This is exactly what I mean. When you encourage modders to use systems to manage a lot of entities at a time, you could do us the basic courtesy of providing us with performant ways to add/remove those entities to our systems out of the box.
I know I can do it myself but that's not my point.
There is bigger problem - there are no methods to iterate over all entities of specific archetype like in "normal" ECS. I think it will be better to add this.
So they wouldnt have to register?
Yes, it will be managed by engine entirely, you just define archetype (set of components) and engine will do everything to access them in loop faster as much as possible
That's way better yeah
no
I would not be worrying about this, it is very fast searching into an array, even linearly even with 1000 entities. You could always use set, which is a bit slower insertion but faster deletion
Anyway, worry more about constant update time of your main loop, than just rare things happening once upon a time
I saw mods searching whole inventories of every character every frame, so inserting into system being "slow" is not really a problem
Its not really aimed for modders, so avoid it
At any point it could be limited based on how it gets exploited and modders thinking its some place safe for storage
Hmm that gives me some ideas
From what I tested, if you save things with your addon inside it, as soon as the game will resave settings without your mods, it will just delete your settings, so it is not viable at all
Do you think there might be a way to persist client settings on consoles in the future without needing to rely on something like an external API?
So, i'm getting some child prefabs by querying the bounding box of a building. I'm then trying to deactivate a component on said entities. Any reason why this wouldn't work? I'm specifically trying to deactivate the ActionsManagerComponent. This logic is being performed on the server, is that the issue ??
I've tried everything that I could that would make the actions not appear.
I'm trying to avoid having to do an rpc for each of these items.
Why not override the prefab and replace the actions you want to hide with a non-visible action like this:
class ACE_NoUserAction : ScriptedUserAction
{
override bool CanBeShownScript(IEntity user)
{
return false;
}
}
Because I need to do this dynamically at runtime
Then override said action and add a toggle for the visibility
CanBeShownScript is only called on client iirc
But the toggle will have to be an RplProp, which you said that you don't want, but it's sort of a requirement if you want to do it dynamically to begin with.
meaning iI would have to rpc values
and I don't wanna do that for a potentially huge number of entities.
What exactly are you trying to do?
I'm gonna guess that deactivate has to be called on server and client
but in workbench as the server and client it doesn't work
Forget about deactivate. Components can't be deactivated at runtime.
You could have started with that lol
Again, what is your ultimate goal?
To disable a user action on an entity without having to rpc values to the clients
I mean your particular use case. Like you want to remove the door action for certain buildings?
No
How about a central registry for owners for which the action should be disabled? That way you would only need a single RplProp. The action would then check if its owner is in said list.
It's basically the approach we used for deleted trees, as that way you don't need a RplComponent on them.
I'm beginning to think that doing anything in regards to furniture on buildings just doesn't work lol
Eh, I did manage to make a script to query tables for placing intels 😅
Does anyone know how to make an arsenal item take away rank once put into inventory? I do not just want the item to require a certain rank. I know you can do it with a vehicle, I’m just curious on if there’s a similar way with arsenal items.
How does one properly diagnosis a JIP or connection error? The regular logs don't seem very descriptive? sever has several dozen mods and we are not sure which one is the issue. We can't test them all one by one as the issue happens rarely and randomly and usually only with a decent amount of players.
the arsenal item ranks are set directly in the entity catalog, you can remove the rank there
I don’t want it removed, I figured that out, I basically want it to take some rank away. For example, if I spawn a weapon I want some rank to be taken
Or is that what you’re saying to add it there?
Is it possible to add a cooldown timer on specific items?
One last question on this, is it possible to also send me the exact code you used? Just to check if it might be a version difference and just not working in 1.4
Does anybody know what script I can increase the force / velocity of ejected casings from firearms?
Alrady made the casing the minimum allowed mass / damping but need more
Its in the particle effect I believe
Look at the class for Arsenals, there is a server method for when a client asks to take an item. Add some code to deduct XP or rank to an override of that method
Thank you
I haz weird problem
I have an entity with a particle effect as child
When I call Stop on it from a component in the entity it stops fine
When my entity is a child of another entity and I call Stop it doesnt do anything
Wat is going on here
@ocean kernel Could you point me to how your Arsenal/Loadout mod handles RHS assets? For context I am trying to replicate Add/Delete operations for equipment for a unit, such as addWeaponCargo or removeBackpack from ArmA 3.
I have managed to handle the vanilla game however RHS has decided to override BI and expand it. My vanilla asset methods cannot handle RHS magazines as an example, because the magazines are all missing RHS_CustomAttributes to provide m_sCompatibleSlotNames. I can't seem to find an "API" to work with their RHS_ClothNodeStorageComponent which is preventing me from bypassing their system even when overwriting the methods/classes.
My vanilla asset approach is pretty much the same for Weapons/Gear/Inventory
static void AddWeapon(IEntity unit, ResourceName weaponPrefab, int slotIndex, int attempt = 0) {
if (!unit || weaponPrefab.IsEmpty()) return;
EquipedWeaponStorageComponent weaponStorage = EquipedWeaponStorageComponent.Cast(unit.FindComponent(EquipedWeaponStorageComponent));
if (!weaponStorage) return;
if (slotIndex >= weaponStorage.GetSlotsCount()) {
Print("UCAMF: Slot index " + slotIndex + " out of range.");
return;
}
InventoryStorageSlot slot = weaponStorage.GetSlot(slotIndex);
if (!slot || slot.IsLocked()) {
if (attempt < 10) {
GetGame().GetCallqueue().CallLater(AddWeapon, 50, false, unit, weaponPrefab, slotIndex, attempt + 1);
} else {
Print("UCAMF: Gave up trying to insert weapon after 10 attempts.");
}
return;
}
SCR_InventoryStorageManagerComponent storageManager = SCR_InventoryStorageManagerComponent.Cast(unit.FindComponent(SCR_InventoryStorageManagerComponent));
if (!storageManager) return;
bool success = storageManager.TrySpawnPrefabToStorage(weaponPrefab, weaponStorage, slotIndex);
if (!success) {
Print("UCAMF: Failed to add weapon " + weaponPrefab + " to slot " + slotIndex);
}
}
Utilizing SCR_InventoryStorageManagerComponent and its methods TrySpawnPrefabToStorage and TryRemoveItemFromStorage.
However as stated before RHS has extra attributes/components that prevent this from working. Originally getting:
SCRIPT : UCAMF: Failed to add item to RHS_ClothNodeStorageComponent<0x00000242AFE611E8>
I am currently trying to overwrite
RHS_ClothNodeStorageComponent: GetCompatibleSlot and GetSlotForItem
and
RHS_LoadoutSlotInfo: CanStoreItem
but it appears futile.
Any advice would be appreciated.
It doesn't care about whether prefab is modded or not
Hi! I'm very new on this of scripting in reforger and I'm trying to make a component to spawn a explosion from a vest of a dead body. The component is there, I can assign a prefab explosion by hand or code but nothing happen. Any help?
[ComponentEditorProps(category: "GameScripted/Equipment", description: "Spawn explosion on onwer when is dead and remove body")]
class VestBombComponent : ScriptComponent
{
[Attribute("{E7D7F7C2C1B4F1A2}Prefabs/Weapons/Explosives/Explosion_Grenade_M67.et", UIWidgets.ResourceNamePicker, "Prefab of explosion", "et")]
ResourceName m_sExplosionPrefab;
IEntity m_OwnerCharacter;
bool m_Exploded = false;
override void EOnInit(IEntity owner)
{
super.EOnInit(owner);
m_OwnerCharacter = owner.GetParent();
SetEventMask(owner, EntityEvent.FRAME);
}
override void EOnFrame(IEntity owner, float timeSlice)
{
if (m_Exploded || !m_OwnerCharacter)
return;
SCR_CharacterDamageManagerComponent dmgManager = SCR_CharacterDamageManagerComponent.Cast(
m_OwnerCharacter.FindComponent(SCR_CharacterDamageManagerComponent)
);
if (!dmgManager)
return;
if (dmgManager.IsDestroyed())
{
m_Exploded = true;
vector pos = m_OwnerCharacter.GetOrigin();
EntitySpawnParams params = EntitySpawnParams();
params.Transform[3] = pos;
GetGame().SpawnEntityPrefab(Resource.Load(m_sExplosionPrefab), null, params);
// Remove body
RplComponent.DeleteRplEntity(m_OwnerCharacter, false);
}
}
}
How to get running Scenario ID on dedicated server? Backend API's DS Session : Scenario ID shows " "
Calling delete on the particle emitter does nothing
RplComponent.DeleteRplEntity does nothing
ParticleEffectEntity.Stop does nothing
ParticleEffectEntity.StopEmission does nothing
Actually RplComponent.DeleteRplEntity does seem to work
The entity becomes null afterward
But I still see particles haha
Also how do I make all children on fire when parent is on fire?
GetGame().GetMissionHeader().GetHeaderResourceName();
thx i try it
By chance does anyone know what's blocking the movement of inventory items whilst in the swimming animation?
I have been a bit of an idiot and created a shipwreck mission thinking the last part I will look at would be the override allowing players to access the inventory under water.... 😳
Reason: Index out of bounds.
Class: 'TimeAndWeatherManagerEntity'
Entity id:18
Function: 'Get'
Stack trace:
scripts/GameCode/World/TimeAndWeatherManagerEntity.c:448 Function GetDayTimeUIInfo
scripts/GameCode/World/TimeAndWeatherManagerEntity.c:429 Function GetCurrentDayTimeUIInfoAndPhase
scripts/Game/UI/HUD/AvailableActions/Conditions/Game/SCR_DaytimeCondition.c:24 Function IsAvailable
scripts/Game/UI/HUD/AvailableActions/SCR_AvailableActionsDisplay.c:215 Function IsAvailable
scripts/Game/UI/HUD/AvailableActions/SCR_AvailableActionsDisplay.c:346 Function GetAvailableActions
scripts/Game/UI/HUD/AvailableActions/SCR_AvailableActionsDisplay.c:436 Function DisplayWidgetsUpdate
scripts/Game/UI/HUD/AvailableActions/SCR_AvailableActionsDisplay.c:426 Function DisplayUpdate
scripts/Game/UI/HUD/SCR_InfoDisplayExtended.c:551 Function UpdateValues
WORLD : UpdateEntities
WORLD : PostFrame
SCRIPT (E): Virtual Machine Exception
Reason: Index out of bounds.
Class: 'TimeAndWeatherManagerEntity'
Entity id:18
Function: 'Get'
Stack trace:
scripts/GameCode/World/TimeAndWeatherManagerEntity.c:448 Function GetDayTimeUIInfo
scripts/GameCode/World/TimeAndWeatherManagerEntity.c:429 Function GetCurrentDayTimeUIInfoAndPhase
scripts/Game/UI/HUD/AvailableActions/Conditions/Game/SCR_DaytimeCondition.c:24 Function IsAvailable
scripts/Game/UI/HUD/AvailableActions/SCR_AvailableActionsDisplay.c:215 Function IsAvailable
scripts/Game/UI/HUD/AvailableActions/SCR_AvailableActionsDisplay.c:346 Function GetAvailableActions
scripts/Game/UI/HUD/AvailableActions/SCR_AvailableActionsDisplay.c:436 Function DisplayWidgetsUpdate
scripts/Game/UI/HUD/AvailableActions/SCR_AvailableActionsDisplay.c:426 Function DisplayUpdate
scripts/Game/UI/HUD/SCR_InfoDisplayExtended.c:551 Function UpdateValues
eh?
i just setup my terrain ant the TAW manager is freaking out. Never encountered this.
SetEventMask(owner, EntityEvent.INIT); first in OnPostInit method to call EOnInit
Where does faction color of GM icon come from
Definitely doesnt come from faction affiliation component + editable entity component
SCR_EditableSystemComponent does update color but not when entity is destroyed
Do systems not run on client with Frame point?
nvm they do but InitInfo/outInfo is useless
Now when the entity die get deleted instanly and no explosion is spawned 🫤
The OnFrame event should be used as little as possible and you should be using a script invoker for when the damage manager is destroyed
From a quick look it seems as though they removed the script invokers for on destroyed(or im completely blind)
modded class SCR_ExtendedDamageManagerComponent
{
ref ScriptInvoker m_OnDestroyed = new ScriptInvoker();
//------------------------------------------------------------------------------------------------
ScriptInvoker OnDestroyed()
{
return m_OnDestroyed;
}
//------------------------------------------------------------------------------------------------
protected override void OnDamageStateChanged(EDamageState state)
{
super.OnDamageStateChanged(state);
if (state == EDamageState.DESTROYED)
m_OnDestroyed.Invoke();
}
//------------------------------------------------------------------------------------------------
}
Heres a quick example
Then on init of your component get the damage manager component of the character, then call OnDestroyed.Insert and pass in your explosion spawning function
I personally wouldn't use this with a component on the character, I would add a component to a vest and then call Insert/remove on the invoker when the vest is worn/taken off
Thank you very much! It is my idea from the beginning, that this is usable by players simply using the vest. I have used as a base what you have recommended to make the script much better. Now I'm trying to deal with the issue of detonating the warhead...
Pretty sure faction manager
Ahh forgot to report I figured out. Made my own editable entity component.
not wanting be funny new here but is scripting same as codeing and if so were would one start to try learn this
@main crescent Sent a DM
string scenarioId = SCR_SaveWorkshopManager.GetCurrentScenarioId();
Anyone know how I can test this within the editor without a second player
override void OnPlayerKilled(int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer)
{
super.OnPlayerKilled(playerId, playerEntity, killerEntity, killer);
Print("Player " + playerId + " was killed.");
Just run a PeerTool
But this should work and in SP just out of box
gotcha, then i did something wrong 🙂 thank you for confirming
Check HandlePlayerKilled
you might be able to suicide to trigger this event. just press shift esc and then respawn
Great idea's thank you very much for providing these ideas
I think my error is in calling the actual script. I've added a modded gamemode on the base, added settings to fill in but i do not see the logs
alright, i figured it out
I totally misled myself by adding it to the BaseGameModeClass while I just could create a SCR_BaseGameModeComponentClass and add that as a component. the HandlePlayerKilled thank you very much everyone!
You should be using a custom BaseGamemodeComponent
No need to mod vanilla classes unless you absolutely have to
gotcha, thank you very much
Is there any way to set RPL distance for specific entities? For example make loose items on the ground only replicate to clients within 50m?
setting EnableStreaming(false) on the entities until a player is near seems like it might kind of work but I think it would enable streaming those entities at default network distance for all clients as soon as one player approaches instead of just streaming it in for that one player nearby
I don't think there's even any scripted functionality to mess with the streaming range of individual entities.
I can tell you that it's probably not worth it to do on tick events for every player/item to check distances.
If you did do something like that clearly the player would be the best choice as there is a max of 128 and there are 1000s of other entities.
Do that though, and there's nothing stopping anyone from dropping a ton of items in one place, potentially causing server/clent crashes when they all stream in.
yeah I was thinking of disabling streaming on ground loot by default then adding a trigger area to player character that activates it on any matched entities in the radius
yeah this is already a problem in any persisted/EPF game mode that doesn't have a solution for it I think, I haven't looked into GC much yet but if it's scriptable I was thinking of trying to create an inverse of the nearby player lifetime extension that reduces item lifetime more depending on how many other items are nearby or something
Offer trash cans for players.
Make certain things delete faster using the garbage manager.
Searching an area around the player on tick isn't a good solution.
Could lead to worse performance.
Yeah there are probably a ton of work-arounds I was just looking for a way to also make RPL a bit more scalable with lots of ground items + players
but will most likely end up doing stricter cleanup or total count limits and/or changing to container based loot
I don't think you(modders in general) can do anything about that unfortunately.
That's already what network bubbles do.
Yeah I have been turning down network range and it's helped but I figure turning it down too much will negatively impact gameplay e.g. visible pop-in of characters and vehicles
Or do characters/vehicles replicate at a different range to that setting?
Not sure about that aspect of it tbh.
Will give it a try turned down to 50m, if it doesn't apply to characters and vehicles then that might be fine on its own
Why are you ending up with a bunch of ground loot?
I wanted to have good loot density, not just 2-3 spawns per building
some of my building prefabs have 10+ loot spawners
so when a group of players quickly approaches a town with 20+ buildings and server tries to replicate all those items to all of them it tanks FPS / causes rubberbanding
Crazy
I once tested the loot spawners on Arland airstrip and had 10 thousand of them and didn't really have any issues, a few people did when looking directly into the airstrip though.
but yeah sounds like that's not really feasible with Enfusion atm so I'll just have to crank down max item spawns a heap
randomly increase/decrease the call later function to not spawn the loot all at once
That could help if the values are high/low enough
for instance building x only spawns one items at a time because all of the loot spawns at a random interval
Won't help with overall loot spawning
the loot spawning is processing 10 entities per tick, 1 tick per second and seems to run perfectly smooth on it's own, after a fresh wipe when every spawner is empty / wants to spawn something it's smooth. Just after a few hours once all the spawners have populated is when it starts to become a lagfest
but it will help with performance
I'll be releasing a more optimized mod for spawning loot soon
But until then, you can disable the call queue of spawners if they have loot spawned.
and then when the item is picked up you can then re-add the call queue
Another way is to create a representation of your item, as a non entity like a class. Since you are mentioning loot, it probably means that no player touched to it, and only if there is a player near it, you spawn the prefab itself
yeah the system I'm using (based on CentralEconomy mod) has baked generic entity loot spawners with a component that spawns the RPL'd item, I might try something similar to the ambient patrol spawning logic to make it only spawn when players are close enough for it to be relevant but not so close that they can keep getting loot in one spot, hopefully the overhead of doing radius checks and spawning/despawning the loot entities much more actively doesn't outweigh the RPL savings 🙂 thanks
How to make script editor not lag for a minute when opening scripts while having 50 mods loaded?
What is this for in a System? Is this data not set in the system config? 
override static void InitInfo(WorldSystemInfo outInfo)
{
outInfo
.SetAbstract(false)
.AddPoint(ESystemPoint.FixedFrame);
}
Load less mods 
Genius
It doesnt do anything, use the config instead (from experience)
Hey! so I have very limited knowledge scripting wise, so I'd appreciate if you can point me in the right direction.
What do i need to do if I want to suppress these task notifications?
Might be an override or something. But yeah ill stick to config
Do I just create a new script with the SCR_BaseTask subclass? Something like this?
ExportToClipboard doesn't have any limitations like A3 version?
Reforger is still running the legacy version of systems. The new stuff they added is not yet functional.
The config settings will be retried soon, and are only used for the diag menu. all system MUST implement init info.
Whats best class / method to work with cursor for UI in newest version?
How do I set this to only show scripts from my mod?
Only by prefixing every script with your tag and search it 😭
dfhgsddgs
It's why I just use VS Code
It much better even if you don't have autocomplete
Giving up autocomplete isn't worth it tbh.
I extensively use auto, so it almost completely broken for me
also, bunch of AI autocomplete, detaching FindSymbol and Outline to separate window and use win 10/11 snap feature and you can do very much
if the outline also showed a tooltip (or right in the list) with symbol definition, then the script editor would become useless as an editor
Terox, Arma 3 friend, I see you haven't received an answer yet, so I will give it as good as I can with my current knowledge.
Navmesh is part of the map or generatable in the scenario. What you need is a GM scenario or i guess combat ops with an addon within that addon you can create the LoadoutManager and it's selectable role, loadouts and more. Have a look at RHS they have preselectable roles.
As for triggers and ai waypoints I know Scenario Framework offers a lot of these things it might just suit your needs for a second addon.
there's a chat command that will crash ur client. on official missions /servers as well.
Lol what is it
I've encountered an odd bug and I'm ready to pull my hair out.
I have a custom SCR_InfoDisplay put on an overriden DefaultPlayerController. It creates widgets to display on the screen on callbacks.
It works in the editor flawlessly (even when going to the main menu and hosting a server, everything).
As soon as I run it in the actual game using the workshop version the widgets aren't on the screen, but the SCR_InfoDisplay is still working perfectly (I put a ton of Prints and I can see in the logs its working perfectly as expected, just no widget showing).
mod name ?
Its unlisted rn
Can you send me the project (or the downloaded addon as a zip) ?
I will have a look during my break
So I have a simple map object:
protected ref map<string, RVX_64D_MFDBasePage> ROUTES = new map<string, RVX_64D_MFDBasePage>();
I am trying to fill it and retrieve data from it.
I wrote two functions : SetRoutes and InitializeRoutes which I run one after another in PostInit
override void OnPostInit(IEntity owner)
{
super.OnPostInit(owner);
SetRoutes();
InitializeRoutes();
}
These are the functions:
private void SetRoutes()
{
RVX_64D_MFDBasePage extraPage = new RVX_64D_MFD_FLT();
ROUTES.Insert("FLT", extraPage);
Print("Inserted: " + ROUTES.Get("FLT"));
}
private void InitializeRoutes()
{
Print("Loaded: " + ROUTES.Get("FLT"));
}
But those Prints give me this result:
SCRIPT : Inserted: RVX_64D_MFD_FLT<0x0000019F134CBEE0>
SCRIPT : Loaded: NULL
Why is that? Am I missing something?
protected ref map<string, ref RVX_64D_MFDBasePage> ROUTES = new map<string, ref RVX_64D_MFDBasePage>();
Mario would be proud
I think that inserted class is just getting garbaged after SetRoutes
without the ref
Damn, that was super fast
Big thanks
does it work?
Like a charm
yippee
What class is responsible for these controls hints?
There is a config with them I forget the name but it has all hints in it
Available actions something maybe
AvailableActions.conf
SCR_AvailableActionsDisplay.c
Legend, thank you🙏🏻
m_mRoutes 🤓
Routes 
Hes building react, call the cops
Guys, did you know AI got good at Reforger coding? This game-mode written by Claude 4.0 in Copilot https://makearmanotwar.com/entries/60E108D10E842BFC
I'm already use local model 
How many parameters?
14B
and how the fuck do you train that at home?
I don't train, I just use qwen
oh
I tried ~23B, but it too slow for autocomplete on my setup
So, what's the advatnage of local? over just using huggingface or even openAI api
You are not dependent on anyone's service and its monetization policy
I had one idea that could be useful for Reforger: vector embeddings for Reforger wiki + RAG then you could "search" the wiki by talking to an LLM
Reforger wiki
Better to extract definitions and comments to it from Script Editor itself
I'm used this plugin to extract scripts from game and dump them into llm context: https://github.com/pennyworth12345/ReforgerDumper
Would be nice if BI put Reforger's scripts on Github, then they would be in the training data for all the llms.
Putting it in github doesn't only help this, but it would also help to find every small changes that has been done in the script, so it would be simpler for you guys to see how it was replaced in a new version
Is there a page that shows api changes in each update?
Im going to start duplicating core scripts and feeding them to my chatgpt. Too bad theres no "Duplicate all to.."
with Copilot in VSCode or Cursor you can click "Add context" button to add files/folders.
cann add all in one click
Ohh nice thanks man. Just got into the ai stuff few days ago finally.
Is there a way to keep the markers the same size regardless of map zoom?
how do I override a static method lol
or at least what that method returns
should I override the variable it returns instead?
You would have to update them when zoom changes.
YOu have a NaN
Weird question, but is there a way to change the name a mod is published under? Mine is just showing my email
how does one get a NaN out of a 0?
Division by 0 I would guess
Could also be other things though, idk
PSA: Don't type ## in-game.
On a dedicated server, a GM player (client) spawns an entity. The entity is a modded one so I can do things in e.g. EOnActivate. I would need to know details like position where it was spawned on the server. What would be the right way to get this information to the server?
Seems like this only crashes the client that runs it
the faster Alt-F4 in a way. maybe not a bug.
Dunno if this is the best place to put this but Im looking to make a leaderboard mod for my server where it will send all the info over to our discord and show a top 50 leaderboard for different stats like kills, points captured, supplies ran, etc. Need help on getting it started if anyone wants to work with me
ok so i made a script called jammingcomponent.c
Im trying to make a version of the command truck that cna be deployed on both teams that jams enemy coms by playing some audio files i made on the platoon channel of their enemy factions
im trying to add this component to the truck prefab in the prefab editor but for some reason my script wich is under my mods directoriy under scripts so /radiojammermod/scripts is not showing up under the list of avail components in the prefab editor for the copy of the truck in my mod directory.... what did i do wrong here..
hey brax this is a cool idea! id be down to help out as best as i can, i have a dedicated server we could run testing on and i play frequenly! hmu!
Needs to be in a script module
One of these
In 945% of cases in the game module
How can i get multiple loadout options in the spawn menu to show up in a GM scenario? I want to have 3 preconfigured kits/loadouts in addition to the fourth slot which will be the players saved loadout from the box.
loadout manager entity
It does! Sometimes it’s hit or miss, things I’ve personally experienced is it usually will not show if you have syntax errors, and sometimes it breaks completely for me and I have to restart the tools altogether.
jeez i just replied to an old ass message lol. i love when discord does that, sorry dude
i recognize you from wtf. i recommend using EDF. if you have any questions let me know, i have an unlisted mod im working on with functionality like this
Is there any difference between these two?
Setting signal via action on all clients + server
Setting MP signal via action only on Server
Outside of the obvious being the MP signal is synced not really... Although excluding action stuff clients can set the value without having to run additional rpcs so... don't really see a reason why you wouldn't use an mp signal. That and I don't remember if actions execute on all clients or if they're restricted to replication range. If they are restricted to replication range then you'll eventually get clients out of sync.. Guess it's just going to come down what you're doing with the signal and if it really matters but like I said I don't see why you wouldn't run an mp signal...
the results of your action are only synced within the replication range though
if its not a global signal
JSON say is correct but the server doesn't start what I'm doing wrong?
Wrong channel, ask here: https://discord.com/channels/105462288051380224/976119935875026964
whats the best way for me to get current movement direction?
without using any movement components, all I got is IEntity and Physics
My bad
Physics physics = m_OwnerVehicle.GetPhysics();
vector vehMat[4];
m_OwnerVehicle.GetTransform(vehMat);
vector localVelocity = physics.GetVelocity().InvMultiply3(vehMat);
Sth like this perhaps?
will try thankies
Is there any reason to not use this code
return PrintFormat("test %1", unit);
as a replacement to
PrintFormat("test %1", unit);
return;
In the context of a function of return type void
Yea, it won't compile? void should not return anything
It certainly compiled as the function is not expecting to return anything.
I am simply curious what memory leak or issue I may run into without noticing in the short term.
return X() will return the return of X(). At least in regular programming languages.
It works in script too, but sometimes it doesnt
Damn
but when it doesnt it just doesnt compile, so you'll be fine
I wish it worked since 20% of the codebase is checking if things exist followed by an error message and return.
Would be nice to make it only 10% - for void functions naturally
I use it this way in a lot of places, just missing the walrus operator
also not being able to pass functions as arguments to functions is making me blow steam out my ears when I think about it
because to send a response to a request I have to write 10 conditions instead of having a map of type <string, ResponseFunction> and then just call handlers.Get(requestType)(request) or whatever
Definitely what gluten said. If you want it as an angle then take the dot product with the north direction vector and arccos of that is the angle wrt to north
Just normalize the velocity @ocean kernel
No need for the expensive operations
The direction is encoded in the velocity
Remember velocity is direction times speed
Normalize and you get the direction
So about the recursive script invokers
No
Did you know it throws VME when you login as admin in game master scenario
Myself, no
Repprt it in FT pls
Nah
Did u know the game crashes when you type ## into chat
Yes
Sweet
Is this a feature?
btw
18:51:08.443 SCRIPT (E): Virtual Machine Exception
Reason: ScriptInvoker: Recursive call of Invoke!
Class: 'SCR_CharacterHeadHitZone'
Function: 'Invoke'
Stack trace:
Scripts/Game/HitZone/SCR_HitZone.c:66 Function OnDamageStateChanged
Scripts/Game/HitZone/SCR_CharacterHitZone.c:286 Function OnDamageStateChanged
Scripts/Game/ACE_Medical_Prototypes/HitZone/SCR_CharacterHitZone.c:18 Function OnDamageStateChanged
Scripts/Game/HitZone/SCR_CharacterHitZone.c:523 Function OnDamageStateChanged
Scripts/Game/ACE_Medical_Prototypes/HitZone/ACE_Medical_VitalHitZoneKillHelper.c:65 Function OnDamageStateChanged
Scripts/Game/HitZone/SCR_HitZone.c:66 Function OnDamageStateChanged
Scripts/Game/HitZone/SCR_CharacterHitZone.c:286 Function OnDamageStateChanged
Scripts/Game/ACE_Medical_Prototypes/HitZone/SCR_CharacterHitZone.c:18 Function OnDamageStateChanged
Scripts/Game/HitZone/SCR_CharacterHitZone.c:523 Function OnDamageStateChanged
18:51:08.444 SCRIPT (E): Virtual Machine Exception
@dire sinew is dis u
Did u know the game crashes when you
wat does -nan(ind) mean
Nan means "not a number". You probably have a zero division error somewhere.
I am more curious about the ind part
I think it's just a C++ thing that nan's are printed that way 🤷
You broke the floating point law.
you got a nan, with the sign bit flipped
Fun fact, I have nan defined as a constant in one of my mods and the workbench always complains about it when opening the mod, but apart from that it works fine 😅
"nan".ToFloat()?
Exactly
Nooooo
I have a matrix, where each element describe the state of a 1m x 1m cell on a map. The element is nan when the cell does not have a road. Otherwise it will be a float for the radian of the direction of the road on that cell.
I suppose I could use a value outside the range
Yeah
avoid nan
It's infectious
If it ends anywhere in your calculations
the whole thing is wrecked without recovery
We added the warning later as we were getting weird crashes on matrices operations from public
This might have been the culprit
And issue is that it is hard to trace back
Imagine making a game that crashes when modder types some words
Do you want power or not?
I don't do matrix operations on it. It's literally just for compiling suitable positions for checkpoints. If the value is nan, further processing gets skipped.
honestly? life would be simpler if it was way more limited because right now it is on a level where it seems powerful but basic features from real languages are missing
Are you talking about matrix as in the script matrices or matrix as in math speak for a table?
Purely mathematically speaking.
What features are you missing the most?
Ah ok
being able to pass functions as arguments to functions and being able to put them inside maps
right now anyway
I wanted a map of handlers for specific things
Instead of making 15 ifs
There is a proper in depth event system coming
But it's part of the World Systems and World Controller combo
So until you get those, you will not get the proper event system
and connections are made/checked compile time
And there is a runtime aspect for connecting them, triggering them and disconnecting them
plus filtering
For those that need specificty
would be better if I could make my own handler system
my mods are less reliable the more I rely on vanilla stuff
This is more of a proper solution
Nothing like script invokers exploits of usage
Anyway, they are unique per system or controller
It's not a general one for all
friend class/method is planned as well
Other things I can't promise yet.
map<string, MyFunction>
Great, so I no longer have to comment to tell ppl that a method is meant to be friend of a specific class 😅
I'll just do map<string, string> and use ScriptCallQueue.CallByName
There were other changes but forgot them, I will need to check

Also I just noticed that I got rid of nan anyway in the latest implementation, as I switched to COO-type format of storing the matrix and got rid of the nan entries that way 😅
sparse matrices? 👀
exactly
What are you using that for? (Feature wise)
Why?
Could you elaborate more please
I compiled those sparse matrices through scanning terrains based on a 1m^2 grid. The values essentially tell me that this cell is suitable for placing and what the best angle is, for instance, a road block or large fortification and so on.
misuse probably (If it comes to base enf stuff)
game stuff could break between updates as the game is currently worked on
engine stuff is harder for it to break across updates
The event system mentioned above is Enfusion thing btw
For roads it works well, as they lead to really sparse matrices, but for flat and empty place, it really depends on the shape of the terrain how sparse they are, so it might be suboptimal there.
array accesses are slow in scripts compared to other languages, specially on big arrays in scripts.
how do I do something like have RplProp sync but only if the user is admin
Did you test if it performs better performance wise vs locally checking around with traces on demand?
As placing things like roadblocks does not tneed entire map processed, just locally to it's bounds
oh there is rpl condition
You can enable streaming of RplNode for specific player(s)
That would wreck everything else
Even rpl of transform of entity itself
The thing is there is more going in than just whether the location is suitable. It also provides the best angle, which is done through unsupervised machine learning on the matrix. Maybe eventually one could do it add-hoc, as you suggest, but I would need to implement said algorithms in Enfusion first.
He wants to target a single RplProp
Make a separate entity just for this...
No...
That is bad practice
And waste of resources
Yeah. Making standalone mods are more future-proof, less dependencies
At the moment it may take a few seconds until a location is set up, which is good enough for me. Enforce script is surprisingly fast, then again I came from SQF, which is magnitudes slower 😅
list initialization or just the object itself?
having to do map = new map... is annoying
So is there even a reason to bother with new?
yeah
when you already have the var somewhere
and want to do
someMap = new map<int, int>
or when doing it in a function
Method(new map<int, int>())
or return of new object
etc
Class someVar()
is just syntatic sugar for
Class someVar = new Class()
And
Class someVar = Class()
also works the same
It's what happens in attributes
speaking of annoying things... green man, give null coalescing operator
That one is not coming
D:
And don't ask. We do not talk about that here.
what about walrus operator
I believe += for elements of a container is still marked as WIP 😅
I can tell you do not come from CPP 😅
As you would have asked for someVar = anotherVar = 5
imagine having notnull but no try/catch
can we replace enforce script with dreamberd
This one is due to possible obscurity to veyr high probability of abuse
as with the coalescing operator
y'all are giving us the ability to get a VME intentionally but not catch it LMAO
We do not want the script to become more complicated
With the simple things in there people already do not get it except for more seasoned scripters
not making things easier for us promotes jank workarounds
And with nature of modding, non technical people always go and try their luck with scripting
So due to that, it will stay simpler in many regards
If you catch it, I bet you would do so to ignore it

I would print an error tho
I know error logging is not something you guys are into since you have hardcoded all server crashes to "Reason: Unknown"
it would be way better than having 10 conditions inside the method
issue is that it is very common for people to use this as a hack of messaging bus
Or use it in similar manner as if-else ifs
ok
For you, it might be okay to follow
at least give me the ability to collapse code blocks
for other modders would not
and if you do such hacks, debugging is painful
or studying someone's code behavior
I suppose assertive casts could make debugging a bit easier sometimes
This I want too
the language would greatly benefit from things to reduce the boilerplate
or at least I would benefit from it
I dont care if other people have difficulty following my code, completely irrelevant
My biggest annoyance is the Cast/FindComponent combo
How would you replace it though?
green man... what about safe navigation operator
Anyway to troubleshoot entity deletions by script? Got a problem right now where after a bit of time, player entities and some map entites like our safezone gets deleted. There's no log outputs for this happening though so can't find the issue.
Same deal as the other one
Similar reason
make enum.ToString do the same as typename.EnumToString
maybe enum.ToString(bool name = false) to retain current behavior
i am out of operators to suggest 
could you elaborate?
enums are actually classes internally
So the ToString behaves the same as Class.ToString
It's why typename works on them too
and modding
and inheritance
The constants, internally they get interpreted as static const int FIRSTVAR
for example
typename.EnumToString(ServerAdminTools_EPluginStatus, status);
could be replaced with
status.ToString();
or something
enum SomeEnum
{
VALUE1,
VALUE2
}
Is compiled as this
class SomeEnum
{
static const int VALUE1 = 0;
static const int VALUE2 = 1;
}
with the exception that the class receives some special behavior for enums
not possible
as you see with what I posted above
your status var is an INT
I'm pretty sure it is possible
SomeEnum.VALUE1 gives an int
because it is Class.SomeVar
where SomeVar is an int
It just does not work how you expect
yes but you could magick it on engine side
or whatever
I just dont like how much boilerplate I have to write
Yea but what I mean
It's not possible with current way the whole enum stuff is implemented
Because you lost track of where it came from
At that point ?. is more likely to happen
Maybe like this
Also wrapping for log console PLEASE
status.ToString(SomeEnum)
or vice-versa
Script Log Console or Generic Log Console?
the one in wb
hey is it possible to connect addon to discord api ? is there a get or post function ?
Nice Tyyyy !!!
Hello. Cant add waypoint to AI. I spawned a group RCS_AIGroup. Created a waypoint and using group.AddWaypoint(waypoint) added to group. In gave I can hear voice like "Guys move 100m to west" from AI commander, but bots still staying without moving. Who could help?
Your scenario might be missing navmeshes.
How to add? Maybe somewhere I can read the guide
am i on the right path here?
Yes, it was explained in the last bootcamp: https://www.youtube.com/watch?v=SsL8arV1lMA&list=PLfUcrRpCM_fKjkTrkV-bqnknVbFCPA3YU&index=12
AI Loot & Supply Waypoints Example Mod: https://reforger.armaplatform.com/workshop/6514CBB55F20D6E0-AILoot%2526Supplywaypoints
This Modding Boot Camp seminar was originally held on the Arma Discord Server on April 30th, 2025.
In this session, Senior Technical Designer Petr "Zeli" Ondráček and Technical Designer Karolína Komárková show how...
Looks good
do u guys just send two arrays or write Rpl serializer stuff for map data structure?
you are the goat bacon
Were you able to figure this out? I've run into a similar problem I think: #enfusion_ai message
Right now in progress
Same, but now I know there's a boot camp that could help! 😎
Do you know why?
ENTITY : Create entity @"ENTITY:2305843009213693994" ('SCR_AIWorld') at <7134.047363 99.118317 6273.741211>
PATHFINDING : Navmesh Init 'Soldiers'
PATHFINDING(E): Unable to open navmesh file ".NavData/soldier-navmesh/navData_0.ntile"!
PATHFINDING(E): Not able to load data.
I generated navmesh, saved to file and cant use this file in AIWorld navmeshcomponnet
they start talking about navmesh about the 28 minute mark.
I found already prepared navmesh for edem and its working. group is moving
I guess I have a different problem then. 😦
I need to spawn AIGroup and set cycle patrol in specific radius. Is it possible? somehow without creating manual logic to repeat waypoints each time
how do people extend bitflag enums in a manner that ensures compat with other mods?
or maybe i'm overthinking this, but it was a consideration I had as I was extending some enum recently
I still don't understand why this is used so regulary.
At least the persistand components could be casted once somewhere and accessed by using ComponentWithStuff.m_SomeComponent; instead of Cast/FindComponent over and over again?
Like pretty much all of the character components for example which will never change during runtime.
Caching it everywhere can quickly waste gbs of memory
Not to mention you make the memory layout more sparse for the classes which in turn affects how cpu processes things more
And in scripts, where that is already bad. You make it worse
Even if it was just a reference? (If I understood correctly)
Yes
Its about the memory layout here
If you use it on for example a component on a base prop entity
Then dont
Or in a tree ent, then dont
If its something that is instantiated 10 times only, then go ahead
I hope the point is coming across
Are you talking about CPU caches here? Like that it would make the memory usage less cache friendly leading to more cache misses and worse performance that way? Just curious to learn how things work under the hood 😅
this is about the bevy engine but the same concepts apply: https://taintedcoders.com/bevy/ecs
This guide will show you a high level overview of Bevy's ECS. ECS stands for Entity Component System and is a programming paradigm where we store and access our data in a way that maximizes performance.
if you go pointer chasing you also kinda thrash the cache
Yes, this is what I mean 👍 I.e. would caching the references break the high cache coherency typical in ECS based engines
Haven't read for a while what kind of cache optimization algorithms CPUs use nowadays, but I'd assume that in any case the less random (and more predictable) the memory access pattern is, the better the coherency and thus also performance
yeah basically. modern CPUs use the branch predictor in combination with other predictors to preload cache (which is why we got spectre / meltdown) so yeah if your code path generally hits the same memory accesses the CPU will prefetch, but in a scripting engine the CPU has less opportunity for this because the scripting language is not JIT compiled to native code, so the CPU is instead optimizing for the VM implementation itself
which is why the memory layout optimizations matter so much too: you're already at a loss because of the VM, so helping out the CPU as much as you can greatly reduces cache misses overall
now i am not a game dev but have worked on full system emulators / hypervisors / etc. where I've had to touch on some of these things, but don't take what I say as 100% accurate
Interesting information in any case 😄 And yeah, I can imagine that even with one abstraction layer between the CPU and programmer the optimization becomes much harder
if you're extremely interested in how CPUs work / memory optimizations I'd recommend popping into https://twitch.tv/gamozo next time he's live / checking out some of the materials he's shared here: https://x.com/gamozolabs
I used to work with him and can attest that this dude knows CPUs probably better than some intel architects
Also there's a nice course about the topic by local university here https://ppc.cs.aalto.fi/
Ms Agner's is the best resource
Software optimization manuals for C++ and assembly code. Intel and AMD x86 microprocessors.
Windows, Linux, BSD, Mac OS X. 16, 32 and 64 bit systems. Detailed descriptions of microarchitectures.
All the manuals here
Anyway, what is best depends on case to case basis
There is no general method to make it nice
as optimization never thrives in generality unfortunately
Also your target hardware highly affects what is best too 🙂
This is why in certain cases you see games that perform insanely nice on a CPU that is on #20 in top performant CPUs vs one in #3 where it would run way slower there
You can tell instantly that the author definitely knows what he's doing from the looks of the site 😂
Also, avoid OOP if you want high performance
do data oriented and composition hybrid
You will see how much performance you generally gain by avoiding abstraction and complex data structures
as the CPU is uncapable of processing those properly
CPUs like continous memory access, and proces data on mass based on that
Instead of for example doing a tree with classes for nodes, and connections
Do a single array with smart continous memory allocation with no node classes
You will have to think more about it, and some generalism might be gone. But it will be WAAAY faster for the computer
Yeah, I guess the best option depends on the specific case, i.e. where the bottleneck is (like working memory of the programmer's brain or CPU features). If it's the former, OOP could help, but in the latter case what you describe
society if you could compile every variation of target-cpu=native arch and deliver the appropriate binary on download
It's funny because the ones I talk about are generally not even taught in universities
It's something you find and are forced to do in practice on high demanding applications
Everyone comes fresh from university with OOP embeded like a bible
Check out the course I linked above, it might resonate 😄
And working the other way is unnatural if you come from that
and it goes backwards from what you get to learn there
I mean that is a plus of consoles for optimization tho
PC is the trickier one for this
same as mobile
There's a "story" about an uni student that comes to algorithms class with a superb algorithm. He challenges the professor and says it's much better than one that the professor showed during a previous lecture. The professor replies: "Have you tested it?" and the student replies "No, but you'll see!"
They then run both of the algorithms and the professor's one beats the student's one with a large margin. The professor ends it with a comment "This is why you need to know how to optimize for hardware as well"
idk about android but in theory apple can (does?) do this with their app submissions being bitcode format rather than precompiled bins
When I learnt about these things was when I was fresh from uni and was working on a physics simulation engine on a team. And got berated for writting some really crappy code
but i don't think they recompile for each target device CPU. i mean currently you can't even submit for arm64e
and this is why rust is superior /s (not really /s tho)
every language is 💩. You just learn to live with it and use what allows you to do what you need for the job
Even tho I prefer CPP, I also hate and love it
as a vulnerability researcher targeting c/c++ I highly encourage everyone continue writing in these languages for my own job security
It would not be so much of an issue if developers cared to learn about memory safety and the quirks of the languages and implementation
The worse that you can have is someone that wants to use CPP like they want to use JS or Python
which is quite common
unironically I think Rust is a great way to force yourself to be more thoughtful about object lifetimes -- it's forced me to do so when writing c++ at work at least
getting devs to run target binaries / tests with ASAN would be a start tho
Why not just add a borrow checker to enforce script?
two borrow checkers even
I would have prefered for ref to be handled like std::move in CPP tho
Instead of being done implicitely on assignment like now
Well as an example: SCR_ChimeraAIAgent
In vanilla they cacheSCR_AIUtilityComponent m_UtilityComponent and SCR_AIInfoComponent m_InfoComponent; in SCR_ChimeraAIAgent which are very often used with the A.I. agent.
But there are many other persistant A.I. components which i use to cache in the SCR_ChimeraAIAgent by simply using the member variable.
This is okay cuz i only use it in this one "base" class right?
I think something similar was discussed. I have vague memory of it
actually though? that would be terrible for ergonomics imo
Do you know how to make the log console wrap through editing the qt styles or whatever
Its probably not there for a reason lol
I just remember someone bringing it up at some point
generic log of script log?
generic log
Or widget whatever
You are out of luck
Is the guy that made that widget in the prague office?
I actually strongly believe that just having the simple plain pointer we have in scripts would have been a bit better
Or is this me? lol
Ima swing by in a few weeks and I have words
You can avoid refs/managed if you inherit your class from Class
then you have to manage the lifetime yourself
or use autoptr somewhere if lazy
👀
what a wonderful world it would be if an array in a enforce contained values, instead of references... 
primitive types are stored as values in continuos memory
But classes - not
Anyway how is this relevant to you?
So Class isn't ref?
As I said
If you inherit from class, you are not Managed
Does not inheriting from class explicitly mean it's managed?
ref won't be and won't work there
and you have to delete it manually somewhere
It's also faster performance wise if your class is like that
for that same reason
Yeah
from Game module and up
Gamelib and Core default to Class
The rest to Managed
So what, class MyClass: Class?
Yes
That looks ugly, I'll keep avoiding it
Just need to iterate over a big array as fast as possible at every frame/fixed
I prefer to not say something I was about to say 👀
You can just copy the classes before procesisng, if they stay the same overtime then it;s worht it
Just do it at the same time so that they are continuos (Hopefull, allocation could mess you up at some point).
Issue is that it won't necessary be close to the array allocation itself if classes
Anyway for obvious reasons we won't provide low level stuff to script
People mess up heavily with high level stuff anyway
Atleast the high level stuff is easier to debug
that's why I'm crying (||where is my threads 😭 ||)
I need to spawn AIGroup and set cycle patrol in specific radius. Is it possible? somehow without creating manual logic to repeat waypoints each time
You can try your luck with: SCR_EditableGroupComponent > EnableCycledWaypoints(bool enable);
Not quite sure if this is the right place to do it but at least it look's promissing.
Btw, regarding mostly future projects with Enfusion: are there any plans to provide a "stable" API for modders with guaranteed future compatibility when it comes to scripting? I would imagine that if there won't be such thing, scripting is gonna be hell with no compatibility and stuff breaking between game versions
I get it that the whole paradigm is different with Enforce Script. But I still think that some of the heavy lifting should be done by a stable API. Or am I completely lost here?
Stability will greatly increase when we are done with all roadmap features
Any ETA? Over time since 1.2+ the servers experience more crashes with each update
I am talking about non breaking changes, not crash rate. That should go down with every patch
I mean each update with new features introduced risk of new uncaught crashes. So after roadmap completion this also happens more rarely
Is crashing when typing ## in chat from a new feature?
I wonder how long that's been in the game, never tried before
For past AR we are implementing certain things to make it better
For AR is hard to do so due to it already being am existing big codebase
And those changes, would break mods heavily.
Biggest issue that you have in AR, like Arkensor said is that you are modding a game that is being updated heavily stilk
So problems will eadily arise
Specislly since the architrcture there does not allow for certain compatibility changes
But things we learnt in AR are being used to better it for A4 from the start
Like no script invokers 
But you do have an event system so it should practically replace script invokers
So not worrying for me personally
Yeah that is why
Up to you
Yay!
Will it be possible to override static methods? And their return values?
I mean I can do it now sort of but it still returns stuff from the parent class
also is there a method in script to list all quads from an imageset?
Would like to make a page that has a preview of all icons in an imageset
you can override static methods, and call super and vanilla
About the return value, no
Big oof
Tbh I wanted a static string method that I would override in inheriting classes to return different string
I think you do not understand how override is supposed to work in languages
you are asking for non determinism
the only case you can, even outside of enforce script is with covariant types
which also works in enforce script
Search for covariant return type
Seems to me, you are asking for overload
Are there some upcoming code changes in next major update I could prepare for?
not override
I have a script heavy mod
experimental versions exist for this purpose. there will be plenty of time on exp before it hits stable
Any guide how to create task for player? like objective with marker on map
#enfusion_scenario go find blackheart six youtube he has tons of videos about all that.
I mean from script, not from UI builder
Is there an equivalent to ScriptCallQueue.CallByName that gets me a return value?
pass a struct in an argument and have the callee set result in that struct
this pattern is also useful with ScriptInvoker and can be used with multiple callees (and depending on callee’s logic you can have the first, last, or whatever result). kind of a poor man’s voter pattern
I just want a map that I will use to handle requests by type
in place of 2348235238534 conditions or switch cases
Looks like it behaves like calllater with 0 delay
So no I dont get the update immediately
thats ok I can respond inside the method I guess
It cant run protected methods? Ouch
Time wasted once again
GetGame().GetScriptModule().Call(ClassInstanceHere, "YourMethod", /* false for blocking */, returnValHere, ...Params)
Guys, any tutorial "How to create task for player with map marker using script"? Or maybe code snippet
No script invokers? 
How do we invoke scripts then?
We also remove scripts
Ahh yes, scripts were sometimes causing errros therefor they were removed :^)
err wut?
Awesome
SOLUTION: #enfusion_scripting message
Can someone write me a script to add a smoke grenade into a vest on any unit wearing ALICE webbing?
I have this function that works on adding items to the uniform and backpack but have no luck on the vest.
static void AddItemToStorage(IEntity unit, ResourceName prefab, BaseInventoryStorageComponent storage)
{
if (!unit || prefab.IsEmpty() || !storage)
return;
SCR_InventoryStorageManagerComponent mgr = SCR_InventoryStorageManagerComponent.Cast(unit.FindComponent(SCR_InventoryStorageManagerComponent));
if (!mgr)
{
Print("UCAMF: Missing InventoryStorageManagerComponent on unit");
return;
}
bool success = mgr.TrySpawnPrefabToStorage(prefab, storage);
if (!success)
{
PrintFormat("UCAMF: Failed to add item to storage: %1", prefab);
}
else
{
PrintFormat("UCAMF: Successfully added item to storage: %1", prefab);
}
}
BaseInventoryStorageComponent uniformStorage = UCAMF_UnitInventory.GetStorageFromArea(player, LoadoutJacketArea);
BaseInventoryStorageComponent pantsStorage = UCAMF_UnitInventory.GetStorageFromArea(player, LoadoutPantsArea);
BaseInventoryStorageComponent backpackStorage = UCAMF_UnitInventory.GetStorageFromArea(player, LoadoutBackpackArea);
UCAMF_UnitInventory.AddItemToStorage(player, grenadePrefab, uniformStorage);
UCAMF_UnitInventory.AddItemToStorage(player, grenadePrefab, pantsStorage);
UCAMF_UnitInventory.AddItemToStorage(player, grenadePrefab, backpackStorage);
Not only did RHS write their own component for storage but even vanilla vests seem a nightmare.
I've pondered a tacky fix of filtering through the available pouches on a vest
SCRIPT : UCAMF: Storage ClothNodeStorageComponent<0x00000195C4A1DE30> has 8 items
SCRIPT : - {B95BD66EA8F863C8}Prefabs/Characters/Vests/Vest_ALICE/Vest_ALICE_suspenders_2.et (GenericEntity<0x0000019590D01460> @"ENTITY:4611686018427388087" ('GenericEntity','Assets/Characters/Vests/Vest_ALICE/Vest_ALICE_suspenders_2.xob') at <1744.947754 39.000603 2917.479736> @"{B95BD66EA8F863C8}Prefabs/Characters/Vests/Vest_ALICE/Vest_ALICE_suspenders_2.et")
but this seems unlikely to work, especially once RHS is included.
//Function used in source code above
static BaseInventoryStorageComponent GetStorageFromArea(IEntity unit, typename areaType) {
if (!unit) return null;
EquipedLoadoutStorageComponent loadoutStorage = EquipedLoadoutStorageComponent.Cast(unit.FindComponent(EquipedLoadoutStorageComponent));
if (!loadoutStorage) return null;
IEntity clothing = loadoutStorage.GetClothFromArea(areaType);
if (!clothing) return null;
return BaseInventoryStorageComponent.Cast(clothing.FindComponent(BaseInventoryStorageComponent));
}
Delegates and actions? More C# keywords and systems? ☺️
He's probably shady like that
he doesnt receive e-mails or communications ?
the strange this is that the mods appear in the workshop
Yeah that is bizarre. Maybe have them show screenshot of their publish window settings
hey Zelik thanks so much for this tip it lead me to create my own custom component that i can now attach to any prefab i want! this tip was such a lifesaver! Im going to be publishing my creation on the arma reforger workshop soon once im happy with the audio node setup ill make sure to thank you in the description of my addon!
I really appreciate it, some people aren't even nice enough to do that.
There anyway to override/mod RplComponent so I can get outputs of whats happening in replication?
I realize I can inherit, but it'd be quite time consuming to replace the RplComponents on everything I need to debug.
I'm running into some issues with the Input Manager and Input Contexts that maybe someone at Bohemia can answer as most of this functionality is native.
- We can check if an Input Context is active with
InputManager m_InputManager = ...
m_InputManager.IsContextActive("CharacterMovementContext");
But it appears this will return true as long as the context exists, even if the context is disabled (e.g. I am in the inventory) - See the picture.
CharacterMovementContext is considered active despite the bar in the diag window being low. I assume this is because of the context priority (from the chimeraInputCommon.conf) and I don't see any way to check the priority or if its "active" given the priority. Is this possible?
- It seems that on
EOnFrame(...)several Input Contexts such likeCharacterMovementContextare not returning as active by theIsContextActivefunction. It works in theEOnPostFrame(...), howeverEOnPostFramedoesn't properly get the values of actions throughInputManager.GetActionValue(...).
Therefore the only place where it is reliable to work with Character Movement Inputs is in SCR_CharacterControllerComponent.OnPrepareControls(...) but this is protected, so I have to mod this and add a ScriptInvoker to give callbacks from this function. I don't like modding classes for compatibility sake.
Is there a reason to the contexts being disabled mid frame or some insight there? OnPrepareControls() is running at some point every frame anyway.
that's from the grenade aint it?
yea xD
Does anyone know why the NPC's clothes are spawning on the ground beneath him?
It's actually random, sometimes they have all the clothes, sometimes nothing, sometimes just one item.
Anybody able to help me with a script that can make a particle play only during nighttime? 🙂
Pretty please - im useless with scripting and ChatGPT wont cut it lol
Not modding DayZ anymore?
Heyy Mario, long time man and nah, tried going back now and then but I cant get myself working with that engine anymore lol
I spawn an entity. The entity has an RplComponent, but it's disabled by default. Is it possible to enable it runtime? FindComponent returns a null.
Reason: ScriptModule.Call: method 'RequestHandler_GetMotd' is private/protected
Doesnt work in inheriting classes
My reply was not really targeted to the encapsulation
But of a way to do it right away (The call)
It works great in the parent class
Enforcement of encapsulation was fixed on these in 1.3
it was not respected before (Bug)
GetGame().GetScriptModule().Call(this, handlerName, true, response, request);
Should I pass the class from outside?
this refers to the correct class instance though
Because I am also logging it
Just make the method public if you want to access it through these things
As these are called on global scope
I think I am lost
Show code and reexplain like if I had no context
DoSomething(string handlerName, string request) {
string response;
GetGame().GetScriptModule().Call(this, handlerName, true, response, request);
}
protected string SomeHandler(string request) {
return "hello";
}
In the above example it works fine, but in a class that inherits this class it doesn't work
That async should be false though oops
Note in the inheriting class I am trying to call a method that doesnt exist in the parent, maybe that matters

before you ask
the async thing is not a thread
I dont see why I should make request handlers public
Failing that I can create a class with a HandleRequest method and store it inside the map
But I really wanted to avoid having to define classes for every request
Do you have the new class in what script module?
Game

It's a ScriptComponent
I'll check what the code is doing
It might be doing it based on context when compiling
Wtf
I moved the call part into the inheriting class and it fails with same VME
I moved it into an override of a method
So I guess it's calling in context of the "vanilla" method
Which is a little frustrating
But it works if its public
But in the parent it works if its protected
Ahhhhhhhhhhhhhhhhhhh
it doesnt work even if the call is inside a new method defined in this class
Idk
Weird root parent class only feature lol
All I wanted was to define request handlers in a map to avoid 50 if statements

So is there any easy way to do what I want
If I make a class for every type of request I'm gonna end up with like 30 classes
I want to avoid having too many classes in the mod since there's already like 150
I can't suggest things without know the full extent of what your feature is supposed to be adn do
Replace this:
void HandleRequest(string requestType, string someData) {
if (requestType == "type1") {
// do something with someData
return;
}
if (requestType == "type2") {
// do something with someData
return;
}
}
With this (pseudo code):
ref map<string, string> m_MyMapWithHandlers;
protected void Handler1(string someData) {
// do something with someData
}
protected void Handler2(string someData) {
// do something with someData
}
void HandleRequest(string requestType, string someData) {
// request handlers stored in m_MyMapWithHandlers
RunMyMethodFromStringName(m_MyMapWithHandlers.Get(requestType), someData);
}
Now that I look at it, it doesn't seem that bad of an idea to make it all public
Since HandleRequest is public anyway
Lol
So if I want to use protected/private methods for this then I need to setup a scriptinvoker for every request type
Anyone know ?
This is kind of why friend attribute is planned
what mods are you using?
Shop System
Is it the only mod you are using?
the shop system is the problem with NPCs having clothes on the floor, but i ahve more
Zeliks Loot Spawners , Zeliks Zones
I sent the complete list to your PM
That is like 20 mods lol
Try it with only the mods needed for your use case
it's a dayz server, they need to be 😦
It's a known issue with the shop system "NPCs". Because they aren't actually characters(SCR_ChimeraCharacter) , the component that attaches their clothing doesn't replicate to clients or something.

They actually worked, regardless of them not being a character originally iirc.
@rapid ferry Didn't they? or am I mistaken.
yeah its a bad prefab setup probably. you solved this a while ago, so @hushed swan just enable these components on ur shop npc: #enfusion_generic message. me too lazy to fix mod
Your shop npc isn't a character, he'll have to create a "NPC" prefab with those components disabled and add the shop system stuff to it as wll.
well*
ohh ty , i try
EntityDto test = new EntityDto();
test.params.Insert("test", Class.Cast(new Any<string>("test")));
test.params.Insert("tesstsasd", Class.Cast(new Any<float>(1.5)));
Print(Any<string>.Cast(test.params.Get("test")));
Why params like map <string, class> convert to map<string, Any<float>>... WTF 😂
P.S. Resolved -> I don't know why this is so implicitly, but "ref"... it's my bad... )
is there a function that returns a player's identityID?
Hello I'm looking to get into scripting I'm pretty new to scripting and don't know a whole lot just some basics any pointer would be greatly appreciated but I'm looking to create a component that makes optics have a slight opacity when aiming to mimic having both eyes open witha bit of dof around the optic I'm sure this is possible but I have no clue where to start
On BackendApi
Hello, can anyone here help me or share a script that forces the player into a specific faction?
Comments:
Called on every machine after a player is registered (identity, name etc.)
Reality:
identity = "";
Some time later:
identity = "<real uid>";
🤯
Event is called when player connecting Session hosting current Game Mode where is required authentication verification via. platform services
AuditSuccess() call specifically mean this verification was successful
Basically audited player has access to persistency/ etc. related functionality provided by online services.
\param iPlayerID is index of player in game, equal to the one assigned at PlayerController
*/
event protected void OnPlayerAuditSuccess( int iPlayerID ) {};```
whoever wrote that comment must've had a stroke. I hope they are OK.
Yes you need to wait for audit success to have passed
One or the next major updates will contain a new utility method with peertool support and errors it used to early or improperly
Until then consider looking at the wrapper code I prove in EPF mod
I am actually looking into this because I have an issue with testing my mod on a local dedicated server launched from workbench. neither of OnPlayerAuditXXX callbacks seems to trigger
Its prepared for doxygen formatting
In code it will look weird
Notice that things aimed to be Names and References have capital letter
That is why it looks odd to you. In doxygen it will point to another page
makes sense
This is important because if you do not capitalize it then doxygen wont auto link it
And adding the link right away in the doc is maintenance hell and clutters it more
that's what I'm having a problem with actually. WaitForUid never triggers
This kind of backfires
As sometimes common words get auto linked. Meaning that in many cases you cant use them 😅
So you would see some comments trying to go around that in some funny ways
In many cases switching to UK or American versions of a word. In others making a typo on purpose or a random capital letter
It won't audit success in workbench in current public build. It will be in the future. That is what I have a hack for onplayerregistered
Ah, okay. It only goes into that flow if RplSession.Mode() != RplMode.Dedicated, so it hangs when launching a dedicated from WB.
when launching a dedicated server from WB, is WORKBENCH define set or not? if not, am I correct to assume shit will blow up if I define it on CLI?
A truly dedicated server will work
A listening server will not. What you start with peertool. Just hate the logic I have in my mod and use normal peertool testing.
the thing is I am launching a dedicated server and connecting to it with peertool. not using the listen server within workbench
...unless by truly you meant a normal production exe - which yeah, works fine
Then it will only work if your server is registered to backend properly. Aka I could join if it was public. Anything else won't work.
I suppose diag exe does not do that
Especially not with raw loading of unpacked mods etc. It needs -config.
There is no need to test on dedicated servers. They don't behave differently than listen server through workbench.
can I detect authoritatively that server is running without backend connection? something in BackendApi?
I think you can read CLI params and found -noBackend
No that won't help you for if you are not connected. Also that Param is due to not exist anymore
well, yes and no. the problem I'm after is that I need to access ENotification-s config on the server, which is not loaded there, because SCR_NotificationsComponent is attached to a player controller, and singleton getter accesses it through GetGame().GetPlayerController().
so I need to load it manually in that case, and to make sure it works I need to test it properly - and I won't reproduce it without a dedicated.
I can hack it ad-hoc, but I'd prefer to have a persistent solution in the codebase to be able to run dedicated+peertool setup in the future
Player controller on the server must be retrieved by player id via player manager. That shortcut is for clients only
If you want reliable testing you NEED to use normal peertool. All our changes are for it. Dedicated server on local pc without actual full setup is not supported by any API
no more 200 players, and no more convenient real mp test without mod publishing
so what's the point of dedicated server tool in workbench, or is it considered legacy?
Honestly no idea what purpose it serves. At least none if you want to do anything with backend data such as player identities
also with using peertool + workbench listen server you can't test any scenarios that involve no players online on the server. testing with a dedicated server is an absolutely valid scenario
Sure but then you also don't have any identity issue as you will never ask for them. As no players are connected
missing identities is also an issue on workbench listen server; no difference really.
There will be full support for it soon. You asked for something reliable in the future code base etc. So start testing with normal peer tools
dont use dedicated is not a solution for I have a problem running dedicated 😄
You started to ask here about how to get the identity of a player. I am answering that question
no, I think we miscommunicated at some point
If you don't care about identity, use onplayerregistered. It fires for all regardless
I don’t understand how using peer tool is recommendation for testing multiplayer. Since it does not behave like a dedicated server , thus making testing limited
my question is: how do I tell within OnPlayerRegisted that the OnPlayerAuditXXX will never trigger, so I need to go into the hack flow
There is a hack someone posted here a while ago
What behaves differently? They run the same code
you can easily write code that relies on stuff that turns out to be attached/relevant to local player controller (or even sound system). it will fail on dedicated but work on a listen server
Oh yeah you can definitely accidentally have things work that only do on this mixed client server main window. That's true.
I think the fact that they run the same code makes matters even worse, because for unexperienced devs it just magically works for all combinations (dedicated, sp, listen + clients) until it doesn't. and when it stops, oh boy, good luck debugging that if you haven't kept any convention or at least a sense of what is allowed to execute in which context.
a very common issue I saw is attaching local player's stuff unconditionally to the PlayerController. usually dedicated server works fine, but listen server gets messed for the hosting player as soon as another player joins
I think the best solution for you is to wait for a patch. I got annoyed by audit sometimes firing sometimes not. So we will just fix that. Until then you have a solution available that I described
If by works fine you mean nullptr exception then yes
np, I appreciate your help
a landing you can walk away from is a good landing. unless the server segfaults it works fine. 😆
@dark ocean Do not follow this advice, it's very wrong.
Listen client does behave different than dedicated server environment.
Feature wise even
Due to the proxy/auth/owner model
You could have things that work nicely in listen client for example, but not in dedicated. And it would be expected.
They are not the same at all.
If you watch the replication modding bootcamps on youtube
You will easily see why
Just gave up trying to sort our peer tools and the server plugins and just publish the mod to a live server for testing. Too many nuances that weren't surfacing when testing in the workbench
Did you use dedicated server tool?
Or peer tool?=
They are not the same
the problem with that is a) you don't have the debugger and ability to step in, b) you can't see/filter logs live, c) that's a lot of turnaround time (at least for me, it takes several mins for my hosting provider to reprovision the server), d) you can't connect with several clients to a live server
This one will launch an actual server (You should see the CMD window open with it)
in my experience peer tool works fine (and I often run WB + 4 of them concurrently), now that I hacked EPF the dedicated server tool + peer tool also does the job as expected
Anyway Hovi
If you are doing things based on server and client, then of course it ill be broken
Use proxy/auth/owner model properly and it will always work
Once you nail that, you only have to test on one env and it will work on all
I feel like half of my battle is getting the peer tool set up correctly (and there seems to be super limited documentation out there on it). Dedicated server + peer tool. I'd love to see your example of the setup/parameters if you don't mind Dming it o me
If you struggle with it, then it means you do not understand it yet.
But yea, its obviously not ideal pushing it out to a live server and asking for some actual help testing with real clients
Watch both modding bootcamps for replication
We show both of those
And explain the model with practical examples
also
You can get people to connect to your server launched by dedicated server tool
It does not have to be only virtual clients
Thanks. I've done this and it just simply doesn't play nicely with the way that it's demonstrated. I'll do my best to get to a point of understanding it, would be easier if this pretty important testing stuff wasn't burried in a random segments of 2 hours videos. Beyond the fact that the -parameters are never discussed in full detail or documented?
Peertool should configure itself
Anything other than it setting up itself (at least for the first time) is bad UX
It should take addons and addonsDir from WB
And just work
Instead of having to configure it manually
Bad UX seems intentional in the Reforger area
They give you an option to specify a ban reason when banning someone and then when you view bans you dont see reasons
Hahaha
No remote no apply
Idk if you guys were talking about this but it’s really frustrating that PeerTool seems to be extremely flaky in CTI scenarios with duplicate identity errors
has like a 3% success rate for me 
Getting this now, except I have valid coords
Prototype
IEntity player = UCAMF_Core.GetPlayerEntityByID(1);
ResourceName prefab = "{77EAE5E07DC4678A}Prefabs/Weapons/Grenades/Smoke_RDG2.et";
UCAMF_UnitInventory.AddItemToVest(player, prefab);
static bool AddItemToVest(IEntity unit, ResourceName prefabToInsert, BaseInventoryStorageComponent optionalTarget = null) {
if (optionalTarget) return TryAddItemToSpecificStorage(unit, prefabToInsert, optionalTarget);
return TryAddItemToAnyVestPouch(unit, prefabToInsert);
}
static array<BaseInventoryStorageComponent> FindVestCompatibleStorages(IEntity unit, ResourceName prefabToInsert) {
array<BaseInventoryStorageComponent> compatibleStorages = {};
if (!unit || prefabToInsert.IsEmpty()) return compatibleStorages;
SCR_InventoryStorageManagerComponent mgr = SCR_InventoryStorageManagerComponent.Cast(unit.FindComponent(SCR_InventoryStorageManagerComponent));
if (!mgr) return compatibleStorages;
array<BaseInventoryStorageComponent> allStorages = {};
mgr.GetStorages(allStorages);
foreach (BaseInventoryStorageComponent storage : allStorages) {
IEntity sourceEntity = storage.GetOwner();
if (!sourceEntity) continue;
ResourceName sourcePrefab = sourceEntity.GetPrefabData().GetPrefabName();
if (!sourcePrefab.Contains("Prefabs/Characters/Vests/")) continue;
if (!SCR_UniversalInventoryStorageComponent.Cast(storage)) continue;
if (mgr.CanInsertResourceInStorage(prefabToInsert, storage)) {
compatibleStorages.Insert(storage);
}
}
return compatibleStorages;
}
protected static bool TryAddItemToAnyVestPouch(IEntity unit, ResourceName prefabToInsert) {
if (!unit || prefabToInsert.IsEmpty()) return false;
SCR_InventoryStorageManagerComponent mgr = SCR_InventoryStorageManagerComponent.Cast(unit.FindComponent(SCR_InventoryStorageManagerComponent));
if (!mgr) {
Print("UCAMF: Missing InventoryStorageManagerComponent in TryAddItemToAnyVestPouch");
return false;
}
array<BaseInventoryStorageComponent> vestSlots = FindVestCompatibleStorages(unit, prefabToInsert);
foreach (BaseInventoryStorageComponent slot : vestSlots) {
if (mgr.TrySpawnPrefabToStorage(prefabToInsert, slot)) {
PrintFormat("UCAMF: Successfully inserted into vest slot: %1", slot.ToString());
return true;
}
}
PrintFormat("UCAMF: No compatible vest slot found for prefab %1", prefabToInsert);
return false;
}
protected static bool TryAddItemToSpecificStorage(IEntity unit, ResourceName prefabToInsert, BaseInventoryStorageComponent targetStorage) {
if (!unit || prefabToInsert.IsEmpty() || !targetStorage) return false;
SCR_InventoryStorageManagerComponent mgr = SCR_InventoryStorageManagerComponent.Cast(unit.FindComponent(SCR_InventoryStorageManagerComponent));
if (!mgr) {
Print("UCAMF: Missing InventoryStorageManagerComponent in TryAddItemToSpecificStorage");
return false;
}
if (mgr.TrySpawnPrefabToStorage(prefabToInsert, targetStorage)) {
PrintFormat("UCAMF: Successfully inserted into specific storage: %1", targetStorage.ToString());
return true;
}
PrintFormat("UCAMF: Failed to insert into specified storage: %1", targetStorage.ToString());
return false;
}
So taking advantage of this will help with the issue I have of, "it works in workbench, not on the DS"?
Made a few features and it comes down to this. Started to do testing with the DS Tool to better test what is ran on server and client, but from what I read this would essentially be useless?
How can I disable the player from seeing a box and accessing it via "TAB"?
I used Peer Tool couple times in the past and the things i've tested worked.
However ppl with real dedicated servers told me they did not work, so i tryed with the server.exe ( locally ) and they did infact not work.
So since then i only use the server.exe locally hosted to test anything mp related.
This is not for tools
I think if you understand how peer tool works and what you’re testing entirely then peer tool is good. Also slightly faster to boot? Otherwise for testing methods that require replication, sever.exe seems like the best option
Testing with the server tool could be made much easier if the restart was automated (aka. close the 2+ windows and relaunch with one click ). Also the ability to live tail all peer logs
you can display logs live within the peer window by shift + ~
What i doing wrong ?
Just read the first error
You don't have class that mentioned here
Now csript is available but engine is not starting
Use force start engine for cinematic purposes
Here is what I used a few days ago
GenericEntity vehicle = GenericEntity.Cast(GetGame().GetWorld().FindEntityByName("bambi_killer"));
CarControllerComponent controller = CarControllerComponent.Cast(vehicle.FindComponent(CarControllerComponent));
controller.ForceStartEngine();
VehicleWheeledSimulation vehicleSim = controller.GetWheeledSimulation();
vehicleSim.ForceEnableSimulation();
vehicleSim.SetGear(4);
vehicleSim.SetBreak(0, false);
vehicleSim.SetClutch(1);
vehicleSim.SetThrottle(1);
@torn bane Arkensor, hi... Sorry for tag, but i have a question that has been discussed for some time in "enfusion scripting". I saw that there are problems with limited network resource in arma reforger. I would like to understand an optimized or correct way to increase the limits, perhaps not to use JsonApiStruct, or for example hang another application and stream read the file to which the data will be written from arma reforger... Perhaps there are some sensible thoughts on how to get sufficient volume without untraceable errors?




