#enfusion_scripting

1 messages · Page 8 of 1

torn bane
#

I am not sure what you mean. Communication with what?

opal robin
#

Is this some kind of setup? Or the command in the script ?

frail hound
frail hound
# torn bane I am not sure what you mean. Communication with what?

I'm need transfer data > 1mb, and yeah i can divide data, but I'm wondering how I can bypass the default buffer and network limits

(For example, use an additional application/agent that will read and write to a file, so that the Arma Reforger sends data through a file, and reads another to receive data)

frail hound
torn bane
torn bane
#

Though if you want to use http API there are still some limits which we need to remove in a future update

frail hound
torn bane
frail hound
rotund cape
#

New to scripting... how do I tag specific assets in a script?

hushed swan
#

Does anyone have any idea how I can block players from accessing the box here?

#

I've been trying a few ways, one of the ones I managed to do is remove the Universalinventory component, it really disappears from the TAB player but it also doesn't allow me to open the box.

#

If anyone has any idea how to do it

sweet badger
#

Not sure why the prefab has 3 inventory storage components.

hushed swan
#

When I do this I can't use the box but it goes out of view when the player presses TAB

#

Now I need to make the box work

sweet badger
#

It's a base component which should usually not be used directly

hushed swan
#

If I remove this component from the arsenal box there is an action script > open box and it doesn't work

sweet badger
#

Just use one SCR_UniversalInventoryStorageComponent

timid citrus
#

Is the bug that you have to restart workbench to clear some console errors known? Even if you fix the script and reload scripts it wont clear the console error half the time even if it is fixed until you restart workbench. Sent me on many a wild goose black rabbit hole chase until I figured it out a few hours ago.

#

Not sure if its new in the last patch or 2 or not.

#

Verified it 20x today though since I figured it out.

hushed swan
sweet badger
# hushed swan

Why do you even want a storage component that's not accessible by the player?

hushed swan
#

Basically some players are allowed to access via action "F", those who shouldn't have permission can enter via TAB

#

I definitely need to hide this arsenal presentation in the inventory TAB

sweet badger
#

Restricting the interaction is the wrong approach, you would want to inherently restrict storage access.

#

Read the SCR_UniversalInventoryStorageComponent class and its parent classes, they'll likely have some inventory rights related method.

timid citrus
#

Everon Life mod has EL_RestrictedInventoryItemComponent

#

I use it for a hidden cash slot that players cash goes into

hushed swan
#

oh

#

I will look at this mod to understand

#

I managed to make a script here UHULL, thanks guys

narrow aspen
#

guys what is the function to return all capture point militarybases of a faction?

ionic compass
#

Hey everyone,

I'm developing a radio jamming system and need some help with compilation issues.

System Goal & Approach:
The aim is to inject jamming audio into radio transmissions via the VoN (Voice over Network) system, effectively jamming frequencies for nearby players.

We're using:

RadioJammingComponent.c: Manages the jamming state, frequency, and range, orchestrating the overall process.
SCR_JammingVoNComponent.c: Inherits from SCR_VoNComponent. This component handles the actual audio injection. It creates a dummy BaseRadioMessage and uses the entity's BaseTransceiver to "transmit" it on the specified jamming frequency. On "successful transmission," it plays a designated jamming audio file.
We believe this approach should work because by using BaseTransceiver to perform a "transmission," we leverage the game's existing radio propagation and reception mechanics. This should allow nearby radios on the same frequency to "receive" our jamming signal and play the associated audio.

Current Problem: SCR_VehicleRadioJammerInteractionComponent.c See Errors.txt
I'm facing multiple compilation errors in SCR_VehicleRadioJammerInteractionComponent.c, which is a ScriptedUserAction to toggle the jammer from a vehicle. The errors are primarily "Broken expression (missing ';'?) " and "Expected ',' or '}', not a ';')".

To help debug, please see the attached text file Errors.txt for the full list of compilation errors and the content of the SCR_VehicleRadioJammerInteractionComponent.c file itself as well as the other two scripts.

Any insights or suggestions for fixing these syntax errors, or improving the ScriptedUserAction implementation, or perhaps a better method to achive my goal would be greatly appreciated!

spark otter
narrow aspen
spark otter
#

yep i do similar stuff with a good ol foreach!

#

How would I search for nearby rocks and trees, FindEmptyTerrainPosition does not seem to be doing a very good job with that. Im using TraceFlags.ENTS, should I be using TraceFlags.WORLD?

#
SCR_WorldTools.FindEmptyTerrainPosition(pos, pos, 25, 4, 4, TraceFlags.ENTS, GetGame().GetWorld());
```  maybe this is the issue, it doesnt find a spot in the areaRadius? ```c
 \param[out] outPosition Variable filled with found position. When none was found, areaCenter will be filled.```
#

Ill try to increase the radius for better results i guess

spark otter
#

On another topic, if I script a live mine on a road and then use ```c
void RequestNavmeshRebuildEntity(IEntity entity)

gritty timber
#

What function/class is used for when a base is being captured?

teal vapor
#

ShowTaskProgress might not be exactly it, but that should be a decent starting point. Otherwise you can open the diag menu (win + alt + control), disable localizations, and find the capture progress localization id to point you in a better direction

spark otter
spark otter
ocean kernel
#

spawn a dummy entity with a huge collider

#

request rebuild

#

swap with mine

#

?????

#

but if this works then you gotta remember to rebuild again when entity dies?

spark otter
#

thats not a bad idea hahah

#

yeah i suppose so

ocean kernel
#

I guess you could skip the swap part, the huge collider entity could be a child of the mine prefab then gets deleted after rebuild

spark otter
#

yeah ill have to try something like that tomorrow night, im headded to bed! 💩 😴

ocean kernel
tough cave
#

arsenal refund (selling back) calculates weapon attachments supply refund value twice because it sees them as both attachments (additional cost / value) and items in storage. solved by just ignoring storage inside when it comes to weapons, which is better than allowing supplies to be exploited.

narrow aspen
rotund cape
torn bane
ionic compass
quiet drift
#

Hello, I have a technical question, I created a modded class of PlayerController, the amount of features made the script become quite big for me and it would be easier to separate things into several files, will it cause problems if I make between 4 and 6 modded classes of PlayerController?

#

I guess there is a way to create methods in separate files that I could call from the PlayerController, would that be better than stacking modded classes or does it not change anything?

minor agate
#

As every modded class counts as a new inherited class, and each super in there counts as new context and extra script method calls. Which are expensive.

frail hound
#

Why it's so strange;

TestDto test = new TestDto(
    "test123",
    "test",
);
test.Init();


test.Pack();

Print(test.AsString());
Print(test.param1);
SCRIPT       : {"param1":"€d6\u000E?\u0002","param2":"€d6\u000E?\u0002"}
SCRIPT       : string param1 = 'test123'
SCRIPT       : ScriptDebugger: remote script executed successfully.
class Any: JsonApiStruct {
    
    void Init() {
        typename variableType = this.Type();
        int variableCount = variableType.GetVariableCount();
        for(int i = 0; i < variableCount; i++) {
            RegV(variableType.GetVariableName(i));
        }
    }
}
class TestDto: Any {
    static string param1;
    static string param2;
    
    void TestDto(
        string param1,
        string param2,
    ) {
        this.param1 = param1;
        this.param2 = param2;    
    }
}
frail hound
frail hound
torn bane
#

yes

frail hound
# torn bane yes

But i need unique methods for get value by field...
After all, my wish is an auto serializer of any object inherited from a special parent... Will it work?*

frail hound
frail hound
# torn bane yes

But thank u very much, it's looks more interesting than JsonApiStruct

torn bane
#

yes it can automatically handle custom structs with nested complex properties also etc

#

jsonapi struct is mainly used for fixed simple json we use to communicate with backend services

frail hound
# torn bane yes it can automatically handle custom structs with nested complex properties al...

I just don't quite understand how i will desiarilize to object... When i need use some of typename.GetVariableValue...

i can't get pointer to value to use as a parameter for reading from context

SCR_JsonLoadContext loadContext = new SCR_JsonLoadContext();
loadContext.ImportFromString(dataString);

string stringValue;
int integerValue;

// order does not matter for JSON as it uses key names
loadContext.ReadValue("key2", integerValue);
loadContext.ReadValue("key1", stringValue);
torn bane
#

ah i see you are still trying to implement an any type. forget about that. it will not work. i tried before

#

Either way if you want to try and continue and find out yourself, you can simply read and write an object as a whole with ReadValue("", objectVar)

frail hound
pliant ingot
frail hound
pliant ingot
#

Just beed to write function that will create instance and get all values from json object

frail hound
#

when you're have object, easy serialized from JsonSaveContext, but when u try deserialize, u can't desirilze into object...

class MyObj {
  string param1;
}

string test = {"param1": "test123"}

u can't set field into MyObj like

MyObj newObj = new MyObj();
typename type = MyObj.Type()
string varName = type.GetVariableName(0);
typename varType = type.GetVariableType(0);
auto varValue = varType.Spawn();

type.GetVariableValue(newObj, 0, varValue);

you don't get any value or reference because auto doesn't work in this context

torn bane
#

You can not spawn primitives, only complex classes. and you can not hold a complex and primitive type in the same wrapper. as complex needs strong reference, primitive CAN NOT have one.

#

you must setup template magic for each of the primitive types and then Class or better Managed for holding any non primitive

frail hound
minor agate
#

just do ""

#

Or am I missing something?

torn bane
#

You will have to check the varType and depending on each result return a primitive any wrapper type from some sort of factory method ... i dunno it was all so against everything the script language was made for that i gave up on making one type to rule them all

minor agate
#

Yeah the language is supposed to be strong typed

#

so better to forget trying to stay away from that

#

It wil just make everything harder and slower

#

.Spawn(); was supposed or planned to be removed iirc btw

frail hound
minor agate
#

Generalism usually means bad solution

#

But I guess it is hot topic

frail hound
#

If there was minimal access to getting the field reference, that would solve everything

minor agate
#

Depends on what you want to do

torn bane
#

If I had my ways we had more dynamic reflection coding already, but I fear the things I myself will create with them 🙂

minor agate
#

Generalism is often extremely bad for performance, and maintenance in many cases

torn bane
#

BUT IT LOOKS COOL!

minor agate
#

But it has its nice aspects too

#

As everything it must be used WHERE it actually makes sense

frail hound
#

I mean, it's not about u...

#

It's like - user don't know how to use right

#

Sorry for my eng 😅

minor agate
#

I have done my fair bit of misuse of reflection too

frail hound
dark ocean
dark ocean
frail hound
#

@torn bane

What are u think?

class SConverter {
    
    static void ReadObject(string json, Dto obj) {
        SCR_JsonLoadContext ctx = new SCR_JsonLoadContext();
        ctx.ImportFromString(json);
        if(!obj.IsInherited(Dto)) {
            return;
        }
        
        typename objType = obj.Type();
        int variableCount = objType.GetVariableCount();
        for (int i = 0; i < variableCount; i++) {
            typename variableType = objType.GetVariableType(i);
            auto value = variableType.Spawn();
            
            string variableName = objType.GetVariableName(i);
            objType.GetVariableValue(obj, i, value);

            if(variableType == SString) {
                ctx.ReadValue(variableName, SString.Cast(value).value);
            }
        }
    }
}
string json = "{\"param1\": \"test\"}";

ref TestDto testDto = new TestDto();

SConverter.ReadObject(json, testDto);

Print(testDto.param1.value);
SCRIPT       : string value = 'test'
SCRIPT       : ScriptDebugger: remote script executed successfully.
rotund cape
#

How do I tag assets in a script?

ocean kernel
#

I would like if bohemia allowed us to use keywords only they can use like passing functions as parameters, or storing functions in variables

minor agate
#

Its only a thing from CPP

ocean kernel
#

CallLater can accept function as parameter

minor agate
ocean kernel
#

Pretty sure I use it in script

#

See wat I did there

minor agate
#

Yes. But the system was defined in cpp

ocean kernel
#

I'm sure you could make it work if you wanted

red cedar
#

I had a question regarding the guidelines about modding.

So i'm working on a game mode which is fully dependant on my API, the thing is.. for obvious reason the endpoint and logins info are not saved in the mod.

Am i allowed to make it so that the gamemode does not start when the authenthification failed ? or should i implement some kind of minimal compatilibity in case if the authenthification fails ?

tough cave
#

UpdateLimited / AddMode in SCR_EditorManagerEntity is one of those infinite recursive scriptinvokers still, on server anyways when running peer tool, u can't #login on the non-workbench client without triggering it

ocean kernel
#

It's not recursive anymore because it's canceled by the VME wicked

frail hound
#

is there any way to get metrics in milliseconds for an operation?

coarse pasture
red cedar
coarse pasture
red cedar
#

Ok thank you, i was not aware of the existence of this channel.

coarse pasture
rapid ferry
red cedar
#

Ok so RequestClose should be fine

slate raft
#

How can I force BaseInventoryStorageComponent.GetAll to always work on peer? I've noticed that it only returns something if peer has opened the inventory UI recently, and then disappears again after some time. So there must be some lazy replication going on.

dark ocean
delicate crane
#

Has anyone messed with using chatgpt to script for enfusion?

