#enfusion_scripting

1 messages · Page 4 of 1

teal vapor
#

I previously had arsenal inventory supply draw working but looks like I broke it when getting base supply loading working

ocean kernel
#

Hm I would have thought that spawning a heli on a helipad would be handled by entity spawner component but it seems like it doesnt handle it, why is it called spawner if it doesnt spawn?

coarse pasture
#

Any reliable place to grab the server name and not just the mission header?

ocean kernel
#

There is no reliable place. Server config is the only one but that's not reliable. Mission header doesn't store server name.

coarse pasture
ocean kernel
#

You can try getting it out of the CLI Params unless the backend api call for it works somehow

dire sinew
#

Also Math3D.MatrixMultiply3(A, B, R) does actually seem to do R = B matrixMultiply A. Maybe it's intentional though to swap the order so that the vectors in vector[3] are treated as column vectors 🤷

coarse pasture
#

CLI was a good lead though

river imp
#

At least it wasn't last time I tried.

coarse pasture
river imp
coarse pasture
# river imp Share code lol
{
    private static string s_sCachedServerName = "";
    private static bool s_bServerNameReadAttempted = false;

    //------------------------------------------------------------------------------------------------
    //! Reads the server name using the BackendApi's running configuration.
    //! Caches the result.
    //! \return The server name string, or a default/error string if reading fails.
    //------------------------------------------------------------------------------------------------
    static string GetServerName()
    {
        if (s_bServerNameReadAttempted)
        {
            // Print(LOG_PREFIX_UTILS + " GetServerName: Returning cached name: '" + s_sCachedServerName + "'", LogLevel.DEBUG);
            return s_sCachedServerName;
        }

        s_bServerNameReadAttempted = true;
        s_sCachedServerName = "Unknown Server (Config Read Error)"; // Default fallback

        Print(LOG_PREFIX_UTILS + " GetServerName: Attempting to get running config from BackendApi...", LogLevel.NORMAL);

        BackendApi api = GetGame().GetBackendApi();
        if (!api)
        {
            Print(LOG_PREFIX_UTILS + " ERROR: GetServerName: Could not get BackendApi instance.", LogLevel.ERROR);
            s_sCachedServerName = "Unknown Server (No BackendApi)";
            return s_sCachedServerName;
        }

        // Create a DSConfig object to be populated w placeholder data 
        SCR_DSConfig runningConfig = new SCR_DSConfig();
        if (!runningConfig)
        {
            Print(LOG_PREFIX_UTILS + " ERROR: GetServerName: Failed to create SCR_DSConfig instance.", LogLevel.ERROR);
            s_sCachedServerName = "Unknown Server (Internal Error)";
            return s_sCachedServerName;
        }

        // Call the BackendApi function
        if (!api.GetRunningDSConfig(runningConfig))
        {
            Print(LOG_PREFIX_UTILS + " ERROR: GetServerName: BackendApi.GetRunningDSConfig() failed.", LogLevel.ERROR);
            s_sCachedServerName = "Unknown Server (Backend Read Failed)";
            return s_sCachedServerName;
        }

        // --- Extract the name ---
        // Check if the 'game' object and 'name' property exist and are valid
        if (runningConfig.game && !runningConfig.game.name.IsEmpty())
        {
            s_sCachedServerName = runningConfig.game.name; // Get name from populated object
            Print(LOG_PREFIX_UTILS + " GetServerName: Successfully read server name from running config: '" + s_sCachedServerName + "'", LogLevel.NORMAL);
        }
        else
        {
            Print(LOG_PREFIX_UTILS + " WARNING: GetServerName: GetRunningDSConfig succeeded, but 'game' object or 'game.name' was missing/empty.", LogLevel.WARNING);
            s_sCachedServerName = "Unknown Server (Name Missing in Running Cfg)";
        }

        return s_sCachedServerName;
    }```
#

Kind of of hacky workaround but it gets the job done

teal vapor
#

Is it normal for Arma to be added as a dependency of my mod? I override a couple of compositions which presumably triggered it?

coarse pasture
#

Yea

minor agate
#

And you will see, that Arma Reforger also has Core (addon/mod as dependency), which is the engine provided one.

shadow oxide
#

Why don't action value's/events get updated when you have a UI open? I've created actions and listeners for them, and they run correctly normally, however as soon as I open a dialog they no longer run. Is there a way to fix this?

river imp
#

The context for the UI is higher priority

shadow oxide
#

You think changing that will fix it?

#

Nah that didnt fix it

river imp
#

When changing things in configs you need to restart workbench sometimes

shadow oxide
#

Restart didnt fix it either :(

#

Thanks for the suggestions though

river imp
#

CharacterGeneralContext has a priority of 10
InventoryMenuContext has a priority of 120

#

Things in CharacterGeneralContext aren't "triggered" when InventoryMenuContext is active because they are at a lower priority

shadow oxide
#

My custom input context is priority 9 and my ui context is 10

river imp
#

Yeah

#

10 is greater than 9

shadow oxide
#

Priority typically means lower number has higher priority... is that now how reforger does it?

#

Hm reforger keeps quietly crashing, things still seem to work but I cant exit the sim, maybe thats having an odd affect

#

Making the input context 999 seems to allow it to detect inputs, thankyou for the suggestion! It also seems like I was re-creating the listener every frame by mistake which was causing the soft crash! Thankyou very much for your help Zelik

midnight talon
#

Hey Zelik since you're around, mind telling was that code related to metabolism you posted in here a while back for a new mod you're making or a feature coming to your character mod?

teal vapor
#

From a modded class, is there a way to call the vanilla.super implementation of the function? If we pretend Foo extends some class Menu, neither of the below examples seems to invoke Menu.Bar() -- it'll always invoke the original Foo.Bar() function.

// Example A
modded class Foo {
    override void Bar() {
      super.super.Bar();
    }
}

// Example B
modded class Foo {
    override void Bar() {
      vanilla.super.Bar();
    }
}
pliant ingot
midnight talon
#

Is there any script built in method to generate a UUID?

lofty willow
#

Anyone worked on / made .layout files? Specifically a menu

lofty willow
teal vapor
midnight talon
#

Yeah trynna make player groups persistent and it would be a lot easier if I could override them to be tracked by a UUID string instead of an int that increments and starts from 0 every time server restarts

pine nacelle
#

SCRIPT (E): Virtual Machine Exception

Reason: NULL pointer to instance

Class: 'SCR_InventoryMenuUI'
Function: 'SetStorageSwitchMode'
Stack trace:
scripts/Game/UI/Inventory/SCR_InventoryMenuUI.c:884 Function SetStorageSwitchMode
scripts/Game/UI/Inventory/SCR_InventoryMenuUI.c:714 Function OnQueueProcessed
scripts/Game/UI/Inventory/SCR_InventoryMenuUI.c:701 Function ProcessInitQueue
scripts/Game/UI/Inventory/SCR_InventoryMenuUI.c:726 Function OnMenuUpdate

What am i missing here?

teal vapor
#

apparently a null pointer check

#

did you modify that code?

teal vapor
midnight talon
#

yeah I guess a really really really really big random number could kind of work as well

teal vapor
# midnight talon yeah I guess a really really really really big random number could kind of work ...

just generate 16 random numbers and format as hex. note, not tested:

// returns 16-byte hex string
static string GenerateUUID()
{
    const string hexChars = "0123456789abcdef";
    RandomGenerator rand = SCR_Math.GetMathRandomGenerator();

    string hexString = "";
    for (int i = 0; i < 16; i++) {
      int value = rand.RandInt(0, 0xFF);
      int hexDigitHigh = (value >> 4) & 0xF;
      int hexDigitLow = value & 0xF;
      hexString += hexDigitHigh;
      hexString += hexDigitLow;
    }

    return hexString;
};
midnight talon
#

I think I'm just gonna try persisting the m_iLatestGroupID to file and init it to that value on startup which should hopefully achieve the same result of avoiding newly created groups after a restart getting IDs that collide with previously persisted but not loaded ones, but if it doesn't work I'll give that a try thanks 🙂

midnight talon
#

I swear I saw you post something about a metabolism system a while back and was wondering what the go with that is

#

though in trying to find the post I found Hydro Skunk's metabolism mod which sounds like pretty much what I was after

river imp
solid hearth
#

Can you use RplProp in a game system, vaguely remember reading about gamesytem and networking. I only remember it can use Rpc (Obviously Server->Client) so I assume it supports RplProp..? thenking

minor agate
#

Including examples of these on systems

solid hearth
#

Yeah I have adhd, those videos don't cut it for me. I'm more of a skim-reader with good ol' brute force trial and error. I thought as much tho just figured I'd ask to be sure before I find out it didn't and have to do something else cute_smile_cat_meme thx

dapper gale
#

Im trying to follow along with this video and im getting a issue i dont really understand. I copied the scripts and changed a few things like vehicle name but now im getting an error.

#

heres the script

#

this is the vid

#

I cant get it to preview like in the video

frosty coral
torn bane
#

That is an unfortunate error 🙂 hard to overlook _ vs - on this tiny font honestly

minor agate
#

Like when based on font, 1 looks the same as l

solid hearth
#

Sure would be nice to have a Replication.Refresh and Replication.RefreshEntity for no particular reason

ocean kernel
#

Like bumpme?

solid hearth
#

Yeah but on the client end

#

Just forcefully restream in an entity or all in network bubble

sleek dove
#

sus

solid hearth
#

🤨

ocean kernel
#

Lol

#

Teleport it outside and then into the replication bubble

#

Within 2 frames

solid hearth
#

Yeah let me let the player do that.. totally wouldn't be abused...

ocean kernel
#

I mean there's already dudes teleporting around

solid hearth
#

There's a lot more those dudes do..

frosty coral
red escarp
#

Hi,
I have a menu script that works fine in the editor and offline, but it doesn't open at all on the server. Can you help me identify the issue?

 {
     if (!m_GarageComp)
         return;
     
     int playerId = GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(pUserEntity);
     
     string playerGuid = GetGame().GetBackendApi().GetPlayerIdentityId(playerId);
     if (!playerGuid)
         return;
     PlayerGarageStorage storage = m_GarageComp.LoadPlayerGarageData(playerGuid);
     MenuBase menu = GetGame().GetMenuManager().OpenMenu(ChimeraMenuPreset.AGW_GarageMenuList);
     AGW_GarageMenuList applicationMenu = AGW_GarageMenuList.Cast(menu);
     //if (!applicationMenu) return;
     
     
     Print(m_GarageComp.GetStoredVehicles(playerGuid));
     int x = 0;
     foreach(auto vehicle: m_GarageComp.GetStoredVehicles(playerGuid)){
         GarageVehicleData vehicleData = vehicle;
         applicationMenu.insertContent(vehicleData.vehicle_prefab,vehicleData.vehicle_icon, vehicleData.vehicle_name,playerId,x,m_GarageComp);
         x++;
     }
     //m_GarageComp.LoadCar(playerId, m_iVehicleIndex);
 }```
torn bane
late locust
#

Any way to increase API call timeout?

torn bane
river imp
#

That has nothing to do with scripting, this isn't a feedback channel.

gloomy lynx
#

looks like a environment probe tweaking out

static mural
#

Hi there, I'm new to Arma Reforger Tools.
I'm trying to automatically spawn a prefab based on the faction that owns the control point in a conflict mode (if the US owns the point -> spawn prefab HelipadUS for example).

civic moon
#

Does anyone know how to fix my problem. If i put this in mine Server.Json: "missionHeader": {
"m_iControlPointsCap": 42,
"m_fVictoryTimeout": -1,
"m_iStartingHQSupplies": 9001,
"m_iMinimumBaseSupplies": 500,
"m_iMaximumBaseSupplies": 10000,
"m_bCustomBaseWhitelist": true,
"m_aCampaignCustomBaseList": [
{
"m_sBaseName": "TownBaseMontignac",
"m_bIsControlPoint": true,
"m_bCanBeHQ": false,
"m_bDisableWhenUnusedAsHQ": true,
"m_fRadioRange": 500
}
]
}
},

#

the base disepears

river imp
teal vapor
#

Anyone have a .gitignore template they like to use for their mod repos?

red escarp
river imp
#

calling that function on the client does nothing.

thorn anchor
#

Is there any performance concerns with having a map thats hard ref and contains a resourcename and class? im not sure how many resources will be in it yet but im guessing atleast 30-40.

