#enfusion_scripting

1 messages · Page 16 of 1

plush lotus
#

let me rephrase

minor agate
#

Go to doxygen

#

Fully explained there

#

Whole replication process

plush lotus
#

are you familiar with unity3d ?

minor agate
#

Down to internals

plush lotus
#

ive seen images of the editor, i am curious, how close it is to unitiy3d's approach ?

#

you tie scripts to objects ?

minor agate
#

We mean it

plush lotus
#

so, nothing like unity then

minor agate
#

But we do not use it as its a mess compared to systems and such

#

Specially for modding

#

We have something similar to ECS too

plush lotus
#

unity's approach is that you use the scripting to directly access the behaviour of the gameobject

the loop of any script is still determined by unity's main engine

just trying to understand whats different

minor agate
#

But itd more fleshed out in current enf (AR is not on latest atm)

minor agate
#

Otherwise you will have issues getting things

#

Its not really based from other engines

#

What is there has been added based on needs of the projects while development

#

If you want quick jump start

#

Watch the modding bootcamps in youtube from ArmaPlatform

#

Also, its nothing like dayz

plush lotus
#

script or gameobject wise?

minor agate
#

Overall

#

Everything

plush lotus
#

does this/will this come with civilian assets (cloths/food)

#

because this channel is about arma right? just military stuff?

minor agate
minor agate
#

It does not have to be even on theme of the game

scarlet dune
#

whats AR

plush lotus
#

arma reforger?

scarlet dune
#

oh lol ok

minor agate
#

If someone tells ypu that ypu cantthen ignore them

plush lotus
#

i see, thats what i was told last time i asked in here... thats a shame 🙁

minor agate
#

I am confused hehe

plush lotus
#

that this person told me something different, so i was no longer interested in this discord

#

that person said no civilian stuff

minor agate
#

But

#

Do not use this chat for dayz scripting questions

#

As this discord channel is for AR

plush lotus
#

fair enough
i am interested in learning AR but, if its not fully supported with docs etc then it will be quite hard for me... i just don't do well with learning curves 🙂

minor agate
minor agate
#

On Arma Platform channel

#

There is a dozen going over multiple aspects of engine and game

sweet badger
plush lotus
minor agate
#

Also always feel welcomed to ask anything in the proper channels

plush lotus
minor agate
plush lotus
#

so what does that mean, you're not allowed to turn this game into a zombie survival mod?

minor agate
#

You are not allowed to make it dayz

#

You can make your own zombie survival. Just dont copy or use dayz

plush lotus
#

fair enough... i can understand you dont want a fully ported dayz when you might want to release your own lol

boreal swan
#

I don't know any other ways to justify this anymore from BI's perspective, but I think BI is sitting on top of huge pile of revenue that would come from supporting (civilian) roleplaying stuff especially before new GTA arrives and even after that if it turns out to be a buggy mess

#

(Speaking of the civilian stuff)

plush lotus
#

well as i hinted, everyone is waiting for the "next dayz -engine" maybe thats why

minor agate
boreal swan
plush lotus
#

no that wasnt him, i was in here years ago asking questions (sorry should have clarified)

#

so i quickly skipped through the bootcamp #1 and the scripting section... is that the same editor used by the workbench?

minor agate
#

WB here is way better than dz's

#

Although it still has bugs

plush lotus
#

reason i am asking is because there is no UI font scaler... in dayz's editor... i need a magnifying glass to read any of it

minor agate
#

It bugged out in some of the vids too

#

We decided to keep those scenes to show a bit of truth of some of the issues modders can still face when developing their features

#

And how to sort it in some cases

sweet badger
plush lotus
#

mind you, this is bigger than it is on my screen lol

minor agate
#

That does not play too well with WB

plush lotus
#

yeah, tried that, but has no effect
i can't use the WB editor, i have been using vs code and command line instead

minor agate
#

Some things will not scale well as in your screenshot

plush lotus
#

i cant read the UI lol

#

this is max zoom with coding, so assume that then think of how small the rest of the UI is 🙂

(and this image is larger because its stretched by discord)

#

i am assuming the AR workbench will be the same?

minor agate
plush lotus
#

ok

dark ocean
#

when I spawn an item which can be equipped in the hand slot using InventoryStorageManagerComponent.TrySpawnPrefabToStorage, the item gets properly equipped, but it does not appear visually in hand unless moved out & in to the slot. is there some specific hack I can do to refresh it?

haughty fractal
#

Hello, is there any way to block the construction of a helipad? Since I have made a map focused on infantry and I only want vehicles, not helicopters. Thank you.

desert escarp
#

I'm absolutely stumped, I've done everything I can to prevent memory spikes from my mod but it's happening without my mod even having a drone placed or anywhere on the server

#

A server restarts and it happens immediately without any drones being on the map, nothing in the arsenals so I'm so confused

dark ocean
river imp
dark ocean
#

TrySpawnPrefabToStorage works fine for all cases so far, with the exception of that visual appearance in the hand slot

river imp
#

I'd say that TrySpawnPrefabToStorage is expecting a virtual inventory and not a "Storage" that requires the model to be visible.

#

The way I do it is with handcuffs is CharacterControllerComponent::TakeGadgetInLeftHand

river imp
dark ocean
river imp
#

If its in the hand slot though you'll probably have to force drop it, then pick it up.

#

You may be able to get the inventory item component and set it to visible tbh

mossy field
#

is there a way to compile my mod on headless setup (ie cli)?

minor agate
mossy field
#

Like write some script source in my editor of choice and then I can invoke some cli tool to build/compile/whatever its doing in workbench

pliant ingot
#

If you want to pack addon - use -packAddon argument
For validating scripts - specify to run script module through arguments and -validate

sour marten
#

hej modders i have a question

i get always this if i start workbench

desert escarp
#

How are we meant to get the radios of other players

#
SCR_GadgetManagerComponent gadgetManager = SCR_GadgetManagerComponent.GetGadgetManager(entity);
ref array<SCR_GadgetComponent> gadgets = gadgetManager.GetGadgetsByType(EGadgetType.RADIO);
#

This gives me nothing

#

GetItems and GetAllItems from SCR_InventoryStorageManagerComponent also give me nothing

#

He definitely has a radio in his inventory

#

All this works when I am calling it locally on myself but whenever I try it on another player it does not get the other players radios

#
ChimeraWorld world = GetGame().GetWorld();
        world.GetRadioManager().GetTransceiversInRange(SCR_PlayerController.GetLocalControlledEntity().GetOrigin(), 10, radios);

and this just crashes my game

#

: ))))))

kind widget
#

SCR_InventoryStorageManagerComponent invMgr = SCR_InventoryStorageManagerComponent.Cast(
            charEnt.FindComponent(SCR_InventoryStorageManagerComponent)
        );
        if (!invMgr) return null;
    
        array<IEntity> found = {};
        array<typename> comps = { BaseRadioComponent };
        invMgr.FindItemsWithComponents(found, comps, EStoragePurpose.PURPOSE_ANY);

maybe something like this? Definitely not efficient but it works

kind widget
kind widget
desert escarp
#

Like it's not tracked with the inventory of another client

#

This works fine if it's called on the entity the client is controlling

#

Any other entities besides itself it does not find any of the radios

#

And just the radios

#

Ah I see

#

For some reason radios in the inventory of other players are not within our replication bubbles

wooden cape
desert escarp
#

Or don't exist at all for the other clients

#

One of the two

dire sinew
#

Stop trying to do your handlings on clients. Really don't understand why you still insist doing it that way.

desert escarp
#

I'm opening up a UI that needs to see what frequency the other players radio is on. No real way I can open a ui on the server and show it to the player.

dire sinew
#

Yes, but the data should be compiled by the server, not the client.

#

Basically, client should do request and server sends the data back so you can create the UI afterwards.

desert escarp
#

How do I send data from the server to the client

#

Rpcs dont give back values

#

Oh I guess I could broadcast owner

dire sinew
#

Yeah, owner RPC that opens the UI with the given data.

desert escarp
#

That's smart, appreciate it

#

Still kind of silly that radios and radios only are not replicated in an inventory

dire sinew
desert escarp
#

No but this radio is right next to me

#

Like its an action on another player

#

It should be in my bubble

#

This isn't a bubble issue this is the radio does not exist on the client

#

Well I guess it is but it shouldn't be

dire sinew
#

Yeah, some replicated entities don't have proxies to begin with (i.e. never exist on other clients). Though the only one I was aware of so far are player controllers.

#

One of the reasons I'm hoping we'll get world controllers sooner than later, as you have the option to have proxies on all clients for stuff like RplProps.

craggy jolt
#

What if we had a flag\option inside EntitySpawnParams to avoid spawning prefab magazines? I get that "magazines" are way too specific for a broad term like "entity", but I don't know where else would be better.

#

One option I always wanted in RV is spawning a vehicle without inventory items and I also would find a use for it here in Enfusion.

pliant ingot
torn bane
minor agate
#

Makes no sense the gamemode is an entity within the physical worldx that has transforms and many other things

#
  • plethora of other complications because of it being an entity on engine.
minor agate
#

Replicating entities and components all the time to users that do not need it is mega wasteful

#

And leads to explosion on bandwith usage + performance issues as that has to be processed as well

#

Also as kex said, stop doing rpl auth stuff on client

#

Do it on server, it will be better overall. And safer against hackers and cheaters

#

It will also make yout life easier

minor agate
#

anyway @desert escarp, may the enfusion god of suffering and despair be gentle on you.
The VoN and related are quite hard coded, and non controllable so you will have many issues.

ocean kernel
#

Yeah I gave up on that bs pretty quickly

dire sinew
fervent cedar
#

hopefully all the people having trouble with VON modding will
help reforger 2 get better VON with more modding and scripting support

craggy locust
#

👋
Hello, i was wondering, what would be the best way to hide / show the RIS rail on my gun. That would depend on if the RIS optics slot would be occupied.

I tried to look into the scripting for this but havent figured out what would be the best approach, have it in one .xob, or separate mesh? Please help.

gleaming shard
#

Would love to use Cutscene for a singleplayer mission im building - but stupid Q, how do one use this (if Im not big on scripting) blobdoggoshruggoogly

maiden goblet
maiden goblet
minor agate
#

IF you want to use it otherwise, you would have to create a texture, save it to disk and use it.

#

Which is only possible on PC afaik, and quite slow

maiden goblet
#

slow is ok, but PC only 😦 I have some fun thing in Unreal generates pretty skyboxes for a procedural galaxy, thought it would be fun to try same in Reforger

minor agate
#

That would work on all, and is faster than creating image to disk and reading it

neon elbow
# gleaming shard Would love to use Cutscene for a singleplayer mission im building - but stupid Q...

It's pretty simple.

  1. Take the name of your scene entity and put it into the attribute input called "Entity Name".
  2. After you set up the trigger activation type,
  3. and class filter,
    it should play once a character enters the sphere

If you don't know how to make a cutscene, look up "ARMA REFORGER CINEMATIC TUTORIAL FULL (2025)" by CebCine.
If you're completely new to scripting.... it might be easier if you just pm'd me

neon elbow
thick arch
#

Hey, is there any way to detect any decal textures applied to the player model through scripts?

(lets say a player was very close to a explosion and the explosion texture gets applied to the player, how would one detect this/remove this?)

earnest raptor
#

How is the seating position for a turret determined?

ionic pewter
#

anyone know where/how to find the scripts that calls these functions when right clicking on actionsmanager?

dire sinew
open pier
mossy field
#

Is there a way to implement this pattern in enfusion script (not using enums)?
https://refactoring.guru/design-patterns/state

minor agate
#

But yeah you can

mossy field
#

why avoid?

minor agate
#

You see it more common in UI web frameworks ngl

#

But for games, or anywhere where performance matters. It causes insane indirection

#

But yes, it is possible to do this pattern in enforce script

sour marten
#

how we can check if player or AI is not death

m_CharacterController = SCR_CharacterControllerComponent.Cast(pOccupant.FindComponent(CharacterControllerComponent));
if (m_CharacterController && m_CharacterController.!IsDead())
{
do something
return;
}

#

i noticed ! .isDead() is not allowed

#

a i found it if (m_CharacterController && !m_CharacterController.IsDead())

mossy field
calm cobalt
#

need help with enfusion / RHS
im trying to make thermal works with ads. when “use thermal” is ticked you cant ads with any weapon at all. how can i modify that and or where and what do i change to make thermal compatible with ads