ocean kernel
red cedar
ocean kernel
red cedar
#

ok lol. Sounds good, thanks for the info 👍 .

rotund cape
#

Me again... How do I tag/reference assets/prefabs in a script?

ocean kernel
#

How do I make the script editor not take 15 seconds to focus when having more than a dozen mods loaded in WB?

hushed swan
#

Today we have solutions to allow a map rotation or vote to occur, without having to restart the server, and that does not cause Jeep ERROR?

#

Today we know that a server with many players, when finishing the map, is having to restart the server with the new map, because the scenario reload and map voting end up giving Jeep Error

severe jolt
#

does anyone know if the RestApi is also available for consoles or just PC?

kind widget
pale cosmos
#

is there a concept like setting/getting variable on a namespace (like a specific entity) during game runtime in enfusion, similar to a3 setVariable/getVariable?

minor agate
red cedar
#

This was before your clarification ^^

pliant ingot
desert escarp
#

The minute I moved those to a different part of my drive so the WB only used what I downloaded from the workshop and therefore can't edit it is when the performance fixed itself

#

This was 2-3 months ago so it may have changed since then tho test it out

foggy swift
hushed swan
#

Does anyone have any idea how I can set a player in the preferred queue?

spark otter
#

thats also not scripting

spark otter
#

Does RequestRoadNetworkRebuild() work? Im spawning in a building and using that function to try to get AI not to drive over scripted mines, but they just keep driving straight into them.

vital pasture
#

Does anyone know where I can find a script or something to do adding props inside houses?

lethal thistle
#

Hello, can anyone help me with Kodiis Building System?

I can build, the file is written but when I start it again the objects are not displayed in the game, I have already checked and it is as if the game could not read it to load. But everything is "fine"

fringe prairie
random cloud
#

Has anyone resources/videos to get into reforger modding (scripting). I have Development exp. But not in games. And I can’t get into by my own. Has anyone some helpful links? How to script UI interfaces e.g. or mod configs to limit spawns etc.

#

I tried to study the wiki but after the tutorials I still dont know where to do what.

fringe prairie
#

Let's start with asking what you want to do

random cloud
#

I would say I‘m a total beginner in game scripting. I wrote a little mod for cyberpunk but arma is more dev friendly 😉

#

I have two things for now. I want a simple UI window with info when a player spawns. And the second thing is to save/ make some things persistent when the server restarts

#

And later I would to do something where the player can interact with. Like a UI with buttons

#

So the UI thing should be easy. The. Persistent part needs a DB and a connection from the game to it. How can I connect the game with the DB on my server

#

If you think this is a bit to ambigues for beginners, I would be fine with some other ideas to learn

midnight talon
#

IIRC Arkensor said some similar functionality will be added as Vanilla and EPF will be deprecated eventually but if you just want most things persisted in a FFA game mode it's the easiest way to get that up and running currently

midnight talon
random cloud
#

@midnight talon thanks. E.g. when I want to write class that sends the info to the db. How can I add this class or where I need to add this class? To an event when a player does something?

midnight talon
narrow aspen
dapper kernel
#

Hey fellas, i'm having issues with the code below. I'm getting an error that reads "Scripts/Game/Character/WZ_AltitudeSick.c(16): error: Can't make callback from unknown method 'radius'". I have tried multiple times to define Radius as a float value of 10000.0 both in a separate declaration, and in the actual parameters for the QueryEntitiesBySphere function.

// comment
world.QueryEntitiesBySphere(foundEntities, "0,0,0", radius, EQueryEntitiesFlags.DYNAMIC, SCR_ChimeraCharacter);
median sparrow
#

player lock

forest arrow
#

Hello. I have AreaClear to set task to kill all enemies in area. But after finish I want to call script method created by me (just call a custom script). How can I do this? I'm using SlotClearArea from ScenarioFramework

random cloud
ocean kernel
#

How can I listen to animation events in my script?

minor agate
#

Is it a vehicle, character, ai, clothes, gun, gadget, etc?

ocean kernel
#

I found it in character controller 😄

pliant ingot
#

GetWorldTime() is in sync with server for clients?

hushed swan
river imp
hushed swan
#

even if I use the admin logic that already has priority and try to remove the GM ?

river imp
hushed swan
#

I imagined it had

river imp
#

They can't be modified by scripts.

#

That is how you give people priority in the server join queue.

ocean kernel
#

Whats the best way to get where the eyes of a character are pointing? Look direction? Head aiming component only gives heading or something wrong with what I'm doing

#

lmao nvm it has GetLookAngles lets give that a shot

hushed swan
ocean kernel
#

I'm applying transform to a bone and the angles are kinda multiplied by 2

#

Just want to copy world transform of one bone and paste into another

minor agate
#

So if you really want what the eyes point to, you have to get the transform of the eye bones

ocean kernel
#

I have the direction now which is correct, but it seems it's not possible to force a bone to have the same transform as the one I want because angles get multiplied by 2 or whatever

#

I turn 90 degrees and the bone turns 180

minor agate
#

Are you using correct units?

ocean kernel
#

I am using GetTransform and SetTransform

minor agate
#

Are you using correct units?

ocean kernel
#

You tell me, is SetBoneMatrix local or model space?

minor agate
#

That is the space, not the units

#

Are you handling angles at any point?

#

Then converting to matrix transform?

ocean kernel
#

No.

minor agate
#

What are you doing?

minor agate
ocean kernel
#

I have two bones. I want bone 2 to have same angles as bone 1. So I tried Get...Matrix and Set...Matrix and angles of bone 2 multiply by 2

minor agate
#

Just beware, that what is front for you might not be the front axis of the bone

#

See what they are in the skeleton preview on the xob

ocean kernel
#

Its my bones lol

minor agate
#

Select the bone, see orientation

ocean kernel
#

Everything is fine except looking around multiplies its angles by 2

minor agate
#

I am telling you because this is always cause of "issues" when people are trying to deal with transform of bones

ocean kernel
#

Actually I lied. My source matrix comes from PointInfo with one of the other bones as pivot.

minor agate
#

also show code

ocean kernel
#

This gets me the correct world space and model space matrix

minor agate
#

Can't really help without seeing the setup, and code

#

Whatever you have there affects whatever we might provide you

tough cave
#

do you have to mess with the sound component to stop a vehicle horn, including over the net? CharacterInputContext methods not a help. I used action listeners, but it was messy because setting the value to off / zero makes the listener retrigger, which isn't true to the state of the button (still held). extra timers are needed to track and ignore some the retriggering.

ocean kernel
#

This is the code

m_AimPointBase.GetModelTransform(m_vAimPointBaseMatrix);
m_vAimPointBaseMatrix[3] = vector.Zero;
m_Animation.SetBoneMatrix(this, m_Animation.GetBoneIndex("RightHandProp"), m_vAimPointBaseMatrix);
forest arrow
#

I have ScearioFramework area created, but want to disable it by default to do not spawn\create inside world, then from script create\spawn it with all childs and despawn\delete when I need also from script using SCR_ScenarioFrameworkArea

How its possible?

scarlet iris
forest arrow
#

Okay. But I can use it to spawn childrens later, right?

#

and despawn too

scarlet iris
forest arrow
#

Okay, so I need to play with activation\deactivation, to control spawn of children units

scarlet iris
#

yes and if you want to control spawning and despawning dynamically you have to activate Dynamic Despawn on the layer or slot and on the game mode config

forest arrow
#

Yes, but it will do it automatically based on player position\camera. I want to control it manually. Now I configured Activation condition for Area and control it by variable value. SetVariable and then Area.DynamicInit() to reinit it with new variable value.

But it doesnt work when I want to deactivate Area. Area is still active. Why?

I can activate it by set variable to 1, but cant deactivate by set variable to 0

ocean kernel
#

Lol CharacterHeadAimingComponent.GetAimingDirectionWorld() only returns aiming direction across one axis

#

Wait no it gets worse

forest arrow
#

Cant understand how to despawn. I have few Area. Each contains layer with childrens Slot or SlotAI.
I want from script spawn childs for Area1 or Area2.
For example when I'm typing command to chat, I want to spawn\activate Area1 childs. Then from next command remove from map\despawn\deactivate all childs from Area1 and spawn\activate all childs from Area2

Cant find a way to do it. In docs cant find method how to control it for Area\Layer

shy steeple
# dapper kernel Hey fellas, i'm having issues with the code below. I'm getting an error that rea...

BaseWorld.c

/*!
    Query for entities touched by sphere.
    \param center
    Center of sphere
    \param radius
    Radius of sphere
    \param addEntity
    Callback method. called when another Entity is intersected during Query methods.
    \return Return true, when query should continue, False when you want to quit query call.
    \param filterEntity
    [optional] Callback method. Called when another Entity is encountered during Query methods.
    Some light-weight filtering could be implemented here, prior to    intersection test \return True when entity has to be further tested, False otherwise
    \param queryFlags Various flags See EQueryEntitiesFlags
    \return
    False when query was canceled.
    */
    proto external bool QueryEntitiesBySphere(vector center, float radius, QueryEntitiesCallback addEntity, QueryEntitiesCallback filterEntity = null, EQueryEntitiesFlags queryFlags = EQueryEntitiesFlags.ALL);

Isn't foundEntities not a valid parameter? Hence it is reading center=foundEntities, radius=``"0, 0, 0"`

hushed swan
#

Does anyone know why this error occurs and disconnects?

fervent cedar
dense snow
#

Does anyone have info or script on whitelisting doors to individuals?

coarse pasture
#

But we have the same issues, so might honestly be vanilla

fervent stirrup
#

Just ran into this, think I see why

Replication.IsServer() returns true on peer tool client

static vale
fervent stirrup
#

Is there any way to allocate more static memory to a ScriptModule?

ocean kernel
#

which script specifically handles camera position/movement when character moves around? in third person

ocean kernel
#

oke doke

forest arrow
#

I’m using AudioManager.PlaySound()
In WB works fine, but on server can’t hear sound. As sound using default sirens, not mods or custom uploaded

fervent cedar
# ocean kernel which script specifically handles camera position/movement when character moves ...

class CharacterCamera3rdPersonBase

    //-----------------------------------------------------------------------------
    override void OnUpdate(float pDt, out ScriptedCameraItemResult pOutResult)
    {
        pOutResult.m_vBaseAngles = GetBaseAngles();
        bool isLinked = m_CharacterAnimationComponent.PhysicsIsLinked();
        
        //! update fov
        m_fFOV = GetBaseFOV();
        
        //! yaw pitch roll vector
        vector lookAngles = m_CharacterHeadAimingComponent.GetLookAngles();

        if (!m_bIgnoreCharacterPitch && !isLinked)
            lookAngles[1] = lookAngles[1] + m_OwnerCharacter.GetLocalYawPitchRoll()[1];

        //! apply to rotation matrix
        Math3D.AnglesToMatrix(lookAngles, pOutResult.m_CameraTM);
                                
        //! base bone pos 
        if (m_iBoneIndex != -1)
        {
            vector boneMatrix[4];
            m_OwnerCharacter.GetAnimation().GetBoneMatrix(m_iBoneIndex, boneMatrix);
            pOutResult.m_CameraTM[3]    = boneMatrix[3];
        }
        else
        {
            pOutResult.m_CameraTM[3]    = "0 0 0";
        }

Do you mean this part?

#

What devious things is bacon doing with the camera??

fluid sierra
#

Has anybody made a script for conflict game mode where players get rewarded for repairing vehicles? Also rewarding players for decommissioning random spawn vehicles not ones that are spawned in by players

dense snow
#

Does anyone have any script for a RP life server?

minor agate
ocean kernel
#

I actually just needed the third person camera to behave for testing, in published mod it wont be used

fringe prairie
#

SoundEvents are pretty easy to use imo, if your usage allows it

coarse pasture
ocean kernel
#

You can get current active camera from the World

serene fox
#

Hi, what does this means and how i can fix it?

2025-06-06 21:09:02:  WORLD        : Frame
2025-06-06 21:09:02:   SCRIPT    (E): Virtual Machine Exception
------>  2025-06-06 21:09:02: Reason: ScriptInvoker: Recursive call of Invoke!
2025-06-06 21:09:02: Class:      'SCR_HelicopterDamageManagerComponent'
2025-06-06 21:09:02: Function: 'Invoke'
2025-06-06 21:09:02: Stack trace:
2025-06-06 21:09:02: scripts/GameCode/Components/SCR_DamageManagerComponent.c:1311 Function OnDamageStateChanged
2025-06-06 21:09:02: scripts/Game/Modded/REAPER_DamageManagerComponent.c:131 Function OnDamageStateChanged
2025-06-06 21:09:02: scripts/Game/Components/Damage/SCR_VehicleDamageManagerComponent.c:1657 Function OnDamageStateChanged
2025-06-06 21:09:02: scripts/Game/Components/Damage/SCR_HelicopterDamageManagerComponent.c:33 Function OnDamageStateChanged
2025-06-06 21:09:02: scripts/GameCode/Components/SCR_DamageManagerComponent.c:520 Function Kill
2025-06-06 21:09:02: scripts/GameCode/Components/SCR_DamageManagerComponent.c:1311 Function OnDamageStateChanged
2025-06-06 21:09:02: scripts/Game/Modded/REAPER_DamageManagerComponent.c:131 Function OnDamageStateChanged
2025-06-06 21:09:02: scripts/Game/Components/Damage/SCR_VehicleDamageManagerComponent.c:1657 Function OnDamageStateChanged
2025-06-06 21:09:02: scripts/Game/Components/Damage/SCR_HelicopterDamageManagerComponent.c:33 Function OnDamageStateChanged
2025-06-06 21:09:02: scripts/Game/Components/Damage/SCR_VehicleDamageManagerComponent.c:1629 Function ProcessCollision
2025-06-06 21:09:02: scripts/Game/Components/Damage/SCR_VehicleDamageManagerComponent.c:1485 Function OnFrame
forest arrow
timid citrus
#

Is there a channel I can drop a link to my debugging console errors video?

#

I'm sure it will be quite helpful to many members of the community.

teal vapor
serene fox
timid citrus
#

Already tried deleting and rebuilding fresh script

tame sequoia
#

Try adding ; on the last }

