#enfusion_scripting

1 messages · Page 18 of 1

static vale
#

Purpose is to setup custom game mode before any players spawn or join. I need to get the edge of the real map so i don't spawn somthing off the map / close to the edge

inland bronze
#

Been an issue for a good while for me, though it’s gotten less consistent. I just chocked it up to Workbench being Workbench for some CPUs

coarse bane
#

my friend have the same issue while streaming on discord but only while streaming

scarlet iris
#

Hello. I created a UI and want to attach it to this screen. Does anyone know where I should attach my script to? Thanks

fringe prairie
#

What are you looking to add?

scarlet iris
# fringe prairie What are you looking to add?

Thanks. just a UI from a mod I'm working on. Figured it's better to have it there than in the actual game screen. there's a good empty space below the "vecinity" section so it would fit nicely there. I was hoping I wouldn't have to actually use the same layout as the InventoryMenu20.layout to add my stuff but not sure if there's another way!

static vale
#

Is it possible to use generic types or is it an internal only thing? I found this, but not sure how to return just a generic type
#enfusion_scripting message

class TestClass<Class T>
{
    T TestMethod(array<T> items)
    {
        return items[0]
    }
}
sweet badger
fringe prairie
river imp
scarlet iris
#

Alright thank you both. I'll try it!

torn bane
#

Hello, todays experimental version contains the next iteration of the persistence system which has finalized script APIs. So anyone looking to implement save/load logic into their custom gamemodes can start playing around with it. Therre are some more bugs and crashes in the system so I would avoid Everon as map and recommend Arland or the included persistence feature test map. I have some minimal info prepared where to start looking for the feature, just waiting for it to be published on the biki.

https://community.bistudio.com/wiki/Arma_Reforger:Startup_Parameters#worldSystemsConfig
https://community.bistudio.com/wiki/Arma_Reforger:Server_Config#persistence
https://community.bistudio.com/wiki/Arma_Reforger:Persistence_System

The stable release of 1.6 will have JSON as data format enabled which we later switch to binary once we had mode time to test. But for workbench development JSON is better to debug anyway. The first 1.6 release will NOT include any HTTP functionality, as I could not finish it in time. It will come with a later update to 1.6 though. But the local disk mode is sufficient for any plain save/load operation where you do not need to edit the data while turned off. There is no 1mb limit anymore as we no longer use JsonApiStruct at all in the system.

errant fog
#

If a player is shot by a vehicle, the instigatorvehicle will be that vehicle.
Any suggestions how i would get the Player or AI entity of the one who actually fired the vehicles weapon?

I can get the vehicle pilot through Vehicle.GetPilot, but what about gunner or commander?

safe geode
torn bane
#

rest api is untouched in 1.6

safe geode
torn bane
#

yes we plan to

abstract crescent
safe geode
torn bane
abstract crescent
# torn bane I do not have any idea what you mean

its more about security, not scripting. But we cant control http requests from mods as game servers administrator. Is it possible to somehow identify workshop mods that use HTTP requests in their code?

#

Like markers or tags in workshop?

torn bane
#

No

torn bane
midnight talon
#

Also you can prevent mods making requests as a server administrator, block connections to those IPs in firewall

sullen coral
#

We have released a script repository on GitHub for the Arma Reforger modding community to track script differences between release versions. This will allow modders to easily take a look at what has changed between release versions while working on updates for their mods.

The current GitHub release is for Arma Reforger Experimental releases. A repository for Arma Reforger Stable will follow the release of Arma Reforger's 1.6 update.

https://github.com/BohemiaInteractive/Arma-Reforger-Script-Diff-Experimental

GitHub

Contribute to BohemiaInteractive/Arma-Reforger-Script-Diff-Experimental development by creating an account on GitHub.

midnight talon
midnight talon
#

Sweet, also you mentioned it can't really handle a map the size of Everon, would you say Kolguyev is usable with it yet?

dire sinew
#

For anyone that wants to test persistence for GM in workbench, open GM_Arland.ent and make sure to select the correct system config:

mossy spade
#

What determines the order of tools in the world editor toolbar? I'd like to group my tools together.

scarlet iris
torn bane
torn bane
dire sinew
torn bane
#

ohhhh maybe those are excluded from public builds ... did not know that. makes sense though. too much data that is not needed. ok so then GM arland is the fastest yes

#

my world was basically MPTest with some examples of each thing that can save and load to run quick tests in

ocean kernel
#

You can grep relevant keywords and it will find them in mod pak files 🙂

#

It is also a good way to find the mod that is crashing your server due to compilation failure but the modder intentionally chose a tag in their mod to make it harder to locate

floral sun
#

Is there any obvious reason that EOnInit (or any other function) isn't being called here?

[ComponentEditorProps(category: "GameScripted/Misc", description: "")]
class MCAT_InputTestComponentClass : ScriptComponentClass
{
}

class MCAT_InputTestComponent : ScriptComponent
{
    [Attribute("Jump", UIWidgets.EditBox, "The name of the input action to listen for.")]
    private string m_sActionName;
    
    //------------------------------------------------------------------------------------------------
    override void EOnFrame(IEntity owner, float timeSlice)
    {
        Print("EOnFrame", LogLevel.NORMAL);
    }

    //------------------------------------------------------------------------------------------------
    override void EOnInit(IEntity owner)
    {
        Print("test init");
        SetupInput();
    }
    
    void SetupInput()
    {
        if (!GetGame().InPlayMode())
            return;
        
        InputManager inputManager = GetGame().GetInputManager();
        if (inputManager)
        {
            inputManager.AddActionListener(m_sActionName, EActionTrigger.DOWN, OnActionTriggered);
        }
    }
    
    protected static void OnActionTriggered()
    {
        Print("Testing");
        return;
    }

    //------------------------------------------------------------------------------------------------
    override void OnPostInit(IEntity owner)
    {
        // remove if unused
        // SetEventMask(owner, EntityEvent.INIT | EntityEvent.FRAME);
    }

    //------------------------------------------------------------------------------------------------
    override void OnDelete(IEntity owner)
    {
        // remove if unused
    }
    /*
    override void EOnActivate(IEntity owner)
    {
        super.EOnActivate(owner);
        SetEventMask(owner, EntityEvent.FRAME);
    }
 
    override void EOnDeactivate(IEntity owner)
    {
         super.EOnDeactivate(owner);
        ClearEventMask(owner, EntityEvent.FRAME);
    }
    */
}
floral sun
pliant ingot
#

same for frame* events (but you can set/unset it at any time, not only in init)

floral sun
#

Oh my god I can't belive I'm that blind

#

Thank you

spark otter
#

also tried the new CLI param for world systems, but thats not very clear how to use that either.

#

I went to the config file in the setup section of the new doc page, but everything seems already enabled. How am I supposed to tell if its working or not?

midnight talon
#

I'm guessing for it to run in Conflict we'll need to add the persistence system to an override of ConflictSystems.conf?

spark otter
floral sun
#

Out of curiosity, are scripts simply interpreted or is there some sort of JIT?

midnight talon
#

I was expecting EPF-style autosave/load

#

I guess should be able to script that in to gamemode start/end events or something

#

Editor chugs a bit when loading a session on Kolguyev (I can see why Everon for now was disadvised 😆 ) but otherwise seems to work great, awesome job Arkensor and team 👍

midnight talon
#

even deleting all my scripts still gave compile errors, they didn't go away until I deleted prefabs and configs too 😄

spark otter
#

glad you figured that out though, I had suspected that might be the case!

midnight talon
spark otter
midnight talon
#

Yeah I was wanting to do an almost full rewrite anyway so it's perfect timing for me haha

floral sun
#

What does it mean when my input context is yellow? I activated the context from script, but its not working

#

This is what I did to activate the context based on what's in SCR_IntroSplashScreen2Component.c

    void ActivateContext()
    {
        if (!m_bShouldActivateContext)
        {
            return;
        }
        
//        Print("Context Tick", LogLevel.DEBUG);
        GetGame().GetInputManager().ActivateContext(m_sContextName);
        GetGame().GetInputManager().ActivateAction(m_sActionName);
        GetGame().GetCallqueue().CallLater(ActivateContext, 0)
    }
#

Huh, I fixed it by increasing the context priority from 0 to 15, anything 10 or below doesn't seem to work for some reason

#

Actually, it might be a bit smarter to just make my action part of GlobalContext for what I'm doing

river imp
spark otter
#

So I think Im stuck on GetSaves: cs SaveGameManager SGMan = GetGame().GetSaveGameManager(); array<SaveGame> sGames = {}; SGMan.GetSaves(sGames, "3BE30F418DCEE458"); is giving me an error on that 3rd line: ```
RESOURCES (E): Wrong GUID/name for resource @"{0000000000000000}3BE30F418DCEE458" in property "<missing-def>"

midnight talon
#

why tf does a fresh custom faction duplicated from US and name changed in UIInfo show up as Sowjets?

midnight talon
#
    void HandleStartup()
    {
        const SaveGameManager manager = GetGame().GetSaveGameManager();
        manager.SetSavingAllowed(true);
        manager.SetEnabledSaveTypes(ESaveGameType.AUTO);
        manager.RetrieveSaveGameInfo(null, new SaveGameOperationCb(OnLoad));
    }
    
    void OnLoad(bool success)
    {
        const SaveGameManager manager = GetGame().GetSaveGameManager();
        array<SaveGame> saves = {};
        int count = manager.GetSaves(saves);
        
        if (manager && count)
            manager.Load(saves[0]);
    }
    
    void HandleShutdown()
    {
        const SaveGameManager manager = GetGame().GetSaveGameManager();
        manager.RequestSavePoint(ESaveGameType.AUTO, flags: ESaveGameRequestFlags.BLOCKING);
    }

Works but I can't find an event/method to call HandleShutdown that doesn't also get triggered by calling Load (load ends game -> starts new game from save) so it keeps getting stuck in a loop

#

literally just duplicated US faction, changed their key + UI info and it also happens

#

factions in 1.6 are fucked

midnight talon
#

Ok I figured it out, faction names in 1.6 seem to be hardcoded based on faction key, completely ignoring the UI Info you put in for them if the key isn't one of the vanilla ones. Only factions with the vanilla faction keys get names now apparently.

#

Previously you could give a custom whatever faction key you want and everything would work ok, someone has broken something here

#

With faction key = US (or presumably other vanilla keys) the custom UI info name shows up as expected, with any other faction key the name becomes Sowijet

spark otter
midnight talon
#

but the loop happened because HandleShutdown triggers whenever I call manager.Load

midnight talon
#
modded class SCR_GameModeCampaign : SCR_BaseGameMode
{
    override protected void Start()
    {
        m_OnStarted.Insert(PostStartSetup);
        m_OnGameEnd.Insert(PreShutDown);
        super.Start();
    }
    
    void PostStartSetup()
    {
        MO_GameModeStateSystem.GetInstance().HandleStartup();
    }    
    
    void PreShutDown()
    {
        MO_GameModeStateSystem.GetInstance().HandleShutdown();
    }
}

This is how I was triggering it

#

saving and loading both works, its just that loading causes game mode to end -> causes it to save and load again in infinite loop

#

if there was something like m_OnGameExit that didn't get triggered by calling manager.Load then it would be ez

midnight talon
#

I suspect someone has added some of that goofy if (factionKey == hardCodedValue) kinda logic seen above into Faction.GetFactionName, so GetFactionName is only returning a name if the faction's key is one of the vanilla ones

#

Wish more stuff was scriptable so we could fix it when they break it

spark otter
torn bane
torn bane
# midnight talon I was expecting EPF-style autosave/load

It does, but not killing the game anymore. it was too unreliable for server exe before the OS said "enough, you shut down now".
Saving is done via exit to main menu, explicit save buttons, auto save interval or scripted events

torn bane
torn bane
#

Persistence megathread

#

^^^^ Persistence discussion goes here please
Because I can not pin a thread - thank you discord - I am pinning this message.

midnight talon
#

See how I put "Players" in the info but the game gives me Sowijet

#

There seems to be a bug in 1.6 where the UI info only gets read when FactionKey is one of the vanilla factions, if I change the key to US the custom UI info name shows as expected

torn bane
#

I do not know much about this faction setup, its more a question for #enfusion_configuration as it has nothing to do with scripting. but either way if you think there is a bug please make a feedback ticket with the minimal steps to reproduce this

midnight talon
vagrant veldt
#

Does Enfusion offer a predefined event that directly intercepts experience gains?

vagrant veldt
#

thanks Ark!

random moat
#
        override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
    {
        vector mat[4];
        IEntity.GetTransform(mat);
        Print( mat );
    }
#

scripts/Game/Components/UserActions/SCR_BangaloreDuplicateAction.c(11): error: Trying to call non-static function 'GetTransform' as static

#

Welp

midnight talon
random moat
#

Where *

#

Thank you for your help

midnight talon
#

They are defined at the start of your example in the method signature:
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
Generally if you want to see where the values that get passed into something might come from, you can search for usages (ctrl+shift+F and search for PerformAction()
If you want to see the definition of IEntity (or any class/method/prop) you can ctrl+click on it and the editor will take you to the definition

dire sinew
#

Actually, to check out where a symbol is defined, you can do CTRL+LMB on it to jump to its definition.

midnight talon
#

In this particular case pOwnerEntity is the entity the action is attached to / being activated, and pUserEntity is the entity performing the action (player or AI character)

#

Yeah ctrl+lmb on something to go directly to it's definiton, and just do project wide search to find usage examples if you want an idea of where the data getting passed in comes from

cerulean stag
#

i don't understand 🫠

midnight talon
#

If you don't see notnull on the type, always assume there is a situation where it could be null

random moat
#

pOwnerEntity.GetYawPitchRoll(orient);

#

scripts/Game/Components/UserActions/SCR_BangaloreDuplicateAction.c(13): error: Too many parameters for 'GetYawPitchRoll' method

#

I see that the out is array of size 3

#

but i am not sure what i am doing wrong

#

Is this a function i can only use on players?

dire sinew
midnight talon
#

It's kinda deranged how enforce script expresses vector types using array access syntax tbh

spark otter
#

Why would I be getting ```
Bad type 'SCR_GameCoresManager'

