#enfusion_scripting

1 messages · Page 7 of 1

late locust
#

Will try, thanks

pliant ingot
late locust
tough cave
#

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?

late locust
#

Also does authority need to do that?

pliant ingot
late locust
#

Ohh I see

pliant ingot
late locust
sleek dove
late locust
sleek dove
#

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

late locust
#

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

sleek dove
#

No your code is unstream for everyone, and stream for your specific connection

late locust
#

Yeah thats what I want

sleek dove
#

I mean from the message above you wanted to force stream out an entity, so EnableSpatialRelevancy should do that

late locust
#

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 thonk

sleek dove
#

Yeah exactly, if you do enable false with EnableSpatialRelevancy on an entity that is not spatial, it will stream it to you

late locust
#

Can I do that on same frame?

#

So its not fast enough to unstream and restream and just keeps it there? hmmyes

sleek dove
#

Yeah, it will be fine

#

The changes will only get process on next replication tick anyway

sleek dove
late locust
#

Alright, thanks alot meowheart

frosty sable
#

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.

prime quarry
#

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.

high hawk
frosty sable
late locust
minor agate
sleek dove
late locust
#

No just mine

sleek dove
#

And which vehicle? I will try to repro locally

#

And when do you call the method as well ?

high hawk
late locust
frosty sable
minor agate
late locust
#

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

torn bane
frosty sable
frosty sable
#

Sorry Arkensor I have miss read what you said and my brain skipped passed the word multiple

torn bane
#

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

frosty sable
#

Thank you thats helpful.

serene fox
#

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");    
ocean kernel
#

ApiCtx.SetHeaders("Content-Type","application/json");

foggy swift
frosty sable
#

Thank you Connor, its working well nicely on just a dev box for me too

foggy swift
#

Using atlas and no issues on that front either 👍

serene fox
ocean kernel
#

Well that's how you set headers

#

I think

#

name,value,name,value...

#

I might be misremembering tho

analog python
#

Are mods able to write to ReforgerGameSettings.conf or is ModuleGameSettings only for BI? hmm

ocean kernel
#

In my mod called Keybinds Resetter I was able to delete InputUserSettings.conf on Xbox

#

Whether this works in current version or not idk

sleek dove
midnight talon
#

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

late locust
late locust
# sleek dove I tried it and it works, I can share video in PM if you want, I do `EnableSpatia...

Im really not sure what im doing wrong. But I cant get it to work notlikemeowcry
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);
    }
}
hushed swan
#

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?

hushed swan
#

How can I disable or validate this?

dire sinew
#

This method controls the visibility in the inventory menu for an item

ocean kernel
#

Did 1.4 bring any updates to systems, like providing built in feature to efficiently register and unregister entities?

pliant ingot
ocean kernel
#

Or when entities are quickly created and deleted

pliant ingot
#

And on remove you just need to swap indices of item to remove and last and remove your item

ocean kernel
#

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.

pliant ingot
ocean kernel
#

So they wouldnt have to register?

pliant ingot
ocean kernel
#

That's way better yeah

sleek dove
#

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

ocean kernel
#

aight bet

#

yeah I figure I will worry about it if it becomes a problem

minor agate
#

At any point it could be limited based on how it gets exploited and modders thinking its some place safe for storage

ocean kernel
#

Hmm that gives me some ideas

sleek dove
analog python
#

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?

river imp
#

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.

dire sinew
river imp
#

Because I need to do this dynamically at runtime

dire sinew
#

Then override said action and add a toggle for the visibility

river imp
#

CanBeShownScript is only called on client iirc

dire sinew
#

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.

river imp
#

meaning iI would have to rpc values

#

and I don't wanna do that for a potentially huge number of entities.

dire sinew
#

What exactly are you trying to do?

river imp
#

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

dire sinew
#

Forget about deactivate. Components can't be deactivated at runtime.

river imp
#

You could have started with that lol

dire sinew
#

Again, what is your ultimate goal?

river imp
#

To disable a user action on an entity without having to rpc values to the clients

