#enfusion_scripting

1 messages · Page 27 of 1

ocean kernel
#

Where does your code run?

sage meteor
#

There is a spawner entity which creates the vehicle instance which includes these functions

ocean kernel
#

Yeah so check if it's a vehicle through cast or something

sage meteor
coarse moon
#

Is there a way to trigger a weapon to fire from an action? We're developing a smoke countermeasure system (which is already set up and working), and we want it to be launched from a button in the vehicle using an action, but I haven't been able to figure out how to trigger the weapon to fire

gloomy lynx
#

so when\how does this happen with characters and vehicles

#

server is owner, controller is authority?

hollow oak
#

hey folks!

Could somebody explain me how actually AddActionListener is working, please.

I want to create a simple terminal with command line. I could handle the Inner logic behind it, but I don't understand how to add simple action on Enter button (KC_Return if i'm not mistaken).

Let's say, I want to print "Debug", when pushing Enter.
the code below doesn't work for me =(((

        GetGame().GetInputManager().AddActionListener("PcEnter", EActionTrigger.DOWN, DebugPrint);

    void DebugPrint()
    {
        Print("Debug");
    }
#

I also added PcEnter to Actions in chimeraInputCommon.conf, restarted my workbench. But nothing has happened 🙁

river imp
hollow oak
#

I added it to CharacterGeneralContext, but nothing has changed 🙁

river imp
#

If you followed everything that I mentioned before then it should work

#

If it doesn't then you've done something wrong.

hollow oak
desert escarp
#

Okay Im getting lost now

#

So I am facing the right way, AKA the parent prefab is at the right angle, but my child prefabs, the plane object is SLIGHTY off angle

#

Nothing is done differently

#

And this only happens on dedicated servers

#

It's not like it isn't getting rotation

#

It has rotated from where it's spawned

#

But it's just slightly off from the rest of the object

#

Okay

#

For some reason scaling the model up by 2 caused it to be off by exactly 15 degrees

#

But if it was 1 it was fine and lined up perfectly with the parent

pliant ingot
plucky folio
coarse moon
plucky folio
deft steppe
#

Is there a way to automatically reset the Base AI limit on server restart?

Current situation:
I host a server for Gramps Conflict PvE, I had noticed that when players log off, their model will still get saved by the game. I want their models to dissapear when they log off. So I installed a mod called 'AIPlaceholderDeleter', which seems to work.

However, when I restart the server, that mod also deletes all the US AI troops that have been spawned in using the Base AI limit by players. When it deletes these US AI troops, the Base AI limit stays at 100%, meaning that players cannot spawn any troops to guard against counter-attacks.

Does anyone know of a way to reset that limit automatically on server restart?

P.S. I don't know if this is the right channel to be asking this question, if not please redirect me to the right one! Thanks 👍

sour prawn
#

is there a way to script an AutoDoorOpener for vehicles so they spawn with the doors opened pls? ty

sour prawn
#

also is there a way to simulate shaking on a vehicle + driver camera ?

#

do i gotta use : SCR_GenericCameraShakeProgress ? i got it nvm

sour prawn
river imp
#

Looks like you're sol these days, opening vehicle doors doesn't work like it used to.

#

The requirement now is a CompartmentAccessComponent on a character

gloomy lynx
#

cars will spawn with doors open visually but the action will say closed, then you can change the actions to be correct

#

might also have to swap the character anims

#

might be somewhere in the anim graph where u can set initial state, not sure tho

ionic stream
#

anyone knows any way to do silent footsteps?

gloomy lynx
#

or turn them down\off while not wearing boots?

forest arrow
#

Hello
What component/module/whatever is required to enable building from engineer trucks?
I have action on truck, but after clicking - nothing

torn bane
sour prawn
#

Can you link me the feedback ticket pls

hushed hatch
#

howdy all.

in the process of building a RP server for AU/NZ area, created a few things for it so far, right now im working on some civ jobs, specifically deliveries, i was wondering if there was anything that would allow me to have a visual marker show on screen, not the map, for the delivery point location? if there is anything that anyone knows of, that would be helpful.

Cheers

hollow oak
#

am I right, that the only way to create new .json file is to call SaveToFile from SCR_JsonSaveContext?

#

I'm suprised there's no CreateFile method in FileIO 🙁

torn bane
winter jay
#

How to reconnect back to dedicated server tool from peer client?

torn bane
river imp
#

I would guess it's the nulls that you passed.

#

I'm replying regardless of you deleting the message. Lol

hollow oak
river imp
#

Pass nothing for no parent lol

hollow oak
#

trying to recreate unix-like filesystem

     string dirName;
    ref array<ref Dir> folders = {};
    ref array<ref File> files = {};
    ref Dir Parent;
    
    ref Dir NewDir(string dirName)
    {    
        Dir dir = new Dir();
        dir.dirName = dirName;
        dir.Parent = this; //problem was here
        return dir;    
    }

forest arrow
#

Too many instructions per function

How to find real root cause or fix? In logs classes and functions which are not used in my mode

fringe prairie
#

or an infinite loop maybe, not sure

red escarp
#

Subject: Best practices for Player Escorting/Dragging System

"Hi everyone, I'm currently developing an Escort/Dragging system for my mod. After researching and testing, I found that the most stable way to handle player synchronization and physics is by using an 'Invisible Proxy Entity' (essentially a hidden vehicle) that the victim gets moved into.

I've noticed that many existing mods (like others) use a similar approach because it seems to be the only way to bypass the engine's current limitations with player-to-player physics.

My question is: Is this still the 'Standard' way to do it? Or is there a more modern approach using the new Enfusion updates that doesn't involve proxy vehicles? I want to ensure my implementation is optimized and follows the community's best practices regarding IP and performance.

quiet glade
#

SCRIPT_MISMATCH if it only just said which mod in that message that would help so much 🙁

#

Because mosly the fix is delete mod and rejoin. But since this message is generic = DELETE ALL MODS and now you need to delete 17GB again xD

toxic lichen
#

If I focus more on logic and less on 3D modelling, will I be able to make simple procedural kinematics work without rigging bones to meshes?

shrewd nova
#

Delete smallest mods first then work up

open pier
quiet glade
#

I understand, but it would be really helpfull to put it in the message.. right.. feels like an easy win for devs? 😄

#

Well easy win for us, but easy to implement 😄

red escarp
#

Hi everyone,

I’ve been trying to find a proper way to drag or attach a player and move them to another location (specifically an escort system), but so far I haven’t found a reliable method.

The only workaround I’ve seen—used in mods like ACE Carry and Narcos Life—is placing the player into a vehicle and then moving the vehicle. I’m a bit concerned about using this approach in case it could cause issues or violate any rules.

If anyone knows a better or more proper method to achieve this, I’d really appreciate your guidance.

dire sinew
#

As far as attaching one player to another goes, vehicle compartments is probably still the only possibility. Directly attaching players to each other was broken the last time I tried.

#

I think the dragger mod takes a different approach. Probably updating the position on each frame or manipulating the physics, but it can be a bit laggy from what I've seen.

red escarp
dire sinew
#

And alternatively to building an escort system from scratch, you could use ACE Captives or mod it if you need adjustments.

red escarp
#

Oh, thanks! I need to check if it’s open-source or not.

dire sinew
#

It is, it's GPLv2, so you could even run it on monitized servers.

forest arrow
#

Hello. I have client script, user action. How to get IEntity user rank or XP without using server? only on client

river imp
#

You probably can't.

forest arrow
dire sinew
#

No, it's good. Embrace authority!

forest arrow
#

I want to restrict vehicle driver seats by rank. Any ideas how I can do that? Tried with user action, but can’t 🙁

dire sinew
forest arrow
wet trench
#

Hi I'm looking for help on a script I'm writing. I would like to make a new type of voting. I have made my class like CLINTON_BotsVoting : SCR_VotingReferendum. The idea is that normally a vote contains one int like SCR_VotingReferendum.m_iValue to store the thing that's being voted over (this int usually stores the playerID of who's being kicked or promoted to GM) However, I would like an Array of Ints and each player has the usual vote or abstain options (not like SCR_VotingElection, the array don't matter as long as the data is being stored). I have the notification working and I can get the vote to pop up on a peer's screen, and it ends which runs CLINTON_BotsVoting.OnVotingEnd(). However, my member variable which is the array of int's is set to null when I try to use it in OnVotingEnd(). I'm not sure what's going wrong. (I can paste my code into the chat, I'm just avoiding spamming large chunks of text). What I'm doing is making my own versions of the functions in SCR_VotingManagerComponent. Like I've copied CreateVotingInstance(EVotingType type, int startingPlayerID, int value) into my own function like CreateVotingInstance_Array(EVotingType type, int startingPlayerID, int value, array<int> units_in_faction). The only difference from the AR code to my code is inside CreateVotingInstance_Array I have the lines

CLINTON_BotsVoting voting = CLINTON_BotsVoting.Cast(template.Type().Spawn());
voting.InitFromTemplate(template, startingPlayerID, value, remainingDuration);
voting.SetValues(units_in_faction);
...
m_aVotingInstances.Insert(units_in_faction);

