#enfusion_scripting

1 messages · Page 5 of 1

river imp
#

The grenade probably doesn't have the correct set up for EOnContact to work

vale verge
#

The how would the collisiontriggercomponent be working then, if it doesn't rely on EOnContact?

#

since all the grenade effects are setup in the CollisionTriggerComponent

high hawk
#

Timer?

vale verge
#

by default

#

And what did you have this setup on, so I can try and test mine in a similar setting?

river imp
#

Not a projectile

#

What specific prefab are you using?

vale verge
#

swapping the CollisionTriggerComponent for mine

#

but it seems strange that the EOnContact wouldn't work for them, given that the BaseTriggerComponent has the event protected void EOnContact(IEntity owner, IEntity other, Contact contact); as part of it

#

and when I try and override the EOnInit for it, it works fine

#

but the EOnContact doesn't

river imp
#

You have absolutely 0 idea what is actually happening in the CollisionTriggerComponent because none of it is exposed.

vale verge
#

Yes, that is why I was asking questions on if anyone had any idea

river imp
#

Having an EOnContact method doen't mean that is what is being called by the CollisionTriggerComponent

vale verge
#

like from discussions i've missed or info I haven't been able to find, and could be pointed too

#

Yeah, it's a long shot of messing with it. I found another way to do what I actually want to do, so it's not an end of the world thing, but it was more a case of wanting to see if I still could get it to actually do what I wanted

timid citrus
#

Anybody know anything about EPF_BasicRespawnSystemComponent breaking deployment screen?

#

It works with regular SCR version but when I add the epf version it breaks

scarlet iris
#

Hello I'm getting an error related to this line of script in SCR_AmbientPatrolSystem

The line is this: SCR_AmbientPatrolSpawnPointComponent spawnpoint = m_aPatrols[spawnpointIndex];

Any idea what this could mean? I'm not using ambient patrols and the error happens even if I delete all the AI from the scenario

ocean kernel
#

Can you post full error?

scarlet iris
#

I've tried everything. I've even started the scenario with nothing but just a spawn and it keeps happening

ocean kernel
#

Do you have ambient spawn points in your scenario?

scarlet iris
ocean kernel
#

Something is causing the system to kick in, what if you place a dummy ambient spawn point sonewhere that does nothing?

scarlet iris
ocean kernel
#

It's probably not a good way to get rid of the error, but at least it won't be annoying you in development

scarlet iris
#

Thank you for the quick fix though!!

torn bane
#

Simple getters even for c++ side it is best performing to repeat them. But depending on how long the chain is, you might still want to use a variable for better readability. Also if the method warns it does some expensive lookup Logic you don't want to call it often

dark ocean
#

does modded have any runtime performance impact? let’s say I want to modularize a class by splitting it into several files, so that each source file appends it’s own methods to a single class.
are there any downsides to having 20 usages of modded on a single class?

pseudo merlin
sleek dove
pseudo merlin
#

Agree.
It can be confusing even if just 2 or 3 splits.
Speaking from my own experiance.

dark ocean
#

while search window is fine to work with, I find it more cumbersome with context menu’s „go to definition” option, which usually opens the file with modded variant instead of the source class, even if variable/method to follow is not modded

sour prairie
#

Hey, I want to increase the number of people it takes to start the capturing of the base. I want it to be a minimum of 3 people on the point BUT would still want like the ratio aspect still active. can this be done within the engine or is it a script ????. any help would be much appreciated as I'm new to this. Many thanks

torn bane
#

Sorry for the delay, this is a known issue related to road network which hangs up and causes a subsequent freeze check crash. We are already working on fixing it.

spark otter
sweet badger
#

When I make an entity inheriting from the PolylineShapeEntity, the points do not seem to work correctly.

[EntityEditorProps(category: "GameScripted/", description: "")]
class TILW_PolylineTestClass : PolylineShapeEntityClass
{
}
class TILW_PolylineTest : PolylineShapeEntity
{
}

I can place the entity and add points to it, but these points will:
a) Not disappear when going back out of the vector tool, they are always displayed
b) Are not selectable in the vector tool, meaning you cannot select+edit placed points.
I assume this is a Workbench bug (and will make a feedback ticket in that case). Or is this something that is expected to not work for some reason I'm not aware of?

rich pecan
#

Our Server creates an entity (parachute model, in this case) and attaches the entity to moving player entities, using local transform + parent. This works, but the parachute attachment vector can be off when viewed from other clients. So the parachute appears on other clients like it's underneath player entities, depending on lag.

Is there a right way to attach an entity to another moving entity, so it appears in the correct position on clients? The code on the Server is something like this.

EntitySpawnParams spawnParams = new EntitySpawnParams();
spawnParams.Parent = playerEntity;
spawnParams.TransformMode = ETransformMode.LOCAL;
spawnParams.Transform[3] = "0 0.9 -0.05";    // Position relative to player entity
IEntity spawnedParachute = GetGame().SpawnEntityPrefab(parachuteResource, GetGame().GetWorld(), spawnParams);
ocean kernel
#

I have a similar issue with my parachute but no there is no good way, and to have a character moved in as driver I even need to wait like 66ms otherwise it doesnt work, so even more lag.

rich pecan
ocean kernel
#

Ah ok I used this approach before I switched to a compartment and it was a bit prettier (parachute was almost instant, no delay) but this one is more proper

dire sinew
#

How about spawning it locally for each client inside the RPL bubble?

sweet badger
#

Is there a way to measure sub millisecond time, apart from Debug.Begin/EndTimeMeasure() which can only print the measurement?
I'm aware of System.GetTickCount(), but that only gives you a ms timestamp, so not precise enough.

rich pecan
# sweet badger Is there a way to measure sub millisecond time, apart from Debug.Begin/EndTimeMe...

What seems to work is create a new component, attached to the parachute entity, with a single function -> SetTransformBroadcast(vector transform) which is broadcast from the server, and each client does their own local transform. This makes everything 'look good' on the clients.

parachuteEntity.SetLocalTransform(FullTransform);  // each client does a local transform, relative to their view of the player entity's position.
parachuteEntity.Update();
#

e.g. that is called by every client, for each parachute entity, where it's streamed in.

ocean kernel
#

Lol I use this all the time for client-authoritative vehicles

#

Just send the transform, in some cases I also send velocity and angular velocity and apply it on other clients to smooth it out a little

#

I mean for movement

dire sinew
rapid ferry
#

In microseconds

narrow aspen
sweet badger
sweet badger
pliant ingot
#

What required to GameSystem be instantiated? (class inherited, added to ChimeraSystemsConfig.conf and nothing happen) or I need to do this manually?
never mind, restart WB just fix everything

candid garnet
#

does Enfusion support polymorphic dispatch?

say I have:

BaseSkill rifleSkill = new RifleSkill(); // RifleSkill inherits from BaseSkill
rifleSkill.SomeFunction();

will it call RifleSkill's SomeFunction, or BaseSkill's SomeFunction?

dire sinew
ocean kernel
#

Is that a fancy name for overloading

candid garnet
#

It allows you to call the same method on different objects and have each object execute its own appropriate implementation, simplifying code by letting you treat diverse types uniformly... sort of like an interface, but enfusion doesn't support interfaces

ocean kernel
#

It also doesn't support the walrus operator

dire sinew
#

There are also languages that support both, e.g. virtual vs non-virtual methods in C++.

ocean kernel
#

Aight why my world system aint running

#
class Bacon_6522EAB7461F248C_RobotSystem: BaseSystem {
    protected ref array<Bacon_6522EAB7461F248C_RobotCharacter> m_Characters;
    
    override static void InitInfo(WorldSystemInfo outInfo)
    {
        outInfo
            .SetAbstract(false)
            .SetLocation(ESystemLocation.Server)
            .AddPoint(ESystemPoint.FixedFrame);
    }

    override event protected void OnUpdate(ESystemPoint point)
    {
        Print("Hello");
    }
}
#

Also, how does the config from my screenshot get applied in published mod? Is it automatic?

#

Alright it works when I override chimera systems config, the mod config approach doesn't work

candid garnet
#

yeah ACE we modify chimera systems config

ocean kernel
#

What's the best way to handle entities being registered and unregistered rapidly? This is for a mod that will often have 100 characters running around spawning and dying

#

Best in terms of performance

candid garnet
#

have a minimum timeout between registers and limit how many things can be registered/unregistered at any given time. so you'll do a register/unregister queue

ocean kernel
#

But a queue means delay

candid garnet
#

yeah but does it need to be every frame? well, seems your system is using fixedFrame so what is that, every 30 frames?

ocean kernel
#

Would it be efficient to store my entities in a set? In terms of adding and removing is that faster than an array? I guess if it checks if something already is in the set then probably not

#

Maybe I'm just overthinking it

#

I'm going to iterate over all 100 characters, a couple per frame probably

#

I just put fixed frame for learning purposes

candid garnet
#

yeah so make a queue then, with no timeout, and you'll need to change your system to Frame instead of FixedFrame

pliant ingot
ocean kernel
#

Okie

pliant ingot
ocean kernel
pliant ingot
pliant ingot
sweet badger
# ocean kernel What's the best way to handle entities being registered and unregistered rapidly...

I'm not sure of your requirements, but I came up with this yesterday for my system:

//! Removes a character from the system
void RemoveCharacter(SCR_ChimeraCharacter character)
{
    int index = m_characters.Find(character);
    if (index == -1)
        return;
    
    m_characters.Remove(index);
    
    if (m_currentIndex > 0 && index < m_currentIndex && m_characters.Count() > index)
        ProcessCharacter(m_characters[index]); // Process swapback character
}

My system has an array of characters, and processes at most 50 per frame.
This means when you just remove a processed character during an unfinished processing round, a still unprocessed character from the end of the array would be swapped back to the removal index, and not be processed. This removal method processes any characters that were swapped across the current index.
The technique avoids ordered removals (which is important for performance) without the need for a removal queue.
Registration is not a problem, you just add it to the end of the array.

ocean kernel
#

Thank u all for the ideas boys

rich pecan
#

Since I'm attempting to determine if my mod is causing this, is there any way to correlate Replication 0x800XXXX errors with something in-game? Nothing else in my logs correlate to that Id, so I'm unsure what to do with that (seemingly unhelpful) error message.

  RPL       (E): RplSchedulerError: Generated task provided id of removed or never registered item! id=0x8000ECDC
  RPL       (E): RplSchedulerError: Generated task provided id of removed or never registered item! id=0x8000ECDC
  RPL       (E): RplSchedulerError: Generated task provided id of removed or never registered item! id=0x8000ECDC
pliant ingot
# ocean kernel Thank u all for the ideas boys

There are more options:

  1. You can make magic with weak and strong refs
  2. You can store index in component on entity, and instead of calling array's Remove implement your-own that first swap indices between last and deleting entity, swap them in array, and delete last element from array)
ocean kernel
#

Honestly kinda feeling like if systems are designed for modders to iterate over many entities, they should provide this functionality out of the box to be efficient

woeful vigil
#

hello, anyone who worked with REST API calls, can help me with this simple POST:

override void EOnFrame(IEntity owner, float timeSlice)
    {
        m_TimeAccumulated += timeSlice;
        if (m_TimeAccumulated < m_Interval)
            return;

        m_TimeAccumulated = 0;

        vector pos = owner.GetOrigin();

        PlayerController pc = GetGame().GetPlayerController();
        if (!pc)
            return;

        int playerId = pc.GetPlayerId();
        PrintFormat("[JRDX] playerId: %1", playerId);
        string playerName = GetGame().GetPlayerManager().GetPlayerName(playerId);

        JRDX_PlayerPosition position = new JRDX_PlayerPosition();
        position.x = pos[0];
        position.y = pos[1];
        position.z = pos[2];

        JRDX_PlayerPayload payload = new JRDX_PlayerPayload();
        payload.playerId = playerName;
        payload.position = position;
        payload.Pack();

        string body = payload.AsString();
        PrintFormat("[JRDX] Sending payload: %1", body);
        
        string contextURL = "http://localhost:8000/";
        string contextType = "application/json";
        RestContext context = GetGame().GetRestApi().GetContext(contextURL);
        context.POST(m_Callback, "player", body);

}
#