west prism
#

how to get remote console to work

#

SCRIPT : ScriptDebugger: remote script executed successfully.
SCRIPT : ScriptDebugger: remote script executed successfully.
SCRIPT : ScriptDebugger: remote script executed successfully.

#

i'd really love to know how the fuck it's doing this when i don't even have the game open

#

😹

clever oxide
#

your code is null safe 😉

minor agate
#

And the script debugger is connected to it by default

craggy jolt
#

Any idea of ETA for supply becoming very laggy over time fix to reach stable? Really needed on public vanilla servers.

high hawk
#

Why after every update/every new project i create peer tool is just a hassle to setup, I hope whoever made it this difficult gets sand in their socks

high hawk
#

Was there somewhere in the debug menu to display rplids? I cannot find it thisisfinebetterttv

timid citrus
#

https://youtu.be/R8QjnL3HBwI

20 minutes of super fun debugging workflow. There are several good tips and quirks in there that I run into during it show how to deal with. If not allowed delete or tell me a better channel to post in. Peace.

Debugging 101 For Enfusion Arma Reforger Tools + ChatGPT

Tips if you feel so inclined. Every dollar goes towards me not having to take other work so I can do this stuff more.

https://andeerockgaming.tip4serv.com/

▶ Play video
high hawk
timid citrus
# high hawk Appreciate it, hope the 20 mins is worth it

For sure. You will get the gist in the first couple minutes but watch all the way through if you want to see the little quirks that you might run into so you don't have to chase them for hours and hours like I did before you figure it out.

wooden cape
#

This is a new one. Any ideas?