(I'm happy to paste my code into the chat if needed just avoiding spam)

#

@forest arrow did you need it to not use the server at all? It sounds like you could get the client todo a RPC to the server, server checks the players level then somehow does a RPC back to the client

granite tendon
#

I found hooks for guns in general and for grenades. what is event handler for mortars?

restive island
#

I want to know everything about a base service entity that was built, how can I traverse up the parent hierarchy of it when it's built?
Example, a vehicle depot was built: Who built it, who placed the blue print, base name it's at, the prefab name, map coordinates, time it was built, the building faction, its unique ID, etc.

torn bane
lyric inlet
#

Working on an occlusion-based rendering porthole script. Slow but steady progress! Trying to make working tank portholes that don't require camera changes or PiP.

quiet glade
#

You know what would be nice, some git diff view in the scripting files, so I can see what changed and maybe revert some thing

quiet glade
#

Oh cool, is this like a plugin or how to install this?

sage meteor
#

Presumably you can just replace those with git commands, but I haven't tried it as I just use VSCode diff atm

winter jay
#

How to check if entity inside another entity?
i want to check if player is inside rock

im using SCR_WorldTools.TraceCylinder and world.TraceMove
i think there another trick to better implement this?

protected bool IsPositionClear(IEntity entity, vector position)
{
    vector mins, maxs;
    entity.GetBounds(mins, maxs);
    float height = 4.0;
    float radius = 1.0;

    vector checkPos = position + Vector(0, height * 0.5, 0);

    // Method 1: TraceCylinder - checks player-sized collision
    if (!SCR_WorldTools.TraceCylinder(checkPos, radius, height, TraceFlags.ENTS | TraceFlags.WORLD | TraceFlags.OCEAN, GetGame().GetWorld()))
        return false;

    // Method 2: IsInsideEntity - checks if inside large entity (rock, building)
    return !IsInsideEntity(position, entity);
}

// Checks if position is inside any entity (rock, building, etc.)
protected bool IsInsideEntity(vector position, IEntity excludeEntity)
{
    BaseWorld world = GetGame().GetWorld();
    
    TraceParam param = new TraceParam();
    param.Flags = TraceFlags.ENTS | TraceFlags.WORLD;
    param.Exclude = excludeEntity;
    
    // 6 directions: +X, -X, +Y, -Y, +Z, -Z
    array<vector> directions = {
        Vector(1, 0, 0),
        Vector(-1, 0, 0),
        Vector(0, 1, 0),
        Vector(0, -1, 0),
        Vector(0, 0, 1),
        Vector(0, 0, -1)
    };
    
    int hits = 0;
    foreach (vector dir : directions)
    {
        // Trace 50m in each direction from position
        param.Start = position - dir * 50;
        param.End = position + dir * 50;
        
        float result = world.TraceMove(param, null);
        
        // If trace hits something (result < 1), increment hits
        if (result < 1)
            hits++;
    }
    
    // If 4+ traces blocked, we're inside an entity
    return hits >= 4;
}
dire sinew
#

NavmeshWorldComponent::GetReachablePoint is also an interesting method, but it can fail if there are large cliffs and navmesh islands got generated within them.

restive island
restive crown
restive island
#

How can I pull more information about placed prefabs to get everything I want about them? I think I have 4 ways to do it (2 ways for two different .et files), but dunno what to use to get info about them. I thought I'd be able to at least get the Faction with SCR_EditableEntityComponent, but it just returns Null meowhuh

modded class SCR_FuelNode : BaseFuelNode
{    
    override void OnInit(IEntity owner) 
    super.OnInit(owner);
[...]  

owner.ToString(): GenericEntity<0x0000027C9BB4C348> @"ENTITY:6917529027641082048" ('GenericEntity','Assets/Props/Military/Fuel/FuelPump_USSR_01/FuelPump_USSR_01.xob') at <1126.298584 39.051060 2729.769043> @"{EAE7EE94ECB73285}PrefabsEditable/Auto/Props/Military/Compositions/FIA/E_LFD_FuelService_FIA.et"

SCR_EditableEntityComponent.GetEditableEntity(owner): SCR_EditableEntityComponent<0x0000027D29BE5930> (Owner : @"ENTITY:6917529027641082048" ('GenericEntity','Assets/Props/Military/Fuel/FuelPump_USSR_01/FuelPump_USSR_01.xob') at <1126.298584 39.051060 2729.769043> @"{EAE7EE94ECB73285}PrefabsEditable/Auto/Props/Military/Compositions/FIA/E_LFD_FuelService_FIA.et")

SCR_EditableEntityComponent.GetEditableEntity(owner).GetFaction(): NULL    //WHAT!? Player-built fuel depot

owner.GetParent(): GenericEntity<0x0000027C9BB4C030> @"ENTITY:6917529027641082006" ('GenericEntity') at <1126.293579 39.051060 2731.563965> @"{3C9FC8943BE4E63B}PrefabsEditable/Auto/Compositions/Slotted/SlotFlatSmall/E_LFD_FuelStorage_S_FIA_01.et"

owner.GetRootParent(): GenericEntity<0x0000027C9BB4C030> @"ENTITY:6917529027641082006" ('GenericEntity') at <1126.293579 39.051060 2731.563965> @"{3C9FC8943BE4E63B}PrefabsEditable/Auto/Compositions/Slotted/SlotFlatSmall/E_LFD_FuelStorage_S_FIA_01.et"
ocean kernel
#

Can someone fill me in on the enum values for KickCauseGroup + KickCauseGroup2? Is KickCauseGroup2 essentially modded KickCauseGroup and the numbers just go up with each group?

#

Referring to this

ocean kernel
#

Lol nevermind I can just print it

#

Why do some enums start at 0 and some start at 1

minor agate
#

Then it could be preset to different values from CPP than what you would see in script code

ocean kernel
#

Magic

restive island
#

What's the point of SCR_EditableEntityComponent.GetEditableEntity(owner).GetFaction() if it isn't going to print a faction?

river imp
#

If not, then it doesn't have a faction.

restive island
#

Yup it does, these are fuel storage compositions

river imp
#

You should see what SCR_EditableEntityComponent.GetEditableEntity(owner) prints

#

I would assume that is somehow an entity without a faction affiliation component

upbeat wagon
#

Hello, i have questions about dependencies tree.
I'm currently creating a mod that overriding Arma class but WCS do it too. So i put WCS as dependencies in my mod to be sure that my mod override WCS modification and i can be compatible too with them.
In a dream world, i would like that my mod is without dependencies but how can i be sure that WCS (if used) is not overriding my class.

  • Is this order in mod dependencies have importance ? Like import (0) WCS, (1) My Mod. And i'm sure that my mod is priority
  • Should we import it in layer mod dependencies ?
river imp
#

Order is important

red cedar
river imp
#

What their actual doing and how their doing it is also important

#

Also good to note that the mod order in server config is bottom to top.

upbeat wagon
#

Okay guys thanks you very much

#

it's very clear

restive island
restive island
#

What is this behavior? It's not hitting "AAA" or "BBB" but it's in the function????

SCRIPT : *In GrabBaseName SCRIPT : IEntity ownerEntity = GenericEntity<0x0000022EEB27E868> @"ENTITY:6917529027641082103" ('GenericEntity','Assets/Props/Military/Fuel/FuelPump_USSR_01/FuelPump_USSR_01.xob') at <1133.506958 38.280960 2774.692383> @"{DCDE1C94BF386854}PrefabsEditable/Auto/Props/Military/Compositions/USSR/E_LFD_FuelService_USSR.et"

void GrabBaseName(IEntity ownerEntity) 
{
    Print("*In GrabBaseName");
    Print(ownerEntity);
    
    if (!ownerEntity)
      Print("AAA");
      return;
    
    Print("BBB");
[...]
#

what is this, I just needed an else {} and it suddenly works? 💩

pliant ingot
#

It's not python

restive island
#

I thought you could use no curlies if it's 1 line + return

red cedar
#

the return statement is out of the if statement's scope so you will return regardless here

sturdy pollen
#

why is my vehicle showing this while im trying to set it up, all the compartments and action contexts have been set up as close to the documentation as possible

restive island
restive island
restive island
#

last updated 2 years ago, probably needs to be updated here and there. If you can point out where it is wrong, @queen silo can update it

sturdy pollen
#

I have no idea how to even set it up lol thats why I was asking

restive island
#

I think you'll have more luck asking in #enfusion_model since they work on the game models there

sturdy pollen
#

Ok

restive island
#

1. How can I reliably parse this output?
SCRIPT : owner.ToString(): GenericEntity<0x00000234EC71C138> @"ENTITY:6917529027641082063" ('GenericEntity','Assets/Props/Military/Fuel/FuelPump_US_01/FuelPump_US_01.xob') at <1109.140137 38.999966 2713.393066> @"{1D09F6DDE5595017}PrefabsEditable/Auto/Props/Military/Compositions/US/E_LFD_FuelService_US.et"

**2. How can I dereference what's at memory locations like this with enfusion? **
SCRIPT : string m_LastSpawnedPrefab = 'SCR_EServicePointType<0x000001D34272B4B0>'

torn bane
restive island
torn bane
#

There is no concept of memory locations and pointers in script. there is no going back from string debug to entity reference

pliant ingot
#

Goto declaration in Script Editor or Jump to script definition in World Editor can help you

restive island
#

Someone should make a C file of pre-made, efficient queries called MakeShitWork.c

late kite
#

is it possible to get the world position/transform of a specific bone on a character using the bone name or bone ID?

pliant ingot
trim aurora
late kite
glass imp
#

hey all, been trying to create the EXILE mod from scratch, right now we are hung up on the trading systems and banking, we are using Dynamic economy, however was wondering how would we set up the shops to be organised and one trader sell guns in one menue, ammo in next, and then clothing inanother tab and then have a diffrent trader sell cars,trucks, ect. and how would be get it so we can edit the starting money from the base 1k

candid garnet
#

that is way too much for a discord conversation. break it down into smaller pieces

glass imp
deft raptor
#

Wondering if anyone is willing to help, im quite new too the enfusion tools and im just trying to create a script as a component class. I followed the wiki. I saw in a video that you have to place the script into the game directory files but I cannot create a folder in there or create a script it does nothing when I press add new script. Ive made my script in my mod folder and I validated and reloaded scripts. Any help appreciated.

[ComponentEditorProps(Category: "Killroy", description: "Hello World")]
class KLR_HelloWorldComponentClass : ScriptComponentClass
{
}

class KLR_HelloWorldComponent : ScriptComponent
{
    override void EOnInit(IEntity owner)
    {
        super.EOnInit(owner);
        Print("Hello World");
    }
}```
red cedar
#

EONInit is only to be used when you need to do something after the entity is fully initialized

zenith pilot
red cedar
#

That too

deft raptor
red cedar
#

It showed with the EOninit?

deft raptor
#

well it showed up as a component i dont think the hello world is going to work

red cedar
#

Ohhhhh

#

I read it diagonally didn't know you were having trouble finding it as a comp. So my answer was out of subject then lol

deft raptor
#

Yet, still helpful!

#

were cooking gang

#

Is using script as component class like this the best way to execute script? Or is that best for using it say on a object as a trigger or something maybe

red cedar
#

Best way to use it as a script

#

Then there are also game systems but those are a little different

deft raptor
#

Ok makes sense, what im trying to do is modify the deploymenu to be able to choose a slot instead of the player just taking the first slot when they click on squad. Im guessing Ill want to choose that script here in the spawn logic when I have it finished or would it be ok to just add it as a componentclass to the game mode?

red cedar
#

I have never toyed with that UI before so i can't really help you with that rn, but essentially there are two ways to do it, either you override the existing script to add your own logic to it or you create a whole new squad menu and replace the old one.

deft raptor
#

Ok that makes sense, so I guess my final question would be if I modify an existing script is having it in my mod directory enough for the game to just pick up the modded version?

river imp
#

You should take a look at everything related to scripting on the wiki. Knowing the keywords will be incredibly helpful. I see Kex typing. So I assume he's giving an example of using the modded keyword lol

dire sinew
#

There are two ways to modify existing scripts: modded keyword and file patching. modded behaves similar to inheritance, but your class will be the one that is used, while inheriting from the original. File patch happens when your copy has exactly the same path, which will replace the whole vanilla file by yours. Preferably, you should go for modded and make sure paths are not identical.

dire sinew
deft raptor
#

Copy that big appreciate guys. I'm gonna start breaking stuff and figuring it out haha

red cedar
deft raptor
#

For real, thanks for the help guys.

#

Oh we are cooking fellas

river imp
#

Btw, there's a "fill from temple" plugin/tool for scripting. Makes spitting out components pretty user friendly

red cedar
#

Wished i knew about it

river imp
#

They both use configs iirc

#

So if you had a script that you would be making a lot of you could add your custom component or whatever to the config

ocean kernel
#

I also write all my boilerplate from temples, or rather the thing between them

tawny lotus
#

Is there a way to ask from a prefab (.et) it's main class and if it has some component attached to it without spawning it?

For example, I want to check if {2013579FE0B109F3}Prefabs/Vehicles/Wheeled/M923A1/M923A1_engineer_MERDC_filled.et is of type Vehicle and has component BaseRadioComponent in it?

dire sinew
tawny lotus
dire sinew
tawny lotus
stable grove
#

Hello ! Anybody wants to make Arma Reforger life roleplay ?

#

I already made a working base using Typescript & Postgres

silent scarab
stable grove
desert escarp
#

Currently trying to get the .emats in the materials of the mesh object on a sight

IEntity sight = sightComp.GetOwner();
        Resource loaded = Resource.Load(sight.GetPrefabData().GetPrefabName());
        IEntitySource entitySource = SCR_BaseContainerTools.FindEntitySource(loaded);
        if (entitySource)
        {
            for(int nComponent, componentCount = entitySource.GetComponentCount(); nComponent < componentCount; nComponent++)
            {
                IEntityComponentSource componentSource = entitySource.GetComponent(nComponent);
                if(componentSource.GetClassName().ToType().IsInherited(MeshObject))
                {
                    Print("MESH");
                    BaseContainerList materials = componentSource.GetObjectArray("Materials");
                    Print(materials);
                    for (int i = 0; i < materials.Count(); i++)
                    {
                            Print(i);
                    }
                }
            }
        }

This is not working it seems

#

It prints MESH but no numbers indicating actually values found in Materials

dire sinew
desert escarp
#

Need the actual resource name

#

Reading further up I see it’s currently bugged getting the default materials from a mesh object

river imp
fringe prairie
river imp
#

I meant to link that hours ago and got distracted.

desert escarp
river imp
#

It only works when what Agent said has happened.

#

Specifically the mesh object has to have the material overwritten

desert escarp
#

Either way I was trying to edit the blend mode mid game and it seems like an engine bug when you do

desert escarp
river imp
#

Being able too get the assigned should always be a thing regardless of a new one being assigned or not

#

But it doesn't work like that for some reason

desert escarp
#

¯_(ツ)_/¯

river imp
#

How are you trying to change the blend mode?

#

By changing the value in the base container?

#

If so, that only works on the server regardless.

#

You could do mag repacking in a single player game mode using that method.

river imp
#

So you can override the base and just change the material to whatever you like

#

Thus making the children "override" the material in said material slot.

#

Then what I liked above would work..

#

Would still need to change the child materials, oof

#

You would have to override the base, and then the first child that the variants all inherit from.

#

Really lame..

desert escarp
# river imp How are you trying to change the blend mode?

Using GetOrLoadMaterial on the Material class. Then just using the SetVariable methods. They returned true so they were setting it and I could see the scope changing its color. The transparency just was not supported for on the fly changing like that.

#

Probably just an absurd edge case as what dude would want to change the blend mode mid game to make an object transparent

river imp
#

Any of those values should be changeable, just like in material refs.

#

But it seems that the update that added all the extra stuff to materials did some changes to what could be changed at runtime as well.

river imp
#

I know it works

#

So if that doesn't work for you then you're doing something wrong.

desert escarp
#

Will do, whenever I get back to smashing my head against the wall again

cobalt shadow
#

Let's say I wanted to add the weapons slots to the blocked slots section of the base loadout cloth component, how would I do that?

river imp
#

Weapons aren't clothing, they don't get "attached" the same way.

cobalt shadow
river imp
restive island
slow acorn
#

Maybe check the stuff you added to base game too?

torn bane
slow acorn
torn bane
#

The proper way would have been to reproduce the crash, report that, as a script issue should never be able to crash the whole game, just throw and VME, then let me know about the mod issue, which he did and I fixed it, and then lastly find the mod using EPF as dependency that tried to submit the malformed data. Even with the change applied it will error out elsewhere. But if he wants to use me as frustration vent he can, I just don't care lol.

slow acorn
#

Oh i see now you made the commit later but the pr says unmerged?

gilded quest
#

PR adds 2 checks -> Ark accepts one but not another -> Ark makes his own commit that adds accepted check -> PR is left unmerged 🤷‍♂️

torn bane
#

I am not merging a commit thats technically incorrect. I explained why, said I fixed the data access aspect and closed the PR because its completed. Not sure what else was expected.

slow acorn
#

I see . Not worried about it, he’s a good dog

agile bloom
#

Has anyone encountered a situation in Arma Reforger Tools where the application crashes immediately upon opening a project? The project behaved normally during development; however, if a specific script file exceeds a certain line count—sometimes triggering a crash at 2,000+ lines in some projects, or 5,000+ lines in others—the tool crashes during the reloading and compilation process.

torn bane
agile bloom
torn bane
agile bloom
torn bane
#

the best thing to do when you can reproduce it reliably is pack up the local mod, and send it over

agile bloom
torn bane
#

zip

red cedar
gloomy lynx
#

i have one thats ~3000 lines, runs fine.

red cedar
#

it's not about runtime, it's mostly that if your comps reach over 3000 lines you should most likely split it into multi single purpose/feature components.

At least that's the way I do it to keep my scripts easier to maintain

open pier
#

and im out here scared to write too many lines, keep everything as modular as possible, and reusable elsewhere if applicable

lean moth
open pier
lean moth
#

I know that all too well, even with years old stuff I’ve maintained 😂

narrow aspen
open pier
river imp
open pier
#

yee already got one going with a fair bit of stuff in it, as i look through old code though i just see the opportunity. just dont have the time to change it atm

#

lots of improvements to the backend/api recently to prepare for a much better front end, one day i'll be able to get back into mod work pepegamer24

river imp
#

Who cares what other people think of your naming conventions, if they work for you, that's all that matters..

open pier
#

the naming conventions are pretty good nowadays, its mainly when looking at the actual logic of the code. If i don't look at it for months or even up to a year or 2 then i gotta really break it apart, find some bugs that way too. Come back after learning a bunch and stuff jumps at ya. Ig thats also another huge thing is i've still be learning as i've been going on both ends, no schooling here just doing project after project

ocean kernel
#

Make sure you name your variables with single letters and mix case all the time in function and class names

#

Also use auto everywhere

torn bane
#

Stop making fun of my precious auto. It is beautiful and deserves respect.

ocean kernel
#

Can it count to 1000

pliant ingot
tawny lotus
#

Can I somehow read the array of traits with SCR_BaseContainerTools (m_aAuthoredLabels and m_aAutoLabels)? The information is in SCR_EditableVehicleComponent.

torn bane
tawny lotus
torn bane
tawny lotus
torn bane
tawny lotus
amber moat
#

Using pixel grids for importing images at runtime only solution?

tawny atlas
#

I saw some hinting at server only code coming a few months ago. Is this still something in the works? Any updates on this?

torn bane
tawny atlas
clever marlin
ocean kernel
#

How do I fix ctrl + click not working on anything

#

It just goes to top of the file

torn bane
desert escarp
#

Wait nvm Im just dumb one sec

#

Yeah that worked

#

Changing the blend mode mid game must just be busted

trim aurora
#

Did someone here have luck with setting "Flags" via a workbench script in the last few months?
I still have the problem that everything I try just resets the flags to default, when the same vanilla script works (https://feedback.bistudio.com/T195816).

clever marlin
red cedar
#

That's just a guess tho

torn bane
# clever marlin do you mind if i ask why it will never be a thing for modders but maybe a thing ...

I am talking about client vs server, not communities. Consoles won't ever support client side extensions and I don't see us adding support just for PC players as it is a risk for users and attack vector for cheat makers. Yes there are a handful of nice use-cases for Arma 3 like teamspeak plugins, but I am not sure if they will justify an exception. There are many people here strictly opposed to ANY support to it, so getting them for dedicated servers on windows and linux would already be a lengthy process. The idea already floats around for years now and that it's still not there should tell you a lot.

clever marlin
clever oxide
#

Hi! How can i give default value for typename in parameters?

torn bane
# clever marlin ok i think i understand the reasoning behind it

With a fast OOP script language and native http client included a lot of use cases can be covered already. What is left are "fun" projects we saw in A3, that are definitely cool but never saw any "real use" in any gamemode, and a few who want to integrate the game with other services. Who knows, maybe its not that much more to allow it on PC and if people want to make a PC only server so be it, but we'll walk that road when we get there.

torn bane
lean moth
restive island
fringe prairie
clever oxide
# torn bane You can assign null as default or the class name directly I believe? Or is it no...

Oh my fail, typename typeName = SCR_BP_PossibleBasePrevComponent worked fine,
but how can i use typeName for class?
not too big problem if its not possible, i have several other solutions... i only curious

void getPositionsFromPBPComponents(out array<vector> outVector, IEntity base, typename typeName = SCR_BP_PossibleBasePrevComponent)
{
    array<Managed> baseAPossibleBaseComponents = {};
    base.FindComponents(typeName, baseAPossibleBaseComponents);

    foreach(Managed managed : baseAPossibleBaseComponents)
    {
        typeName component = typeName.Cast(managed);
        if (component) outVector.Insert(component.getPosition());
    }
}

typeName in line 4 working fine
problem in line 8 "Unkown type"
how can i use typeName for classname in this case?

torn bane
# clever oxide Oh my fail, typename typeName = SCR_BP_PossibleBasePrevComponent worked fine, bu...

You can not use it like that. But what you are doing is expecting a base class of at least SCR_BP_PossibleBasePrevComponent and then some more specialized filter, but in the end you only take the position data. so i am not sure if you need this filter at all, and if so, just check the typename inheritance is at least from SCR_BP_PossibleBasePrevComponent, and then later for the outvector cast to SCR_BP_PossibleBasePrevComponent instead

trim aurora
#

@torn bane Sorry to ping you directly, but this error is driving me crazy and is breaking half of my editor scripts. Do you have any idea why calling

api.SetVariableValue(entitySource, {}, "Flags", newFlags.ToString());

might reset unchecked flags back to checked if they are enabled by default? Right now, it makes it impossible for me to turn off the RELATIVE_Y flag via script.
The value of newFlags does not matter, if the entity has RELATIVE_Y set to true by default this call will reset it to it.

torn bane
minor agate
minor agate
trim aurora
# minor agate But just to make sure, how are you calculating newFlags?

null or {} does not seem to make a difference in this instance. Both have the same outcome.

This is the relevant code:

EntityFlags lastFlags, newFlags;
lastSelectedSource.Get(DAB_Names.FLAGS, lastFlags);
entitySource.Get(DAB_Names.FLAGS, newFlags);

if(lastFlags & EntityFlags.RELATIVE_Y) {
    newFlags |= EntityFlags.RELATIVE_Y;
} else {
    newFlags &= ~EntityFlags.RELATIVE_Y;
}

//Flags
api.SetVariableValue(entitySource, null, DAB_Names.FLAGS, newFlags.ToString());

But even you even have the reset behaviour if you leave newFlags umodified. So just get and set and the flags still reset.
Same if you set newFlags to 0. Also tested it with "Flags" instead of the const DAB_Names.FLAGS

minor agate
#

<@&105621371547045888>

trim aurora
queen silo
minor agate
#

I will pass it around

trim aurora
# minor agate I will pass it around

Thank you. If this turns out to be a bug rather than an error on my side, it may be worth noting that the script (and the corresponding function call) was working normally until an update shortly before the report was created.

trim aurora
#

In a Workbench tool, is there another method to get a keypress other than checking on OnKey Events? The problem with this method is that you can only use keys that are not used in the workbench already.

jaunty hearth
#

Are there any other commands besides GetIlluminationFactor() for checking how much a unit/item/object is illuminated? It's quite strange that in this situation, my character is supposedly completely illuminated. pepeHM

red cedar
#

Or just any key pressed

trim aurora
red cedar
#

@trim aurora

amber moat
#

Dumb question, is there any simple way to make it so scripted cameras can render entities from very far away? Like buildings ai etc

red cedar
amber moat
#

yeah i guessed that, ill have to see

#

thought i was missing something

trim aurora
sour prawn
#

how can i script a button that need to be hold and then ajust value with scroll wheel ?

clever oxide
red cedar
clever oxide
#

i think they sets enable Perform per frame in Action and uses scrolling input in scripts, maybe they predefine some attach points too but i'm not sure. if workshop mod licences allows, open and check it

#

better if you ask original modder who made it

red cedar
#

i wanted the money :(

neon elbow
#

It is what it is

river imp
red cedar
#

MrBeast was giving away money

river imp
#

awww man. I love money lol

restive island
#

I take it if I want SCR_MilitaryBaseLogicComponent().GetBases() I can't be a cheap date and call it directly like in the screenshot, but I gotta assign it to an object first then call it

#

im going to petition BI make enfusion script be more like javascript

sweet badger
# restive island I take it if I want `SCR_MilitaryBaseLogicComponent().GetBases()` I can't be a c...

Class() is constructor notation. I assume you want to get the bases of an existing component on some entity?

SCR_MilitaryBaseLogicComponent comp = SCR_MilitaryBaseLogicComponent.Cast(entity.FindComponent(SCR_MilitaryBaseLogicComponent));
if (comp)
  comp.GetBases();

You do not technically need to do the variable assignment, it can be done in one line directly after Cast(), but you usually should so you have the null check.

restive island
restive island
# sweet badger Maybe show your full code?

It is messy but here it is. Maybe im not using the correct map mode in WB to grab the base names.

modded class SCR_FuelNode : BaseFuelNode
{    
    override void OnInit(IEntity owner)
    
    {
        super.OnInit(owner);    
        
        Print("----In SCR_Fuel Node: " + owner); 
        //Prints "GenericEntity<0x000002A6A9C86760> @"ENTITY:6917529027641082754 ('GenericEntity','Assets/Props/Military/Fuel/FuelPump_US_01/FuelPump_US_01.xob') at <1012.185730 37.873810 2817.788818> @{2DF0C0623E207C7E}PrefabsEditable/Auto/Props/Military/Compositions/US/E_LFD_FuelService_US_Conflict.et"
        
// TODO If I know base name is not in a array of base names, set its fuel very low.
        SetFuel(10.0); // Affects vehicles, fuel cargo, and gas stations

        // Get as much info as possible on the prefab
        Print("owner.ToString(): " + owner.ToString() + "\nowner.GetPrefabData(): " + owner.GetPrefabData());
        Print("owner.GetParent(): " + owner.GetParent() + "\nowner.GetRootParent(): " + owner.GetRootParent());
        Print("SCR_EditableEntityComponent.GetEditableEntity(owner): " + SCR_EditableEntityComponent.GetEditableEntity(owner));
        //Print("SCR_EditableEntityComponent.GetEditableEntity(owner).GetInfo(): " + SCR_EditableEntityComponent.GetEditableEntity(owner).GetInfo(owner).GetUnformattedDescription()); //Null ptr error   

        GrabBaseName(owner); // See below for func     
        
    }
}
sweet badger
restive island
# sweet badger What do you want to achieve, overall?

At each base when a service station with the first fuel service station is built, it has 100% fuel in it. Otherwise, there's 0 fuel. I already have the fuel svc station prefabs set with a fuel manager component, like fuel depot, vehicle depots, helipad.

#

so im trying to pull the base names to be used to see if a fuel svc was already built there or not

#

here's another i've been trying to get to work. I call this function with the override above.

//Get base name when svc point is built by player or placed by GM
void GrabBaseName(IEntity ownerEntity) 
{
    // Get the entity this fuel node belongs to
    if (!ownerEntity)
    {
        Print("LFD: GrabBaseName !ownerEntity");
        return;
    }
    

    // Find the SCR_ServicePointComponent on the owner entity
    SCR_ServicePointComponent servicePoint = SCR_ServicePointComponent.Cast(ownerEntity.FindComponent(SCR_ServicePointComponent));    
    if (!servicePoint)
    {
        //Print("LFD: GrabBaseName !servicePoint");
        return;
    }
    

    // Get all registered bases
    array<SCR_MilitaryBaseComponent> bases = {};
    servicePoint.GetBases(bases);
    Print(bases);
    

    if (bases.IsEmpty())
    {
        Print("LFD: GrabBaseName bases.IsEmpty()"); 
        return;
    }

    
    // Cast to SCR_CampaignMilitaryBaseComponent and get the base name
    SCR_CampaignMilitaryBaseComponent campaignBase = SCR_CampaignMilitaryBaseComponent.Cast(bases[0]);
    if (!campaignBase)
    {
        Print("LFD: GrabBaseName !campaignBase");
        return;
    }

    Print("Fuel depot is at base: " + campaignBase.GetBaseName());
}
restive island
#

maybe the map im loading isn't calling the base name bc there isn't one thonk

restive island
#

ok ok, golang or nim🧌

restive island
pearl bay
#

Hey, question.

If you are trying to change entire charachter HP to something similar to ArmA 2 DayZ mod blood system, what would it inherit?

Or would you need to make idk something new entirley?

I have a simple concept in mind but never really coded for an actual game before aPES_Laugh

minor agate
glossy gorge
#

I'm stuck on figuring out how to make prefabs properly equippable, and then how to add the custom eat/drink actions when in hand. Thanks for any help

open pier
river imp
shy plinth
#

our server keeps crashing and this is the error it keeps giving.

anyone has an idea where its coming from, or how to fix it?

Log /home/container/profile/logs/logs_2026-04-25_21-19-16/crash.log started at 2026-04-25 21:31:37 (2026-04-25 21:31:37 UTC)


25.04 2026 21:31:37
Virtual Machine Exception

Reason: Maximum number of attempts exceeded!

Class: 'SCR_TurretControllerComponent'
Function: 'RpcDo_ACE_ForceReloadWeaponWithServer'
Stack trace:
Scripts/Game/ACE_Core/Components/SCR_TurretControllerComponent.c:84 Function RpcDo_ACE_ForceReloadWeaponWithServer
Scripts/Game/game.c:866 Function OnUpdate

Runtime mode
CLI params: gproj ./addons/data/ArmaReforger.gproj config ./config.json profile ./profile backendlog nothrow disableShadersBuild rplEncodeAsLongJobs logVoting logStats 600000 maxFPS 60 freezeCheck 120 freezeCheckMode kill autoreload 30 autoshutdown addonTempDir /home/container/tmp

restive island
dire sinew
#

I added that VME myself for when the scripted reloading fails. Reforger just throws any VME into the crash log, even those way before the crash. If you don't have a stack trace to enforce script at the very end of the log (which is very often the case), you don't really have a chance to pinpoint what it is.

#

So no, this is very unlikely what caused the crash.

solid hearth
torn bane
#

I mean look at the timing. if the script issue is not on the exact same millisecond as the crash they are unrelated.

dire sinew
#

Also that you can see the VME multiple times. If it were the issue, it should have crashed the first time.

solid hearth
#

Oh we still going? well I'll smooth brain this past all of you! the last thing in the crash.log is the crash Pepe5Head

ocean kernel
#

Crash.log should be renamed to vme.log, the crash traces mean nothing there anyway

solid hearth
#

Ehh.. I've had a few that were clear as day what and where the issue was, it was so out of the norm that I thought that was a bug till ark confirmed it lol.

shy plinth
dire sinew
#

It will throw a VME pointing to that line with the message you pass.

ocean kernel
#

Are you seeing anything that says "too many instructions per function"?

forest arrow
#

Hello. Cant execute rcon command from rcon
[RCON] Process Command: #rconkick 4b4a2ac0-fb5c-4c33-99d1-ee387a6fce08
also tried rconkick, but without #, same result

By log I can see that server received command, but cant understand why it not start processing it

Rcon configured and has admin permission

log without #:
[RCON] [CLIENT: 0] Received Game Command: rconkick 4b4a2ac0-fb5c-4c33-99d1-ee387a6fce08
21:35:25.749 BACKEND : [RCON] Process Command: rconkick 4b4a2ac0-fb5c-4c33-99d1-ee387a6fce08

Like in file I have a lot of logs, no logs i can see on server after command executing + player is not kicked

sage meteor
#

Don't suppose you are using AI for this and it's just making stuff up?
Half of the functions you mention here seem like an AI trying to apply Unity game engine features to Reforger

cursive sluice
#

If I have a ScriptComponent for example that I want to be shared and accessible by scripts and code how do I get a reference to it? I want to do something similar to a global singleton, I just need one instance to keep some shared data. How can I get a reference to it?

sage meteor
river imp
#

Or depending on your use case if could be handled better in a game system

#

It really just depends

#

But there's no need to make an entity to hold a component, just to have a singleton

#

Or you can just do a non-component class that has a static ref to itself.

#

Many different ways to do it, just depends on your use case tbh

cursive sluice
#

I tried going down the SCR_BaseGameModeClass route but that was really difficult to get working and setup a brand new prefab in my World. Is it possible to just extend like the GameModeSF so I can use all of that existing content as well as the prefab? I suspect I went too far "down" and should just leverage more of what's already available.

sage meteor
cursive sluice
#

Any chance there are tutorials or examples on this that people are aware of?

sage meteor
#

I can't speak for tutorials since I haven't really looked, but I've been trying to learn how to do this by looking at how the Conflict and CombatOps modes are implemented
You can use that as an example of how to make game mode derived from the base gamemode
If you are inheriting from the scenario framework mode instead of the base gamemode it should be fairly similar, maybe simpler since a lot is already set up

cursive sluice
#

that's a good idea, thanks

river imp
#

Depending on your use case

restive island
pliant ingot
#

Looks like ai slope, don't use ai

craggy jolt
#

Yeah its ChatGPT gibberish

ocean kernel
#

AI Slope is a good expression

#

A downward slope into incompetence

late locust
#

How does NwkMovementComponent work exactly? Does it only sync movement when authority moves it? Does it always sync, like should I only have Simulation enabled when needed and disable when idle?

ocean kernel
#

I am not sure if this helps you but if I add NwkPhysicsMovementComponent my physics based authority moved entities are lerping around instead of teleporting

#

I put it in my AI planes

late locust
#

Was testing Interpolation Keyframe if that teleports it, but that just crashes the PeerTool 🙃

ocean kernel
#

So defines made in other mods working only in workbench is a bug? Or is that intentional

red cedar
#

I want to be a doctor but don't want to attend med school

#

Stop gatekeeping

stable grove
#

Hello guys, is there some people working with PeerTools ?
I don't know how to use on each instance a different uid for tests purposes ?

maiden goblet
uneven oriole
#

average vibe coders

red cedar
lean moth
restive crown
#

a carpenter could hit nails in with his hand but it speeds things up to use a hammer
he just needs to learn not to smack his hand with the hammer

halcyon oasis
#

I get why Enfusion Workbench modders are turning to Chat Jipperty. There is no structured learning tools out there, so everyone is asking chat. The Assets tutorials are set out from beginner/intermediate/advanced, but the scripting tutorials have no progression labels which can stump most people.

crude lark
#

Please tell me how to write my script correctly so that it works, and how to check if it works?

heady sphinx
#

Hi! Is it possible to separate server-side and client-side scripts?
I tried to implement something similar but got the error

RplConnection::ValidationError remote script source code checksum does not match!
#

As far as I understand, this is only possible in debug mode.
It would be convenient to have the option of not publishing the server source code.

pliant ingot
#

Or just move it to web server logic and use restapi

heady sphinx
#

Apparently the only adequate way to switch to restapi

lean moth
late locust
ocean kernel
#

Is it a vehicle entity? In that case maybe one of the vehicle nwk movement components

late locust
#

Yeah its a vehicle but the vehicle nwk move also dont seem to work

#

and they require a vehicle simulation component

red cedar
ocean kernel
#

As in wheeled but no actual drivetrain

late locust
#

That doesnt instantly crash everything?

ocean kernel
#

It doesnt when you add a dummy engine, gearbox and whatever else there was

shrewd nova
#

Or is it you thinking you know everything again?

open pier
lean moth
# shrewd nova Where did you get that metric? Link to source please
American Medical Association

AMA survey of nearly 1,200 doctors offers four key insights into how physicians use and feel about augmented intelligence (AI) in medicine.

shrewd nova
#

1200 doctors is like 2 hospitals

calm sluice
#

Can anyone give me tips how i can get ammo that is curently loaded in chamber(not in magazine) all i can think of is making some script that writes down ammo from used mag and checks if bolt is cocked on reload

lean moth
clever marlin
river imp
calm sluice
river imp
calm sluice
#

After all its much better then what i was thinking to do

river imp
slim vortex
#

hi im new to enfusion and looking to connect my players to my API for persistence how do i access IdentityID for store unique ids for players. When i call it in editor its blank im guessing because it is obsolete now? What is the best way to get/create id for players

red cedar
#

Only work server side tho

slim vortex
red cedar
#

Yw, good luck

amber moat
#

Anybody knows max pixel grid size ?

#

I know it’s a value betweeen 64 and 1024.

#

Nevermind I understand now.

#

It’s not a polygon cap it’s a lifetime issue

#

web-to-game image transfer, no more images in the mod files, all dynamic

ocean kernel
#

so you send them from server to client to display?

amber moat
#

Yes!

#

For now I chose 256 px

#

App-backend-arma server-clients

red cedar
#

Likely Inefficient but really neat

amber moat
#

this is very low res but works fine

#

its not inefficient why would it be ? its simple encoding

red cedar
amber moat
#

u can chunk stuff

red cedar
#

And i didnt mean it as a criticism

red cedar
amber moat
halcyon oasis
#

I'm learning the scripting side of things and I'm falling flat on my face. I was trying to get a players name (done) then I want to display it in a notification - like where the killfeed is. Can someone point me in the right direction?

crude lark
calm sluice
fringe prairie
# red cedar Likely Inefficient but really neat

There are quite a few optimizations that can be done. You can transmit a 512x512 image with optimizations for 20kb. Now the primary issue believe it or not is the canvas widget/draw commands. So the optimizations I’ve done into this area of research focuses on encoding as a series of rectangles, and when you control the encode/decode pipeline you can get rid of a ton of useless data basically. TLDR: the issue is not the size of images, it’s rendering them optimally in game.

fading heron
fringe prairie
#

how do I make my component not function in a preview world?

#

GetOwner().GetWorld() !== mysystem.GetWorld()

craggy jolt
#

^ return;

torn bane
craggy jolt
severe owl
red cedar
severe owl
#

yeah kick takes playerid cause the player has to be on the server

#

you can technically do a one second ban to "kick" by identity id

red cedar
#

Or script a kickbyuid

#

And have your own fancy commands

severe owl
#

#360noscopeintomordor

red cedar
#

Truthnuke

severe owl
#

actually I just remembered you can't do a 1 second identity ban xD

#

because it doen't kick the player

#

only by name or player id does

#

xD

#

I had to make an override of the ban command to have it use the playerId to kick when using identityId

red cedar
severe owl
#

yup

red cedar
#

I've never used rcon bans only playermanager bans, and using the PM a ban is a kick with the ban as the dosconnection type

severe owl
#

yeah I'll see if i can grab the code its pretty funny when I found out

red cedar
#

Would be really silly if that's still the case

#

So like would the player only be banned when he'd disconnect? Or like after a few minutes?

#

(Without your modifications)

severe owl
#

yeah once they disconnect they wouldn't be able to reconnect

#

I even tried it on my server as I didn't believe it at first

red cedar
#

I hate to be the type of guy to judge but i wonder what was the thought process behind that

#

Giving a banned player their last meal before they're gone 😭

severe owl
#

The handle section:

            // Handle Create Result
            case SCR_EBanSubcommandArg.EBSA_CREATE:
                if (m_iBanPlayerId > 0)
                    GetGame().GetPlayerManager().KickPlayer(m_iBanPlayerId, PlayerManagerKickReason.BAN);
                return ScrServerCmdResult(string.Format("Player '%1' banned!", m_sPlayerName), EServerCmdResultType.OK);

and image is the ban command

#

m_iBanPlayerId is not set when EPIT_IDENTITY is used, so when you reach the handle the PM kick is not triggered KEKW

severe owl
red cedar
severe owl
#

Yup so made a new sub ban command that just always get the ID and kicks no matter what EPIT type is used

#

and use that instead

solid hearth
#

thenking Is there a different way to get the children of an entity instance? i.e Place generic entity into world, then another one as its child. Because doing the norm fails

IEntity parent = GetGame().GetWorld().FindEntityByName("ParentEntity");
IEntity child = parent.GetChildren();
dire sinew
solid hearth
#

That'll definitely probably be it..
Edit Yep that was it, Thought I was going crazy... Thx

wise eagle
#

hi i need some help ive tried everything but i dont find my tm62asset in browse entity i put a screenshot of all my attempt if someone have an idea i take it 🙂

restive crown
#

ai should be used to augment what you already know, its always going to mess something up and you need to be able to spot it by knowing how it should be done

wise eagle
red cedar
torn bane
hollow oak
#

I'm totally confused meowsweats

hollow oak
#

😢

red cedar
#

You're likely playing it server side

hollow oak
hollow oak
#

I have a lot of things in my GameMode. But except this - everything works fine

#

damn, it's almost impossible to debug: I would have to upload mod anytime to find out was it fixed or not

red cedar
hollow oak
#

you mean?

red cedar
#

Plugins > Settings > Peertool clients

hollow oak
hollow oak
#

so in the workbench everything works just perfectly

red cedar
# hollow oak

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

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

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

▶ Play video
hollow oak
hollow oak
queen pasture
#

Is there any way to use #ifdef with class names?

dusk pollen
#

how do i check API to see what's possible? like if there a function to see if something is inside a building or actions for AI

uneven oriole
#

for now ai api is not much, you can use tracemove to check whether ai is below soemthing or above something and cast it to check if its on building or not

hollow oak
clever marlin
hollow oak
clever marlin
queen pasture
#

Is there a callExtension alternative for Reforger?

sweet badger
spark otter
# queen pasture Is there any way to use `#ifdef` with class names?

What you can do is check if something exists. For one of my mods I check if a resource from another mod exists, if true then I know that mod is loaded.

I also have 2 mods where I set a variable in one, then in the 2nd that uses the first as a dependency, I set that variable to something, and that only happens when that 2nd mod is active. For example, I set a variable called m_bIsModEnabled = false; but when that mod IS enabled, I set it to true.

Not exactly sure what you're trying to do, but I hope this helps!

fringe prairie
# spark otter What you can do is check if something exists. For one of my mods I check if a r...

Only issue is compile time that if you do something like (pseudocode):

if(ResourceName == "SomeModsResource") {
  SomeModClass entity = SomeModClass.Cast(ForSomeReason);
}

You will get compile time error.

So best practice I advocate for is for modders with scripts to #define TAG_ModName
And for others to do:

#ifdef TAG_ModName
  SomeModClass entity = SomeModClass.Cast(ForSomeReason);
#endif
spark otter
sage meteor
fringe prairie
spark otter
#

Yeah I suppose that would work only if you're modding vanilla classes.

#

really depends what youre trying to do

fringe prairie
#

Yeah, depends on what you are trying to do, but if you want a script to pull data from a mod depending on if it is loaded or not, and if that mod doesn't expose such data in a vanilla medium (signals, etc.), then a #define is the way to go, otherwise prefab overrides, signals, and generic things of that nature should suffice.

fading bane
#

Hi, I have a script that detects certain arsenal actions. On certain actions, I would like a server-wide message to be sent. Originally I did something like

    // --------------------------------------------
    // Let Everyone know!
    // --------------------------------------------
    [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
    void RPL_RequestServerMessage(string message)
    {
        if (!Replication.IsServer()) return;
        Print("[RPL] Message Sent");

        
        PlayerController pc = GetGame().GetPlayerController();
        if(!pc) 
        {
            Print("[ERROR] INVALID PLAYER CONTROLLER");
            return;
        }
        SCR_ChatComponent chatComponent = SCR_ChatComponent.Cast(pc.FindComponent(SCR_ChatComponent));
        
        if(!chatComponent)
        {
            Print("[ERROR] INVALID CHAT COMPONENT");
            return;
        }

        chatComponent.SendMessage(message, 0);
    }    

Which worked when testing in Workbench w/ PeerTool, but does not seem to be working on a dedicated server. Any thoughts or guidance?

open pier
fading bane
#

All the Arsenal actions I am tracking are wrapped in if(!Replication.IsServer()) return; So, it should all be getting called from the server-side, unless I have a fundamental misunderstanding. The tracking is working because there is also a command that shows tracking values are getting updated and players are able to use that and see it reflect the correct data.

sage meteor
# fading bane Hi, I have a script that detects certain arsenal actions. On certain actions, I...

I am still learning how replication works so someone more knowledgeable feel free to correct but I think the idea of Broadcast RplRcver is that the server triggers the broadcast RPC and the Rpl method runs on the proxies
So having the if (!Replication.IsServer()) return at the top means that your notification is never being triggered on clients? I would have thought it would not work with a peertool client if that was the case though

fading bane
open pier
fading bane
#

Is this a "make sure the server knows" kind of thing?

open pier
#

I have a script rn that even though its locked down to run on the server using if(!Replication.IsServer()) return; that updates a variable that is required to be updated by the server, i need to Rpc that call to the server still to properly update it

fading bane
#

Interesting

open pier
fading bane
#

I'll give it a go, thanks Goose

red cedar
#

Are you running this from the viewport instance?

fading bane
#

I test in workbench w/ Peer Tool, and it worked. Then we got it on a community server and the tracking works, but the messaging doesn't

#

So my thinking is most likely some Rpl/Rpc disconnect in my understanding. Or worse a mod conflict. This mod purely relies on vanilla, but the community server has quite the mod list some of which definitely impact ChatComponent, etc.

red cedar
# fading bane I test in workbench w/ Peer Tool, and it worked. Then we got it on a community s...

When you were using peertool were you using two instances of it?

That early return is definitely a cause of the issue but remember at all time that in the workbench the viewport instance act as both the server and a client, so your !Replication.IsServer() will be false on the viewport instances and from other clients it won't work.

Also remember that only the server can broadcast a message, clients can ask the server to broadcast cast it for them

fading bane
#

There is the native spin up of the instance + a secondary peer client. So two playable characters. Are you suggesting adding another? In workbench the message displays on both the in-workbench player and the peer client player

red cedar
#

When i test network code in the wb i always run two peertools, and always run the action from one peertool instance to another.

The viewport is misleading

fading bane
#

Yeah it is... Ok I will try that too! Thank you

queen pasture
pliant ingot
queen pasture
spark otter
#

First of all Im on EXP branch. Im modding a class and overriding a static function, however it refuses to use my modded class and insists on using the original unmodded class with the non-overrided function. Am I doing something wrong or is this a bug? I'm so confused, never seen this happen before.

minor agate
spark otter
# minor agate Can you show exactly what you did?

Its very strange, I'm overriding a couple different mods, some overrides work for some mods, but overrides in another mod don't. Does the order of dependencies in the project settings have an influence on whether an override is used or not? The one that does not seem to work is at the bottom of the list under ArmaReforger.

spark otter
#

I'm calling a function that I simply added a print to. The print does not display, but I know the function is getting called as it's doing what it's intended to do in game, but it's not printing the print I added.

#

I just moved the mod that wasn't using the overrides to the top of the list but it's still not using the overrides and I have no idea why. This is pretty much all I'm trying to do: ```cs
modded class CustomClassBelongingToAMod
{
override static void DoAThing()
{
Print("[DEBUG] DoAThing() Called");
super.DoAThing();
}
}

#

The Print does not print, but the thing is doing it's thing. (I can see the thing happen in game) I am also set to logLevel spam, so I would think I should be seeing everything! I am seeing all my other prints added to other mods overrides.

fringe prairie
minor agate
#

Please

#

Show exactly what you had

#

Dont modify it. Even the names

#

It sounds like either a parser bug or a mod that does not call super

fringe prairie
# fading bane All the Arsenal actions I am tracking are wrapped in `if(!Replication.IsServer()...

Replication authority is not present in a user action, a good rule of thumb is that if you have the words "Rpl" "Replication" in a user action, it is probably written wrong. The correct way to incorporate native user actions is to override "HasLocalEffectOnly" to return false on your user action, and then defer to a component on a replicated entity (which will have a RplNode) that can then talk to the server - or a system. Non server calls are automatically dropped, so logic like (pseudo code):

System Version

MyUserAction : ScriptedUserAction {
  override bool HasLocalEffectOnlyScript()
  {
    return false; //By itself, this is the default and it means that user actions when triggered, trigger on server, client, and broadcasts to other players within the area.
  }
  override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
  {
      TAG_YourServerSideSystem yourSystem = GetWorld().FindSystem(TAG_YourServerSideSystem);
      if (!yourSystem) return; //If the system is serverside only, this is one trick to have logic only trigger on server
      
      yourSystem.BroadcastMessage("Message");
  }
}

Component Version

MyUserAction : ScriptedUserAction {
  override bool HasLocalEffectOnlyScript()
  {
    return false; //Action can trigger on server.
  }
  override bool CanBroadcastScript()
  {
    return false; //Action will not trigger for other players locally whenever it is triggered, only locally and on server.
  }

  override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
  {
      TAG_YourComponent yourComponent = pOwnerEntity.FindComponent(yourComponent);
      if (!yourComponent) return; //Standard null check
      
      yourComponent.BroadcastMessage("Message");
  }
}

//Then the component handles authority like so:

TAG_YourComponent : ScriptComponent {
  RplComponent rplComp;
  void BroadcastMessage(string message) {
    rplComp = GetOwner().FindComponent(RplComponent);
    if(rplComp)
    {
      if(rplComp.Role() == RplRole.Authority)
      {
        //Broadcast message if we are the authority (server in MP, player in single player, host in listen server)
      }
      //If not authority, ignore.
    }
  }
}
spark otter
# minor agate Can you show me the classes with the methods from the other mods

sure thing, the mod I'm modding here is a dependency of my mod: ```cs
modded class KSC_ParadropHelper
{
override static void EjectPassengers(array<SCR_ChimeraCharacter> characters)
{
Print("[DEBUG] EjectPassengers() Called");
GetGame().GetCallqueue().CallLater(EjectStep, PASSENGER_EJECT_DELAY_MS, false, characters);
}
}

#

All of my other overrides modding other mods work just fine, just this particular mod is not letting me mod it for some reason.

minor agate
urban silo
#

Does anyone know how to add a new category to the building menu? Initially, it has 3 tabs, which are shown in the screenshot. When adding your trait, the tab does not appear, do you need any other actions?
Is EEditableEntityLabel only needed?

main veldt
#

Hey all, I'm a newbie to Enfusion. I managed to write a script but have been struggling to test it in a map environment. I'd love it if someone could join VC and help me figure it out. Thanks for your help

restive island
urban silo
clever oxide
clever oxide
#

or maybe

thorny ibex
#

Any proficient Enfusion scripters looking for paid work? I need some scripts added to my server and willing to pay.

red cedar
#

Only scammers and vibe c*ders will dm you

thorny ibex
#

Ok, anyone willing to teach me so I can do it myself?

spark otter
# clever oxide "override static" never works

Mario helped me get it working last night. Ended up having to move the static override to the same file where I was calling it, but above where I was calling it as well. Placing the override below where I was calling it prevents it from working. The devs are looking into how to solve that on their end. Hope that makes sense!

red cedar
# thorny ibex Ok, anyone willing to teach me so I can do it myself?

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
thorny ibex
#

There is no scripting covered in this video, already watched it

red cedar
#

Then watch the ones about scripting and replication 😭😭😭

hollow oak
#

hi folks! a quick question regarding performance improvment.

to spawn a big town i'm using chunks spawn script. It spawns a big city entities by chunks (also have to use calllater btw, because my game crashes if I'm trying to spawn all at once)
And after i'm leaving this area - I call EntityHelper.Deleteblablabla
So the question is - does it make any sense? 😆
I was thinking about - maybe long distanced entities aren't being loaded to memory and don't have any effect on performance?

leaden flint
#

Does anyone know if any events are fired off on the client when a predicted bullet hits a target? I know a particle effect gets spawned but I'm not sure how that ties into the DamageEffects as described on the bistudio wiki (if it does at all).

clever oxide
spark otter
# clever oxide yea direct file/path override works always, scripting keyword says the call over...

Doing it like this in the same script file will work and print TEST: ```cs
modded class ClassOne
{
override static void DoTheThing()
{
Print("TEST");
super.DoTheThing();
}
}

modded class ClassTwo
{
override void DoAThing()
{
ClassOne.DoTheThing();
}
}
But doing it like this will ignore the override, and will use the non modded class ClassOne: cs
modded class ClassTwo
{
override void DoAThing()
{
ClassOne.DoTheThing();
}
}

modded class ClassOne
{
override static void DoTheThing()
{
Print("TEST");
super.DoTheThing();
}
}

dusk pollen
#

can we please have the script editor lag fixed? the alt-tabbing focus delay/lag is very annoying

#

I see the issue has been on the backburner since 2025

#

I'm assuming it's either related to some indexing defect or there's an editor function like spelling, autocomplete, etc, that slows it down and these things execute when the script editor gets focused

minor agate
#

Disable auto rebuild scripts in workbench settings

minor agate
#

It was added when we added modded class introspection on the script editor

#

Unfortunately bigger problems are being solved right now so that is waiting

#

For now, just load the specific mods you need. If not possible then you have to deal with it for now

#

There is no workaround to the issue

#

Maybe when we release the visual studio code plugin

dusk pollen
#

Please fix it soon, a lot of community servers make missions and need to script where many addons need to be loaded in order to make the mission 😭

#

I know a lot of developers in my community Global Conflicts are suffering from this defect

shrewd nova
#

Yeah the script editor window lag is horrrrendous

#

Click away, click back a second later, takes 15 seconds to respond

#

It’s so bad that I just edit the script in notepad+ and restart the editor(takes less time)

#

Really became noticeable with 1.6

#

And seems to have gotten worse

#

Almost feels like it’s doing some kind of auto parse when focusing the window

#

Even with auto rebuild off

clever oxide
#

Always load minimal mods what need, i don't think you need more than 1-2mods for scripting

shrewd nova
#

I’ve even run into this same situation over and over where if I have a compile error and then fix it, recompile. It will print the same exact error again unless I restart the entire editor

#

So now I just edit with notepad and open the tools when I’m done

spark otter
#

Are you loading every mod that runs on your server? Or just the ones you need for the mod? I tried every mod I run on my servers once and that was the only time I had those lag issues, but that's to be expected with so much loaded. I think the most Ive ever had was like 6 dependencies. 2 of which I really needed, but they each had their own dependencies, bringing it up to 6 total.

minor agate
#

So yes, he is subject of that issue

spark otter
#

WOW! There's two map mods just in the A's! That really shouldn't be necessary! No wonder they're lagging!

dusk pollen
leaden flint
# leaden flint Does anyone know if any events are fired off on the client when a predicted bull...

For anyone wondering, I was looking to see if I could hijack predicted damage on the client to do an RPC on the server to effectively hack in client-side hit registration. Unfortunately from my breakpointing, it seems like there is likely code in the engine guarding the client from calling any damage functions during their prediction, and all the damage calc I was able to hit was only in rpl::Pip::ProcessNetToGame. It would be really nice in my opinion if we were given the option to get access to the client simulation state here given the sometimes extremely poor state of hitreg. I'm new to reforger modding but do professional game dev for work, so apologies if I'm misunderstanding some of the logic flow.

I did do some digging in the debug UI but all the hitreg/damage logging functions seemed to not output anything to any of the log files, so not sure if those are stubbed or I'm just looking in the wrong place.

spark otter
dusk pollen
spark otter
dusk pollen
#

The AI QRF thing is from scenario framework, in the base game, to help with AI management in the mission

spark otter
#

yeah exactly, it does not require any dependency mods, yet you're loading like 50 mods causing all that lag.

clever oxide
#

When i learned Enfusion scripting 30min scripting taked 30min testing time. Maybe wasted 30% of my 4587h WB time 😄

red cedar
#

I wonder if the vibe coding epidemic is also present on arma 3's modding side

#

Or if they were spared from the plague

crisp maple
#

Who is smart in the ways of scripting and doesn't mind helping me out? I need something short and sweet. I have like 100+ wearable variants that I want units to be able to have randomly chosen for them. But I don't want to make 300+ variants of a unit just to do that

ocean kernel
#

What about making 299 variants

crisp maple
#

sounds even worse 😭

ocean kernel
#

298

crisp maple
#

Id raw the line over 15

ocean kernel
#

ducksalute makin progress

crisp maple
#

A script would be preferable however. That way I don't spend the rest of my mid twenties making a bunch of permutations of uniforms

dire sinew
sullen oar
#

Hi! Could you tell me how to add a cooldown to a vehicle? How do I set the time? Thanks in advance!

dire sinew
#

If you don't want to modify scripts, you could make separate providers for group of vehicles you want to have different cooldowns.

sleek moat
#

is obfuscation and GetGame().RequestClose() if not using a key hash for your mod allowed? I didn't think it was

red cedar
#

But atp i'm kinda disappointed that i didn't obfuscate some of my mods ngl nodding_fish_emoji

sleek moat
#

thought so, a mod we've been using has recently decided to do this so unless you have the key it will shut the game down and you also can't read the script as it uses some block comment obfuscation 🙃 rather than just have a license stating "don't use without perm"

red cedar
#

Very kind of them

spark otter
restive island
urban silo
restive island
deep zodiac
#

Hi, I wasn't sure where to ask this but I believe scripting may be a good starting point. I was making a radio with preset channels and wanted to be able to name them based on their frequency. Similar to how the Game Master editor radios have faction labels (US, USSR, FIA) or Faction-based Group names.

I have a lede with the SCR_VONMenu and SCR_VONEntry but am unsure of what I am actually doing lol.

#

update, i have found vonentrycomponent and vonentryradio and that seems to be more applicable to what I am trying to do, still lost

deep zodiac
#

a more clear example of what I am looking for, the functionality of how 48MHz says "Platoon Channel" is exactly what I would like but with different selected frequencies

amber moat
#

Faction config

#

U can manage all that

deep zodiac
#

the only thing I can see that is related to what I am talking about is the "Faction Radio Frequency" which is not what I am looking for

deep zodiac
# amber moat Faction config

I think i found what you were talking about, or at least i assume so, with the predefined groups? it isn't what i had been wanting to do with the radio though, but it may be a temporary solution that does achieve the same goal, testing it at this moment

amber moat
deep zodiac
#

but that is only the one platoon channel for that faction, i am wanting to be able to name multiple channels/frequencies and not just the one

amber moat
#

Ok got u, can u see if there is an add option anywhere? Maybe where u pick platoon channel?

deep zodiac
#

i have scoured(?) what i was able to see and couldn't find anything except some scripts that may allow me to do what i am wanting to do but am just unfamiliar with scripting currently

amber moat
#

Yeah honestly the way I set groups and radio freqs is via script

#

But I’m positive there is a easier way maybe in the vanilla config files

deep zodiac
#

i mean i don't think the script should be super complex, just giving a title/channel name if frequency is equal to whatever integer

#

but i have been looking though literally everything lol

amber moat
#

Yeah u need to look at how to properly set it up. Check the vanilla script files and you’ll find clues for sure

deep zodiac
#

my predefined groups don't seem to work and i have no idea why

sage meteor
#

I have also had issues with the predefined groups I couldn't work out

deep zodiac
#

i cannot even see the groups i have predefined in the faction's group selection in-game

sage meteor
deep zodiac
#

no, but am i supposed to make the predefined groups in the factionmanager_editor? i don't know what it does verus the faction_us.conf

sage meteor
deep zodiac
#

it's just a normal game master scenario

sage meteor
#

Are you overriding the _Editor faction manager

deep zodiac
#

i am now

#

okay i figured it out, it was the factionmanger i needed to do it in

#

no idea what the US.conf file does/is for in the faction folder but /shrug, this is only a temporary thing lol

sage meteor
deep zodiac
#

now i get to find out how to change the callsign for those predefined groups lol

sage meteor
#

Anyone know the difference between SCR_AICharacterSetting and SCR_AIGroupSetting? I am trying to set custom settings on waypoints via script
When I use SCR_AICharacterStanceSetting.Create(SCR_EAISettingOrigin.WAYPOINT, SCR_EAIBehaviorCause.ALWAYS, ECharacterStance.CROUCH)) even with the cause set to ALWAYS it seems to have no effect
If I instead use SCR_AIGroupCharactersMovementSpeedSetting.Create(SCR_EAISettingOrigin.WAYPOINT, EMovementType.WALK)) it works fine

Something to do with SCR_EAIBehaviorCause maybe?

// WP creation code
vector wpPos = TTS_AISpawnHelper.GetRandomSpawnPositionInRadius(50, 200, spawnPosition);
array<ref SCR_AISettingBase> settings = {SCR_AISettingBase.Cast(SCR_AIGroupCharactersMovementSpeedSetting.Create(SCR_EAISettingOrigin.WAYPOINT, EMovementType.WALK))};
SCR_AIWaypoint wp = TTS_AIWaypointHelper.CreateMoveWaypoint(wpPos, settings);
group.AddWaypoint(AIWaypoint.Cast(wp));
    // TTS_AIWaypointHelper.c
    static SCR_AIWaypoint CreateMoveWaypoint(vector position, array<ref SCR_AISettingBase> settings = null)
    {
        ResourceName waypointResourceName = GetWaypointPrefab(TTS_EAIWaypointHelperWaypointType.MOVE);
        return CreateWaypoint(waypointResourceName, position, settings);
    }

    static SCR_AIWaypoint CreateWaypoint(ResourceName waypointResourceName, vector position, array<ref SCR_AISettingBase> settings = null)
    {
        Resource waypointResource = Resource.Load(waypointResourceName);
        if (!waypointResource.IsValid())
        {
            PrintFormat("TTS_AIWaypointHelper.CreateWaypoint: Failed to create waypoint, waypoint resource is invalid! (%1)", waypointResourceName, level: LogLevel.ERROR);
            return null;
        }

        EntitySpawnParams waypointSpawnParams = new EntitySpawnParams();
        waypointSpawnParams.TransformMode = ETransformMode.WORLD;
        waypointSpawnParams.Transform[3] = position;

        SCR_AIWaypoint waypoint = SCR_AIWaypoint.Cast(GetGame().SpawnEntityPrefab(waypointResource, GetGame().GetWorld(), waypointSpawnParams));
        if (!waypoint)
        {
            PrintFormat("TTS_AIWaypointHelper.CreateWaypoint: Failed to spawn waypoint prefab! (%1)", waypointResourceName, level: LogLevel.ERROR);
            return null;
        }

        if (settings)
        {
            foreach (SCR_AISettingBase setting : settings)
            {
                waypoint.AddSetting(setting);
            }
        }

        return waypoint;
    }
serene fox
#

Hey, who is allowed to spawn RocketProjectiles?? Even when im spawning the prefab on Master/Auth i got warnings, that this is not allowed, because its Replicated?

clever oxide
serene fox
#

Whats different between heloRocket and RPG Rocket?

clever oxide
#

Ammo_Rocket_Hydra70_HE_M229.et works fine

#

script will give vme if no RPL comp on rocket

clever oxide
#

I have a replication question:
When RplSave called if Entity or my GameMode's RplComponent setting on Streamable disabled?
i not seen manual call for RplSave.
I use RplProp() and BumpMe() now. Keep it and need forget RplSave?

minor agate
#

It depends on what you are doing

clever oxide
ocean kernel
#

Its ok, I only want to update people living in the same bubble as me anyway

clever oxide
#

i see 70 RplProp in whole AR scripts, i have mod with 32 RplProp, maybe mot need keep update all on every BumpMe().

red cedar
# minor agate It depends on what you are doing

Is there a way to get the value of a client sided variable without Rpc calls ?

Like for example let's say I have a script that set a string variable for the current context the player is in and from the server i want to fetch it. How would i go about doing that without rpc calls if possible ?

minor agate
#

If it's not mutable then only do RplSave and RplLoad

minor agate
#

Because your entities will be replicated and active on all clients all the time

clever oxide
# minor agate If it's not mutable then only do RplSave and RplLoad

I plant use this way, main question is RPL save when runs? If variable in Gamemode and RPLcomponent streaming disabled how rplsave called?
Multiplayer scripting page says in example:
"// Called on the authority when an entity gets streamed"
I calculated 6 random variables by server in OnGameStart() event. is it runs after "gets streamed"? Or there is a point what is runs before streaming but world is ready?

#

OnGameStart() random variables different on client and server, this is what i need sync, but maybe not in RPLProp.

#

i'm going reread RplDocs.c file :]

dry olive
#

Trying to figure out how to get garage2 by kodii working, or something similar. I think it relies on components like
AH_Currency component, JOB_jobcomponent, JOB_impound manager, and a few other components. Does anyone have any experience with this? My guess is it needs kodiis RP to actually function

dry olive
#

Yeah so to reiterate with my question, even with those dependencies I am still having errors within workbench missing those specific components

sage meteor
# sage meteor Anyone know the difference between `SCR_AICharacterSetting` and `SCR_AIGroupSet...

Not sure what I was doing wrong yesterday but had no issues with this today, must have been user error lmao
But if anyone was curious about this like me you can still use bothSCR_AICharacterSetting and SCR_AIGroupSetting in the group/waypoint settings, but when it is a CharacterSetting the group will automatically apply the setting to each group members SCR_AICharacterSettingsComponent instead of the group's SCR_AIGroupSettingsComponent

gusty onyx
#

Hi all,
I am implementing my own PvP GameMode, and I would like to access to the groups I placed in the subscene.

It looks like SCR_AIGroup.RplLoad registers the group into groupsManagerComponent with SCR_GroupsManagerComponent.RegisterGroup at runtime.
But I fail to find the groups when mission starts, can you tell me when the RplLoad is executed?

torn bane
gusty onyx
torn bane
#

The groups manager is primarily intended for player groups and not AI placed on the map. But yes, it is too early. If at all, attempt to find them during gamemode start

gusty onyx
#

I just want to place on map for players only, detect all the slots them and create a lobby. Thanks for your help 🙂

restive island
dry olive
craggy jolt
#

Custom titles for class attributes aren't possible at all, right?

#

Hate that you can't see the value for UIWidgets.Flags attribute unless you unfold it

craggy jolt
#

What I mean, displaying selected flags when attribute is folded (using random enum for test her)

restive island
restive island
#

Is this the best way to manage arrays of two different types? The data should persist for both but only one changes size.

class MyArrays {
        vector <string> dynamic_names;
        ref array <string> static_names;
};
clever oxide
#

ref array<string> is dimamic, you can use static arrays too if not need increase size

#

string str[4]; it is static

restive island
#

ref array<string> is dyanmic but array <string2> is not dynamic? I thought vector <string> was dynamic

clever oxide
#

vector is dinamic array in C++

restive island
#

is ref just a special enfusion script feature?

restive island
clever oxide
#

ref is keep things alive

restive island
#

oh i see what you mean, enf vector is junk for my use case lmao

torn bane
dire sinew
#

The length isn't the really BS though, as proper mathematical vectors can have any length, but they don't support mathematical vector operations, so that is that 😅

clever oxide
clever oxide
#

How did C# come about? they only renamed struct to public class 😛

red cedar
#

Stupid question to ask so late into scripting but :

does a double == comparison already take into consideration a certain epsilon or not?

sterile stump
#

Im a amauteur in enfusion, I am currently having issues spawning enemies on structures in the ocean. Does anyone have a method to spawn enemies in a exact position? Because the ambient spawners will ignore collision and spawn enemies at the bottom of the ocean.

restive island
red cedar
torn bane
red cedar
#

meant to say float* just finished some java bullshit i have double in mind sorry

#

Thank you

sterile stump
red cedar
#

I noticed that equipping an item such as binos make them reset the flag invisible. any easy workaround to that ?

spark otter
red cedar
#

is there a way to check if an entity is already invisible ?

#

i hide the entity using :
entity.ClearFlags(EntityFlags.VISIBLE, false);

spark otter
#

I would search SCR_Enum.HasFlag

red cedar
zenith lily
#

anyone know a good approach to create a anti combat log script? i.e so the character stays on the server for a period of time after the user disconnects

winter jay
#

its possible to control reforger server fps through script?
(-maxFPS commandline?)

red cedar
winter jay
amber moat
winter jay
#

yea,
but i need it by using scripts set server maximum fps value, then change it back
-maxFPS i don't find how to implement it in script

amber moat
trim aurora
#

Did anyone here get GetWaterSurfaceY() or TryGetWaterSurface() to work with rivers or lakes?
I am trying to test if an object in the workbench is in a body of water or not. It works with the ocean, but lakes or rivers do not work.

trim aurora
dire sinew
#

It's been a while, but when I did work on this method, I tested it in the workbench. Maybe something has changed.

#

I think I tested Heifer pond on Arland.

dire sinew
trim aurora
dire sinew
#

Oh wait, I get your point. You're trying to do it in the world editor, not in the play mode 😅

trim aurora
desert escarp
#

Anyone know of a way to grab the magazine prefab you are currently loading?

red cedar
#

In a codec how do we go about encoding a map ?

#

for example :
ref map<int, int> m_playerBalance; (example)

torn bane
red cedar
# torn bane First count of items then key value n times. There is no util to do this for you

ok so i tried to make a basic codec which contains this map for example :


    ref map<ECharacterHitZoneGroup, int> m_bodypartsHit;

    static void Encode(SSnapSerializerBase snapshot, ScriptCtx ctx, ScriptBitSerializer packet)
    {
        // irrelevant stuff
        snapshot.EncodeString(packet);
        snapshot.EncodeString(packet);
        
        snapshot.EncodeInt(packet);
        snapshot.EncodeInt(packet);
        snapshot.EncodeInt(packet);
        
        // MAP encoding
        snapshot.EncodeInt(packet); // m_bodypartsHit.Count() ??
        // Can't access non-static member
        foreach(ECharacterHitZoneGroup key, int value : m_bodypartsHit)
        {
        } 
        
    }

But since the method is static i find it very confusing to know for example how many times i need to encode it.

#

in this particular case i know there is at most 7 key, val pairs.

But still it is a confusing for me to understand how to encode those as i can't access the member

sterile stump
#

Has anyone tested building playable areas under the map? I want to make a large underground complex under arland for my custom server scenario and am wondering if I may encounter issues doing this

sterile stump
#

oops

#

thanks

red cedar
#

As expected i failed LOL :

Server-side :

  SCRIPT       : -----[KittenEye] Broadcasting stuff
  SCRIPT       : -----[KittenEye] Stats for HideoutKitty (0)
  SCRIPT       : -----[KittenEye] Head : 6
  SCRIPT       : -----[KittenEye] Lower torso : 7

Client-side :

00:02:14.334   SCRIPT       : -----[KittenEye] Stats for HideoutKitty (0)
00:02:14.334   SCRIPT       : -----[KittenEye] Head : 0
00:02:14.334   SCRIPT       : -----[KittenEye] Lower torso : 0
#

i'll crash out

winter jay
#

there is bug sometimes when you cannot reload weapon, and you can't drop this gun, basically whole weapon slot is bugged.
Is there any method how to fix it?
Animation State?

storm bobcat
#

I am trying to debug some code. Using the remote console, it will only let me print variables from my own classes but not any of the base game classes.

#

Also, I am trying to enable custom loadouts on command trucks. All I do is remove a check for custom loadouts in SCR_CampaignSupplyRestrictedSpawnPoint.CanReserveFor_S(...).
But it still won't let me spawn with a custom loadout.

#

Can anyone offer some help either of these two issues?

fringe prairie
#

If there is logic in encode/decode (other than encoding/decoding values) generally something is wrong though

#

I'd just recommend doing arrays and constructing maps with the decoded array

minor agate
#

Or you can go into the watch tab while the breakpoint is hit and in debug mode

#

then you can see the entire instance data accessible to scripts

#

You can also mod the class and add your print if the class is moddable

minor agate
# storm bobcat I am trying to debug some code. Using the remote console, it will only let me pr...

Also. As apparently not everyone knows this of the script debugger, breakpoints and the remote console.

If you hit a breakpoint, on any class. After the process freezes with a breakpoint hit, given that the script vm is single threaded, it will safely internally have a cached variable for this that is used for many things, one of those is the remote console. So when you are on a breakpoint, this will be then the same instance where you have your breakpoint on. Meaning that you can use it in the remote console to call other methods from the class, or call and print variables from it, or change it's data. Or pass it somewhere else. Test results of methods on the remote console, etc.

#

You can use it to modify behavior of method in a sense, before doing any modding of it

#

Or changing the state before method processes after certain point at runtime

#

You can call/use anything from the method, local vars and also private/protected members (Method and varibles) of the class. And anything outside

storm bobcat
storm bobcat
minor agate
#

THen no

#

It has to be in the specific context the breakpoint is on

#

Sorry not the breakpoint

#

but the state of the debug

#

It will change based on where these lead you to

#

You can also technically change what this points to. But beware that it is locked to the current variable type it originally had, meaning it will accept only original class type or inherited

this = someOtherInstance;
solid hearth
#

eeeh Is there a particular reason why QueryEntitiesByOBB is not correctly using the angles of a transform on a modded map? It works as aspected on a normal map like Arland but doing the same thing on a modded map and it just completely ignores the angles info..

minor agate
solid hearth
#

that'll really do it in? Yikes.

minor agate
#

And it might not have on itself identity matrix for the basis vectors

minor agate
#

people often avoid in games to have transform on world

#

As you can avoid an extra transform for everything else 3d math related when you need to account for world

#

It simplifies the math, and unfortunately most people also never take into account that world itself might have a transform

#

So even then it's safer somehow to not have it pepegakekW

solid hearth
#

hmm So am I just screwed with this approach?

minor agate
#

You could update the entities you have positions if not dynamic on the grid by offsetting it by the world transform

storm bobcat
#

A question I dont expect an answer to: Why did bohemia hard code No Custom Loadouts in conflict rather than giving us a game mode setting/toggle?

#

I found my issue

#

Thanks for pointing out the watch context!

#

It really helped!

minor agate
#

Modding on Arma 4 is thought of from Design to the end of the dev process with modding in mind. So ideally this should be better on features later on. But we have architecture there that makes such changes easy later on

#

In general you can't think of everything for modding, but you can accomodate for it

storm bobcat
#

Of course. It was probably a patch for a balance change in the vanilla conflict. And its easy (when you know where to look) to change it for modded.
I aint really comlpaining. I just got over a frustrating and now satisfying debug session 🙃 😁

minor agate
#

Many of the mistakes for modding on AR are know, same for older games. And are being taken into account on the current engine and the future of our games

#

It might seem that AR in some places is a rocky road for modding, but it's the experience and experiment before you can better it

#

It's actually invaluable for us to get feedback on the problems faced

#

Always mention the struggles and things that seem bad modding wise

storm bobcat
#

Try/Catch?

minor agate
#

Otherwise we might never figure out

minor agate
storm bobcat
#

Figured out that does not exist today 🙂

minor agate
#

It's worse for modding

#

way worse

storm bobcat
#

Oh really?

minor agate
#

Yeah 😅

#

I also wanted it at some point, then found out how big of risk it is later on

storm bobcat
#

Performance wise or... software infrastructure wise?

minor agate
#

It's better to cause the crash or vme

#

than to try to band aid it, or handle it somehow when it comes to modders

#

The main issue is the non technical modders

#

And the extra problem we have with it, is that you can modify functions

#

rather than normal inheritance or partial classes

#

Which is what caused the msot trouble

storm bobcat
#

modded / override methods caused trouble?

minor agate
#

try catch end up being hardcoded in a sense forcing to what we call "hard method override"

#

Also you can hide away problems

#

Which we know modders will try their best, we prefer the game to crash on these things so that we can find issues

#

It sounds backwards but it's the safest to mantain long term stability

#

Broken mod should stay broken and unused if abandaoned

storm bobcat
#

Have you seen the ressurect crash guard mod?
It has a bunch of null catches for common null pointer crashes

minor agate
#

The only thing we are toying with is for catching nulls

#

that we might provide

#

But no general one for any VME

minor agate
#

But they are regression on stability

#

It hides the problems

#

But the problem is that players wanna play, even if bugged

#

so people make these

storm bobcat
#

Does crash report automatically upload to let yall know about the null crashes? Or do you need people to send them in?

minor agate
#

Another problem is that many features did not account for modded additions, and when modders add or remove things they land with null pointers

#

So it is important that we get these reported

#

On vanilla the null pointer might never arrive, but it will on modded

#

Crashes and VMEs are your friends, not enemies

#

They are that harsh friend that tells you the truth 😅

storm bobcat
#

(not snarky) Try telling that to my fellow server admins and regular players 😁
They panic over every crash

minor agate
#

Only big problem are the big crashes that do not produce logs

minor agate
open pier
minor agate
#

By the way, if you want to save yourself on null checks for a method that you provide something on. You can make the method return type have notnull on it

#
notnull SomeType GetSomeType()
{
        return something;
}
open pier
storm bobcat
#

Will that protect it from a crash? or just expedite the crash?

minor agate
#

So you need access to CPP to debug it,

#

best way is to report it back to us

open pier
minor agate
#

or mention it to @brazen sphinx

storm bobcat
#

What is CPP?

open pier
minor agate
#

He is a programmer dedicated for Arma Reforger modding problems

#

I can help from time to time too but unfortunaly I am often busy with company related stuff

open pier
#

Normally if the question is thrown there's someone to respond either way. Which most if not all of what you say is invaluable since it actually gives insight to how the engine works.

storm bobcat
# open pier C++

I thought so. So how can I debug through unknown exception crashes with CPP?

open pier
open pier
minor agate
open pier
#

a squeaky wheel gets the grease

minor agate
#

But it's feedback, not a complaint

#

and even then if complaint, it's usually rooted on a problem

minor agate
#

and we want to hear about that problem

restive island
#

i just go to the feedback thing and post everything i come across

storm bobcat
jaunty hearth
#

can someone point me how this selecting window work?
I was wondering if its possible to transfer this to something else like Changing entity faction and having list selection from factions from factionManager in world?

ocean kernel
#

VMEs and null pointers dont crash the game so calling a null pointer fix "crash guard" is dishonest

red cedar
red cedar
#

(derogatory)

red cedar
#

well deserved

#
RIPT       : -----[KittenEye] Stats for HideoutKitty
SCRIPT       : -----[KittenEye] Head : 6
SCRIPT       : -----[KittenEye] Lower torso : 7

SCRIPT       : -----[KittenEye] Echo
SCRIPT       : -----[KittenEye] Stats for HideoutKitty
SCRIPT       : -----[KittenEye] Head : 6
SCRIPT       : -----[KittenEye] Lower torso : 7

Finally thanks a lot @fringe prairie and Arkensor

dire sinew
red cedar
#

hey kex, would you mind if i use your shots fired code? (the detection part of it)

dire sinew
red cedar
#

the RegisterPlayerCharacter method yes

dire sinew
#

Yeah sure, go for it.

red cedar
#

Thank you

#

saving me hours frfr

dire sinew
#

That system has been scrapped anyway, so that way it was at least not for nothing 😅

red cedar
#

lol

#

Also would you know what would be the most elegant way to get Server sided data that i cannot use as an RplProp to a client sided menu ui ?

red cedar
dire sinew
#

If you don't want to use RplProp, then use RPCs instead. Client sends request (either it owns the object or via its player controller) and server sends back data to update UI.

#

If you need regular updates while the UI is active, you could also just implement a single request for starting updates until you request termination. We do this for the GM context menu tooltip for medical, for instance.

red cedar
#

i'll give it a shot, i don't need it to update just load and display the data when the Menu opens basically

#

ty

red cedar
#

What the fuck ?

restive island
#

I'm getting a VME with this saying there's a Null pointer at the bottom function, how can I fix it?

// Class with a static array
class LFD_Arrays 
{    
    private ref const array <string> LFD_files = 
    {
        "{1D09F6DDE5595017}PrefabsEditable/Auto/Props/Military/Compositions/US/E_FuelService_US.et",
        "{5B61FA25DD8DFA54}PrefabsEditable/Auto/Props/Military/Compositions/US/E_FuelService_US_Large.et",
    };

  bool get_prefab(string iprefab)
    {
      if (LFD_files.Contains(iprefab))
          return true;
        
        //Else
        return false; 
    }
}

// Logic start
modded class SCR_FuelNode : BaseFuelNode
{    
    LFD_Arrays Arraycheck;
    override void OnInit(IEntity owner)
    {        
        super.OnInit(owner);
        string prefab = owner.GetPrefabData().GetPrefabName(); 
        bool bmyprefab = Arraycheck.get_prefab(prefab); // VME here: Function OnInit, Null pointer to instance
        
        if (!bmyprefab)
            return;        
    }
}
dusk pollen
#

Does scripting have server side, client side, and shared?

red cedar
#

slap a

Arraycheck = new LFD_Arrays();

at the beginning of your OnInit

#

or

#

you should be able to get away with making your class statics

red cedar
dusk pollen
#

how do you know if the script is running server, client, proxie?

red cedar
#

well when you're writing down your script you should just know.

However you can prevent the script from running on the client side for exemple by writing something like :

    override void OnPlayerSpawnFinalize_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, SCR_SpawnData data, IEntity entity)
    {
        super.OnPlayerSpawnFinalize_S(requestComponent, handlerComponent, data, entity);
        if(!Replication.IsServer())
        {
            return;
        }
  [...]
restive island
red cedar
#

LFD_Arrays Arraycheck; just means "hey i plan to use a global variable of the type LFD_Arrays named ArrayCheck"

But you haven't instanciated the class, writing Arraycheck = new LFD_Arrays(); assign the variable to a new instance of the type LFD_Arrays

dusk pollen
#

Does waypoint creation, entity creation, or Resource.Load cause the most lag?

red cedar
dusk pollen
red cedar
#

Especially AI or vehicles

red cedar
#

As for players logging in, nothing you can do about it without sacrificing some number of slots

dusk pollen
#

anyone know why this sometimes doesn't work when a vehicle of crew get spawned? crewOccupants becoming empty.

        // Collect current crew in vehicle
        array<IEntity> crewOccupants = {};
        compartmentManager.GetOccupantsOfType(crewOccupants, ECompartmentType.PILOT);
        compartmentManager.GetOccupantsOfType(crewOccupants, ECompartmentType.TURRET);

        // Keep only entities from THIS spawn batch
        for (int i = crewOccupants.Count() - 1; i >= 0; i--)
        {
            if (!occupants.Contains(crewOccupants[i]))
                crewOccupants.RemoveOrdered(i);
        }

        if (crewOccupants.IsEmpty())
        {
            Print("No crew occupants found to split from vehicle group for QRF Dispacher", LogLevel.ERROR);
            return null;
        }
restive island
dusk pollen
#

also wouldn't it be array<ref IEntity> instead?

restive island
#

perhaps, I just know ref stops arrays from clearing

#

id try it on GM or HQC Arland in WB, I always have issues getting things i need from the MPtest maps

minor agate