missing data, apicode, apicode, uuid, message? wth that means?

rich pecan
random moat
#

I've defined this component on an RPG and added the event handler component. Yet when i fire the RPG nothing happens

[ComponentEditorProps(category: "scripts/Game", description: "???????")]
class RED_MissileGuidanceComponentClass : ScriptComponentClass
{
}

class RED_MissileGuidanceComponent : ScriptComponent
{
    protected override void OnPostInit(IEntity owner)
    {
        
        if (!GetGame().InPlayMode())
            return;
        
        if (!Replication.IsRunning() && !Replication.IsServer())
            return;
        
        EventHandlerManagerComponent eventHandlerManager = EventHandlerManagerComponent.Cast(owner.FindComponent(EventHandlerManagerComponent));
        Print("BLUE.B"+eventHandlerManager);
        eventHandlerManager.RegisterScriptHandler("OnProjectileShot", owner, OnProjectileShot);
        
    }
    
    
        void OnProjectileShot(int playerID, BaseWeaponComponent weapon, IEntity entity)
    {
        
        Print(playerID);
        Print(entity);


    }
    
}
ocean kernel
#

In my experience it was only updating transform when I looked at it as client but it was a while ago, so it looked like it was teleporting

random moat
woeful vigil
#

wait xD

pliant ingot
pliant ingot
woeful vigil
#

replace cpp with whatever lang it is, like: py, c, c#

woeful vigil
pliant ingot
woeful vigil
#

ahh, kk xD

pliant ingot
woeful vigil
#

ye ye, got it, escape the symbol

pliant ingot
# woeful vigil \ ?

Server returns 422 code - which means it can't process provided data and message where it says that uid and apicode is missing in data

woeful vigil
#

how can i set headers?

low vault
#

anyone in here pretty good at sciprting who could help me with something stupid simple?

woeful vigil
#

why is the call even like that:

context.POST(m_Callback, "player", body);

it means will append "player" to the url? like "http://localhost:8000/" + "player" ? kinda weird

low vault
#

ive been trying for 3 hours to basically copy and paste something with 0 luck and don't understand why it wont work properly

rich pecan
low vault
#

theres a mod called improved shovels, the problem is it's for NATO only and I would like to get one going for RU. My theory is I can copy the original mod and the attributes of the E-Tool to the MPL and use the original mod as a dependancy.

#

I watched videos, tried over and over but I can't figure it out.

pliant ingot
pliant ingot
#

So looks like it trying to check your credentials

woeful vigil
#

i wish to know how to set headers and then try again, is the only thing i see different

pliant ingot
#

Search by this name in this chat for syntax

ocean kernel
#

Btw also don't use SCR_JsonApiStruct it is cursed

ocean kernel
#

It will stop working randomly and the parser is broken

woeful vigil
#

kk, so i need to know how to make a json in there

ocean kernel
#

SCR_JsonSaveContext and SCR_JsonLoadContext should work

#

It's probably not related to your problem just putting it out there

woeful vigil
woeful vigil
random moat
#
proto void RegisterScriptHandler(string eventName, Managed inst, func callback, bool delayed = true, bool singleUse = false);

What does Managed inst mean

pliant ingot
#

So it's any class by default in Game scripts

#

When you write class MyClass it's actually class MyClass : Managed

random moat
#

ok

#

when you this does this refer to the class you are scripting in?

#
        EventHandlerManagerComponent eh = EventHandlerManagerComponent.Cast(owner.FindComponent(EventHandlerManagerComponent));
        Print("BLUE.eh"+eventHandlerManager);
        eh.RegisterScriptHandler("OnProjectileShot", this, OnProjectileShot);
pliant ingot
#

this is pointer to instance

#

Instance may have different type, that inherits from your

random moat
#

I have no clue why it not triggering the event

pliant ingot
random moat
low vault
#

can someone help- me with my issue if they have a second

pliant ingot
random moat
# pliant ingot Your instance is live until it fires?
RED_MissileGuidanceComponent<0x000001D1965F17D0> (Owner : @"ENTITY:2305843009213693953" ('GenericEntity','Assets/Weapons/Launchers/RPG7/RPG7_body.xob') at <121.777000 1.000000 127.904999>)

this is the printout before i fire , if its not null its live aye?

ocean kernel
#

Whats the proper way to create an instigator for the damage related stuff that is actually null? I dont want to give credit for the damage to the GM

random moat
#

Right and it should be the world?

low vault
#

will legit pay someone 5 smackaroos

pliant ingot
#

All uses of this event by BIS is for player's entity and vehicle compartment ocupant

woeful vigil
low vault
#

supposedly you can write a script for it to work but that portion isn’t working

woeful vigil
#

what u have so far?

low vault
#

I’ll send it give me two seconds

pliant ingot
random moat
#

appreciate your time

scenic inlet
#

Hello, I'm looking for a script that automatically deletes all entities on a server every 5 minutes, as well as vehicles that don't work. Can you help me?

low vault
# woeful vigil what u have so far?

modded class SCR_ShovelImproved
{
override void EOnInit(IEntity owner)
{
super.EOnInit(owner);

    // Set RU model instead of NATO
    SetObjectMesh("{Game}/Prefabs/Items/Equipment/Accessories/ETool_MPL50/ETool_MPL50_FreeRoamBuilding_Gadget.et");

    Print("RU version of Improved Shovel active!");
}

}

random moat
#

Is there an actual tutorial that goes through this script somewhere

woeful vigil
pliant ingot
low vault
random moat
#

Or is the entity created when its shot

pliant ingot
woeful vigil
# low vault yea i only want RU to have it since impoved shovels is the same thing but for NA...

then i think this is not the way, you need to rewrite Configs/Factions/USSR.conf
this is what i did to add RHS - MSV to USSR:

SCR_Faction : "{B122E3B10BB3404B}Configs/Factions/OPFOR.conf" {
 m_aEntityCatalogs {
  SCR_EntityCatalogMultiList "{623E8A5B77CA04E3}" : "{FABE1A78C3709433}Configs/EntityCatalog/RHS_MSV/MSV_EMR_Characters.conf" {
  }
  SCR_EntityCatalogMultiList "{623E8A5B722AFFAB}" : "{DB327CCD7CD65D3B}Configs/EntityCatalog/RHS_MSV/MSV_Groups.conf" {
  }
  SCR_EntityCatalogMultiList "{623E8A5B73421B06}" : "{4AB9A3D2B81A7855}Configs/EntityCatalog/RHS_MSV/MSV_InventoryItems.conf" {
  }
  SCR_EntityCatalogMultiList "{623E8A5B718D69C0}" : "{4817C4345C248B30}Configs/EntityCatalog/RHS_MSV/MSV_Vehicles.conf" {
  }
  SCR_EntityCatalog "{623E8A5B6F6C6620}" : "{C9C16833C8387421}Configs/EntityCatalog/RHS_MSV/MSV_WeaponTripod.conf" {
  }
 }
}

just try to replicate with the item you want to add, it would be only 1 element i guess, i can't remember, it's been 8 months not touching Reforger stuff

random moat
pliant ingot
low vault
#

the problem is i do want it to be the MPL50 not the Etool

woeful vigil
low vault
#

Etool is the NATO side shovel, MPL50 is the RU side shovel

woeful vigil
#

how the hell i'm supossed to do that:

SCR_JsonSaveContext playerPos = new SCR_JsonSaveContext();
playerPos.WriteValue("x", pos[0]);
playerPos.WriteValue("y", pos[1]);
playerPos.WriteValue("z", pos[2]);
        
SCR_JsonSaveContext player = new SCR_JsonSaveContext();
player.WriteValue("playerId", playerName);
player.WriteValue("position", playerPos);
woeful vigil
#

it is like you edit the loadouts and add what you want them to have

low vault
#

yea exactly, its something you should have to hit rank major for

#

and then you can get it from arsenal

woeful vigil
#

first try simply add it to the loadout

#

i think u need to work whit this line and remove the others:

SCR_EntityCatalogMultiList "{623E8A5B73421B06}" : "{4AB9A3D2B81A7855}Configs/EntityCatalog/RHS_MSV/MSV_InventoryItems.conf" {}

ofc, replace with your object(shovel) path

#

something like:

SCR_EntityCatalogMultiList "{623E8A5B73421B06}" : "{TheModID}Configs/EntityCatalog/TheShovel/TheShovel_InventoryItems.conf" {}
#

but i would learn to do that in the workbench editor, not by scripting, will be easier

low vault
#

is the workbench editor a different program?

woeful vigil
#

no, just the workbench

low vault
#

this is the first time ive ever messed with enfusion

woeful vigil
#

but there are various tools, so wha i mean is world editor maybe

random moat
low vault
#

ah gotcha

woeful vigil
#

so, you go world editor, open your mission, find the faction manager, find the faction USSR, edit loadout, add the items for the shovel

low vault
#

yea i dropped a message in there and my buddy whop codes is now on so he's translating what youre saying also lol

#

thank you a lot im gonna try this and ill report back

woeful vigil
#

what's your lang btw?

low vault
#

English, idk code really

#

Okay so i found how to change the tool and all, how do i add it as a downloadable mod now?

#

well everytime i try to do it my enfusion crashes

quiet drift
#

Hey, hopefully someone can help me on this, I replaced de animation of combat evade command (roll), I figured out that root motion by animation is used here. In the STM the tag IsMoveRolling is set, if I delete it there is no more root motion. I suppose this work like the example of SCR_CharacterCommandSwim, If I undersand correctly the CMD and the Tag have to be true at the same time to get the root motion.
The thing is I can't find where the CMD_Combat_Evade and his tag IsMoveRolling are used in script. This is definitely possible to use the movement speed of the animation by root motion but I don't know what script I should use to set the root motion or any example related to the roll animation. I already have my script to call the CMD when the action is pressed , I have a script made from the example of swim and the command is called in SCR_CharacterCommandHandler, the swim seems to have root motion by animation as well but I can't get those script right apparently I'm missing something, they compile but my animation play without root motion. I join the scripts in the case someone want to look at them and find what's wrong.
https://streamable.com/g00qho

Watch "Workbench 2025.04.25 - 02.27.36.02" on Streamable.

▶ Play video
#

If I can get the root motion in my animations I'll do an animation logic that can work with it, that would be awesome for the animations visual quality and way easier in blender.

candid garnet
#

yeah delete this cross post or that one. pick one place

quiet drift
quiet drift
#

Don't take it wrong but I'll delete it if a moderator tell me to do it

minor agate
#

If so, then there is some RootMotion related method in the inheritance chain. I forgot the exact name. Search for it

#

Then override it in your scripted command to return true.

#

Unfortunately i can not check the exact name right now as i am out of country

quiet drift
# minor agate Is it custom scripted command?

I did one try by taking example of SCR_CharacterCommandLoiter but I couldn't make it work so I started looking for an another solution. You talk about the method in the screenshot ? I'll keep going in that way if you recommend me to

quiet drift
quiet drift
#

now it fully work, it was bugging because I forgot to set the tag in the STM x)
A beautifull root motion, except that it seems the command is "eating" Fire action, ADS and everything. I wonder if that's just how behave this method or if that's fixable

tawny lotus
#