fringe prairie
minor agate
#

Rather than the behaviors driving instances to those states

vernal moat
#

hey @minor agate o/
can you confirm that those will be properly GC when the chimera gets GC


 // --- Register vehicle compartment event handlers
SCR_ChimeraCharacter chimeraPlayer = SCR_ChimeraCharacter.Cast(entity);
SCR_CompartmentAccessComponent baseCompartmentAccessComp = SCR_CompartmentAccessComponent.Cast(chimeraPlayer.FindComponent(SCR_CompartmentAccessComponent));
baseCompartmentAccessComp.GetOnCompartmentLeft().Insert(OnCompartmentLeft);
baseCompartmentAccessComp.GetOnCompartmentEntered().Insert(OnCompartmentEntered);
baseCompartmentAccessComp.GetOnPlayerCompartmentEnter().Insert(OnPlayerEnterCompartment);
baseCompartmentAccessComp.GetOnPlayerCompartmentExit().Insert(OnPlayerExitCompartment);

but those wont ?

EventHandlerManagerComponent eventHandlerManager = EventHandlerManagerComponent.Cast(entity.FindComponent(EventHandlerManagerComponent));
if (eventHandlerManager)
{
    eventHandlerManager.RegisterScriptHandler("OnProjectileShot", this, OnProjectileShot);
    eventHandlerManager.RegisterScriptHandler("OnGrenadeThrown", this, OnGrenadeThrown);
}
teal vapor
#

Random q but I recall watching a video that described enfusion's task system and how it figures out dependencies between components (like particle effects depending on another effect system). Does anyone happen to know the video I'm thinking of?

spark otter
teal vapor
ocean needle
#

how would i go about editing the values in the m_aNameOfObjectsToSpawnOnActivation array using the world editor api?

this causes an error

array<ref ContainerIdPathEntry> fin0_spawn0 = CreateContainerPath("m_aActionsOnFinished[0]/m_aActions[0]/m_aNameOfObjectsToSpawnOnActivation");
api.SetVariableValue(comp, fin0_spawn0, "0", string.Format("Air_Art_%1", taskIndex));

WORLD (E): SetVariableValue - Property called: m_aNameOfObjectsToSpawnOnActivation is not OBJECT type

#

i can do this

array<ref ContainerIdPathEntry> fin0_spawn0 = CreateContainerPath("m_aActionsOnFinished[0]/m_aActions[0]");
string spawnList = string.Format("\"Air_Art_%1\" \"Defend_TaskArea_%1\"", taskIndex);
api.SetVariableValue(comp, fin0_spawn0, "m_aNameOfObjectsToSpawnOnActivation", spawnList);

but that puts the "list" in the first entry/sets the array to only one entry

so i guess my question is if theres a way to properly represent those arrays in a string?

#

i just needed a comma and no extra quotes hmmyes

spark otter
mossy field
#

is it possible to rename a project if I already published to workshop previous versions

opaque basin
#

Hello,
someone have a tips for me for how i can add a cooldown inside an object in Arsenal ?
Adding cooldown for vehicle are easy but for object in arsenal it's a bit complicated

tribal quiver
#

I’d like to ask about conf files in Arma Reforger Workbench. Is it possible to use multiple inheritance within a single conf file?

serene fox
#

Hey, every time i reload Scripts in EXP 1.5, i got the following Error:

SCRIPT    (E): Leaked 'OneHandAimModifier' script instance (25x)!
SCRIPT    (E): ==== Total Leaks (25x)! ====
umbral spade
#

Hello!
Please, help me.

I have a code that should trigger the greeting sound on the character if you use this action.

In single player mode - it works. In Multiplayer on a dedicated server it does not work.

I get this error -

15:01:51.053 WORLD : UpdateEntities
15:01:51.053 RPL : rpl::Pip::ProcessNetToGame
15:01:51.053 SCRIPT : soundManagerEntity not found

//------------------------------------------------------------------------------------------------
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
{
SCR_SoundManagerEntity soundManagerEntity = GetGame().GetSoundManagerEntity();
if(!soundManagerEntity)
{
Print("soundManagerEntity not found");
return;
}
vector mat[4];
mat[3] = GetOwner().GetOrigin();
SCR_AudioSource audioSource = soundManagerEntity.CreateAudioSource(GetOwner(), m_AudioHello);
if (!audioSource)
{
Print("audioSource not found");
return;
}
soundManagerEntity.PlayAudioSource(audioSource, mat);

};
#

in class SCR_PlayInstrument
I do not understand what the difference is with the same

//------------------------------------------------------------------------------------------------
override void OnActionStart(IEntity pUserEntity)
{
if (s_onInstrumentPlayed)
s_onInstrumentPlayed.Invoke(GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(pUserEntity), m_eInstrumentType);

    SCR_SoundManagerEntity soundManagerEntity = GetGame().GetSoundManagerEntity();
    if (!soundManagerEntity)
        return;
            
    if (!m_AudioSourceConfiguration || !m_AudioSourceConfiguration.IsValid())
        return;
    
    SCR_AudioSource audioSource = soundManagerEntity.CreateAudioSource(GetOwner(), m_AudioSourceConfiguration);
    if (!audioSource)
        return;
    
    vector mat[4];
    IEntity owner = GetOwner();
    owner.GetTransform(mat);        
    mat[3] = owner.CoordToParent(m_vSoundOffset);
                
    AudioSystem.TerminateSound(m_AudioHandle);
    soundManagerEntity.PlayAudioSource(audioSource, mat);            
    m_AudioHandle = audioSource.m_AudioHandle;
}
serene fox
spark otter
pliant ingot
analog python
#

This is also new:

/*!
SCR_SoundManagerModule is created for playing simple one-shot sounds without need of SoundComponent on given entity.
SCR_SoundManagerModule is not present on console app.
If functions in SCR_SoundManagerModule are enough for given sound, prioritize it befor adding SoundComponent on the entity.
If entity already has SoundComponent because of some other sound, do not use SCR_SoundManagerModule.
Do not use SCR_SoundManagerModule for UI sounds.
Do not use SCR_SoundManagerModule for managing looped sounds. Looped sounds always need SoundComponent to work properly
Signals for given sound can be set only before the playback and is not possible to update them during the sound playback.
*/

Noted

tacit flower
#

Hey guys, need help...I have made predefined groups in my faction for my server, but people can rename those in game or when they left that team, the name of the predefined group and its description dissaphered...And also I have still callsign Atlas Red 1 etc. which I would like to delete or change...because in the radio settings its not showing the name of the group, but callsign from ArmA, which is Atlas Red...and I dont know how to change it.
Ping me with anwers, thank you

fringe prairie
#

IIRC there is another layer there but could be wrong.

open pier
#

How can I register a system? Docs say to specify GetSystemPoint to my need but can't seem to find how/where to use that

dire sinew
open pier
dire sinew
#

You may have to restart the WB afterwards if reloading scripts doesn't do it.

olive elbow
#

Does anyone have any resources on how I can setup a dedicated test server with custom mods without needing to upload them?

red inlet
#

https://youtu.be/asWxIIHT6d0?si=N7kfcalOs-SUpsLu

It's either this one or the advanced one which is next in the playlist

https://community.bistudio.com/wiki/Arma_Reforger:Multiplayer_Scripting

This Modding Boot Camp seminar was originally held on the Arma Discord Server on January 23rd, 2025.

In this session, we explore the fundamentals of replication within the Enfusion Engine, highlighting key concepts and common challenges. Through detailed examples and clear...

▶ Play video
olive elbow
#

I'll have a look through that, thanks!

tacit flower
ionic pewter
#

I wanted to make a component to make be able to switch power transfer to axles so you can make vehicles have 4wd and 2wd, maybe difflock too but focuse now is the torque share parameters here that gives powers to the wheels. However ive tried a couple of approaches to do this with no luck.
So does anyone know how to access differential TorqueShare parameters through VehicleWheeledSimulation scripting? Or alternative methods to achive this?

torn bane
# open pier Thank you ❤️

Just a small heads up, while this config still says which systems are active (and there will be more specifics configs inheriting from it in 1.6 btw), in the near future the rest of the configuration regarding server/client and system points will be removed. what matters is defined via code in the systems initinfo method. you will get a warning in console if they mismatch.

red cedar
#

Hey, how expensive is it to have the Hierachy component to an entity with ~100 children entity to it ?

The reason why I 'need' it is that this "outpost" is spawned in via Script and despawned later on, unless there is a better way to do it that i am not aware of...

Thanks in advance !

ocean kernel
#

might be a frame and networking hiccup if you spawn them all in 1 frame but otherwise should be fine

red cedar
ocean kernel
#

I mean you could test it

red cedar
#

from a "visual" observation it feels like the prefab do not spawn all at once

#

feels like it's taking ~100-200ms to spawn(in the workbench) and that there is some kind of queuing. i wonder if the replication takes care of splitting the spawn to not overload the network.

#

(could just be my slow ass laptop struggling to load it all at once)

red cedar
#

Is there a proper way to make the AI spawn above this terrain ?

Regardless of if i add some height to the spawn param or snap it to geometry they seem to always spawn below that "fake terrain".. like as their pos is snapped to the actual terrain after they spawn.


vector newPos = vector.Zero;
        array<IEntity> excludedEntities = {};
        SCR_TerrainHelper.SnapToGeometry(newPos, m_vPosition, excludedEntities);     

        EntitySpawnParams spawnParams = new EntitySpawnParams();
        spawnParams.TransformMode = ETransformMode.WORLD;
        
        vector mat[4];
        Math3D.MatrixIdentity4(mat);
        mat[3] = newPos; 
        spawnParams.Transform = mat;
        
        
        IEntity aiGroupEntity = GetGame().SpawnEntityPrefab(prefabResource, GetGame().GetWorld(), spawnParams);

(last pic is the position of m_vPosition which is already above the spawn location of the prefab)

solid hearth
#

There's an option on the group that dictates whether or not they snap to terrain height

#

Never found a solution via script to ignore it. Option is enabled by default on all groups as far as I could tell when I ran into the issue.

red cedar
serene fox
#

Hey, what is the correct way to get the playerIdent in EXP 1.5?

        string playerUID = BackendAuthenticatorApi.GetIdentityId();
        string playerUID = GetGame().GetBackendApi().GetPlayerIdentityId(playerId);

__

    [Obsolete()]
    proto external string GetPlayerIdentityId(int iPlayerId);

What should we use now on Master/Server side?

BackendAuthenticatorApi = Client only

spark otter
#

But yeah that's the kind of info that is essential for modders, would be nice to get docs before experimental is pushed to stable. Otherwise how are we to get our mods ready, which is the point of making experimental available to modders. blobdoggoshruggoogly

solid hearth
#

They may mark it later when its set to deprecated on what to use.

#

At least that's what they've done with previously deprecated functions.

spark otter
#

They didn't do that with the task system because it got a complete rewrite, that took me almost two weeks to figure out how to do what I needed to. I was told to wait for the docs, which still are not available almost a month later.

solid hearth
#

Welcome to the world of BI Happy

spark otter
#

Yeah, it's frustrating. Point being, docs for modders in experimental to help them get their mods ready would be a huge help. If the identity id getter does in fact become obsolete, it's going to break a lot of mods. So I hope someone does answer r34p3rs question above.

lime dew
#

Afternoon

please could someone help me how do I script this into a component I just need a dropdown menu with the add and minus feature.

I dont know what this is called.

solid hearth
desert escarp
#

Forgetting that ref has led to an embarrassing amount of hours debugging

sleek dove
solid hearth
#

Is a ref needed for when the array is just ints? thenking

sleek dove
#

array is an object that needs to keep referenced somewhere

lime dew
solid hearth
#

If you read above you should add ref to it so protected ref array<int> asdfgdfhsg;

slow acorn
#

Any ideas to debug why the GM menu (EditorMenuUI) is randomly closing in multiplayer? I tried adding Debug.DumpStack() all over the place and it didn't help

open pier
#

Essentially don't use ref until workbench yells at you that it's missing

pliant ingot
open pier
solid hearth
#

pull a bacon and ref the ref

ocean kernel
#

I'm not allowed to talk about scripting anymore

solid hearth
open pier
#

|| be worried ||

kind widget
#

Printing EntityID on linux dedicated server gives me weird result like 0x0x40000000000049d8.
In workbench or when running via windows dedicated server tool in AR Tools, it gives me correct string like 0x40000000000049d8.
What's wrong?

kind widget
minor agate
#