brave crag
#

Anyone know how to fix my json

river imp
teal vapor
#

I noticed that at the start of the match, inSCR_NameTagData::SetGroup() the m_NTDisplay.m_CurrentPlayerTag.m_iGroupID is always -1 for the group leader.

When the next player joins though, I can see that there are two people in the group -- yet the leader still has its own name tag data reflecting -1 for its group ID. If the group leader creates a new group and the other player joins the new group, everything is fine.

Is this a known issue?

*created https://feedback.bistudio.com/T190881

#

Oh is it a race condition? or just tag is initialized before the faction? This breakpoint is hit right when you press "Deploy" for the first time

neat wolf
#

We had some guy come into our server and was promoting some docker lua program he made to one of our admins and was selling hat claimed to do recurring system chat messages on an unmodded server. Can you shed any light on this?

Still suirprised not support in RCON yet though, along with IP. We've had to scan log files with our own in-house program to log IP info and associate it to details collected via RCON

ocean kernel
neat wolf
frosty coral
#

Is IEntity's Get/SetTransform same thing as Get/SetWorldTransform?

coarse pine
#

I wrote this when drinking beer and modding so apologies in advance but it works.
Is this really the most elegant way to select the component that is explicitly a BaseTriggerComponent and not an inherited one?

minor agate
#

That is it

#

They are the same

#

difference is that SetWorldTransform is just faster because it is direct

frosty coral
#

Thanks

minor agate
#

Why do you need that specifically?

#

You are already searching for the derived class

#

IsInherited will do the same

#

If it's not it then it will give false

coarse pine
#

If I just do a simple cast, it is possible to cast CollisionTriggerComponent into BaseTriggerComponent which will cause a problem

#

Also for some reason I need to have all the other trigger components as child components of the CollisionTriggerComponent or otherwise it wont work. At least for the TimeTriggerComponent

coarse pine
minor agate
#

@coarse pine Just do
temp.Type() == BaseTriggerComponent

coarse pine
#

Yeah...I have no idea why I converted it to string...
Thanks

pliant ingot
coarse pine
static imp
#

Hello everyone I have a question. I have a scenario that uses large trigger entities to function as a restricted zone. When a player of a specific faction enters the zone, a pop up notification show on their screen warning them to turn back or be killed. The problem I am having is that when the pop up notification occurs it displays as a global server message. Everyone sees it instead of just the local player. I am trying to fix this issue without writing any scripts but I'm starting to think this is going to require a script that calls to the to the local player only. I just don't see any way in the editor to target the specific player. Does anyone know how to do this in the GUI editor? Thank you:)

ocean kernel
#

Why cant server command name have a slash in its keyword?

#

Lol

#
// works
override string GetKeyword() { return "sat_plugins/json"; }
// doesnt work?????
override string GetKeyword() { return string.Format("%1/json", super.GetKeyword()); }

Note: super.GetKeyword() returns "sat_plugins"

coarse pine
#

Is there are way to make an action show that is added to a gadget that another player holds in their hand?
For example when player 1 has a grenade in their hand, player 2 could do an action on the held grenade.

ocean kernel
#

PULL THE PIN LMFAOO

rich pecan
#

Thanks for the mentions on this. Much appreciated. Is there a link to a BI issue tracker, or known issue list about this one, whether it's addressed in a recent update? Thanks!

torn bane
rich pecan
torn bane
#

It is done via startup cli params

rich pecan
torn bane
#

No you do not call anything manually, you use the cli param exclusively

rich pecan
coarse pasture
#

Anyone have a lead on the .conf that defines player/controller markers on the map? Having a hard time tracking down where those come from 😅

torn bane
#

It is triggered via SCR_BaseGameMode.EndGameMode()

#

If you want the server to physically restart then you will also need to set -autoshutdown as cli param and -autoreload disabled or -1

teal vapor
#

@torn bane sorry for the ping but while you're around, I was asking before about the format used by SCR_BinSaveContext and whether it's something standard like BSON or CBOR or if it's a proprietary format. I saw you suggesting folks use this in the past -- are you able to share any insight?

torn bane
#

Custom bitstuffing compression, not intended for parsing externally. If you want the exchange data, use json

teal vapor
#

Thanks for the info

rich pecan
#

Was anyone able to get -autoreload 0 to work after calling SCR_BaseGameMode.EndGameMode() ?

rich pecan
#

I think at the end of the day, it still calls GameStateTransitions.RequestScenarioRestart()

topaz locust
#

I have an issue that seems to be an engine side error and I have no idea what it means or how to fix it. Any ideas?

topaz locust
#

It happens when a regenerating hitzone on an entity I have takes damage. Seems to randomly do it so I can't pinpoint the exact condition but the result is the health gets instantly nulled out and no longer regenerates if I click abort in the above error box

west prism
#

Hey i have next problem by using CE

by github it says

Run the server ONCE to generate the default CE_ItemData.json file (file can be found in your server profile folder, and goes $profile/.CentralEconomy/CE_ItemData.json).

bei Nitrado hosting i have no file found but loot spawns

midnight talon
#

Any EPF users had any issues with persisted character entities getting deleted between it being spawned in LoadCharacter and attempting to handover control of it in OnCharacterLoadComplete?
The entity seems to spawn fine initially but by the time OnCharacterLoadComplete callback runs it has been deleted. Could possibly be some bad override or mod I have running but I don't think anything I have should impact that, almost seems more like the entity just gets deleted by ref counting or GC on next frame

river imp
midnight talon
#

Ok cool guess I just never noticed / repro'd it until 1.3 so thought it was maybe something recent

candid garnet
#

when making a component, when should I use child components?

tawny lotus
#

I drop/spawn an UAZ452 Ambulance on the map. The inventory has arsenal in it and I'd like get rid of that. Is that defined in the vehicle prefab or does that come from gamemode? Can I disable it on the spawned vehicle? Or set it to zero?

river imp
tawny lotus
#

You're right and I did that. I could not find anything related to it so that's why I'm asking. Not sure which component it should be .. nothing seems to be related to arsenl.

river imp
#

Well if you looked and there isn't anything related to the arsenal in the prefab what does that mean...?

candid garnet
#

SCR_ResourceComponent might have some stuff in it too

#

SCR_ArsenalComponent exists on other arsenal related objects

#

SlotManagerComponent has a virtual arsenal slot for the UAZ452

tawny lotus
torn bane
topaz locust
hollow gazelle
lofty willow
#

why is it that I dont have a mouse when my .layout file is shown?

river imp
minor agate
#

Could you elaborate?

fervent cedar
#

probably need to use thee menu for interacting with the layout with a mouse
or script a new mouse using the inputs and block looking around

pseudo merlin
#

Someone knows the place where a VON direct speech/message is send and received?
Like what or is there something triggered in script the moment a player talks?

teal vapor
#

But from looking at surrounding code it seems like the player controller has a SCR_VoNComponent.

pseudo merlin
thick arch
#

does anyone know of a method to convert a string hash back to a string?

thorn anchor
open pier
thick arch
ocean kernel
#

Well, hashes are supposed to be one way

open pier
thick arch
open pier
river imp
#

I'm confused as to why you're doing that.

#

You should setting enums by either int or string

#

When using string SCR_Enum has a function to get the value iirc

thick arch
# river imp Can you show an example of that?

bassically, I was converting the string into a hash to set a enum as a "string" without actually having a string since that's not possible:

the basic idea was to store the string as a int then convert that int into a string later down the line.

river imp
#

Maybe i'm confused as to what you're actually trying to do because it makes no sense to me.

#

Oh, I think I understand now.

#

You're trying to use enums in a way they arent meant to be used

#

enum values are ints

river imp
#

Clearly you know that lol. That's why you're trying to have them be hashed strings

minor agate
thick arch
spark otter
#

What would be the best way to save the player that armed a mine. Im guessing in a component of the mine? Maybe SCR_MineWeaponComponent?

thorn anchor
#

Could always have a map of all the enums with a string tied to each enum.

thorn anchor
spark otter
#

Yeah I think Im going with an array of all players who have armed the mine's in the mine weapon component. Im adding XP for disarming a mine and am trying to prevent exploiting the XP by repeatedly arming and disarming. So if the player is in the array, it will not process the XP reward.

open pier
#

With the hash stuff, isn't the number hes getting from hashing his string an int or is it not because of it being negative and/or a larger number than, I believe int32? Looking to correct myself if my thoughts are wrong on this

#

Or is it because the enum itself is a string which equals an int

minor agate
#

unlike resolving collisions in a hash map for example

viscid fiber
#

Hello everyone I've been modeling a scuba tank but have No idea how I would get a script to work with the prefab has anyone got any clue how I could go about doing it?

minor agate
minor agate
#

What do you want to make it do?

viscid fiber
#

Make it so you don't die under water for a period of time

minor agate
viscid fiber
#

@minor agate okie makes sense I have no programming experience just modelling and texturing so trying to mod scripts is new to me. I'll try find the file your talking about and sus it out thankyou for your advice king

minor agate
#

override


  SCR_CharacterControllerComponent::UpdateDrowning()
#

Make sure in there, that while you are in your vehicle to set as well, and avoid calling the super of it. But do not forget to call super if you are not in your vehicle!

m_bCharacterIsDrowning = false;
viscid fiber
#

Okie thankyou so much @minor agate I appreciate it

minor agate
#

@viscid fiber Although, based on what I see in that method

#

You can set CompartmentAccessComponent to be water tight

#

And if player is on that compartment, then this is done automatically for you

#

So it can be set on Compartment Slot

viscid fiber
#

What prefab should I base it off then you reckon

minor agate
#

For that you must have used Compartment Slots

#

According to the code here, there should be a Watertight setting

solid hearth
#

I've seen it on that component

minor agate
#

Enable it so that you do not drown if player is in it

solid hearth
#

Should be a float from 0->1, 1 being completely air-tight

minor agate
#

It's there, yes

solid hearth
#

There's another one somewhere then that has a float think I seen it on the brdm2

viscid fiber
#

So I need to make my scuba tank a vehicle ?

solid hearth
#

No, I think he just assumed you were making a mini sub?> thenking

minor agate
#

Yeah

#

I assumed it was a mini sub

#

Well

viscid fiber
minor agate
#

then you need to add your extra behavior then

#

To that method as I told you

solid hearth
#

Someone told me actions stop working underwater, that still true..? thenking

candid garnet
#

how do you replicate a variable that contains an IEntity? RplProp throws a ton of errors.

trying to sync a IEntity in one of my components to all clients' versions of the component

minor agate
#

What do you mean by sync IEntity?

solid hearth
#

You'd be better off using RplId

candid garnet
# minor agate What do you mean by sync IEntity?
    [Attribute("1", UIWidgets.ComboBox, "Defibrillator Emulation Type", "", ParamEnumArray.FromEnum(ACE_Medical_EDefibrillatorEmulation))]
    protected ACE_Medical_EDefibrillatorEmulation m_EDefibrillatorEmulation;
    
    ACE_Medical_DefibrillationSystemSettings m_Settings;
    static const ref array<ACE_Medical_ECardiacRhythm> shockableRhythms = { ACE_Medical_ECardiacRhythm.VF };
    
    // Offset variables
    protected float m_fAnalysisTimeOffset = 1;
    protected float m_fChargeTimeOffset = 0.0;
    
    // Analysis variables
    protected float m_fAnalysisTime = 1;
    protected float m_fAnalysisAmount = 0.0;
    [RplProp()]
    protected bool m_bIsAnalysing = false;
    [RplProp()]
    protected bool m_bIsAnalysed = false;
    
    // Charge variables
    protected float m_fChargeTime = 5.5;
    protected float m_fChargeAmount = 0.0;
    [RplProp()]
    protected bool m_bIsCharging = false;
    [RplProp()]
    protected bool m_bIsCharged = false;

    ACE_Medical_DefibrillatorSoundComponent m_soundComponent;
    
    // Needs replication
    //[RplProp()]
    IEntity m_patient;

need to send m_patient to all clients for user actions

minor agate
#

and replicate that

minor agate
candid garnet
#

alright I'll try that. second question:

the call:

networkComponent.RequestDefibrillatorNotification(ENotification.ACE_MEDICAL_SHOCKDELIVERED, GetOwner(), SCR_ChimeraCharacter.Cast(defibrillatorComponent.GetConnectedPatient()));
    void RequestDefibrillatorNotification(ENotification type, IEntity defibrillator, SCR_ChimeraCharacter patient)
    {
        Rpc(RpcAsk_GetDefibrillatorNotification, type, Replication.FindItemId(defibrillator), Replication.FindItemId(patient));
    }
    
    //------------------------------------------------------------------------------------------------
    [RplRpc(RplChannel.Reliable, RplRcver.Server)]
    protected void RpcAsk_GetDefibrillatorNotification(ENotification type, RplId defibrillatorID, RplId patientID)
    {
        SCR_ChimeraCharacter patient = SCR_ChimeraCharacter.Cast(Replication.FindItem(patientID));
        if (!patient)
            return;
        
        ACE_Medical_CardiovascularComponent cardiovascularComponent = ACE_Medical_CardiovascularComponent.Cast(patient.FindComponent(ACE_Medical_CardiovascularComponent));
        if (!cardiovascularComponent)
            return;
        
        IEntity defibrillator = IEntity.Cast(Replication.FindItem(defibrillatorID));
        if (!defibrillator)
            return;
        
        ACE_Medical_DefibrillatorComponent defibrillatorComponent = ACE_Medical_DefibrillatorComponent.Cast(defibrillator.FindComponent(ACE_Medical_DefibrillatorComponent));
        if (!defibrillatorComponent)
            return;
        
        switch (type)
        {
            case ENotification.ACE_MEDICAL_SHOCKDELIVERED:
            {
                SCR_NotificationsComponent.SendToPlayer(m_pPlayerController.GetPlayerId(), type, cardiovascularComponent.GetShocksDelivered());
                break;
            }
            // add more
        }
    }
#

I can't seem to get it to find the ID of the defibrillator entity. it always comes back as -1. what are the things I need to go back in check?

minor agate
#

But there is a gotcha

#

Nothing gets registered into replication unless it needs Rpl

#

Entities by default do not have rpl layout

#

So most of them do not have RplID

#

Safer bet here, is to get the RplComponent one

#

Then sync that

solid hearth
#
static IEntity GetEntityByRplId(RplId id)
    {
        if (!id.IsValid())
            return null;

        Managed instance = Replication.FindItem(id);
        if (!instance)
            return null;

        RplComponent rplComponent = RplComponent.Cast(instance);
        if (rplComponent)
            return rplComponent.GetEntity();

        return IEntity.Cast(instance);
    }
    
    static RplId GetRplIdByEntity(IEntity ent)
    {
        if (!ent)
            return RplId.Invalid();
        
        RplComponent rplComponent = RplComponent.Cast(ent.FindComponent(RplComponent));
        if (rplComponent)
            return rplComponent.Id();
        
        return Replication.FindId(ent);
    }
minor agate
#

then on the method I did there

solid hearth
#

I use those methods for getting RplId of an entity

minor agate
#

Do RplComponent instead then GetOwner to get the patient ent

candid garnet
solid hearth
#

The Component part is just type casting you'd have to change it up to uhh

candid garnet
#

alright, I'll try to implement the above

solid hearth
#

RplComponent.Cast(ent.FindComponent(RplComponent))

#

There fixed it shypeepo

scarlet dune
#

oops wrong chn

open pier
candid garnet
#

I can't seem to get to the second breakpoint. First breakpoint is reached on clients fine, but it doesn't reach the ask method on the server. I believe I followed other examples to the T.

minor agate
solid hearth
#

Start jamming everything on the playercontroller cat_thumbs_up

candid garnet
#

something like this?

solid hearth
#

Wait are you using an action? You can sort of simplify this and override CanBroadcastScript and HasLocalEffectOnly, Return false for localEffectOnly and false for CanBroadcastScript (I think..?) And that code in the performAction should only be running on the server. Otherwise you'd have to setup multiple rpcs in a component that would go on the playercontroller and use that to talk back an fourth between server/client/client(s)

candid garnet
#

yeah all the defib actions are on the defib except for one... this connect patient one which is on the character. its what is throwing me for a loop

solid hearth
#

Well you can do like I said and the action would run on the server, depending what all you're doing it should be... fine..

candid garnet
#

back to formula

solid hearth
#

I'd look at the description and functions on the ScriptedAction thing (can't remember name exactly or functions to override)

candid garnet
#

maybe what was confusing me was I was assuming that actions were local to the client

solid hearth
#

It depends

#

Normally when you do an action that you want to execute on a server, you set it so it's not local and check ownership or the dirty Replication.IsServer

#

Setting CanBroadcastScript to false means it won't tell other clients to also perform that action

#

Probably safe to still check if authority/owner of the pOwnerEntity to be 100% sure

candid garnet
#

does CanBeShownScript function in a similar way or is it always local?

solid hearth
#

CanBeShownScript is local to the client

candid garnet
#

yeah so that's where the trip up is. I have to check and see if a patient is connected with GetConnectedPatient, but if I call it directly like this, it pulls from the local version of the component which would always be null unless I replicated the entity. All other defib actions have similar checks as well. It seems like my replicated bools and floats replicate fine without any extra stuff, but replicating and entity on the other hand...

solid hearth
#

So wait what part is failing exactly eeeh

candid garnet
#

Everything works fine as the authority (listen server) initiating the actions. GetConnectedPatient() always returns null on my proxies. I can't get m_patient on the defib component to replicate to all machines, and if I initiate the connect patient action on a proxy, it will not replicate to the authority's version either.

solid hearth
#

And this connect option is connected directly to a character entity?

candid garnet
#

aye

#

on the character's action manager

solid hearth
#

And the Defib component as well?

candid garnet
#

connect option is not on the defib's action manager. only analyse, charge, shock, disconnect. connect is only on the character

#

I got everything functioning correctly in SP, and now I'm working MP into it

solid hearth
#

🤨 I'm bored and this is interesting, if you want we can hope in a call and show me the full chain and I can help you figure it out. I have to see the full flow to understand where to correct thinkingpepe

candid garnet
solid hearth
#

I do not thenking

candid garnet
solid hearth
#

Night time is the best time.. I joined and pulled up the branch nodd

candid garnet
#

got a bunch of stuff in prog and not committed, basically moving things down in hierarchy to allow for more extensions later, but the logic is still the same

faint talon
#

I created a script that spawns vehicles randomly in a radius, what's the cleanest way to check for collision before spawning (Buildings, objects, other vehicles etc?)

serene fox
#

What's the difference between
.SetOrigin
.SetWorldTransform
.Teleport (BaseEnt)

And does all of them called on the proxy where character is local?

faint talon
serene fox
midnight talon
#

Add one to each garage prefab then every garage in your world can spawn vehicles

#

I also put vehicle spawners on the repair ramp prefabs

#

You'll need to use the Teleport->activate physics method used for placing entities in Build Mode to be able to place them on top of non-solid non-terrain meshes though, snaptoground method puts them in the middle of the repair ramp which I guess makes sense given its name 😂

high glade
faint talon
river imp
#

Also, how about testing it out before posting it here? AI generated script that you didn't bother to test otherwise you'd know it doesn't compile.

candid garnet
#

also to make things in the editor, you'll have to edit the text file of the layer, adding the entity

teal vapor
#

SCR_MapMarkerEntity defines the position prop as:

    [RplProp(condition: RplCondition.NoOwner, onRplName: "OnUpdatePosition")]
    protected vector m_vPos;

I've got some logic in the OnUpdatePosition callback but since this is marked as NoOwner I never hit the breakpoint in the debugger.

What I've done for now is override the EOnFrame function, test if the var changed, and call the callback manually. Is this the right approach for testing?

candid garnet
#

do you know how to debug your clients using the ports?

teal vapor
#

also to note the other thing is that the workbench instance doesn't trigger the behavior. I'm unsure if this is something that would happen in a real scenario? or if this is unique to how the workbench is set up

candid garnet
#

well the workbench is the authority when you are using it to debug

minor agate
#

So those things do not get called on auth

candid garnet
# teal vapor No, got a guide?

if you go to your peer tool or dedicated server tool, set up your params with a debuggerPort. you can then in the script editor, select custom and put that port in. now your console is linked to that client

teal vapor
#

Appreciate it

teal vapor
#

Is this a typo in SCR_MapMarkerEntrySquadLeader? group.IsPlayerInGroup(playerController.GetPlayerId() == playerId) would be equivalent to group.IsPlayerInGroup(0) or group.IsPlayerInGroup(1) no?

//------------------------------------------------------------------------------------------------
    //! SCR_AIGroup event
    protected void OnPlayerRemoved(SCR_AIGroup group, int playerId)
    {            
        PlayerController playerController = GetGame().GetPlayerController();
        if (!playerController)
            return;
        
        if (m_bCurrentSquad == group && group.IsPlayerInGroup(playerController.GetPlayerId() == playerId))
        {
            m_bCurrentSquad = null;
            UpdateToolEntryState();
            
            SCR_MapMarkerSquadLeader marker = m_mGroupMarkers.Get(group);
            if (marker)
                marker.UpdatePlayerAffiliation();
        }
    }
slow acorn
#

Does anyone know of a function to get the material the player is standing on/looking at? For example Grass or Sand emat? I know you can get the object the player is looking at .GetPlayerCamera().GetCursorTarget()

high glade
river imp
high glade
#

you always have to start with scratches - that's what I am doing, need a sketch, now gonna eliminate not logical things and maybe gonna learn smth 🙂

river imp
midnight talon
minor agate
teal vapor
#

For some reason in this map marker mod I'm working on for showing players on map, everything works good... but only after the master client opens their map? Otherwise peers 2 and 3 never get the entities replicated.

As soon as I opened the map however, I see the replication event + clients agree it should now be visible:

18:44:29.289 WORLD        : UpdateEntities
18:44:29.289  RPL          : rpl::Pip::ProcessNetToGame
18:44:29.289   SCRIPT       : Is master: 0
18:44:29.289   SCRIPT       : Tag for player 2 should be visible. Global visible? 1

I've also tried just forcing the issue by making them immediately visible regardless of my logic and they still don't work. Player ID 1 needs to open their map first.

Any ideas why the other players don't get the markers synced immediately?

frosty coral
#

Can anyone elaborate on the difference between TracePosition and QueryEntitiesByOBB? Which should be used when?

river imp
teal vapor
river imp
#

No one would really know unless they've tried what you're doing.

teal vapor
#

the lifecycle of the markers upon clients joining just isn't super obvious to me and unfortunately debugging this specific scenario* is a pain in the ass

teal vapor
thorn anchor
#

is there a guide or write up someone has done on json? im trying to start a small db for storing playerstats and info. ive never touched json before so im lost even after reading documentation. like is there a way to make a json template as a reference for enforger to duplicate?

teal vapor
teal vapor
# teal vapor For some reason in this map marker mod I'm working on for showing players on map...

Ok so my map marker problem summarized: I was only attempting to call SetTarget() on the marker when it was being created. Since I'm tracking players, sometimes the PlayerControlledEntity wasn't available. Had to double-check and yes I was missing a marker.SetTarget() on player spawn.

The reason why the marker appeared in the corner of the map is because it's the null vector. and EOnFrame had no entity to use for updating positions, so it remained null.

thorn anchor
# teal vapor what's the disconnect? like just understanding json syntax, schema or what?

Well using the arma methods etc. json looks pretty simple. Just confused with all the different classes and methods. Like creation and packing of json files. Plus formatting as well inside reforger script. Like having the hierarchy based on one string object. I’ll have a read on that documentation and see if it helps. Mostly just stuck on proper creation, expanding etc. also would a game mode component suffice for having the json file be written server side?

teal vapor
#

Mostly just stuck on proper creation, expanding etc. also would a game mode component suffice for having the json file be written server side?

I'm the wrong person to ask for this since I just recently started modding but I think so?

Like having the hierarchy based on one string object.

if the formatting of the serialized data is throwing you off, try pretty printing it in your favorite editor or in an online prettery printer. It's just a nested dictionary at the end of the day.

{"key": "value", "key": { "oh look": "another dictionary" } }

Are you manually constructing the data with SCR_JsonSaveContext or a JsonApiStruct? If you control the data structures I'd say just use the latter to simplify things: https://community.bistudio.com/wiki/Arma_Reforger:JsonApiStruct_Usage

ocean kernel
#

Step 1 of json in reforger is dont use JsonApiStruct

torn bane
red escarp
#