dire sinew
#

I mean your particular use case. Like you want to remove the door action for certain buildings?

river imp
#

No

dire sinew
#

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.

river imp
#

I'm beginning to think that doing anything in regards to furniture on buildings just doesn't work lol

dire sinew
#

Eh, I did manage to make a script to query tables for placing intels 😅

river imp
#

I can get them

#

and delete them

#

I just can't seem to do anything else with them

craggy kernel
#

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.

static vale
#

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.

analog python
craggy kernel
craggy kernel
craggy kernel
late locust
timid citrus
#

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

ocean kernel
#

Its in the particle effect I believe

midnight talon
ocean kernel
#

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

shy steeple
#

@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.

ocean kernel
coarse moon
#

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);
        }
    }
}
clever oxide
#

How to get running Scenario ID on dedicated server? Backend API's DS Session : Scenario ID shows " "

ocean kernel
#

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?

sweet badger
clever oxide
frosty sable
#

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.... 😳

shy pond
#

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.

pliant ingot
ocean kernel
#

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

ocean kernel
#

Do systems not run on client with Frame point?

#

nvm they do but InitInfo/outInfo is useless

coarse moon
river imp
#

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

coarse moon
#

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...

spark otter
ocean kernel
#

Ahh forgot to report I figured out. Made my own editable entity component.

main crescent
#

not wanting be funny new here but is scripting same as codeing and if so were would one start to try learn this

boreal swan
#

@main crescent Sent a DM

analog python
kindred vessel
#

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.");

pliant ingot
#

But this should work and in SP just out of box

kindred vessel
#

gotcha, then i did something wrong 🙂 thank you for confirming

pliant ingot
rapid ferry
kindred vessel
#

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

kindred vessel
#

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!

river imp
#

No need to mod vanilla classes unless you absolutely have to

kindred vessel
#

gotcha, thank you very much

midnight talon
#

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?

midnight talon
#

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

river imp
#

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.

midnight talon
midnight talon
river imp
#

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.

midnight talon
#

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

river imp
#

That's already what network bubbles do.

midnight talon
#

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?

river imp
#

Not sure about that aspect of it tbh.

midnight talon
#

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

river imp
#

Why are you ending up with a bunch of ground loot?

midnight talon
#

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

river imp
#

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.

midnight talon
#

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

river imp
#

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

midnight talon
river imp
#

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

sleek dove
midnight talon
# sleek dove Another way is to create a representation of your item, as a non entity like a c...

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

ocean kernel
#

How to make script editor not lag for a minute when opening scripts while having 50 mods loaded?

late locust
#

What is this for in a System? Is this data not set in the system config? thonk

    override static void InitInfo(WorldSystemInfo outInfo)
    {
        outInfo
            .SetAbstract(false)
            .AddPoint(ESystemPoint.FixedFrame);
    }
ocean kernel
#

Genius

ocean kernel
scarlet iris
#

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?

late locust
scarlet iris
#

Do I just create a new script with the SCR_BaseTask subclass? Something like this?

pliant ingot
#

ExportToClipboard doesn't have any limitations like A3 version?

dire sinew
torn bane
timid citrus
#

Whats best class / method to work with cursor for UI in newest version?

ocean kernel
#

How do I set this to only show scripts from my mod?

pliant ingot
ocean kernel
#

dfhgsddgs

pliant ingot
#

It much better even if you don't have autocomplete

dire sinew
#

Giving up autocomplete isn't worth it tbh.

pliant ingot
pliant ingot
pliant ingot
#

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

kindred vessel
#

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.

tough cave
#

there's a chat command that will crash ur client. on official missions /servers as well.

ocean kernel
#

Lol what is it

fervent stirrup
#

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).

fervent stirrup
#

Its unlisted rn

versed remnant
#

Can you send me the project (or the downloaded addon as a zip) ?
I will have a look during my break

quaint basalt
#

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?

ocean kernel
#
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

quaint basalt
#

Damn, that was super fast
Big thanks

ocean kernel
#

does it work?

quaint basalt
#