If its for identifying entities from server and client then dont. It will not be deterministic there regardless of OS environment

safe geode
#

Yo

#

What formats are Reforger's PlayerId's in?

#

And are they unique to each player

#

I assume it changes between PS, Xbox and PC users

dire sinew
pliant ingot
#

I see few peoples who don't understand it and ask me what the hell is going on and in most cases answer was "missing ref"

safe geode
dire sinew
#

The server just gives each player an index. Not that complicated.

safe geode
#

Not server one

#

I can only test with PC is the issue

#

So I don't know if xbox or ps have different uid structures

dire sinew
#

Don't think so. Pretty sure Overthrow uses player UIDs for storing player related data.

safe geode
#

Cool

#

Cheers guv

#

Making a web interface for stuff so needed to check I can rely on the uid easily

dire sinew
#

They are just stored as string from what I remember.

kind widget
fervent cedar
#

ricochets mentioned

sleek dove
violet egret
#

How to change object color without creating a new material, for example for a Backpack?

solid hearth
# safe geode What formats are Reforger's PlayerId's in?

They're the same on all platforms, if they weren't they'd have a seriously hard time with their own stuff. They're unique to the "account" playing so on PC it's the steam account or whatever other platform its on, on consoles i'm not fully sure how that works but for the most part its tied to the XBL/PSN account but they have sub-accounts or something that cause it to change..?

open pier
safe geode
#

Was confident with the PC uid but not consoles

ocean kernel
#

They're the same on all platforms except for when you download a spoofer on PC

fringe prairie
minor agate
minor agate
#

These will be non deterministic

#

So they might not match on client vs server

#

But if you care about only server, then it should be fine

kind widget
minor agate
#

Yeah i always warn because people try to use it for both all the time then run into issues

#

You can also tun into issues when using loadtime map entities

#

If you are using it in wb + peertool for example

#

Wb will cache them and then it will mismatch with the client

#

Which is why sometimes you have go restart wb to make your stuff work if it relies on that

#

Or restart WE

serene fox
#

May i ask for some help, to get the Override materials form a Prefab?
BaseLoadoutClothComponent

   WornMaterialsOverride {
    "{60DCA03734C7B78C}Assets/Characters/Textures/UV6_Helmet/UV6_ACU_HELMET.emat"
   }

i tryed:

        // Get override Materials from prefab 
        Resource resource = Resource.Load(owner.GetPrefabData().GetPrefabName());
        BaseContainer prefab = resource.GetResource().ToBaseContainer();
        
        BaseContainerList mats = prefab.GetObjectArray("WornMaterialsOverride");        
        for(int i = 0; i < mats.Count(); i++) {
            m_aOverrideMaterials.Insert(mats.Get(i).ToString());
            Print(m_aOverrideMaterials[i]);
        }
ionic pewter
river imp
spark otter
#

If I use KickPlayer() with reason ban, and timeout of -1, is that essentially a permanent ban? If so how would I remove that ban if I wanted to?

neat valley
#

Where can I find the resources to make a scripted event for AI helicopter?

fringe prairie
river imp
river imp
#

If they are removed in my inherited prefab, then of course I can't get them.

#

Because they don't exist.

fringe prairie
#

because if you import an object, make a prefab for it, the meshobject doesn't allow you to set an override if it is still the same material, but for basecloth component, it can still work

river imp
#

In the base cloth component, if the parent prefab has material overrides so does the child.

#

These don't work like most other things.

spark otter
valid anchor
#

Is Shape.CreateLines only available in workbench/peertool and not hosted servers?

I can draw lines fine and view in peertool but dedicated test server, nothing

valid anchor
#

Is it possible to enable debug in live environment for GMs?
Or workaround for shapes to render in live environment?

I've tried saving reference, tries rendering eonframe ShapeFlags.ONCE | ShapeFlags.NOZBUFFER | ShapeFlags.VISIBLE

it works as expected in WB/peertool

pliant ingot
craggy jolt
#

I want to figure out vanilla spawn system, I see there is plenty of logging under #ifdef _ENABLE_RESPAWN_LOGS, how can I enable this flag?

valid anchor
#

Basically replicate like a laser attachment and connect to eye/head bone?

ionic pewter
#

sorry for at @torn bane but it seems so simple to being able to add a selective drive system to the game since everything is in here, like the ability to switch the willys jeeps drive train from 4wd to 2wd and there is also a difflock feature and all that could be used to make more in-depth vehicle controls and driving. Why isnt it? ive been trying to find a way to edit this myself but cant find any relevance to the "torque share"

coarse pine
pliant ingot
valid anchor
#

effort rn

undone patrol
#

How can I make the Projectile visually fly to the locked target on the Player Client (on the Server)
because my invisible missile hits the target and flies further according to its ballistics on the client
Are there any secrets in the scripts in this game? 😄

ocean kernel
#

I would tell you but I am not allowed to

ionic pewter
undone patrol
zenith coral
minor agate
#

It's being moved to it's own sim component

#

you should have the control there after that

#

It will be in a modding update so you will know how

undone patrol
#

🫡

zenith coral
#

So how does one do navmesh

#

If that’s for this channel there are just too many it confuses me

pliant ingot
zenith coral
pliant ingot
zenith coral
#

And that’s it?

#

Also thanks

scarlet iris
#

Can anyone help me? In offline single player, AI units don’t seem to "activate" on in it. They only start following waypoints once I—or the camera—move within roughly 600 meters of them. I assumed disabling LoD might fix it, but either I did it wrong or it simply has no effect in single player. On a dedicated server this problem doesn’t happen. If this isn’t related to LoD, what’s the proper fix?

lime dew
river imp
lime dew
#

100%, you right on AI

thanks for the help, I will take a look at the Flush Toilet action.

earnest raptor
#

Anyone know how to enable again the command truck extending range? I know it's from vanilla but I'm loading WCS and can't find where they changed that

river imp
minor agate
maiden goblet
#

I bet if you let loose an AI debugging agent on Reforger's codebase it could fix many crashes. There are so many, must be some low hanging fruit. That said it could just as easily waste your time hah.

ocean kernel
#

If it applies try catch to engine code it will win a nobel peace prize

maiden goblet
sudden bough
#

Hello guys, i'm very new to enfusion scripting but i have a lot of experience in other games already, but no game has such a bad explanation and so few tutorials as arma has, is anyone here willing ot explain to me where to start and how i can do a simple script which triggers when a player is unscontious?

fringe prairie
# sudden bough Hello guys, i'm very new to enfusion scripting but i have a lot of experience in...

Most scripting is hijacking events. Yes it’s unfortunate there isn’t a good searchable documentation, the outliner is really your only friend plus discord search. For stuff you need to start with “what handles this thing?” Probably a component on the character. Look at them and find one which seems to relate the most to what you are trying to do, then pull the thread on the yarn ball lol.

sudden bough
brittle ridge
#

Sorry to interrupt the convo, don’t mean to hijack it. However, I can’t for the life of me figure this out.

We’ve had multiple players report crashing and share their crash logs. I myself have had these crashes as well, and upon loading back into the game, I’ll end up crashing shortly after. Typically, the third time does the trick and I’ll be good for a while until it happens again. In all of our logs, we notice this common denominator—


Virtual Machine Exception

Reason: Division by zero

Class: 'SCR_MapEntity'
Entity name:'SCR_MapEntity1' id:3

Function: 'UpdateZoomBounds'
Stack trace:
scripts/Game/Map/SCR_MapEntity.c:1067 Function UpdateZoomBounds
scripts/Game/Map/SCR_MapEntity.c:345 Function OnMapOpen
scripts/Game/Map/SCR_MapEntity.c:1488 Function EOnFrame

#

Along with this one to follow—

Virtual Machine Exception

Reason: Division by zero

Class: 'SCR_MapEntity'
Entity name:'SCR_MapEntity1' id:3

Function: 'SetZoom'
Stack trace:
scripts/Game/Map/SCR_MapEntity.c:626 Function SetZoom
scripts/Game/Map/SCR_MapEntity.c:1414 Function ZoomUpdate
scripts/Game/Map/SCR_MapEntity.c:1470 Function UpdateMap
scripts/Game/Map/SCR_MapEntity.c:1497 Function EOnFrame

fringe prairie
brittle ridge
#

These mods touch the map UI, so that’s why I’m guessing one of these could be guilty. Although I will say, the crash doesn’t discriminate. Hardly ever do I crash when I open my map.

fringe prairie
#

The script could be triggering for a player which does not have their map open when another player opens their map. I would look into trying to find a way to reproduce it

brittle ridge
sour marten
#

hej guys can someone give me some information i want to use a image in a script for the ingame map
i use the MapDescriptorProps for showing a little image on the map

i use the SetImageDef parameter

i make a own imageSet

how can i the Quadname of the image in the script

string myImageset = "{D9E84F7D13F926D0}UI/Imagesets/Dots.imageset";
string myImageQuad = "Red_DG_dot";

MapItem pointItem = mapEntity.CreateCustomMapItem();
if (!pointItem)
continue;

pointItem.SetBaseType(EMapDescriptorType.MDT_DEBUG_POINTS);

        pointItem.SetPos(x, y);
        pointItem.SetRange(1); 
        pointItem.SetVisible(true);
        
        MapDescriptorProps props = pointItem.GetProps();
        if (props)
        {
            //props.SetImageDef(myImageset);
            props.SetFrontColor(Color.Red);
            props.SetOutlineColor(Color.Red);
        }

i noticed the color does not change so thats why i want a own image and create a red dot for on the map
can someone give me a push 🙂 thanks already

lime dew
# minor agate From exp, as soon as you mention that you used AI or it is apparent you did. You...

Thanks for the heads up!

For a beginner it helps a lot to understand what is going on.

The only thing AI did was fix some syntax issues and structuring on the sound component.

Everything else is written by me using other game scripts as a sample.

I looked at the flush toilet script and it is way harder to understand for a beginner.

After that I simply gave up on scripting the radio sound.

clever oxide
#

Hi! Is there a way to ensure that my modded class runs last?
Where can i find more information about the mod hierarchy?

sudden bough
#

So i'm asking again as this got buried, could anyone show me how to set up a basic script that catches a event or knows a good tutorial?

red cedar
sudden bough
clever oxide
neon elbow
# sudden bough Hello guys, i'm very new to enfusion scripting but i have a lot of experience in...