Hi,
I have a menu script that works fine in the editor and offline, but it doesn't open at all on the server. Can you help me identify the issue?

 {
     if (!m_GarageComp)
         return;
     
     int playerId = GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(pUserEntity);
     
     string playerGuid = GetGame().GetBackendApi().GetPlayerIdentityId(playerId);
     if (!playerGuid)
         return;
     PlayerGarageStorage storage = m_GarageComp.LoadPlayerGarageData(playerGuid);
     MenuBase menu = GetGame().GetMenuManager().OpenMenu(ChimeraMenuPreset.AGW_GarageMenuList);
     AGW_GarageMenuList applicationMenu = AGW_GarageMenuList.Cast(menu);
     //if (!applicationMenu) return;
     
     
     Print(m_GarageComp.GetStoredVehicles(playerGuid));
     int x = 0;
     foreach(auto vehicle: m_GarageComp.GetStoredVehicles(playerGuid)){
         GarageVehicleData vehicleData = vehicle;
         applicationMenu.insertContent(vehicleData.vehicle_prefab,vehicleData.vehicle_icn, vehicleData.vehicle_name,playerId,x,m_GarageComp);
         x++;
     }
     //m_GarageComp.LoadCar(playerId, m_iVehicleIndex);
 }```
#

how to use rpl or rpc for getbackend api from server to client

thorn anchor
thorn anchor
ocean kernel
#

yes

thorn anchor
#

im assuming this is what you use to create new entries automatically and recall info from them. oh man.

frosty coral
#

What TracePosition is actually tracing? If i use callback which just returns "true" it catches entities which are not even within the OBB (as if it traces against entity's AABB instead of geometry/colliders). If i use null callback it doesn't always catches entities which geometry/colliders intersects OBB. I've tried different flags, different layermasks/targetmasks. Last resort asking here.

#

with "true" callback this already gives tracedEnt wardrobe

#

with null callback this doesn't catch the wardrobe, though if i put it a bit deeper it catches

thorn anchor
# ocean kernel yes

How do I get the savecontext to format nicely instead of minified? do I have to run it through a format method?

ocean kernel
# thorn anchor How do I get the savecontext to format nicely instead of minified? do I have to ...

Snippet from one of my projects

    static bool JSON_SaveToFile(string path, Managed data, bool useTypeDiscriminator = false) {
        ContainerSerializationSaveContext saveCtx = new ContainerSerializationSaveContext(false);
        if (useTypeDiscriminator)
            saveCtx.EnableTypeDiscriminator();

        PrettyJsonSaveContainer container = new PrettyJsonSaveContainer;
        saveCtx.SetContainer(container);

        if (!saveCtx.WriteValue("", data)) {
            PrintFormat("ServerAdminTools_Util | Serialization of '%1' failed for file '%2'", data, path, level: LogLevel.ERROR);
            return false;
        }
        
        return container.SaveToFile(path);
    }
abstract crescent
#

how can i read or view crash/dump **mdmp **file of reforger?

torn bane
abstract crescent
# torn bane You can't but we can. You can send it to me, or better submit a crash report and...

i just ask it for future. I want know is it software or hardware issue when players ask me.
As example here:

21:26:25.807 RENDER    (E):   func: m_pD3DDevice->GetDeviceRemovedReason()
21:26:25.807 RENDER    (E):   C:\jenkins\cpu\workspace\continuous_branches_stable_1.3.0\ARGamecode\Enfusion\Enfusion\src\render\enf_rendmainimpl.cpp(3138): enf::RendererImpl::EndFrame
21:26:25.807 RENDER    (E): Device removed, reason: DXGI_ERROR_DEVICE_HUNG
21:26:25.808 ENGINE    (F): Crashed```
open pier
faint talon
#

Hey all, for QueryEntitiesBySphere

How do I filter for vehicles specifically?

sweet badger
#

In your filter method

faint talon
thorn anchor
#

what is the best path to ensure that the file is in a good spot for server side logging.

open pier
#

Probably in your $profile:logs

thorn anchor
#

mm let me rephrase, for storing a database of player info.

#

im assuming its best practice to have a seperate json for each player, stored in a stats folder?

open pier
#

EPF seems to do it in profile/.db I'd assume anywhere you have access to is good enough but better to be organized

thorn anchor
#

wondering if I should just move over to epf. probably makes keeping track of stuff way easier.

open pier
#

Definitely makes things simpler but with larger files it seems to cause replication crashes.if you can try to do a more personalized persistence framework

faint talon
faint talon
#

Anyone know if there is a SurfaceType equivalent for enfusion?

I would like to know if a position is on a road, dirt or asphalt

serene fox
#

You need to get the SurfaceIndex...

// tarmac 1000-2000 | Dirt 2000-2310 | Forest Coniferous 2310-2312 | Forest Deciduous 2312-2500 | Gravel 2500-2700 | Pepples 2700-2800 | Sand 2800-2810 | Beach Grass 2810-3000 |
// Grass 3000-3121 | Grass Tall 3121-3122 | Cropfiled 3150-3152 | DryGrass 3152-3500 | Grass2 3500-3800 | Seaweed 3800-5000 | Wood hollow 5000-5110 | Wood solid 5110-6000 | Metal 6000-6110....

hollow oak
#

howdy folks! Could someone explain:

    /*!
    Forcibly enables simulation of vehicle, only meant for cinematics, not to be used in any game logic!
    */
    proto external void ForceEnableSimulation();

why it is only meant for cinematics, not to be used in any game logic ?

frail hound
#

How i can move vehicle with animation and other things from script? Mb IEntity the only ones option for physic move/or not??? Sry for english, and thank's for advance

red shoal
#

Hey,
At the moment, I'm working on a stats webpage that tracks player progress in vanilla server. I’ve already built the full data structure for player saves, but I need your guidance on two key areas:

1-How to control or customize the timing of player data saves.
2-How to track and capture the killfeed data.

high hawk
ocean kernel
#

Only ones you know of

thorn anchor
#

track and capture killfeed data??

high hawk
thorn anchor
#

doesnt killfeed data just come from a gamemode component?

ocean kernel
#

They trolled me

high hawk
thorn anchor
#

ahh

high hawk
#

Tell me how 76015angrypepe

thorn anchor
#

couldnt you just modify instigatordata to capture the weapon used by the killer when the other player dies. or something similar?

high hawk
#

PS tho

#

Mods... Easy

thorn anchor
#

wouldnt that be how they are kind of doing it? capturing the killers weapon or capturing who dealt the damage and with what. I havent looked into anything so im just spitballing.

open pier
#

Can't change anything just gotta use what's available. Maybe there's a trick for more verbose logging

thorn anchor
#

ohhh

slow acorn
lofty stag
#

I am trying to test a config file in workbench but I am having trouble getting them to populate in the profile folder. Any settings that I need to check? I

teal vapor
# high hawk https://stats.team-elan.com/

My guess is server-side code injection to do a server-only mod. Find the engine routine that allows for executing a script from a file -> inject native code into the server process -> execute the engine routine.

#

but my understanding is this breaks the EULA so...

candid garnet
#

alright, how do I troubleshoot:

Kick cause code: group=1 'REPLICATION', reason=1 'SYSTEM_FAILURE'

when using dedicated server tool on my clients. I'm assuming I have an error in my replication somewhere, but the replication works fine on a local listen server with the peer tool. Not getting any other logs in console or compiler to go off of.

undone patrol
#

how to make an automatic detonation timer like a lighting projectile
Only for rockets and Cmponent Rocket Ejector blobdoggoshruggoogly

candid garnet
#

do you have something in the search bar?

thick arrow
spark otter
high hawk
river imp
#

This isn't for Arma 3

#

This channel is for Arma Reforger

brazen falcon
#

oops thank you

frosty coral
#

Why does TracePosision of OBB (blue box) picks up this wardrobe? The depth is > 0 but it still detects a hit.
This happens only if I use callback (even with just true in it). If i use null callback there is no detection until the box hits geometry, which is what i'd want.

#

I've tried QueryEntitiesByOBB but it also gives me false positives.

midnight talon
#

Is there any way to do union types or make a type nullable in Enforce? I have a prop typed as ResourceName that I would also like to be able to unset back to null but doing so gives me "Incompatible parameter" compiler error

midnight talon
sleek dove
frosty coral
narrow aspen
#

maybe a stupid question. Can I spawn an ambient patrol spawnpoint through a SF slot? Or how can I modify the slot script to check closest player and spawn an Explosive effects aroud the player.

#

for example, I modded the ambient patrol system to make a ambinet explosive system, how can I disable it according to a task state (e.g. destroy a mortar placement).

sleek dove
sleek dove
torn bane
midnight talon
#

Would feel a lot cleaner if I could just do a union type like ResourceName | Null m_itemPrefab; or if there was a generic type like Nullable<ResourceName> then I could just set it back to null

#

Would give much better type safety TBH because then the compiler knows that something can be null and warn you if you try to access it w/o null check instead of you just finding out from logs/crashes at runtime

sleek dove
undone patrol
#

Is ProximityTriggerComponent a working trigger? Otherwise, regardless of the distance, it immediately activates. The only thing that breaks it is Safety Distance
Or is its essence triggered by the distance traveled, not by the distance to the ground?

red escarp
#

how to use rpl or rpc for getbackend api from server to client?

faint talon
trim musk
#

Is there a way via scripting to set limits for different vehicle types?

red escarp
#

string playerGuid = GetGame().GetBackendApi().GetPlayerIdentityId(playerId);

how yo get in server and send to client?

high hawk
faint talon
#

Anyone know why EPF takes a hissy fit when I add a map spawn in pants on the character using the storage slot component?

Is there something else i should be doing?

thorn anchor
teal vapor
undone patrol
#

@fickle ingot

fickle ingot
#

Gentlemen, I'm an aspiring screenwriter here, could you help me? The essence of the dilemma is that I need data on the direction of the cannon (mortar) firing, namely the angle and distance that will be read if the cannon's position changes and a timer signal is sent to the projectile so that it explodes according to the ballast table. The task seems to be clear, but I can't figure out which component to access, I just figured out how to give a certain time to the projectile from the turret to the projectile, I was asked to help, and I just need to write a regular program on a computer, not a script in a game where I don't really understand who is working with what.

river imp
fickle ingot
candid garnet
#

Are you trying to make an external program? Or something in game.

fickle ingot
river imp
#

"I just need to write a regular program on a computer, not a script in a game where I don't really understand who is working with what."

fickle ingot
#

That is, I pointed the gun at 2 kilometers, fired, and the shell should explode as a cluster.

fickle ingot
#

I meant that I write mainly programs for office employees.

#

And I was asked to help with such work experience, in modification.

#

I'm researching the mother part that was available on the wiki, but alas, there is no reference material for every component, module, class, etc.

river imp
#

The game is the reference material

fickle ingot
#

Yes, open the script every time, and there will be a million more scripts.

river imp
#

Yeah that's how games work

fickle ingot
#

In any case, where do I get the position of the mortar/turret sight to matter?

spark otter
#

When I script mortar stuff in my scenario, I just use a waypoint for the target, I believe the calculations are done engine side where we can't see?

#

This is for ai using the mortars.

fickle ingot
#

Let's imagine primitively, I have a mortar in my hands, to put it as accurately as possible Multiple launch rocket system, I aim the sight at a distance of 5,000 meters, at this moment the script works and every time the position of the sight is changed, it updates the data in order to program the missile for a certain time of explosion, so that the explosion occurs in the air, and not in the ground. And thus, checking the data through the ballistics table, he takes the time before the explosion from there and instructs the missile to explode in 30 seconds (conditionally).

teal vapor
#

SRC_VonComponent::OnReceive() takes a float quality argument that I was trying to examine. I set a breakpoint here but the call stack is just this function so I'm assuming the logic which calculates quality is determined in the native side of the engine?

spark otter
# fickle ingot Let's imagine primitively, I have a mortar in my hands, to put it as accurately ...