Like a charm

ocean kernel
#

yippee

frosty coral
#

What class is responsible for these controls hints?

ocean kernel
#

There is a config with them I forget the name but it has all hints in it

#

Available actions something maybe

versed remnant
frosty coral
pliant ingot
ocean kernel
#

Hes building react, call the cops

maiden goblet
maiden goblet
pliant ingot
maiden goblet
#

and how the fuck do you train that at home?

pliant ingot
maiden goblet
pliant ingot
maiden goblet
#

So, what's the advatnage of local? over just using huggingface or even openAI api

pliant ingot
maiden goblet
#

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

pliant ingot
maiden goblet
#

Would be nice if BI put Reforger's scripts on Github, then they would be in the training data for all the llms.

sleek dove
timid citrus
#

Is there a page that shows api changes in each update?

timid citrus
#

Im going to start duplicating core scripts and feeding them to my chatgpt. Too bad theres no "Duplicate all to.."

maiden goblet
#

cann add all in one click

timid citrus
scarlet iris
#

Is there a way to keep the markers the same size regardless of map zoom?

ocean kernel
#

how do I override a static method lol

#

or at least what that method returns

#

should I override the variable it returns instead?

sweet badger
ocean kernel
minor agate
lofty stag
#

Weird question, but is there a way to change the name a mod is published under? Mine is just showing my email

ocean kernel
sweet badger
ocean kernel
#

ok

sweet badger
#

Could also be other things though, idk

tough cave
#

PSA: Don't type ## in-game.

ocean kernel
#

Are you serious

tawny lotus
#

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?

ocean kernel
tough cave
#

the faster Alt-F4 in a way. maybe not a bug.

lunar wolf
#

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

ionic compass
#

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..

ionic compass
river imp
#

One of these

#

In 945% of cases in the game module

ionic compass
warm void
#

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.

foggy swift
#

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

foggy swift
late locust
#

Is there any difference between these two?
Setting signal via action on all clients + server
Setting MP signal via action only on Server

solid hearth
#

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...

ocean kernel
#

the results of your action are only synced within the replication range though

#

if its not a global signal

wooden gale
#

JSON say is correct but the server doesn't start what I'm doing wrong?

ocean kernel
#

whats the best way for me to get current movement direction?

#

without using any movement components, all I got is IEntity and Physics

fervent cedar
ocean kernel
#

will try thankies

shy steeple
#

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

maiden goblet
shy steeple
#

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.

ocean kernel
#

It works in script too, but sometimes it doesnt

shy steeple
#

Damn

ocean kernel
#

but when it doesnt it just doesnt compile, so you'll be fine

shy steeple
#

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

ocean kernel
#

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

rapid ferry
minor agate
#

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

ocean kernel
minor agate
ocean kernel
# minor agate No

Did you know it throws VME when you login as admin in game master scenario

minor agate
#

Repprt it in FT pls

ocean kernel
#

Nah

minor agate
ocean kernel
minor agate
#

Yes

ocean kernel
#

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

minor agate
#

Did u know the game crashes when you

ocean kernel
#

wat does -nan(ind) mean

dire sinew
#

Nan means "not a number". You probably have a zero division error somewhere.

ocean kernel
#

I am more curious about the ind part

dire sinew
#

I think it's just a C++ thing that nan's are printed that way 🤷

minor agate
#

you got a nan, with the sign bit flipped

dire sinew
#

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 😅

dire sinew
#

Exactly

minor agate
#

Ok, We will remove it

dire sinew
#

Nooooo

minor agate
#

You should have kept your secrets this time

#

What do you use it for?

dire sinew
#

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.

minor agate
#

Ok, definitely taking it away

dire sinew
#

I suppose I could use a value outside the range

minor agate
#

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

ocean kernel
#

Imagine making a game that crashes when modder types some words

minor agate
dire sinew
#

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.

ocean kernel
# minor agate Do you want power or not?

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

minor agate
dire sinew
#

Purely mathematically speaking.

minor agate
minor agate
ocean kernel
#

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