torn bane
#

Because of a different compile error elsewhere that stops vanilla from compiling

spark otter
#

well how am I supposed to figure that out when the only compile error is this?

#

Its not a bad type, but it cant get past that point!

spark otter
#

ok so apparently I had done a duplicate to override the entire file. Then I commented out everything in the file. Only once I actually deleted the file with everything commented out would it compile correctly.

#

So I guess it was still reading the file with commented code in it, essentially wiping the vanilla file.

dire sinew
#

Yes, same path leads to file patching 🙈

torpid sand
#

which EntityEvent should i use??? for physics update

OnEFrame only works but coming for GD background it very unefficient Phsyics Has its owns Independent framwe logic loop

#

i tired EOnSimulate And also SetEvenet mask for it it doese do a simpel print

floral sun
river imp
molten glacier
#

Is there a way to get an npc to aim and trigger a primary fire of a weapon as if there was a button press method?

gentle cradle
#

does anyone know what the function is for the camera system?

minor agate
#

Do you want to create a custom camera?

gentle cradle
midnight talon
#

RE making the WB remember selected systems config, it would nice if we also had an option here to just use whatever system config is specified in the mission header

#

Can BI please stop doing these hardcoded faction key checks? Pretty sure these should be referencing the SCR_GameModeCampaign.m_sBLUFORFactionKey etc configurable Conflict belligerent faction keys, not hardcoded faction key constants. It's this kind of stuff that leads to bugs like https://feedback.bistudio.com/T195459

#

ah nvm I jumped the gun on that one, GetFactionByEnum actually does check the campaign keys internally

#

still tho there are tons of hardcoded faction key checks around

fringe prairie
#

it's a pretty nifty system, i need to do a write up on it

#

Because the way the GM camera works:
On simulation, it processes a stack of changes.
For example the player can move it around, that's one layer of "changes"
Then there is terrain level stuff, so closer to terrain the slower it should move, that is another layer which affects previous ones.
Then there is the hover functionality, which biases the camera to have rotational assist, or snapping to a target.
All of these get stacked and whenever a change happens - the script marks the old data as dirty, and camera translates to new position,
As a result of all the layers acting on it. Very smart approach to the problem. All done in script, not game code.

fringe prairie
#

You would need a game master context action:

extend SCR_BaseContextAction

Which would be added to overridden EditorModeEdit.et under the SCR_ContextActionsEditorComponent.

Then you extend SCR_BaseManualCameraComponent, and add it to overridden ManualCameraEdit.et under the entities components.

You would get your component with something like this:

// Get the GM camera
SCR_ManualCamera gmCamera = SCR_CameraEditorComponent.GetCameraInstance();
s_OverrideComponent = AG0_PlayerCameraOverrideComponent.Cast(gmCamera.FindCameraComponent(AG0_PlayerCameraOverrideComponent));

The priority set on the component determines at what time in the stack does it run (first or last), you want to be last so that snapping, terrain, etc. does not interfere. (though iirc low number means low priority, so you want it to be really low number?)

You'll have to look through the source classes or find the examples in #1430441381649715220 which allow you to set the camera on a broadcasting device. Biggest issue I think is hiding the head/head clipping for first person, also first person and third person are slightly misaligned in engine. Found this out taking the player camera's transform, and copying it to a PIP camera, had some mean frame imperfect lag, due to PIP camera (arbitrary camera index) not matching script "idea" of where a transform actually is at that point in time.

river imp
midnight talon
river imp
midnight talon
#

So I made a generic entity with an EOnInit override and put it into the world, but EOnInit is never called, what am I missing here? Do I have to set an event mask or put the script in a specific directory?

class MO_Spawn_AreaClass : GenericEntityClass
{
}

class MO_Spawn_Area : GenericEntity
{
    [Attribute("RANDOM", UIWidgets.Auto, desc: "Area name to match against infil action name", category: "MercOut!")]
    string spawnAreaName;
    
    override void EOnInit(IEntity owner)
    {
        PrintFormat("MO_Spawn_Area.EOnInit(): Registering Spawn Area '%1'", spawnAreaName);
        MO_GameModeStateSystem.spawnAreas.Insert(spawnAreaName, this);
    }
}
pliant ingot
midnight talon
torn bane
gentle cradle
timid citrus
#

Any quick way to make weather work outside of the world bounds? Or just make the world bounds yuge?

midnight talon
#

Are there any plans to allow modding shaders or is that unlikely to ever be a thing?

floral sun
# torn bane No

I'm assuming that's due to having to deal with console specific SDKs for shaders?

#

It probably wouldn't be practical from a cost standpoint, but depending on how shaders are compiled for Enfusion, could you handle compiling shaders for consoles during some sort of backend processing step after mod upload?

torn bane
#

Proprietary technology which we can not share even if we wanted to (which we do not). Without it you can not develop these shader.

floral sun
#

And TBH it's probably for the best as well, given some of the rendering tech I've seen in Enfusion, allowing user made shaders could make things a bit more difficult. It's also probably best for everyone to use the same material workflow anyways to prevent fragmentation when it comes to addon development

elder wigeon
#

@torn bane is there any way to spawn helis wothout rockets loaded, i.e. with empty pods without extra scripts? Just changing values in workbench?

random moat
#

I have an array in an ScriptedUserAction , how do i access this array from another scripteduseraction?

little otter
#

How do i add a new chat command, does anyone have a example for it?

fringe prairie
#

It’s super easy, just copy the usage of BanCommands.c, or my implementation

#

You can set permission level, etc. so much easier than Minecraft plugins lol

little otter
midnight talon
# random moat I have an array in an ScriptedUserAction , how do i access this array from anoth...

You would either need to find a way to get a reference to that user action instance or possibly make the array static so it can be read w/o an instance.

If they are both on the same action manager component you could probably use FindComponent on the owner entity to look up the other action. But otherwise I would probably recommend moving this array to somewhere more easily accessible. I usually just whack custom client side logic into an override on SCR_PlayerController (which is very easy to get a reference to) unless it becomes complex enough to warrant its own class

cerulean summit
#

Hey so i wanted to see if someone could help me try to get supplies and added ai to our server just dont know how and I was wondering if someone would be able to provide some assistance to me with it or atleast walk me through it

#

for ARMA REFORGER

tawny lotus
#

There are cases where a game has multiple faction managers. Using GetGame().GetFactionManager() returns the first one found. What is the way to find all faction managers in use/available?

torn bane
tawny lotus
#

Heh, I maybe worded my response badly. 🙂 I noticed a situation where a gamemode has defined the faction manager. Now, as a next step someone adds a mod with a new faction. This new faction is not automatically included in the existing faction manager. Adding a second faction manager, kinda fixes the issue, but is not the right way (as mentioned above). I don't have a way to ask for all existing factions includind the added one.

mossy spade
#

I don't have a way to ask for all existing factions includind the added one.
That. 👆 The faction system lacks a central registry (analogous to entity catalogs for vics/items/etc.), but a major issue for me is the fact that factions have to be statically defined on FactionManager in the first place.

tawny lotus
ocean kernel
#

You can have factions in files that arent defined in faction manager, but those won't work well either way so feel free to ignore them

#

Faction manager should be enough realistically

#

Thats the registry

mossy spade
#

It's not. The prefab hierarchy in vanilla is:

- FactionManager_Base - this has no factions
  - CampaignFactionManager (Conflict?)
  - FactionManager_Editor (GM game mode?)
  - FactionManager_USxUSSR (Combat Ops?)
  - FactionManager_FFA (?)
#

Following this pattern new game modes should inherit FactionManager_Base. Where do you add your modded faction, so that all of them could use it?

#

FactionManager entity should have an attribute to statically define list of faction keys to use (for WB users) that'd use an underlying API to dynamically load them from a central registry, defined by a standalone .conf. That way one could still use the current pattern, but it would also work for universal game modes that decide factions at runtime.

#

Also another side effect of having anything possible declared in FactionManager upfront is that these factions appear in the GM interface. If the game mode logic is built around specific faction roles, it is undesired for the GM to have the ability to spawn completely unrelated faction elements (and players assume "if it shows up in UI, I can use it").

past swallow
#

Hello, quick question if anyone can help please?

i have been trying to get menuspawnlogic to work with EPF_BasicRespawnComponent so that faction selection is available on joining the server for say civilian and police. i understand this only works with SCR without making custom scripts. Just wondering if anyone has already achieved this or can guide me in the right direction please...

midnight talon
# past swallow Hello, quick question if anyone can help please? i have been trying to get men...

I got it working with a custom respawn system component and a ton of overrides to Conflict+EPF stuff, it was very painful to get working properly because EPF's base respawn system component overrides-out a ton of calls needed for the spawn menu so you gotta figure out what to call for your game mode w/o calling too much to cause players to spawn before EPF properly inits them.
I would strongly suggest starting in 1.6 Experimental with the new persistence system as it already supports vanilla menu spawn logic and EPF is going to be deprecated in favour of it

past swallow
midnight talon
#

not exactly, there is a new vanilla persistence system that replaces 1.4 savegame system + EPF

boreal swan
#

So, I have this character placed in World Editor and I've added a component from the BIKI tutorial to it: https://community.bistudio.com/wiki/Arma_Reforger:Create_a_Component
I've added some debug prints in the code, and based on them the component is active and running. However, nothing is happening despite of that when I run back and forth in the play mode in World Editor. ```csharp
// Editor attributes
// ...
protected Shape DrawLine(notnull IEntity from, notnull IEntity to, vector offset)
{
Print("Entering DrawLine method");
vector points[2] = { from.GetOrigin() + offset, to.GetOrigin() + offset };
float distance = vector.Distance(points[0], points[1]);
if (m_bLineFadeInOut)
{
int alpha255 = 255 * (1 - ((distance - m_fTriggerRadius) / (m_fWarningRadius - m_fTriggerRadius)));
m_iTempLineColour = m_iTempLineColour & 0x00FFFFFF | (alpha255 << 24);
return Shape.CreateLines(m_iTempLineColour, ShapeFlags.TRANSP, points, 2);
}
else
{
return Shape.CreateLines(m_iTempLineColour, 0, points, 2);
}
}

//------------------------------------------------------------------------------------------------
override void EOnFrame(IEntity owner, float timeSlice)
{
    super.EOnFrame(owner, timeSlice);

    vector ownerPos = owner.GetOrigin();

    m_fCheckDelay -= timeSlice;
    if (m_fCheckDelay <= 0)
    {
        m_fCheckDelay = m_fCheckPeriod;

        m_aNearbyCharacters.Clear();
        owner.GetWorld().QueryEntitiesBySphere(ownerPos, m_fWarningRadius, QueryEntitiesCallbackMethod, null, EQueryEntitiesFlags.DYNAMIC | EQueryEntitiesFlags.WITH_OBJECT);
    }

    m_aShapes.Clear();
    m_aShapes.Reserve(m_aNearbyCharacters.Count());
    foreach (IEntity character : m_aNearbyCharacters)
    {
        Print("In foreach loop");
        vector characterPos = character.GetOrigin();
        if (vector.Distance(characterPos, ownerPos) > m_fTriggerRadius)            // in the warning zone
        {
            Print("Drawing a line");
            m_aShapes.Insert(DrawLine(owner, character, m_vOffset));    // draw line
        }
        else                                        // in the trigger zone
        {
            Print("Teleporting!");
            vector dir = vector.Direction(ownerPos, characterPos).Normalized();
            character.SetOrigin(ownerPos + dir * m_fTeleportDistance);    // teleport
        }
    }
}

//------------------------------------------------------------------------------------------------
// QueryEntitiesCallback type
protected bool QueryEntitiesCallbackMethod(IEntity e)
{
    Print("Checking entity...");
    if (!e || !ChimeraCharacter.Cast(e)) // only humans
        return false;

    Print("Entity of correct type found!");
    m_aNearbyCharacters.Insert(e);
    return true;
}

//------------------------------------------------------------------------------------------------
protected override void OnPostInit(IEntity owner)
{
    m_aShapes = {};
    m_aNearbyCharacters = {};
    m_iTempLineColour = m_LineColour.PackToInt();
    Print("OnPostInit");
    SetEventMask(owner, EntityEvent.FRAME);
}

}

#