#
21:01:28.961  RPL          : rpl::Pip::ProcessNetToGame
21:01:28.961   RPL       (E): Item was removed from replication on local machine but there are still RPCs targeting it. This may be sign of very serious issues! itemId=0x800102A7, identity=0x00000000, rpc='Rpc_ProxyIncrementalUpdateCtrl_BCNO'
21:01:28.961   RPL       (E): Item was removed from replication on local machine but there are still RPCs targeting it. This may be sign of very serious issues! itemId=0x800102C7, identity=0x00000000, rpc='Rpc_ProxyIncrementalUpdateAnim_BCNO'```
ocean kernel
#

WTF

#

Why is entity with rplcomponent transform different on client than on server

#

It seems like on client "Auto Transform" is always on

#

???

#

Or maybe I am the bug here

#

Actually I am not the bug, when entity is streamed in it's like Auto Transform is checked 😦

ocean kernel
#

what is this

#

and why it only happens in peerclient never on server (wb)

#

Crash GUID 14cdf452-dc95-4e18-8158-7addcd7e952d and 2de29bdc-0cd5-4de9-a014-ef63ee467fb7

#

Blockers, can't release mod until it tells me what is wrong

timid citrus
#

I'm just amazed you actually got the peer tool working. I gave up way too much of a hassle for what it is.

#

I'm sure I can get it working if I wanted to put five or ten hours into it , but no thanks.

#

Hopefully that will be the biggest priority for That position they have open.

river imp
timid citrus
#

They own the engine and the game. It should be a lot more streamlined.

#

Is that the shitty tool you would make if you were doing it?

#

And it's not that hard you're right but it's just annoying having to find the right parameters and all that stuff when it's unnecessary really.

ocean kernel
#

I guess I will not release this mod because the game throws errors without telling me what went wrong and crashes, guess I've wasted another saturday on trying to make a mod

#

It's a bit weird how it only does it when a client gets involved but I guess since the logging is desinged to be as unhelpful as possible I will not be finding out what goes wrong

pliant ingot
ocean kernel
#

I can't believe that modern software would require me to press completely random buttons to fix a problem, apparently logging what is wrong is impossible in 2025

vernal moat
#

is there a string or smth helper to retrieve UID from resource name ?

#

"{GUID012345678910}Prefabs/Characters/Factions/Faction/Character_FactionName_NLAW.et"
-> {GUID012345678910}
with or without brackets dont care and im lazy

ocean kernel
#

Just substring it

vernal moat
#

i found FormatResourceNameToUserFriendly() and hopped 😄

pliant ingot
vernal moat
pliant ingot
#

And path part with ResourceName.GetPath

dapper kernel
#

Hey fellas, what function are we using to deal direct damage to a player through a ScriptComponent, if any?

#

Im working on, and very close to finishing, a Script to simulate Hypoxia during freefall, and the only part of it left to sort out is to cause the player to actually take damage when their oxygen gets low.

pliant ingot
#

on DamageManagerComponent

#

just make DamageContext and call it

dapper kernel
ocean kernel
#

Wow now it just freezes, not even any errors

minor agate
#

Mins have to always be less component wise than respective maxs components

#

Mins[n] < Maxs[n]

severe jolt
#

EDIT: nvm I think it's a me issue

vernal moat
#

share more or we cant help

severe jolt
# vernal moat share more or we cant help

I think I figured out the issue but I for sure hate this compiler... it doesn't show the errors like gcc or clang and it's very confusing when coming from actual c++...

dapper kernel
#

Anyone ever use the CharacterMovementComponent in script? It seems to crash workbench anytime I try to attach it to the base player

tough cave
#

SCR_CampaignFaction used inconsistently in SCR_CampaignBuildingEditorComponent. some code was changed to use SCR_Faction, but not all.

fervent stirrup
#

Is it possible to check if a define is set at runtime without the preprocessor?

static vale
desert escarp
#
override void OnPostInit(IEntity owner)
    {
        SetEventMask(owner, EntityEvent.POSTFIXEDFRAME);
        SetEventMask(owner, EntityEvent.SIMULATE);
        m_InputManager = GetGame().GetInputManager();
        
        m_InputManager.AddActionListener("DroneUp", EActionTrigger.VALUE, DroneUp);
    }
    
    override void EOnSimulate(IEntity owner, float timeSlice)
    {
        vector upThrust = vector.Up * m_iCurrentThrustRPM;
        if (m_iCurrentThrustRPM > 0)
            Print(upThrust);
        owner.GetPhysics().ApplyForce(upThrust);
    }
#

Any reason why whenever I change the thrust here it just stops running the EOnSimulate member

#

What's even weirder is this worked once and then never again

#

No change

#

Twas the EventMask it seems

ocean kernel
ocean kernel
#

It doesnt matter now since the mod freezes client now

high hawk
#

I know I'm pushing the boundaries of cyber bullying, but I do hope whoever made UX for peer tool steps on Lego's (yes, plural, I'm mad).

pliant ingot
#

It's possible to use ScriptBit* for your own Rpc function? So you can encode delta of some complex data and decode it on receiver side rather sending entire instance or calling multiple Rpc functions for each changed property?

high hawk
#
17:45:26.000  NETWORK   (V): RplConnection::Rpc_Validation_S sent
17:45:26.091 RPL          : ClientImpl event: disconnected (identity=0x00000000), group=4, reason=2
17:45:26.091 NETWORK   (V): RplSession::RplRuntimeEvent: Error
17:45:26.091 NETWORK   (V): RplSession::RplRuntimeEvent: Disconnect
17:45:26.091 NETWORK   (V): RplSession::Terminate
17:45:26.091 RPL          : Pip::Terminate
17:45:26.091 RPL          : IReplication:: Terminating
17:45:26.192 RPL          : Pip::Destroy
17:45:26.193 NETWORK   (E): Unable to connect as client to ''
17:45:26.294 PLATFORM  (D): Steamworks: SteamAPI_Shutdown()
17:45:26.391 ENGINE    (E): Unable to initialize the game
17:45:28.878 INPUT     (V): InputManager: deactivated
17:45:28.883 NETWORK   (V): RplSession::Deleted
17:45:28.904 ENGINE       : Game destroyed.
17:45:28.904 DEFAULT   (D): HttpClient::Cleanup() HR = 0 
17:45:28.925 RPL          : Pip::Destroy
17:45:28.935 AUDIO     (D): Audio loop exit

how does one simply figure out wtf is wrong with peer tool frogthinking

#

Swap projects, and budda bing budda boom we are no go on the peer tool working again. Probs easier for me to publish and test

fervent stirrup
#

I have a script that looks for all entity catalogs from all loaded addons, works perfectly reads all the prefabs.

EXCEPT catalog.GetCatalogType() will ONLY return 0 or 100, even though its going over containers with other values. E.g.

Resource res = BaseContainerTools.LoadContainer(resourceName); // resourceName is the .conf file
if(!res || !res.IsValid())
    continue;
                
BaseContainer container = res.GetResource().ToBaseContainer();
if(container.GetClassName() != "SCR_EntityCatalogMultiList" && container.GetClassName() != "SCR_EntityCatalog")
     continue;
            
SCR_EntityCatalog catalog = SCR_EntityCatalog.Cast(BaseContainerTools.CreateInstanceFromContainer(container));
catalog.InitCatalog();
                
Print(resourceName + " , " + catalog.GetCatalogType());

I wonder if its some magic here or something im missing

[BaseContainerProps(configRoot: true), SCR_BaseContainerCustomEntityCatalogCatalog(EEntityCatalogType, "m_eEntityCatalogType", "m_aEntityEntryList", "m_aMultiLists")]
class SCR_EntityCatalog
{
    [Attribute("0", desc: "Type of the Catalog", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EEntityCatalogType))]
    protected EEntityCatalogType m_eEntityCatalogType;
#
{3B679F1799D55F6F}Configs/EntityCatalog/USSR/Characters_EntityCatalog_USSR.conf , 0
trim sail
ocean kernel
#

Wait until you have to create an entity that's visible in game master. For a character, you need to set its faction to match your faction in three different places plus you also have to set it in three places inside the group prefab if you haven't done it already

#

If you expect that the Faction Affiliation Component would be the only place this information is stored in, you're wrong. It's also in two places in another component.

desert escarp
#

How do I use action listeners to influence in EOnSimulate

#
override protected void UpdateLocalPlayerController()
    {
        InputManager inputManager = GetGame().GetInputManager();
        super.UpdateLocalPlayerController();
        
        inputManager.AddActionListener("DroneUp", EActionTrigger.VALUE, DroneUp);
        inputManager.AddActionListener("EnterDrone", EActionTrigger.DOWN, EnterDrone);
    }
    
    void DroneUp(float value, EActionTrigger reason)
    {
        SAL_DroneControllerComponent.Cast(GetGame().GetWorld().FindEntityByName("drone").FindComponent(SAL_DroneControllerComponent)).DroneUp(value);
    }
#

Adding a Print statement in DroneUp makes this work due to the delay its adding but how do I do this naturally

coarse pasture
#

Too much going on in the backend and on the client to get it working properly

desert escarp
#

If I restart the workbench it works

#

But then if I reload the scripts it no longer works

#

what the hell

ocean kernel
#

Is there a function somewhere that will do something like "go into game master, then focus camera there"?

desert escarp
# desert escarp what the hell

Ended up just being whatevers going on in the background of the engine, offloading all my members for input into EOnFrame fixed this

main crescent
#

have a question not sure if possible lets say there are multiple towns or locations on map is it possable for an object lets say a car to randomly generate in one of those location each match

dire sinew
ocean kernel
#

I imagine you'd want to change the player's faction as if they selected it in spawn menu? Not sure where that's stored

dire sinew
ocean kernel
#

Aha, there we go

#

Easy peasy

dire sinew
#

Had to figure that one out when I tried to fix the reconnect component not properly restoring the player's faction for my marker mod 🙈

dire sinew
ocean kernel
#

Yeah I was just hoping I don't need to make a mess with calllater

dire sinew
#

Or a static method on the editor camera to pass its initial position that should get set on init.

coarse pasture
#

I more or less do that with my GM Tools #mc command. If its typed in by an admin, it will put them into gm mode and then move to the camera to the target location

#

SCR_ManualCamera and SCR_TeleportToCursorManualCameraComponent

elder lichen
#

Hey guys, is there a way to change an emat UV offsets using scripts within the game?

pale cosmos
#

Is there a way to show a hint to all players on a dedicated server?

midnight talon
# ocean kernel Yeah I was just hoping I don't need to make a mess with calllater

could probably add some kind of "deep link" logic to GM mode by adding a public property for the focus target position, override the GM mode open method to call same focus method F keybind does on that position after opening if it's set. Then from your context outside GM mode you just set that new prop on GM mode entity/component and open it directly

midnight talon
#

Oh, SCR_EditableEntityComponent so it shows as correct faction entity in GM mode?

dire sinew
#

Third place is probably on the group that is used for AI joining you, but that might be handled automatically when assigning a player group.

midnight talon
dire sinew
#

Just create and assign a new player group and you should be fine I guess.

midnight talon
#

Yeah for group creation at least it's all handled automatically in groupsManager.CreateNewPlayableGroup(faction)

coarse pasture
#

If the player is not controlling a character when its triggered against them (say like the deployment screen or respawn screen), it will bug out and need to be refreshed via replication

midnight talon
coarse pasture
#

If the player is already possessing and entity, they can be swapped easy enough. Swap them and when they go to respawn they will be on the other faction. But if that player is currently at the deployment screen or respawn screen and a change is attempted it will not allow the player to deploy or respawn without some additional replication telling the client UI to refresh all the faction associated components

#

The only time I ever got it working was a very delayed call later to do just that. Otherwise I just changed the players faction and killed the controlled character entity and they went to the new faction respawn screen without any issue

midnight talon
# coarse pasture If the player is already possessing and entity, they can be swapped easy enough....
        SCR_PlayerFactionAffiliationComponent fac = SCR_PlayerFactionAffiliationComponent.Cast(playerController.FindComponent(SCR_PlayerFactionAffiliationComponent));
        if (fac)
            fac.SetFaction(playerController, faction);
        
        SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
        if (factionManager)
            factionManager.UpdatePlayerFaction_S(fac);

^ calling these seems to set & sync player's faction correctly for systems like welcome screen/deploy menu/group menu/player menu

#

at least for my case of integrating those with EPF which by default overrides-out most of the vanilla spawn logic system events

coarse pasture
#

Have you tried that on a dedi server?

#

I have to look at the last version that I ended up scrapping

midnight talon
coarse pasture
#

Yea I'm pulling those and it can execute totally fine, but is not replicated in the UI appropriately on dedi

midnight talon
#

those get called after a player w/ existing character connects and is loaded by EPF, since EPF doesn't persist/manage factions I manually set player faction on first join and reconnect. When player re/spawns their deploy menu etc shows them with correct faction assigned

#

If you're trying to use EPF in Conflict-based world as well you'll also need to call some other systems after player faction is set for them to be properly registered e.g. m_SpawnLogic.OnPlayerRegistered_S(playerId); for deploy menu etc to work properly

coarse pasture
tough cave
#

can we test JIP / reconnect with peer tool or dedicated tool? there's no obvious way to connect to a Diag server manually

#

there's a setting to not autoconnect peer tool, but u can't do anything to trigger connect after that unless I missed something in the Debug "Diag" menu.

cerulean parrot
#

0,

#

23+6-+

#

,0

#

,

ocean kernel
#

Why u guys troll me like dis

#

SCR_DamageManagerComponent.GetHealthScaled() returns actual health not scaled health

#

Bruh

#

Also OnDamage script invoker isnt firing now wut

cerulean parrot
#

Guys, I could really use your help understanding something.

I'm coming from an MVC and web dev background, and the game development paradigm is still pretty confusing to me.

I'm not sure how to implement server-client interaction with a REST API in a game context, or which in-game classes I should use for that. I'd be super grateful for any pseudocode or guidance!

Here’s what I’m trying to do:

Simple scenario:

  • Player opens a menu
  • REST API request is made
  • Data is rendered in the UI

More complex scenario:

  • Player opens a menu
  • They enter some input into fields
  • Request is sent to the server (maybe with extra data)
  • Server makes a REST API call
  • Server sends response back to client
  • Data is displayed in the UI

Thanks a lot in advance!

torn bane
# cerulean parrot Guys, I could really use your help understanding something. I'm coming from an ...

Easy, there is none, client rest api calls from script on pc are only enabled by accident and may be removed at any time in the future. Xbox and PS5 do not have them anyway.

If you must get data to clients you can proxy it from the dedicated server via ingame replication and he can send and recieve data. but this will obviously fail on PC main menu hosted "coop aka listen servers" once the api is removed there.

#

If your goal is to render whole UI with markup it will be too much data. you must only transmit the info to hydrate the UI with what the server had to say.
However doing this when ever a client opens a UI makes it possible to spam traffic and take down a server easily by accident. This is why generally this approach is not a good idea.

What is your goal you are trying to achieve? What information does your web api have that the client needs?

lofty pumice
#

Hey i cant get my head around a silly problem in enfusion reforger, i want to mod the "DoorUserAction.c" but when i copy paste it with the keyword modded before the class, i cant open doors anymore, nothing else changed...

` modded class SCR_DoorUserAction : DoorUserAction
{
//------------------------------------------------------------------------------------------------
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
{
DoorComponent doorComponent = GetDoorComponent();
if (doorComponent)
{
vector doorOpeningVecWS = pOwnerEntity.VectorToParent(vector.Forward);
if (doorComponent.GetAngleRange() < 0.0)
doorOpeningVecWS = -1.0 * doorOpeningVecWS;

        vector userMat[4];
        pUserEntity.GetWorldTransform(userMat);
        float dotP = vector.Dot(doorOpeningVecWS, userMat[3] - doorComponent.GetDoorPivotPointWS());
        
        // Flip the control value if it is above a threshold
        float controlValue = 1.0;
        float currentState = doorComponent.GetDoorState();
        if ((dotP < 0.0 && currentState <= 0.0)  || (dotP > 0.0 && currentState < 0.0))
            controlValue = -1.0;
        if (Math.AbsFloat(doorComponent.GetControlValue()) > 0.5)
            controlValue = 0.0;
        
        //Print(controlValue);
        doorComponent.SetActionInstigator(pUserEntity);
        doorComponent.SetControlValue(controlValue);
    }
    
    super.PerformAction(pOwnerEntity, pUserEntity);
}

//------------------------------------------------------------------------------------------------
override bool CanBePerformedScript(IEntity user)
{
    DoorComponent doorComponent = GetDoorComponent();
    if (doorComponent)
        return true;
    
    return false;
}

}; `

prime quarry
#

So I had some time to get this going. I did everything but the data only works in the dev. tools. In the main live server, the data doesn't show for some odd reason. Do you have any ideas?

#

Like more or less, the LVLs aren't displaying. Like in local environment it shows [LVL-1] Username but in my actual live server it just shows my name.

#

I added some debugs etc. the client is getting the correct level as well but displaying the level is just not working.

cerulean parrot
torn bane
#

In that case you should likely refresh that data on the server how ever often it makes sense, but not autoreplicate all changes. instead register all people subscribing to the market data and push updates to them via manul rpcs to them as an array of receivers every x time. This also ensure fairness in the game where they all get the same data no matter if they just opened it 1 second before the update or 1 second too late. You can register for live updates via rpc from client to server when opening the menu which can send you the last known info everyone got. alternatively you broadcast the market info to everyone even those do do not have the menu open but only like every 60 seconds or so - really depending on the data sizes.
Also i would only sync full data to clients once on join and from there only send smaller updates.

Needless to say, building such system is expert level scripting for both external service usage and repliciation and UI. nothing you should attempt as first project

pliant ingot
tender hare
#

Is anyone familiar with an efficient way to draw polygons on the map? I'm trying to make a system to visualize territory control by different factions. I've seen some examples using CanvasWidget, but I'm a bit confused by their implementations

sweet badger
#

It uses an existing CanvasWidget included in Reforger Lobby, but you can just create your own, it's trivial.

tender hare
sweet badger
#

Really the only thing you need to read is OnPostFrame(), CreateMapWidget() and some of the class variables.

#

The main ways to make it efficient are:

  • Avoid recreating the draw commands unless it's absolutely required
  • Only recalculate draw command vertices if the map was transformed, not every frame
tender hare
#

This is a slick implementation, exactly the sort I was looking for

#

I'll keep that advice in mind. I'm aiming to create a very simple visualization using static areas, so the recalculation of draws should be rare over the course of a game session

sweet badger
#

It doesn't need to be rare, you can do it many times a second if you like. Just don't do it every frame if there is no reason to.

#

From a gamemode perspective, you will have to consider how to handle the vertex calculation: Do you calculate the vertices on the server and send them to the clients, or create them on the client based on existing information (or information sent from the server)?
I would go with the second option in your case, that's much easier and probably also less traffic.

tender hare
#

Ya, I agree with going for the second option. No real reason to have the server handle the calculations in my use cases

tough cave
#

is there an equivalent to GetWorldBounds that works when it's not an ocean map? something for dedicated servers to have the land / terrain bounds in script?

#

it's gonna be kind of funny if I tell client to send their map size if server doesn't have it

sweet badger
sweet badger
tough cave
sweet badger
tired rover
#

Causing unnecessary amounts of stress on the server for 0 reason is fun

#

im being sarcastic

tough cave
hushed swan
#

Guys, could you tell me if even though the Arma Reforger server is not officially available for Linux, to run a server the best case considering performance would be Linux or Windows? (If it is Linux I think only with Wine or proton)

#

server with mod in case

ocean kernel
#

AMD - Linux
Intel - Windows

hushed swan
#

because it is not compatible with linux

ocean kernel
#

I run hundreds of servers in docker on debian, I didn't really need to do anything

hushed swan
#

I think it has to be without GUI so as not to limit performance, right?

ocean kernel
#

Thank you I will refer to this guide when setting up the 1000th server

pliant ingot
#

not for you for him)

desert escarp
#

What's the best method for updating an objects location among all clients.

Right now I have an RPC to the server, then to all clients that does

drone.SetTransform(transform);
drone.Update();
drone.OnTransformReset();

And this is not updating on clients

#

Try to make a client authority drone and kind of stumped as of right now

hushed swan
#

or can we say that this is a myth?

desert escarp
#

Both the server and client are getting the proper RPCs so I have no clue as to why the position isn't updating

ocean kernel
abstract crescent
# desert escarp What's the best method for updating an objects location among all clients. Righ...
[RplProp()]
vector m_dronePos;

void SetNewPos(vector pos)
{
m_dronePos = pos;
Replication.BumpMe();
}

void OnUpdate()
{
...
drone.SetTransform(m_dronePos);
...
}

https://youtu.be/asWxIIHT6d0?list=PLfUcrRpCM_fKjkTrkV-bqnknVbFCPA3YU

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
#

Or use unreliable channel to update position.

desert escarp
#

That's what I am currently doing using an unreliable RPC to broadcast the position updates

abstract crescent
#

U dont need broatcast if u use RplProp

desert escarp
#

Would Replication.BumpMe() be way more intensive on network traffic rather than an unreliable RPC

abstract crescent
#

U cant set data on server from client. U should send info to server by PlayerController and then server should update position and send new one to clients

desert escarp
#

Excatly what I am doing yes

#
void SendTransformToServer(vector transform[4], RplId droneId)
    {
        Rpc(RpcDo_SendTransformToServer, transform, droneId);
    }
    
    // === CLIENT → SERVER ===
    [RplRpc(RplChannel.Reliable, RplRcver.Server)]
    void RpcDo_SendTransformToServer(vector transform[4], RplId droneId)
    {
        Print("Updating Drone Server");
        IEntity drone = RplComponent.Cast(Replication.FindItem(droneId)).GetEntity();
        GenericEntity droneEntity = GenericEntity.Cast(drone);
        droneEntity.SetTransform(transform);
        droneEntity.Update();
        droneEntity.OnTransformReset();
        ReplicateTransform(transform, droneId);
    }
    
    void ReplicateTransform(vector transform[4], RplId droneId)
    {
        Rpc(RpcDo_ReplicateTransform, transform, droneId);
    }

    // === SERVER → ALL CLIENTS ===
    [RplRpc(RplChannel.Unreliable, RplRcver.Broadcast)]
    void RpcDo_ReplicateTransform(vector transform[4], RplId droneId)
    {
        Print("Updating Drone Client"); 
        IEntity drone = RplComponent.Cast(Replication.FindItem(droneId)).GetEntity();
        if (!drone)
            return;
        if (!SAL_DroneConnectionManager.GetInstance().IsDronePlayers(drone))  // Only apply if not the controller
        {
            
            GenericEntity droneEntity = GenericEntity.Cast(drone);
            droneEntity.SetTransform(transform);
            droneEntity.Update();
            droneEntity.OnTransformReset();
        }
    }

SCR_PlayerController

#

SendTransformToServer gets called every 100ms in the controller

#

On the client controlling the drone

#

What's happening right now is the only player who gets the broadcast is the drone controller for some reason

#

Like the broadcast is not reaching the other players

#

buh

#

I got it

#

SCR_PlayerController only exists on the client

#

🤦‍♂️

#

That in fact work

abstract crescent
#

btw. RplProp is faster than Rpc. RplProp works directly from engine ( c++ ). Information from boot camp video

desert escarp
#

Replication.BumpMe() only can be called from the server so you will still need an Rpc and you would already need to go through the player controller at that point

#

So in short yes

#

But I don't think that'd work for vehicle networking

midnight talon
hushed swan
hushed swan
#

Can I make a billboard or sign that changes its image every minute?

high hawk
late locust
#

If I have a timer that needs to run on client+server in sync, what would be better?
Server timer + RplProp or somehow sync the client timer start with e.g a unixtime in the future so they start at the same time 🤔

pliant ingot
#

and it count from game mode start

ocean kernel
#

I would sync the time the timer ends and then action resulting in timer end handled by server, client can visualize the timer on their end separately

#

Bonus points if your client handling of the timer factors in ping

late locust
#

Well the timer doesnt end

ocean kernel
#

Oh no

#

What the other guy said

high hawk
#

When getting all items on a character, is there a way to filter out the slots from the BaseLoadoutClothComponent? Currently getting the vest, plus all the pouches and shit along with it

high hawk
river imp
#

@high hawk @fervent cedar or just use the vanilla functionality in materials to switch the bcr

high hawk
river imp
#

Supply x number of textures and set the anim speed

high hawk
# river imp

What about setting it through script from imageset? thatll work though wont it?

#

Genuine Question as i am gonna attempt it now

river imp
#

There's no point in using a render target for that.

#

Unless you actually need to for your use case

#

But yes, images/imageset on a render target will work fine.

high hawk
river imp
vestal saffron
#

happenees wwhen lloading said world in the play view mode

rancid dove
#

Hey guys. Can i learn the enfusion scripting language enforce from Dayz tutorials? I ask cause Dayz has a lot more info about it however i also know theres a difference from a quick Google search. Is it possible?

#

I mean can the Dayz stuff be used in reforger?

ocean kernel
#

Doubt it. You are not modding enfusion. You are modding Reforger. So your learning should be Reforger-specific.

rancid dove
#

Damn thats what i thought thanks tho! Do you have any links for good resources to learn this?

dire sinew
#

As for any programming language, learning the language is usually the easiest step, but not enough. You also have to familiarize yourself with the libraries and code base.

rancid dove
#

Will try those out thanks

neat fjord
#

Hi, im trying to make a script, that when you want to equip white armband, it wont let u, if u have a weapon in your inventory, same vise versa, if u have a white armband, it wont let you equip weapon.

Any tips and tricks? Im really lost and dont know, how to use Enfusion scripting.

dire sinew
errant wren
#

You definitely learn the language syntax and structure from DayZ.

#

But there are differences. It would be better to start on Reforger yes

tough cave
tough cave
rancid dove
#

man their pages dont get updated enough, i followed this guide to the letter.. i even tried copy paste the thing and i still get errors :sadface:

narrow aspen
#

is this vector calculation currect? I always get mortar waypoint directly on top of player header.

#

if(m_eTargetType == IPC_ETargetType.Player)
{
if(!m_targetPlayer)
return;
params.Transform[3] = m_targetPlayer.GetOrigin() + Vector(Math.RandomFloat(0,m_fDisperson), 0, Math.RandomFloat(0,m_fDisperson));
}

frail hound
#

Can i write some values in config file in runtime?

pseudo merlin
pseudo merlin
#

Looks good.

narrow aspen
#

it works now

dire sinew
high hawk
#

Anyone know if there is a method to clean a stringtable item? Or would I just load it from the container?

ocean kernel
#

define clean

minor agate
ocean kernel
minor agate
ocean kernel
high hawk
ocean kernel
worldly pier
#

Do anyone know how to make a weed script where can pick up weed then process it then sell it

prime quarry
high hawk
#

UI's are always player 'owned' correct? If so, is there a way that the UI can be owner on another entity and I just access it?

ocean kernel
#

UI is always local to where it's displayed

#

There is no owner because there is no replication

high hawk
#

So if I have a UI attached to a storage, how would one controll the storage? Maybe when I perform the useraction on the entity to open the menu?

ocean kernel
#

You control the UI on the machine you display it on

#

You can synchronize data for your UI via replication

high hawk
#

I'm just trying to getitems from a storage into my UI, works fine on workbench obvs, but just didnt know the most effective way to achive it on the server

#

I'm just spitballing around to myself here but, If I get the storageComponent when I perform my UserAction to open the menu, I could pretty much controll it that way?

high hawk
#

Good or no? I need da help

rancid dove
#

Is there logs somehow from Discord? Wondering if can get AI to sort thru all the questions and answers and compile a nice tutorial

fervent cedar
#

script editor freezing for 5 seconds every time I click it

rancid dove
#

if i want to take dmg over time by entering a zone, which prefab do i edit?

dire sinew
eager venture
#

Hello

rancid dove
#

i need more bwainpowah

frail hound
pseudo merlin
#

Is there a way to get the actual terrain height ( y ) when some terrain prefab is build on top of the base terrain?
Speaking about the "ErodedEmbarkment".
When i use SurfaceY it will give me the base terrain height but i need the height of the map with the "ErodedEmbarkment" taken into account so something like ATL from Arma 3 i guess.
With "ErodedEmbarkment":

#

Without "ErodedEmbarkment":

#

I know i can do some nasty stuff to get the "ErodedEmbarkment" entity and use entity.GetWorldBounds(worldBoundsMin, worldBoundsMax); to get the actual height but i was looking for a more simple way.

rancid dove
#

if i change this , it still wont load as the new character?

tough cave
#
modded class SCR_EditorManagerEntity
{
    protected override void UpdateLimited()
    {
    }
}

this is related to the scriptinvoker recursive spam that I see before server crashes. if you take code out like this, everyone has GM without doing anything. So I guess another piece of code is wrongly giving out GM, and the original code in this method keeps taking it away, and it just loops for no good reason.

rancid dove
quaint basalt
#

What is Is Fired From Script" used for in WeaponSlotComponent ?

ocean kernel
#

It tells the weapon slot component if it's fired from script

quaint basalt
#

Jokes aside, afaik there is no way to fire that weapon from script, correct?

ocean kernel
#

Correct

quaint basalt
#

F* it. I'll just duplicate the weapon for the pilot

timid citrus
#

Whats the newest way to pause the world.

#

I want to not have it hear the ocean sounds from the default thing it does when you go into play mode, until the player has spawned from the menu.

ionic rune
#

I can't find my created components in the components list when im inside the world editor and trying to add a component to a character base et

dire sinew
ionic rune
#

yes, still not found

dire sinew
#

Maybe restart the workbench then. Also from which class does your component inherit from?

#

From what I remember certain components can only be present once on an entity. In that case you would have to switch the existing one by yours.

ionic rune
#

it's a created class

dire sinew
#

... just copy and paste here the line that define thes class like class ACE_Medical_CardiovascularSystem : ACE_Medical_BaseSystem

ionic rune
#

class VitalsComponent : ScriptComponent

#

class VitalsComponentClass : ScriptComponentClass {}

dire sinew
#

Hmm, so you still can't find VitalsComponent even after you restarted the workbench?

ionic rune
#

yep

#

is there a certain spot beyond the project folder that i need to have this script?

dire sinew
#

Bruh... They should be inside scripts/Game, otherwise it won't even get compiled 😅

ionic rune
#

ArmaReforgerWorkbench\addons\VitalsMod\addons\Vitals\Scripts\Game

#

like that?

dire sinew
#

Yes

ionic rune
#

yep it's there

#

well wait

#

is it case sensitive for the folder?

dire sinew
#

Maybe, scripts is not capitalized in the base game

ionic rune
#

yea that's im thinking now that im looking at it.

#

gimme a min

#

it's working now

rancid dove
#

i just started learning enforce script and still have hard time understanding..
Why do i get Unknown Type error on this code here:

||_modded class NW_GameMode : SCR_BaseGameMode
{
override void OnInit()
{
super.OnInit();
Print("NW_GameMode initialized", LogLevel.INFO);
}
}||

#

ok that msg didnt turn out how i wanted.. but the question still stands, thanks in advance

pliant ingot
#

Or _ in front of modded

rancid dove
#

thats a discord typo, the _

river imp
rancid dove
pliant ingot
river imp
#

You can't mod a type that does not exist. ^^

rancid dove
#

hm alright i thank thee very much

abstract crescent
#

How to send data from client to server correctly? I want open UI on client, press button and update value on server.

dire sinew
abstract crescent
dire sinew
signal belfry
#

Anyone know how to resolve this?
Can't compile "Game" script module! scripts/Game/Campaign/WCS_CampaignNetworkComponent.c(70): Can't find variable 'm_vLastUnloadedAt' PROFILING : Script validation took: 1265.627700 ms

#

I am getting Game Script errors for both Enfusion and while trying to play on a modded server

abstract crescent
# signal belfry

it can be weird but it cant find variable i think blobcloseenjoy
Check **m_vLastUnloadedAt **in WCS_CampaignNetworkComponent.c file

midnight talon
ionic rune
#

void OnKilled()
{
StopWhisperLoop();
IEntity self = GetOwner();
GetGame().GetCallqueue().CallLater(() => {
GetGame().GetWorld().DeleteEntity(self);
}, 500);
}

#

what did i do wrong?

midnight talon
#

I don't think JS style anonymous "fat arrow" function expressions are a thing in Enforce Script. Try passing a reference to a method to CallLater

#

Would be really nice if we could have first class functions though

#

And just nicer patterns for callbacks/async operations in general

abstract crescent
ionic rune
abstract crescent
#
  1. Create clean up manager, like component for gameMode "MYMOD_CleanUpManagerComponent"
  2. Subscribe to entity death by ScriptInvoker
  3. Get callback that entity is dead and mark it for delete
  4. Delete entity on next frame/tick from "MYMOD_CleanUpManagerComponent"
abstract crescent
# ionic rune Well I'm just starting, so trying to do something. I'm working with little infor...

or you can use another way:

class MYMOD_TestEntity: IEntity
{    
    void OnKilled()
    {
        MYMOD_CleanupManagerComponent comp = MYMOD_CleanupManagerComponent.Cast(GetGame().GetGameMode().FindComponent(MYMOD_CleanupManagerComponent));
        
        if (comp)
        {
            comp.KillMeBaby(this);
        }
    }
}

class MYMOD_CleanupManagerComponentClass: ScriptComponentClass
{
};

class MYMOD_CleanupManagerComponent: ScriptComponent
{
    private ref array<MYMOD_TestEntity> m_deadEntArr = new array<MYMOD_TestEntity>();
    
    void KillMeBaby(MYMOD_TestEntity ent)
    {
        m_deadEntArr.Insert(ent);
    }
    
    protected override protected void EOnInit(IEntity owner)
    {
        if (!SCR_Global.IsEditMode())
        {
            GetGame().GetCallqueue().CallLater(OnUpdate, 1000, true);
        }
    }
    
    protected void OnUpdate()
    {
        foreach(MYMOD_TestEntity ent: m_deadEntArr)
        {
            if (ent && !ent.IsDeleted())
            {
                SCR_EntityHelper.DeleteEntityAndChildren(ent);
            }
        }
        
        m_deadEntArr.Clear();
    }
} ```
pale cosmos
#