minor agate
#

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

ocean kernel
#

would be better if I could make my own handler system

#

my mods are less reliable the more I rely on vanilla stuff

minor agate
#

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.

ocean kernel
#

map<string, MyFunction>

dire sinew
ocean kernel
#

I'll just do map<string, string> and use ScriptCallQueue.CallByName

minor agate
#

There were other changes but forgot them, I will need to check

ocean kernel
dire sinew
#

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 😅

dire sinew
#

exactly

minor agate
#

What are you using that for? (Feature wise)

faint yew
dire sinew
# minor agate What are you using that for? (Feature wise)

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.

minor agate
#

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

dire sinew
minor agate
ocean kernel
#

how do I do something like have RplProp sync but only if the user is admin

minor agate
#

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

ocean kernel
#

oh there is rpl condition

pliant ingot
minor agate
#

Even rpl of transform of entity itself

dire sinew
minor agate
#

He wants to target a single RplProp

pliant ingot
minor agate
#

That is bad practice

#

And waste of resources

faint yew
dire sinew
ocean kernel
#

will initializing a map work with just {}

#

ever

minor agate
#

list initialization or just the object itself?

ocean kernel
#

having to do map = new map... is annoying

minor agate
#

map<..., ...> someMap()

#

does it

#

it's the same as = new ...();

dire sinew
#

So is there even a reason to bother with new?

minor agate
#

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

ocean kernel
#

syntax highlighting makes it yellow and therefore ugly

#

back to new map it is

sweet badger
#

speaking of annoying things... green man, give null coalescing operator

minor agate
sweet badger
#

D:

minor agate
#

And don't ask. We do not talk about that here.

ocean kernel
#

what about walrus operator

dire sinew
#

I believe += for elements of a container is still marked as WIP 😅

minor agate
ocean kernel
#

imagine having notnull but no try/catch

#

can we replace enforce script with dreamberd

minor agate
#

as with the coalescing operator

ocean kernel
#

y'all are giving us the ability to get a VME intentionally but not catch it LMAO

minor agate
#

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

ocean kernel
#

not making things easier for us promotes jank workarounds

minor agate
#

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

minor agate
ocean kernel
#

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

minor agate
#

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

ocean kernel
#

ok

minor agate
#

For you, it might be okay to follow

ocean kernel
#

at least give me the ability to collapse code blocks

minor agate
#

for other modders would not

#

and if you do such hacks, debugging is painful

#

or studying someone's code behavior

dire sinew
#

I suppose assertive casts could make debugging a bit easier sometimes

minor agate
ocean kernel
#

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

minor agate
#

My biggest annoyance is the Cast/FindComponent combo

dire sinew
#

How would you replace it though?

sweet badger
#

green man... what about safe navigation operator

open pier
#

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.

minor agate
#

Similar reason

ocean kernel
#

make enum.ToString do the same as typename.EnumToString

#

maybe enum.ToString(bool name = false) to retain current behavior

sweet badger
#

i am out of operators to suggest notlikemeow

minor agate
#

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

ocean kernel
#

for example

typename.EnumToString(ServerAdminTools_EPluginStatus, status);

could be replaced with

status.ToString();

or something

minor agate
#
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

minor agate
#

as you see with what I posted above

#

your status var is an INT

ocean kernel
#

I'm pretty sure it is possible

minor agate
#

SomeEnum.VALUE1 gives an int

#

because it is Class.SomeVar

#

where SomeVar is an int

#

It just does not work how you expect

ocean kernel
#

yes but you could magick it on engine side

#

or whatever

#

I just dont like how much boilerplate I have to write

minor agate
#

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

ocean kernel
#

Also wrapping for log console PLEASE

minor agate
#

status.ToString(SomeEnum)

minor agate
minor agate
ocean kernel
#

the one in wb

crimson mica
#

hey is it possible to connect addon to discord api ? is there a get or post function ?

forest arrow
#

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?

dire sinew
forest arrow
#

How to add? Maybe somewhere I can read the guide