Hey! Thanks for showing interest in scripting. We can always use more scripters. Yeah there isn't a whole lot of good beginner tutorials. But you should start with the examples here https://community.bistudio.com/wiki/Category:Arma_Reforger/Modding/Scripting/Tutorials
Specifically the Component then the Entity examples.
Then read these files in the Enfusion Script Editor for some useful methods/functions (You don't need to memorize these, it's nice to know that they're there):
tools.c
Game.c (capital G)
game.c (lowecase G)
IEntity.c
BaseGameTriggerEntity
SCR_AIGroup.c
and CharacterControllerComponent.c
//------------------------------------------------------------------------------------------------

As for your question. Player characters will have a CharacterControllerComponent component. In that component there's a boolean IsUnconscious() method that checks if the character is unconscious (lol) . You can start there.

neon elbow
#

Now, I have a question. How would I best go about filling an array with every player Id? I'm thinking a loop that goes from 0 to some number, and if the Id does not have a controller associated with it I stop the loop. Otherwise I add the integer to the array.

valid anchor
dire sinew
neon elbow
#

😮

marble ridge
#

Hello all - what function/class is responsible for displaying the nameplate/name tag of another player when you look at them?

#

I.e., you look at a player, it tells you their name, and what squad they are in

valid anchor
#

Scr_nametagdata, scr_nametagdisplay etc

marble ridge
brittle ridge
valid anchor
ionic yacht
#

Hey friends, does anyone have a good example of a script to control a looping audio sample like the vehicle horns?

brazen thistle
#

How do i attach a script to a interactive model.

For instance I have a ATM, I want users to hit F on it and it pop up a GUI.

I have read the docs but it doesn’t really explain all that well lol.

fringe prairie
brazen thistle
#

Im not trying to release this mod, just playing around with stuff to learn modding in general

fringe prairie
#

I’d open it/close it via the player controller, that way it exists per player, and since player owns it they have authority to tell server what data is changing on it.
I think the GUI modding bootcamp does go over the interactivity of the menu itself

#

I think it’s as easy as adding script handler to widget desired

brazen thistle
topaz locust
#

Can I request that the character movement speeds be added to the class CharacterCommandMoveSettings list? I'd like to make movement enhancing/limiting items without having to hard code a custom character with the settings manually or using the encumbrance system.

calm wren
#

Can local Entities be inserted into inventory? Or do i have to make them global ?

brittle ridge
spark otter
#

In SCR_CampaignBuildingProviderComponent.GetAvailableTraits() Where is the list of entities populated from those traits?

abstract charm
#

Hi there. How to get entities inside a trigger? The only thing I found is GetCountEntitiesInside(), but it just counts them

brazen thistle
#

Fought for 8 hrs today, trying to get my script to just populate map markers randomly on the map to work and for the life of me I cant get it to

#

Compiles & builds correctly,

Generic Entity
<{myscriptname} component added to the generic entity

I add the prefab to the world and hit save and nothing shows up on maps or even in the logs like the script isnt even activating even though it got loaded into the world

Fresh project, no additional mods loaded

abstract charm
#

Also, what difference between this two methods of SCR_ScenarioFrameworkTriggerEntity.c?

sinful fossil
brazen thistle
sinful fossil
tender hare
#

Is there a way I can have the OnActivate of an SCR_BaseTriggerEntity run on all clients? I'm new to replication and struggling with this, I've yet to get the trigger entity to be replicated to all clients regardless of distance.

topaz locust
topaz locust
abstract charm
#

And I'm looking for a way to get entities in trigger, not amount of entities

topaz locust
topaz locust
topaz locust
topaz locust
topaz locust
abstract charm
#

Ahh, here it is, thank you

sinful scaffold
#

How do I set up the script and implement it to my helmet attachments.

spark otter
#

Ok Im pretty confused. I am trying to script the ability to use saved loadouts on the MHQ in conflict. I put a bunch of prints in both SCR_BaseGameMode and SCR_GameModeCampaign for CanPlayerSpawn_S(). What I dont get is why is the super in GameModeCampaign returning false when BaseGameMode returns true?

analog python
#

how do I get a script defines working on a linux dedicated server without doing something super ugly like making a file called _.c (so it loads before everyone elses scripts) and throwing all my #defines in there?

solid hearth
#

Have you tried the launch param way?

#

i.e -scrDefine WL_DEBUG

analog python
#

I need it done via the mod, cant expect every server who wants to use the mod to have to mess with their launch options

#

also I think srcdefine makes a server refuse connections from non diag.exe

#

last time I checked

#

back in 1.2 or something

solid hearth
#

Well then idk Shruge hopefully someone else has an idea

analog python
#

I mean I got it working using my ugly way, I was just hoping maybe I can do it using the system I believe was intended for it lol

#

theres a PLATFORM_LINUX but I cant find where that is coming from, maybe I should just add an object called linux and see if it works shrug

late locust
#

Why are the Tags modded in a vanilla script and why do I need to also add these values in my modded enum for it to not break vanilla code? blobdoggoshruggoogly

modded enum ETagCategory
{
    Metal = 8,
    Insect = 16,
    StaticTurret = 32,
}
ocean kernel
#

they are flags I guess

#

but so is EntityEvent, idk

#

nvm I forgot I'm not allowed to talk here

minor agate
minor agate
#

Same old modding issues found in DayZ too from not using them

late locust
minor agate
#

This code was done before i got those decorators to be introduced

#

It has to be updated

late locust
#

And why is this the only modded enum in the whole game code?

minor agate
#

Modded can also be used by us

#

Its not a modder only thing

late locust
#

But then why not just add it to the base enum

minor agate
#

And you do not want to mix game project specific things to engine

late locust
#

I see

torn bane
ocean needle
#
// m_vRotMat is set OnInit: Math3D.AnglesToMatrix(owner.GetAngles(), m_vRotMat);
vector rotAxis = owner.GetWorldTransformAxis(1);
        
vector rotOut[4];
SCR_Math3D.RotateAround(m_vRotMat, owner.GetOrigin(), rotAxis, pitchDeg * Math.DEG2RAD, rotOut);

owner.SetAngles(Math3D.MatrixToAngles(rotOut));

this only rotates my entity around the correct axis if its pointing north or south how can i fix that?

#

well its actually just wrong most of the time

#

fixed it using quats, still just as confused but it works

fervent cedar
#

Ye, would be nice to get more helper functions for 3d positioning and rotating.
It's confusing and takes long time for many people, common struggle

pliant ingot
ocean needle
#

but i was doing stuff to the position separately in the same place during debugging and i barely know what im doing here so its messy

pliant ingot
#

Converting matrix to Euler angles and back - is weird

ocean needle
#

yup had many times where i hit play and it just started doing some crazy backflips

brazen thistle
#

Anyone want to collaborate with me on a project?

Recreating the popular arma 3 "Dynamic Missions Spawner" - for multiple use cases on Reforger

spark otter
#

Trying to work out where the prefabs are populated for the campaign building mode. Anyone have a clue?

dire sinew
spark otter
# dire sinew Depends for what. For vehicles and groups it's the same configs as for GM, as yo...

I think Im getting closer! Im trying to attach the building mode to the MHQ to allow both fortifications (which is working fine) and one small modded vehicle to be spawned. The trouble is I dont want all vehicles to be spawnable. Now I'm trying to figure out how to determine if the building mode was entered from the MHQ, so I can then manually filter out the unwanted vehicles. However, the owner for the building mode seems to be the game mode 😢

simple rampart
#

Cross post from generic: Hi all, I'm trying to work out how to make a modification to the PlayerManager class in Enfusion but the only thing I can find seems to be a header file PlayerManager.c. If you could @ me in your response just in case I miss is that would be appreciated ❤️

spark otter
#

But I guess the answer to my earlier question is SCR_EntityCatalog and SCR_EntityCatalogEntry. The building mode seems to use cs SCR_EntityCatalogManagerComponent.GetFilteredEditorPrefabs() however the heavy vehicle depot uses ```cs
SCR_CatalogEntitySpawnerComponent.AddAssetsFromCatalog()

river imp
#

You beat me to it lol

dire sinew
simple rampart
dire sinew
#

No, but what the heck are you even trying to accomplish?

spark otter
simple rampart
# dire sinew No, but what the heck are you even trying to accomplish?

I just want to override the functionality of GetPlayerName to return a custom value. I believe there is at least one mod that allows for custom names but it doesn't play nice with other mods. Overriding this would mean anything relying on get player name like squad compass would get a custom name

river imp
#

generated classes can't be modded and external functions can't be overwritten

#

Even if you could inherit and override some methods, you wouldn't be able to override the method to get the player manager from the game.

#

ChimeraGame::GetPlayerManager is external.

#

You'd then be forced to replaced every call of getting the playername in every script

#

And if there is anything engine side that calls it you'd be SOL

simple rampart
#

Yep, but I only wanted to replace it in one and I would have just made compats of the mods locally if there were new mods I wanted to override that functionality in

#

I have another solution but it is less elegant I think 🤔

#

I appreciate the help though ❤️

spark otter
dire sinew
spark otter
#

well the main issue now is trying to figure out where the action was called from, the MHQ truck, or a vehicle depot.

#

probably have to use Rpc's as the action is local only

#

Not really sure how to connect SCR_CampaignBuildingStartUserAction and SCR_EntityCatalogManagerComponent

#

I guess I could use the game mode!

spark otter
#

That worked!

minor agate
river imp
minor agate
#

In future you will also be able to mod generated classes

#

But you wont be able to override non event generated proto or external methods

#

That will stay locked

river imp
#

I recall you mentioning that script invokers are probably going away

#

What would they be replaced with?

minor agate
minor agate
open pier
marble ridge
#

There was an update to it recently to ensure compatibility with Coaliton Squad Interface

#

By simply modding CSI's classes.

simple rampart
marble ridge
#

Yeah we didnt want to have CSI as a dependency, but unfortunately due to Enfusion's race condition only one mod can fight for control of GetName()

#

So we had to end up modding CSI aswell

ocean breach
#

I keep running into the problem that I cant get/set different properties of Components that are exposed through the editor, for example the type of bullet inside a magazine. I can get the Magazine from a weapon, but there doesn't seem to be a way to determine what ammunition it uses. Does anyone have any idea how one might be able to access these properties?

fringe prairie
stable harbor
#

My Game won't go in the cinematic camera when running the game engine. what can i do?

stable harbor
#

Can i do cutscenes?

torn bane
ocean breach
torn bane
#

Getters, you cannot set these. They are handled by the magazine config which is hardcoded via the .conf files. no changing via script

topaz locust
#

Does anyone know why this assertion fails when trying to create a particle emitter? Works on a different component with that same configuration and no issue

#

Is it because I'm doing it from an AimModifier?

desert escarp
#

Is there any way to actually diagnose a memory leak in the debug menu?

#

Something is leaking from my mod and it's not appearing in the script profiler in the WB

ocean breach
minor agate
#

Just beware that you do not have permission to feed AI our script code.

ocean breach
# dire sinew You can read any property from BaseContainer: <https://github.com/acemod/ACE-Anv...

Thank you for this, I've got it working properly. Two more questions though: Is it possible to modify these values on a componenrt at runtime? My understanding is that the BaseContainer basically only contains the data for the prefab, so not "up-to-date" data, meaning SetObject won't change an object at runtime. Also do you know if it's possible to obtain the currently chambered round? My only way would be to get the current AmmoCount-1 and use that to find the round from the MagazineConfig.

torn bane
topaz locust
valid anchor
#

trying to script changes to player animation audio

#

what exactly handles the triggers for footsteps?

#

character_footsteps.acp

#

I see charactersoundcomponent on the character_base but even scripted it to disabled has no effect

pliant ingot
sinful oasis
#

SCR_SupportStationManagerComponent seems to cause major issues for me in Conflict, whenever this error pops up, my groups break. Any ideas what causes this / how to fix? Seems so random...


Reason: NULL pointer to instance. Variable 'm_eSupportStationPriority'

Class:      'SCR_SupportStationManagerComponent'
Function: 'AddSupportStation'
Stack trace:
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function AddSupportStation
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function DelayedInit
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function DelayedInit
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function OnUpdate
SCRIPT    (E): Virtual Machine Exception

Reason: NULL pointer to instance. Variable 'm_eSupportStationPriority'

Class:      'SCR_SupportStationManagerComponent'
Function: 'AddSupportStation'
Stack trace:
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function AddSupportStation
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function DelayedInit
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function OnUpdate
SCRIPT    (E): Virtual Machine Exception

Reason: NULL pointer to instance. Variable 'm_eSupportStationPriority'

Class:      'SCR_SupportStationManagerComponent'
Function: 'AddSupportStation'
Stack trace:
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function AddSupportStation
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function DelayedInit
scripts/Game/Components/SupportStation/SCR_SupportStationManagerComponent.c:169 Function OnUpdate
mossy spade
#

Add this as a band-aid:

modded class SCR_SupportStationManagerComponent : ScriptComponent
{
    protected static SCR_SupportStationManagerComponent s_Instance;

    override void OnPostInit(IEntity owner)
    {
        s_Instance = this;
        super.OnPostInit(owner);
    }
}
late locust
#

Are there any conventions for e.g requires.Insert(FactionAffiliationComponent); and still checking for null after FindComponent(FactionAffiliationComponent)?

sinful oasis
open pier
#

Has therr been any recent changes to how the PlayerController works? We have a profile for players that is on their PlayerController which includes money. It worked initially where players money would save/load/update if depositing or withdrawing money, now it doesn't seem to update or save their money when doing a transaction.

If you withdraw money and relog, you have the money you withdrew and the balance before the withdrawal in your bank account.

A few weeks ago it worked as it should.

Disregard, with all my glorious intellect, I found out that you need to put "await player.save()" at the end of your function, to actually have it update the database yeehaw

pseudo tide
#

Anyone know what's the best way to start scripting in enfusion when I've never had any experience with it?

modern marlin
#

Hi All. I'm just starting with some scripting. I'm attempting to subclass SCR_ScriptedEntity and I'm getting : Unknown type 'SCR_ScriptedEntity' My project has the main ArmaReforger dependency 58D0FB3206B6F859 but I can't seem to get it to recognise this SCR_ class. Do i need to do anthing special to fix this? ( chatGpt has been suggesting I add the dependency that I already believe I have). Thanks.

open pier
modern marlin
modern marlin
#

... after telling chatgpt my exact version it now reveals to me that class no longer exists. Sigh...

fringe prairie
#

What is your desired end result?

open pier
modern marlin
#

Goal is simply to setup an entity so just looking for the correct approach. I think I've got it now that Ive fixed chatgpt's hallucination. I'm now using GenericEntity which seems to be fine.

teal vapor
#

The bootcamp vids are really great.

river imp
#

If you're a "learn from reading source" person just open Workbench and look and the vanilla scripts. Lol

#

At*

verbal cloak
#

im new to tools just wondering if anyone know how to setup cars in map creation because i cant find anything online

teal vapor
open pier
# modern marlin Goal is simply to setup an entity so just looking for the correct approach. I th...

Place a GenericEntity on the map, create a class that inherits from the GenericEntity.

Zen_GenericEntity : GenericEntity {}

Compile your code.

In the world editor, right click on the entity, in the resource browser, and change class to the one you just made. Then you can do your overrides as needed. Don't forget to create a class constructor. I've found that without it the entity won't initialize. Mainly an override to the EOnInit or OnInit or Init(im on my phone rn so unsure which one it exactly is) along with a SetEventMask(EventMask.Init) in the constructor is a good way to start having your entity 'run'. From there, look at docs and just how certain things are scripted from the base game. ie something that is doing something relative in the base game that you want to try to do.

With figuring out the event mask, the workbench helps a ton. Just write
SetEventMask(EventMask.

And the workbench will generate some auto completes for that specific enum.

#

Again, im on my phone so what I write my look like some chatgpt "there but not exactly correct", im just going off if memory.

modern marlin
lime dew
#

I am using Enfusion Persistent Framework respawn system, How do I make sure the faction manager counts the player into the assigned faction ?

I have only one player in the scenario it has the correct assigned faction but doesn't get counted, I have tried multiple scripts and it still doesn't work, this has been an issue for a few months, If anyone can help PLEASE let me know.

torn bane
lime dew
#

I hope so I am at ends wit with this.

open pier
torn bane
#

I will probably ensure EPF keeps what ever functionality it has now for a few months. I will not add anything new. Transition is not really hard but requires touching everything. The idea of extracting save data and applying it back is still there so it's not hard to transition I would imagine.

polar patrol
#

Hello guys, does anyone know if it's possible to make hand logic in Arma.r like in the game Bodycam? Without creating animations for it, p.s I don't know how to make them. So here's an interesting question: we have the character's hands and they have bones, we can work with the bones through setbone, but setbone works in a confusing way, and as I checked, if you set the weapon rotation logic through setbone, the animation will be clunky and frame-by-frame. set/offset also doesn't work as we can only change the position of the hands in the offset but can't rotate them (maybe I haven't fully explored the option with offsets, but still, if anyone knows how to do this, please help

river imp
scarlet iris
#

What is the best method to ensure AI has infinite mags? (not infinite ammo)

ocean needle
#

hook when they reload and add another magazine?

rose needle
#

How do you check if a string has " inside it?

#

cause doesn't like ' " '

#

Imma use string helper

ocean needle
rose needle
#

I see thanks

scarlet iris
#

How can I detect when a character is being controlled by a human player?

ocean needle
#

or static bool IsPlayerOrAIOwner(notnull ChimeraCharacter character, out bool isAi = false) in the same class if thats what you mean

scarlet iris
# ocean needle `SCR_CharacterHelper` has `static bool IsAPlayer(IEntity entity)`

Thank you. I can't get it to work not sure what I am doing wrong.

Here's a script that adds a magazine to inventory when the character reloads, and it works fine but I can't make it apply only to AI. since this component is attached to Base Character Prefab, all characters have this feature. I want to make the feature only for AI with an optional checkbox to allow players to use it but no matter what I do it keeps detecting players as characters in general. any ideas? would greatly appreciate it.

scarlet iris
ocean needle
# scarlet iris a bit hacky but I managed to solve it by modding the SCR_PlayerController to dis...

post init seems to be too early still to detect if its a player, this should work

    //------------------------------------------------------------------------------------------------
    override void OnPostInit(IEntity owner)
    {
        super.OnPostInit(owner);

        m_WpnMan = BaseWeaponManagerComponent.Cast(owner.FindComponent(BaseWeaponManagerComponent));
        if (!m_WpnMan)
            return;

        GetGame().GetCallqueue().Call(EE_InfiniteMagsInit, owner);
    }

    //------------------------------------------------------------------------------------------------
    protected void EE_InfiniteMagsInit(IEntity owner)
    {
        EE_InfiniteMagsComponentClass compClass = EE_InfiniteMagsComponentClass.Cast(GetComponentData(owner));
        if (!compClass)
            return;
            
        SCR_ECharacterControlType controlType = SCR_CharacterHelper.GetCharacterControlType(owner);
        if (controlType == SCR_ECharacterControlType.AI)
            m_bIsValidCharacter = true;
        
        if (compClass.m_bAllowPlayers && SCR_CharacterHelper.IsAPlayer(owner))
            m_bIsValidCharacter = true;
        
        if (m_bIsValidCharacter)
            SetEventMask(owner, EntityEvent.FRAME);
    }
acoustic quail
#

Is it normal that the scripts that you can view in Reforger Tool is duplicated?

noble dune
#

Hey we are looking for a Life Framework because there is no German server and we would like to play 🙂

tawny lotus
abstract crescent
#

Hi. I try to make some diagnostics code. Can i get server performance statistics like CPU, RAM, Replication and VON network activity for server?

open pier
spark otter
#

is it possible to add an EEditableEntityLabel to a prefab via script?

#

maybe something like ```cs
m_aAuthoredLabels.Insert(EEditableEntityLabel.ENTITYTYPE_VEHICLE);

#

Or maybe thats not allowed with an APL-ND mod though, huh? o.O 💩

acoustic quail
#

I think it is causing some bugs to occur in game

#

Even reinstalling Reforger or the Tool won’t help

tawny lotus
# acoustic quail You know how to fix it?

No. OTOH, I did not see any other issues than the visual annoyance. In my case, I just keep the files triggering this in a separate dir. As said, this is a weird bug.

\dirB\otherfile.c```

If I move the otherfile.c to \dirA\, it suddenly looks like:
```\dirA\file.c
\dirA\file.c
\dirA\otherfile.c
\dirA\otherfile.c```
honest umbra
#

Random Question: In terms of resource/network usage, are these 2 methods of saving different data types the same or is one method better than the other?

1] Create multiple components and corresponding savedata classes extending EPF_ComponentSaveData that are included in the EPF_PersistenceComponent attached to the Chimera_Character.
This way, the data is more spread out and on every save and read, it is looking into multiple different json files for data pertaining to each individual character. Smaller chunks.

2] Creating a single gamemode component and corresponding savedata class extending EPF_ScriptedStateSaveData , and having just one, big json file with all the players and relevant data.
This way the data is more centralized but the read/write would have to deal with one, larger file.

I hope this makes sense to someone. Or maybe I'm just overthinking it.

desert escarp
#

Incase anyone else runs into this

#

This fixed the ram leak within my mod.

abstract charm
#

Hi there. I'm trying to make a little racing framework and end up with a problem. How do I create some variable (with start/finish time, etc) and have it accessible from different triggers?

abstract crescent
abstract charm
#

I need to store start time in start trigger, and finish time in finish trigger

abstract crescent
# abstract charm No, I mean how can I some data structure to which I can access globally from dif...

whatthe

class MYTAG_MyGameMode: SCR_BaseGameMode
{
  private WorldTimestamp m_startRaceTime = null;

  void StartRace()
  {
    m_startRaceTime  = GetGame().GetWorld().GetServerTimestamp();
  }
  void StopRace()
  {
    m_startRaceTime  = null;
  }

  void GetStartTime()
  {
    return m_startRaceTime;
  }
}
void SomeFuncSomeWhere()
{
...
  MYTAG_MyGameMode gameMode = MYTAG_MyGameMode.CAst(GetGame().GameMode());
  WorldTimestamp startTime = gameMode.GetStartTime();
...
}
abstract charm
#

You suggest using gamemode as storage? I'll try, thank you

abstract crescent
abstract crescent
undone patrol
#

Is it correct to edit the zoom step in the notepad?
since the limit in the game is x5, and instead of writing a new script, I'm editing the prefab in the notepad.
Will this cause conflicts?
According to the console, there are no errors.

#

Essentially, this bypasses the script restriction

#

And is it Legal? kekw

undone patrol
#

Or would it be more correct to use override or inheritance?

fringe prairie
fringe prairie
# undone patrol Or would it be more correct to use override or inheritance?

So you are modifying a config file which is completely fine, what I’m interested in seeing is if it actually works (not just not errors), if it works this is an excellent albeit dumb solution to an arbitrary problem. Now if it doesn’t work you might need to make a modded class that overrides that attribute to increase it. Or inherit the class with override attribute so it only affects certain (scopes)?

pearl swift
#

i cant figure it out for the life of me

undone patrol
undone patrol
#

This component allows you to edit the Minimum and Maximum zoom levels and the Step ratio when zooming in.

pearl swift
# undone patrol

it doesnt work for me,if i change base zoom level i cant zoom up to max zoom level

#

does interloption speed have do with anything?

undone patrol
pearl swift
undone patrol
pearl swift
#

i figured the problem out

undone patrol
spark otter
open pier
acoustic quail
#

if you want to get the current faction holder of a campaign base, which would be the best function to do so? I have been trying to use the faction affiliation component but it does not work well

#

it seems the faction affiliation don’t change after capturing

acoustic quail
#

should I use getcampainfaction or Getfaction

desert escarp
#

Currently trying to use the CharacterIdentityComponent to set specific bodies to specific slots but it seems like swaping the visual identities in the Enforce side does not work and results in clipping.

#
    void SetVisIdentity(IEntity entity)
    {
        SCR_CharacterIdentityComponent identityComp = SCR_CharacterIdentityComponent.Cast(entity.FindComponent(SCR_CharacterIdentityComponent));
        VisualIdentity visIdentity = identityComp.GetIdentity().GetVisualIdentity();
        visIdentity.SetBody("{E7C1C23F782B7481}Prefabs/Characters/Basebody/BigBossBaseBody.et");
        identityComp.CommitChanges();
    }

    override void OnControllableSpawned(IEntity entity)
    {
        super.OnControllableSpawned(entity);
        if (entity.GetPrefabData().GetPrefabName() == "{B3182F73DBEACB7B}Prefabs/Characters/Factions/BLUFOR/CRF_GS_BLUFOR_COY_P.et")
            GetGame().GetCallqueue().Call(SetVisIdentity, entity);
    }
#

The same thing happens when I use the override in the SCR_CharacterIdentityComponent , we are adding gear to the entity in runtime, currently I've tried calling the gear being adding at the same time and after and the clipping persists

desert escarp
#

Correction, even using the override from the component with the base loadout manager causes clipping.

#

Nvm it was my custom mesh that was the issue

spark otter
spark otter
#

How would I get the SCR_EditableEntityUIInfo of a Vehicle, or the Vehicle of the SCR_EditableEntityUIInfo?

#

Since its listed under the SCR_EditableVehicleComponent in the world editor, would it be a child of the SCR_EditableVehicleComponent?

tidal kernel
#

Anyone know how to add blown cover when fired a round into an enemy in SCR_PerceivedFactionManagerComponent?
I know this is a new feature which is so cool and hope they add code to "reveal your cover in certain rules (Example: Noise radius, Suppressed weapons, First shot free...etc)", if broken a rule the enemy faction (same faction impersonating) sees right through the cover.
However does anyone know how to add that currently? Mainly for shooting an enemy... Im pretty new to scripting in this engine and need to do some heavy learning.

Also I hope we get more settings like distance, chain reaction and other bits to improve "going undercover" Scenarios

spark otter
#

can I not modify SCR_EditableEntityUIInfo? If I try to do modded class without actually modifying anything, I get a bunch of errors that seem to come from ```cs
protected override void CopyFrom(SCR_UIName source)

next talon
#

int factionCount = 0;

Anyone know something similar that works to resolve this error?

open pier
next talon
gusty pulsar
#

What is the best and cheapest way to get material (gamemat/physmat) from bullet hit (contact)?

red cedar
tender brook
#

Is there a way to add aditional actions to a ActionsManagerComponent in runtime through a script? Because it has no 'AddAction' function. I tried searching for the word 'ActionsManagerComponent' but all 59 results in the original Arma code dont try something like that.

spark otter
sleek dove
#

as Gramps said only way is to add it already and just hide it

tender brook
#

Thanks but unfortunatily that wont work for what i am trying to do.

#

I'd have to add 100's of actions to each item lol

slate raft
polar patrol
#

Guys please tell me, is there a separate signal that reads the player's turn while standing still or in motion?

errant fog
#

Hi, im doing some super vibe coding to proof of concept.
I am wondering why my code compiles and runs on the server, but i get a 415 whenever i attempt to POST

#

code incoming:

#
//OpsTrack_BaseGameMode
modded class SCR_BaseGameMode
{
    override void EOnInit(IEntity owner)
    {
        super.EOnInit(owner); //Run code from super class
        
        if(Replication.IsServer()) //Using IsServer because we only want it to happen when it is a server.
        {
            Print("[OpsTrack] Mod is running on the server!");
        }
    }
    
    override void OnPlayerConnected(int playerId)
    {
        super.OnPlayerConnected(playerId);

        BackendApi backend = GetGame().GetBackendApi();
        string uniqueId = backend.GetPlayerIdentityId(playerId);

        RestApi api = GetGame().GetRestApi();
        RestContext ctx = api.GetContext("<SOMEURL>");
        ctx.SetHeaders("Content-Type,application/json,Accept,application/json");


        
        

        string json = string.Format("{\"PlayerId\":\"%1\",\"UniqueId\":\"%2\"}", playerId.ToString(), uniqueId);
        ctx.POST(new OpsTrackCallback(), "/player/join", json);

        Print(string.Format("[OpsTrack] Player connected: %1 (%2)", playerId, uniqueId));
    }

    override void OnPlayerDisconnected(int playerId, KickCauseCode cause, int timeout)
    {
        super.OnPlayerDisconnected(playerId, cause, timeout);

        BackendApi backend = GetGame().GetBackendApi();
        string uniqueId = backend.GetPlayerIdentityId(playerId);

        RestApi api = GetGame().GetRestApi();
        RestContext ctx = api.GetContext("<SOMEURL>");
        ctx.SetHeaders("Content-Type,application/json,Accept,application/json");



        string json = string.Format("{\"PlayerId\":\"%1\",\"UniqueId\":\"%2\"}", playerId.ToString(), uniqueId);
        ctx.POST(new OpsTrackCallback(), "/player/leave", json);

        Print(string.Format("[OpsTrack] Player disconnected: %1 (%2)", playerId, uniqueId));
    }


}```
#

Server log:

 DEFAULT      : BattlEye Server: Disconnect player identity=0x00000000
 DEFAULT      : BattlEye Server: 'Player #0 Mikkelsen disconnected'
NETWORK      : Player disconnected: connectionID=0
BACKEND   (E): SetHeaders - Number of strings must be even!
SCRIPT       : [OpsTrack] Player disconnected: 1 (605f7501-78f3-4f02-b029-fdb329d14751)
NETWORK      : Total number of players: 0
BACKEND   (E): [RestApi] ID:[34] TYPE:[UNKNOWN] Error Code:415 - Unimplemented 4xx, apiCode="", uid="", message=""

Its definetly game server side, i can post just fine to my api, through swagger

torn bane
sour marten
#

Hello Reforger Modders,

I'm currently working on a custom map UI component (SCR_MapUIBaseComponent) to draw a circular zone using multiple MapItem markers (a point cloud).

I'm running into an issue loading a custom image from an Imageset onto these MapItems. I keep getting white squares on the map, indicating the resource isn't found or loaded correctly, despite the resource paths being confirmed in the Workbench.

I've already tried the standard solution, but it's not working:

// 1. Canonical Resource ID is constructed correctly.
string myImageset = "{GUID}UI/Imagesets/Dots.imageset";
string myImageQuad = "RedDot";
string myImageResourceID = myImageset + ":" + myImageQuad;

Using the correct MapItem property setter.
MapDescriptorProps props = pointItem.GetProps();
if (props)
{
props.SetImageDef(myImageResourceID);
// I also tried explicitly setting a solid alpha:
props.SetFrontColor(Color.RGBA(255, 0, 0, 255));
}

Is there a specific method required to register an Imageset or ResourceName with the MapEntity or MapConfiguration before using MapDescriptorProps.SetImageDef()

Any insights would be greatly appreciated! Thanks!"

errant fog
torn bane
#

Yes we hope to improve the apis to make it less error prone. this was just added so there is any way to set headers with least amount of effort

spark otter
#

Whats the name of the action for placing vehicles in building mode?

tough cave
#

is there a way to dump the localization stringtable or do lookups on strings from core game? I don't see anyone talking about that

#

FYI: It's been talked about once before, but it didn't get any attention. SCR_MapCampaignUI.ShowSpawnPoint is for Campaign / Conflict, but it affects all scenarios due to how MapFullscreen.conf is set without being mission-specific like when tied to a game mode prefab. A SCR_GameModeCampaign type check forces a premature return in that method for all non-Conflict scenarios. You can change the class back to the parent to get spawnpoint icon drawing on map to use the generic code. MapSpawnMenu is unaffected by this Campaign / Conflict misconfig / code.

ocean needle
#

getting an error here, what am i missing?

scripts/WorkbenchGame/Editor/SMG_Bake.c(47): error: Wrong number of template parameters

SMG_SystemRegistry sys;
if (!SMG_Template<SMG_SystemRegistry>.Load(m_sSystemTemplate, "System Template", sys, curErr))
    ShowError(curErr);

// ...
class SMG_Template<BaseContainer T>
{
    static bool Load(ResourceName path, string label, out T instance, out string error)
    {
        // ...
river imp
stable harbor
#

can i establish an ip connection in enfusion engine?

open pier
stable harbor
open pier
# stable harbor yes

If you're trying to through the workbench then yes, there is also DNS resolution

errant fog
#

Do you just use the enfusion IDE? and github desktop to push for repo?
I was wondering if there exist a better solution, like the inbuild version control in vs2022

serene fox
#

Good Morning, question: Do we need to replicate Entity Flags or will they replicated by the game itself? For example if we change the visibility on runtime.

minor agate
#

You might want some to be active on server, while other active on clients

#

whicle several clients having different ones

#

etc etc

minor agate
#

as you will mess with other things because of what I mentioned.

serene fox
torn bane
solid hearth
#

Hopefully 1.6 doesn't get deleted internally Prayge

errant fog
#

I need to create a configuration file located in the $profile: folder in JSON format, and of course read that config back into my mod.

What is the recommended way to work with JSON serialization in Enfusion/Arma Reforger?

  • Which classes or containers should I use (JsonLoadContainer, JsonSaveContainer, etc.)?
  • And how do I read the values back into my own settings class?
torn bane
errant fog
ocean needle
errant fog
torn bane
# errant fog Nice, thanks. Where would it be appropiate to load settings? BaseGameMode doesnt...

The earliest instances that run before any other entity in the world is created are world systems. But adding a system just to read the config is meh. I do not have an ideal place in my head yet. Maybe a derived mission header type would be a good approach, but not sure how those will work with the main menu where your mod is not active ...

Usually you can just make your settings holder a singleton that does the reading on the first occurance of someone wanting your settings and then it keeps them. That should work

ocean needle
stable harbor
#

ok any knowlage base with examples about this topic

open pier
errant fog
tawny lotus
#

Should a marker be visible only to USSR faction if I do this:

Faction faction = GetGame().GetFactionManager().GetFactionByKey("USSR");
int fIndex = GetGame().GetFactionManager().GetFactionIndex(faction);
SCR_MapMarkerBase markerst = new SCR_MapMarkerBase();
markerst.AddMarkerFactionFlags(fIndex);
/* Rest of the needed things */
mapMarkerMgr.InsertStaticMarker(markerst, false, true);

Doing the above makes it hidden to everyone.

solid hearth
#

Try Set instead of Add.

tawny lotus
solid hearth
#

Wait are you sure it displays for everyone without changing the flags?

tawny lotus
#

Yes.

#

If I set it as SetMarkerFactionFlags(0), everyone can see it (..as is documented).

solid hearth
tawny lotus
stable harbor
#

How can i make my script execute by the game on every server session.

solid hearth
#

Idk if it's marker type specific or something or if you're on experimental but just try changing it up.

tawny lotus
solid hearth
#

There's only two things that should have anything map marker related which are the game mode entity and player controller. I'd check which player controller you're running and if it has all the map managers on it.

tawny lotus
#

Care to elaborate on how to check the player controller?

solid hearth
#

On the game mode entity its self all the way at the bottom

ionic pewter
#

so i get this error for my componant that i made "SCR_ExplosionPrefabSpawnerComponent"


Reason: NULL pointer to instance. Variable '@m00'

Class:      'SCR_ExplosionPrefabSpawnerComponent'
Function: 'IsNearExistingCrater'
Stack trace:
scripts/Game/CombatOps/Test.c:215 Function IsNearExistingCrater
scripts/Game/CombatOps/Test.c:90 Function SpawnCraterPrefab
scripts/Game/CombatOps/Test.c:313 Function OnDelete

However it dosnt pop up with the text box asking to debug or anyhting only in console here and a little warning in the corner when i compile. Tested it many times in game here and it works fine, so i uploaded it to the workshop to download and test in game and there too it work fine. Should i just ignore this then?

restive island
#

Where can I change the behavior of the fuel depot to act like the fuel truck cargo so it has limited fuel? It looks like it's a fuel node but it has no fuel manager so it just limits the fuel flow per the logic

modest flame
#

Hey, I'm trying to create a marker that floats above an object and is visible to all players in the game world from anywhere. Similar to the task icons in Arma 3. Does anyone have any idea how to implement this? As far as I know, the tasks in Reforger are not displayed in the game world but only on the map, right?

acoustic quail
#

What is the meaning of “chimera” I see in script?

#

And what is the difference between ChimeraAIAgent and regular AIAgent?

sweet badger
# acoustic quail What is the meaning of “chimera” I see in script?

As far as I know, Chimera is an internal project name, though I don't know whether it stands Reforger in general or something used for Reforger.
Either way, in practice the name just indicates at what level that class was implemented, same as SCR_ (scripted chimera reforger) classes are implemented in script.

sour marten
#

hej guys i have a question about how to make a own strings text for example the RestrictionZoneWarning.layout

i want to create a custom Message for it

i did already edit the SCR_RestrictionZoneWarningHUD so that i can add the New Warning Type in the ERestrictionZoneWarningType

but how can i change the strings or add the strings

#

Do i need to create a stringTable or How does the #AR_justtext work

sweet badger
#

It has a string field for each type, and in there you can put the text directly, or alternatively a localization key.

sour marten
#

Correct that what i found but they use the strange strings right the #AR_something
i think the best is to use localization key.

sweet badger
#

If you want it to show messages in different languages, you will need to create a string table and add such an entry.
Unless the Arma Reforger string table already has a suitable entry that you can reuse.

sour marten
#

it is not possible to change the Arma Reforger string table right

so i need to create a new one

and add it here right

sweet badger
#

Yeah, the Workbench does not let you access it, the st files might not even be included, just the built runtime tables

sour marten
#

so for the mod you dont need the orginal Table just create a new Table what i use for that specific mod is that correct

sour marten
#

i added it into the Game Project -> WidgetManagerSettings -> String Tables

i added the new String table to it but it does not work

i added also the Translation string to the HUDManager in the playerController

do i forget something?

desert escarp
#

Make sure you build the string table

#

Table > Build

sour marten
#

i did

#

still not working

#

i restarted workbench to

tacit wagon
#

Hello all!!

I am really good with Arma 3's SQF language but I really really struggled to even find my footing into Reforger. I watched a few of the modding bootcamp videos which were helpful in familiarizing myself with the workbench, components, etc but I think where my struggles still largest lie is in how one would go about starting to make a mission. For example, initialization order, event scripts, etc.

Does anyone here have any resources that were helpful for them while learning to build missions? Were there any resources that helped in learning client / server-side relationship? Is anyone here an SQF native who struggles a bit with the concepts of OOP and have any guides or suggestions on how to navigate that?

Apologies in advance if this is all a really loaded question. Would love to get into Reforger, just struggling to find my steps.

storm bobcat
#

Hey guys. I'm looking to add a custom construction object for construction trucks. I want to build a Hab object like from squad.

Can anyone point in the right direction:
Where is the list of construction objects for conflict?
What is the file path to the bunker construction object?
What components do I need to create a physical supply depot?

I already know where to look for this, but any tips on a creating custom spawn point object?

errant fog
#

Im getting a bit confused when looking around at KickCauseCode...
I want to "capture" the reason for a disconnect, and the potential error message... Am i even looking at the right class here?

gentle cradle
#

can anyone see where the broken expression is here?: SendMessage(playerId, string.Format(" Discord Integration: %1", configManager.IsDiscordEnabled() ? "✅ ON" : "❌ OFF"));

fluid olive
#

im neww to the arma tools and very confused

ocean needle
spark otter
#

Whats the name of the action for placing vehicles in building mode?

fluid olive
#

anyone help with adding enfusion character persistence to my server/scenario?

#

very new to reforger tools and im having some rough luck here

delicate edge
#

Hey, probably a stupid question but how do you DEspawn prefabs from script?

coarse moon
#

I'm trying to make an entity that has a vest equipped delete itself when it dies, but no matter how hard I try, it doesn't work. Am I doing something wrong?

{
    // More code...
    
    // Store reference to delete after explosion processing
    IEntity bodyToDelete = m_OwnerCharacter;
    
    OnItemUnequipped();
    
    GetGame().GetCallqueue().CallLater(DeleteBody, 200, false, bodyToDelete);
}

void DeleteBody(IEntity body)
{
    if (!body)
        return;
        

    delete body;
}```
desert escarp
#

If you're trying to delete everything on the character use
SCR_EntityHelper::DeleteEntityAndChildren

kindred vessel
#

What is the best strategy of loading custom config and using those values across multiple files?

pliant ingot
kindred vessel
kindred vessel
kindred vessel
#

For context, this is in a GameSystem that is defined for both client and server

river imp
kindred vessel
#

Some code would help I'd say, sorry for leaving that out but thanks for taking the time to answer.

I've got a config in the mod and that is confirmed loading serverside OnInit but once I call GetVoteGroupByName from a menu for example (clientside) I get a Reason: NULL pointer to instance. Variable '#array' during call 'array<@ZERO_VotingGroupConfig>.Count' error.

class ZERO_VotingGroupSystem : GameSystem
{
    static ref ZERO_VotingGroupSystem s_Instance;
    protected SCR_VotingManagerComponent m_aVotingManager;
    ref array<ref ZERO_VotingGroupConfig> m_aVotingGroups;
    ref map<string, int> m_mLastVoteTimeByGroup;

    static ZERO_VotingGroupSystem GetInstance()
    {
        World w = GetGame().GetWorld();
        if (!w)
            return null;
        return ZERO_VotingGroupSystem.Cast(w.FindSystem(ZERO_VotingGroupSystem));
    }

    override protected void OnInit()
    {
        ZERO_VotingGroupsConfig groupsConfig = new ZERO_VotingGroupsConfig();
        m_aVotingGroups = groupsConfig.m_aVotingGroups;
    }

    ZERO_VotingGroupConfig GetVoteGroupByName(string name)
    {
        foreach (ZERO_VotingGroupConfig group : m_aVotingGroups)
        {
            if (group && group.GetGroupName() == name)
            {
                return group;
            }
        }
        return null;
    }
....
#

the config manipulates how the UI is displayed and provides config that I will need server side. So I'm stuck on conditionally displaying the UI from a config in essence.

river imp
#

Your ZERO_VotingGroupsConfig::m_aVotingGroups could be getting populated by functionality that only the server can run. Meaning it's null on the client.

kindred vessel
#

I have a config file that is located in the mod, in the folder Configs that contains:

ZERO_VotingGroupsConfig {
 m_aVotingGroups {
  ZERO_VotingGroupConfig "{66610CC5ADA12E83}" {
   m_Name "y"
  }
  ZERO_VotingGroupConfig "{66610CC5ADC54F4C}" {
   m_Name "y"
  }
  ZERO_VotingGroupConfig "{66610CC5AD39F9C8}" {
   m_Name "y"
  }
 }
}

Based on the following classes:

ZERO_VotingGroupsConfig.c

[BaseContainerProps(configRoot:true)]
class ZERO_VotingGroupsConfig : Managed
{
    [Attribute("", UIWidgets.Object, "Voting group configs")]
    ref array<ref ZERO_VotingGroupConfig> m_aVotingGroups;
};

ZERO_VotingGroupConfig.c

[BaseContainerProps()]
class ZERO_VotingGroupConfig : Managed
{
    [Attribute()]
    string m_Name;
};
#

I've stripped some details which aren't relevant for this issue

river imp
#

You need to create an instance of the actual config file that you're trying to use.

#
    override protected void OnInit()
    {
        ZERO_VotingGroupsConfig GC;
        ResourceName RN = "{965E7D57CC2AB8E0}Configs/ExampleConfig.conf";
        GC = ZERO_VotingGroupsConfig.Cast(SCR_BaseContainerTools.CreateInstanceFromPrefab(RN));        
        m_aVotingGroups = GC.m_aVotingGroups;
    }
kindred vessel
#

Ahh then I misinterpreted Vlad then, because that was what I was initially doing. I will retry that in a moment and give an update asap

river imp
#

It works

river imp
#

Otherwise make the ResouceName an attribute of the system

#
    [Attribute(defvalue: "{965E7D57CC2AB8E0}Configs/ExampleConfig.conf",params: "conf class=ZERO_VotingGroupsConfig")]
    protected ResourceName m_VotingGroupsConfig;
        
    override protected void OnInit()
    {
        if(m_VotingGroupsConfig == string.Empty || !Resource.Load(m_VotingGroupsConfig).IsValid())
            m_VotingGroupsConfig = "{965E7D57CC2AB8E0}Configs/ExampleConfig.conf";
        
        ZERO_VotingGroupsConfig GC;
        GC = ZERO_VotingGroupsConfig.Cast(SCR_BaseContainerTools.CreateInstanceFromPrefab(m_VotingGroupsConfig));        
        m_aVotingGroups = GC.m_aVotingGroups;
    }
#

With a default value it may not ever be "empty" but, it's safe to assume that if someone can break it they will. So some checks before hand are advised.

kindred vessel
#

I wasn't sure how it worked but I saw a config beeing loaded for hints like that in the source

kindred vessel
pliant ingot
river imp
#

Or just cut out the middle man and use SCR_BaseContainerTools::CreateInstanceFromPrefab

#

Config helper does do some "null checks" for you though.

#
ZERO_VotingGroupsConfig GC = SCR_ConfigHelperT<ZERO_VotingGroupsConfig>.GetConfigObject(m_VotingGroupsConfig);
kindred vessel
#

both solutions do it for me, thank you both very much for helping me out 🤟🏻

craggy jolt
#

What's the difference between Resource.Load and BaseContainerTools.LoadContainer? Both seem to be the same.

minor agate
#

LoadContainer will try basically Resrouce.Load first, and if failed then goes directly into trying filesystem

craggy jolt
#

Still don't get it tbh, resource manager builds asset list from file system as well isn't it? Is there upside/downside to either?

minor agate
#

BaseContainerTools.LoadContainer is more useful for plugins in WB

#

Where you might want to load a config file from outside game dirs or paks

#

As it will be able to read from unregistered resoruces

craggy jolt
#

🤔

minor agate
#

While the .Load() one is there to use resource manager

#

Which will need them to be registered (Have meta file on them)

#

BaseContainerTools.LoadContainer will be okay to use filesystem paths as well, unlike Resource.Load which should be used with actual ResourceNames

#

Here is a reference I gave before for understanding filesystem in enfusion

craggy jolt
#

Thanks, guess I gonna have to make use of it to fully get it. Bookmarked that post for myself.

minor agate
#

Only to registered resources (Those that have meta files to them) have ResourceName. But this is talking about resource databse

#

Unregistered resources have no ResourceName

#

The ResourceName is more than just an ID tied to a filepath

#

That ID, is not just for quick lookup like some people think. It's also the basis of the whole modding of configs and so.

craggy jolt
#

Got it, thanks for clarification

kindred vessel
#

Does anyone know how I can make this config class renamable in the config? Since there isn’t a read only UIWidgets, I’m trying to work around the fact that m_VotingType can’t be editable but still needs to be recognizable.

[BaseContainerProps()]
class ZERO_VotingTypeConfig : Managed
{
    [Attribute("4", UIWidgets.Hidden, "Voting type", "", ParamEnumArray.FromEnum(EVotingType))]
    EVotingType m_VotingType;

    [Attribute("true")]
    bool m_Enabled;
    
    bool IsEnabled()
    {
        return m_Enabled;
    }
};
versed remnant
# kindred vessel Does anyone know how I can make this config class renamable in the config? Since...

You can !
Here is a quick made up example usingm_sName

[BaseContainerProps(configRoot: false), SCR_BaseContainerCustomTitleField("m_sName")]
class SCR_VotingConfigEntry : Managed
{
    [Attribute("", UIWidgets.EditBox, "Vote name")]
    string m_sName;
    
    [Attribute("", UIWidgets.EditBox, "Vote description")]
    string m_sDescription;
    
    [Attribute("", UIWidgets.CheckBox, "Is voting locked by GM")]
    bool m_bIsVotingLocked;
}
#

in your case I suppose this would do ? (untested)

[BaseContainerProps(configRoot: false), SCR_BaseContainerCustomTitleEnum(EVotingType, "m_VotingType")]
class ZERO_VotingTypeConfig : Managed
{
    [Attribute("4", UIWidgets.Hidden, "Voting type", "", ParamEnumArray.FromEnum(EVotingType))]
    EVotingType m_VotingType;

    [Attribute("true")]
    bool m_Enabled;
    
    bool IsEnabled()
    {
        return m_Enabled;
    }
}
kindred vessel
#

this is very cool

#

thank you so much!

#

Exactly what I was looking for

abstract crescent
#

Does anyone else have same issue with the hints in script editor? Its so annoying.

abstract crescent
craggy jolt
dire sinew
#

Do scripted inventory actions only work for weapons as parent? I can't see the action when I inspect my gadget and have another item with a scripted inventory action in my backpack that registers to a context of the gadget.

abstract crescent
coarse saffron
#

does anyone know how to get a vehicle to move when makeing a cinematic? I have a soldier in a jeep and scripted this, but I just can't get him to drive forward. He moves maybe half a foot. I attached it to the scene not the jeep entity. but either way it does not work. Any help is much appreciated!

earnest grail
#

**Hi hope this is the right place for this ! Does anyone know how to create an AI tracker team that moves to the players last know position in 60 second intervals ? in arma 3 it was getpos ...... moveto on loop with a pause before the moveto comman ! Any ideas would be grate thanks in advance ! ** // Create a function to make AI follow the player (you)
void trackPlayer(Entity player, Entity aiUnit)
{
// Loop to continuously check AI's awareness of the player's position
while (true)
{
if (aiUnit != null && player != null)
{
// Set the AI's waypoint to the player's position
aiUnit.GetWaypointManager().ClearWaypoints();
aiUnit.GetWaypointManager().AddWaypoint(player.GetWorldPosition());

        // Optionally: Make the AI "alert" to the player, so they actively track and engage
        aiUnit.SetStance(EStance.Alert);
    }
    
    // Small delay to avoid excessive computation
    Wait(30); // Wait for half a second before checking again
}

}`

gusty pulsar
#

What is the best way to read what material (.gamemat, .physmat) bullet hit?

tawny lotus
torn bane
red cedar
#

I have a bit of a "stupid" question, but if i want to run a logic (call a function) every like 20 minutes, Would it be wiser to use a callqueue or should i rather have a component / system adding timeslices until the 20 minute mark is reached ?

And how big of a difference does it make ?

neon elbow
neon elbow
#

There's more but, I'll need to ask: Are you using this script for singplayer or multiplayer? And, will your hunter team be on the map at the start of the game or are you planning on spawning them in when your players meet a condition (i.e trigger, user action)?

barren harness
#

I'm looking to make a triggerzone that prevents rockets and high caliber bullets from being used in that triggerzone does anyone have any experience with this?

earnest grail
undone patrol
red cedar
#

Another day another stupid question :

when i have for example the character entity of a player. Is there a cleaner way to get the player controller than go through the playermanager, get the player id and finally get the player controller??

I really hate this approach it feels unclean for me

neon elbow
#

let's see...

neon elbow
#

First let's get your player position. In the game mode there's a method PlayerController GetPlayerController(); so we can do

PlayerController playerController = GetGame().GetPlayerController();
        
IEntity player = playerController.GetControlledEntity();

vector playerPos = getOrigin(player); 

for your waypoints, you'll need to spawn a new one and assign it every time the 60 seconds elapses. Spawning things can be a bit tricky but you need SpawnEntityPrefab(notnull Resource templateResource, BaseWorld world = null, EntitySpawnParams params = null)

To utilize SpawnEntityPrefab you need a resource (The name of the type of waypoint you want to spawn. See images) and the spawn parameters (where you want to spawn the waypoint, i.e the playerPos).
We can start by generating some spawn parameters
I lifted this from Rabid Squirrel's videos.

protected EntitySpawnParams GenerateSpawnParameters(vector playerPos)
{
  // Create a new set of spawn parameters 
  EntitySpawnParams params = EntitySpawnParams();
  // Calibrate to our world map
  params.TransformMode = ETransformMode.WORLD;
  // Assign the position to those parameters 
  params.Transform[3] = playerPos;
      
  // Return this set of spawn parameters
  return params;
}

Now let's spawn our new waypoint

  Resource resource = Resource.Load("the_name_of_your_resource");
  AIWaypoint waypoint = AIWaypoint.Cast(GetGame().SpawnEntityPrefab(resource, null, GenerateSpawnParameters(playerPos)));

and assign it to our hunter group

SCR_AIGroup HunterGroup = GetGame().GetWorld().FindEntityByName("HunterGroupsName");
group.AddWaypoint(waypoint);
#

As for looping. I suppose you can use recursive function(?) by calling your method again 60 seconds later. GetGame().GetCallQueue.CallLater(the_name_of_the_method_you_put_all_you_stuff_in, 6000, false, What_ever_paramaters_you_used_for_said_function)

earnest grail
neon elbow
#

yeah, no problem. Right now the hunter group will keep following the chain of waypoints. But if you want them to take a straight path to the player whenever it loops I suggest looking into CompleteWaypoint() found in the AIGroup class.

maiden goblet
#

can't remember who author was tho

river imp
red cedar
#

Well not really issue. I'd say code that feels "unclean"

river imp
#

If you don't want all the boilerplate write a helper function.

desert escarp
#

Probably your best best

ocean kernel
#

The above is missing like 5 null checks because try/catch is dark magic blasphemy to enfusion devs

red cedar
red cedar
desert escarp
#

who doesn't love
if (object == null)
return;
over and over and over in each and every single fucking method

red cedar
#

Unfortunately it's very necessary (learned that the hard way) :(

kindred vessel
#

Vertical code length is always better than horizontal

#

but i'd love some support for a null conditional operator

red cedar
#

We need ternary operators

kindred vessel
desert escarp
#

Neither are happening

red cedar
#

Awwww :(

#

That's kinda messed up..

#

Then give us linq frfr

river imp
desert escarp
#

At least in an IEntity case

river imp
#

I've literally never used == null

#

For anything

desert escarp
#
IEntity radio = m_PlayerController.m_aRadios.Get(0);
if (radio == null)
  return;

Here it was

#

This was the case in which I had to use it

#

doing !radio for some reason did not return properly

#

Same thing for ray casts

#
            if (p.TraceEnt == null)
            {
                found = true;
                break;
            }

Works

            if (!p.TraceEnt)
            {
                found = true;
                break;
            }

Does not

red cedar
river imp
#

I've done plenty of traces and it's worked perfectly fine for me

desert escarp
#

Okay

river imp
#

Odd

desert escarp
#

I can try again, but I spent literal hours debugging that raycast for it to have been that

river imp
#

Keep doing whatever works for you. It's just odd that !object has always worked for me

desert escarp
#

Oh same, it works almost 100% of the time, in the case of TraceEnt was like the only time I specifically had to do == null for some odd reason. Makes no sense as !p.TraceEnt should do the exact same thing

minor agate
red cedar
minor agate
#

The controller and the controlled enitty

#

If you got the character entity, then it is the controlled entity

#

if you cast that entity to SCR_ChimeraCharacter

#

then you can access directly the controller

#

Which is where people usually add their components for controller logic

#
IEntity ent;

// Supposing ent is for sure ChimeraCharacter.
CharacterControllerComponent controller = SCR_ChimeraCharacter.Cast(ent).GetCharacterController();
red cedar
#

Ok. Thank you. I wasn't aware that we could find our playercontroller component in CharacterControllerComponent.

Ty^^

minor agate
#

I think you can, don't remember too well

#

let me check

red cedar
minor agate
#

Also it causes something we call callqueue explosion

#

Which is a big issue for us with mods and replication

#

as it stalls the replication threads

#

That and script invokers

#

which is why for A4 they are basically gone

red cedar
#

Hmm.. would it be wiser to then count timeslices even for "long" wait such as like 20 minutes?

red cedar
minor agate
#

You are receiving the latest Enf event system anyway at some point on AR

#

So you could use that which is not only faster, but clearer and with compile level errors for misconnections and recurssion issues

red cedar
#

That sounds great

minor agate
#

@red cedar The issue with the CallQueue you usually use is that it is global

#

Everyone adds things to it

#

whcih get checked every frame

#

the more you add, the worse it gets

#

at some point it explodes and stalls many things

red cedar
#

I've noticed that on populated server sometimes a scheduled call is dropped completely. Which i assume is what you're referring to as callqueue explosion?

minor agate
#

IF you really need CallQueue

#

Then just do anew callqueue instance and store it on a system

#

then tick it manually there

#

That would be better

red cedar
#

And would adding time slices every frame on a component until we reach a desired value be a bad practice or would it be alright?

I usually do that for clients sided code such as hud displays etc. But i'm not sure about server side and for longer periods

minor agate
#

Use systems

#

Issue is that having to tick for example 10 components is worse than ticking a single system

#

Also the process to decide what to tick from engine is not free

#

It's more efficient to use system

#

and more manageable for you as well

#

As you get a single point of control/update

#

Suddently if you want to connect those components updates to other updates, create dependencies, etc

#

you will heavily suffer with the component approach

fringe prairie
#

Not to sidetrack, sent you a DM Mario - no rush, just in case it got buried.

red cedar
#

Ok that's good to know. I was told to only use system for short periods.

Thanks a lot for your time Mario i really appreciate your clarification, i try to produce cleaner code so that's why sometimes i come up with those silly questions ^^

#

I'll also need to test out the CharacterControllerComponent approach to find my components and if it doesn't work i'll just keep using my helper functions

timid citrus
#

Anybody know where to work with the x/y green lines on the map widget for layouts?

#

And MapWidget.c is just generated basically empty script.

deft aurora
#

Hello, do you think it would be possible to have a script that would move a prefab from point A to point B following a spline?
I haven't been able to find an example.

molten glacier
#

I have a script that spawns artillery barrage immediately but I want to delay it from when it is called.

I tried calllater but it just doesn’t spawn then.

How do you do a delayed spawn?

undone patrol
open pier
# minor agate avoid periodical events on components

Avoided callqueue and did a tick system like this for anything that needs periodic updates, both are bad practice ;-;

Going to wait until the new event system is released though to change what I have. Thank you for the information on these

molten glacier
molten glacier
fringe prairie
#

System usage saved me lots of network traffic client side.

#

some things do need frame events though, you’ll never really have a perfect solution but a lot of big servers right now are having replication related stalling on Xbox as far as I can tell

#

Which leads to a 10 second freeze for clients when players join or leave, or shoot tons of rockets, because a lot of data is being streamed at one time

open pier
open pier
fringe prairie
#

And it definitely depends on what you’re doing as well. Let’s say it’s a state that all players should see, kind of makes sense to have the component frame for all clients, custom movement protocol would be a good example. Because that logic has to live somewhere, and if it lives on the instance which needs to be simulated, kind of makes sense.

Alternatively, if that state can be invoked (whereas you basically have a client ask “hey can I get this data”),using system to store that data and send it when needed, especially via player controller (once I learned about its power it became a god send), then you can really tighten network usage, send batch updates or filter updates per player as needed, or have system send component changes to components for storage via RplProp if it must be readily accessible without request by clients

open pier
#

A huge thing with the freezes too, it happened a lot on some sort of user action, gotta make sure to restrict the action to client or server where and when needed. Understanding replication made me understand that, there's 60 things being replicated when it should just be to the person using the action and the server, unless not

fringe prairie
#

Yeah server only actions are pretty much the way to go, I like client based without proxy for things which only the player sees (like HUD), that way you aren’t wasting network usage on worst case 128 transmissions of that data where it does not apply.

open pier
open pier
mental storm
#

would anyone here be so kind to possibly help walkthrough maybe guide me on setting up a proper vehicle the vehicle in question being the lifeboat from halo,

even if no help can be offered I woud like to ask questions (without flooding this chat) about whats possible and what isnt possible when it comes to it.

also should note I have no prior experience to setting any vehicles up, so any help is greatly appreciated.

open pier
mental storm
#

I thought it might be the best place due to the needs of the lifeboat, doesn't necessarily act like most vanilla vehicles in reforger do.

red cedar
#

I'm having a weird moment with tasks...

so i'm spawning the task but i can't seem to figure out why the name isn't being set properly.

 if(m_taskPrefab)
        {
            Resource resource = Resource.Load(m_taskPrefab);
            if(!resource)    {return;}
            
            EntitySpawnParams spawnParams = new EntitySpawnParams();
            spawnParams.Transform[3] = GetOrigin();
            
            m_taskEntity = SCR_TriggerTask.Cast(
                GetGame().SpawnEntityPrefab(resource, GetGame().GetWorld(), spawnParams)            
            );
            
            m_taskEntity.SetTitle(m_sMissionName); // doesn't work ?? or there is something i don't quite understand
            m_taskEntity.SetDescription(m_sMissionName); // works fine
    
        }

Thanks in advance ^^

open pier
torn bane
#

Good morning
Today's experimental update contains an inactive and not fully finished version of our new save game system. This is entirely incompatible with anything you might have built on top of the old scripted save manager core and it's associated JsonApi structs.

If you are super curious to see the new system and how it generally works you can search for "Persistence" as keyword in config and scripts later.

The more polished version with some API changes will come in another experimental update. Including full documentation and examples.

Anyone using my modded persistence solution: That should still work and I will give some migration examples, but I will deprecate it as soon as 1.6 hits stable as anyone will want to transition to the vanilla solution. It's > 100x faster than my mod with ~80% less memory consumption.

ocean kernel
#

Is new version also limited at funny 1 MB

grave rampart
#

Hi, is there any way to tell clients to connect to another server?

torn bane
grave rampart
#

🙁

grave rampart
torn bane
#

Maybe, it will require some additional user prompts to let them know and accept etc. It must be an active user choice if and where they want to connect. No chance of silently moving them onto another server instance for some sort of round based lobby server

grave rampart
#

yeah at the moment I display a message telling them to connect to <other server> but it's kinda high friction so just having them able to click "Ok" on a prompt would be a lot easier

fervent cedar
#

Anything 🙏

red cedar
torn bane
# red cedar Will we see improvement to the http client any time soon?

Not in 1.6 probably. the built in http database for persistence which I want to ship (in an even later exp) simply handles everything in gamecode. script raw usage of rest api is on the list but we have many pressing issues to deal with so it will take time until it is on the schedule

scarlet iris
torn bane
red cedar
scarlet iris
red cedar
# torn bane I am not sure what you mean.

Nvm i just realized that i should refactor my code...

I was reusing the same callback instance for all of my requests of the same type.

Could you just tell me wether it would be a bad idea or not to instantiate one callback instance per request?

torn bane
red cedar
#

Okk good to know.. currently i was adding the uid as part of the response and iterating through every player to see who has the uid from the response.

Thank you ^^

undone patrol
#

GetPhysics no longer works when referenced.
How can I correctly reference the new logic now?

boreal swan
#

Anyone making an open source RP gamemode here?

timid citrus
#

How long are we looking at until the new save system is in non experimental?

#

Need to plan if I should keep building my own persistence system or pause and wait to leverage this.

torn bane
timid citrus
analog python
torn bane
#

Known and fixed in one of the next updates

jade rock
#

Hello everyone. I'm trying to modify respawn behaviour. I have a mod that enables an Spectator mode. I want to launch the spectator mode for a player when is killed. How can I do it? Thanks!

candid skiff
#

Help please - i changing Transmittin range, save prefab and change in new by the Building conf list, but in game Conflict start - radio still have 2k range (base stay 1 m range), and some wear - in Tools - game it can work normal, but if im upload to WS and start game like DServer - that work like vanilla (2k range) - some one know how it works and how to do custom range wich will work?