Not sure if a scripting issue but asking for help. I show a hint on the clients by sending it to the client.

    protected void RpcDo_ShowHint(string title, string msg, int dur)```

Works nicely until it does not. With using dedicated server the client may start to showing them. The client log shows that this showing is triggered. If I do logout/login, it may be that the hint is not showing. Another logout/login may result it to show again. 

The server log shows: ```(W): Notification data in 'SCR_NotificationsLogDisplay' has duplicate notification info key: 'PLAYER_ON_BLOCKLIST_JOINED'. There should only be one of each key!```. Unsure if this is related. 

Any hints on where to look for the issue?
Should I do something when player logs out?
ember cloud
#

Hi guys, i'm looking at making some "mods" for server side only, and third party softwares.

especially, i'm looking at creating an online detailed dashboard. But i can't figure out if the servers have a public/private API (not talking abount the gaming internal API, but an API for external tools)

glossy onyx
#

I don’t know if this is where I’d ask but is there a way to remove sandbags and razor wire off of the servers ?

dire sinew
trim sail
#

i would like to know how mines ingame get triggered.
Attaching MT colliders (car wheel collision for example)to something onto character does not trigger mine when "smaking" mine with the thing.
Are these particular checks excluded with playable characters and only computed when vehicle goes over mines?

ember cloud
# dire sinew How about a REST API?

That's the idea, but i don't know if regorger's servers have a rest api

(haven't mention its to make an app for managing a reforger server with scoreboards)

high hawk
ember cloud
high hawk
#

You can use it to send data from the server

ember cloud
toxic bear
#

Dashboard <--> Your Backend <--> Arma

ember cloud
dire sinew
#

JS is a plague, I'd rather use FastAPI 😅

ocean kernel
#

Serverside scripts are possible with dynamic script modules

#

They cant do everything modside scripts can but they can do stuff

spark cairn
#

Am I the only one that the intellisense is sometimes works sometimes dosnt even show anything?..

glossy onyx
glossy onyx
rich pecan
#

Question on player entity bodies disappearing. We have garbage collection disabled.

Sometimes players get frustrated after dying and immediately disconnect (alt+f4). The body then disappears immediately. Logs show a player disconnect, then an immediate engine player delete.

I assume this is caused by vanilla BaseGameMode::OnPlayerDisconnected(). It does a

RplComponent.DeleteRplEntity(controlledEntity, false);

Any issues in changing that false to a true? Or what else should I be worried about?

ocean kernel
#

I would suggest commenting that out and Killing the player character instead if not dead already

#

Lol, soul left the body kinda vibe

spark cairn
#
class SCR_GateOpenUser : ScriptedUserAction
{
    [Attribute( defvalue: "Right Gate", uiwidget: UIWidgets.EditBox, desc: "Signal index of right gate door")]
    private string m_sSignalName;
    
    private int m_iSignalIndex;
    const float MAX_SIGNAL_VALUE = 90.00;
    
    private SignalsManagerComponent m_SignalsManager;
    //------------------------------------------------------------------------------------------------
    override bool CanBeShownScript(IEntity user)
    {
        return CanBePerformedScript(user);
    }

    //------------------------------------------------------------------------------------------------
    override bool CanBePerformedScript(IEntity user)
    {
        if(!m_SignalsManager) // Do nothing if there is no signal manager
        {
            Print("SignalManger was not found", LogLevel.ERROR);
            return false;
        }

        if (m_iSignalIndex < 0) // Check if signal index is valid
        {
            m_iSignalIndex = m_SignalsManager.FindSignal(m_sSignalName);
            Print(m_iSignalIndex, LogLevel.NORMAL);
            return false;
        }

        return true;
    }

    //---------------------------------------------------------
    override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
    {
        float targetValue = Math.AbsFloat((m_SignalsManager.GetSignalValue(m_iSignalIndex)) - MAX_SIGNAL_VALUE);

        m_SignalsManager.SetSignalValue(m_iSignalIndex, targetValue);
        Print(m_iSignalIndex, LogLevel.NORMAL);
        Print(targetValue, LogLevel.NORMAL);
    }

    //------------------------------------------------------------------------------------------------
    override bool GetActionNameScript(out string outName)
    {
        if((m_SignalsManager.GetSignalValue(m_iSignalIndex)) == 0)
        {
            outName = "Open Gate Door";
        } else
        {
            outName = "Close Gate Door";
        }
        return true;
    }

    //------------------------------------------------------------------------------------------------
    override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
    {
        m_SignalsManager = SignalsManagerComponent.Cast(pOwnerEntity.FindComponent(SignalsManagerComponent));
    }
}

in print im getting the right signal index, but when performing action signal just dont listen, is it a bug in workbunch or Im missing something?
Im able to find the signal index and Im able to change the value no errors, bone set to the correct bone in the procAnimation

spark cairn
#

I guess procedural animations are totally broken even trying just using the sample provided in github dosnt work lol

rich pecan
#

I'm modding a function in SCR_BaseGameMode. Vanilla function does a super.OnPlayerDisconnected() which I still want to call from my modded OnPlayerDisconnected().

What is the best way to call the original's super?

I can't seem to inject a new modded function into the vanilla SCR_BaseGameMode that gets me a reference to its super. But I'm probably missing something here...

vale verge
ocean kernel
#

Alternatively, if you want to be mean and hurtful, you can call vanilla.OnPlayerDisconnected() inside your method, but this might break compatibility with other mods that change OnPlayerDisconnected if they happen to compile before your mod

dire sinew
glossy onyx
#

So how dies that work with the wcs Everon mod ? Just load it up in the arma tools and look for that and remove them then reimport and what re publish it ?

#

Are do I make a whole knew file

#

Are say im making a new Eden senerio I could just do it in that one correct

dire sinew
#

You can't remove stuff from other maps in the world editor. You have to make a script that does the removal on game start.

#

Basically, you make a script that overrides ArmaReforgerScripted::OnGameStart.

glossy onyx
#

Okay so id make a script with that and then just add that to my mod list pretty much

dire sinew
#

Exactly

glossy onyx
#

Is that in the world editor are in the script menu

#

I’ve never messed with the scripts

dire sinew
#

Script editor only

glossy onyx
#

Can I send you somthing and you show me where I could add in there

#

Are mabye can tell me we have a file with stuff in it like ui so like load screen has a file for entity catalog and for somthing else

#

So can I stick that script any where in there

dire sinew
#

Have a look at the second bootcamp. Mario does an example of overriding ArmaReforgerScripted there

glossy onyx
#

Okay awsome

#

I was just trying to avoid making another mod if I can just add that to are ore existing mod

west prism
#

wanted to ask is it possible load in server config config.json under missionHeader script code?

rich pecan
ocean kernel
#

Ah my bad. So even vanilla. would call the parent of your modded class.

eager epoch
rich pecan
ocean kernel
#

Dont think so

#

I guess you can't mod the base class?

candid garnet
#

any way to change character movement speed easier? or do I have to modify every animation?

ocean kernel
#

they are in the command handler component

#

but theres a lot of em

candid garnet
#

it doesn't look like the attribute variables are exposed. so we can't modify them on the fly...

candid garnet
# dire sinew What is your ultimate goal?

Researching if I can do some things if I made an RPG framework. Think SPECIAL from fallout or oblivion with weapon skills. Just kind of in the planning phase to see what's possible. Changing movement speed based on speed/agility/athletics, carry weight and melee damage with strength, a sort of nearby player ping for perception. You get the idea. But I would have to modify these things in runtime.

river lily
#

However this affects (almost) all animations so it's a neat addition for say a skill tree, but only if you keep the modifications to a minimum value.

candid garnet
river lily
candid garnet
#

Lol

hearty swan
#

hello, I am trying to get a string I am putting into an Action component could someone please help?

#

I would like to try and use this Action Title

#

is anyone thats a seasoned programmer for Arma Reforger available?

candid garnet
#

what you highlighted is just for the editor

hearty swan
#

@candid garnet so this one can be reached?

candid garnet
candid garnet
hearty swan
#

@candid garnet theres that component and I have a text in it and I want that text to show as prompt

#

but to do so, i have to get the text from the component in my script

#

in Unity you are able to grab a field from the component on an asset with like Component<component type>variable = variable().getvariableName()

#

i just want to get a text...

river imp
river imp
#

Also last time I checked, setting the name in a ui info isn't at the instance level, meaning all of those actions would have their name changed.

vale verge
#

So, the mines use the SCR_PressureTriggerComponent to go off. That relies on EOnContact, which means you need to have two colliders contact one another, and the object that steps or drives on the mine also needs to meet the weight requirement to set the mine off. That weight is setup in the SCR_PressureTriggerComponent, and the colliders need to be setup on whatever asset you add to the game for your mine / pressure based explosive.

The two ways to do that are either make an asset that has the proper interaction layers on the object, or adjust the RigidBody to have all the proper interaction layers you need for that object. Once that is done, just setup the weight as needed, and there you go, you should have a working mine for whatever you want.

#

@eager epoch @trim sail

hearty swan
#

I ended up adding a new string field to the component and output it instead of trying to get a field from a component that i couldnt reach

#

simple solution to hard problem apparently

river imp
#

If an entity has a component you can get it from script.

#

Oh, you couldn't get the attribute from the component for some reason..

river imp
candid garnet
#

Not sure how to explain it to a new person

river imp
#

Not sure what that has to do with my response. lol

candid garnet
#

1.) making your own action inherit from ScriptedUserAction, it won't change all of the actions' text
2.) was referring to Kaiser

river imp
#

meaning, they all can't have different "action names"

#

I see your question before you deleted. The point I'm trying to make is, you shouldn't be changing the UIInfo name in order to change the "action name". The correct way to do it is like this #enfusion_scripting message

#

Also, it he was wanting the UIInfo from the context and not the action itself.

candid garnet
#

Yeah the question answered itself when I went to test it while waiting for answer

tawny lotus
#

Has anyone else had an issue where SCR_HintManagerComponent.ShowHint stops showing the hint on a client after one or more logout/login cycles? This happens on dedicated server. The trigger to show it on the client (replication) works properly, but ShowHint just does not show.

coarse pasture
#

Anyone have working examples of a rest callback they could share? Testing some stuff out and everything seems to just be running asynchronous. Use case is to use an external api response in a function

spark cairn
#

Is there an option to check interacting player UID? so I can check it against json file I have of players UIDs

coarse pasture
spark cairn
spark otter
spark cairn
coarse pasture
#
            string playerUID = GetGame().GetBackendApi().GetPlayerIdentityId(id);```
#

Id inception

spark cairn
#

Thank you!

torn bane
coarse pasture
#

I've just had zero luck with getting the dedicated server plugin w/ peer to recognize my mod folder which makes it hard to get an accurate test

coarse pasture
# spark cairn same...

The paramters and addons seem to want to do their own thing, no matter what I put there. So the peer just fails saying it can't find that addon each time.
Meanwhile, I can run localhost + peertool just fine.

desert escarp
#

Is there any reason why this keybind isn't working

#

GetGame().GetInputManager().AddActionListener("ArmDrone", EActionTrigger.VALUE, ArmDrone);

void ArmDrone(float value, EActionTrigger reason)
    {
        if (value == 1)
        {
            m_bIsArmed = !m_bIsArmed;
            Print(m_bIsArmed);
        }
    }
#

Every other keybind I have works but this one, I'm so confused

ocean kernel
#

What about if value > 0.98

desert escarp
#

Other keybinds trigger it tho

#

Like if I do DroneLaser instead it works

ocean kernel
#

Your action is in context right?

desert escarp
#

Yeah

ocean kernel
#

Maybe just print the value first

desert escarp
#

It's not calling the member at all

#

Like I tried just doing a print statement

ocean kernel
#

Also check priority maybe some other context is overriding it

desert escarp
#

ArmDrone doesn't work, no matter the keybind

ocean kernel
#

Oh i thought itd be something stealing F key

desert escarp
#

Could it be because i overrided chimeraInput like way back in 1.1 when I made the mod

#

Could it just have broke over the updates?

#

Cause this makes no sense as to why it's not firing

#

If I put the same keybind in another input class it works

#

Restarting doesn't fix it either

#

Wtf

ocean kernel
#

How do I make muzzleinmag muzzle type have infinite ammo

#

😦

#

Is this the way lol

ocean kernel
#

Would be nice if it worked in multiplayer tho, clients never even see the weapon being fired

north osprey
#

Hey guys what's the best way to find the reason for my server crashing? the dump file generated has a file size of 0 so there's nothing to look at there. Crash log shows this.

26.04 2025 16:06:27
Unhandled exception

Program: C:\TCAFiles\Users\erice\6316\ArmaReforgerServer.exe
Reason: Access violation. Illegal write by 0x7ffcc2c41af0 at 0x20