warm void
dire sinew
# forest arrow How to add? Maybe somewhere I can read the guide

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...

▶ Play video
ocean kernel
tough cave
#

do u guys just send two arrays or write Rpl serializer stuff for map data structure?

warm void
spark otter
spark otter
#

Same, but now I know there's a boot camp that could help! 😎

forest arrow
spark otter
#

they start talking about navmesh about the 28 minute mark.

forest arrow
#

I found already prepared navmesh for edem and its working. group is moving

spark otter
#

I guess I have a different problem then. 😦

forest arrow
#

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

teal vapor
#

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

pseudo merlin
#

Like pretty much all of the character components for example which will never change during runtime.

minor agate
#

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

boreal swan
minor agate
#

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

boreal swan
teal vapor
#

if you go pointer chasing you also kinda thrash the cache

boreal swan
#

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

teal vapor
# boreal swan Haven't read for a while what kind of cache optimization algorithms CPUs use now...

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

boreal swan
#

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

teal vapor
#

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

boreal swan
#

Also there's a nice course about the topic by local university here https://ppc.cs.aalto.fi/

ocean kernel
#

Will arma 4 be ecs?

#

ToiletFlushWorldSystem, ToiletFlushController

minor agate
#

All the manuals here

minor agate
#

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

boreal swan
minor agate
#

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

boreal swan
teal vapor
minor agate
#

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

boreal swan
minor agate
#

And working the other way is unnatural if you come from that

#

and it goes backwards from what you get to learn there

minor agate
#

PC is the trickier one for this

#

same as mobile

boreal swan
#

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"

teal vapor
# minor agate same as mobile

idk about android but in theory apple can (does?) do this with their app submissions being bitcode format rather than precompiled bins

minor agate
#

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

teal vapor
#

but i don't think they recompile for each target device CPU. i mean currently you can't even submit for arm64e

teal vapor
minor agate
#

Even tho I prefer CPP, I also hate and love it

teal vapor
#

as a vulnerability researcher targeting c/c++ I highly encourage everyone continue writing in these languages for my own job security

minor agate
#

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

teal vapor
#

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

ocean kernel
#

Why not just add a borrow checker to enforce script?

teal vapor
#

two borrow checkers even

minor agate
#

I would have prefered for ref to be handled like std::move in CPP tho

#

Instead of being done implicitely on assignment like now

pseudo merlin
# minor agate Not to mention you make the memory layout more sparse for the classes which in t...

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?

minor agate
teal vapor
#

actually though? that would be terrible for ergonomics imo

ocean kernel
minor agate
#

I just remember someone bringing it up at some point

ocean kernel
#

The window is called log console

#

In wb

minor agate
#

generic log

ocean kernel
#

Or widget whatever

minor agate
#

You are out of luck

ocean kernel
#

Is the guy that made that widget in the prague office?

minor agate
ocean kernel
#

Ima swing by in a few weeks and I have words

minor agate
#

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

minor agate
pliant ingot
minor agate
pliant ingot
minor agate
#

Use Class

minor agate
pliant ingot
#

So Class isn't ref?

minor agate
#

Did you break EULA?

minor agate
#

If you inherit from class, you are not Managed

ocean kernel
#

Does not inheriting from class explicitly mean it's managed?

minor agate
#

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

minor agate
#

from Game module and up

#

Gamelib and Core default to Class

#

The rest to Managed

ocean kernel
#

So what, class MyClass: Class?

minor agate
#

Yes

ocean kernel
#

That looks ugly, I'll keep avoiding it

pliant ingot
minor agate
minor agate
#

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

minor agate
#

People mess up heavily with high level stuff anyway

#

Atleast the high level stuff is easier to debug

pliant ingot
forest arrow
#

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

pseudo merlin
#

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.

boreal swan
#

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?

torn bane
ocean kernel
#

Any ETA? Over time since 1.2+ the servers experience more crashes with each update

torn bane
#

I am talking about non breaking changes, not crash rate. That should go down with every patch

ocean kernel
#

I thought it was interesting