The console log prints mostly these debug lines regardless of the distance from the character with the component attached: WORLD : UpdateEntities WORLD : Frame SCRIPT : In foreach loop SCRIPT : Teleporting! WORLD : UpdateEntities WORLD : Frame SCRIPT : In foreach loop SCRIPT : Teleporting! WORLD : UpdateEntities WORLD : Frame SCRIPT : In foreach loop SCRIPT : Teleporting! Also the "Checking entity..." and "Entity of correct type found!" debug prints appear occasionally (based on a pattern that I haven't figured out yet), but the code never enters the DrawLine method.

What might be wrong here?

#

The code flow seems to change when I shoot the character. After that the console logs keeps spamming this instead; ```
WORLD : UpdateEntities
WORLD : Frame
SCRIPT : Checking entity...
WORLD : UpdateEntities
WORLD : Frame
SCRIPT : Checking entity...

#

Found the first error with debugger... The querying method includes the character itself in the results 😄

boreal swan
#

Hmm... The script only recognizes the character with the component itself but not e.g. my character when I test it in the World Editor. What could cause this?

#

(I edited the code to skip the origin character): ```csharp
// ...
m_aShapes.Clear();
m_aShapes.Reserve(m_aNearbyCharacters.Count());

foreach (IEntity character : m_aNearbyCharacters)
if (character == owner)
{
continue;
}
// ...

minor agate
#

Sometimes WB bugs out scripts when dealing with components

#

Restart workbench and try again

boreal swan
#

Roger, trying it now

boreal swan
#

Aaand there we go, for some reason the character that I spawn in when pressing the play button is GameEntity instead of ChimeraCharacter 😄

#

Is there a shortcut to play as a unit placed in World Editor?

timid citrus
#

Oh nm

boreal swan
timid citrus
#

I'll send you my dev spawn function you can prob adapt it.

torn bane
#

If you return false from a query it will stop and not find other entities that would come laterr. its not a yes no filter.

boreal swan
torn bane
#
//------------------------------------------------------------------------------------------------
// QueryEntitiesCallback type
protected bool QueryEntitiesCallbackMethod(IEntity e)
{
    if (ChimeraCharacter.Cast(e))
        m_aNearbyCharacters.Insert(e);

    return true;
}

this checks for characters and also implicitly that they are not null. though a query never returns a null entity to the callback by design

boreal swan
#

Testing it now, thanks

#

Damn, it works like a charm 👍 Maybe it could be added to the related wiki article?

olive burrow
#

Sorry for my dumb question, but RestApi in Infusion works fine? I can't get data from http 🙁 Every time i get data length 0

#

POST is ok, but GET not working for me

olive burrow
# pliant ingot Yes, it's work fine.

Hmm... Can you show me you simplest query to get some data from http?
I'm doint something like this:
auto ctx = GetGame().GetRestApi().GetContext("http://127.0.0.1/");
auto content = ctx.GET_now("unixtime/");
PrintFormat("[HTTPQ] %1", content);

#

I can't understand why always returns a data size of 0 and an empty response. Whatever I output on the page, it's always 0. No errors, everything is fine, but... Zero.

pliant ingot
olive burrow
#

I've tryied it only today. All other variants was like ctx.Get("");

olive burrow
# pliant ingot What? What's code?
class Bridge_HttpCallback : RestCallback
{
    override void OnSuccess(string data, int dataSize)
    {
        PrintFormat("[Bridge_HTTP] OnSuccess - datasize %1", dataSize);
        Print(data);
    }

    override void OnError(int errorCode)
    {
        PrintFormat("[Bridge_HTTP] OnError — %1 (%2)", errorCode, typename.EnumToString(ERestResult, errorCode));
    }

    override void OnTimeout()
    {
        Print("[Bridge_HTTP] OnTimeout");
    }
}

class Bridge_HttpTester
{
    protected RestContext m_pContext;
    protected string m_sBaseUrl;
    protected string m_sHeaders;

void Init(string host = "127.0.0.1", int port = 80)
{
    m_sBaseUrl = string.Format("http://%1:%2/", host, port);
    m_pContext = GetGame().GetRestApi().GetContext(m_sBaseUrl);

    m_sHeaders = "Content-Type,application/json,User-Agent,Bridge_HTTP-Test";

    PrintFormat("Base URL: %1", m_sBaseUrl);
    PrintFormat("Host: %1", host);
    PrintFormat("Port: %1", port);
    PrintFormat("Headers (will be set): %1", m_sHeaders);

    m_pContext.SetHeaders(m_sHeaders);
}

    // GET
    void Get(string path = "unixtime/")
    {
        if (!m_pContext)
        {
            Print("[Bridge_HTTP] err pContext!");
            return;
        }

        string fullUrl = m_sBaseUrl + path;
        PrintFormat("[Bridge_HTTP] try GET %1", fullUrl);
        PrintFormat("[Bridge_HTTP] headers: %1", m_sHeaders);

        m_pContext.GET(new Bridge_HttpCallback(), path);
    }
}

// autostart

modded class SCR_BaseGameMode
{
    override void OnGameStart()
    {
        super.OnGameStart();
        Print("[Bridge_HTTP] diag - ok");

        auto http = new Bridge_HttpTester();
        http.Init("127.0.0.1", 80);
        http.Get("unixtime/");
    }
}
#

WHOA/// Sorry, is it too much?

pliant ingot
pliant ingot
# olive burrow Hmm... Can you show me you simplest query to get some data from http? I'm doint ...

Second, simple example:

class MyRestApi {
    protected static ref MyRestApi myRestApi;
    
    protected ref RestCallback myRestCallback;
    
    static MyRestApi GetInstance() {
        if (!myRestApi) {
            myRestApi = new MyRestApi();
            myRestApi.myRestCallback = new MyRestCallback();
        };
        return myRestApi;
    };
    
    RestCallback GetCallback() {
        return myRestCallback;
    };
};

class MyRestCallback : RestCallback {
    override event void OnSuccess(string data, int dataSize) {
        PrintFormat("%1.OnSuccess(%2, %3))", this, data, dataSize);
    };
    
    override event void OnError(int errorCode) {
        PrintFormat("%1.OnError(%2))", this, errorCode);
    };
    
    override  event void OnTimeout() {
        PrintFormat("%1.OnTimeout())", this);
    };
};

In remote console:

auto api = MyRestApi.GetInstance();
auto callback = api.GetCallback();
auto context = GetGame().GetRestApi().GetContext("http://localhost:5000");
context.SetHeaders("Content-Type,application/json");
context.GET(callback, "/path/to/endpoint");
context.POST(callback, "/path/to/endpoint", "{\"string\": \"Hello World\"}");
context.PUT(callback, "/path/to/endpoint", "{\"string\": \"Hello World\"}");
context.DELETE(callback, "/path/to/endpoint", "{\"string\": \"Hello World\"}");
olive burrow
gloomy jay
#

SetHeaders taking an associative array string encoded by joining with comma. How do you then encode a comma into a field value?

torn bane
olive burrow
#

@torn bane i understand, but Enfusion for me - dark forest for now 🙂 Oh! One more moment - i've sent you PM in X, ignore it 🙂 Since 2002, I've dreamed of working for Bohemia on Arma, but... Unfortunately, I'm too weak as an IT specialist for your company 🙂

open pier
minor agate
hearty oracle
#

It said that Enfusion Script supports exception handling so that must be true

#

And that the only "catch" is that there is no "finally" block

#

I choose to believe ChatGPT over Arkensor

olive burrow
fringe prairie
desert escarp
#

The only thing I use it for is vector math

#

Cause what the fuck even is this

olive burrow
midnight talon
#

It's even more fun when you're used to Z as vertical and keep wondering why Y axis is putting things in the sky 😄

minor agate
coarse moon
#

I have updated one of my scripts because they have modified things in OnDamageStateChanged in the experimental version, but when I update it, I get all these errors about vanilla things, which I don't call at any point...

scripts/Game/Components/Custom_CharacterDamageManagerComponent.c(10): error: Overloading event 'OnDamageStateChanged' is not allowed

coarse moon
solid hearth
#

So... any particular reason the campaign building system refuses to consume supplies unless SCR_GameModeCampaign is the current mode... this change seems... dumb.. and I hate it.. very much..

torn bane
solid hearth
#

suss worked fine before

torn bane
#

i mean yoyu can have a loook at the scripts and submit feedback and or mod a change if needed

ocean kernel
#

You wouldnt want a building system outside of conflict in the game anyway, right?

craggy jolt
#

I'm wondering if there is a way to pass unrealized damage from HZ to its parent HZs. By unrealized damage I mean the damage when HZ already has no health left. Are my attempts futile?

#

More simply: RHand has 0 health, you shoot it and I want the damage still pass to main health HZ

dire sinew
solid hearth
#

Technically speaking the building system is apart of the editor with just has interactions with the resource system, basically a limited version of GM.. and the resource system afaik is meant to be a flexible and usable system by all.. This change is a 1.6 specific thing, supplies are even put down as a disabled resource type on the editor gamemode now and I just don't get why this was done.

I have a custom game mode and prefab, if I switch the entity class type to campaign gamemode it works fine. I've gone up and down SCR_GameModeCampaign and there's nothing particularly fancy or needed. It's just some type of hard-coded lock as if it's there's some disgusting cast type dependency somewhere that really isn't needed, this all worked perfectly fine since 1.1 up to 1.4 so I just don't get the change. After sleeping it's fine, it's w/e, I'll just make my class inherit off campaign and disguise myself. Lesson of the day is don't be lazy just do everything from scratch, don't use any vanilla systems if at all possible cause it just leads to ruin later on cat_thumbs_up

dire sinew
#

supplies are even put down as a disabled resource type on the editor gamemode now
No, this isn't just a 1.6 thing, it has been for a long time. Disabling the resource type just means that services are unlimited and need no supplies, which imo is a sensible default for GM. Besides GM can reenable global supply usage via the scenario properties.

dire sinew
desert escarp
#

Is there a way to get the playerId of a player from a GUID besides manually looping through and checking every connected player Id

dire sinew
midnight talon
timid citrus
#

Yeah It's all interconnected pretty deep.

midnight talon
#

I was kinda hoping a lot of it would become more independent having seen refactor notes that some conflict stuff should be pulled out into their own systems, but in 1.6 some things seem to have taken a step backwards becoming even more tightly coupled with the game mode

dire sinew
#

But let's be fair, it overall used to be way worse in the older code base. For instance, the ambient patrol system used to be deeply embedded in the conflict game mode class before it got refactored into a system.

midnight talon
#

Yeah overall I think 1.6 is much improved in that same fashion. I'm guessing some of this was just to get things working in experimental while refactoring is still in progress, hopefully just some loose ends that get tied up before release 🤞

spark otter
midnight talon
desert escarp
#

BI Identity

#

Its looking like I'm just gonna prep an array when I need to check cause I need it all at once anyway

craggy jolt
#

Yeah it works

wet trench
#

Hi, could I get some help with Replication? I have an Entity that I want to use as a manager for an array I have. So the server spawns the Entity in, it's a prefab that I have given a RplComponent to. The Entity has a public function like .RequestAddRecords(...) that I want my own menu to be able to use. But I don't know how to get a reference of the Entity from within my menu's class. I'm thinking of using the RplId of the Entity when the server spawns it in, but I don't know if I can synchronize it so client's get it whenever they first open their menus

fringe prairie
#

or server side system with modded player controller methods to allow granular control of data being sent from the system to specific players

#

The client will simply not be able to resolve the entity, by design, without some hoops to jump through if you must go this route (like disabling streaming, I'd search for that in this channel for info)

ocean kernel
#

Simply register your entity in your menu after init

#

Since it's streamed to the client

#

It will be on the client

river imp
#

Or just use a game system

ocean kernel
#

Yes you can do that also if you want to spend more time for questionable benefit

fringe prairie
#

Just worried if the intent is using the entity as a global manager lol

river imp
#

Like the weather manager, or faction manager...

#

Can we still not rpc from client to server in a game system?

fringe prairie
#

Idk, haven't tried

ocean kernel
#

How would that work with the ownership model?

#

Will check in 1.6

river imp
#

Each player owns their own client game system I suppose. If it's "Both" or "Client".

ocean kernel
#

So the server runs 50 game system instances for 50 players? Otherwise how rpc from client

#

Sounds like an entity with extra steps

river imp
#

I always used entities, I just recall game systems being "the better way".

solid hearth
pliant ingot
# ocean kernel How would that work with the ownership model?

All replicated world systems are owned by server. This means that replicated world systems can broadcast information to all clients, but they cannot communicate with specific client (neither sending, nor receiving). We'll talk about communication between specific client and server in section World controllers.

#

While owner of replicated world system is always server, owner of world controller is always one of the players. This allows owner player to communicate with server through the world controller and it also allows server to send information only to particular player via their controller.

ocean kernel
#

Yeah, entity with extra steps

torn bane
torn bane
solid hearth
#

It indeed functions perfectly fine outside of campaign, nothing in resource consumption is really campaign specific, I realized after finding it and comparing it against old code it was done because of the new persistence system cause it used to be something like:

SCR_GameModeCampaign campaign = SCR_GameModeCampaign.GetInstance();
if (campaign && campaign.IsSessionLoadInProgress())
    return;

aworrySpin

torn bane
#

There are two things, one is avoiding re-consumtion of supplies when loading a save and the compositions are loaded in, the second is a replication error that got fixes in the mean time. The check for save game load is done entirely independently of gamemode, but the error fix still relies on it. It may not actually work without campaign mode, you just did not observe the error logs. set your level to debug and #restart your server and you might observe the "unregistered network item" error prints which we fixed. the code is specifically asking for campaign mode down the road from that method

wet trench
#

ahh I'm not gonna lie idk what systems and controllers are. I'm going to re-read the docs now that I have attempted something. If it clarifies things, my project is a menu which looks like the players-list-menu when you are in a match. But you can add bots which recursively place NPCs. Then the Entity-thing is a Manager where the bots are just values stored in an array in the Manager. Hopefully that makes sence. I've copied the examples from the docs and made them work, but I guess I need to go back and understand what they do

midnight talon
minor agate
ocean kernel
#

No u

minor agate
#

Entity have other things undergoing on the engine, like simulation, some resolution of resource usage, more complex replication hierarchies, more data to process, longer data/memory usage, more fragmented processing/computation, etc etc

#

Systems are, more simple and systematic internally.

#

also you can rpc and use rpl props on systems

#

And you can start using and checking out World Controllers and World Systems + Event System in 1.6 currently.

#

Although you might find issues, port is recent

#

World Controllers makes you avoid using Player Controller with components for stuff

boreal swan
minor agate
#

On doxygen

boreal swan
#

Roger, will check it out

minor agate
#

Also beware that we are moving away from BIKI. So in future you will see a lot of updates to doxygen which is what we will use for official docs

boreal swan
#

Yeah there was some discussion about it recently

#

So are the introductory scripting tutorials on BIKI becoming obsolete as well?

minor agate
torn bane
#

Documentation != Tutorials also

scarlet iris
#

So the only way to access doxygen is by opening the zip folders inside Arma Reforger Tools\Workbench\docs ?

minor agate
#

Ok rip can't check because cloudflare also just blocked me now that I am in mexico pain.
So I can't open BIKI

#

It should be in the main scripting page for Enforce Script

#

At the top it should have a link to it

torn bane
#

Most successfull CF user at our company

scarlet iris
midnight talon
#

Where can I control creating a new group upon a new (no persisted data for them) player joining a faction? I used to apply my custom logic for this in overrides to EPF methods for handling new player setup but with the new persistence system I'm not sure.
I'm using SCR_MenuSpawnLogic with a forced faction, that faction has no predefined groups and one gets auto-created but I can't seem to find any references to create or join group methods anywhere that relates to a new player joining

mossy spade
#

SCR_BinLoadContext is broken in exp. Loading back the same class saved previously with SCR_BinSaveContext returns most fields as NULL, interestingly it happens only ingame, and works as expected from WB.

#

(on a side note, the binary format also changed since 1.4, which is a pretty significant change, yet I think I haven't seen it in any changelog or communication)

torn bane
torn bane
mossy spade
#

I think it should be signaled it's not meant for use by modders then.

#

For example, if I used binarized format with EPF, all campaigns in progress of my playerbase would be dood now. 😉

scarlet dune
#

oh no lol

torn bane
#

Binary is the fastest and most compact container, the speed comes with the compromise of not always being backwards compatible. This is the first breaking change it received since it released and it will probably not break again until future game titles.

Its absolutely meant for modders, we only use it for save game data otherwise in vanilla. If you need a well defined, always compatible format, you need to use json

torn bane
scarlet dune
#

i can see that and agree totaly

mossy spade
torn bane
#

Either way, please send me an example to validate your issue. I can do so tomorrow. If the bug is still present then it will be fixed in the next 1.6 update after stable release

mossy spade
#

Thanks, I'll do that next week, as I'm busy right now working around that for tomorrow.

torn bane
mossy spade
scarlet dune
#

hay your really cool man @ Arkensor

torn bane
restive island
#

@torn bane any plan in the 1.6 update(s) to fix the "create/update prefab" problem that makes a bad Editable Prefab? Looks like a null pointer scripting issue https://feedback.bistudio.com/T195486

torn bane
#

I do not see any progress on it yet, besides being assigned for evaluation, so probably not.

spark otter
#

Will persistence no longer crash the server on stable release?

open pier
dire sinew
#

I'm still a bit worried that these changes won't get tested on experimental first.

scarlet iris
#

Yeah it kiiinda feels just a tiny bit rushed in my opinion. Don't get me wrong is great to finally have 1.6 on stable but there are some stuff in exp that are currently not working for me for example the audio is behaving very weird on xbox

spark otter
mossy spade
#

There are two wolves in me. One wishes the stable release will be a completely different and polished version to have the base game in a good condition, the other wishes it will be close to the exp build, as otherwise all of my testing and effort on experimental doesn't make any sense.

dire sinew
spark otter
#

Very true, Id probably have a week's worth of work to do if it were not for the experimental branch. I just really wanted to test the persistence out before stable. Oh well! Ive got PTSD from removing a feature before its replacement was ready, so this persistence stuff was pretty triggering lol

desert escarp
#

Is there anyway to pull an items supply total, like how much supply is needed to pull this item from an arsenal, without spawning the item and without having to loop through every single faction config

#

I don't have the faction of this item in this instance

dire sinew
desert escarp
#

So its not ran off of the arsenal and numerous items can come from seperate factions

dire sinew
#

Point being it goes against how vanilla works, so I don't think you will get around compiling the costs by iterating over all faction item configs.

desert escarp
#

Rip makes sense

midnight talon
midnight talon
#

I ended up just not worrying about controlling the autocreated group and just created my custom group and "moved" the player to it which deletes the autocreated one instantly 🙂

ocean kernel
#

What improvements to json and function callbacks are there in 1.6?

#

I think two biggest things I've complained about aside from exception handling

ocean needle
#

can script invokers not be used from inside a system or am i tweaking?

#

just aint doing anything pepehmmmm

minor agate
tough cave
#

seems like my mission is stuck with debug defines like ENF_WB on a regular server, not sure

rain turtle
#

are you going to update the EDP+EPF for 1.6 ? @torn bane

dusky swallow
#

Anyone else getting this, when pressing play in previously created GM scenario in 1.6 World Editor?

sweet badger
#

@torn bane it's looking like the scenario transition jip error got much worse with 1.6, do you know anything about this?
i was just updating my scenario loading mod, and it seems to happen every time in MP now, during 1.3 it was less than 20%

wooden cape
#

Am I missing something with how classes are structured now?

tawny lotus
#

Anyone else getting this error when doing a shift+f7?

ocean kernel
#

Yes the update introduced new errors on top of previous errors

#

ie. still crashes when recompiling scripts with behavior editor open, but now also likes to throw the above error on top

solid hearth
midnight talon
torn bane
torn bane
sweet badger
torn bane
wooden cape
#

Yep, that was it. It seemed to be erroring in another file.

ocean kernel
#

So how do I spawn shell projectiles now huh since they cant have rplcomponent

torn bane
sweet badger
#

I was testing with my Scenario Reload Menu mod loaded, but I will verify it happens without anything else

rain turtle
torn bane
rain turtle
#

ok nice thx

torn bane
coarse pasture
#

Just discovering this and wow this is sucks.

vague magnet
desert escarp
#

In our own custom gamemode we now just have this random loading screen causing the entire gamemode to break as it never advances past this

#

What was added to cause this?

vague magnet
desert escarp
#

No

torn bane
desert escarp
#

Ah I see

#

Can I just completely disable respawn system if we do our own

vague magnet
desert escarp
#

And if I outright disable the new respawn system it barks errors in a bunch of places

kind widget
#

it will cause a couple of exceptions but at least u will your menus

desert escarp
#

I did and now I get a bunch of errors from other systems

desert escarp
#

This seems quite silly

kind widget
#

it is

#

it's ok if you are not actually using this system, just override problematic methods

#

2 problems here

  1. this happens when u set big values for transmitting range in BaseRadioComponent (probably >= 70000)
  2. typo in names
desert escarp
#

No errors

#

Only thing that I now notice is that means selecting respawn in the escape menu is completely tied to the system

#

🙂

spark otter
torn bane
desert escarp
#

That wont mess with anything just disabling the loading screen?

manic carbon
#

it's impossible, every update is breaking something

#

this is the base everon life framework, I cannot even touch it since it' s a workshop dependency

kind widget
manic carbon
#

do we know any problems with the workshop?

solid hearth
#

delete it from your drive

torn bane
storm shore
#

I normally override OnPlayerSpawned in my gameMode component, that no longer works today. What's the best alternative solution now?
I use this to show my own respawn menu logic

spark otter
desert escarp
#

Is there a better way to get all supplies in an area without having to do a sphere query and manually get all local supplies myself

desert escarp
#

Is there any reason as to why now in 1.6 the prefabs in groups don't spawn in based off of their order anymore?

#

This worked fine since 1.2.1

deep cradle
desert escarp
#

It's the Coalition Reforger Framework

coarse pasture
#

Removed linebreaks from chat?? Whhhyyyyy mjcry

versed remnant
coarse pasture
#

Yea I figured. I hoped there would be a more elegant way to patch that so that we could still use it for legitimate means

#

Any suggestions for scripts then, or is it just breaking things out into multiple messages?

versed remnant
desert escarp
#

What's the proper way to consume resource from supply tents

manic carbon
#

any way to replace the old spawn component in the new EPF?

coarse pine
desert escarp
#

None

coarse pine
#

Damn. They bork it then.

open pier
#

who was messing with the doors this update confusedcat

gentle cradle
#

SCRIPT (E): @"Scripts/Game/SimpleChatRoles.c,182": Undefined function 'SCR_RespawnSystemComponent.GetPlayerFaction'
SCRIPT (E): Can't compile "Game" script module!

Scripts/Game/SimpleChatRoles.c(182): Undefined function 'SCR_RespawnSystemComponent.GetPlayerFaction'
PROFILING : Script validation took: 1159.015500 ms

desert escarp
#
if (!entity.FindComponent(SCR_ResourceComponent))
            return true;
        
        SCR_ResourceComponent resComponent = SCR_ResourceComponent.Cast(entity.FindComponent(SCR_ResourceComponent));
        float storedResources = 0;
        
        SCR_ResourceConsumer resConsumer = SCR_ResourceSystemHelper.GetStorageConsumer(resComponent);
        if (!resConsumer)
            return true;
        storedResources = resConsumer.GetAggregatedResourceValue();

#

Currently grabbing the overall supplies in entities and for some reason this is not updating

#
for (int i = 0; i < supplyItems.Count(); i++)
        {
            IEntity supplyDepot = RplComponent.Cast(Replication.FindItem(supplyItems[i])).GetEntity();
            Print(supplyDepot);
            SCR_ResourceComponent resComponent = SCR_ResourceComponent.Cast(supplyDepot.FindComponent(SCR_ResourceComponent));
            SCR_ResourceSystemHelper.GetStorageConsumer(resComponent).RequestConsumtion(((float)supplyCounts.Get(i)));
        }
        
#

This is how I consume the supplies on the auth, and it updates in game

#

Just for some reason not with GetAggregatedResourceValue

desert escarp
desert escarp
desert escarp
#

Ended up saying fuck it and just create a replicated variable that tracks all the supply counts instead of trying to make this system work

minor agate
#

So it wont update what you wanted to check because supplies were not taken from that depot but other containers

desert escarp
#

Do supplies only work in bases like that?

#

Cause these would be free floating around the map

minor agate
#

The consumer in bases, detects its own depot and other thing in certain radius + connected services

desert escarp
#

So updating the consumer on a lone depot doesn't update it necessarily?

minor agate
#

Things should update when used. But depends on what you were targetting

#

Can you give me whole context?

#

For bases

#

You want to get consumer with id default

#

Not id stored

#

Stored is for singular depots (composition of containers as in a prefab)

#

Default is used for services

#

A base is technically a service

midnight talon
desert escarp
#

This is my current work around but the callback was how I was getting the consumer in client

minor agate
#

Is get base entity, find res component

#

Find res consumer with id default

#

Request consumption

#

Done

desert escarp
#
                for (int i = 0; i < supplyItems.Count(); i++) 
                 { 
                         IEntity supplyDepot = RplComponent.Cast(Replication.FindItem(supplyItems[i])).GetEntity(); 
                         SCR_ResourceComponent resComponent = SCR_ResourceComponent.Cast(supplyDepot.FindComponent(SCR_ResourceComponent)); 
                         SCR_ResourceSystemHelper.GetStorageConsumer(resComponent).RequestConsumtion(((float)supplyCounts.Get(i))); 
                 }
#

This is my current way of requesting consumption which results in it not updating on the client

#

However the depot still updates

river vale
#

loving 1.6, however as it usually happens, new update broke some stuff

I'm getting
"Unknown type 'SCR_SoundManagerEntity"
and

"Can't find variable 'soundManagerEntity"

on my Wirecuters mod - what whould one have to do to make it work again?

midnight talon
open pier
#

With the new persistence, will there be more documentation on how to setup server config? It seems like most links touch on certain aspects of it but don't tie it together at all. Trying to understand this a bit more but seem to have not made it far

More specifically heres the example for the config:

"persistence": {
    "autoSaveInterval": 15,
    "hiveId": 1337,
    "databases": {
        "webapi": {
            "preset": "{0123456789ABCDEF}Configs/Systems/Persistence/Database/JsonWebApi.conf",
            "options": {
                "url": "https://persistence-db.armareforger.local:5539/api/v1?query=parameter&and=more",
                "headers": {
                    "X-API-KEY": "4rm4R3f0rg3r",
                    "Content-Type": "application/json"
                }
            }
        }
    },
    "storages": {
        "session": {
            "database": "webapi"
        }
    }
}

Theres no mentions of what JsonWebApi.conf might contain or how to use it
Also the stuff with it being a webapi in general, will there be something about how to setup and use that system? Also what if using in file in general?

If I can link this to the backend I already have setup using REST, that'd be dope. I just can't seem to wrap my head around how to start configuring stuff. Also persistence just saves the bundle right now, is there anyway to make those save individual collections? If I understand the bundle correctly, this will be quite the large single file for the player's we have to migrate Just read why this is setup this way

minor agate
#

It's wrong

#

It gets consumers for Storage composition or vehicles

#

nothing related to a base's supplies, not even a regular service's

#

So you are only getting the depot spawned with the base, and using from that

#

do

resourceComponent.GetConsumer(EResourceGeneratorID.DEFAULT, EResourceType.SUPPLIES);
#

instead

desert escarp
#

I could've sworn I did that and it resulted in all the supply depots around me having 0 supply

#

Its not using bases like traditional conflict, its legit just supply prefabs placed on the map

minor agate
#

If you want those detected

#

you must use default

#

because STORED ones, only detect the depots spawned within the same prefab

#

nothing else

desert escarp
#

Okay will try again tomorrow

minor agate
# desert escarp Okay will try again tomorrow

If you are doing custom UI, and you want the value in the UI to update constantly when an interaction to the supplies happens even outside of the player then you need to get a handle to the consumer

#

You do not need to do the Component definition thing, you can just use the already done one for Supplies in PlayerController

desert escarp
midnight talon
#

this stuff

umbral spade
#

I've encountered several crashes when spawning a group of people and then deleting them. Has anyone else encountered this?
This happens without mods too.

storm shore
#

Might be a dumb question, I haven't been paying much attention though...
Is there somewhere we can see all the code changes in the recent update? I'm coming across a number of issues and kind of flying blind

torn bane
ocean kernel
umbral spade
umbral spade
open pier
ocean kernel
torn bane
main stratus
torn bane
red cedar
#

it appears that when i create a callback instance for a request :

void ConnectUser(notnull SDS_ConnectUserJson connectInfo, int playerId)
    {
        if(!m_isBackendReady)    {return;}
        
        ref SDS_ConnectUserCallBack callback = new SDS_ConnectUserCallBack();
        
        callback.SetPlayerId(playerId);
        
        connectInfo.Pack();
        
        m_context.POST(callback,ENDPOINT_CONNECT_USER, connectInfo.AsString());
    }

The (callback) instance is destroyed before i can get a response from the rest api :
-----[KE-SDS] SDS_ConnectUserCallBack instance is destroyed

Is there any other way to keep it alive other than to store it in a map and destroy it after i receive my response ?

main stratus
# torn bane You mean the new one?

I havent really tested the new one, in the other project ,where i use your spawn system etc there are few mods broken, so i do wait for now. Yesterday i spent much time reworking this rpc problem with rhs, so i only ran your persistence for the vehicles on the other server

torn bane
red cedar
#

Ok, that's good to know !

And i also have this small question, is the RegAll method new ? It is really convenient so thanks a lot for adding it :)

torn bane
red cedar
#

can we serialize and deserialize objects with it ?

Last time i used it i had to manually specify each fields and it was rather painful

red cedar
#

it can't when you're stupid enough to not know how 🤷‍♂️ (meeee)

#

but thank you i'll look into it

grave dock
#

Currently getting this when launching my server; does anyone have any ideas of where to start to figure out which mod in my list is the culprit?

Scripts/Game/GME/Editor/Containers/Backend/SCR_EditorAttributeStruct.c(4): Unknown type 'SCR_EditorAttributeStruct'

grave dock
torn bane
midnight talon
grave dock
#

Cheers lads

ocean kernel
#

Is there a way to search the script diff on github without half of the page flickering?

ocean kernel
#

Otherwise what happened to rt widgets? They are no longer projected on my mesh

solid hearth
#

There was an attribute removed from them and if its present it breaks the layout idk if that's your problem

desert escarp
#

Manually deleting Prefab: {GUID} from the meta files fixed it for me

open pier
open pier
#

Guess the main point to that was to change the autosave interval, couldnt find out how to do it in the workbench or anywhere besides that, waiting 10 minutes to test persistence saves is a bit long

tiny yew
#

Hello guys i made bulldozer, so i want to add to it an key to build a dirtpile in front of its blades, im not expert on scripts and stuff like that, any one here can guide me?

timid citrus
tiny yew
#

But how can i do it? _)

timid citrus
#

Not at my pc rn but the class or method is something like SpawnEntityPrefab

tiny yew
#

Alright bro, i apprecait ur help, can u show me if u have time, thanks for respone.❤️

open pier
#

Is there anyway to lower the time it takes persistence to save outside of the server config? I can "use" the config and get the time down, but then my peer tool breaks so can't actually test anything.

random moat
#

event void OnWeaponActive();

How do i use this event callback?

vague magnet
#

do any one know why i get that ?

#

our goat @torn bane could you help ?

torn bane
delicate crane
spark otter
storm shore
#

What's this 😱
Happens everytime I validate and reload scripts

#

Since the update

open pier
#

If I run peertool without the server.json, it loads right and I get 10 minutes persistent save intervals, with the server json it doesn't work.

fringe prairie
#

Anyone else have issues with render targets and switching layouts on them

formal marten
#

Hey so I'm gonna be running some experiments with making an accurate HMD for helicopters, has anyone had any experience trying to make something like that

fringe prairie
formal marten
#

Well I want to make a script that would allow for the base game Huey and also the RoR falcon to have a fully functional HMD similar to the IHADSS, how difficult was it to do?

#

And id rather avoid using AI where possible so I can actually learn the ins and outs of it

#

Note I'm not a member of RoR this is just a personal project

fringe prairie
#

Other method is putting stuff under the vehicle's HUD component (probably a better solution), but need to mod the vehicle HUD parent layout to make your "hmd" slot. At the end of the day the easy but not super optimized solution is just running a script which spawns the hud for the pilot and updates it. But the HUD component will handle the init/destruction for you.

formal marten
#

Okay so modifying the HUD component is the better way to do it, just more complicated?

fringe prairie
#

Probably yeah, you'd create a derivative class, etc. I mean it's not the worst thing in the world, depends on knowledge of scripting and how everything is nested

formal marten
#

Okay makes sense

fringe prairie
#

Also 1.6 broke my layouts (that's why they are bugged but half of the problem)

#

On PC, the layout fails to render which results in a white render target (this is fine), on Xbox it looks like the GPU died (within the render target)

formal marten
#

A H

fringe prairie
#

Also my layout is complaining because I have strings which say #1 ENG FAIL etc. and it's trying to localize it, guess I should do localization but I have such a backlog of things to work on I can't do it right now, how to suppress this caution?

desert escarp
#

@minor agate Did something change with the new update with RplSave writing

writer.WriteInt(m_iCompanyCallsign);
        writer.WriteInt(m_iPlatoonCallsign);
        writer.WriteInt(m_iSquadCallsign);
        writer.WriteInt(m_iCharacterCallsign);
        writer.WriteInt(m_iRoleCallsign);
        writer.WriteBool(m_bAloneInGroup);
        writer.WriteInt(m_iFactioniD);
#

This is base game code using the helpers which I thought we should not use

boreal swan
random moat
#

How do you make use of an event in a another component?

#

I'd like to use

override void OnFired(IEntity effectEntity, BaseMuzzleComponent muzzle, IEntity projectileEntity)

in SCR_MuzzleEffectComponent

kind widget
#

Also 1.6 brings a lot more stutters to tools and sometimes it even totally freezes my system, so I have to hard reboot pc

midnight talon
# random moat How do you make use of an event in a another component?

if the event calls/class exposes an event invoker you can bind your own listener to it with .Insert(MyListenerMethod), otherwise override the method to call yours with the args then return a call to the same method on super. or vanilla. so it calls your logic then continues with the default logic

mossy spade
tawny lotus
#

Is Math.Clamp broken?
A: Nope, it was a MeIssue.

gentle cradle
#

what has changed with the chat system?

#

i can get everything to work but adding color now

tough cave
#

PSA: SCR_MapCampaignUI is still in the generic MapFullscreen.conf even though it's conflict-specific.

gentle cradle
#

never mind got it fully working

vague magnet
ocean kernel
#

@umbral spade do you have some kind of repro for the AI group crash with no mod?

umbral spade
ocean kernel
#

Oki thank u

rough goblet
#

so is modifying {3B230AAC5252108F}Prefabs/MP/Modes/Conflict/GameMode_Campaign.et not a thing anymore? Since the update it's throwing errors that keeps saying after override the there are two in the world and it's not allowed. If so, this keeps us from overriding scenarios time/date/starting inventory/basic scenario defaults across all maps on a server.

ocean needle
#

whats the shortcut to add an attribute above your variable, i cant see it in the options and i keep pressing it

#

nvm found it in the plugins section at the bottom

torn bane
rough goblet
# torn bane The latter is only the issue. There are two gamemodes in the world probably. wou...

Below is what error I receive when attempting to Override GameMode_Campaign.et to modify start time and add EPF in the attempt to load the scenario save and entities in the world when server restarts. This is strictly an override not duplications of GameMode_Campaign.et. Everytime the server restarts because of an error since 1.6 update the game mode restarts without loading game save. Terminal log shows that it is saving game state but apparently 1.6 won't load the save when restarted.

DEFAULT (E): Multiple game mode entities present!
DEFAULT (E): oldEntity: @"ENTITY:0" ('SCR_GameModeCampaign') at <0.000000 0.000000 0.000000>
DEFAULT (E): newEntity: @"ENTITY:3" ('GameMode_Campaign1', SCR_GameModeCampaign) at <0.000000 0.000000 0.000000>
ENTITY : Create entity @"ENTITY:3" ('GameMode_Campaign1', SCR_GameModeCampaign) at <0.000000 0.000000 0.000000> @"{3B230AAC5252108F}Prefabs/MP/Modes/Conflict/GameMode_Campaign.et"
SCRIPT (W): 'SCR_AdditionalGameModeSettingsComponent' exists twice in the world!
SCRIPT (W): [SCR_GroupTaskManagerComponent.SCR_GroupTaskManagerComponent] instance is missing
SCRIPT (W): 'SCR_PerceivedFactionManagerComponent' exists twice in the world!
SCRIPT (W): 'SCR_PlayerListedAdminManagerComponent' Multiple instances of the 'SCR_PlayerListedAdminManagerComponent' exist in the world!

torn bane
rapid ferry
#

I noticed all of the GetPlayerIdentityId related functions are marked as obsolete in BackendApi and that BackendAuthenticatorApi is disabled on dedicated server. Is there a new method somewhere for getting unique id of individual player?

torn bane
# rapid ferry

player identity utility that all vanilla scripts link to. has peertool polyfill support. its basically a better version of a modded wrapper I introduced on early access launch. We will later wire that scripted one up to new identity provider that is in the works - which should work out of the box with peertools (using -username to assign "unique" identities). So if you want some script that will work now and in the future, use the scripted wrapper, it will probably stay for the rest of the games lifetime. Do not call backend api or player manager directly

https://enfusionengine.com/api/redirect?to=enfusion://ScriptEditor/scripts/Game/Utilities/SCR_PlayerIdentityUtils.c;7

rapid ferry
#

Sweet, thanks for quick reply. i'll check it out (SCR_PlayerIdentityUtils::GetPlayerIdentityId, for others in future)

past swallow
#

can anyone help me fix this error with zel banking please, when creating a account and purchasing a bank card this pops up and then when ignored the bank card is there and working... But it throws this error everytime you get a bankcard from the teller.

Virtual Machine Exception

Reason: NULL pointer to instance. Variable 'ProfileName'

Class: 'ZEL_BankCardEntity'
Entity id:4611686018427388361

Function: 'SetMaterialData'
Stack trace:
scripts/Game/Entities/BankCard/ZEL_BankCardEntity.c:174 Function SetMaterialData
scripts/Game/Entities/BankCard/ZEL_BankCardEntity.c:135 Function Ask_Authority_UpdateData
scripts/Game/Entities/BankCard/ZEL_BankCardEntity.c:117 Function SetAccountInfo
scripts/Game/UserActions/Teller/ZEL_Teller_CreateAccount_UserAction.c:69 Function SpawnCard
scripts/Game/UserActions/Teller/ZEL_Teller_CreateAccount_UserAction.c:41 Function PerformAction
scripts/Game/Interactions/SCR_InteractionHandlerComponent.c:235 Function DoProcessInteraction
scripts/Game/Interactions/SCR_InteractionHandlerComponent.c:763 Function OnPostFrame

river imp
random moat
#

is this kind of rpID sensible?

storm shore
random moat
fringe prairie
dire sinew
dire sinew
dire sinew
#

Especially if you just spawned the entity with a script and immediately pass its RplId to a broadcast RPC.

past swallow
random moat
# dire sinew You should share your code. It's possible that the replication of the entity isn...
    protected void SetupGuidanceOnProjectile(IEntity projectile, ChimeraCharacter shooter)
    {
        SCR_MissileGuidanceBase g = SCR_MissileGuidanceBase.Cast(projectile.FindComponent(SCR_MissileGuidanceBase));
        if (!g)
        {
            if (m_Debug)
                Print("[GuidanceSelector] Projectile has no SCR_MissileGuidanceBase, skipping");
            return;
        }

        // Set mode
        g.SetMode(m_DefaultMode);

        // Set shooter replication ID
        if (shooter)
        {
            RplId sid = RplId.Invalid();
            RplComponent rc = RplComponent.Cast(shooter.FindComponent(RplComponent));
            if (rc)
                sid = rc.Id();
            if (!sid.IsValid())
                sid = Replication.FindId(shooter);
            if (sid.IsValid())
                g.SetShooterRpl(sid);
        }

        // Select and attach guidance strategy
        GuidanceStrategy strat;

        switch (m_DefaultMode)
        {
            case SCR_EGuidanceMode.SACLOS:
            default:
            {
                strat = new StrategySACLOS();
                break;
            }
            // Add additional modes here if needed
        }

        if (strat)
            g.AttachStrategy(strat);

        if (m_Debug)
        {
            string who;
            if (shooter)
                who = shooter.ToString();
            else
                who = "<null>";

            Print(string.Format("[GuidanceSelector] Bound guidance to %1 | mode=%2 | shooter=%3", projectile, m_DefaultMode, who));
        }
    }
#
override void OnInit(IEntity missile, SCR_MissileGuidanceBase base)
    {
        m_Base = base;
        m_ShooterId = base.GetShooterId();
        m_Shooter   = ChimeraCharacter.Cast(Replication.FindItem(m_ShooterId));

        vector o, d;
        bool gotLOS = SampleLOS(o, d);
        if (gotLOS)
            m_LastCmdDir = d;
    }
#

Oh wait should it be World.Replication?

#

I have checked that the RPLID i get in the first script is the same in the second

dire sinew
#
            if (!sid.IsValid())
                sid = Replication.FindId(shooter);

Remove this part. It's pointless. Getting the ID from the RplComponent is good

#

But that means you should do the cast correctly

#

The ID is for the RplComponant and not for the character...

#

Which is why you get null here

ChimeraCharacter.Cast(Replication.FindItem(m_ShooterId));
random moat
#

Ah

#

Make sesne

#

thanks you beautiful person

dire sinew
#

And then use RplComponent::GetEntity to get the character

past swallow
# river imp It's fixed. Next time there's an update give me time to fix whatever may have go...

@river imp There is also this one when im using the zel ui for thr shop system, dont know if theres anything you can help with here too please or is it for ADM to fix?

GUI : Creating menu 'ADM_ShopMenu'
RESOURCES : GetResourceObject @"{DF4CC8BEDB0858A0}UI/Layouts/Menus/ShopMenu/ShopMain.layout"
GUI : Layout load @"{DF4CC8BEDB0858A0}UI/Layouts/Menus/ShopMenu/ShopMain.layout"
GUI : Widget prefab @"{A5D822A6CBEB8003}UI/layouts/Menus/Common/MenuBackground-NoScripts.layout"
GUI (W): Overridden prefab member 'BackgroundImageFilter' (GUID: '{604F7067D0A2A068}' type: ImageWidgetClass) no longer exists in prefab
GUI (W): Overridden prefab member (GUID: '{5CFCF5E894AE6628}' type: ImageWidgetClass) no longer exists in prefab
GUI : Widget prefab @"{BBD087BFC198428A}UI/layouts/WidgetLibrary/BaseElements/WLib_MenuBaseSimple.layout"
GUI (W): Overridden prefab member 'Overlay' (GUID: '{604F7067D0A2C729}' type: OverlayWidgetClass) no longer exists in prefab
GUI : WidgetManager: CrateWidgets @"{DF4CC8BEDB0858A0}UI/Layouts/Menus/ShopMenu/ShopMain.layout"
GUI : WidgetManager: CrateWidgets @"{7513528C6C68D18A}UI/Layouts/Menus/ShopMenu/ShopList.layout"
SCRIPT (W): EditBoxFilterComponent used on invalid widget type.
GUI : WidgetManager: CrateWidgets @"{7513528C6C68D18A}UI/Layouts/Menus/ShopMenu/ShopList.layout"
SCRIPT (W): EditBoxFilterComponent used on invalid widget type.
RESOURCES : GetResourceObject @"{8C726E31F48200A5}UI/Layouts/Menus/ShopMenu/ShopCart.layout"
GUI : Layout load @"{8C726E31F48200A5}UI/Layouts/Menus/ShopMenu/ShopCart.layout"
GUI (W): Overridden prefab member 'BarterItemContainer' (GUID: '{605C6E092B3AD1B2}' type: HorizontalLayoutWidgetClass) no longer exists in prefab
RESOURCES : GetResourceObject @"{E1119D334BD43966}Prefabs/Items/Wallet/ZEL_Wallet.et"
WORLD : Entity prefab load @"{E1119D334BD43966}Prefabs/Items/Wallet/ZEL_Wallet.et"
RESOURCES (E): Wrong GUID for resource @"{50995CC6E9526553}Assets/Wallet/ZEL_wallet.xob" in property "Object"

Cash get stuck on checkout and the market freezes

last cargo
#

would someone be willing to help me with makin a mortar mod

river imp
olive burrow
#

if (mgr)
{
    string message = "Server: " + dataShort;
    mgr.OnNewMessageGeneral(message, 0, -1);
    PrintFormat("[tech] short info - %1", dataShort);
}
    else
{
    Print("[tech] no info! Waiting...");
}

I can't figure out what ID I need to specify to send a message to the global chat as the Server, so that it looks normal, without a ":" before "Server"?
Now i'm getting " : Server: <my_data>". I need to send it in GLobal, not System chat.

timid citrus
#

I'm thinking probably not, but do we have enough access to script "instances" of areas like an instanced dungeon type of system?

river imp
#

If the "instance" is just a prefab

timid citrus
#

Hmm ok

#

ty

river imp
#

Basically how I did my "Hideouts" for an Escape game mode.

timid citrus
#

Cool I'll check it out

#

What mod is it in

#

or server

river imp
#

I unpublished it at some point apparently.

timid citrus
#

Ah

gentle cradle
river imp
#

Regardless, Create a prefab of your "instance". In my case it was a building(one of the bunkers) with the door components disabled. Then just spawn it in and teleport the player(s) inside it.

#

Not sure if you can spawn other maps as instances. I beleve that would get tricky.

olive burrow
#

or git? 🙂

gentle cradle
river imp
#
string dataShort = "You Can Do It";
SCR_ChatPanelManager mgr = SCR_ChatPanelManager.GetInstance();
if(mgr)
    mgr.OnNewMessage(string.Format("Server: %1",dataShort));
olive burrow
# river imp

As i said - not to system chat. I need Global.

river imp
#

I missed that part. Regardless, why in global? Everyone should see all the messages in system chat.

#
mgr.OnNewMessageGeneral(string.Format("Server: %1",dataShort),0,-1);
olive burrow
river imp
#

Problem being, it expects a player name

river imp
#

You have a few options.

  1. don't send system chats to the general channel.
  2. Mod the class and add your own function to it
olive burrow
#

There is not only system chat messages 🙁 There is few RP messages (in group channels) 🙁

river imp
#

add a new function to the class or override the OnNewMessageGeneral function

olive burrow
#

ok, will try it, thx 🙂

desert escarp
#

How does the player request the items in a vehicles inventory

#

I see until it is opened GetItems() populates nothing on the client

tawny lotus
#

I'm using SCR_MapMarkerManagerComponent to create a marker with InsertStaticMarker(). All good in previous version, but now in 1.6, SCR_MapMarkerWidgetComponent gives a VME with Reason: NULL pointer to instance. Variable 'm_wMarkerTimestamp'. Anyone else seeing this?

red cedar
solid hearth
tawny lotus
tawny lotus
solid hearth
#

Ah yeah found it, I had to add that text widget because I have a custom layout for markers. Good luck with the null m_wRoot issue that I didn't have worryDitto

tawny lotus
#

Uh, I introduced the m_wRoot issue myself with a typo. All good now. Thanks @solid hearth and @red cedar for help.

coral stirrup
#

the best new feature in 1.6 is the script editor crashing on every build

#

02.11 2025 21:11:10
Assertion failed

Program: N:\SteamLibrary\steamapps\common\Arma Reforger Tools\Workbench\ArmaReforgerWorkbenchSteamDiag.exe
File: D:\jenkins\workspace\continuous_branches_stable_1.6.0\ARGamecode\Enfusion\GameLib\Source\GameLib\Framework\GameApp.cpp
Line: 1283

Reason: Resources are leaking! Check log!

[zlibVersion]: ??? addr:0x7ff7f88dc4c2
[zlibVersion]: ??? addr:0x7ff7f88dc748
[nvtt::CubeSurface::toGamma]: ??? addr:0x7ff7f7dba41e
[nvtt::CubeSurface::toGamma]: ??? addr:0x7ff7f6df4fae
[nvtt::CubeSurface::toGamma]: ??? addr:0x7ff7f6e149cc
[nvtt::CubeSurface::toGamma]: ??? addr:0x7ff7f6dc4236
[QObject::qt_static_metacall]: ??? addr:0x7fffd60424c1
[QMetaObject::activate]: ??? addr:0x7fffd6044fd4
[QAction::activate]: ??? addr:0x7fffae3735b1
[QMenu::actionGeometry]: ??? addr:0x7fffc7ff3fe3
[QMenu::actionGeometry]: ??? addr:0x7fffc7ff3db1
[QMenu::mouseReleaseEvent]: ??? addr:0x7fffc7ffa432
[QWidget::event]: ??? addr:0x7fffc7e86630
[QApplicationPrivate::notify_helper]: ??? addr:0x7fffc7e434c2
[QApplication::notify]: ??? addr:0x7fffc7e41658
[QCoreApplication::notifyInternal2]: ??? addr:0x7fffd6003b8f
[QApplicationPrivate::sendMouseEvent]: ??? addr:0x7fffc7e46446
[QWidgetRepaintManager::updateStaticContentsSize]: ??? addr:0x7fffc7eac0f9
[QWidgetRepaintManager::updateStaticContentsSize]: ??? addr:0x7fffc7eaa18f
[QApplicationPrivate::notify_helper]: ??? addr:0x7fffc7e434c2
[QApplication::notify]: ??? addr:0x7fffc7e425f6
[QCoreApplication::notifyInternal2]: ??? addr:0x7fffd6003b8f
[QGuiApplicationPrivate::processMouseEvent]: ??? addr:0x7fffadff895c
[QWindowSystemInterface::sendWindowSystemEvents]: ??? addr:0x7fffae0547db
[QEventDispatcherWin32::processEvents]: ??? addr:0x7fffd61908b0
[QWindowsGuiEventDispatcher::processEvents]: ??? addr:0x7fffae308619
[QEventLoop::exec]: ??? addr:0x7fffd600a694
[QCoreApplication::exec]: ??? addr:0x7fffd6002082
[nvtt::CubeSurface::toGamma]: ??? addr:0x7ff7f6dc609c
[zlibVersion]: ??? addr:0x7ff7f947c750
[zlibVersion]: ??? addr:0x7ff7f9479aea
[BaseThreadInitThunk]: ??? addr:0x7ff8e275e8d7
[RtlUserThreadStart]: ??? addr:0x7ff8e334c53c
[RtlUserThreadStart]: ??? addr:0x7ff8e334c53c

(Press Retry to debug the application - debugger must be attached)

ocean kernel
#

Idk that sounded better in my head

wet trench
#

Hi I would like to double check something, we can not use WorldController.FindMyController() yet in arma reforger right? (The Enfusion Script API docs say "Legacy world systems do not support world controllers.")

tough cave
#

You know, most games would be able to enumerate all game controllers (even if it's still up to 4 if the devs insist) whether or not they have the same name. So, multiple vJoy devices should be detected like any other controller even if they have the same OEM / device name. However, it's not even the first vJoy device that takes precedence either. I guess I need to make a ticket to ask the devs to do something that is kind of an industry standard, and it works on all the games I know of, old and new. Just saying.

fervent cedar
tough cave
#

It's a bit much to mark GetPlayerIdentityId obsolete without pointing to the replacement function / wrapper. And, it's obviously only deprecated if the wrapper still calls the original function. Just saying. lol

wet trench
#

I just wanna celebrate real quick. I think I have my per-player-controller which my menu uses that can RPC on the server. I haven't done the implementation fully but my client seems to have the correct Replication ID to their controller. Thank you for reading my blog
🎉

sleek dove
sleek dove
ocean kernel
sleek dove
ocean kernel
#

Yeah I appreciate it

slow acorn
#

Pre 1.6 this example worked on a dedicated server. Calling RL_TestUtils.SpawnAndStartMoving() server side. Now the entity will spawn and the origin changes on the server, but the new position does not replicate/update client side. Any clue what changed in 1.6 to break this? ```class RL_TestUtils
{
static void SpawnAndStartMoving()
{
Print("SpawnAndStartMoving");
Resource prefabResource = Resource.Load("{8154532BBAD4C09C}Prefabs/MP/Campaign/Assets/CampaignRadioBox.et");
if (!prefabResource || !prefabResource.IsValid())
{
Print("prefabResource failed to load");
return;
}
EntitySpawnParams spawnParams = new EntitySpawnParams();
vector transform[4];
Math3D.MatrixIdentity4(transform);
transform[3] = "129.578 1.026 140.605";
spawnParams.Transform = transform;
spawnParams.TransformMode = ETransformMode.WORLD;

    IEntity newEntity = GetGame().SpawnEntityPrefab(prefabResource, GetGame().GetWorld(), spawnParams);
    GetGame().GetCallqueue().CallLater(RL_TestUtils.MoveUpABit, 1000, true, newEntity);
    Print("SpawnedEntity"+newEntity);
}
static void MoveUpABit(IEntity entityToMove)
{
    vector vehicleRotation = entityToMove.GetYawPitchRoll();
    vector vehicleOrigin = entityToMove.GetOrigin();
    vector vehicleForward = vehicleRotation.AnglesToVector();
    vector targetOrigin = vehicleOrigin + vehicleForward * 1.1;
    PrintFormat("Entity %1 Current Pos %2 Target Pos %3", entityToMove, entityToMove.GetOrigin(), targetOrigin);
    entityToMove.SetOrigin(targetOrigin);
    entityToMove.Update();
}        

}```

timid citrus
#

RESOURCES : GetResourceObject @"{2EB880C768FDC52F}Prefabs/MP/TestLobby.et"
WORLD : Entity prefab load @"{2EB880C768FDC52F}Prefabs/MP/TestLobby.et"
WORLD (E): Unknown class 'SCR_TestLobbyEntity' at offset 20(0x14)
ENGINE (W): Can't load prefab Prefabs/MP/TestLobby.et
RESOURCES (E): Failed to load
RESOURCES (E): Could not load the prefab '$ArmaReforger:Prefabs/MP/TestLobby.et'

Not sure how I managed to get this vanilla file error. No overrides or duplicates of it.

Any direction at all would be appreciated

ancient axle
#

so weird bug i use armst platform and they use persistence but i have a issue when somone logs out their charcter stays on the server idle then when they relog it spawns them as a totally new character is this a problem on your side?

slow acorn
ancient axle
#

ill try to d him ig just know hes probally really busy

spark otter
torn bane
slow acorn
torn bane
#

Ooof, no I see the issue in our vanilla scripts. I'll fix it. You can add a reconnect component to your gamemode and have it enabled to fix the issue in the meantiime

slow acorn
torn bane
slow acorn
#

So how is one supposed to move things after spawning?

#

Delete and spawn a new one 💀

torn bane
slow acorn
#

The CallLater has true for the repeat param so it should continue to move. The CampaignRadioBox I used in the example does have an RplComp. It is static but even with that unchecked it still doesnt move. This is simplified version of a function I had working before 1.6. After 1.6 it suddenly does not work. I can Rpc Broadcast the new position but that wasnt required before.

narrow aspen
#

do we have any smart action for AI to let them build like a player?

scarlet iris
gentle cradle
#

so it kit saving not a thing anymore?

ancient axle
#

what is causing this lmao

#

I HAVE FIXED IT

silent shard
#

Can anyone confirm that this is the correct script that I should be inheriting from if I'm making a mod that utilizes the existing logic for building with the multitool?:
SCR_CampaignBuildingBuildUserAction

I can't find one that has a more generic name, and wasn't sure if this is scoped for just the campaign.

tawny lotus
#

Is there a simple way to get a total damage value for a vehicle - helicopter in my case? I don't think helicopters have a thing like IsVehicleOperable.

ocean kernel
#

Neat, calling SetRenderView after RemoveRenderTarget instantly crashes

silent shard
tawny lotus
serene yew
scarlet iris
#

Can anyone tell me what's the correct method to detect roads? I want to spawn vehicles only on roads but no success so far

ocean needle
#

or the other methods in that class if they're more applicable

coral stirrup
#

Does anyone know why Im suddenly getting these blue debug cubes in play mode after 1.6? they show whether in GM or not

#

they do not show in edit mode, only in play mode

scarlet iris
coral stirrup
#

they are only showing on compositions that I spawn via code, and only on one, possibly the last one I spawned

desert escarp
#

Anyone else have the annoying poison pop up?

#

Its a menu I can't seem to get rid of

#

I also can no longer open the debug menu as well

#

Since 1.6

fringe prairie
#

The game is obviously warning you about poison

fringe prairie
#

Can anybody tell me about the proper set up for a world controller as an analogue to the player controller?

I've switched the majority of my data transfer to a controller which the system talks to on the serverside, and the controller then RPCs itself with the information to whatever player I am trying to specifically send that information to. I guess the question I have is:
How many instances of a world controller are there? I think I messed myself up with this RPC rodeo because if there is one on the server, and one per client, then the data I am sending is trash and I need to check who to send it to more than likely. The docs don't elaborate much on this.

My ideal flow of data is:

Server calculates and creates data via serverside system
Server sends data for each player to the controller
Controller sends data down to it's client which needs that data for storage.
Client components (items, etc.) talk to the controller to retrieve such cached data.

Is there a good explanation for the difference between public and private for controllers? Unique is explained as a single instance (makes sense).

vernal hawk
#

No clue where else to ask this, but everytime I try to load any of the maps I've made it always says "load world error." Does anyone know how to fix this?

fringe prairie
# fringe prairie Can anybody tell me about the proper set up for a world controller as an analogu...

Looking more into my issue, when the following runs:

AG0_TDLController controller = AG0_TDLController.Cast(
  GetSystems().FindController(AG0_TDLController, playerID)
);

controller is NULL
So I double checked the InitInfo and I am adding the controller there .AddController(AG0_TDLController). This runs well after a player has joined and is initialized.
The system is:
class AG0_TDLSystem : WorldSystem
I have tried both Server and Both for location.
The controller is:
AG0_TDLController : WorldController
The controller is set public.

I wonder if somehow the system is being treated as a legacy system, it is defined in the systems config. I also wonder about the differrence between ints and PlayerIds in terms of what object type they are, which could be why this is failing

fringe prairie
#

Ok, so player manager assigns ID 1 and the controller is assigning ID 0? This is a workbenchism of course but need to do testing to see if this is offsetting all playerids in MP.

fringe prairie
#

Yea I feel like I’m being cooked I need to log what the game thinks a player id is on dedicated because the player id given by the controller is 0 on workbench and looking for player 1s controller on dedicated gives me null. I’m giving up for the night.

coral stirrup
# fringe prairie Can anybody tell me about the proper set up for a world controller as an analogu...

I do something similar to this in Overthrow if that helps:

https://github.com/ArmaOverthrow/Overthrow.Arma4/blob/main/Scripts/Game/GameMode/OVT_OverthrowController.c

My Spawn Logic will create the entity and then pass ownership of the entity to the player then I use that for all RPC requests from the player

GitHub

A dynamic and persistent revolution platform for Arma Reforger (and eventually Arma 4) - ArmaOverthrow/Overthrow.Arma4

fringe prairie
#

Was advised to avoid entities and my system is a background thing that needs to push data to specific players due to the large amount of data there is/can be. An entity will still replicate that data to all players within replication distance, or all players regardless.

coral stirrup
#

I see

#

not sure why'd youd avoid entities though, it really is a barebones entity

#

the components on that entity do the work

#

it could just be a generic entity

fringe prairie
#

The mod potentially has hundreds of “devices” (components) which would store arrays of data based on their connectivity with other devices, updated constantly. Not good for network traffic, been there done that.

fringe prairie
#

A player only needs to know what they need to know, if this was a smaller project, would be an issue

coral stirrup
coral stirrup
#

or use them as a database

#

fair enough

#

kinda not very true to the ECS method of architecture though. an entity should only have the overhead of the components attached to it

#

an empty entity with zero components should do nothing but occupy memory on the server

#

but oh well

fringe prairie
#

If I wanted players to own the entities they are playing with, it could work, but such ownership can be counterproductive especially with devices potentially being placed down (but I still need to use them), so I have to develop on the basis that every device could be interconnected, and 50 connected devices each storing their own array of the other 49, and wanting to update constantly would not be good for me - so I decided to have the system prepare that info, and give only a player carrying such a connected device the single list of 50, and it gets rid of the headache of assigning and transferring ownership, etc. if an entity is “permanently” owned by the player you could argue that you can just RPC to the owner from server and back. But because I need to know what’s connected to what, spawning an entity is probably equally as difficult as making a controller. Before the recent change it was actually incredibly easy to just piggy back on the player controller and you didn’t have to set anything up at all

coral stirrup
#

no its incredibly easy to spawn an entiy and give them ownership its literally 2 lines

#

you dont need to code the entity if you dont want to, it could be a GenericEntity with some components on it

#

those components could store and replicate references to the other 49 entities

#

via RplId

#

your game mode or similar global entity could handle spawning and recieve self-registration requests then update all 50 as the devices come online and run their constructor

minor agate
fringe prairie
#

Interesting, @minor agate if you read up I’m having an issue where the first player has ID of 0 for the controller, does this mean 1 is skipped and the rest would have 2 and on?

minor agate
#

That is why FindController is bugged

fringe prairie
#

Yeah… I thought I was going crazy

minor agate
#

FindMyController works no issue

#

RplIds of them work well as well

fringe prairie
#

What would you recommend in the meantime for system that must contact specific players

minor agate
#

Is just finding by playerId that is broken

minor agate
#

Just FindControler(pId) won't work

#

You can externally store which controller belongs to which player

#

but otherwise you can just go back to PlayerController entity for now

fringe prairie
minor agate
#

It's just that RPCs were never expected to be used like this

#

somePointer.Rpc

#

You were always supposed to call it on within the class itself

#

(There is some context based shenanigans with it)

coral stirrup
#

you can put a component on the controller and still use Rpc that way, just call your component method then that does the Rpc

minor agate
#

So to avoid issues, it is now protected with an message

#

So the way to do it is to create your own public method to call it safely

fringe prairie
#

Yeah, which makes sense, should ask the server side version first.

#

I already swapped pretty much everything over, so I’ll just need to figure out how to store the controller RplIds. Tomorrow problem

wet trench
#

hmm thank you

deep cradle
#

Is there a list of deprecated functions and what they were replaced with?

timid citrus
torn bane
vernal hawk
timid citrus
#

Like to make a custom menu in the menu bar

minor agate
minor agate
#

Which are all scripted the same as you would as modder

#

Were you like, inheriting from an existing tool?

#

If so, then know that you can mod the original, override the vanilla method and mod away the private by ignoring it on the override signature

#

Method signatures are moddable that way

#

Protected itself should work on inheritance

vernal hawk
minor agate
#

protected and private are accessible in modded classes

timid citrus
#

It was a while ago I will have to get more details, but while I have your attention, the magnifying glass button does not navigate to and show the relevant file anymore like it used to in the resource browser

#

For me since 1.6

#

Well scratch that its working now idk

timid citrus
#

Is Play From Camera Position accessible anywhere in script?

minor agate
#

If you have Play From Camera already enabled, and you call this method then it will play from camera as well

timid citrus
#

Trying to make a dev spawn mode that bypasses server authority stuff

#

Obviously the reason is because play from camera mode doesn't work for me. I'm assuming because custom camera manager.

#

Ty

minor agate
timid citrus
#

for my splash screen database connecting / main menu / character creatino flow

#

I want to test that stuff on dedi with real game client, but when in editor just want to be able to get in with a player to test new mechanics

minor agate
#

You can not have mods loaded in main menu

#

and going back to main menu, then to play session resets the mods and state

timid citrus
#

i mean custom main menu

#

not reforger

minor agate
#

Any mod that we find that do such thing is not allowed

timid citrus
#

welcome screen i suppose

minor agate
#

and any exploits or bugs found to have that is going to be patched

timid citrus
#

Cool yeah not trying to do anything like that.

minor agate
#

We do not allow Main Menu to be touched for security purposes

#

Okay good

#

Just letting you know before more time is wasted if that was the case

timid citrus
#

This main menu

minor agate
#

But server main menu or so?

#

If so, then that is completely fine

timid citrus
#

Yeah mod / servermain menu

#

Opens on init when joining server

minor agate
timid citrus
#

No messing with server browser trying to put it our layouts either I assume?

#

I did toy with that before and got backend connection errors

timid citrus
#

This checkbox disabled destruction or the whole entity?

#

on Tree_Base and DestructibleTree_Base

silent shard
high hawk
#

Whats everyone doing for spoofing peer tool IdentityId's (UUID)? Would I just generate a ID if one is not found on a player connection? Or has someone got a quick little tip they wanna share pepeSmirk

gentle cradle
high hawk
#

Peer Tool clients don't have IdentityId's

#

t'was looking for a solution to tht, but ty

torn bane
high hawk
#

hah! neat, what im looking for, cheers

gentle cradle
desert escarp
#

Control+Enter automatically creates null checks now? Was this added in 1.6 or have I just been missing out

manic carbon
#

rpphone working in 1.6 finally

desert escarp
#

Is weapon dropping now hard coded in 1.6

#

I see the method that drops the weapon but it is an external we cannot override

#

and the only code exposed to us that uses it does not stop the weapon from dropping of I override it

vivid flower
#

does anyone know about a mod that saves inventory and position as u log out so u keep that when logging back in? or has the experience to make something like that. id love to see that since i need that for a server but have no clue how to make that

desert escarp
#

@minor agate

    SCR_ResourceComponent resourceComponent = SCR_ResourceComponent.FindResourceComponent(supplyDepot, false);
            if (!resourceComponent)
                continue;
                
            SCR_ResourceConsumer consumer = resourceComponent.GetConsumer(EResourceGeneratorID.DEFAULT, EResourceType.SUPPLIES);
            if (!consumer)
                continue;
                
            Print("Requesting " + supplyCounts[i] + " Supplies");
            Print(consumer.RequestConsumtion(supplyCounts[i]));
        }
#

I followed what you said and this is not consuming the resources

#

For example this is the supplies I am using

#

The truck has the action to consum them

desert escarp
#

Got it

#
SCR_ResourceComponent resourceComponent = SCR_ResourceComponent.Cast(supplyDepot.FindComponent(SCR_ResourceComponent));
            if (!resourceComponent)
                continue;
                
            SCR_ResourceConsumer consumer = resourceComponent.GetConsumer(EResourceGeneratorID.DEFAULT_STORAGE, EResourceType.SUPPLIES);
            
            if (!consumer)
                consumer = resourceComponent.GetConsumer(EResourceGeneratorID.DEFAULT, EResourceType.SUPPLIES);
            
            if (!consumer)
                return;

               consumer.RequestConsumtion(supplyCounts[i]);
fringe prairie
#

Consumtion

spark otter
tough cave
#

so, now the dedicated server tool doesn't have ENABLE_DIAG defined, only ENF_WB. was it like that before though?

minor agate
minor agate
neat wolf
#

Is there still a way to obtain the current scenarioId by script?

umbral spade
#

How do you work I can't figure out how you work with scripts. The tool crashes every fifth recompilation, and when I try to open my GUI, it crashes.

wet trench
#

Can you only have one World System in a game? I would like to add my own feature into the game but I don't want it to be the entire game mode. I would really like to use World controllers

torn bane
torn bane
wet trench
#

Hmm I see what I was doing wrong. I was making my own config instead of adding my system to the regular config. Cheers

hybrid veldt
#

so u know. dont do it

hybrid veldt
#

dont do it as an example either

manic carbon
#

I’m allowing player to put their own background

manic carbon
hybrid veldt
#

risky

manic carbon
#

It’s like in FiveM phones they put the link of an image and it’s the background

#

Is it not allowed?

hybrid veldt
#

if people use your mod to spread stuff they are not allowed, your mod might get removed as well

tough cave
hybrid veldt
#

fiveM is not really know for following rules

manic carbon
hybrid veldt
#

I would not recommend that

manic carbon
#

Ok, I’ll put standard backgrounds

#

Thanks!

manic carbon
midnight talon
torn bane
mossy spade
torn bane
#

Truth be told, a lot of things are missing from the changelog, but that is my fault, I am buried below a lot of work and simply did not dedicated any time to submitting info for it. Also that is why some modding articles are not released yet. I will catch up on this and try to pick out some highlights for next exp/stable changelog even if they may have already technicially been released 😉

thick arch
#

Hello, I was wondering what the best practice is for replicating a hashmap from the authority to all clients, I currently am doing a (kinda scuffed) method.

I am currently separating the key (playerID) and value (Data Container) into two separate arrays, replicating those arrays, then stitching them back together on each client whenever there’s an update.

This works, but I had the nagging sensation this isn’t best practice lmao. Let me know if anyone has any other solutions!

ocean kernel
#

I could tell you but mario would time me out

torn bane
timid citrus
#

Lol

#

Started converting all of our crap to world systems and world controller

polar patrol
#

Guys, can you help? After the update, this error appeared in my mod after any change in the code. It's not critical, and I can safely update the mod, but the problem is that if I load the game with only my mod, I get a white screen.

desert escarp
polar patrol
# desert escarp New error we all get, ignore it

I understand that this is a new error, but because of it, the mod doesn't work, and if I try to load the game with only my mod, there will be a white screen, but without my mod, there won't be a white screen.

desert escarp
#

Something else besides that then, sounds like a map error or something if all you see is a white screen

#

Like the custom world you are trying to open doesnt have the map it needs anymore in your mods

polar patrol
#

they really screwed up with the update

solid hearth
#

You should comb through the console log upon opening workbench with the affected mod and booting into the world. Your issue is probably buried deep in the logs. Something small like a bad attribute on some material file or config but not workbench breaking enough to stop it from running.

polar patrol
#

Alright, I'm too lazy to mess with this, I'll just re-release my mod.

timid citrus
#

Just click ignore

polar patrol
#

I hope so, because without my mod I can't play the campaign; my mod provides too much immersion.

misty escarp
thick arch
#

Best way I’ve come up with is a hashmap with a players ID as the key and a replicable data container class that stores/replicates all the information we need

misty escarp
#

it sounds overengineered to me when you can just broadcast a change to all other clients when a client induces an update on the server

#

hopefully by not sending full arrays and maps of data but only necessary incremental updates

thick arch
fringe prairie
thick arch
fringe prairie
#

It’s instantly available

#

And updates come from system

#

You could also do a system which exists on server and client if you aren’t afraid of all players having the data, but it makes it harder in the future to provide certain data to specific players

#

For example the enemy team doesn’t need to know your teams positions, or maybe you have squad markers or group data that other groups don’t need

#

You’d shoot yourself in the foot with network congestion if you go a “I have massive data” route, because say you can do delta updates over network, the initial sync still has then potential to stall replication

#

You can still do it of course, sometimes you have to, but a hybrid approach might be best

thick arch
#

Hmmm, fair, do you have any examples of the player controller route? Cause that may be the best route since I can separate information to each players faction as that’s the only real option right now

fringe prairie
#

So TDL used to work that way, but I switched to world controllers (pretty much same idea)

#

Server side system, collects and refines the data.
A class which holds the data; with proper encode decode, etc. methods so you can just send RplProp that class.
Modded SCR_PlayerController with the RplProp which uses said container class.
A method on it which the system sends the data to, which sets the RplProp, then bumps replication with Replication.BumpMe()

#

Then local methods to talk to the class and pull data as needed ReplicatedClass.GetPlayerNametag(playerId)
Which since it’s stored in the rpl prop, as long as it’s not null you can instantly get your data from other classes on the client by talking to the player controller

inland bronze
#

Is there possibly a vanilla method to get whether a entity is sitting on the terrain rather than a structure? I.E. dirt instead of a sidewalk

Or maybe even something I could reference on how to determine such?

thick arch
open pier
#

@arkensor do you have any idea why this might be happening? It happened with our ChimeraCharacter at first now with some custom shorts we have in our mod

I'm still stuck on this error with EPF

SCRIPT       : GetResourceName 'Scripts/Game/EPF_PersistenceManager.c,155'
 RESOURCES (E): Invalid ResourceName format @".et" in property "m_rPrefab"
SCRIPT    (E): Virtual Machine Exception

Reason: Invalid prefab type '{752C8D1934A4ECEE}.et' on 'EPF_ItemSaveData:6909778d-0000-0001-0001-57d0af807376' could not be spawned. Ignored.

Class:      'EPF_PersistenceManager'
Function: 'SpawnWorldEntity'

I can give the full stack trace if needed just didn't want to make more of a wall of text if it's not needed.

forest arrow
#

`[RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
static void StartSirene()
{
array<string> sirenes = {"Siren1", "Siren2", "Siren3"};

    foreach(string siren: sirenes)
    {
        IEntity sirenEntity = GetGame().GetWorld().FindEntityByName(siren);
        SoundComponent sirenComponent = SoundComponent.Cast(sirenEntity.FindComponent(SoundComponent));
        //sirenComponent.Activate(sirenEntity);
        AudioHandle sirenAudio = sirenComponent.SoundEvent("SOUND_SIREN_LP");
        sirenesAudio.Insert(sirenAudio);
    }
    
    GetGame().GetCallqueue().CallLater(StopSirene, 10 * 1000, false); // 2 minutes
}`

On workbench it works fine, on server not, why? Maybe I did something wrong with RPL? I'm calling this method from non RPL method

#

Or how to enable siren sound in GenericEntity(SirenMilitary_E_01) and disable after few seconds

torn bane
manic carbon
# torn bane Fixed in latest version of EPF

hey man, sorry to bother, as now when I get the persistence id of a baked map entity it's always the same, in the moment that I try to get it on a dinamically spawn entity (like a car bought from a store) the persistence ID get changed every time I reload the workbench (not in the file, just in game)

#

this is always the same in the file but in game I'm getting another ID

light tide
#

Hello everyone!

I’m aware this question might have been asked before, but I couldn’t find a clear answer.

Could someone please explain how to create a script or trigger for a toxic zone where wearing a gas mask prevents damage?

I saw such a system implemented in a project that has since been taken down by its author.

I apologize in advance for my English — I’m using a translator.

fringe prairie
#

OnAuthorityReady seems to only run on server for my World Controller, is this intentional? OnRplGiven doesn't seem to work, or maybe it doesn't work in the way I expect. No vanilla controller uses it, not present in 1.6 at least.

open pier
pliant ingot
minor agate
torn bane
manic carbon
#

(the one in the file I mean)

torn bane
forest arrow
manic carbon
torn bane
red cedar
#

Hello !

What would be the most optimized way to get players (or SCR_ChimeraCharacter) around a player ?

#

(ran client side so it's not like it will NUKE server fps, but still)

boreal swan
red cedar
#

yeah this look much better than getting all players and doing a distance check

#

Thank you !

minor agate
timid citrus
#

Sent you one yesterday also figure you're backlogged

tough cave
#

does anyone have some scripting to test the reconnect component? perhaps, you could prespawn an entity that is being preserved like a net disconnect, but just hand it to the first client to connect in workbench / dedicated server tool. this would let you test the reconnect dialog and what not, including restoring previous game state related to the player's entity.

torn bane
tough cave
torn bane
tough cave
# torn bane Reconnect works now since 1.6 yes, even for peertools

ty. I didn't realize that would be working perfectly. I can debug some problems I am having with faction streaming of dynamic map markers and some player-specific data store stuff. FYI, it's not 100%, you don't always get reconnected to same playerId, which is fine, you can redo it, it will probably work the second time if it missed the first by chance, but your old body is still there like a dummy AI. not sure, still looking into it. I think I will also need some code to deal with private group rejoin on reconnect. I see there is a SCR_AIGroupSerializer though.

tulip copper
#

I’m trying to add shops to my server for players to buy and sell item found in game basically redoing DayZ through reforger how can I add shops

inland bronze
tulip copper
#

What channel do I need to go to?

red cedar
tulip copper
red cedar
#

the bad news is that it's going to take you a fewmonths before you understand what you're doing.

The good news is that bohemia made a serie called bootcamp which will walk you through the basics about the workbench and enforce in general :
https://youtu.be/Fgl_mAHReP4

it is actual programming so it's going to take time.
I'd recommend you watch these bootcamps :
#1 Introduction to enfusion
#2 Modding patterns and workflow
#4 User interface and HUD
#5 and #6 on replication (THE MOST IMPORTANT in my opinion)

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

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

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

00:00 - Modding Boot Cam...

▶ Play video
red cedar
#

I'm facing some issues with the QueryEntitiesBySphere method.

For some reason only the entity highlighter in blue (my palyer) is queried while my peertool isn't (the red one)

What am i doing wrong ?
(delay in between queries is 5 seconds)

void QueryNearbyEntities()
    {
        m_nearbyPlayers.Clear();
        m_world.QueryEntitiesBySphere(
            m_currentCamera.GetOrigin(),
            m_EntityProximityQueryRadius,
            QueryEntitesFinishedCallback, 
            null,
        EQueryEntitiesFlags.DYNAMIC | EQueryEntitiesFlags.WITH_OBJECT
        );
    }
    
    protected bool QueryEntitesFinishedCallback(IEntity e)
    {
        if (!e)
            return false;
        ChimeraCharacter chimera = ChimeraCharacter.Cast(e);
        if(!chimera)
        {
            return false;
        }
        m_nearbyPlayers.Insert(chimera);
        return true;
    }
ocean kernel
#

Yo that highlight shader is cool

red cedar
#

Hello bacon !

timid citrus
#

Don't ask 😉

red cedar
#

this is so frustrating holy shit 😭

torn bane
red cedar
#

oh

red cedar
#

This is sick !

Thanks

ocean kernel
#

Hey @torn bane is this crash known?

19:36:05.838   PLATFORM  (E): Failed to create save. Maximum playthrough or save point number exceeded!
19:36:05.865   ENGINE    (E): Application crashed! Generated memory dump: /tmp/78e106df-0e74-4666-7931699c-648e36a4.dmp
torn bane