SymGetSymFromAddr:487, addr:0x7ffcc2c41af0
SymGetSymFromAddr:487, addr:0x7ff6598557d7
SymGetSymFromAddr:487, addr:0x7ff6598507f9
SymGetSymFromAddr:487, addr:0x7ff65963e672
SymGetSymFromAddr:487, addr:0x7ff65963e9ee
SymGetSymFromAddr:487, addr:0x7ff6588e08e2
SymGetSymFromAddr:487, addr:0x7ff6588f1ae7
SymGetSymFromAddr:487, addr:0x7ff6595f6284
SymGetSymFromAddr:487, addr:0x7ff6595f321b
SymGetSymFromAddr:487, addr:0x7ff65887180e
SymGetSymFromAddr:487, addr:0x7ff6595f2de8
SymGetSymFromAddr:487, addr:0x7ff658e5e3bc
SymGetSymFromAddr:487, addr:0x7ff659353468
SymGetSymFromAddr:487, addr:0x7ff65887095e
SymGetSymFromAddr:487, addr:0x7ff6595029ad
SymGetSymFromAddr:487, addr:0x7ff6594fcfc8
SymGetSymFromAddr:487, addr:0x7ff6594fcdf9
SymGetSymFromAddr:487, addr:0x7ff65882b52e
SymGetSymFromAddr:487, addr:0x7ff65882b1e2
SymGetSymFromAddr:487, addr:0x7ff6598f2508
[BaseThreadInitThunk]: ??? addr:0x7ffcca047ac4
SymGetSymFromAddr:487, addr:0x7ffccc4ea8c1
SymGetSymFromAddr:487, addr:0x7ffccc4ea8c1

spark otter
#

Get the crash report guid from the console log, then create a feedback ticket, and then pray someone feels like telling you what the issue was. Nothing users can do unfortunately.

#

That is also in no way at all related to scripting...

north osprey
#

my bad didn't see the troubleshooting channel until after I posted. Thank you

pseudo merlin
#

How do i get A.I. stuff from server to client?
I need some data from SCR_AIInfoComponent on the client but whenever i try Rpl Broadcast the RplId of the SCR_AIInfoComponent from server to client the id is -1.
What am i doing wrong?

pseudo merlin
# candid garnet post what you got so far

I'm using SCR_EditableCharacterComponent

//------------------------------------------------------------------------------------------------
protected void RplAIInfoComponentDelayed(SCR_AIInfoComponent infoComponent)
{
    RplId infoComponentId = Replication.FindId(infoComponent);
    
    Rpc(RplAIInfoComponent, infoComponentId);
    
    Print("SCR_EditableCharacterComponent > RplAIInfoComponentDelayed" + " > " + infoComponent + " > " + infoComponentId);
}