I would take a look at these two classes: c class SCR_AIStaticArtilleryActivity class SCR_AIGetArtilleryAimDistanceCompensation This is where I do artillery stuff for my scenario as far as aiming and setting a new waypoint. But now that I think about it, I wonder if it would work if you just lifted the target waypoint off the surface and into the air for it to explode above the ground, or if it actually needs to hit something to function? 🧐 ```c
AIWaypoint_ArtillerySupport.et

fickle ingot
#

Thanks for the tip.

#

I will let you know if it helped me. In any case, maybe the bm-21 cluster will be made faster.

teal vapor
# teal vapor `SRC_VonComponent::OnReceive()` takes a `float quality` argument that I was tryi...

Follow-up on this. Unless I'm mistaken it seems to me like much of the VON system is done in core engine rather than scripts. So let's say I want the server to identify when someone is speaking. I don't think there's a direct method of this that's observable in scripts today? So I think I'd need some component or system to hook m_OnCaptureVON in SCR_VoNComponent and RPC to the server.

Does this align for other who may have looked into this?

minor agate
teal vapor
#

I think I can do what I desire by just doing a client-side RPC to the server to notify my script

pseudo merlin
sleek dove
faint talon
torn bane
reef crescent
#

If i want to make something move and rotate with a signal do i need coding experience or is there another way?

sleek dove
#

No, just create an animation, create an animation variable, and then in AnimationControllerComponent, you can bind an animation variable to a signal, so animation variable value will always be equal to the signal value

reef crescent
teal vapor
inland bronze
#

@torn bane what are common reasons why EPF would crash Workbench to desktop with no log on saving data when exiting play mode?

I’ve kinda determined it to not be any of the save data classes, as commenting out the methods within them still produces a crash every time on exiting of the play mode. Using the JSON database format, can provide any other info necessary 🫡

#

Of course, definitely open to revisiting my save data classes if I’ve missed something and provide code if needed

#

Those components that are used for the save data are connected to a GameSystem as well, not sure if that effects that

torn bane
inland bronze
#

The crash report submit option doesn’t show on crash, but maybe that’s a thing I’ve set to ignore or something Hmm

teal vapor
inland bronze
#

I don’t have any launch parameters set to disable it either

reef crescent
inland bronze
reef crescent
#

oh i read it now

torn bane
#

If the reporter does not open thats unfortunate hmmm. I will need to reproduce it then on our debug binaries. for that please try and collect the necessary setup, zip the exact mod code zip and db used if relevant and make a feedback tracker ticket please

inland bronze
#

@torn bane I looked over my scripts again and I believe I solved the issue, which was writing any scripts after midnight lmao. I appreciate the help and insight!

Also, I noticed with EPF that the EPF_PersistanceComponent is not added to the Handwear_Base.et prefab and subsequently any inherited prefabs, is there a reason for that?

spark otter
red escarp
#

How can I replicate or copy something from a client to the server and server ti client, or broadcast it from the server to all clients, or from one client to all other clients?

IEntity spawnedVehicle = GetGame().SpawnEntityPrefabLocal(vehicleResource, GetOwner().GetWorld(), params);

i use this but only client show

IEntity spawnedVehicle = GetGame().SpawnEntityPrefab(vehicleResource, GetOwner().GetWorld(), params);
and use this but not run in client only server

torn bane
candid garnet
#
storm bobcat
#

Is there a way to inject code like this into vanilla without needing a packed script?
I assume packed script means a mod, right?

faint talon
inland bronze
#

Having an issue with a GameSystem, whenever I unregister a component from it, it throws a Index out of bounds error on my foreach loop, when I don't think it should, unless I'm overlooking something..? Check interval is set to 1 second.

override event protected void OnUpdate(ESystemPoint point)
{
    float timeSlice = GetWorld().GetFixedTimeSlice();
    bool nullValuePresent;

    m_fTimer += timeSlice;
    
    if (m_fTimer >= m_fCheckInterval)
    {
        m_fTimer = 0;
        
        foreach (CE_ItemSpawnableComponent comp : m_aComponents)
        {
            if (!comp)
            {
                nullValuePresent = true;
                continue;
            }
            
            comp.Update(m_fCheckInterval);
        }
        
        if (nullValuePresent)
        {
            for (int i = m_aComponents.Count() - 1; i >= 0; i--)
            {
                if (!m_aComponents[i])
                    m_aComponents.Remove(i);
            }
        }
    }
}
``` Any insight would be greatly appreciated
random moat
#
  protected ref array<Material> SlideArray;```
random moat
#

How do i define the array correctly

sweet badger
river imp
#

Should also be using array<ResourceName>

#

And ui widget should be UIWidgets.ResourceAssignArray iirc

midnight talon
#

Why not just call .Remove(component) on the component directly in the method that unregisters it rather than in OnUpdate?

torn bane
# inland bronze Having an issue with a `GameSystem`, whenever I unregister a component from it, ...

Is it possible that the update method of the individual components could cause the system to be called? Because e.g a new entity is spawned which registers itself? That would mess with the known array indices as you change the array during iteration.

Also the removal of null should not be needed. Register your component during postinit and unregister it ondelete and your system will never have nullptr accesses

pseudo merlin
#

Is there something that triggers whenever a player is talking ( Radio or Direct )?
I've already tryed many breakpoints in multiple methodes of SCR_NameTagData and SCR_VoNComponent.
For some reason none of them triggers when using PeerTool and speaking.
I can see the Direct chat icon and everything when talking so no clue how or where to get the speaking event... blobdoggoshruggoogly

balmy kayak
#

What function can I use to retrieve an object's properties? I'm trying to retrieve an ItemPreviewManagerEntity instance's default render attributes so I can use those properties at runtime for function calls.

pliant ingot
brave crag
#

},
{
"modId": "5965550F24A0C152",
"name": "Where Am I",
"version": ""
}

#

{"modId": "5D1880C4AD410C14"},{"modId": "621D3771875C1D3D"},{"modId": "5E0AB16BEB16D6A4"},{"modId": "625113D08F47AB6C"},{"modId": "622120A5448725E3"},{"modId": "61C93085D1BECD63"},{"modId": "5AE50EC5B8D6F4AE"},{"modId": "62EAD0E26762CE0F"},{"modId": "629B358C38E73FB7"},{"modId": "5CCCC1DFB9C93581"},{"modId": "5C961A93A16EB866"},{"modId": "5E389BB9F58B79A6"},{"modId": "5E193315C8E82019"},{"modId": "5AAF6D5352E5FCAB"},{"modId": "5CF0C3158AB2337E"},{"modId": "5965550F24A0C152"},{"modId": "6243491A7D2ACCFD"},{"modId": "5B383D4CB27E0D54"},{"modId": "629B2BA37EFFD577"},
{"modId": "5C721177A220B42F"},{"modId": "5DF42518F3C3210D"},{"modId": "5F244258B6AD0AB4"},{"modId": "64F869693699EEA7"},{"modId": "64D6B51E4CA6CF65"},{"modId": "6108BB22767D4D58"},{"modId": "606B100247F5C709"},{"modId": "6276E6E3CC97A22B"},{"modId": "60ED3CC6E7E40221"},{"modId": "61F62542BF6DBA74"},{"modId": "5A78300A9F2D7A65"},{"modId": "64B063B94348F5C8"},{"modId": "647978F120DCFE12"},
{"modId": "60CAFAA76E027A42"},{"modId": "64511E38125A67B6"},{"modId": "6334E929FA792895"},{"modId": "6303360DA719E832"},{"modId": "63120AE07E6C0966"},{"modId": "5E0AB16BEB16D6A4"},{"modId": "61957C5C6FB7A773"},{"modId": "61A2FDEE636A1CD8"},{"modId": "60629E954144D73F"}

#

I need help this is driving me crazy

reef crescent
#

Is there anyone that could show me how i Connect a Action to a animation?

im trying to create a bridge and both the Open/Close animations work, i just cant seem to figure our how to connect them to a action

spark otter
pliant ingot
pliant ingot
barren viper
#

I’m getting this error when launching my server. Anyone know what it is?

#

Can't compile "Game" script module!
scripts/Game/UI/RadUI/HCA_RadUI_HUD.c(1343): Overloaded function 'AddElementsFromCategory' not compatible
Runtime mode

pliant ingot
#

Line and file where is error - you can see in message

balmy kayak
#

Where can we make suggestions for improvements to an API? ItemPreviewManagerEntity has some serious limitations :/

river imp
balmy kayak
# river imp It does everything it needs to do...

It's member instance of PreviewRenderAttributes is not exposed. Which means the only way to modify it is to pass in a custom one... but guess what there's only 3 exposed methods on PreviewRenderAttributes... So no it doesn't do everything it needs to do.

river imp
balmy kayak
#

The values from the entity are not being used when loading the model to be previewed via script.

river imp
#

In the script you showed in GUI, you're not even passing PreviewRenderAttributes to the function. So of course not.

balmy kayak
#

You shouldn't have to, it's a property of class.... And even when I pass in a custom PreviewRenderAttributes you only have the ability to change the rotation and the fov... Not everything else. What about distance to item like the prefab is able to do? What about dynamic objects like the prefab can do? What about animation instances? Not seeing your point.

river imp
#

Anything that is gonna be "previewed" is expected to have PreviewRenderAttributes in it's prefab already set up. Not sure what is so hard to understand about that.

balmy kayak
#

I don't think you are comprehending the problem, thanks for trying though.

#

I'll just submit the ticket as I was planning to before you interrupted. Thanks!

autumn nebula
#

Is it possible to override the attributes of the map gadget component? I haven't done scripting in Reforger before, but I know what I want to change.

#

I'd just like to change a couple attributes in the SCR_MapGadgetComponent.c

autumn nebula
#

I found the Wiki for it, all good now.

autumn nebula
#

Only thing I'm curious about is if you can change Variable Values in a Modded Class, or do you need to make a new variable and override the methods they are called in to use the new variable?

#

Especially if it is protected?

inland bronze
#

Has anyone ran into issues with IEntity::SetYawPitchRoll() recently? Probably since 1.3 release? Does it need to be replicated now?

pseudo merlin
river imp
inland bronze
#

It seems to be pretty random when it wants to work

midnight talon
#

Is there any way to debug malloc(): invalid size (unsorted) error on dedicated server?

midnight talon
#

this bug is some spooky poltergeist shit 😄

midnight talon
#

Whatever triggers this issue with SetYawPitchRoll also seems to be breaking SnapToGround from working on the same entity

#

It also seems specifically related to weapon entities, other stuff like clothes and tools are rotating and snapping fine

craggy jolt
#

(It was workbench again)

#

Fixed itself after restart

midnight talon
#

classic WB 😄

craggy jolt
#

gotta finally start testing with dedi right away

pliant ingot
pseudo merlin
pseudo merlin
#

Yeah i believe you.
Thank you for proving me anyways. 🙂

#

Highly likely my fault...
I've got PeerTool working the first time just couple days ago.
So yeah still many parts for error from my side.

reef crescent
#

Do i need the knowledge to Code if i want a action to execute a animation? i created a prefab with a animation and it works, i just dont know how to connect it to a Action (Pressing F something to Open/Close the animation.

red escarp
#

how to SpawnEntityPrefab only in PerformAction i need use in any method not only PerformAction

serene fox
#

Does anyone know a way to check, if the local controlled entity is reconnected or connected the first time.

candid garnet
midnight talon
#

Can anyone from BI say if there are any plans to make BaseLoadoutManagerComponent scriptable or support variant randomization on the item prefab slots?

candid garnet
midnight talon
#

or maybe I'm just doing something wrong idk

tawny lotus
#

I'm trying to find a way to check if a position is inside a building (=inside the building walls). If the buildings were cubes, the bounding box would work but that is not reality.

midnight talon
#

Oh wait there are more args on the prototype that compiler unhelpfully decided to not tell me about

red escarp
#

please someone give me example for client press button in ui after this spawn vehicle
client press button after press send to server Because server only can spawn

midnight talon
#

It sounds like you want to do an Rpc from client to server, read the linked wiki article section on Rpc method

red escarp
#

okay i have methode spawn vehicle but player in performeaction can be spawn in this method cant

#

okay how to give client ownership or authority

ocean kernel
#

I'm gonna change my script editor font to comic sans again

midnight talon
#

RplComponent.Give / GiveExt but if doing it on something that is already meant to be owned by server or client transferring ownership could potentially cause weird side effects breaking other stuff so you might wanna avoid if you're overriding something that already exists

candid garnet
plush tendon
#

I want to make a series of missions where destroyed cities will remain as such in the following scenarios.

Does anyone have any ideas on how to get the state of buildings, trees and other objects?

ocean kernel
#

Hm, does server saved session contain destruction info?

red escarp
#

spawn from server is very good but in client not spawning

#

i am soo bad in Replication in arma reforger and Unreal engine all good but Replication

inland bronze
reef crescent
#

Could someone tell me Where the connection is between a open/close Door action of a vehicle And The Animation? For example: action: "door_l01" must somehow be connected to this

#

Is there a script that executes this or something else? so yes, what is the script called?
this vehicle is s105

#

I know there is a VehicleAnimationComponent, but this still doesnt show the direct connection between the Action (Pressing F on something to open/close) and the animation

high hawk
#

wut dis dooo

candid garnet
#

2spoopy4me

high hawk
#

Shiver me timberlands, its an attribute without a description 59918pepeangry

inland bronze
reef crescent
inland bronze
#

CompartmentAccessComponent::OpenDoor() line 39 of CompartmentAccessComponent.c script

#

Other than setting the door index and ECharacterDoorAnimType, I think the actual connection is behind engine

reef crescent
#

Dind think i needed the coding experience to run a animation when pressing F on something 😭

inland bronze
reef crescent
inland bronze
#

Simplest way would be a custom ScriptedUserAction, with a button or something that has the action context

reef crescent
#

Also that link u send dind work

inland bronze
#

then retry the link 😄

reef crescent
#

its no longer giving me a error message but the screen is just grey lol idk if firefox is supported

inland bronze
#

it'll open the file in Workbench after confirming it's okay to in your browser, so check there. Firefox should work because it does for me

reef crescent
#

ooh now i see haha

inland bronze
#

But I wouldn't even pay attention the the config file I sent the link for. I would just look at how ScriptedUserActions are done in script

reef crescent
#

I guess this isnt for me its like looking at chineese characters

inland bronze
#

No problem!

river imp
red escarp
river imp
red escarp
#

okey but i have menu for spawn vehicle and this menu get from file

#

in client how to send to server vehicle prefab and server spawning my prefab

river imp
#

You don't need to send anything.

#

I suggest you look into how attributes work

red escarp
#

prefab from client after this give to server after this spawn

river imp
#

Why do you need to give anything from the client?

red escarp
#

client have prefab name to spawn vehicle

#

but i use SpawnEntityPrefab in preformaction is good
after this i use SpawnEntityPrefablocal not good

#

I don't need in action

#

I don't need it from the action because I have a function. This function brings me the name of the car from the client side

#

after this i need only spawn to all player

#

in my function i use SpawnEntityPrefab give me null or not spawning
after this i use SpawnEntityPrefablocal not good spawn in client only not all players

#

i need give client Authority for spawn vehicle

craggy jolt
#

Trying to dress up a character spawned into new world, but SCR_CharacterInventoryStorageComponent.FindSuitableSlotForItem returns NULL

#

If I run identical script but without new world, its all fine and slot returns

#

I thought I'm missing some world entity in preview world "{4391FE7994EE6FE2}Prefabs/World/Game/InventoryPreviewWorld.et" but using other worlds doesn't help it.

craggy jolt
#

Any tips what could be done? The character I'm using is "{836E7E39AAC5888B}Prefabs/Characters/Factions/BLUFOR/US_Army/Character_US_Base.et", the uniform is "{EB0D74A43F74B522}Prefabs/Characters/Uniforms/Jacket_Denim_01/Jacket_Denim_01_strippedShirt.et", as I mentioned it all works properly in the main game world.

river imp
midnight talon
midnight talon
river imp
#

I'm still concerned as to why the client knows the prefab and the server doesn't

craggy jolt
river imp
#

You're trying to do a character "preview"?

#

Customization screen or something?

craggy jolt
river imp
craggy jolt
# midnight talon Are you trying to dress them in the same method call/frame that spawns them? I'...

Nope, no luck:

SCRIPT       : IEntity m_Character = SCR_ChimeraCharacter<0x00000210F16911B0> @"ENTITY:15" ('SCR_ChimeraCharacter','Assets/Characters/Basebody/Basebody_Male_01.xob') at <0.000000 0.000000 0.000000> @"{836E7E39AAC5888B}Prefabs/Characters/Factions/BLUFOR/US_Army/Character_US_Base.et"
SCRIPT       : IEntity m_Uniform = GameEntity<0x00000211170EFAB0> @"ENTITY:19" ('GameEntity','Assets/Characters/Uniforms/Jacket_Denim_01/Jacket_Denim_01_item.xob') at <0.000000 0.000000 0.000000> @"{EB0D74A43F74B522}Prefabs/Characters/Uniforms/Jacket_Denim_01/Jacket_Denim_01_strippedShirt.et"
SCRIPT       : InventoryStorageSlot slot = NULL
SCRIPT       : --- 10ms delay ---
SCRIPT       : InventoryStorageSlot slot = NULL
#

Getting the slot:

SCR_CharacterInventoryStorageComponent inventory = SCR_CharacterInventoryStorageComponent.Cast(m_Character.FindComponent(SCR_CharacterInventoryStorageComponent));
InventoryStorageSlot slot = inventory.FindSuitableSlotForItem(m_Uniform);
Print(slot);
craggy jolt
#

Btw I tried just providing slot id (1) into the TryInsertItemInStorage but it fails, so slots aren't initialized at all, thus my assumption that world needs some entity that does something

#

I guess its Bacon Loadout Editor, gonna check it out

midnight talon
#

So it would make sense that returns null on a character without any clothes yet since they don't have any inventory slots

#

EditablePrefabsLabel_CharacterRole::CheckLoadout has some logic for reading slots from BaseLoadoutManagerComponent which is what I've been basing my thing on

craggy jolt
midnight talon
#

oh wait nvm i was thinking of SCR_InventoryStorageManagerComponent is the one for inventory management but it also looks like that has a bunch of game code methods for equipping gear like EquipCloth / EquipWeapon as well

#

reall doesn't help there are like 8 similarly named classes that all appear to do similar or the same thing until you try using them 😄

fickle ingot
#

Help me, I've been struggling with this stuff for a week.. WHAT SHOULD HAPPEN IS that the ROCKET explodes at the appointed time through the ballistic table, but either it happens that the rocket does not explode or, on the contrary, explodes automatically through the timer trigger (if the value is 1, then the explosion occurs after 1 second).

midnight talon
#

Why does SCR_InventoryStorageManagerComponent.EquipWeapon() attach it to their feet?

#

that's not how you equip a gun

torn bane
keen stag
#

hey guys, is there a way to hide a string in the project so no one can see it ?

torn bane
midnight talon
keen stag
pliant ingot
#

So you can define you own -myparam ABC and use it via this method

keen stag
#

where do i add this params

pliant ingot
#

server.exe -param ABC

midnight talon
#

that worked beautifully thanks Arkensor ya legend

torn bane
high hawk
random moat
#
        QueryEntitiesToRemove = {};
        // server only
        RplComponent rplComponent = RplComponent.Cast(owner.FindComponent(RplComponent));
        if (rplComponent && !rplComponent.IsMaster())
            return;

        BaseWorld world = GetWorld();

        world.QueryEntitiesBySphere(owner.GetOrigin(), m_fRadius, QueryEntities);

        // Removes all entities. This is a hack, until the original SCR_PrefabDeleter works correctly
        foreach (IEntity e : QueryEntitiesToRemove)
        {
            SCR_EntityHelper.DeleteEntityAndChildren(e);
        }

        // destroy self
        delete owner;

Hey guys i updated the SCR_PrefabDeleterEntity Pre.1.3 which there was no problems at the time and worked as intended. Now there is a JIP replication error after 1.3 as seen below:

15:38:56.919 RPL          : rpl::Pip::ProcessNetToGame
15:38:56.919  RPL       (E): IReplication::JIPError: Inconsistent item table on Slave connection. Item is missing or different item was loaded in its place. (item=0x40006959 layout=ChimeraAIWorld)
15:38:56.919  RPL       (E):    Expected:
15:38:56.919  RPL       (E):      cpp_layout=_GenericEntity_Layout
15:38:56.919  RPL       (E):      s_layout=script::Game::PS_GameModeCoop

Any ideas how to fix this?

pliant ingot
random moat
torn bane
# high hawk Why are you enabling this 😆

There are valid uses for it. If it is used for malicious purposes or against our EULA he and his mods are simply banned. I saw the report from you already and we will have a look 🙂
I usually answer questions regardless of who asks. So I saw only now.

random moat
#

Either way at that point of the line the script is done and wont run again

midnight talon
high hawk
random moat
#

Also i struggle to understand this part:

        // server only
        RplComponent rplComponent = RplComponent.Cast(owner.FindComponent(RplComponent));
        if (rplComponent && !rplComponent.IsMaster())
            return;
pliant ingot
random moat
#

override void EOnInit(IEntity owner)

It runs on EOnInit

torn bane
torn bane
pliant ingot
random moat
pliant ingot
#

It also may be client, but in this case it will not be replicated to anyone else

random moat
random moat
pliant ingot
pliant ingot
random moat
pliant ingot
#

If placed in worldeditor

random moat
pliant ingot
#

And because of EOnInit it will be during loadtime, so if you delete some entity on client and not delete it on server or delete on server and not delete on client - you will get JIP error

random moat
#

What is a better point to do this then? other EonInit

pliant ingot
#

You just need to somehow strictly "define" what and how you delete

#

To make sure that taken actions for clients and server are same every time

high hawk
random moat
#

Well i query by sphere and then delete every object returned by the query , i cant see how its executed differently

high hawk
#

Starting to have good docs as well

pliant ingot
pliant ingot
#

So mb on one side some entity is exists later then you code, so on this side you don't delete this entity

random moat
#

So it would better lets say that i make the server run the query generate the list and then that list is executed by everyone else

#

rather than each client doing the query

pliant ingot
#

Transferring entity Ids from server to client is easy way, but not better)

random moat
#

As the EOnFrame is every frame which i think is not something we want

random moat
#

@pliant ingot EonFrame did not work i randomly tried EonActivate that worked any idea why or what

random moat
pliant ingot
autumn nebula
#

Looking to skip the Animation Finish Event Sync in the Gadget Manager Component.

Making a Faster Map Opening Mod, and I removed all delays aside from when Gadget Mode Syncing happens via Animation Event. Map opening is snappy in gamemaster, but not when controlling character.
Trying to skip the wait for animation and looking for a little help.

#

CanChangeGadgetMode() and SetGadgetMode() are the methods I figure have to do with it.

gloomy lynx
#

kinda going crazy trying to find this base game functionality,

what controls the visibility of supply crates on vehicles????

candid garnet
gloomy lynx
candid garnet
gloomy lynx
high hawk
#

Just so I'm clear with it, if I attach a entity to a slot via slot manager and then I'm not able to interact with my actions on the child entity. Would this be because the new child attached is not the owner?

If so, is there a way to essentially make it a 'dummy parent' or something?

candid garnet
craggy jolt
craggy jolt
#

Now TryInsertItemInStorage returns true but item doesn't actually gets equipped 🤔

#

Slot is there, command returns true, not specifying the slot (-1) has no difference. Running Update() on the character or cloth item does nothing thonk

#

TryInsertItemInStorage doesn't help it either

#

Testing in both fresh WB and using peer tool client

autumn nebula
#

I'm looking for the Method which calls Gadget Activation after the Input?

Not able to find it. Makes me think an Animation Event Calls it, but can't find that either. Particularly for the Map Gadget.

inland bronze
craggy jolt
inland bronze
torn bane
#

Under the diag menu there is an inventory section that allows you verbose logging of any reason why inventory might have failed to do something. The Try methods on replication environment only return true if they could send off their RPC, it could still fail on the server

craggy jolt
#

Doing these commands as server

#

Also tried another way, spawning a prefab with loadout items already on it, can't get the helmet and the vest to update even doing m_Character.Update(); each frame.

frosty coral
#

Is there a way to Shape.Create on stable?

craggy jolt
#

What's with "Goto Declaration" randomly not doing anything? Is there a trick to it?

torn bane
# craggy jolt `INVENTORY (W): Call not allowed, wrong data provided`

Damn, I wonder how you reached that part. It may be that the local items are a problem. The inventory system is generally replicated, so perhaps it failed to read it. There should have been an assert Wrong replication data provided if you were doing it in diag workbench. But I bet it works as soon as you try with proper replicated items. There should be a way to do it though, you should check the loadout previews in the respawn screen and see how they do it. I believe those are locally spawned

torn bane
torn bane
frosty coral
high hawk
#

Is there a trick to getting actioss on a child prefab to show after attaching it in runtime? The contexts are still their, but the actions move to the parent entity? It's like pointinfo is being ignored

craggy jolt
torn bane
shrewd nova
#

And check the allow cross hierarchy

#

I found that it only works if the xob’s have the same memory points, if u are creating them in engine it won’t work

ocean kernel
#

Physics.EnableGravity(false) doesnt work on vehicles

timid citrus
#

SCRIPT (E): Virtual Machine Exception

Reason: Attempted to call persistence operation before setup phase. Await setup/completion u

Anybody know where to point me for this EPF error? I broke it somehow in the last couple hours didn't even touch it, but touched character_base prefab for some other things.

#

SCRIPT (E): Virtual Machine Exception

Reason: Attempted to call persistence operation before setup phase. Await setup/completion using GetOnStateChangeEvent/GetOnActiveEvent.

Class: 'EPF_PersistenceManager'
Function: 'CheckLoaded'
Stack trace:
Scripts/Game/EPF_PersistenceManager.c:700 Function CheckLoaded
Scripts/Game/EPF_PersistenceManager.c:259 Function FindPersistenceComponentById
Scripts/Game/EPF_PersistenceManager.c:249 Function FindEntityByPersistentId
Scripts/Game/Entities/Character/EPF_CharacterControllerComponentSaveData.c:191 Function OnGadgetInitDone
Scripts/Game/Components/Gadgets/SCR_GadgetManagerComponent.c:931 Function RegisterInitialGadgets
Scripts/Game/Components/Gadgets/SCR_GadgetManagerComponent.c:1087 Function InitComponent
Scripts/Game/Components/Gadgets/SCR_GadgetManagerComponent.c:1252 Function EOnInit
RENDER : RENDER : ObjectsHeightMap::Build

gloomy lynx
timid citrus
shrewd nova
timid citrus
#

Nope. I was messing with a HUD layout with widgets from metabolism asset, but I deleted my override and its still happening.

#

Wait I just found another one

#

No luck. I may just delete that mod and re-add it. I know it adds an entry for saving in the epf

shrewd nova
timid citrus
#

I will give it a whirl thanks

#

Nailed it lol thanks a million

scenic inlet
#

Hello! I'm trying to create a capture logic system for my Arma Reforger scenario. I'm using ChatGPT to help, but I feel like sometimes it gives me solutions that don't actually exist or aren't supported in the game.

I've created a generic entity, renamed it, and attached the script below. But I can't get it to activate in-game. It tells me to go to SCR_ScriptComponent and Script File, but I can't find those options.

Can someone tell me if I'm doing something wrong or completely off track?

shrewd nova
#

You need to have some understanding of the game script in order to even instruct it correctly

ocean kernel
#

It's hard to know where AI is going wrong if you don't know the subject matter you use it for

#

It's not a shortcut to scripting

scenic inlet
#

it's not the script itself that's wrong — I followed all the steps it told me to do. I feel like I'm on the right track. The only issue I have is that I can't get my script to activate so it can run my capture logic for the PvP scenario.

tough cave
#

Anyone know if you can you get the spline data (path along) roads during runtime or do you cache the data that you get about that with world editor / workbench scripts? I want to spawn stuff randomly on the side of the road. Obstacle detector stores something like that. The other stuff I see for GeoJSON is maybe close to what would work and is running in as a world editor / workbench script. Crossroads may be available, but you would still have to do scan / trace to see where the rest of the road is, and it's hard to track that on the fly. The RoadNetworkManager doesn't seem to have much except where the roads start.

gloomy lynx
#

u can add multiple generators to splines\polylines

fringe prairie
gloomy lynx
#

the way around that would probably be what Lochleg was talking about where you would have to pull the spline\polyline data and then spawn your stuff

tough cave
#

ty, that helps a lot

autumn nebula
#

When/How does this get called for Gadgets?
The Callstack starts here when I breakpoint.

scenic inlet
earnest gorge
#

Where should I be creating my scripts for a project? Right now inside my project folder I have it in a Scripts/Game and dumping them all in there. Is there any recommended convention?

candid garnet
earnest gorge
north osprey
#

Hey guys any idea why when players leave my server they are stuck on the loading screen and need to close their entire game?

west prism
#

Hi! Any one knows how to make yourself, your team members and squad visible for the player on the map?

Is there some tweaks in the workbench for that already?

livid forum
#

there are 2 mods for making urself visible on the map on the workshop

#

ones called "Where am I" and the other one is actually mine, called "YouAreHere"

#

for squads idk if theres one publicly available

west prism
undone patrol
#

I need a script to undermine the height of the Terrainnotlikemeow

livid forum
high hawk
gloomy lynx
craggy jolt
# torn bane Show your code please
    SharedItemRef m_WorldRef = null;
    BaseWorld m_World = null;
    
    void PreviewTest() {
        RenderTargetWidget widget = RenderTargetWidget.Cast(GetRootWidget().FindAnyWidget("RenderTarget0"));

        // World
        m_WorldRef = BaseWorld.CreateWorld("PreviewWorldTest", "PreviewWorldTest");
        m_World = m_WorldRef.GetRef();
        Resource rscWorld = Resource.Load("{4391FE7994EE6FE2}Prefabs/World/Game/InventoryPreviewWorld.et");
        GetGame().SpawnEntityPrefab(rscWorld, m_World);

        // Cam
        m_World.SetCamera(0, "0 0.9 -2", "0 0 0");
        m_World.SetCameraVerticalFOV(0, 90);
        m_World.SetCameraType(0, CameraType.ORTHOGRAPHIC);
        m_World.SetCameraNearPlane(0, 0.001);
        m_World.SetCameraFarPlane(0, 4000);
        
        // Character
        Resource rscChar = Resource.Load("{836E7E39AAC5888B}Prefabs/Characters/Factions/BLUFOR/US_Army/Character_US_Base.et");
        IEntity char = GetGame().SpawnEntityPrefab(rscChar, m_World);
        char.SetYawPitchRoll("180 0 0");
        char.Update();
        
        // Cloth
        Resource rscUniform = Resource.Load("{EB0D74A43F74B522}Prefabs/Characters/Uniforms/Jacket_Denim_01/Jacket_Denim_01_strippedShirt.et");
        IEntity uniform = GetGame().SpawnEntityPrefab(rscUniform, m_World);
        uniform.SetOrigin(char.GetOrigin());
        uniform.Update();

        // Wearing
        SCR_InventoryStorageManagerComponent storage = SCR_InventoryStorageManagerComponent.Cast(char.FindComponent(SCR_InventoryStorageManagerComponent));
        SCR_CharacterInventoryStorageComponent inventory = SCR_CharacterInventoryStorageComponent.Cast(char.FindComponent(SCR_CharacterInventoryStorageComponent));
        bool test = storage.TryInsertItemInStorage(uniform, inventory);
        Print(test);
        
        // Render
        widget.SetWorld(m_World, 0);
    }
#
  INVENTORY (W): Call not allowed, wrong data provided
  SCRIPT       : bool test =   1
torn bane
#

This approach won't work no matter what you do then. Best to see how the loadout selection preview screen did it. I do not know and lack the time to dig into it for you right now, but it should be all in script

craggy jolt
#

Trying doing it another way, having all gear already in place on the character prefab, but I can't get the gear to update its position to match the character.

torn bane
#

Yes ideally you do it all on the prefabs and not dynamically. For clothing items to be correctly worn you need to add them on the right components. base loadout component is the main subject. do not attempt to insert directly into storage component slots. Only weapons in hands etc will not show as you might want to

craggy jolt
#

Spawning "{4FBA24F7BB43E17D}Prefabs/Characters/Factions/BLUFOR/US_Army/Character_US_Sergeant.et", can't get items to animate

#

Tried going through all storages, getting all IEntity items from them and running .Update() on them to no success

#

Continous running of .Update() on the characte doesn't help it either

#

Spawning a car and it properly animates its parts with .Update() though 🤔

narrow aspen
#

How can I send a message to the chat window when player killed AIs, e.g., Player A has killed 5 AI without death. Which tutorial and class should I check?

ocean kernel
#

Create some counter somewhere for each player and store killstreak there, like a map indexed by player id

#

Increment it inside onplayerkilled ondestroyed of a character editable entity component I think

#

Or I guess player id could be extracted from instigator data somewhere

calm wren
#

Hi, i would like to make an entity with action, that is triggering read form database. It is possible to access data on server-side and set it only to client that executed the action ?

#

or for startes, any data, not even db

narrow aspen
earnest gorge
#

So I've got a script that runs on the server and I'm trying to use the built-in SCR_HintManagerComponent to make a hint appear on the client. It appears though, that I need to do something because it's returning null because it's running on the server. Do I have to do some sort of RPC from server to client to make this work?

ocean kernel
#

Yerp

earnest gorge
#

In which case, where do I write the script for this / where do I give this to the player? I guess it's in a player prefab or something?

autumn nebula
#

Is there a reason Breakpoints don't go off on the Radio Components? Tried setting some for Toggle, Change Frequency, ect, and never fired off.

red cedar
#

Regarding the collision between two entities. Is there a way to disable them (Character and a vehicle).

I've tried using the PhysicsBlock and also to set the interaction layer : m_CharacterPhysics.SetInteractionLayer(EPhysicsLayerDefs.CharNoCollide); but it doesn't work so far.. I don't know if i'm just misunderstanding the way it works or what's happenning. Any help would be appreciated..

My code :

    [RplRpc(RplChannel.Reliable, RplRcver.Owner)]
    void DoRpc_EjectClient(EntityID entityId)
    {
        IEntity entity = GetGame().GetWorld().FindEntityByID(entityId);
        if(!entity)
            return;
        
        IEntity playerEntity = GetGame().GetPlayerController().GetControlledEntity();
        ChimeraCharacter character = ChimeraCharacter.Cast(playerEntity);
        
        CompartmentAccessComponent seat = character.GetCompartmentAccessComponent();
        if(!seat)
            return;
        
        // disable collision with the vehicle
        m_CharacterPhysics.SetInteractionLayer(EPhysicsLayerDefs.CharNoCollide);
        seat.GetOutVehicle(EGetOutType.TELEPORT, 0, ECloseDoorAfterActions.INVALID, true);
        
        // Enable the collision after a second
        GetGame().GetCallqueue().CallLater(EnableCollision, 1000);
    }
teal vapor
#

Are there any tricks to getting PeerTool to behave nicely in the CTI_Campaign* maps? The slowest part of my iteration loop at this point is the PeerTool client getting dropped with Another connected player with the same identity found.

#

works fine consistently in the coop campaigns which has me wondering if there's some component added to the CTI world that's causing this

red escarp
#

@torn bane i use your project but cloth in bots not wearing

autumn nebula
#

Would there be a place to request Modding Feedback from Devs?
Wanted to ask about having the Radio Component, and Transceiver Script Modable.

teal vapor
autumn nebula
#

Cool, I'll go check that out. Thank you.

sleek dove
#

I'm not on my computer for 2 days, so can't check exact API

craggy jolt
#

TF2 Soldier

#

Oh nevermind, I guess vests work already while armored vests dont, so nothing really changed apart from me testing another prefab

#

Did that on all inventory entites, no change

#

char.SetVComponentFlags(VCFlags.INHERIT_PARENT_SKELETON); => Resets animation
item.SetVComponentFlags(VCFlags.INHERIT_PARENT_SKELETON); on all storage items => Nothing

ocean kernel
#

There's a preview entity function that will Just Work when called with a character

#

But I dont have context on what you doin

craggy jolt
#

Me neither, I just wanted to render a character in a widget 🤔

#

In general, the idea was to display character figures in different gear sets in a menu, similar to what I did in A3 with pre-rendered images but dynamically

ocean kernel
#

Do you use ResolvePreviewEntityForPrefab for this?

#

or SetPreviewItemFromPrefab

#

ah I just checked how I do it in my loadout editor, I call InventoryItemComponent.CreatePreviewEntity

#

And that creates the player in my preview world

high hawk
#

Where the frickin frick do you remove all occupants from a vehicle by script pepeSmirk

sleek dove
red cedar
red cedar
high hawk
#

I'm just rte doing my one

#

Ill flick it over

red cedar
craggy jolt
craggy jolt
serene fox
#

Hey. If i call a Method from InputAction which is bind to double press. The Method will be called 10 - 15 times (but only pressing twice). How do i need to set this, to make sure its only called once?

red cedar
dire sinew
red cedar
dire sinew
#

We use FireGeo to disable it between characters. Also not sure if it is recursive. You may have to specifically set it for the rotor.

#

Also it has to be set on the owner machine.

dusk pollen
#

Why does the script editor keep freezing for me when I alt-tab to it?

red cedar
red cedar
dusk pollen
red cedar
dusk pollen
#

Is it possible to add ping latency between localhost + peertool in world editor?

ocean kernel
#

Make sure you set it to udp ofc

glossy onyx
#

Is there a script that shows your server being verified so you know it’s real and not a fake

vale verge
#

Has anyone tried doing anything weird with the TimerTriggerComponent / CollisionTriggerCompoment? Im trying to make a new one that essentially merges the two, so you can set a round to have a varible timer trigger, but still also trigger on impact. I initially tried just making my component inherit off collision, and then add the methods from the timer trigger, but I cant figure out how / where it should set the timer trigger to be live, or even where any of that info gets set for them period, since there really isnt much in any of the components to compare to or look at. If anyone does have more info or can point me at something else to look at to try to get it going, Id appreciate it.

ocean kernel
#

You can just have EOnContact in your script and force activate the timed one when something hits it

vale verge
#

So itd be eaiser to inherit off the timedtriggercomponent, and then just override the EonContact

#

This is what I get for modding at 1am

serene fox
#

Hi, Question: i have two keybinds on "F" Single-Click and Double-Click. If i now like to run the method which is bind on the Double-Click, it always runs the one from the Single-Click. Does anyone know how to fix this?

livid forum
serene fox
livid forum
serene fox
#

But this also works on FreeLook... Alt = FreeLook, Double Alt = Toogle Freelook

livid forum
#

hmm you compared the logic for this / setup inside the cfg with urs?

#

unfortunatly cant tell out of my head, never had this before, but if its already correctly setup base game multiple times, eg spring / double click for locked sprint it should def. be possible

#

screw this: "def. be possible" hapyj

glossy onyx
#

Does anyone have issues when game ends it will not auto restart you have to hard restart is that a script issue

ocean kernel
#

When a magazine is empty in a turret it disappears?

#

I noticed if I set ammo count on a magazine that is empty it doesnt throw errors but doesnt load bullets into the mag/gun

glossy onyx
#

RESOURCES (E): Failed to open
RESOURCES : GetResourceObject @"{F503F71C08BE3F7D}Prefabs/Vehicles/Helicopters/AUS_MH60/AUS_UH60_armed.et"
RESOURCES (E): Failed to open
SCRIPT (E): Cannot create entity, error when loading prefab '{F503F71C08BE3 any ideas

scarlet iris
#

How do I inform the game the max number of players on a server so that "Spawn random children based on player count" works properly? As of now No children spawn at all when I test in my server, but they do spawn when I test in workbench

shrewd nova
#

The ammo count after u shoot a mag is also not exposed as a specific prefab

teal vapor
#

Math3D.IntersectionLineSegments() exists, but is there a function to get where they intersect?

teal vapor
#

also, is it not possible to express this in Enfusion?

array<vector[]> lines = {};

vector firstLine[] = lines[0];

Gives me Incompatible parameter 'firstLine'

dire sinew
#

What the heck kind of notation is this array<vector[]>? What your you trying to do?

teal vapor
#

this is one of those times where I feel like it's appropriate to say that it doesn't really matter what I'm trying to do, no matter how I try to do multidimensional arrays I get a syntax error

sweet badger
#

Just do array<vector>, I assume this is what you mean

dire sinew
#

But you didn't specify the size of the static one

teal vapor
#

this syntax is how you pass fixed-size arrays as arguments too SHRUG

teal vapor
sweet badger
#

Either you misunderstand the notation, or I don't get what you're trying to do

#

array<vector> is already an array of vectors, with components that can be accessed using e. g. v[0] without any [] in their declaration

teal vapor
#

huh?

#

a vector is a fixed-size array containing x,y,z components no?

#

an array of vectors would therefore describe some shape

#

this is an array of shapes essentially

sweet badger
#

Yes, and you can declare such an array of vectors using array<vector>

teal vapor
#

Ok, so in this example I essentially have an array of shapes. I've described shapes (in this case a triangle) as an array of vectors (points) with 4 elements. Basically two line segments.

How do I now create an array of shapes as you propose?

sweet badger
#

Oh, I see what you mean now

#

array<ref array<vector>>

teal vapor
#

again I think this is losing the plot a little bit. the root of the question is how do you syntatically declare a multi-dimensional array

dire sinew
#

It doesn't look like there is a way to do it. array<vector[]> is useless, as it throws null pointer exceptions when you try to insert a static array

teal vapor
#

array<vector[]> arr = {} is not the same as array<vector[]> arr;

teal vapor
#

Same error.

#

Has nobody really tried doing multidimensional arrays before in the scripting engine..? The only instances I see sampling ][ is with vector[]

dire sinew
#

Still not really working. It only seems to store the first vector

teal vapor
#

actually I see a array<ref array<string>> format;

sweet badger
teal vapor
#

the error message was the exact same so I didn't even think about it

candid garnet
#

anyone got a write up on what a signal (SignalsManagerComponent) is, how to use them, and why would I use them?

dire sinew
candid garnet
dire sinew
#

I guess it's a matter of design choice. If the variable is used by a lot of other systems besides as a signal, you may not want everything to be couple to signals.

split willow
#

How are people desiging mods? I trying to work on some simple mods to get a grip of how the engine works, but I'm having trouble on finding helpful resources

oblique lynx
#

Hi there, I am trying to extend the enum list ELightType to add an extra option. The attached image shows all the code for the enum I have written. I have also got a new action to trigger this light type but it isn't showing in baselightmanager component

spark kernel
#

Does anyone know where I can get a guide for making a custom spline generator for marking trenches out?

river imp
#

Most people here need to watch those videos. Kex on the other hand doesn't.

red cedar
#

Responded to the wrong guy*

red cedar
river imp
river imp
#

You can learn 95% of everything you need to know from the game files.

oblique lynx
#

Yes

#

the option appears when configuring the user action but not on the lights

#

Left is the user action config, right is the light type config

river imp
#

Have you restarted the tools?

oblique lynx
#

yes, I will try again tho

#

Im unsure if a pc restart might help aswell

river imp
#

You definitely shouldn't have to go that far.

#

Is the modded enum being loaded after the baselightmanager?

oblique lynx
#

I am not sure how to confirm that

pliant ingot
# oblique lynx

Are you sure that right menu is defined by enum? It looks like just a bunch of manually added bools

oblique lynx
#

My assumption was that, but I can't find any bools in the code for the boxes, i will chgeck this aswell tho

river imp
pliant ingot
#

Mb it's collided with any other enum, and because of this don't show

pliant ingot
#

@oblique lynx try to define some value with single bit for your value, that doesn't collide with other values

oblique lynx
river imp
#

My guess is, just like clothing attachment types were early on. That attribute is "hard coded"

oblique lynx
#

ah thats very annoying

tawny lotus
#

I'm trying to get all mapItems in an area with:
SCR_MapEntity.GetMapInstance().GetInsideCircle(mapItems, pos, distance);
This works nicely in WB but on dedicated server it returns 0 items. Why is that?

torn bane
tawny lotus
red cedar
#

I had a question, is there a big performance difference between saving an instance(of per example the world) and reusing it or is it pretty much just the same as always using the GetGame().GetWorld(). same for controlled entity etc. Or is it negligeable ?

ocean kernel
#

I think it's inlined by the compiler

#

If my understanding is correct then it will actually be faster if you use the functions in your script than if you create variables

sleek dove
sleek dove
sleek dove
ocean kernel
#

Ah ok

#

Do you know if there is a way to make AI Agent run a behavior tree from script?

#

Feels like a basic feature to have

vale verge
#

So overriding the EOnContact doesn't seem to work, or at least I can't seem to find out why it's not doing anything. Is there something else missing from the trigger component that needs adjusting, or other parts somewhere that need to be changed? Even looking at the other components, it doesn't seem like anything really changes, so I'm not 100% script wise what get changed where to make each component do their specific thing.

#

But I know it clearly should work, since it the pressuretriggercomponent and such all do overrides, and also have an inheritence that leads back to the basetriggercomponent

river imp
#

You have to set the event mask and the flags

earnest gorge
#

How do I go about triggering a client script from the server, for example making a hint appear? Is there a good example somewhere of this taking place?

river imp
#

Rpc from server to the client.

earnest gorge
#

Any good examples @river imp?

glossy onyx
#

Would anyone know why the name tags do not pop up at the right distances haveing an issue with that on are server

vale verge
#

Or is it a case instead where anytime your override it, you then have to re-set those event masks and flags, to get it to update?

red cedar
# earnest gorge Any good examples <@164872154154795008>?

https://youtu.be/asWxIIHT6d0

Watch the two replication video also, they're life savers.

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
earnest gorge
vale verge
#

Ok, seems to be specifically an issue somewhere with the EOnContact; I cannot for the life of me get it to do anything, even after setting the event masks, ect, unless I am missing another step outside setting those.

river imp
#

No one can tell if you're doing it right just because you make vague posts on Discord.

red cedar
#

Is it possible that a server under heavy load fails to call a method that has been queued(server side) ?

The server i was in was in the middle of an intense gunfight and an event was triggered. but for some reason a method that was queued was never triggered after the delay.

And when i had tried before(and after) on a low population server the script worked just fine ?

#

(The logs show no errors)

vale verge
#
{    
    override event protected void EOnContact(IEntity owner, IEntity other, Contact contact)
    {    
        GetGame().GetCallqueue().CallLater(RPC_DoTrigger); // Delay it to next frame, cannot delete entity in EOnContact
        Rpc(RPC_DoTrigger);
    }
    
    void ICR_TriggerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
    {
        SetEventMask(ent, EntityEvent.CONTACT);
    }
    
    [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
    void RPC_DoTrigger()
    {
        BaseTriggerComponent baseTriggerComponent = BaseTriggerComponent.Cast(GetOwner().FindComponent(BaseTriggerComponent));
        if (!baseTriggerComponent)
            return;
        
        baseTriggerComponent.OnUserTrigger(GetOwner());
    }
}```
#
{    
    override event protected void EOnContact(IEntity owner, IEntity other, Contact contact)
    {    
        OnUserTrigger(owner);
    }
    
    void ICR_TriggerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
    {
        SetEventMask(ent, EntityEvent.CONTACT);
    }
}```
#
{    
    override event protected void EOnContact(IEntity owner, IEntity other, Contact contact)
    {    
        ICR_TriggerComponent trigger = ICR_TriggerComponent.Cast(GetOwner().FindComponent(ICR_TriggerComponent));
        trigger.OnUserTrigger(owner);
    }
    
    void ICR_TriggerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
    {
        SetEventMask(ent, EntityEvent.CONTACT);
    }
}```
#