torn bane
#

I mean each update with new features introduced risk of new uncaught crashes. So after roadmap completion this also happens more rarely

ocean kernel
#

Is crashing when typing ## in chat from a new feature?

#

I wonder how long that's been in the game, never tried before

minor agate
#

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 hmmyes

ocean kernel
#

But you do have an event system so it should practically replace script invokers

#

So not worrying for me personally

ocean kernel
#

So you're telling me

#

I can have an api router with event system right

minor agate
ocean kernel
#

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

minor agate
#

About the return value, no

ocean kernel
#

Big oof

#

Tbh I wanted a static string method that I would override in inheriting classes to return different string

minor agate
#

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

ocean kernel
#

Are there some upcoming code changes in next major update I could prepare for?

minor agate
#

not override

ocean kernel
#

I have a script heavy mod

torn bane
forest arrow
#

Any guide how to create task for player? like objective with marker on map

timid citrus
forest arrow
#

I mean from script, not from UI builder

ocean kernel
#

Is there an equivalent to ScriptCallQueue.CallByName that gets me a return value?

dark ocean
ocean kernel
#

ah genius

#

I assume CallByName is blocking so I should have the output immediately

dark ocean
#

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

ocean kernel
#

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

minor agate
ocean kernel
#

That looks efficient

#

I hope its not slow or anything

forest arrow
#

Guys, any tutorial "How to create task for player with map marker using script"? Or maybe code snippet

fervent cedar
torn bane
#

We also remove scripts

fervent cedar
#

Ahh yes, scripts were sometimes causing errros therefor they were removed :^)

coarse pasture
#

err wut?

ocean kernel
#

Awesome

minor agate
shy steeple
#

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);

itsOver 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));
    }
candid garnet
hushed swan
#

Does anyone know why my friend's name appears unknown at workshop ?

timid citrus
#

He's probably shady like that

hushed swan
#

he doesnt receive e-mails or communications ?

hushed swan
timid citrus
ionic compass
# river imp Needs to be in a script module

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!

river imp
open pier
#

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.

crude stag
#

nice lol

#

looks like one of the scripters likes Evanescence xD

fervent stirrup
#

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.

  1. 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?

  1. It seems that on EOnFrame(...) several Input Contexts such like CharacterMovementContext are not returning as active by the IsContextActivefunction. It works in the EOnPostFrame(...), however EOnPostFrame doesn't properly get the values of actions through InputManager.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.

foggy swift
crude stag
#

yea xD

hushed swan
#

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.

hushed swan
gleaming shard
#

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

gleaming shard
#

Heyy Mario, long time man and nah, tried going back now and then but I cant get myself working with that engine anymore lol

tawny lotus
#

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.

ocean kernel
#

Doesnt work in inheriting classes

minor agate
#

But of a way to do it right away (The call)

ocean kernel
#

It works great in the parent class

minor agate
#

Enforcement of encapsulation was fixed on these in 1.3

#

it was not respected before (Bug)

ocean kernel
#

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

minor agate
#

Just make the method public if you want to access it through these things

#

As these are called on global scope

ocean kernel
#

But it works in the parent with protected

#

Why cant it work in this class

minor agate
#

Show code and reexplain like if I had no context

ocean kernel
#
  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

minor agate
minor agate
#

the async thing is not a thread

ocean kernel
#

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

minor agate
#

Do you have the new class in what script module?

ocean kernel
#

Game

minor agate
ocean kernel
#

It's a ScriptComponent

minor agate
#

I'll check what the code is doing

#

It might be doing it based on context when compiling

ocean kernel
#

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

ocean kernel
#

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

minor agate
#

This is why I mentioned that

ocean kernel
#

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

minor agate
ocean kernel
# minor agate I can't suggest things without know the full extent of what your feature is supp...

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

ocean kernel
#

So if I want to use protected/private methods for this then I need to setup a scriptinvoker for every request type

minor agate
minor agate
hushed swan
minor agate
hushed swan
#

Zeliks Loot Spawners , Zeliks Zones