//------------------------------------------------------------------------------------------------
[RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
protected void RplAIInfoComponent(RplId infoComponentId)
{
    bool isServer = Replication.IsServer();
    
    bool isClient = Replication.IsClient();
    
    Managed infoComponentRpl = Replication.FindItem(infoComponentId);
    
    SCR_AIInfoComponent infoComponent = SCR_AIInfoComponent.Cast(infoComponentRpl);
    
    if (infoComponent)
        m_InfoComponent = infoComponent;
    
    if (isServer)
        Print("SCR_EditableCharacterComponent > RplAIInfoComponent > IsServer > RplAIInfoComponent" + " > " + infoComponent);
    else
        Print("SCR_EditableCharacterComponent > RplAIInfoComponent > IsClient > RplAIInfoComponent" + " > " + infoComponent);
}

I tryed the same thing with RplSave and RplLoad but still SCR_AIInfoComponent RplId is -1.

midnight talon
pliant ingot
pliant ingot
pseudo merlin
pseudo merlin
pliant ingot
#

Idk what is Rpl callbacks, but this in Replication overview

pseudo merlin
#

Okay. 🥲

high hawk
solid hearth
#

I don't even know what Rpl callbacks are 🤨

#

Unless you're talking about the OnRplName or w/e it is eeeh

pliant ingot
pliant ingot
#

It's fully describes what is Node, Item, Prop, Call... but never what is Callback

solid hearth
#

hmm more black magic that won't have a use case for most from what I can see.

high hawk
#

Maybe the callback is from pre 1.3 letting me know where my Registeringslotinfo keeps going

ocean kernel
#

Maybe onRplName is the callback, called when rplProp values changes

solid hearth
#

That's what I thought originally, I mean that is technically a callback

#

or what is traditionally considered one

pliant ingot
high hawk
#

Reforger

solid hearth
#

For all we know it doesn't even exist anymore and just hasn't been scrubbed from the docs

#

definitely wouldn't be the first nor last time that sort of thing happens

dark ocean
#

I swear I'll begin to implement my own classes for absolutely anything instead of using any of the vanilla code. this codebase can't be trusted for the simplest things.

RandomGenerator.RandInt(180000, 480000) = 118677

#

I bet in next minor patch it will start returning negative numbers, because why not

solid hearth
#

1000% stay away from the built in systems as much as you can. It's a nightmare that will never stops. I did some super extreme stuff for random and even then it's still not fully random. 😩

#

"Don't use math.random functions they say... use RandomGenerator instead they say..."
Also them: uses Math.random functions in array.GetRandomElement kannakms

dark ocean
#

yeah I had a feeling for a long time that there's something wrong with the sequences as well. GetRandomElement returned the same index for me several times in a row.
great, so I'm off to implementing my own random library now, instead of working on the mod itself blobdoggoshruggoogly

torn bane
solid hearth
#

Its paaaaaiiiiinnnnn

torn bane
#

It is what I thought it would be. The maximum random number range is 0x7fff aka 32767 anything beyond that simply does not work due to the random algorithm used. There is a diag assert for it. I will request an update to the docs

toxic bear
torn bane
#

If you want full int32 range random you might need to generate enough of these value instances and bitshift them together. you could make yourself a utility method for full range randomness within ranges. I have sent off a ticket for it and we will see what the enfusion team decides to do about it

dark ocean
silver goblet
#

can anyone help a beginner?
when creating a weapon mod, the instructions say you have to create a script for a magazine well. but if you follow the instructions, the script that is in the instructions does not work. is there still code missing or am i just bad? :3

glossy onyx
#

I’m still having a hard time figuring out where to go to make a mod to remove sandbags from are server if anyone could help that would be awsome

cunning wharf
#

Hi guys. Any idea why 16 line has null pointer?

modded class SCR_GameModeCampaign : SCR_BaseGameMode
{
    CQT_ScoreGameModeComponent m_ScoreComponent;
    
    override void EOnInit(IEntity owner)
    {
        super.EOnInit(owner);
        
        SCR_BaseGameMode gameMode = SCR_BaseGameMode.Cast(GetGame().GetGameMode());
        m_ScoreComponent = CQT_ScoreGameModeComponent.Cast(gameMode.FindComponent(CQT_ScoreGameModeComponent));
    }

    override void OnStarted()
    {
        super.OnStarted();
        m_ScoreComponent.Init(); // Null ???
    }

    override void OnPlayerKilledEx(notnull SCR_InstigatorContextData instigatorContextData)
    {
        super.OnPlayerKilledEx(instigatorContextData);

        if (IsProxy())
            return;

        m_ScoreComponent.UpdateScore(instigatorContextData);
    }
}
pliant ingot
#

Also mb somehow INIT entity event is disabled for gamemode idk

cunning wharf
pliant ingot
#

Place brakepoint in eoninit and watch

cunning wharf
#

it works in workbench but not on server

#

Updated code to this

modded class SCR_GameModeCampaign : SCR_BaseGameMode
{
    protected CQT_ScoreGameModeComponent m_ScoreComponent;
    
    override void EOnInit(IEntity owner)
    {
        super.EOnInit(owner);
        
        m_ScoreComponent = CQT_ScoreGameModeComponent.Cast(this.FindComponent(CQT_ScoreGameModeComponent));
    }

    override void OnStarted()
    {
        super.OnStarted();
        
        if (IsProxy())
            return;

        m_ScoreComponent.Init(); // null.......
    }

    override void OnPlayerKilledEx(notnull SCR_InstigatorContextData instigatorContextData)
    {
        super.OnPlayerKilledEx(instigatorContextData);

        if (IsProxy())
            return;

        m_ScoreComponent.UpdateScore(instigatorContextData);
    }
}

As before it works in workbench all good but not on Server...

this line has null pointer
m_ScoreComponent.Init();

#

This also doesn't work on server....

modded class SCR_GameModeCampaign : SCR_BaseGameMode
{
    protected CQT_ScoreGameModeComponent m_ScoreComponent;
    
    override void EOnInit(IEntity owner)
    {
        super.EOnInit(owner);    
        if (IsProxy())
            return;

        m_ScoreComponent = CQT_ScoreGameModeComponent.Cast(this.FindComponent(CQT_ScoreGameModeComponent));
        m_ScoreComponent.Init();
    }

    override void OnPlayerKilledEx(notnull SCR_InstigatorContextData instigatorContextData)
    {
        super.OnPlayerKilledEx(instigatorContextData);

        if (IsProxy())
            return;

        m_ScoreComponent.UpdateScore(instigatorContextData);
    }
}

I have checked that all the additional components are set in base EOnInit method it means that these should be set at that point when I calling
CQT_ScoreGameModeComponent.Cast(this.FindComponent(CQT_ScoreGameModeComponent));

but for some reason component not found on server...

Any idea why is that?

teal coyote
#

is there any way to set time scale for slow motion?

candid garnet
dim fog
#

I have a map on which there is 4700 entities "GraniteStone".. it is an object which I need to delete manually each time.. I wanted to write a script that will remove them when the game starts.. have this but I get errors:

modded class SCR_BaseGameMode
{
override void OnGameStart()
{
super.OnGameStart();
Print("Starting Granite Stone Removal...");
RemoveGraniteStones();
}

void RemoveGraniteStones()
{
    World world = GetGame().GetWorld(); 
    if (!world)
    {
        Print("World not found!");
        return;
    }

    array<IEntity> foundEntities = {};
    world.QueryEntitiesByType(BaseWorldEntity, foundEntities); 

    foreach (IEntity entity : foundEntities)
    {
        if (!entity) continue;

        ResourceName prefabName = entity.GetPrefab().GetPrefabName();

        if (prefabName.Contains("Granite") || prefabName.Contains("Stone"))
        {
            Print("Deleting Granite Entity: " + prefabName);
            world.DeleteEntity(entity); 
        }
    }
}

}

#

I am still very fresh with it.. is there a way to even achieve it?

candid garnet
#

Post the errors

pliant ingot
#

Also afaik ids of world entities don't change between restarts, so in theory you can run heavy search script that collects all ids of entities you want to delete and then delete them on each start

sleek dove
#

List is :
RplSave/RplLoad //< Used when streaming a node to a client
RplGive/RplGiven //< Used when giving ownership to a client
RplTake/RplTaken //< Used when taking ownership from a client

sleek dove
dim fog
#

@sleek dove can I DM you in regards to this query?

sleek dove
#

Since unfortunately flags on entity is overridden you can't really just put Disable flag on the prefab enabled

minor agate
#

If you have questions, just explain it here and we will help with it. or someone else in the communtiy will.

dim fog
#

No worries, hence I asked

#

so going back to the screenshot, I can just overwrite granitestone and set to disabled

minor agate
dim fog
#

Thank you

#

I will try it, as deleting 4700 rocks in GM on the map start.. it is not only annoying but laggs GM completely

sleek dove
#

Disabled should work, since none of the placed entity should have flags overriden, you can try it, otherwise using the way of creating a component which delete the owner during EOnInit is probably the second easiest option

high hawk
#

U could also use one of the world editor tools to mass update or replace

sharp void
#

Hello, i’m trying to test with server localhost + peertool but i’m getting a duplicated id error, what am i doing wrong?

#

Had to change the exec to the one with Diag suffix

pliant ingot
pliant ingot
ocean kernel
#

Is it not possible to have a custom collision trigger component? EOnContact and EOnInit in it never fires

#

I dont understand why those are exposed in this case if they don't get called

ocean kernel
#

My use case is I need to create an entity in the place where the projectile hits

#

And call some methods of that entity

#

And I want to retain the use of a projectile entity

#

Am I cooked?

high hawk
high hawk
ocean kernel
#

I can, but how can I feed data to it when it spawns from the projectile?

#

I thought inherit collision trigger component and use EOnContact but it never fires

vale verge
#

So if you do find a solution, please let me know, because I'm not sure if it's related to the projectile entity, or another aspect.

ocean kernel
#

The things that appear to be most logical when developing are roadblocked lmao

#

Modding workflow in reforger encourages jank workarounds

vale verge
#

Yeah. I remember I was able to get EOnInit working, but I could never get it to do anything with the EOnContact, at least using projectiles

#

Because what I was trying to do was merge the CollisionTriggerComponent and TimerTriggerComponent, but I couldn't get any of them to work, even just trying to modify them as one at a time

solid hearth
sleek dove
#

EOnContact is physics based, projectile are not physics based, they have their own simulation. This is why you get nothing, you need to use the projectile effects to be able to detect hit with projectiles

ocean kernel
#

Hm, so how should I go about accomplishing what I need? I need to pass information to an entity spawned by the collision trigger component

#

This is a UGL projectile btw, technically

slow acorn
#

For regular characters (not AI) is there a method that is triggered when a shot is fired nearby? Similar to the firedNear event in arma 3?

mild quarry
#

I am trying to make a folding bayonet script. When the bayonet folds out, I want to attach it to the slot on the weapon and when it folds in I want to detach it. On detach, I move the bayonet to a dummy entity that I have attached to the weapon (for storage). The script triggers on an inspection action, like this:

class BC_ToggleBayonetUserAction : SCR_InspectionUserAction
{
  override protected void PerformActionInternal(SCR_InventoryStorageManagerComponent manager, IEntity pOwnerEntity, IEntity pUserEntity)
  {
    . . . // Calls animation command and fetches components/entities

    if (isBayonetFoldingIn) // Store on the dummy attachment entity when folded
      bayonetHelperCompAttachment.AddChildToEntity(bayonetHelperEntity, bayonetEntity);
        dummyEntity.AddChild(bayonetEntity, EAddChildFlags.AUTO_TRANSFORM);
    else // Store on the weapon when active
        pOwnerEntity.AddChild(bayonetEntity, EAddChildFlags.AUTO_TRANSFORM);

It works perfectly when executed on the server side in workbench. But in peertool, the client sees the weapon swinging, but the stabbing is what the server sees (because the AddChild() didn't happen from the server's POV).

I have tried it a plethora of ways by using SetAttachment(), TryMoveItemToStorage , and several others and it always comes to the same result. I'm assuming the client doesn't have "authority" to call AddChild() (or SetAttachment(), etc.), but I honestly don't know what I am supposed to do.

hasty remnant
#

I'm completely stumped — I have no idea how to get input working for my mod. I just want players to walk up to a ledge (the ledge detector already works), and when they do, a UI tooltip should show up in the bottom right that says something like “Press _ to perform action.” It seems like a basic feature, but I'm extremely lost. I’ve figured out it needs to be handled through ChimeraInput, but I have no clue how to set that up properly. Any help or guidance would be massively appreciated.

rapid ferry
# hasty remnant I'm completely stumped — I have no idea how to get input working for my mod. I j...

Keybinds are defined per context. there are different contexts active at different times (helicoptercontext, menucontext, etc.). I'm not sure which one you should use, but if you open the debug menu you can view which contexts are active and chose one which looks right. To do that you'll need to mod chimera input config and add a new action, and then add your action to the list of actions within the context inside the config. The alternative is to make your own context and then have a script on the player which triggers activating the context.

#
OnFrame:

if (something)
{
  GetGame().GetInputManager().ActivateContext("YourContext");
}
late locust
#

Why are these in different order?

vector anglesXYZ = owner.GetAngles(); //X, Y, Z
vector anglesYXZ = Math3D.MatrixToAngles(mat); //Y, X, Z
late locust
#

Hmm I see, angles and YawPitchRoll is different.
I guess MatrixToAngles should be MatrixToYawPitchRoll then 🤔

owner.GetAngles(); //X, Y, Z
owner.SetAngles(); //X, Y, Z

owner.GetLocalYawPitchRoll(); //Y, X, Z
owner.SetYawPitchRoll(); //Y, X, Z
Math3D.MatrixToAngles(mat); //Y, X, Z
serene fox
#

Does anyone know if its possible to get all Ranges from a Sight? GetCurrentSightsRange() return the current, but i need a array which all available ranges from the Scope.

sacred agate
#

Use PeerTool
code not work in Client
GetGame().GetMenuManager().CloseAllMenus();
Close menu in server only

analog python
serene fox
analog python
ocean kernel
#

What was that ping Mario

minor agate
ocean kernel
#

Do you think I should forget about it being a projectile and just make a generic entity that does something on collision? :/

sleek dove
ocean kernel
#

I need to pass information to the warhead when it spawns

#

Well its not a warhead its "just an entity"

#

That information comes from who fired it

fervent cedar
#

I did that once just made a map with all the projectiles 🤷

#

        HCA_m_mPrjToLaunchTime.Insert(f_IEnt_Prj, t_fTimeCurrent);
        HCA_m_mPrjToWeapon.Insert(f_IEnt_Prj, f_IEnt_Wpn);
ocean kernel
#

omg

ocean kernel
#

So I need a different approach if I dont want to overcomplicate things

jaunty hearth
#

There is any alternative for ForceWeatherTo from TimeAndWeatherManagerEntity? No matter how i try use it to change smooth the weather it always skip the transition time and make change instant.

dire sinew
jaunty hearth
dire sinew
#

Use BaseWeatherStateTransitionManager::CreateStateTransition for creating the transition and then insert it as the next transition with BaseWeatherStateTransitionManager::InsertStateTransition.

ocean kernel
dire sinew
#

Projectiles are generally very limited with regard to modding. No way to make more advanced simulations of their trajectories either.

ocean kernel
#

I'm upset about the projectile entity I inherited having a collision trigger component that is used through arcane wizardry and any scripting changes I make to it are completely ignored by the game

#

dont give me editable things if editing those things doesnt edit those things

fervent cedar
#

That's true

ocean kernel
#

so now I have to spend an hour imitating what the projectile approach did to add 1 small feature to it

fervent cedar
#

GL & HF

ocean kernel
#

And now EOnContact fires underground when it collides with terrain so my entity spawns underground

fervent cedar
#

What about BaseProjectileEffect ? think_turtle

#

And then use the OnEffect?

ocean kernel
#

I needed a way to pass data to it from outside when it blows up

#

Anyway whatever

#

I forgot pressing ctrl+c in behavior editor has a random chance of crashing wb and reverting my most recent changes

faint talon
#

Regarding EPF, how do i figure out what is causing this?

#

Actually might've figured it out

#

No i have not

mild quarry
torn bane
candid monolith
#

So is there a reason CallLater() gives a "static arrays are not supported" error, when passing it a BaseWorld?

dire sinew
candid monolith
#

oh i know i just find it really weird, i didn't test but idk if all things inheriting from pointer cause that error of if the world is a special case using the wrong error

quiet drift
#

Hello, this is the debug of the weapon animation graph, to send a custom variable here I'm forced to do a custom class of WeaponAnimationComponent or that's necessary just to change the behavior of the weapon like in the bootcamp n°10 ?
I tried to use the AnimationControllerComponent like I use CharacterAnimationComponent but it doesn't work. Character graph receive the variable but not the weapon graph. I also tried to used BaseItemAnimationComponent to synch but still doesn't work.

feral falcon
#

IDK if anyone here is familiar with the concept of reflection, at least that's the name in the C# space.

I've figured out how to dynamically get variable names / values from a type. However... can't figure out how to update/set those values. Does the engine right now support this? Only looks like retrieval of things is supported

#

for context, trying to build upon the json-schema standard to describe a set of data. Augmented it to include describing how the data would render in the UI. Was hoping as widgets are created I could use OnElementChanged to update the backing model's value. May need to get crafty on an alternative approach.

Example:

"title": "TrainWreck Settings"
"properties": {
   "SpawnTimerInSeconds": {
    "title": "Spawn Timer in Seconds",
    "description": "Interval in which AI spawn",
    "default": 2,
    "type": "integer",
    "ui": {
      "type": "slider",
      "min": 2,
      "max": 500,
      "step": 1,
      "format": "%1 seconds"
    }
  }
}
feral falcon
#

Want to dynamically generate a UI based on a schema, where I can have a concrete backing type for.

So.... for the example listed I have a

class TrainWreckSettings
{
     float SpawnTimerInSeconds;
}

Want to expose this to an admin so that they can configure things at runtime. But make it generic enough so the broader community could perhaps benefit.

IDK what the final code would look like as I'm still researching but it'd be something like

ShowDialog<TrainWreckSettings>()

Maybe a path to the schema in the mod itself. IDK yet. But having this generate and hookup the UI for me would be huge in my opinion

pliant ingot
feral falcon
#

That's true, that's one way of doing it. If reflection path was possible then it could be a lot less developer setup and bit more dynamic.

#

End result, being able to tweak a schema and poof I get a working/usable UI

dire sinew
#

Maybe instead of trying to reinvent the wheel, you could add your settings to the GM scenario properties.

#

Also your settings would automatically be part of session saves that way.

feral falcon
#

This is not reinventing the wheel. This would enable devs to provide a specification file following json-schema standards and have it generate the UI and the glue between the UI and backend code.

Verus having a developer do it for EVERY single thing they want.

mild quarry
quiet drift
dire sinew
mild quarry
mild quarry
# quiet drift Yes

Sorry if I’m asking silly questions. Did you register the variable? I always registered my player and weapon variable separately (idk if that’s needed, but I did)

quiet drift
mild quarry
#

But yeah

quiet drift
mild quarry
# quiet drift I tried like this and also another way but I don't have that one anymore

Oh I figured you were doing the variables in a custom weapon animation component. I’m not super familiar with that class, so I’m just going to venture a guess. Not sure when OnControlledEntityChanged is called, but I would guess that if the weapon is not in hand, then your variable would not be bound properly and it might be failing the null check before you set the variable. You can put a break point in the debugger to see if your variable is being set and if the variable index has been bound to an integer

quiet drift
#

But Character part almost always fine

scarlet iris
#

Hello how do I add a script to a prefab? I've tried adding "Script Component" but it just says "Enabled" doesn't let me attach a script.

On the prefab entity there's a Script section with a plus sign to apparently add a script and it shows a dropdown list but when I chose one nothing really happens. what am I doing wrong?

quiet drift
#

Now I use another method SetWeaponReload to a new integer and it's the perfect way but I wanted to know why I can't send a variable to the weapon, like if i'm forced to create custom class or something

dire sinew
mild quarry
quiet drift
mild quarry
#

You can also try rebinding the variable constantly. Not great to keep in the code, but it might help debugging. I rebind mine every animation event lol

quiet drift
mild quarry
#

Actually I do that with events, not sure if it will overwrite variables

mild quarry
feral falcon
quiet drift
quiet drift
scarlet iris
# dire sinew Don't use the Script section. It's bad practice tbh. Can you show the code of th...

This is more an experiment than anything because I don't really know what I'm doing. Using a few AIs for research I managed to get this down (trying to attach a map marker to a vehicle so that I can see it on the map in real time at all times)

So I guess I have to attach this to the actual truck but even then not even sure if it would work at all. was just trying to experiment

feral falcon
feral falcon
#

It's a little weird to me that you have to define it sort of twice? One with the suffix class? I'm not 100% sure what the difference/purpose really is. Just following the conventions I've seen in the codebase

dire sinew
#

You could also use the Create New Script plugin in the script editor and set Type to Component to generate the file.

dire sinew
mild quarry
# quiet drift Oh ok, and that's fine for mod conflict issue ?

Depending what you’re doing, yes. If you’re doing anim stuff for your custom gun, you just inherit from the animation component class that the gun uses and give it your own name. Then you replace the class in the prefab with your new one. If you’re trying to override vanilla gun animations, there’s a chance for conflicts. Maybe that’s when you would want to use a modded class? Not sure though

quiet drift
scarlet iris
#

can anyone tell me what's wrong with this script?

[EntityEditorProps(category: "GameScripted/Frontline", description: "Adds a dynamic map marker to the vehicle.")]
class TruckMarkerComponentClass : ScriptComponentClass {}

class TruckMarkerComponent : ScriptComponent
{
override void OnPostInit(IEntity owner)
{
super.OnPostInit(owner);

    if (!Replication.IsServer())
        return;

    SCR_MapMarkerManagerComponent markerManager = SCR_MapMarkerManagerComponent.GetInstance();
    if (!markerManager)
        return;

    // Create a dynamic marker that follows this entity
    SCR_MapMarkerEntity markerEnt = markerManager.InsertDynamicMarker(SCR_EMapMarkerType.DYNAMIC_EXAMPLE, owner, 0);
    if (!markerEnt)
        return;

    Print("Dynamic marker inserted.");
}

}

It's printing on the log so at least the game recognizes it but it's not doing what I want it to do

eternal pewter
#

Is there a way to escape a "? In other languages it's like "This is a quote:\"I am a quote\""

I want to call ffprobe in a Workbench plugin for checking the length of WAV files and as paths might contain spaces so I need something like this string command = "ffprobe "filepath" > output.txt"

#

Sorry, already found it: filepath = "\"" + filepath + "\"";

mild quarry
river imp
#

It's way easier for us to read.

#

In your script you're returning for the client. Meaning the client will never get the dynamic marker added. You're only adding it for the server which doesn't even render UI(I.E. a map) unless it's a hosted game or workbench.

#

If everything is set up correctly, your script should show the marker for the listen server(workbench)

#

If it doesn't then you're not doing something correctly

teal coyote
#

how am I supposed to call the parent class constructor?

pliant ingot
teal coyote
#

ooof, so how does it pass arguments then?

pliant ingot
#

You can have only one constructor and each child constructor must repeat arguments of parent

teal coyote
pliant ingot
#

You can extend them only on the end

teal coyote
serene fox
#

How can i override a destructor? i also need to remove some materials, like the original class

    //! Destructor
    void ~SCR_2DPIPSightsComponent()
    {
        Destroy();
        if(m_pMaterial) m_pMaterial = null;

        // This should prevent some static leakness.
        if (IsPIPEnabled()) SetPIPEnabled(false);
    }
dire sinew
#

I mean in the case you want to remove behavior from the original condtructor. If you just want to add behavior, you can make a destructor in the modded one.

serene fox
#

Scripts/Game/Weapon/REAPER_2DPIPSightComponent.c(526): error: Invalid destructor name '~REAPER_2DPIPSightsComponent'

dire sinew
#

Or rather the s is missing in the class name

serene fox
#

OMG

#

Thanks 😉

sacred agate
#
modded class SCR_FactionButton
{
    bool UpdateButtons()
    {
        SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
        if (!factionManager || !m_Faction)
            return false;
    
        string factionKey = m_Faction.GetFactionKey();
        PlayerController pc = GetGame().GetPlayerController();
        if (!pc)
            return false;
    
        if (!AL_FactionHelper.IsFactionPlayable(m_Faction))
        {
            SetEnabled(false);
            SetShouldUnlock(false);
            return false;
        }
    
        string strPuid = AL_Helper.GetPlayerUID(pc.GetPlayerId());
    
        EFactionAccessState access = AL_FactionHelper.CanJoinPoliceFaction(strPuid);
        
        if (factionKey == "POLICE")
        {
            switch (access)
            {
                case EFactionAccessState.INVALID:
                    SetFactionName("Wait for sync...");
                    SetEnabled(false);
                    SetShouldUnlock(false);
                    return false;
                case EFactionAccessState.DENIED:
                    SetFactionName("You do not have permission.");
                    SetEnabled(false);
                    SetShouldUnlock(false);
                    return false;
                case EFactionAccessState.ALLOWED:
                    SetFactionName(m_Faction.GetFactionName());
                    break;
            }
        }
    
        SetEnabled(true);
        SetShouldUnlock(true);
        Replication.BumpMe();
        return true;
    }
}

I have a problem with the list refreshing on the server only. It doesn't update on the client.

sacred agate
#

@vernal moat 🌹

vernal moat
#

what ?

teal coyote
#

is there a way to access the ammo config of a MagazineComponent programmatically?

#

I'm trying to get a default bullet type given a weapon prefab, so I got to the default magazine from the weapon through BaseMuzzleComponent::GetDefaultMagazineOrProjectileName, but now I can't find a way to get from the magazine to the bullet

dire sinew
#

You can access any attribute through BaseContainer::Get and you can get the base container of a component through SCR_BaseContainerTools::FindComponentSource.

sacred agate
vernal moat
#

¯_(ツ)_/¯

sacred agate
slow acorn
#

For regular characters (not AI) is there a method that is triggered when a shot is fired nearby? Similar to the firedNear event in arma 3?

river imp
#

Not afaik. There isn't an equivalent method for everything that existed in Arma 3.

#

Making the comparison is just hindering your learning if you ask me.

solid hearth
#

There's a supression mod out there, could probably take a look at that and see how they're detecting it.

slow acorn
#

seemed to work

river imp
solid hearth
#

The general rule is search for it, and if you can't find a way look and see if someone else has achieved something similar and learn from them. That's the arma way cat_thumbs_up

#

Just actually take the time to understand what they're doing don't go for a blind copy paste.

slow acorn
#

There is a SCR_AIDangerReaction_WeaponFired for AI but it seems the trigger is not exposed.

#

Last resort is to loop every player around when a shot is fired and set a variable on them. But defenitely not an ideal solution

#

I'm just waiting for Tonic to make a "life" framework

solid hearth
#

Never happening

slow acorn
#

just kidding, we are getting there. Almost up to your par

solid hearth
#

I think roleplay stuff in arma is stupid and pointless, go mod gta at that point it's more suited for that stuff and obviously more popular 😔

slow acorn
#

It's for the nostalgia

#

A3L was the peak of my teenage life

foggy swift
#

before i try reinventing the wheel, does EDF still work?

foggy swift
#

🙏

candid monolith
#

also is there any normal way of being able to use a 64 bit value? You can typedef EntityID and use it's fromint() function to set the bits, but you can't read them back or increment past 0xffffffff still

#

I'm currently just using a class with two int's and manually handling changing each one but it's a memory hog for what should be 8 bytes

minor agate
candid monolith
#

i've got my class working pretty well now so it should be okay i think

#

Although bigger issue, why does bit shifting stop working with values greater than 0x7fffffff?

0x7fffffff >> 4  = 0x07ffffff // all good
0x80000000 >> 4  = 0xf8000000 // not good at all
0xffffffff >> 24 = 0xffffffff // really not good
#

Shifting left works as expected though

pliant ingot
boreal swan
#

When it comes to GTA, it's better platform for hardcore roleplay, but I consider Arma a better platform for more arcade RP especially if the in-depth simulation of nature got utilized properly (as that's something that GTA doesn't have)

candid monolith
#

I think I may just be a grumpy c programmer

ocean kernel
#

Okay so whats the way to get the world space matrix of a bone now that works? Not only GetBoneMatrix returns local matrix, but somehow it's usually wrong too

#

Ah okay GetBoneMatrix ignores the rotation of the entity

dire sinew
#

It's local, so you can get the world one by multiplying with the world transform of the entity.

minor agate
#

And for the transforms it would work, they would have to be from root bones

#

Otherwise the transform hierarchy is lost

dire sinew
#

Surely Math3D.MatrixMultiply4(entityWorldTransform, localBoneMatrix, worldBoneMatrix) should work. It's basic linear algebra.

minor agate
#

You are missing the hierarchy

#

If it was root bones, it would be fine

#

For a hierarchy of bones, it will not

dire sinew
#

Ah, I see

#

So the they are in the parent bone space instead of the entity space

#

So is there a way to get the change of basis to the world space? Or do you have to transform up until you get to root bone?

dire sinew
#

Is that the one in the entity space or parent bone space?

minor agate
#

Parent bone space

#

If you use both (GetBoneMatrix), then you are golden

dire sinew
#

So GetBoneMatrix is entity space?

minor agate
#

idk what is up with the naming on this api, but GetBoneMatrix returns model space

#

The other one returns bone orientation in space of parent bone.

dire sinew
minor agate
#

If you want final in world space

#

then you have to do those two and then world space of entity itself

#

I can make a small example later today.

#

With the references in a world to see visually, I think it will help many.

dire sinew
#

Maybe it was a bit confusing. I meant with localBoneMatrix the one you get from GetBoneMatrix. I didn't even consider there is also GetBoneLocalMatrix 😅

rich pecan
#

Question about ref leaks. I have an in-game entity (a big Billboard) with a texture mapped to it. (via RTTextureWidget) That Widget has a RichTextWidget for text display, with a Script Component (BillboardTextureComponent : ScriptedWidgetComponent).

I'm getting a Leak error about BillboardTextureComponent on scenario transition, even though nothing else references it. (that I can discover) It's only referenced as a Script under the texture.

What should I look at to resolve, and what are the impacts of this overall?

dire sinew
#

Don't ref the component

#

Never ref something you are not actively creating and managing.

coarse pine
#

I am guessing there is no way to increase slotReservationTimeout over 300 due to it requiring backend also?

dire sinew
#

If you really want persistence, you should create or use a proper framework for it tbh.

coarse pine
#

For my use case just increasing that to 900 would have been enough but I guess you are still right.

west prism
#

can someone tell me please why this doesnt work when executed in remote console SCR_NotificationsComponent.SendLocal(ENotification.PLAYER_KICKED); console says executed successfully but nothing shows

#

just trying to wrap my head around the notifications

jolly fiber
#

reposting: is anyone familiar with making cinematics? I need some tutoring. this is a long way over my head but im eager to learn and I have a goal to achieve. I just need help getting started.

narrow aspen
#

what is this error means? invalid waypoint?

#

Function: 'NodeError'
Stack trace:
scripts/Game/AI/Utils/NodeError.c:8 Function NodeError
scripts/Game/AI/ScriptedNodes/Waypoints/SCR_AIGetDefendWaypointParameters.c:21 Function EOnTaskSimulate
01:47:16.028 WORLD : UpdateEntities
01:47:16.028 WORLD : Frame
01:47:16.028 SCRIPT (E): Virtual Machine Exception

Reason: Wrong class of provided Waypoint!

river imp
#

Yeah

high hawk
#

Is replication through layouts possible? (Not doing anything, just a question)

#

or more so, is there certain limitations

pliant ingot
#

Speaking about Systems: there is no way to make the systems work in edit mod?

high hawk
pliant ingot
#

looks like I forced to make some workaround in components with custon "system" class to do this

high hawk
#

restart workbench? if you added the debug methods as well, in the diag menu under systems yours should be there if successful

pliant ingot
#

I try vanila config and config that contains only my system

#

And I don't known how to retrieve this system even if it will be instantiated because during edit mode GetWorld returns "zero world" which throws null exception when you try to call FindSystem

high hawk
#

How come you are trying to find the system? just do it in play mode

pliant ingot
# high hawk How come you are trying to find the system? just do it in play mode

play mode
question isn't about play mode, but about edit mdoe, in play mode everything works fine
I just want to perform some checks to ensure that editor is setup everything right and provide additional visual information, and I want to use for this code from system itself, but currently it's impossible because I can't run system during edit (at least for initialization like for any component and entity), so I ask - it's possible to do this or not and I need to create some extra class that behaves like a system

river imp
#

You're gonna have to create some class that behaves like a system

tiny apex
#

Hey,
I am currently trying to add a custom config unfortunately it does not show up if I try to add one.
I used the SCR_XPRewardInfo respectively SCR_XPRewardList as template, basically just copying into a new scriptfile and renaming the classes, without success. Whenever I add a config it only suggests SCR_XPRewardList (my class just having TEST_ as prefix).
I have restarted the Workbench / reloaded the scripts multiple times without success.
Did I miss any step to register my class as config class?
Is there any documentation I missed about this topic?

sleek dove
pliant ingot
sleek dove
#

In future, we want to have systems config being selectable in world, so you could have one world with multiple configs, so this would not be possible to achieve with it, but you can always create a plugin to validate your data

high hawk
sleek dove
tiny apex
# sleek dove In `BaseContainerProps` attribute, you should have `configRoot` as parameter, if...

This is how my file looks like, it is basically the same as SCR_XPRewardInfo. I omitted the most of it since it is the same as SCR_XPRewardInfo.

Name of file: TEST_RewardList.c

[BaseContainerProps()]
class TEST_Reward
{
    [Attribute(defvalue: "0", uiwidget: UIWidgets.ComboBox, desc: "ID of this reward.", enums: ParamEnumArray.FromEnum(SCR_EXPRewards))]
    protected SCR_EXPRewards m_eRewardID;

        [...]
}

[BaseContainerProps(configRoot: true)]
class TEST_RewardList
{
    [Attribute()]
    protected ref array<ref TEST_Rewards> m_aRewardList;

        [...]
}

errant wren
#

Are you able to set your own contexts in chimeraInputCommon.conf?

glossy onyx
#

I’m looking for the location to remove sand bags from the game

river imp
errant wren
#

Can they not be activated with an action?

#

GetGame().GetInputManager().ActivateContext("ActionMenuGadgetContext");

doesn't seem to activate it

river imp
errant wren
#

Oh ok, that should be helpful thank you

mild quarry
placid haven
#
[WorkbenchToolAttribute(name: "Vector2", wbModules: { "WorldEditor"}, awesomeFontCode: 0xF023)]
class VectorTool2: WorldEditorTool 
{
    override void OnActivate()
    {    
        
        WorldEditor we = Workbench.GetModule(WorldEditor);
        
        WorldEditorAPI m_api = we.GetApi();
        
        IEntity ent = m_api.SourceToEntity(m_api.GetSelectedEntity());
                
        m_api.ToggleGeneratorEvents(true);
            
        Print("set scaling");
        
        ent.SetScale(0.1);
        
        ent.SetScale(1.0);
        
        Print("scaled up");
        
        m_api.ToggleGeneratorEvents(false);
        
        m_api.EndEntityAction(); 
        
        Print("end");
    }
}

Hi everyone! Trying to force trigger generation of WallGeneratorEntity with scaling
But script do nothing

tiny apex
pliant ingot
#

Scripts outside of these folders are ignored

#

List of moduels you can see in project options or in remote console

#

The best option for you is Game

tiny apex
#

Soo scripts/Game/config should work then?

pliant ingot
#

Yes

#

At least if there are no vanilla important script with this name

#

Which may breaks scripts entirely

#

Better to prefix your files with some TAG

tiny apex
#

I have

#

Thank you! It was the directory... 😄
Is there some documentation about this somewhere?

tiny apex
#

Thank you

static vale
scarlet iris
#

If I want to slightly modify a script from a dependency how do I go about it? because I can't override a script and if I duplicate it, it gives me script error

scarlet iris
#

but when I duplicate it I can't edit it

#

not sure if this is how it's meant to work tho, I'm new to this

late locust
#

Why does this not work?
string foo = "Double quotes: \"\"";
But this does with a whitespace in between?
string foo = "Double quotes: \" \"";

pliant ingot
#

because there are broken syntax highlighting with escape quotes

late locust
frosty coral
#

Anyone knows of any unobvious reasons not to mod SCR_PlayerController?

pliant ingot
oblique lynx
#

Does anyone know if it's possible to modify wheeled simulation values whilst the game is running? Like say I wanted to give a vehicle a nox switch or smth

ocean kernel
#

How do you get active ragdoll of a character?

#

And more importantly, its velocity

pliant ingot
#

There are no regular expressions here?

#

Or any patter matching

#

for string

ocean kernel
#

Only what is in string helper class. No regex

shrewd nova
oblique lynx
ocean kernel
#

Physics impulse downward

#

Like a deployable spoiler

shrewd nova
oblique lynx
gloomy lynx
#

yeah =\

oblique lynx
# ocean kernel Physics impulse downward

Not sure how to do that, currently just trying to use the stuff in VehicleWheeledSimulation to do this, im hoping somehow by improving the gearbox efficency and also the longitudinal friction I can find a way to make the vehicle be able to climb things easier but not be a rocket

gloomy lynx
#

maybe somehow spawn an extra set of invisible wheels for extra grip? if that is even exposed

oblique lynx
oblique lynx
#

For the gearbox efficency does anyone know if this has any impact on torque? or how to modify the torque the engine produces at run time

gloomy lynx
#

high ratios result in way more torque

#

i usually do 2:1 for transmissions and try to keep differential ratio realistic so i will look it up for whatever vehicle im using

#

most subarus use 4.11:1

#

so to visualize it, gearbox ratio is from engine to gearbox
so for every 2 turns of the engine its 1 turn of the transmission, then to axle differentials in my case it was 4.11 turns of transmission per 1 turn of axle

#

the higher you make those ratios it results in less rpm but more torque

oblique lynx
gloomy lynx
ocean kernel
#

You know what would be nice, gear ratios that work so my vehicle doesnt turn out to be incapable of going forward but launch at mach 5 in reverse with the same gear ratios

hushed swan
#

Hi, guys, can you tell me if there is any mod or if it is possible to create a mod where I put bohemiaId and this ID does not get in line or has priority equal to admin?
What if you use an existing logic of the administrators? Because today the administrator has priority in the queue if the server is full, correct?

coarse pasture
shrewd nova
hushed swan
safe geode
#

Anyone figured out how to get an SQL server sorted using enfusion yet?

ocean kernel
#

Not possible for two reasons:

  1. You can't use Enfusion. You can only use Reforger.
  2. There's not SQL bindings or functionality in Reforger.
dire sinew
#

Why not just put the DB behind a REST API?

dire sinew
foggy swift
#

If you’re looking for the config options you can find it on the wiki

spark otter
humble shale
#

Q: how would one script in a vehicle prefab limiter to limit the numbers of active vehicles by type ( ie: limit active attack helicopters to 2 per team )

west prism
#

Anyone know how to call notifications for testing?

teal vapor
#

Does the declarative config language used for cfg / layout files have a name?

coarse pasture
#

You could probably do it with some onclick type of thing but UI work is tough

west prism
#

Sorry noob

coarse pasture
#

Of calling vanilla notification or your custom layout?

west prism
safe geode
safe geode
#

Considering there is no reforger scripting channel

#

Is there any plan to add extensions like in Arma 3

#

Guess that gives... an answer

dark ocean
safe geode
#

Oooh

#

Oh yeh

#

Rereading

dire sinew
safe geode
#

Good point

safe geode
#

Like extdb3

safe geode
#

Oh no

#

The big man himself is typing

solid hearth
#

Sadly from statements made in the past they don't plan on doing extension support anytime soon (if at all). The closest you can get is with erm.. InterceptAR but you'd have to write your own plugin, plus it's outdated and doesn't work atm but if you let dedmen know he'll probably fix it..?

#

The only real way that won't break over game patches is sadly with the REST system...

safe geode
#

Damn

#

Means I can write whatever, but still annoying

#

Is dedmen not purely focused on perf branch for a3 then?

solid hearth
#

Shruge I briefly talked to him about it and he told me to let him know whenever it wasn't working, that was about it. I don't know much of what he is up to.

safe geode
#

blobdoggoshruggoogly Oh well, will have to see in the future, for now will just use REST

torn bane
#

I plan to have a look at server extension support and will certainly make an internal draft, but this is a topic for next year at the earliest. A post roadmap item so to speak.

Until then we have improvements to usability/bugs of the restapi designed already and hopefully are able to develop those soon.

I intend to also setup a public db proxy for common interfaces that would be used by the upcoming persistence functionality, so if you only want to test something or have low throughput data, you can just yeet some database somewhere and let my proxy give you the http communication to it. Self hosted proxy then once you exceed what I can give people for free or when you have sensitive data you don't want to trust me with.

solid hearth
#

It's not bad per se just annoying setting up an additional layer. Probably for the better in the long run though.

torn bane
#

From our experience, Tonic you will agree, most life servers for example ended up wanting to have some kind of custom admin panel anyway, or stats for their websites. So just db + game was only used by dev servers and those "i play with my 3 friends" nieche setups. So at some point you probably will want some kind of http app involved in your gamemode setup anyway

solid hearth
#

I'm not gonna lie, I was amazed that even a rest system existed in the game, just having that is a big step up from working on previous titles. Me personally though I'd like server-side extensions for a lot of reasons not just database but that's just cause i'm more comfortable with doing stuff in C++ and if I need very specific functionality I'd have that ability cute_smile_cat_meme

safe geode
#

Rest is awesome but niche things would be nice to have the extensions

#

But for sure a pist roadmap thing

#

There's more important stuff to handle first lmao

solid hearth
#

How InterceptAR initially started out is how I'd like to see server-side extension integration, with a few extras.

torn bane
#

We fully understand and just by the pure volume of devs who previously often wrote extensions as modders it is definitely a hot topic. Nobody is against it, but we have to see where it fits in terms of priority and how we do it. Do we just warm up RVExtension interface with a new name? Only allowing primitive data exchange via string? Do we maybe offer some headers to pass around strong c++ types like a vector or entity or component? Do we offer what was later added in A3 with the extension -> game active event push? They all have advantages and drawbacks.

And after all those things are considered we have to make things safer. A3 extensions were very easily exploitable by bad actors. Yes I know the server admin chose to install them themselves, but the amount of times people just follow a youtube guide, download data from some mega.nz link and unpack into their server directory on their home pc ... yikes. We try not to cripple power by putting up unreasonable safety nets, but if we see some new middle ground we might want to explore that. (Maybe scanning what apis the extension tries to acess or something, who knows).

#

I am not sure if the official support will go the way dedmen played around with. Maybe, maybe not. He tinkered around to see whats possible, but those approaches are high maintainence - and as thus no longer working.

ocean kernel
#

What kind of use cases are there that aren't actually better solved by http calls

torn bane
#

Writing gamemode logic in python @hearty oracle wideborkleftupsidedown, advanced log sinks, making use of mutli threaded calculations for e.g. "better ballistics" I think I saw in A3 at some point.

solid hearth
#

wait did RVExtension support python? Pls god no..

torn bane
#

That madman made a whole new gamemode in python yeah

ocean kernel
#

And it was probably easier than in sqf

solid hearth
#

so long as he didn't use a for loop....

torn bane
solid hearth
#

honestly it was probably faster than sqf LMAO

ocean kernel
#

Ah well it didnt cross my mind that those things are commonly done

hearty oracle
solid hearth
#

There was a lot done with extensions.

#

What we have now is more versatile than sqf and all of that jazz no doubt but there's still a place for allowing custom extensions. At least on the server-side, I don't think client based extensions should ever be a thing again that was such a terrible security hole not to mention a hassle because if I remember correctly you'd have to get some whitelisting done via battleye.

#

The only use case really for client-based extensions was ACRE and TFAR but honestly meh. Plus with things being cross-platform now a days it just wouldn't really be a thing.

#

Wait RVExtension got callbacks? aaaa that would of been useful...

pliant ingot
#

There is any function that returns position part in vector form from a transformation matrix?

ocean kernel
#

either call IEntity.GetOrigin() or just mat[3]

pliant ingot
#

So mat[3] returns origin for transformation?

ocean kernel
#

I think so

solid hearth
#

should be yes

#

should be the equiv of getorigin

pliant ingot
#

I need to get current position of current camera in current world, but only thing I found - returns transform

rapid ferry
pliant ingot
#

Also, what is coordinates returns ProjectionFromWorldToSvreen? It isn't pixels, I need it in form of SafeZone from previous Arma, so 0.5 in center and 1.0 in bottom righ and etc

#

There are comments that it returns some "reference" resolution, where I can find info about this "reference"?

pliant ingot
solid hearth
#

Look for a function called DPIScaling or something can't remember off the top of head but it should take in coords from WorldToScreen and spit out coordinates with the proper scaling

hearty oracle
#

there's still a place for allowing custom extensions. At least on the server-side

And it was probably easier than in sqf

honestly it was probably faster than sqf LMAO
FYI: All of the above sentences.
Besides the time spent on building the extension to write extensions ( because that doesn't count, right? 🥲 ), it was then much faster to write and do iterations of my code in Python that I would ever be able to do in SQF. Unit testing everything was also a breeze.

Using an extension (be it in Python or anything else) opened up the gates to use all the libraries already available for a given language. Do you really want to reimplement computing isolines in SQF, in a buggy way, when you already have numpy and matplotlib that have been used by thousands of scientists daily over the years with all the bugs ironed out by them, already? (I didn't)
Plus you get all the real mutithreading/multiprocessing speed improvements (yes, applies to Python as well).

_As a side note, I don't get the hate that Python used to get in a community using SQF, where types are nonexistent and speed is abysmall (and those who complain about indentation have never had any Code Review done at work, at a real job), but I don't want to start that discussion here 🤷‍♂️ _
@solid hearth @ocean kernel

Personally, I kinda understand the reasons for the lack of extensions for Enfusion (although it makes me a bit sad).
Especially if we now have a cross-platform system, forcing everyone to use the scripting language makes it easier to ensure everyone can play the same game (inb4 PS5 has no mods 😛 ).

However, it's nice to hear that there are options that are being considered to allow extensions in the future @torn bane 😄 👍

ocean kernel
#

They hate us cuz they anus

solid hearth
#

the real question is, have you tried plugging in data to train an ai then send back to make an ai 🤨

ocean kernel
#

I think someone eventually will find a way to train an agent to play the game and it will be fun to see

solid hearth
#

I ditched arma 3 well before things got interesting and I imagine having access to tensor libs and stuff there might be some interesting stuff you could achieve.

hearty oracle
solid hearth
#

oh jesus christ i'm getting old... I just realized I ditched arma 3 a decade ago

hearty oracle
#

Also, there's Arma AI, theres LLM AI and there's ML AI and all are called AI so I don't even know which one you're talking about 😅
(and even then, I'm not really proficient in either of these).

ocean kernel
#

Un/Serializing data really kicks some projects performance in the nuts

#

3458439 byte numpy arrays

candid garnet
hearty oracle
#

If there would be something that would not need passing data in and out of Arma, but would let you have a state on the extension/library side that you'd just incrementally update, then anything would be doable, I suppose

#

Otherwise, Intercept(AR)

solid hearth
#

I was more thinking towards ML, I just wouldn't even know where you'd begin trying to translate data to plug in. But I played arma 3 from the very start (the day alpha dropped) till 2015 then I ditched everything bohemia related entirely and got sucked into mmos.

dire sinew
#

There isn't really a good file format for storing matrices or data in general atm... At the moment I abuse config files for storing matrices I got from ML workflows 😅

#

Side effect is if anyone dares to open those in WB, it probably crashes it.

solid hearth
#

Given that it can crash just by opening and then closing it, yeah.. highly likely.

maiden goblet
rough flint
#

How are modded scripts loaded? Are they auto loaded?

torn bane
solid hearth
#

They're real sticklers about that but with good reason peepoPout

hearty oracle
#

Time to write a WASM intepreter in Enfusion Script 🤔

safe geode
safe geode
teal vapor
#

pretty sure if it needed to happen for something mods would need to go through msft's packaging/signing infrastructure which would greatly complicate things too

safe geode
#

Steamdeck ftw

#

Best console

safe geode
teal vapor
#

The Xbox security model basically defines that the security processor is the only thing that can map executable code pages, and that code must be signed by Microsoft. There’s one exception to this: the SRA VM used for applications can JIT because of Microsoft Edge and .NET applications.

#

Really good overview of it by one of the architects: https://youtu.be/U7VwtOrwceo

https://PlatformSecuritySummit.com/2019/speaker/chen

Every game console since the first Atari was more or less designed to prevent the piracy of games and yet every single game console has been successfully modified to enable piracy. However, this trend has come to an end. Both the Xbox One and the PS4 have now been on the market for close to 6...

▶ Play video
teal vapor
safe geode
#

This server has loads of mutuals I haven't seen in years, it's great

#

Good ol' Arma

late locust
#

How or where does the SlotManagerComponent register compartments if checked?
CompartmentManager only sees the ones directly on it
compartmentManager.GetCompartments(compartments);

late locust
#

Hmm nvm works now blobdoggoshruggoogly

severe jolt
#

does anyone have good resources/tutorials for scripting? The wiki seems to be very incomplete/bare bones right now

river imp
severe jolt
river imp
#

It uses the Entity/Component system.

#

Meet your new best friend.

severe jolt
#

Oh ok I'll dig through that. Thanks 🙂

teal vapor
# severe jolt I do know programming but I don't really understand how enfusion/workbench does ...

The official Bootcamp series is quite good: https://www.youtube.com/watch?v=Fgl_mAHReP4&list=PLfUcrRpCM_fKjkTrkV-bqnknVbFCPA3YU

I recommend watching the first two videos (Introduction to Enfusion, Modding Patterns and Workflow) and #4, User Interface and HUD. #4 still touches on some scripting stuff.

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
candid garnet
#

Also read up on ECS: Entity Component System

minor agate
river imp
#

All the samples you need.

gloomy lynx
#

does anybody know what script controls the list of entities in the bottom right in GM mode?

high hawk
hushed swan
#

Guys anyone know how i insert my logo hud in game?

river imp
#

HUD component on the player controller

safe urchin
#

Been stuck at this for over an hour now, Ive tried everything I believe in ActionsManagerComponents and on my script.. nadda. UI appears basic, action key and thats it. Was hoping tohave it with the progress wheel.

sick lynx
#

Hey
Have you got this working ?

versed remnant
#

Been stuck at this for over an hour now

quiet drift
#

Hello, I can't find the function to set the weapons that is hands back to the inventory or their slot I don't know exactly how that works, can someone orient me please ? I looked in CharacterControllerComponent and InputContext, CharacterCommandHandlerComponent, WeaponComponent and all the base class of those components.

static vale
rose siren
#

@rich pecan can you send me a friend request? I'd like to talk about your JIP issues if you're still having them.

random moat
#

Is there a script invoker i can use that i put on the projectile or the weapon that triggers when fired?

ocean kernel
#

I like doing stuff like this inside a scripted aim modifier

#

I mean you could still have it on a component in the weapon, but the actual fired call could come from the aim modifier

#

Or muzzle effect component I think as well

random moat
ocean kernel
#

Inside bacon ravage there is a scripted aim modifier that gives zombies infinite ammo

#

Maybe that could give you some ideas

cunning wharf
#

Hi. Is it possible to override private variable to protected?

[Attribute()]
private FactionKey m_sFaction;

I tried to think how can I intercept this value and update it in runtime while initialization, but seems this is impossible!

#

Modded class can access private method but not variable...

pliant ingot
# cunning wharf Modded class can access private method but not variable...

what? just write now and it works (m_bIncludeMe is private)

modded class SCR_AIDebugTask {
    void SCR_AIDebugTask() {
        m_bIncludeMe = true;
    };
    
    bool MyFunc() {
        return m_bIncludeMe;
    };
};

Original:

class SCR_AIDebugTask : AITaskScripted
{
    [Attribute("0", UIWidgets.CheckBox, "Message prefixed with ref to self")]
    private bool m_bIncludeMe;
hushed swan
#

I downloaded a mod and it's the only one I can't see in Arma Reforged Tools, what could be happening? I have already scanned the project

pliant ingot
hushed swan
#

@pliant ingot I go to existing project and import gproj but it still doesn't appear in Enfusin Workbench projects

cunning wharf
#

This didn't compile for me.

#

says variable is private. And also documentation doesn't say that private variable can be accessed from modded class.

pliant ingot
pliant ingot
cunning wharf
#

maybe some lag...

minor agate
#

Or on the wrong constructor override

jolly fiber
#

have any of you guys done anything with scripting for cinematics? @minor agate ive watched your installments a few times but scripting is over my head. Im a cinematographer and i really wish the learning curve was not as steep as it is. i would love to be able to learn this a little easier purely for makeing cinematics for my future content.

hushed swan
#

How do I get specific dependencies from another mod and not use it completely?

sweet badger
cunning wharf
#

Not possible access private variable of original class inside modded class.

dire sinew
cunning wharf
dire sinew
#

They all have getters. Use the getters!

cunning wharf
#

This is different code with setter

#

lol

#

please see the picture first

dire sinew
#

Read the error. It's triggered by the code in the left window, not the one in the right!

cunning wharf
#

This why I asking developers why is that.

#

Try it yourself, try to add a setter method to this class
SCR_EditableEntityUIInfo

#

Then If you have something we can talk. Otherwice is useless, sorry but obvious.

dire sinew
#

Oh wait, I see what is happening. If you generate an instance of a class inside a method of it, you can access protected and private members.

#

Not sure why you get the errors then

cunning wharf
#

You saying you have different behaviour in workbench than I do? lol wtf

dire sinew
#

No, I haven't tested it yet, but what is your ultimate goal?

#

You have to be careful of what you are trying to do. The UI info is shared by all instances, so if you want to change it for a specific instance, it won't work that way.

cunning wharf
#

Some mods like RHS has set some custom faction like "AS_RF_blabla" instead of US or USSR
So I need script to update this on Initialization moment so all the vehicles to be added in Conflict Depots

#

Something like that.

#

I have tried to override this method. It is good enough place for my double "If" statement.
But this is impossible too.

dire sinew
#

Yeah, I can reproduce it. Looks to me like modded breaks accessing protected/private variables this way...

river imp
#

UI Infos aren't meant to be altered at runtime.

minor agate
#

Seems like a new bug

minor agate
dire sinew
#

So I guess what you could try to do is override CopyFrom and use your getters

minor agate
dire sinew
#

might need a hard-override though

river imp
#

Also not my point but, thanks for the info

cunning wharf
#

I'm trying to override the method of a class. I havent change anything except "override" instead of protected.
And this also throws the same errors at compilation...

cunning wharf
dire sinew
#

I think hard-override is the only possibility right now

river imp
#

My point is literally that, UI Infos aren't meant to be altered at runtime.

minor agate
#

Ignoring the protected or private in your override mods them to become public

#

If you ignore them, you make them public

cunning wharf
minor agate
#

Same if they were protected and you did override private ...

#

You would make them private

#

And vice versa

dire sinew
#

Though restricting access almost certainly will break something 😅

cunning wharf
#

Waiting for a new version. Before that happens all prefabs with this component need to be overriden manually to adapt their faction to your factionKeys...

dire sinew
#

Again, you could make a copy of SCR_EditableEntityUIInfo.c. Files that have the same path and name in your mod complety override the vanilla one.

cunning wharf
#

How to achieve identical path?

dire sinew
#

Yes, I've done it a couple of times in the past.

#

Just copy the file to your mod and keep the same name

#

The mod folder isn't relevant for whether the paths are the same.

#

Though from what I remember, you may still get a lock on your file in the script editor, so you may have to temporarily rename it for editing and then rename it back.

dire sinew
#

Generally, I would only use this approach as a last resort, as it is less maintainable. Basically you have to check after every update that BI didn't change the file.

coral stirrup
#

Hey all, wanted to report something that seemed to change with the script garbage collection sometime around 1.3.

Im the main developer of Overthrow and we use Arkensor's amazing Persistence Framework to persist the world and up until 1.3 it worked with no issues whatsoever.

After 1.3 it seems that during shutdown (which EPF catches and blocks in order to perform a save) some managed class member refs are already destroyed by the time we try to save them. Namely ref map<string,ref object> types. Its intermittent and we have tried everything to provide a solid set of replication steps in order to submit a formal bug report but have failed. So just wanted to mention it here as something for bohemia to be aware of. We will continue to try and narrow it down with replication steps as well as obviously try to exclude EPF itself (or us) as being the cause.

#

if any enfusion devs may know off the top of their head what change in 1.3 may have caused this (including any workaround ideas) please @ me ❤️

craggy jolt
#

I'm failing to figure out what sets "Global supply usage" to "Yes" in Conflict missions but its "No" by default in an MPTest. I see that its set by SCR_EnableGlobalResourceTypeEditorAttribute but its not referenced anywhere but in Edit.conf

teal vapor
craggy jolt
#

Matches are Edit.conf, SCR_RespawnEnabledEditorAttribute and the class itself

minor agate
#

As scripts do not have meta files

minor agate
coral stirrup
#

yes I speak to him, hes aware and has also been looking into it

#

I found a likely culprit today that we are testing

minor agate
#

If you are using it, and you do not want it to die while EPF is being destroyed then ref the map somewhere were you are using it

#

Otherwise it will be destroyed. Same deal as smart pointers

coral stirrup
#

yeh its reffed on a component on the gamemode entity

#

but I think EPF is sometimes providing a different component

#

Im trying to reference the singleton version of it directly now

#

so might not be a problem with enfusion

minor agate
#

Ref manafement has not chsnged. There is no GC per say

#

Nothing smart or fancy about it

#

Its just a counter on the class that deletes the class when it reaches 0