detonates on the timer trigger fine, does nothing at all with the contact

river imp
#
override void EOnInit(IEntity owner)
{
    owner.SetFlags(EntityFlags.ACTIVE);
}
#
void ICR_TriggerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
{
    SetEventMask(ent, EntityEvent.INIT | EntityEvent.CONTACT);
}
vale verge
river imp
#
[ComponentEditorProps(category: "ZEL/Components", description: "An Example Component")]
class ZEL_ExampleContactComponentClass : BaseTriggerComponentClass{}
//------------------------------------------------------------------------------------------------
class ZEL_ExampleContactComponent : BaseTriggerComponent
{
    //------------------------------------------------------------------------------------------------    
    void ZEL_ContactComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
    {
        SetEventMask(ent, EntityEvent.INIT | EntityEvent.CONTACT);
    }    
    //------------------------------------------------------------------------------------------------
    override void EOnInit(IEntity owner)
    {
        owner.SetFlags(EntityFlags.ACTIVE);
    }
    //------------------------------------------------------------------------------------------------
    override private void EOnContact(IEntity owner, IEntity other, Contact contact)
    {
        Print(other);
    }        
    //------------------------------------------------------------------------------------------------
}
#

This works

#

if yours don't then perhaps your prefab isn't set up correctly

vale verge
#

All I've done is swap the CollisionTriggerComponent on a 40mm grenade for my component

#

and it functions fine on the timer part

river imp
#

That's probably your problem