hushed swan
minor agate
#

Try it with only the mods needed for your use case

hushed swan
river imp
# minor agate That is like 20 mods lol

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.

river imp
#

@rapid ferry Didn't they? or am I mistaken.

rapid ferry
#

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

river imp
#

well*

hushed swan
#

ohh ty , i try

frail hound
#
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... )

zealous valve
#

is there a function that returns a player's identityID?

crude stag
#

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

pliant ingot
lethal thistle
#

Hello, can anyone here help me or share a script that forces the player into a specific faction?

pliant ingot
#

Comments:

Called on every machine after a player is registered (identity, name etc.)
Reality:
identity = "";
Some time later:
identity = "<real uid>";
🤯

dark ocean
#
    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.
torn bane
#

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

dark ocean
#

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

minor agate
#

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

dark ocean
#

makes sense

minor agate
#

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

dark ocean
minor agate
#

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

torn bane
dark ocean
#

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?

torn bane
#

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.

dark ocean
#

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

torn bane
#

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.

dark ocean
#

I suppose diag exe does not do that

torn bane
#

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.

dark ocean
#

can I detect authoritatively that server is running without backend connection? something in BackendApi?

pliant ingot
torn bane
#

No that won't help you for if you are not connected. Also that Param is due to not exist anymore

dark ocean
# torn bane There is no need to test on dedicated servers. They don't behave differently tha...

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

torn bane
#

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

solemn wigeon
dark ocean
torn bane
#

Honestly no idea what purpose it serves. At least none if you want to do anything with backend data such as player identities

dark ocean
#

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

torn bane
#

Sure but then you also don't have any identity issue as you will never ask for them. As no players are connected

dark ocean
#

missing identities is also an issue on workbench listen server; no difference really.

torn bane
#

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

dark ocean
#

dont use dedicated is not a solution for I have a problem running dedicated 😄

torn bane
#

You started to ask here about how to get the identity of a player. I am answering that question

dark ocean
#

no, I think we miscommunicated at some point

torn bane
#

If you don't care about identity, use onplayerregistered. It fires for all regardless

slow acorn
#

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

dark ocean
#

my question is: how do I tell within OnPlayerRegisted that the OnPlayerAuditXXX will never trigger, so I need to go into the hack flow

slow acorn
torn bane
dark ocean
torn bane
#

Oh yeah you can definitely accidentally have things work that only do on this mixed client server main window. That's true.

dark ocean
#

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.

dark ocean
torn bane
#

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

torn bane
dark ocean
minor agate
#

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

coarse pasture
#

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

minor agate
#

Or peer tool?=

#

They are not the same

dark ocean
minor agate
dark ocean
#

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

minor agate
#

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

coarse pasture
minor agate
#

If you struggle with it, then it means you do not understand it yet.

coarse pasture
#

But yea, its obviously not ideal pushing it out to a live server and asking for some actual help testing with real clients

minor agate
#

We show both of those

#

And explain the model with practical examples

minor agate
#

You can get people to connect to your server launched by dedicated server tool

#

It does not have to be only virtual clients

coarse pasture
# minor agate Watch both modding bootcamps for replication

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?

ocean kernel
#

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

fervent cedar
#

They are hiring peertool UX improver

ocean kernel
#

No remote no apply

teal vapor
#

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 Sadge

teal anvil
shy steeple
# shy steeple SOLUTION: https://discord.com/channels/105462288051380224/976155351999201390/137...

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;
        
    }
open pier
# minor agate Use proxy/auth/owner model properly and it will always work

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?

hushed swan
#

How can I disable the player from seeing a box and accessing it via "TAB"?

pseudo merlin
minor agate
slow acorn
#

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

dark ocean
opal robin
#

What i doing wrong ?

pliant ingot
#

You don't have class that mentioned here

opal robin
torn bane
solid hearth
# opal robin Now csript is available but engine is not starting

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);
ocean kernel
#

So

#

map<script, ref ScriptInvoker>

#

How bad are scriptinvokers in general?

frail hound
#

@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?