Looking for some guidance - I’m trying to build a mission where players need to find intel to reveal hidden destructible objects (caches, mortars, etc), they need to find multiple pieces of intel to reveal all of the objects.

Objects will be placed in the world with a component in the world editor. My plan was to register the entities with the component somewhere in an array so i can loop over them, delete random ones, reveal random ones, etc.

Through the process I’ve learned about and tried building my own game mode, game systems that get registered via config, a standalone class, and conceptually learning about managers (like factionmanager, but i haven’t tried building anything yet for this).

I think i’m not sure about the best approach for building this out. I had a fully functioning prototype using my own class that doesn’t inherit from anything but i ran into some issues when I needed some replication. Also had some success with making a game system to store all of the methods and variables. Conceptually it feels like a new “game mode” but i’m not sure if game modes are meant for registering entities from components and doing stuff to them via script.

I think i’m just not sure what approach to take. Are there any guidelines kicking around for when to use a standalone custom class vs a custom gamemode vs a gamesystem vs a manager? does it matter? (this is my first reforger mod btw so i'm battling SQF brain a little bit)

abstract crescent
# pale cosmos Looking for some guidance - I’m trying to build a mission where players need to ...

use **ActionsManagerComponent **and "Additional action" field to add own action (MYMOD_CheckDocumentAction)

class MYMOD_GameMode: SCR_BaseGameModeClass
{
};

class MYMOD_GameMode: SCR_BaseGameMode
{
    [Attribute(defvalue: 0)]
    int m_piecesLimit;
    
    [RplProp()]
    protected int m_findedPieces = 0;
    
    void FindNewPiece()
    {
        m_findedPieces = Math.Clam(m_findedPieces + 1, 0, m_piecesLimit);
        Replication.BumpMe();
        
        if (m_findedPieces >= m_piecesLimit)
        {
            OpenHidenCache();
        }
    }
    
    protected void OpenHidenCache()
    {
        if (Replication.IsServer())
        {
          RpcBroad_OpenHidenCache();
          Rcp(RpcBroad_OpenHidenCache);
        }
    }
    
    [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
    protected RpcBroad_OpenHidenCache()
    {
        // show hidden treasures here
    }
}

class MYMOD_CheckDocumentAction: ScriptedUserAction
{
    override event void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
    {
        MYMOD_GameMode gameMode = MYMOD_GameMode.Cast(GetGame().GetGameMode());
        
        if (!gameMode)
        {
            return;
        }
        
        gameMode.FindNewPiece();
    }
    
    override event bool CanBePerformedScript(IEntity user)
    {
        // place access check here
        return super.CanBePerformedScript(user);
    }
    
    override event bool CanBeShownScript(IEntity user)
    {
        // place show action check here
        return super.CanBeShownScript(user);
    }
}


pale cosmos
# abstract crescent use **ActionsManagerComponent **and "Additional action" field to add own action ...

Thanks for the example, I should have specified I already got the intel folder working with a scripteduseraction, it reveals a random number of destructibles by placing markers on the map, and also have destruction working where it deletes the entity and removes it from the array of caches/destructibles onDestroy.

I’m more wondering if there’s a best practice for building out the main part of the code, does it make sense for it to be a new game mode that inherits from basegamemode, should I use a system that inherits from gamesystem, that kind of thing, what are the pitfalls of one approach over the other, etc. Maybe it doesn't really matter?

abstract crescent
#

If u can make all with standard tools and you are satisfied then use standard tools.
Own game mode class or own component is better than modded game mode class as for me.

#

modded classes is last stand if you dont have another normal way. If your mission is small then dont worry but if you want to scale then use own classes.

open pier
#

Anyone know how I could troubleshoot this?

RplSchedulerError: Generated task provided id of removed or never registered item!

frail hound
#

How i can clear cache for prefab/resource? What i need, a add some value to Prefab in runtime by BaseContainerTools, but in game i can't use new item...

For example is BaseLoadoutManagerComponent have a "Slots". i need add LoadoutSlotInfo with custom LoadAreaType, but it's not flushed when my character spawned

abstract crescent
pseudo merlin
#

Is there a methode to check which world is used?
Something like: if(world == "Eden")

frail hound
pale cosmos
abstract crescent
pseudo merlin
#

Thanks. 👍

midnight talon
torn bane
frail hound
frail hound
ocean kernel
#

The amount of boilerplate I have to write is crazy

#

I could solve it if I could do basic things like pass methods as parameters

#

Or use out void

#

But no, we want to make a powerful scripting language but we're not gonna give you basic things

frail hound
pliant ingot
frail hound
#

The funniest thing is that even from compiled code, an infinity crash from tools can occur.

ocean kernel
ocean kernel
#

The problem is that everything in this game has some sort of problem, and rcon connections randomly take 5 seconds to return the logged in packet

pliant ingot
#

and you can't easily access game data by this approach

ocean kernel
frail hound
pliant ingot
dark ocean
#

the biggest PITA is custom types serialization for network. you practically have to copy/paste logically the very same block of code 4 times, and count all bytes manually on top of it. extremely tedious and error prone.

frail hound
dark ocean
frail hound
ocean kernel
#

We would be better off with JDSL

pliant ingot
frail hound
# pliant ingot > what I wrote Real code in enforce? so you just hide enforce loops and function...

Yeah, use like usual dto in server side app.

class TestDto: Dto {
    ref SString stringParam = new SString();
    ref Int intParam = new Int();
    ref Float floatParam = new Float();
    ref Boolean boolParam = new Boolean();
    ref JsonMap<ref SString> mapParam = new JsonMap<ref SString>();
    ref JsonMap<ref DomTestDto> mapParamObj = new JsonMap<ref DomTestDto>();
    ref Array<ref SString> arrayParam = new Array<ref SString>();
    ref Array<ref DomTestDto> arrayParamObj = new Array<ref DomTestDto>();
    
    ref SubTestDto subTestParam = new SubTestDto();
}

class SubTestDto: Dto {
    ref SString stringParam = new SString();
    ref DomTestDto domTestParam = new DomTestDto();
}

class DomTestDto: Dto {
    ref SString stringParam = new SString();
}

with what is written above

#

unfortunately I have to use inheritance

#

well and additional methods that remove wrapping values ​​in the string

pliant ingot
#

so you still need to write many code for waiting and you consume resources on changing format of data, instead of directly working on it

frail hound
frail hound
#

Has anyone encountered the issue of writing data to a component of an existing entity at runtime?

Like BaseLoadoutManagerComponent "Slots"

I can't add some value inside. Although it may be added, it does not work as it should in the mission... that is, even BaseContainer is added, but it does not affect the game

pliant ingot
#

BaseContainers and etc is just a holders for "setup" them

frail hound
#

in EOnInit method of Chimera

pliant ingot
frail hound
pliant ingot
#

just change real instances - components or entites or whatever it is

frail hound
frail hound
frail hound
# pliant ingot what are you trying to do?

two options,

  1. I'm trying to write an additional slot to the Chimera prefab in the BaseLoadoutManager component... Which is successfully written, but because this prefab doesn't work.

  2. I'm trying to write an additional slot to the BaseLoadoutManager component in runtime directly to the existing instance, but why doesn't this work either

#

don't piss on me, these are tests

ref Resource resourceCharacterBase = Resource.Load(CHARACTER_BASE);
            IEntityComponentSource componentSource = SCR_BaseContainerTools.FindComponentSource(resourceCharacterBase, BaseLoadoutManagerComponent);
            ref BaseContainerList slots = componentSource.SetObjectArray("Slots");
            
            ref LoadoutSlotInfo loadoutSlotInfo = new LoadoutSlotInfo();
            ref Resource loadoutSlotContainerHandler = BaseContainerTools.CreateContainerFromInstance(loadoutSlotInfo);
            ref Resource loadoutAreaTypeHandler = BaseContainerTools.CreateContainerFromInstance(loadoutAreaType);
            BaseContainer containerSlotInfo = loadoutSlotContainerHandler.GetResource();
            containerSlotInfo.SetName(typename.EnumToString(SD_ELoadoutArea, loadoutAreaType.m_Type));
            BaseContainer containerLoadoutAreaType = loadoutAreaTypeHandler.GetResource();
            containerSlotInfo.SetObject("AreaType", containerLoadoutAreaType);
            SD_ELoadoutArea type;
            BaseContainer cont = slots.Get(8);
            
            if(cont != null) {
                slots.Remove(cont);
                cont.GetObject("AreaType").Get("m_Type", type);
                if(type != loadoutAreaType.m_Type) {
                    slots.Insert(containerSlotInfo);
                }
            } else {
                slots.Insert(containerSlotInfo);
            }
#
ref Resource resourceCharacterBase = Resource.Load(CHARACTER_BASE);
        IEntityComponentSource componentSource = SCR_BaseContainerTools.FindComponentSource(resourceCharacterBase, BaseLoadoutManagerComponent);
        
        ref BaseLoadoutManagerComponent comp = BaseLoadoutManagerComponent.Cast(FindComponent(BaseLoadoutManagerComponent));
        
        ref SD_EmptyBaseContainer sdContainer = new SD_EmptyBaseContainer();
        ref Resource sdEmptyContRsc = BaseContainerTools.CreateContainerFromInstance(sdContainer);
        
        BaseContainer newContainer = sdEmptyContRsc.GetResource();
        
        ref BaseContainerList slots = newContainer.SetObjectArray("Slots");
        ref SD_LoadoutAreaType loadoutAreaType = new SD_LoadoutAreaType(SD_ELoadoutArea.MASK);
        ref LoadoutSlotInfo loadoutSlotInfo = new LoadoutSlotInfo();
        ref Resource loadoutSlotContainerHandler = BaseContainerTools.CreateContainerFromInstance(loadoutSlotInfo);
        ref Resource loadoutAreaTypeHandler = BaseContainerTools.CreateContainerFromInstance(loadoutAreaType);
        BaseContainer containerSlotInfo = loadoutSlotContainerHandler.GetResource();
        containerSlotInfo.SetName(typename.EnumToString(SD_ELoadoutArea, loadoutAreaType.m_Type));
        BaseContainer containerLoadoutAreaType = loadoutAreaTypeHandler.GetResource();
        containerSlotInfo.SetObject("AreaType", containerLoadoutAreaType);
        
        slots.Insert(containerSlotInfo);
#

I'm trying to do the second option with a full cleanup for now, for now... p.s. it doesn't work at all

#

First option is code for OnGameStart in gamemode

second is EOnInit in SCR_ChimeraAgent

pliant ingot
#

at least try to do this in constructor

#

not in EOnInit

frail hound
#

thx, 1 sec

pliant ingot
frail hound
# pliant ingot not in EOnInit

it has a constructor in Entity and since it is a modded class I can't override it

either I don't understand something...

scripts/Game/GameMode/SD_BaseGameMode.c(10): error: Overloaded function 'SCR_ChimeraCharacter' not compatible
frail hound
pliant ingot
#

there are in genericcomponent and ientity as I remember

pliant ingot
frail hound
# pliant ingot for what? giving inventory items?

for everything, taking into account the high-level server settings, for example, adding a slot through the admin panel, I can write it into the config for the UI, but I can’t write it into the component...

frail hound
pliant ingot
frail hound
#

I wanted to transfer the slot management directly to the admin panel, since UI management is possible by saving conf when starting the game... I thought it would be interesting to add the ability to manage slots through the admin panel, so as not to touch the mission at all, and configure on the fly.

#

There was a desire to exclude any slot from the game if necessary, easily by pressing a button, or by restarting...

frail hound
#

Understand, my soul is dead after Dayz. although I didn't mess around with it for very long...

pliant ingot
frail hound
pliant ingot
frail hound
#

I try not to touch vanilla working and non-useless lines of code... 😅

frail hound
#

maybe a little less

pliant ingot
frail hound
frail hound
pliant ingot
#

and don't f*ck vanilla)

frail hound
frail hound
pliant ingot
#

but you can start with simple your own component with array of items

#

add you logic for adding/removing slots

#

add UI and etc

frail hound
#

ah... you mean completely from scratch, taking into account rendering...

pliant ingot
#

yes

frail hound
# pliant ingot yes

Ok, I'll think about how much I want to get fucked up) It's a pity that vanilla is so crude...

#

Thank's for all the tips 😄

torn bane
timid citrus
#

SCRIPT (E): @"Scripts/Game/UI/Menus/MainMenu/A4L_MainMenuScreenContent.c,27": Undefined function 'ArmaReforgerScripted.RequestExit'

Does anybody know another way to clear this dumb error that gets stuck in cache besides uninstalling reforger tools and deleting the workbench folder in My Games folder then reinstalling tools?

abstract crescent
timid citrus
#

Chat GPT suggested it was the new get exit function or whatever it is called still has some kind of reference to the old reforger scripted thing. But I'm not sure if that's accurate.

abstract crescent
#

vanilla "ArmaReforgerScripted" doesnt have "RequestExit" function.
ChatGPT and Copilot are stupid with enfusion scripts - they used found modded function as vanilla

#

Are u use mods in yours project?

timid citrus
#

Yeah we have a few. Probably get rid of most of them

#

And it's a triple mod structure r. Right now. Gameplay, core, and UI

abstract crescent
#

That is mods problem can be. Be caful with mods order in dependency.

timid citrus
#

So I have to find what mod that function comes from?

abstract crescent
frail hound
timid citrus
#

nothing about reforgerscripted

abstract crescent
timid citrus
#

But sometimes it compiles..

#

Is there a better way you know of?

#

I'm using GameComponent workflow

abstract crescent
#

it cants compile if u use uncreated function.

#

You have mods issue i think. Check connected mods and mods dependency for that function

desert escarp
#

Idk when the base explosion prefabs stopped actually making sound but what's the new method to explode an object and make it have a sound when it actually does it

torn bane
desert escarp
#

Getting this spammed only on a dedicated server

#

This works in single player I am so confused

#

Literally just a duplice of the medium tnt explosion with sounds

#
    [RplRpc(RplChannel.Reliable, RplRcver.Server)]
    void RpcDo_SendTransformToServer(SAL_DroneNetworkPacket packet)
    {
        if (!Replication.FindItem(packet.GetDrone()))
            return;
        
        IEntity drone = RplComponent.Cast(Replication.FindItem(packet.GetDrone())).GetEntity();
        vector transform[4];
        packet.GetTransform(transform);
        if (packet.GetIsTriggered())
        {
            EntitySpawnParams params = new EntitySpawnParams();
            params.Transform = transform;
            GetGame().SpawnEntityPrefab(Resource.Load(packet.GetExplosion()), GetWorld(), params);
            SAL_DroneConnectionManager.GetInstance().ExplodeDrone(packet);
            //SCR_EntityHelper.DeleteEntityAndChildren(drone);
            return;
        }
    void ExplodeDrone(SAL_DroneNetworkPacket packet)
    {
        Rpc(RpcDo_ExplodeDrone, packet);
    }

    [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
    void RpcDo_ExplodeDrone(SAL_DroneNetworkPacket packet)
    {
        vector transform[4];
        packet.GetTransform(transform);
        EntitySpawnParams params = new EntitySpawnParams();
        params.Transform = transform;
        GetGame().SpawnEntityPrefab(Resource.Load(packet.GetExplosion()), GetGame().GetWorld(), params);
    }
desert escarp
#

Solution was to just restart the workbench

rose siren
#

anything on RequestScenarioChangeTransition causing JIP errors being addressed? Been a thing since 1.3 dropped and is singlehandedly killing our community.

#

Forced restarts for 30min games instead of flowing into the next round really turns people off.

vernal hawk
#

how do i fix this?

#

i get a script error then i load in and it says that

dire sinew
vernal hawk
#

ah okay

#

so where would i ask around here to get a GM scenario setup for a map so i can publish it? Or does it automatically come with a GM scenario? If that didnt make sense i mean whenever you load a map and it gives you the choice of GM or conflict

dire sinew
#

If you want a GM scenario for a new terrain, you gonna have to create one. Create a new world that uses the terrain as parent scene. You can then use the Game Mode Setup plugin in the world editor to get the required entities placed for you.

vernal hawk
#

w h a t

#

im very new to this so that made little to no sense to me

#

well i figured it out and i thank you for your help

#

but is it supposed to get stuck on a loading screen?

kindred vessel
#

I'd like to detect if a patrol that was spawned from a AmbientPatrolSpawnpoint has been eliminated or anything like that. Where can i hook into to monitor that? or is there an event that is triggered?

gritty orbit
#

where can i find a list of reforger action names, sorry im new. im making a custom field manual, and i need the list of action names for displaying keybinds in instructions

gritty orbit
#

if i wanted to show the keybind for reloading your weapon

abstract crescent
gritty orbit
#

Damnit, i found 2 so far, but just in examples from scripting tutorials

#

characterReload, and characterFire

abstract crescent
gritty orbit
#

i might have to do the same

#

its crazy the wiki doesnt have a list of standard vanilla actions

abstract crescent
gritty orbit
#

I sort of found it

#

This file contains a list of every vanilla keybind and the cooresponding action name

#

its all in there, just down a couple clicks per item

#

example, this is the action name for opening the radio channel menu:

#

i came to you for help, but i hope i helped you instead

abstract crescent
high hawk
#
17:58:12.773 RPL          : ClientImpl event: connected (identity=0x00000000)
17:58:12.773 NETWORK   (V): RplSession::RplStartupEvent: Started
17:58:12.783 RPL          : rpl::Pip::ProcessGameToNet
17:58:12.783  NETWORK   (V): RplConnection::Rpc_Validation_S sent
17:58:12.875 RPL          : ClientImpl event: disconnected (identity=0x00000000), group=4, reason=2
17:58:12.875 NETWORK   (V): RplSession::RplRuntimeEvent: Error
17:58:12.875 NETWORK   (V): RplSession::RplRuntimeEvent: Disconnect
17:58:12.875 NETWORK   (V): RplSession::Terminate

I cannot get peer tool to launch..

#

any help much appreciated

kindred vessel
#

Does anyone know how I can track which patrol spawned from which ambient spawn? in script

latent oyster
#

I was wondering if someone could help me with scripting for a new faction, I have looked through every photo and explaintion I could find but I am still struggling, I currently cannot compile and reload my files due to a syntax error but have no idea how to fix this.

dapper kernel
latent oyster
dapper kernel
#

DM me the script, I can take a look, but no promises. Im not a genius lol

lofty pumice
#

he is there any eventhandler in enfusion that i can use without writing a completly new system? Like i want to get points when i kill a other character entity?

scarlet dune
#

don't use Chat GPT, if you do yu'll be all messed up, Arma dont use C++, it uses ArmA Scripting

shrewd nova
#

In most cases you need to know how to script to even instruct gpt properly

timid citrus
#

I've got my custom gpt trained pretty good for 1.4+ compliance.

#

Took some doing though for sure.

scarlet dune
#

the guys in Disacord are my Chat GPT 🙂

kindred vessel
#

Welp, if no one is answering we only have Chad GPT left as option...

ionic rune
#

if i wanted to create an ai, what's some of the things i would first do?

gritty orbit
# ionic rune if i wanted to create an ai, what's some of the things i would first do?

watch this bootcamp, gets you into the fundamentals of modding
https://www.youtube.com/watch?v=Fgl_mAHReP4&list=PLfUcrRpCM_fKjkTrkV-bqnknVbFCPA3YU

https://reforger.armaplatform.com/news/modding-boot-camps-introduction

This Modding Boot Camp seminar was originally held on the Arma Discord Server on November 20th, 2024.

Join Modding Supervisor Mario Enríquez for our first Modding Boot Camp, where he gives a quick overview of the Arma Reforger Tools and Workbench.

00:00 - Modding Boot Cam...

▶ Play video
#

they have some video courses on AI

lofty stag
#

Is there a way to disable ESC exiting the game inside of Reforger Tools? With the new bug I can't get out of the arsenal lol

timid citrus
lofty stag
kindred vessel
#

how can I access the patrol entities from a custom component in the ConflictMilitaryBase?

solid hearth
#

Depending on the setup, if you have your custom component on the main (parent entity) you could loop through the children and build a collection of child entities that have a unique component specific to Patrol_1 / Patrol_2 like so

array<IEntity> childrenWithUniqueComponent();
IEntity child = GetOwner().GetChildren();
while(child) {
    if (child != GetOwner()) {
        if (child.FindComponent(SomeUniqueComponentOnPatrol_1))
            childrenWithUniqueComponent.Insert(child);
    }
    child = child.GetSibling();
}
        
foreach (IEntity patrol : childrenWithUniqueComponent) {
    // do some stuff here        
}

Another way is you can have a unique component on those patrol entities that will register them self to your component on the parent. Quite a few ways to do this just depends what all you're doing and what you want to achieve.

olive slate
#

I’m working on some base building HQ spawn logic using the command HQ prefab E_Headquarters_S_US_01.et and inside it, the RestrictedDeployableSpawnPoint_HQ.et is placed as part of the prefab. This setup works and the base can be built and placed.

However, after a server restart, the RestrictedDeployableSpawnPoint_HQ.et doesn’t show up on the map or act like a proper spawn point. Also, immediately after initial placement, it doesn’t show either.

The only way to make it show up and function correctly is to manually switch its faction affiliation from US to USSR and then back to US.

Does anyone know why this happens or how to make the faction affiliation persistent and automatic on initial placement and after restarts?

have no idea where to even ask for smth like this

kindred vessel
# solid hearth Depending on the setup, if you have your custom component on the main (parent en...

Thank you very much for taking the time to respond to my issue, I really have been struggling to get this to work. This code is similar to the code that I wrote but it never goes into the while loop. Attached screenshots are from a sample project that I've set up. My original code was like this but yields the same result:

override void OnPostInit(IEntity owner)
{
    super.OnPostInit(owner);
    
    Print("TestComponent: getting children");
    IEntity child = owner.GetChildren();
    while (child)
    {
        Print("TestComponent: child" + child);
    }
}
solid hearth
#

that's one way to stall workbench if it did work.. First.. don't leave a while loop going like that... secondly you'd want to do that type of code well after things initialized so in EOnInit so something like this but you may have to get the children in a later cycle (delay it). OnPostInit will trigger the moment it starts initializing where as EOnInit executes once the entity and its components fully initialize or something like that. Not sure on child entities though which is why I said you may need to delay it.

override void EOnInit(IEntity owner)
{
    m_Base = owner;
    IEntity child = owner.GetChildren(); // Gets first child
    while(child) {
      Print("Child entity: " + child);
      child = child.GetSibling(); // Gets next child (if there is none it will become null thus exiting the loop)
    }
}
    
override void OnPostInit(IEntity owner)
{
    super.OnPostInit(owner);
    SetEventMask(owner, EntityEvent.INIT);
}
kindred vessel
#

Thank you so much for teaching me this. I've been trying for almost two days to get my head around it. It did cross my mind that it was a lifecycle and retrieval issue, but still, I hooked into the wrong methods.

late locust
#

If I have a custom class array with RplProp(), it only replicates changed instances cause of PropCompare(), right? So I can Replication.BumpMe() without always replicating the whole array?

rancid dove
#

can someone explain to me about the GUID and where to retrieve? im a total noob and this

kindred vessel
#

gives the option to copy the guid

rancid dove
#

only specific files has this?

minor agate
#

Always

#

If you have an array of 100 objects. Each of 100 bytes. And if 1 bit of those 100,000 bytes changes then everything is sent and the array along all of its contents gets destroyed and individually created every time it is replicated on the clients.

#

Avoid array of large data.

#

Use rpc instead.

#

Or a custom object as container (codec for this might be more expensive performance wise than just doing rpcs)

late locust
#

I see, my array is not that large but I guess rpc is the way then. Thanks meowheart

dire sinew
#

Plus OnRplLoad/OnRplSave for handling JIPs or you still make it a RplProp, but never call BumpMe.

topaz pebble
#
{
    override void OnActivate(IEntity ent)
    {
    if (!ent)
            return;
            

        IEntity teleportTarget = GetGame().GetWorld().FindEntityByName("teleport_01");
        if (!teleportTarget)
            return;

        vector destination = teleportTarget.GetOrigin();
        ent.SetOrigin(destination);
    }

};```
#

Is there a way I can add a fade in/out to this teleport script like we used to be able to with Arma 3?

lofty pumice
#

hey need some help i want to register a function for a ScriptInvoker.
Thats my min. example:
...
` ref ScriptInvoker sample = new ScriptInvoker();

void RegisterSample(void callback) {
    sample.Insert(callback);
}`

Thats my error:
scripts/Game/ExperienceSystem/sample.c(41): error: Can't make callback from unknown method 'callback'

Can i make a methode to register a methode or is this just not possible?
Have i do it the opposite way? To call the .Insert on the class where i want to insert the methode?

dire sinew
#

Keep in mind that you will also have to make a method on the player controller or on a component for doing owner RPC for MP.

#

Same goes for SetOrigin, as from I remember, it also has to be called on the owner.

#

Or call SCR_EditableEntityComponent::SetTransform on the server, which does the RPC for you.

frosty coral
#

Is there a way to check if an entity is loadtime or runtime?

timid citrus
pliant ingot
dire sinew
#

If you just want to know whether EOnInit gets called at loadtime or runtime for an entity, you can use Replication::Loadtime inside.

frosty coral
dire sinew
#

We use this for our modules to distinguish the case where GM places it or that it go placed in the world editor.

frosty coral
frosty coral
#

though thinking of it now i might have a bigger issue with runtime spawned objects still having my component... duh

pliant ingot
frosty coral
static vale
#

How do i get proper world size? For example Everon is 12800x12800.

If i do this: GetGame().GetWorldEntity().GetWorldBounds(min, max); float widthX = (max[0] - min[0]); float widthZ = (max[2] - min[2]);

I get 14443.8 x 12900??? Why do the map /cords show 12800?

#

My goal is to get max x,z cord to i can select a valid point in the world position from 0-12800

ocean kernel
sacred python
#

Is there anyone here that would be willing to give some time to teach scripting for Fixed wing models? Already have the models built just need to import them with scripts to Reforger tools. DM my self if you are able can discuss further in DM's

lofty stag
#

Is there anyway to tell when a group is created? and by whom?

#

Would make our life easier to ban people with bad group names

pale cosmos
pale cosmos
thorn loom
#

Trying to get ResourceName from a prefab but the GUID is coming back as @"{0000000000000000}Prefabs/...

//------------------------------------------------------------------------------------------------
static ResourceName RoleToResource(CRF_EGearRole roleInt, FactionKey faction)
{
  Resource resource = Resource.Load("Prefabs/Characters/Factions/" + faction + "/CRF_GS_" + faction + RoleToString(roleInt) + ".et");
  return resource.GetResource().GetResourceName();
}

In the workbench I get the error:

SCRIPT       : GetResourceName 'scripts/Game/Systems/Core/Containers & Configs/CRF_Enums.c,153'
 RESOURCES (E): Wrong GUID for resource @"{0000000000000000}Prefabs/Characters/Factions/BLUFOR/CRF_GS_BLUFOR_PSG_P.et" in property "@s00"

but I Print the return It does give me the correct output

{6BB714F2C0835B67}Prefabs/Characters/Factions/BLUFOR/CRF_GS_BLUFOR_PSG_P.et```
On the dedicated server tool it returns the 0s. So very lost on whats going on, any ideas?
thorn loom
#

Or is this just not possible at runtime?

timid citrus
#

Can anybody tell me if this is all correct? Or if you have any suggestions for additions. It's for 1.4+ compliance

abstract crescent
#

dont forget to call Update after SetOrigin

abstract crescent
#

use code to check is resource loadedif (resource && resource.IsValid())

abstract crescent
lofty pumice
ocean kernel
#

We are not allowed to pass functions as parameters, only bohemia scripts can

lofty pumice
#

ok thanks 🙂

lament oxide
#

Here's a script that I have to detect magazine size. The goal is to call it using an animation even node. The problem? It's never calling the script. I've tried a bunch of logging at different areas, none of them show up in the logs. What could be causing the magazine animation events to not run?

` override event protected void OnAnimationEvent(AnimationEventID animEventType, AnimationEventID animUserString, int intParam, float timeFromStart, float timeToEnd)
{
super.OnAnimationEvent(animEventType, animUserString, intParam, timeFromStart, timeToEnd);

    if (animEventType == m_iMagazineDetachEvent)
        PerformTacticalReloading();

    // ────────── NEW: current‑mag check ──────────
    if (animEventType == m_evtMagCurrentCheck)
    {
        int max = 0;
        if (m_weaponComponent)
        {
            MagazineComponent mag = MagazineComponent.Cast(m_weaponComponent.GetCurrentMagazine());
            if (mag) max = mag.GetMaxAmmoCount();
        }
        SetIntVariable(m_curMagMaxVar, max);
        //SetPlayerInt("CurrentMagMax", max);
    }

    // ────────── NEW: next‑mag check ──────────
    if (animEventType == m_evtMagNextCheck)
    {
        int max = 0;
        MagazineComponent nextMag = FindNextMagazine();
        if (nextMag) max = nextMag.GetMaxAmmoCount();
        SetIntVariable(m_nextMagMaxVar, max);
        //SetPlayerInt("NextMagMax", max);
    }
}`
random cloud
#

Hey guys, was trying to send a message into the chat when a player spawns. I cannot find in the docu how to do so or if its possible. I want that a msg ist sent each hour but to all players. I found this code but its just sending from the players chat: PlayerController pc = GetGame().GetPlayerController();
SCR_ChatComponent chatComponent = SCR_ChatComponent.Cast(pc.FindComponent(SCR_ChatComponent));
chatComponent.SendMessage("Hello", 1);

abstract crescent
lament oxide
abstract crescent
late locust
#

Is there any way to set another players profile image in a ProfileImageWidget or is that always my own?

lament oxide
abstract crescent
#

You can check SCR_DetonatorGadgetComponent as example

charController.GetOnAnimationEvent().Insert(OnAnimationEvent);
charController.m_OnItemUseEndedInvoker.Insert(OnAnimationEnded);```
lament oxide
#

This 100% works for his thompson mod. I'm trying to simplify it to where there are two functions, one that returns the current magazine max, and the next magazine max. So it can work for all guns based on common magazine sizes (like an m4 30rnd vs 100rnd).

abstract crescent
lament oxide
#

I do as well

abstract crescent
#

did you disable original WeaponAnimationComponent ?

lament oxide
#

On the weapon? yes, it was swapped out for the new one. I'm uploading my script here one sec.

abstract crescent
#

Oh its. my fail. WeaponAnimationComponent has OnAnimationEvent notlikemeow

lament oxide
#

What's weird is that none of the animation graph runs. I connected it up to the default reload path in the graph editor just to test it. It even with just basic logging it doesn't pop.

abstract crescent
#
{
}

class TEST_WeaponAnimationComponent : WeaponAnimationComponent
{    
    override event void OnAnimationEvent(AnimationEventID animEventType, AnimationEventID animUserString, int intParam, float timeFromStart, float timeToEnd)
    {
        super.OnAnimationEvent(animEventType, animUserString, intParam, timeFromStart, timeToEnd);
        
        PrintFormat("OnAnimationEvent %1 %2 %3 %4 %5", animEventType, animUserString, intParam, timeFromStart, timeToEnd);
    }
}```
lament oxide
#

Now define an animation event and add it to the graph so that it is specifically checked when the event node is hit.

abstract crescent
lofty pumice
#

sorry another question, i got a user script on the Scr_BaseGameMode (Named the prefab GameMode_MM_Test) i want to reference the "GameMode_MM_Test_Class"
in

MM_LootSpawnPointManager lootSpawnPointManager = SCR_BaseGameMode.Cast(GetGame().GetGameMode()).GetLootSpawnPointManager();

but i got the error "cant find variable GameMode_MM_Test_Class".

abstract crescent
lofty pumice
#

not working i cant even edit it out off the {} i used the editor thingy to add it , maybe thats not the way to do it anymore ?

river imp
# lofty pumice sorry another question, i got a user script on the Scr_BaseGameMode (Named the p...
//------------------------------------------------------------------------------------------------
modded class SCR_BaseGameModeClass: BaseGameModeClass
{
    [Attribute(uiwidget: UIWidgets.CheckBox)]
    bool m_BoolValue;    
    
    void PrintStuffToo()
    {
        Print(string.Format("The bool value from %1 is %2",this,m_BoolValue));
    }
};
//------------------------------------------------------------------------------------------------
modded class SCR_BaseGameMode : BaseGameMode
{
    void PrintStuff()
    {
        SCR_BaseGameModeClass PrefabData = SCR_BaseGameModeClass.Cast(GetPrefabData());
        if (!PrefabData)
            return;
        
        Print(string.Format("The bool value from %1 is %2",this,PrefabData.m_BoolValue));
        
        PrefabData.PrintStuffToo();    
    }    
};
//------------------------------------------------------------------------------------------------
vast flower
#

What's the difference between affiliated faction and default affiliated faction in FactionAffiliationComponent?
I assume is that default affiliated faction is prefab value (for example, civilian vehicle has CIV faction) and just affiliated faction is dynamic value that could be influenced in runtime (so, when US players gets in into civilian car, it becomes US affiliated faction with CIV as default affiliated faction), right?

river imp
#

The term default would make me think that is the one that never changes and is set by the prefab, the "AffiliatedFaction" would be the one that changes.

#

So when a DefaultFaction(US) gets into a CIV car his AffiliatedFaction would change to CIV

#

and his DefaultFaction would still be US

river imp
vast flower
river imp
#

the default is the value from the prefab

ocean kernel
#

What controls the press space to spawn character as player behavior in GM?

dire sinew
midnight talon
#

Upon entering vehicle the actual faction value gets set so AI target the vehicle if they consider occupant hostile

#

So probably useful to think of it as default faction = vehicle's own faction, faction = faction of occupant

pseudo merlin
torn bane
ocean kernel
#

also changing the affiliated faction does not propagate across all components that store faction information

#

not to all of them anyway, ie. character faction changes but my custom vehicle was still no faction

torn bane
#

No, it just sets the faction on that component, nothing else. that is why changing factions is usually done through the faction manager and or other utlities

ocean kernel
#

This is more of an issue of other components not reacting to changes in the affiliation component

#

What is the Bohemia Approved ™️ way to "just change the damn faction of this entity please"?

mighty lotus
#

Would anybody be able to tell me the mathematical relation between the linear and angular scale vector in SCR_weaponAttachmentAttributes vs the base recoil scale slider found in the muzzle component of a weapon. I am trying to make it so my attachments bring the recoil back to a realistic value as these attachments are required for normal operation.

wooden shale
#

I’m working on a project for Dynamically generating missions and spawning enemies and the programming isn’t necessarily the issue I’m having but I am having a rough time understanding how to even get players to spawn. I’ve put down a faction manager assigned the factions. Setup a spawn point and all of that

#

Still when I click play in enfusion my camera is just stuck on the ground. There’s so many different entities and components that seems to be needed to make everything work.

frosty coral
#

Is vehicles teleporting/stuttering on collisions in multiplayer normal behaviour?

wooden shale
frosty coral
wooden shale
frosty coral
lofty pumice
#

is EonInit called before OnGameStart ? i want to register prefabs to a singleton prefabmanager, but sometimes teh prefabs get initilized befor the gamestarts and wont register to the manager and sometimes it works

lofty pumice
#

i want to place spawnpoints in the editor then on game initalisation i want to first initialize a managementclass for the points, after the Manager is set up i want to register the spawnpoints to the Manager

#

but i have to ensure that the Manager is setup before the points call the register function

toxic pier
#

modded class and how they work?

lofty pumice
# river imp Use a game system.

the documentation is not very good to be honest it was a lot faster to build it myself, and its working now, i got a bug with memory leaking after resume to editor and back to game without rebuilding it. But its fixed.
I learned that sizes are persistence through game restarts and i got a check if a element in the array is null then abort it...
My array was growing each restart from 2 to 4 to 6 ... with null in the first entrys and only the last ones where filled with data

fervent stirrup
#

Entity lifecycles documentation page shows what runs in the world editor

#

Honestly pretty annoying

river imp
ocean kernel
#

How could I exclude one specific character from being spawnable via the press space to spawn player menu?

red cedar
#

Is there a relatively efficient way to detect specific entities. Such as rockets from rocket pods, 30mm bullets, and other types of vehicle-fired ammunition when they enter a trigger zone, and delete them without putting too much strain on the server?

sweet badger
red cedar
# sweet badger What is your overall goal?

I have a zone designed specifically for infantry combat, possibly with small vehicles like Humvees equipped with .50 cal turrets. However, attack helicopters, APCs, and similar vehicles can get close to this area, and I want to prevent them from engaging or strafing players inside the zone. The goal is to keep the combat focused on infantry, without interference from heavy vehicles.

sweet badger
# red cedar I have a zone designed specifically for infantry combat, possibly with small veh...

Efficiency is indeed important for something as broad as this. I'm not sure what's the best way, but here's some approaches I can think of:

  • Prevent the player from firing the vehicle while within a zone. This should be fairly efficient, but is not 100% what you're asking for as you can still shoot in from the outside.
  • If you want to delete munitions when they enter the zone, you would have to perform very frequent checks, as their speed can be extremely fast. This is not great, on the other hand the approach only requires processing of relevant munitions. If you go down this route, you would probably create a system that registers certain projectiles and also zones (points with a radius for efficiency) from a component, and then batch compare the distances several times a second. The downside of this approach is that you can technically still fire from up close and have the projectile hit before it's picked up, but maybe it can also be combined with the other approach to avoid that, if the zones are large.
  • Somehow do it before damage handling? This avoids having to keep track of projectiles, but you have to filter everything.
    But you should definitely get a second opinion on this, I am not familiar with projectiles and there may be a better way that I don't know.
red cedar
#

The second approach is also the one i had in mind but the refresh rate would have to be horribly fast -_-

#

Thanks a lot for your answer btw

abstract crescent
#

Can i hide parent class parameter that has [Attribute()]?

midnight talon
#

Oh wait you said press space to spawn I'm idiot and didn't read 😂

#

I think that placement mode is just based on game master / edit mode filters, so can probably exclude the character you want by overriding it's editable entity labels to lack whatever is currently matching

lean yew
#

I've got a mod in the works that restricts the platoon net to just SLs. This was my implementation:

#

modded class SCR_VONController
{
    //------------------------------------------------------------------------------------------------
    //! VON activation
    //! \param[in] entry which is being activated
    //! \param[in] transmitType type of entry to be activated
    //! \return true if activation was successful, false otherwise
     override protected bool ActivateVON(notnull SCR_VONEntry entry, EVONTransmitType transmitType = EVONTransmitType.NONE)
    {

        // We only care about blocking radio transmissions, not direct speech.
        if (transmitType == EVONTransmitType.LONG_RANGE)
        {
            PlayerManager playerManager = GetGame().GetPlayerManager();
            if (playerManager)
            {
                // Get the local player's ID
                int localPlayerId = SCR_PlayerController.GetLocalPlayerId();

                // Check if the player has the SQUAD_LEADER role. 
                // If they DO NOT, we block the transmission by immediately returning 'false'.
                if (!playerManager.HasPlayerRole(localPlayerId, ERoleCallsign.SQUAD_LEADER))
                

                {


                    return false; // Block the transmission
                }
            }
        }


        // If the player is a squad leader (or if it's direct speech),
        // run the original game's code for activating VON.
        return super.ActivateVON(entry, transmitType);
    }
};
#

I'm interested in any feedback if this is the correct way to do this and how one might go about testing this? I've loaded it up in the editor but only has one player, of course. I need a non-SL player to check it's blocked.

teal vapor
#

Plugins > PeerTool > configure another user, then there's a game run option to run localserver + peertool

lean yew
#

Thanks @teal vapor - i loaded it up and it didn't seem to load anything - the script compiles is there anything I need to add to the .gproj file or anything?

teal vapor
# lean yew Thanks <@242334789540118528> - i loaded it up and it didn't seem to load anythi...

This video says deprecated but the steps are still the same: https://youtu.be/YSPg4MAhDfc?t=192

This video goes over how to use PeerTool in the enfusion workbench, it is used to create a new client instance so you can test multiplayer environments.

Params: -addonsDir "Path/to/your/folder"
Example: https://i.imgur.com/vfJEad7.png

Timestamps:
0:00 Intro
0:18 Creating new project (skip if you have one already)
3:12 PeerTool Explanation
3:56...

▶ Play video
#

Instead of copying the game binary btw you can just point the PeerTool instance at the diag executable

#

you also don't need to set the mods dir. I would just show my config but currently on my work pc doing some stuff and don't really want to context switch

desert escarp
#

Is there an event thats called when an entity is shot

#

not like the character or a vehicle just like any entity

high hawk
ocean kernel
#

You could add a component on the munitions you want to intercept that would query zones and determine if it is intercepted or not

#

I wonder if there is an efficient way to look up entities by region to query only the relevant zones instead of all

late locust
#

Gridmap

red cedar
ocean kernel
#

Just the common parent perhaps

#

Ammo_MortarShell_Base and Ammo_Rocket_Base for example

red cedar
rotund kraken
#

i am new to reforger scripting and making a simple mod that needs to send messages in-game chat. am i getting this right? or there's a better way to send chat messages?

[RplRpc(RplChannel.Reliable, RplRcver.Broadcast)] - This sends to ALL clients
Rpc(RPC_SendMsgToClients, msg, msgType); - This triggers the RPC call

high hawk
ocean kernel
#

really the mortar just fires a fake shell?

high hawk
#

Rockets and everything else works fine, but mortars are no bueno

rotund kraken
#

i have been looking at a couple of mods that send messages / popups to players. it seems they all make an array of players and then loop over each player to send the message / popup.

wondering if that's the most efficient way to do it? or if there's an alternative function that lets you send a global chat message / pop up and warning to all players and so on