#enfusion_scripting

1 messages · Page 13 of 1

neon elbow
#

Maybe something like

    Vehicle myFavoriteVariableName = Vehicle.Cast(GetGame().GetWorld().FindEntityByName(UAZ452_ambulanceMOD1)); 
    SlotManagerComponentClass myComponent = SlotManagerComponentClass.Cast(myFavoriteVariableName.FindComponent(SlotManagerComponentClass)); 
    EntitySlotInfo mySlotInfoName = EntitySlotInfo.Cast(myComponent.GetSlotByName(RearCargo)); 
    mySlotInfoName.IsEnabled() = false;
```?????
#

If you need help with setting up a user action (Zelik is right, WE really need a video on simple enforce script stuff that we can reference later lol) feel free to ask.

fringe prairie
#

Appreciate this, had a non working codec that came to life when I swapped out the helpers with raw manipulation.

humble saffron
# neon elbow If you need help with setting up a user action (Zelik is right, WE really need a...

Nice; thank you very much! You already pointed me some really nice spots to start paying more attention to. 😉
I have NOT yet messed with anything related to actions -> scripting here in Reforger - just ordinary actions for compartments/seats stuff.

I will spend some shots using all that data you have posted, at least to see until where can I reach, and bring any eventual results here as a report, ASAP, regardless they take me somewhere or not. 🍻 😎

restive island
#

I'm learning the scripting side of Reforger. Is there a tool that can map out, in a flow chart, what script action calls what from other parts of Enfusion? Kind of like how Neo4j works graphing related components together.
Example: If I open the class for switching to a weapon it visually graphs out the associated scripts for audio, physics settings, gun attachments, ammunition type, etc. I'd like to see whats called and the order

west prism
#

u have sickness chance but when u sick what i have to do? Medicaments ?

desert escarp
#

👍

high hawk
#

Jesus

craggy jolt
#

Is finding a component on entity and making it check few bools a good fit for "light-weight filtering" of filterEntity in BaseWorld.QueryEntitiesByOBB?

solid hearth
#

I can't imagine its the worst, how often is it running?

craggy jolt
#

Not very often, I guess it should be fine

solid hearth
#

Then it'll be fine, there's a few places in "vanilla" code doing similar or more, so long as you're not doing a query per frame and doing some more intensive things like on the fly calculations etc it shouldn't hinder anything. Doing base checking against a bool, cast checking etc are more or less near instant and lightweight.

#

Just for throwing it out there in my early code I do far more egregious stuff in there looping over thousands and don't even notice it.

craggy jolt
#

Yeah, trying to be as cautious as possible right away

solid hearth
#

You ain't in arma 3 anymore we don't have to penny pinch for performance at every corner pepePoint but if it seems really bad in your head then its probably bad in play.

craggy jolt
#

Hope so, wondering if Enforce is really faster with all its OOP and type casting

solid hearth
#

It's a step up from RV but its only as fast as replication will allow it. Once you start to cram a bunch of people into a small area things go south real fast, for the server that is.

minor agate
minor agate
#

It's just how the game is implemented and how heavy certain things like AI, Character simul, etc are

#

On top of how other scripted systems are implemented.

#

But these things are being optimized so it should get better over time.

torn bane
#

Oh if you do not want the records to exist at all anymore you call Delete on the persistence component of the thing that shall no longer be tracked

west prism
#

Are there any jerry cans in the base game, or do I need a mod?
Does anyone have experience with adding a jerry can without using a mod?
Which components do I need to add to the prefab?

craggy jolt
#

There is and it can be useful to fuel vehicles, you get them at vehicle stations in Conflict

craggy jolt
#

Dont think they're confict specific

west prism
wild glade
#

Hi, does someone have an idea, how I can apply a material like this on an entity? I can't really find a way to dynamically change the material on an entity

analog pivot
#

Is it possible to override fields or do I have to override every method that uses the field?
Or is there another better approach to just change fields.

I would like to change the value of m_bIsDeleteRestricted and m_iPlacedMarkerLimit in SCR_MapMarkerSyncComponentClass

wild glade
#

Hi, does someone have an idea, how I can

fringe prairie
#

You can add a breakpoint and see what is triggered afterwards by jumping in/out

fringe prairie
#

But it won’t show everything
Because a lot of stuff is game code like animations, but animations are visual, and those can be debug too via other animation workspace that corresponds to what you’re trying to look at

west prism
#

try add AI

wild glade
#

does someone have an idea why SCR_EntityHelper.SnapToGround is not working here? The entity still spawns in the air

LB_HideoutSupplyStorage depot = LB_HideoutSupplyStorage.Cast(GetGame().SpawnEntityPrefab(prefabRes, null, LB_Utils.GenerateSpawnParameters(m_transform[3], m_spawnRotation)));

if(!depot)
    return;

SCR_EntityHelper.SnapToGround(depot);        
wild glade
west prism
west prism
#

dont attack AI

desert escarp
#

Place one in your world

west prism
#

navmesh is also done

west prism
#

added waypoint but they still dont move dont shoot

torn bane
#

You should watch the Ai tutorial as part of the bootcamps we have on YouTube

little anchor
#

Hello I want to get the preview of a prefab thanks to its resource (it's for a veh) how can I do?

little anchor
abstract crescent
little anchor
west prism
#

i changed their Faction still dont shoot

spark otter
west prism
#

the zombies also dont attack me

#

should they attack in enfusion tools?

inland bronze
inland bronze
#

@minor agate will the files for the Advanced Replication Bootcamp be released on GitHub? I believe something was mentioned about it in the video, but I couldn't find them

molten glacier
#

I have a script for a mod I have that has been Hit and miss.

It spawns skirmish events based on player position and time passed

Sort of like how Far Cry works. But I cannot get this thing to work right even though with the laws of workshop it should work.

Anyone willing to chip in and be credited?

tacit sundial
#

Beginner question here, I would like to create a new game mode for Arma Reforger. I figure that learning how World Systems work would be a good place to start.

I've been following the documentation here: https://community.bistudio.com/wikidata/external-data/arma-reforger/EnfusionScriptAPIPublic/Page_WorldSystems.html#WorldSystemDocs_CreatingAndUsingWorldSystem

I have:

  • Created the HelloWorldSystem
  • Added it my config file
  • Added the config to my addon "System Module Settings" as an additional config

I then opened the World Editor, opened Arland.ent, set my "Work Systems Config" to my addon config, and started the game.

However I am not seeing the log lines I would expect to see if the system was loaded. Anyone got any hints?

restive island
#

Any idea if there plans for a game update to add *finite fuel * in the mobile fuel depots? Trying to implement it as my first mod

little anchor
abstract crescent
onyx widget
#

Has anyone looked in to, or better yet succeeded at getting the reforger debugger working in Proton?

Also, much of the code analysis features (jump to def, list syms, etc.) are LSP features... anyone know of there's any chance they're somehow exposed via the network iface blender uses for purposes of external editor integration?

craggy jolt
#

Is there a way to find if object has any colliders? Couldn't find much in VObject or MeshObject.

#

Need to know if object can be freely moved through

visual widget
craggy jolt
#

Through script!

minor agate
# craggy jolt Through script!
if (entity.GetPhysics().GetNumGeoms() == 0)
  // Do something if there are no physical geometries on the entity.

Just beware that other things are at play like the interaction layers and all that that coulda ffect if the geometries behave freely movable within the world.

There is also the case where the entity itself might not have geometries, but attached children could.

wild glade
#

Hi, is there a way to force a specific order for children of a prefab? I tried renaming/numbering them, but when I save the prefab, they turn back into their original names

minor agate
#

There are no named entities in prefabs themselves

wild glade
craggy jolt
craggy jolt
#

Thought there would be more tools to check XOB properties 🤔

minor agate
#

The component is just there for fast configuration through prefab

#

Geometries can be created at runtime, even as modder with the Physics API

craggy jolt
#

So, is there a reliable way to know if object has any collider geometry in it?

craggy jolt
#

Doesn't work with all entities though

#
if (!entity.GetPhysics() || entity.GetPhysics().GetNumGeoms() == 0)
```then?
minor agate
#

Yes

dire sinew
#

What method/event can be used to detect that an entity gets streamed out locally on a client?

#

Apart from destructor.

torn bane
forest arrow
#

SCR_ScenarioFrameworkSlotClearArea
slotClearAreaComponent.m_aPlugins.Insert()

How to create instance of plugin? Or how to insert plugin to component from script?
For example, this plugin SCR_ScenarioFrameworkPluginTrigger

torn bane
forest arrow
torn bane
#

It will probably work, but not every property might be exposed to script to be set after the system init and behave like it should. you will have to test and see

forest arrow
torn bane
#

what is configured from the world edit is just instances of it too. so you can in theory just create a new instance with "new" or if something is an entity/component then spawn the relevant SF prefabs for those yes

forest arrow
#

okay, thanks. will try

sleek moat
#

can you make an entity visible to a specific player but not others? without using a local entity

torn bane
sleek moat
#

hm okay, would setting visibility flag either visible or not for what needs to be seen by who be an option too?

valid anchor
#

I'm encountering an issue where, onplayerconnect users aren't seeing capture area markers in the HUD, despite the map marker showing and the capture area being active.
It seems to be a timing issue with initialization/registration. Areas are "start active = false" by default and then I activate the areas as required via script. But this causes users to wait for next activation to initiate HUD update if they connect mid way through an already active area.

Is there a standard call for ensuring the player hudmanager syncs with server after connecting?

molten glacier
#

Been fist fighting a dynamic encounter event system that spawns 4-6 US troops and 4-6 FIA troops 70 meters in front of the player 1 ft above ground to create far cry like experience for solo players and for the life of me I cannot get this thing to work…

I am running it to call to SCR_BaseGameMode (I believe it is verified in the script) do I have to call to all conflict modes or the map?

The script now just runs from player location.

#

I even did a spawn then teleport to location and nothing.

ocean kernel
#

What happened to TryPerformResourceConsumption? It returns true but the amount of supply is never deducted

steady steppe
#

I happen to hit a REST rate limit with simple requests [from Reforger server to our API]

        RestContext context = GetGame().GetRestApi().GetContext(sContextURL);
        string headers = string.Format("Authorization, Bearer %1", sAPIToken);
        context.SetHeaders(headers);
        context.POST(m_restCallback, "", sData);

But neither are requests too large (~1kb), nor plenty (40 req/s). Dokumentation states size limit of 1MB (https://community.bistudio.com/wiki/Arma_Reforger:REST_API_Usage), but no rate limit.
Do you have ideas? Error is below.

DEFAULT   (E): Http :: Failed to queue up request, request limit reached for host https://xxx-xxx.de 
BACKEND   (E): Http Error (CREATE)
BACKEND   (E): [RestApi] ID:[1110481] TYPE:[UNKNOWN] Error - Cannot send request
molten glacier
#

Now for tweaking.

fringe prairie
#

Why might a context appear as yellow within the context debug?
(Not shown, but examples are here)
I am not sure what makes a context yellow, does it mean it doesn't currently have a value set? Or something else (like another context is taking priority?)

torn bane
# steady steppe I happen to hit a REST rate limit with simple requests [from Reforger server to ...

If I am reading the code correctly there is a maximum of 64 pending requests allowed per context. Once a request is done it would not be an issue, but sending multiple that wait for timeout to fail etc could lead to an issue. Workaround would be to open multiple contexts for more specific base url, so you can have 64 per rest resource - or ideally queuing up your requests so you do not attempt to send more than 64 at a time before they are answered.

valid anchor
ocean kernel
#

Can we set the timeout?

ocean kernel
#

Is there some simple way of eating supplies from scripts that works every time, assuming supplies are available?

restive burrow
#

Hello I have artillery mod and would like to attach a Ai dummy to it so the killfeed will read Artillery Strike killed - …. Could someone point me in the right direction. Should this be done though scripts only or do I mess with the components?

restive burrow
west prism
#

how can i add server uptime timer like fps or ping or just use an item actionmenu?

steady steppe
steady steppe
steady steppe
ocean kernel
#

I wonder if its async and my usage is special because the player character is deleted a few frames after the consumption occurs

forest arrow
#

When I'm create SCR_BaseTask from script, I can see it on map, but cant see this layout for task notification, when task started and finished. What I missed?

string taskResourceName = "{CD66837DD5606573}Prefabs/Systems/ScenarioFramework/Tasks/TaskKill.et";
SCR_TaskKill task = SCR_TaskKill.Cast(GetGame().SpawnEntityPrefab(GenerateAndValidateResource(taskResourceName), null, GenerateSpawnParameters(mainPosition)));
task.SetTitle("My task title");
task.SetDescription("My description");

    task.Create(true);
    task.Show(true);
fringe prairie
#

Is there good practice for getting RplId from RplComponent from a sister component on init? Such as when I want to pass it to a system when registering? If I do it EOnInit it is too early so RplId is invalid, right now using a CallLater, then registering

#

¯_(ツ)_/¯

craggy jolt
#

Is there a way to trace against actual collision geometry of objects? I need to know if cuboid doesn't touch any colliders

#

So far tried BaseWorld.QueryEntitiesByOBB and BaseWorld.TracePosition+TraceOBB but these seem to be the same thing, playing around with flags didn't get what I want

ocean kernel
#

TraceMove?

craggy jolt
subtle sparrow
#

I created a conflict scenario and when i press play i get this script error any idea what it could be?

craggy jolt
#

@minor agate Master Sensei, plz give advice on tracing against object geometry 🙏

#
    TraceOBB trace = new TraceOBB();
    trace.Mat = {cubeMat[0], cubeMat[1], cubeMat[2]};
    trace.Start = cubeMat[3];
    trace.Flags = TraceFlags.ENTS;
    trace.LayerMask = EPhysicsLayerDefs.FireGeometry;
    trace.Mins = mins;
    trace.Maxs = maxs;
                
    world.TracePosition(trace, TraceCallback);
```My latest trace, flags nor layer help either
minor agate
craggy jolt
#

The data is correct, it returns all objects that touch this cuboid with their OBBs, but I need to make it more thorough to check against their geometry (view, fire, any), instead of entire OBB

#

Current results: TV's OOB intersects rubble OOB while they're far from touching either other

#

I'd need to test OOB\Cuboid against collider geometry (like FireGeometry)

minor agate
#

filtercallback is for getting possible entities to filter

#

It's there to optimize the trace

craggy jolt
#

oooh

#

There is TraceParam.TraceEnt

minor agate
#

You return false on the filter when you have found the one

#

Then the trace will perform the more expensive checks

#

and return it on the TraceParam TraceEnt

craggy jolt
#
    trace.Flags = TraceFlags.ENTS;
    trace.LayerMask = EPhysicsLayerDefs.FireGeometry;
```finds nothing though,
trace.Flags = TraceFlags.ENTS;
trace.LayerMask = EPhysicsLayerDefs.Default;
minor agate
lean yew
#

What is the canonical way, in code, to check whether a player is a leader of a squad?

#

@minor agate As you appear to be active

minor agate
#

I know more of base game systems or engine stuff

lean yew
#

Who would know? I currently use int leaderID = playerGroup.GetLeaderID(); but it appears to not work sometimes

#

Currently I'm comparing this value to the LocalPlayerID

forest arrow
#

When I'm create SCR_BaseTask from script, I can see it on map, but cant see this layout for task notification, when task started and finished. What I missed?

string taskResourceName = "{CD66837DD5606573}Prefabs/Systems/ScenarioFramework/Tasks/TaskKill.et";
SCR_TaskKill task = SCR_TaskKill.Cast(GetGame().SpawnEntityPrefab(GenerateAndValidateResource(taskResourceName), null, GenerateSpawnParameters(mainPosition)));
task.SetTitle("My task title");
task.SetDescription("My description");

    task.Create(true);
    task.Show(true);
ocean kernel
#

Mario if I try request consumption of supplies and then delete the player character a few frames after does it make the consumption fail?

ocean kernel
#

All server

minor agate
#

If so, then if the deletion happens before the next fixed frame (Which is when the Rpl Scheduler processes what is queued for RPCs, Attributes, etc) then it will be an issue

minor agate
ocean kernel
#

I request consumption and then delete the character a few frames later. I request consumption the same way for picking up items from arsenal and it works correctly, but requesting it for loading a player loadout (which spawns new controlled entity) seems to never subtract supplies from the box

steady steppe
forest arrow
#

Any guide how to create task with layout notification about task start\finish?

fringe prairie
# minor agate Auth or proxy?

Auth.

Also, I have an issue where my instance might be null when calling Extract method for replication on server. What could cause this when it should definitely not be null, or to guard a situation which it is null to avoid a VME? Away from my computer so I can’t send the codec here now.

analog python
ocean kernel
#

FixedFrame is how often?

craggy jolt
ocean kernel
#

Ok I give up on this for now, I call TryPerformResourceConsumption in one place it works in another place it doesnt work

#

Returns true though

#

true == false I guess

#

Why return true if consumption of supply didnt work?

craggy jolt
#

Tried? True!

ocean kernel
#

Bro I swear

ocean kernel
#

do I really have to restart workbench every time I make changes to chimeraInputCommon?

fringe prairie
fervent cedar
molten glacier
#

Dumb oversight moment. Have a script dependent on player position. Didn’t add a retry loop so when there is no player on the map since all Arma modes start with a deploy screen the script just closes itself.

ocean kernel
#

Mario y u do dis to me

#

I wish I knew why my action isnt working, perhaps another context is eating it but I dont know which one

fervent cedar
ocean kernel
#

I have 3 inputs and 1 of them aint working

#

well, 3 actions

#

so I think something might be eating it

#

but I cant find it in the diag thing

fervent cedar
#

I had some issues I deleted the file and createdd override again and copy-pasted the stuff back in text editor

#

I don't even use the config editor it's so hogwater, just text editor

#
ActionManager {
 Actions {
  Action HCA_CM_CharacterSpeed_Toggle {
   InputSource InputSourceSum "{}" {
    Sources {
     InputSourceCombo "{}" {
      FilterPreset "click"
      Sources {
       InputSourceValue "{}" {
        Input "keyboard:KC_LCONTROL"
       }
       InputSourceValue "{}" {
        Input "keyboard:KC_C"
       }
      }
     }
    }
   }
  }
  Action HCA_CM_Toggle_AutoWalk {
   InputSource InputSourceSum "{}" {
    Sources {
     InputSourceCombo "{}" {
      FilterPreset "click"
      Sources {
       InputSourceValue "{}" {
        Input "keyboard:KC_LCONTROL"
       }
       InputSourceValue "{}" {
        Input "keyboard:KC_W"
       }
      }
     }
    }
   }
  }
 }
 Contexts {
  ActionContext CharacterMovementContext {
   ActionRefs +{
    "HCA_CM_CharacterSpeed_Toggle"
    "HCA_CM_Toggle_AutoWalk"
   }
  }
 }
}
ocean kernel
#

is there docs on what the filter presets are and wat they do?

fervent cedar
#

I think they change the picture in keybind menu

#

and tooltip and stuff

ocean kernel
#

Oh yeah

clever oxide
#

hmm my presets is:
FilterPreset "primary:click"
FilterPreset "gamepad:hold"

minor agate
ocean kernel
#

I just used different action that uses same button and its ok now

#

What I do NOT know how to figure out is whats up with the resource consumption issue I have

minor agate
ocean kernel
#

SCR_ResourcePlayerControllerInventoryComponent.TryPerformResourceConsumption returns true but never actually removes any supplies

minor agate
#

Container or Consumer?

#

(I have a hunch it is consumer)

#

Have you called EnableConsumtion(false) on the consumer anywhere in your code?. Or in the loaded addons?

ocean kernel
#
float cost = 100;

SCR_ResourceComponent resourceComponent = SCR_ResourceComponent.FindResourceComponent(arsenalComponent.GetOwner());
SCR_ResourceConsumer consumer = resourceComponent.GetConsumer(EResourceGeneratorID.DEFAULT, EResourceType.SUPPLIES);

auto resourceInventoryComponent = SCR_ResourcePlayerControllerInventoryComponent.Cast(GetOwner().FindComponent(SCR_ResourcePlayerControllerInventoryComponent));

bool success = resourceInventoryComponent.MyWrapperForTryPerformResourceConsumption(consumer, cost);
#

The reason this is baffling is that it doesn't work in method A but works in method B

minor agate
#

What is in MyWrapperForTryPerformResourceConsumption?

ocean kernel
#
bool MyWrapperForTryPerformResourceConsumption(notnull SCR_ResourceActor actor, float resourceValue, bool ignoreOnEmptyBehavior = false) {
        return TryPerformResourceConsumption(actor, resourceValue, ignoreOnEmptyBehavior);
    }
#

Its protected

#

😄

minor agate
ocean kernel
#

I'd rather not

minor agate
#

Is this the arsenal being method A, and spawn thing method B?

ocean kernel
#

Right. The one that works is spawning items into the player's pockets. The one that doesn't is replacing the controlled entity. I guess I'll have to go over them side by side and see if there's some stupid mistake in one of the parameters or something.

minor agate
#

You said all this on auth right?

ocean kernel
#

Yes

minor agate
#

Then it is most likely not an issue from player controller but some setup

ocean kernel
#

I better check if it's using the correct player controller entity too

minor agate
#

wait. Is this using a consumer that is on the player?

ocean kernel
#

SCR_ResourcePlayerControllerInventoryComponent is on the player controller

minor agate
#

Yeah this is just for RPC stuff

ocean kernel
#

Consumer is the arsenal

#

Right?

minor agate
#

SCR_ResourcePlayerControllerInventoryComponent sole purpose was to be able to RPC stuff from client interacting with inventory interactions for supplies

#

That is it. it does not have any other purpsoe.

ocean kernel
#

Wat is the best way for me to just eat supplies then

minor agate
#

Just get the consumer. And RequestConsumption method on it

#

It's safe, should always work

ocean kernel
#

Wow I overcomplicated this to heck then

minor agate
#

And for generation. RequestGeneration on generators

ocean kernel
#

RequestConsumtion pain

#

SetDammage

minor agate
#

If you want to only check, then just do RequestAvailability method on all

ocean kernel
#

It returns a nice response struct

#

Oke doke I will try that then thank you duckbongo

minor agate
vernal sphinx
#

Hello, I'm new to using the Enfusion Workbench, so I'm sorry if I'm asking a question about something that has been answered time after time, how ever I cant find any answers in the plethora of discussions in this discord.

- Concept
I'm attempting to make my own conflict remix.
I don't want FIA on the map anywhere.
I want USSR to be REDFOR.

- Question
Is it a script that changes these things, or is it in a manager setting that needs to be changed?

desert escarp
#

Is there a way to see the amount of ram usage or overall performance of my mod in the debug menus?

red cedar
vernal sphinx
red cedar
#

Fair enough 👍

You need to reconfigure it and replace it in the world. It’s not very difficult

vernal sphinx
#

Im like 2 hours into using enfusion workshop...so not very difficult is just unknown to me

#

Which channel would be best for talking about the faction managers?

ionic pewter
red cedar
#

I hate how LAGGY the workbench is whenever i use a peertool client

#

it literally crashes my whole PC ever since the 1.3 update

valid anchor
#

So hassle to test client side only changes and upload every time

#

And have the upload hang 90% of the time

minor agate
#

For that just launch your mod on a server locally and connect to it

#

No need to pack it even

#

You can do it within workbench itself as well through DS tool

valid anchor
#

Is there a setup guide? I couldn't use the reforger dedicated gui from github cause I use starlink and couldn't connect via peer

#

cause that sure would make testing client/server changes a lot easier lmao

valid anchor
#

the soda3x server tool

minor agate
#

Ah dont expect support from us on 3rd party tools

valid anchor
#

yeah idc about that tool, i just dont know how to do it within workbench

#

is there any resources for setup?

minor agate
#

On youtube

valid anchor
#

cause I spent a whole day trying to work out why my updates weren't reflecting correctly and then realised it's server only replication not client (literally explained in the first 20 minutes of bootcamp 1 lol)

#

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

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

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

▶ Play video
#

Dedicated server tool setup guide timestamp

digital needle
#

is there a script to activate von when unconcious?! an override of the gamemode prefab somehow doesnt work for me

red cedar
#

i'm just testing one of my script really quick

digital needle
#

thank you!!

red cedar
digital needle
#

thanks! i did that but it didnt work..i'll try to find the issue

red cedar
#

make sure you save and that the your game mode entity is correctly in the world

valid anchor
shrewd nova
timber cipher
#

Dont even know if im looking in the right area and its been a week of watching tutorials that dont go over anything to do with character movement, is editing this in scripts even doable? My exp is with mapping but had an idea for a movement/stamina/weight mod and idk what the deal is never had an issue making changes of already existing systems but still new to enfusion and minimal exp with scripting so is anyone able to correct how im going about it or point me in the right direction?

calm wren
#

Hey, does somebody know how to Save to variable Player items in EPF, and then restore it at some point?

narrow aspen
#

well guys, how can I spawn/delete entity through user action? I have write a demo works fine locally but not work on dedicated server. I am sure I missed something related to replication.

#

My requirement: in user action: insert/remove resourcename in server-side json file and delete/spawn entity

digital needle
spark otter
valid anchor
fervent cedar
#

What exactly do you have in mind?

red cedar
narrow aspen
minor agate
#

Should be removed

valid anchor
#

When I use this in fullscreen or viewport and press play with peertool selected, it just opens as normal, not with DS tool. I have to open DS tool and press run to use that

narrow aspen
west prism
#

Hello need help with "The player is unconscious"
"The player is lying down for a few minutes and can’t do anything. Is it possible to configure this option? If yes, which script or prefab should I modify to change this behavior?"

red cedar
valid anchor
#

You work this out?

craggy jolt
#

no

valid anchor
#

Currently working on it and came in to same issue, box with SCR_UniversalInventoryStorageComponent item contents spawn on world init, but not if triggered via script.

west prism
# red cedar I’m not sure what you are looking for… but the game mode health settings compone...

✅ How to Make Players Get Up Faster
Setting Suggested Value Purpose
Permit Unconsciousness ✅ (Enabled) Enables unconscious state
Kill Indefinitely Unconscious... ❌ (Disabled) Prevents auto-death
Regeneration Delay 🔽 2.0 – 4.0 Starts healing earlier
Regeneration Scale 🔼 2.0 – 5.0 Faster health regen while downed
Compartment Regen Multiplier 🔼 1.5 – 3.0 Speeds up healing of individual zones

#

i dont need it in gamehealth i need script or prefab of unconscious

#

Regen here its not only for unconscious

red cedar
west prism
#

i cant find this one

#

ifound allready morphin script and rewrited but now need for unconscious

valid anchor
#

right click the "permit unconciousness" in the component and locate to script definition

west prism
#

i have no idea what is script name for unconscious

valid anchor
#

probably find it there

red cedar
#

if you return false he'll be back up

west prism
valid anchor
# craggy jolt no

I added custom components to the overriden prefab, and after spawning it in, the components weren't detected, pretty sure it's spawning in the base prefab

oblique lynx
#

Hi, I am wanting to make a digital Speedo for a vehicle, I think it's possible using the UI maker but not quite sure how to go about it

valid anchor
west prism
#

need help with nvg helmglitch

#

now have 2 helms on 😄

ocean kernel
#

why GameAnimationUtils.ShowMesh no worky with valid mesh index

inland bronze
ocean kernel
#

wtf

#

ok let's find out

#

Yes that's it, it appears you need joints in order to be able to hide things that aren't joints

#

Thank you

spark otter
sleek dove
inland bronze
#

As I was using a vanilla mesh for my case that had no bones, I ended up just swapping it to an empty mesh in script. Maybe you could do similar if needed

west prism
#

I installed Zeliks_Zones.

I created a safe zone — is it possible to deactivate shooting there so people can’t shoot inside it?
And if possible, can damage to vehicles be disabled as well?

Can anyone help? Vehicles are exploding because people keep shooting them, since the safe zone doesn’t block that.

Thanks for the support!

spark kernel
#

I was wondering if it possible to have a script that turns of lights in an area, whether that would be all lights withing a layer or with a certain name. I wanted to be able to destroy a substation and then it takes out the lights for the area? Is this possible already? or is a script needed?

sweet badger
#

any update on this bug, do you know what causes it yet?

minor agate
#

I strongly believe those helpers should be removed

sweet badger
minor agate
desert escarp
#

Is there any performance difference from either method

minor agate
#

Do not use the helpers WriteXXX, ReadXXX

desert escarp
#

But if we use those right are they not just the same thing

sweet badger
# minor agate In general for any issue from JIP

But presumably the RequestScenarioChangeTransition JIP error would not be related to that, right?
Since it "randomly" occurs when switching scenarios and was introduced with a vanilla update.

minor agate
#

Because the ReadInt, ReadRPLId, etc they compress the data, if they see the RplID is mostly zeroes, it stores it in 3, 2 or 1 byte

#

But on read, it causes issues

desert escarp
minor agate
#

And this is really dependant on chance of the given data being like that

desert escarp
#

Okay makes sense

minor agate
sweet badger
sweet badger
#

Is that not just a design oversight with Write?

minor agate
#

For bool, it makes sense because you can always do 1 bit

#

string, yeah to simplify it

sweet badger
#

Does this issue also affect the Write/Read Range methods?

Compression uses only as many bits as necessary taking the range defined by {min..max} into account.
This sounds like the bits would be defined exactly when specifying a range.

minor agate
#

if min and max both land on the same byte count, then no issue

#

These helpers only work nicely when you have no serial data

#

like when you store a single value only

#

But when you do multiple in serail, that is an issue

forest arrow
#

Hello. Any guide "How to create task?" Or code snippet?
I have created, it works in workbench, but not in game, cant see it on map

maiden goblet
#

Could I ask you guys to leave client rest API calls in the game for PC? Had some mod ideas that would involve client downloading large datas over HTTP while they play.

torn bane
maiden goblet
pliant ingot
pliant ingot
#

if you remove these helpers then modders will create them, but because it's no more in core game, then it will be in each mod, some better some worse

pliant ingot
#

I strongly believe those helpers should be removed
🤷‍♂️

minor agate
#

Can't be done as it breaks mods

#

If anything make them work without the compression thing

#

(For those modders that do not want to worry about the size of primitives)

ocean kernel
#

Brother vanilla servers are unjoinable after conflict round ends sometimes and show players the JIP error - clearing the saved session gets rid of it

#

Number one cause of JIP errors on modded servers is map makers using orange prefabs as part of the map

torn bane
#

If you have any reliable reproduction we would be happy to try it out and fix the issue. So far we have fixed many suspected causes but apparently did not find the right one yet. So unless we uncover some new information it is likely to stay an issue for the time being

sweet badger
torn bane
#

They are connected

sweet badger
#

We get a JIP error in maybe 15% of all scenario transitions, unfortunately I'm not aware of any reliable reproduction method.
Salami said it can happen when a player joins mid transition, but I have not verified that #enfusion_scripting message

ocean kernel
#

People have been complaining about this on vanilla servers for months and you havent even tried to repro it yet?

#

Then again, loadSessionSave is an undocumented parameter so perhaps it should be removed until it works

minor agate
ocean kernel
#

There are quite a few problems with loadSessionSave but people are insistent on using it

torn bane
spring shale
#

Not yet. Need to get employment first before I sink thousands of hours into passion. Looking forward to come back though. Reforger needs some good WW1 attritional PTSD generators 😁

Glad you missed me though. I still check in from time to time. Just not spending much time in the scripting channel anymore.

ocean kernel
#

All I know is it happens when round ends normally, frequent enough for people to invent ways to restart the server and remove session save when POSTGAME appears in the logs

pliant ingot
ocean kernel
#

Idk I built it into my admin panel as a checkbox for users

fervent cedar
ocean kernel
#

If you restart the server while it's loading everon it will timeout players and their game rejoins automatically. Otherwise if you restart too quickly then it says shutdown and they don't automatically rejoin. sadge

fervent cedar
#

How do I filter the server list to only see bacon servers with powerful remove session save feature?
I wish to play these servers

spark otter
ocean kernel
#

Lol I wonder if that's also borderline not allowed

#

But I don't get the point if it would be since it's intentional workaround

calm wren
#

Is there a way to make player invisible for others, but visible for you ?

#

Or send it to other dimension/routing bucket ?

spark otter
desert escarp
#

Anyone know a way to pull how a player was killed

#

Like the weapon/if it was melee

#

SCR_InstigatorContextData doesnt have anything like that

desert escarp
#

Got it

#
if (instigatorContextData.GetKillerEntity())
        {
            ChimeraCharacter character = ChimeraCharacter.Cast(instigatorContextData.GetKillerEntity());
            SCR_MeleeComponent meleeComp = SCR_MeleeComponent.Cast(character.FindComponent(SCR_MeleeComponent));
            
            if (meleeComp.GetMeleeStarted())
                Print("Melee Kill");
        }
#

Just have to make a modded class for SCR_MeleeComponent to create that getter

wooden cape
#

All that for a gun game mission. Smh lol

desert escarp
#

Quality is quality

dense compass
#

Hey everyone, I'm looking for a way to get the concrete type of a variable in a script. Is there an equivalent of typeof in enscript ?

desert escarp
#

@minor agate
Would

[RplProp()] ref array<ref ExampleContainer> = {};

class ExampleContainer
{
    //some data
    RplSave
    RplLoad
    //Writer bs below
}

Be the best way to do this or would this cause massive ram usage for some reason

#

Or would I not need RplSave and RplLoad in the container class because of the RplProp

dire sinew
desert escarp
#

Guessing that also causes tons of issues with performance

dire sinew
#

You can't tell that beforehand. Depends on how it is used.

desert escarp
#

Constantly updated throughout the servers life cycles

dire sinew
#

If the array is large, you might wanna do it differently.

desert escarp
#
class SAL_DroneConnectContainer
{
    protected RplId m_DroneConnection1 = RplId.Invalid();
    protected RplId m_DroneConnection2 = RplId.Invalid();
    protected RplId m_DroneConnection3 = RplId.Invalid();
    protected RplId m_DroneCommandStation = RplId.Invalid();
    protected RplId m_DroneAntenna = RplId.Invalid();
}
#

This is basically what I use it for to store connection data

dire sinew
#

By not having it as a RplProp and instead delivering the full data to JIPs via RplSave/RplLoad on the entity/component that has the array as member. And do new insertions/deletions with RPCs.

wooden cape
#

Might be the source of our VON problems with the jip queue @desert escarp

#

@thick arch ^

dire sinew
#

Technically, you could also do RplProp+RPC, as RplProp also handles JIPs and probably is slightly more efficient than RplSave/RplLoad. However, it's a poor approach from a design perspective, as you essentially have to enforce the requirement that you never call Replication::BumpMe on this entity/component.

desert escarp
dire sinew
#

And again, you would also define RPCs for replicating insertion and deletion of an element.

desert escarp
#

How would that look then with an array of classes

#
bool RplSave(ScriptBitWriter writer)
    {
        writer.WriteRplId(m_DroneConnection1);
        writer.WriteRplId(m_DroneConnection2);
        writer.WriteRplId(m_DroneConnection3);
        writer.WriteRplId(m_DroneCommandStation);
        writer.WriteRplId(m_DroneAntenna);
        
        return true;
    }
    
    bool RplLoad(ScriptBitReader reader)
    {
        reader.ReadRplId(m_DroneConnection1);
        reader.ReadRplId(m_DroneConnection2);
        reader.ReadRplId(m_DroneConnection3);
        reader.ReadRplId(m_DroneCommandStation);
        reader.ReadRplId(m_DroneAntenna);
        
        return true;
    }

This is how it looks right now I'm just confused how I do this with an array of classes instead of in the class object itself

dire sinew
#
//------------------------------------------------------------------------------------------------
class MyEntityClass : GenericEntityClass
{
}

//------------------------------------------------------------------------------------------------
class MyEntity : GenericEntity
{
    [RplProp()]
    protected ref array<ref ExampleContainer> m_aExamples = {};
    
    //------------------------------------------------------------------------------------------------
    void InsertExample(ExampleContainer element)
    {
        Rpc(RpcDo_InsertExampleBroadcast, element);
    }
    
    //------------------------------------------------------------------------------------------------
    [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
    protected void RpcDo_InsertExampleBroadcast(ExampleContainer element)
    {
        m_aExamples.Insert(element);
    }
}

class ExampleContainer
{
    //some data
    //Custom Codec BS
}
desert escarp
#

Ohhhh I see, that makes sense, basically how I am doing it right now, but whatever class has the array CANNOT call Replication.BumpMe();

dire sinew
#

Which is why RplLoad /RplSave would be cleaner instead of RplProp

desert escarp
#

I'm confused is the example above not using RplLoad /RplSave

dire sinew
#

That way you don't have to worry about anyone calling Replication::BumpMe or if you want a proper RplProp on your entity later for a different variable

#

No, this is the RplProp version

desert escarp
#

Ah what would the RplLoad /RplSave version look like?

#

Thats my biggest confusion, how exactly do I do that with an array of classes?

dire sinew
#
//------------------------------------------------------------------------------------------------
class MyEntityClass : GenericEntityClass
{
}

//------------------------------------------------------------------------------------------------
class MyEntity : GenericEntity
{
    protected ref array<ref ExampleContainer> m_aExamples = {};
    
    //------------------------------------------------------------------------------------------------
    void InsertExample(ExampleContainer element)
    {
        Rpc(RpcDo_InsertExampleBroadcast, element);
    }
    
    //------------------------------------------------------------------------------------------------
    [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
    protected void RpcDo_InsertExampleBroadcast(ExampleContainer element)
    {
        m_aExamples.Insert(element);
    }
    
    //------------------------------------------------------------------------------------------------
    override protected bool RplSave(ScriptBitWriter writer)
    {
        // Store m_aExamples on writer
    }
    
    //------------------------------------------------------------------------------------------------
    override protected bool RplLoad(ScriptBitReader reader)
    {
        // Read m_aExamples from reader
    }
}

class ExampleContainer
{
    //some data
    //Custom Codec BS
}

#

Though I'm not sure right now what the cleanest way would be to write/read the data

desert escarp
#

Rn my only thought is doing a foreach loop and saving and loading each index but that seems WILDLY inefficient

desert escarp
dire sinew
desert escarp
#

AH I see, that is not as bad then

dire sinew
#

The alternative would be to store it somewhere where it can never be streamed out like the player controller, but that will increase the memory requirement, as you essentially keep uneccesary data just for the sake of avoiding streaming.

desert escarp
#

Or nvm

#

I see

#

🤦‍♂️

#

Its whenever it goes within replication

dire sinew
#

Exactly, RplSave/RplLoad only ever get called when the entity gets streamed in

desert escarp
#

So for my instance I have a gamemode component that manages all this, I just need to create a seperate gamemode component that only handles the connection containers

#

Or I guess with the RplSave/RplLoad you wouldn't have to, okay this helps a lot

#

Thank you so much

dire sinew
#

Oh well, in case of game mode component, it never gets streamed out, so the only time RplSave/RplLoad gets called is when a player joins the session.

inland bronze
#

I found that in my use case for a component, I used RplProp with Replication.BumpMe() and had to use RplSave/RplLoad, is that a valid method or am I doing something wrong somewhere?

dire sinew
#

Depends on what you are doing. In Salami's case the property is a potentially large array, which is why we want to avoid RplProp, as the whole array gets sent if you modify it and do Replication::BumpMe

dire sinew
inland bronze
solid hearth
#

Trying to follow along with this but yeah i'm lost. My best advice which I hate to suggest it is if you really want to look at a somewhat complicated system but not really on how to deal with syncing large amounts of "classes" across the network you should look into the mapmarker manager component. It does this sort of pseudo technique that kex is trying to show where you have the server telling the client that x action is happening then having the y action on the client in-take and reconstruct the data as the server does and keeps that sort of in-sync.

dire sinew
inland bronze
dire sinew
#

Or the better question is where did you use the value? Could be that you tried to access it too early like in EOnInit.

#

If you want to do something when the value got updated, you should specify your method in onRplName, which is an optional argument for RplProp.

#

Also important to remember is that if you want the method to be called on all machines, you have to call it on the server explicitly, as onRplName only calls it on clients.

inland bronze
# dire sinew Can you provide an example of a case where you had to use `RplSave/RplLoad` in a...

https://github.com/CashewSan/Central-Economy/blob/main/source/Scripts/Game/CentralEconomy/Components/CE_SearchableContainerComponent.c

m_bHasBeenSearched & m_bIsSearchableare the RplProps, RplSave and RplLoad are lines 243 and 251 respectively. Only one I can think of that might be too early is the bump in OnAreasQueried on line 84. Areas are queried on EOnInit, then script invoker is called once they're done.

Being checked in CanBeShownScript() & CanBePerformedScript() of this user action https://github.com/CashewSan/Central-Economy/blob/main/source/Scripts/Game/CentralEconomy/UserActions/CE_SearchContainerUserAction.c

dire sinew
#

As example

//------------------------------------------------------------------------------------------------
class MyEntityClass : GenericEntityClass
{
}

//------------------------------------------------------------------------------------------------
class MyEntity : GenericEntity
{
    [RplProp(onRplName: "OnMyBoolChanged")]
    protected bool m_bMyBool = false;
    
    //------------------------------------------------------------------------------------------------
    //! Has to be called on the server
    protected void SetMyBool(bool newValue)
    {
        m_bMyBool = newValue;
        Replication.BumpMe();
        OnMyBoolChanged(); // Otherwise it won't be called on the server
    }
    
    //------------------------------------------------------------------------------------------------
    protected void OnMyBoolChanged()
    {
        // Do something with m_bMyBool
    }
}
dire sinew
#

The problem likely lies somewhere different.

#

One thing to remember is that OnPostInit is called on all machines. Don't you want it to be only executed on the server/authority?

#

Basically, RplProp only sends the data to JIP if it thinks the data has changed. In contrast your RplSave/RplLoad always sends the data.

#

I think the inconsistency could come from the client also setting the values, as OnPostInit gets executed on all machines

inland bronze
dire sinew
#

Either check the role or check that it's not a proxy.

#

or check if it's master (= server is owner and authority), if the server is always the owner.

desert escarp
#

Just add
#ifdef WORKBENCH
#else
if (RplSession.Mode() == RplMode.Client)
return;
#endif

#

If you want it to work in the workbench but that's up to you

dire sinew
desert escarp
inland bronze
#

I think there's specific cases where it should be used and not used, if I'm not wrong

dire sinew
#

Yes, I agree if possible use roles from RplComponent, but that likely won't work in OnPostInit, that's why I suggest Replication.IsServer()

desert escarp
#

It works with OnPostInit

dire sinew
#

Are you talking about your approach or RplComponent::Role?

desert escarp
#

Sorry my approach

#

I just hear Mario refering to Replication.IsServer() as the devil

dire sinew
#

As, I sad rather use Replication.IsServer(), your approach makes no sense at all

dire sinew
desert escarp
#

Mine still always works, Listen, SP, and MP and is not being phased out

dire sinew
#

Where was it ever said that Replication.IsServer gets phased out?

desert escarp
#

Honest to god, I cannot find it for the life of me but I swear pre 1.3 it was mentioned in here it was going to be phased out eventually, Mario also constantly says to not use it at all costs

dire sinew
#

I'm pretty sure his is point is to go with the methods on RplComponent. I don't see why your approach would be any better than Replication::IsServer

minor agate
dire sinew
#

I think they were briefly mentioned in one of the replication bootcamps, but I forgot about them 😅

minor agate
#

Like, you could have specific things sent to client when streamed in, but not actively replicated like RplProp

#

Or you might want to do something on the client when the Rpl system is active on the item, whcih you would use RplLoad for as sort of event

#

and same for Server when you want to detect if something is about to be streamed

#

RplSave/RplLoad is not an alternative to RplProp

#

RplSave/RplLoad are tools to do and send stuff when streaming in

dire sinew
minor agate
#

But CashewSan has been having some odd stuff with Replication so

#

😅

inland bronze
inland bronze
dire sinew
minor agate
#

This is the "client event" to use and be safe about replication of the item on a proxy/client

ocean kernel
#

But RplProp do trick

dire sinew
#

Also something to consider is to check for GetGame().InPlayMode(), as OnPostInit also gets called in WB, which you probably don't want.

inland bronze
ocean kernel
#

wtf is IsMaster

pliant ingot
ocean kernel
#

I see the edge case

dire sinew
inland bronze
dire sinew
#

I always though, if you want to interact with other components, you have to use EOnInit instead of OnPostInit

minor agate
#

IsMaster can return false if you are server, or true

minor agate
pliant ingot
#

but some may be already initialized

inland bronze
dire sinew
pliant ingot
candid garnet
#

Vlad, you seem to help with replication here a lot. Have you looked over the wiki pages on it? Anything that should be added or changed? Different wording?

minor agate
dire sinew
#

Which would mean that RplComponent probably won't return the correct values yet...

minor agate
#

Non proxy means auth

#

non auth means proxy

#

Auth can have ownership

#

proxy can have ownership

#

which is why the other one you had is flawed

#

as ownership can't be shared

#

so there can auth without ownership

#

!IsProxy() will work to see if auth on all scenarios SinglePlayer, HeadlessClient, Client, Dedicated server, listen client, etc

#

even dedicated on a client with locally spawned ent

#

This mishap here is why things work on DS to some, but not on WB and peertool

dire sinew
minor agate
#

Or why not in SP

#

etc etc

pliant ingot
minor agate
#

That part is predetermined

#

The owneship will change later on

#

Which is why you should never check that on init like that!

pliant ingot
minor agate
#

We are actually going away from wiki

#

So further docs will be on a better doxygen

#

More modernized with WB theme 😅

#

and some linkage to WB

#

Just to clarify, biki won't be removed. Just not used anymore for newer docs

pliant ingot
minor agate
#

we are going with MD files, inline docs and perhaps some github for collaboration with community for issues or additions (We'll see)

pliant ingot
dire sinew
#

And non-unique systems, so you can actually inherit from your own base systems.

pliant ingot
dire sinew
#

You can only have one derived class of a custom base class registered, so it basically bahaves like unique from what I understand. SetUnique seems to be ignored atm.

pliant ingot
#

but i think for these systems will be better to make "main" system and your own system class with your own cfg

dire sinew
#

It would be just nice to have the whole Register/Unregister boilerplate refactored into a base system, rather than having to copy/paste across all system like right now. Ofc ideally, it would be template-based, but I doubt we will ever be able to make templated systems 😅

pliant ingot
minor agate
#

@dire sinew Do you want me to tease you with something from enf that you don't currently have but that is there now?

dire sinew
#

Sure, go for it 😄

minor agate
dire sinew
minor agate
#

plus other things RatJam

#

the widget events and friend classes and methods i guess you should receive soon on AR, let me ask.

dire sinew
#

event system
I presume this will help to properly deal with events in systems. Currently it can be quite awkward, especially if you have to deal with invokers that don't pass the actual entity that invokes it.

minor agate
#

We avoid invokers in the new arma 🙂

lapis creek
#

Should we expect an event system in reforger? 🥹

fervent cedar
minor agate
fervent cedar
#

event handlers?

minor agate
#

There is connection validity on compilation time as well

#

among other things

#

safer, more controllable, compact and systematic

#

You should not miss invokers with it

fervent cedar
#

Sounds like something someone made up.
As long as I can still dynamically add functions to things in scripts and stuff like with script invokers

minor agate
fervent cedar
#

EH in a3 were good, never really had issues with script invokers really 🤷

minor agate
#

And yesm you can do dynamic events

minor agate
#

Not the same thing

#

there it was an event handler

dire sinew
fervent cedar
#

No i mean script invokers in refoger 😄

minor agate
#

Invokers are no event nabager or handler

#

@west prism wrong channel

#

This is for scripting questions

minor agate
#

These sort this, along the clutter from script invokers in code

dire sinew
#

Oh, so you are getting rid of callqueues as well? 😅

minor agate
#

It's not an event system just for the sake of one

#

We would not have spent the time on it if it was just a "nice addition"

fervent cedar
#

getting rid of callQue sounds like making something that takes 1 line take 15 lines tbh 😄

minor agate
#

They are still there

#

local callqueues are fine, just do not use a global one for the whole game

fervent cedar
#

imagine we had advanced preprocessor and macros, it's the best way

#

I wouldn't mind removing callque if I could just use a 1 word macro to do the same function

dire sinew
#

Oh no, please no more EGVAR 😅

fervent cedar
#

I don't mean that one, the ace/cba one was so annoying

#

I just mean instead of making things into functions, they should be macros

#

So scripting would be 1 line, but after preprocesseor it's 15 lines coped from the start of the file.

dire sinew
dire sinew
#

Eh, just let the compiler inline it.

minor agate
#

More complex preprocessor is something that is definitely not being added to scripts

fervent cedar
#

I guess one day we'll just make our own vscode plugin for that

minor agate
#

Very easy to become a mess

#

specially when trying to debug

fervent cedar
#

Yea well you have your own script editor, why can't it properly support macros by hovering over them etc...

minor agate
#

It's the clutter it can generate to modders (Majority not being programmers) misusing it

#

A few might use nicely, most might not

#

then you will have the crazy guy doing #define true false in some cases

west prism
fervent cedar
#

okay so now we have game systems / world controlelrs update and also event handlers update pending

dire sinew
#

The only thing where I see that preprocessors could come in handy is if we had a proper way to check if a specific mod is present via preprocessor.

minor agate
#

and no design means back to backlog or ideas 😅

west prism
fervent cedar
#

Now this thing event handlers.
I was thinking making upward compatability by making

  • parent mod
    • main mod
    • side/optional mod
      both require the parent, so I can have compatability function in the parent mod with event handler (or script invoker)

Can eventhandlers allow me to add script with return values etc in situation like this?

#

So I can run the side/optional mod without the main mod, but also with it

#

we want eventhandlers with return values and dynamic unmknown function calling.
Such as calling a eventhandler just by "stringName"

minor agate
#

in parent mod you will have the provider (What provides the events to be called)

#

And then any receiver can be connected to it

#

Connection is like insert like with script invoker

#

But more smart, also allows you to have some filtering that can be any managed instance or an int

fervent cedar
#

So I have to define all my functionality manually in parent mod?
We want not manually

minor agate
#

Which you an use to fire separate strands or anonymous sub events

#

Or to just do some sort of filtered event, through techniocally the same event linkage

#

Or decide to do broadcast to all

minor agate
#

(Any managed class is a receiver btw)

fervent cedar
#

I can create the eventhandler in main mod.
Ask to add a script to eventhandler in side mod.

fervent cedar
#

Hmmmm nice, this isl ike perfect then for compatability

#

They can support return values or I have to make that manaully?

minor agate
minor agate
mild quarry
#

Is it possible to attach/detach magazines from a gun? I have tried it a number of ways and I can’t get anything to work. Seems like the magazine in WeaponMuzzle.GetCurrentMagazine() is cached and returns a reference, even if that mag way deleted

#

Even when I use the InventoryManager to successfully attach a new mag, it still seems like the weapon reverts to whatever mag was formerly in the gun (further pointing to a cached reference)

spring shale
west prism
#

who has experience with swimming? its there an option to make swimming faster?

spark otter
mild quarry
fringe prairie
minor agate
#

It creates a enforce script define based on the CfgMods config class names

ocean kernel
#

Imo compiler should prefix all non-vanilla class names and method names with mod guid

#

At least for logging purposes

#

Server owners struggle a lot finding which script a mod comes from

#

When they get errors

ocean kernel
#

Also for gods sake make the automatic addons parameter for peertool work for mods with spaces in their name, it's 2025 and your program can't handle an ascii character

torn bane
# ocean kernel When they get errors

If an actual error method is called then the track trace tells which addon filesystem it came from. If you get a compile error you see it too. if you do it in workbench you even get the addon name as extra colum to sort/filter for.

ocean kernel
#

Like currently in the server log?

#

Or in next version

torn bane
#

We have not shipped the latest enfusion version in a while, so it might be much differrent on stable right now. You can check it out on 1.5 experimental once that comes out and give an example of what you would like to see where if that does not solve your problem.

ocean kernel
#

Yeah fair

abstract crescent
#

Hello. I have some issue with class inheritance.
I cant use parent constructor for initialization?
I got exception with null pointer - m_subBase is null in TEST_CustomBaseItem in overrided CustomRunCheck.
its ok if i move RunCheck out of constructor.
Seems derived class doesnt see own parameters when parent class calls overrided function from constructor or parent calls constructor before init parameters in derived class

SCRIPT       : TEST: RunCheck
SCRIPT       : TEST: CustomRunCheck 2 [HELLO]

SCRIPT    (E): Virtual Machine Exception

Reason: NULL pointer to instance

Class:      'TEST_CustomBaseItem'
Function: 'CustomRunCheck'
ref TEST_CustomBaseItem item = new TEST_CustomBaseItem("HELLO");
class TEST_Base
{
    void PrintDebug()
    {
        PrintFormat("TEST: PrintDebug");
    }
}

class TEST_BaseItem
{
    void TEST_BaseItem(string msg = string.Empty)
    {
        RunCheck(msg);
    }
    
    void RunCheck(string msg)
    {
        PrintFormat("TEST: RunCheck");
        CustomRunCheck(msg);
    }
    
    void CustomRunCheck(string msg)
    {
        PrintFormat("TEST: CustomRunCheck [%1]", msg);
    }
}

class TEST_CustomBaseItem: TEST_BaseItem
{
    ref TEST_Base m_subBase = new TEST_Base();
    
    override void CustomRunCheck(string msg)
    {
        PrintFormat("TEST: CustomRunCheck 2 [%1]", msg);
        
        m_subBase.PrintDebug();
    }
}
minor agate
# abstract crescent Hello. I have some issue with class inheritance. I cant use parent constructor f...

TEST_BaseItem has it's own constructor, which is the one calling RunCheck which calls CustomRunCheck

Declaring variables like you did in TEST_CustomBaseItem causes the VM to generate a constructor for TEST_CustomBaseItem with the assignments for those variables.

So when you create a TEST_CustomBaseItem instance.

The order of the chain of calls for the contructors is
TEST_BaseItem();
TEST_CustomBaseItem();

#

Given that you modified CustomRunCheck to try to use that var in TEST_CustomBaseItem, by the time it gets called because of the base class constructor, it does not exist and hence why you have this issue

abstract crescent
minor agate
#

Its done automatically

#

Parents first, then derivations

#

In order of hierarchy

#

same deal for destructors

#

For these cases, just do this

abstract crescent
#

in short: we can't use overridden functions in constructors with deriveds parameters

minor agate
#
class TEST_Base
{
    void PrintDebug()
    {
        PrintFormat("TEST: PrintDebug");
    }
}

class TEST_BaseItem
{
    protected void Init(string msg)
    {
        RunCheck(msg);
    }
    
    void TEST_BaseItem(string msg = string.Empty)
    {
        Init(msg);
    }
    
    void RunCheck(string msg)
    {
        PrintFormat("TEST: RunCheck");
        CustomRunCheck(msg);
    }
    
    void CustomRunCheck(string msg)
    {
        PrintFormat("TEST: CustomRunCheck [%1]", msg);
    }
}

class TEST_CustomBaseItem: TEST_BaseItem
{
    ref TEST_Base m_subBase;
    
    override protected void Init(string msg)
    {
        m_subBase = new TEST_Base();
        super.Init(msg);
    }
    
    override void CustomRunCheck(string msg)
    {
        PrintFormat("TEST: CustomRunCheck 2 [%1]", msg);
        
        m_subBase.PrintDebug();
    }
}
minor agate
#

You set yourself to failure on this regard with the chain of calls, but there is no super on constructors and destructors for performance reasons

#

If you need that behavior, then do what I showed you

#

Also there is no performance gain for initializing the variables on declaration

abstract crescent
# minor agate You set yourself to failure on this regard with the chain of calls, but there is...

its not about performance its more about code visualization

ref array<ref MyClass> arr = new array<ref MyClass>();
arr.Insert(new MyClass("A"));
arr.Insert(new MyClass("B"));
arr.Insert(new MyClass("C"));
arr.Insert(new MyClass("D"));

or

ref array<ref MyClass> arr = new array<ref MyClass>();
MyClass mc = new MyClass();
mc.Init("A");
arr.Insert(mc);
mc = new MyClass();
mc.Init("B");
arr.Insert(mc);
mc = new MyClass();
mc.Init("C");
arr.Insert(mc);
mc = new MyClass();
mc.Init("D");
arr.Insert(mc);
minor agate
#

they do not have the super behavior just to speed up initialization and destruction processes

#

Its implicit and predetermined

minor agate
#

See the code I gave you

#

It would still land you on the first one you shown here

#

The init method is utility method to be called by the constructor (Base)

#

So that then you can use Init method on derived classes to chain your construction logic however you want

abstract crescent
minor agate
#

It's set on the Init method, that gets called by the constructor

abstract crescent
#

what happens if derived class creates own constructor, does it call parent constructor?

minor agate
#

constructor chain is always present

#

it can't be changed by anyone

#

same for destructor

#

Any new constructor, calls the parent constructor

#

and the parent constructor, calls it's parent constructor

#

etc

#

Parent constructors gets called frist thing on the new constructor, before anything else

#

which is what wrecked you on your previous logic

abstract crescent
#

ok. I understand. I just should remember that for future.

ocean kernel
#

How do I call the destructor

#

delete MyClass?

minor agate
#

just beware that delete won't be allowed to go through if the instance has more than 1 strong reference to it

ocean kernel
#

Darn, thats why this = null didnt do anything

minor agate
ocean kernel
#

Not for scriptcomponent

minor agate
#

But again only if there is only 1 strong reference at most

minor agate
#

Engine created classes are handled by engine or game (CPP)

#

Basically, if CPP created it for you natively. Then you can't call delete on it.

ocean kernel
minor agate
#

Only cases where you can is when the native method retrieves ownership to script

#

Which is almost never a thing

#

You can tell on some (When done correctly) by having ref on the native method return type.

ocean kernel
#

Honestly I was thinking doing delete this in constructor would crash

storm shore
#

Is there a way to give a player godmode under certain conditions? I've got a modded SCR_CharacterDamageManagerComponent class and override onDamage, but can't seem to be able to stop a player from taking damage, though I can stop an AI taking damage that way

inland bronze
# storm shore Is there a way to give a player godmode under certain conditions? I've got a mod...

could override SCR_HitZone::ComputeEffectiveDamage to essentially be like (pseudo-ish-code):

override float ComputeEffectiveDamage(notnull BaseDamageContext damageContext, bool isDOT)
{
    ChimeraCharacter struckChar = ChimeraCharacter.Cast(damageContext.hitEntity);
    if (struckChar.IsGod)
    {
        return GodModeEffectiveDamage(damageContext, isDOT);
    }
        else
            return super.ComputeEffectiveDamage(damageContext, isDOT);
}

protected float GodModeEffectiveDamage(notnull BaseDamageContext damageContext, bool isDOT)
{
    float effectiveDamage = super.ComputeEffectiveDamage(damageContext, isDOT);
    float remainingHealth = GetHealth() - effectiveDamage;

    if (remainingHealth < 100)
    {
        return GetHealth() - 100;
    }

        return effectiveDamage;
}
``` or something like that
river imp
#

Or just set EnableDamageHandling to false

storm shore
inland bronze
storm shore
sweet badger
#

If I spawn an entity and directly afterwards modify it's properties in script, this change does get picked up by an RplSave/RplLoad immediately following the entity being spawned and appearing on client, right?

pliant ingot
fringe prairie
#

I'm hitting a VM exception in my RplProp serialization methods. I am destroying a "network" object on server and bumping it, Extract gets called with a null instance (kind of makes sense). My static serialization method signature is:

static bool Extract(AG0_TDLNetworkMembers instance, ScriptCtx ctx, SSnapSerializerBase snapshot)

Is it expected behavior for the replication system to call Extract with null instances?
What is the best way to guard or prevent such a situation, maybe RplProp is just not possible to use with some object which is created/destroyed on demand?

With this issue I decided to start moving away from this and instead RPC to the player controller (probably better long run anyways). Still interested in seeing what causes the instance to be null. I've been reading up on the recent conversation about replication and have done my best to optimize how, when, and where I use replication. The mod I am working on essentially allows for the replication of information managed by a server side system to players who can join certain networks, thus I created a complex object to represent each member's name, position, capability, etc - and replicate that data to each player who is a part of a network with the object containing network information and members.

pliant ingot
#

And yes, sometimes it calls with null

#

But not sure why

fringe prairie
#

I did that to avoid the issue, just wanted to understand more about why it allows me to mess up the server this bad without a null check. Couldn't find an example of a codec which used a null check so figured whatever I am doing is just wrong

pliant ingot
#

I can't tell more about this, because I personally don't use RplProps, and prefer to just RplLoad/RplSave + Rpc for sync, and because of this all my codecs reliably receives not null instance

sleek dove
#

I mean if your instance is null makes sense that extract is called with null, since it just want to replicate the current value which is null

#

I would highly discourage writing your own codec anyway, it is very error prone and just stall the replication of the game.

ocean kernel
#

How is the server browser sorted on the backend? In terms of secondary and tertiary sort keys etc

#

Like let's say I sort by players, there has to be something that sorts the results if they have the same player count right?

desert escarp
#

Is there a way to see what components are using up memory on a dedicated server and by how much?

#

Best I got is the debug menu but in the workbench it kind of merges the roles

minor agate
#

Also, DO NOT do your own utility methods for replications, you just cause each replication process be slower than it should be

pliant ingot
minor agate
#

There was someone before that tried to optimize networking by trying to optimize bandwidth usage, but made the replication ticks be extremely slower

#

Causing more desync because of how long it took to decide to replicate something

minor agate
#

but it has to be quite bad for that

pliant ingot
minor agate
#

there not been a mod with 80% culprit of crashes since 1.1

pliant ingot
minor agate
pliant ingot
minor agate
#

And CPP provided codecs are always best, in some cases RPC and RPLLoad and Save are best too

#

Depends on your data, and logic

#

Sometimes you can restructure logic to minimize replication needs without overhead

#

depends

fervent cedar
#

So are you saying if I just spawn in a IEntity with RplComponent and use RplProps.
It's more efficient than manually sending data with RPCs?

Example, a virtual stock exchange, that every player will use 100% of the time.
I should just create a IEnt with RplProp for the price/availability etc.
Ex there are 10 000 stocks, I'm better using RplProp instead of RPCs and manually managing updating data to all clients and Jip?

#

Because RplProp is all CPP, it's faster tahn anything in the world

ocean kernel
#

Will you guys take down mod 58D0FB3206B6F859 for making vehicles teleport randomly when driving?

#

It kinda makes the gameplay experience suffer

pliant ingot
#

Because all of this is in enforce, which is slower then cpp

#

And you can write them bad

minor agate
#

It depends on your logic, data and how often you need it

fervent cedar
#

Because I assume all IEnt and all RplProp are iterated over in a single thread somewhere

ocean kernel
#

Ghost mod

minor agate
#

Which is when the stall to replication happens

fervent cedar
pliant ingot
minor agate
#

The system only goes over things that are marked that needs update

#

That is why you have to call BumpMe or nothing happens

fervent cedar
#

What about jip?

minor agate
#

RplProp is just a helper methodology to do the same you would do with Rpcs and RplLoad and RplSave

fervent cedar
#

If I can do this and just use 10 000 IEnt with RplProp.
It would be like 100 lines compared to normally ~2000-3000 lines...

#

Rplprop is faster than enfuision sqf

#

Therefor it's indefinitely better

minor agate
#

Don't tell me you are using that cursed SQF in Enfusion thing

fervent cedar
#

x_ no

minor agate
#

Good

#

I saw it before, and was like nice way to extremely slow down things heh

#

also people not wanting to conform to change for the better

#

some form of senior rejection

pliant ingot
minor agate
#

😅

#

it's a fake thread, it still runs on the main thread.

pliant ingot
#

Just for enforce

minor agate
#

also it would just create more unsafe context for modders

pliant ingot
minor agate
#

of everyone touching script, only a small percentage of modders are programming experienced

#

so we tend to limit because of that

pliant ingot
minor agate
minor agate
#

Jokes aside, nice joke. It caught me

pliant ingot
ocean kernel
pliant ingot
#

So you can easily send through rpc or rplprop any custom but simple data

#

@minor agate I don't try yet, but how these codecs and other stuff works with inheritance?

minor agate
#

As you don't want all to be replicated most of the time

#

but I get your idea.

#

You want something like how structs are generally used to pass data around

pliant ingot
pliant ingot
ocean kernel
minor agate
#

idk when that will reach AR.

#

like, it works but it is limited in AR

minor agate
pliant ingot
#

😢

#

Then I need to write a fabric-wrapper with codecs for it

cloud nacelle
#

Hello, was wondering if anyone here could help with my enfusion script struggles
i'm trying to get the headquarters in a conflict game to check which side is which

this is my code

protected ref array<SCR_MilitaryBaseComponent> m_aHeadquarters;
// protected ref array<Managed> m_aHeadquarters;

Print("[DF_AutoTurretFactionInjector] Search HQs");

// I can't get either of these calls to work
GetGame().GetWorld().QueryEntitiesBySphere(vector.Zero, 9999999, HQQueryEntitiesCallbackMethod, null);
// FindComponents(SCR_MilitaryBaseComponent, m_aHeadquarters);

Print("[DF_AutoTurretFactionInjector] Found " + m_aHeadquarters.Count() + " HQs");
        

and the query callback for the entitiesbysphere call

    protected bool HQQueryEntitiesCallbackMethod(IEntity e)
    {
        if (!e)
            return false;
        
        Print("[DF_AutoTurretFactionInjector] hq a");
        SCR_CampaignMilitaryBaseComponent hq = SCR_CampaignMilitaryBaseComponent.Cast(e.FindComponent(SCR_CampaignMilitaryBaseComponent));

        if(!hq || !hq.IsHQ())
            return false;
        
        Print("[DF_AutoTurretFactionInjector] hq b");
        m_aHeadquarters.Insert(hq);
        return true;
    }
    

(the log outputs 2x hq a, nothing after)

Pretty sure I'm doing something wrong in the query callback, but what...

Help would be much appreciated 🙂

pliant ingot
#

Asfaik

#

Or you can get all bases through MilitaryBaseManager, check if it's Initialized, and iterate over it to find HQ

cloud nacelle
#

I'll look into that, though this was partially just an example, as i do need to get more instances of a entity that has a specific component

ocean needle
#
SCR_MilitaryBaseSystem baseManager = SCR_MilitaryBaseSystem.GetInstance();
array<SCR_MilitaryBaseComponent> bases = {};
baseManager.GetBases(bases);

could try this

pliant ingot
cloud nacelle
#

fair enough
I'm trying to fix a broken script i found that updates the faction of all auto turrets (BON_AutoTurretComponent)
so, get the turrets then assign the faction based on the closest HQ

#

Is there any docs on these various ways to search through entities? havent found anyting past queryEntitiesBySphere

pliant ingot
cloud nacelle
#

yeah ill try that, sounds much more sensible

#

ty for the help

dire sinew
#

EquipedWeaponStorageComponent
We're back with good old SetDammage 😅

narrow aspen
#

got a lot of this error...I use a component in player character to update score and register the component in a system (server side).
14:20:10.413 RPL (E): RpcError: Calling a RPC from an unregistered item! itemType='script::Game::IPC_CharacterScoreComponent', rpc='RpcDo_SetPlayerId'

minor agate
#

(Whole IPC_CharacterScoreComponent class)

narrow aspen
#

uploading. Can I DM you the file or project?

minor agate
#

Why not here?

#

It helps other with similar issues in the future

narrow aspen
#

okay I upload the system/component file here.

#

so it is always triggered when the system using InitializeData() method in the component. And the component is in character prefab

minor agate
narrow aspen
#

if(!Replication.FindId(this))
return;

#

it was triggered even in the spawn menu.

minor agate
#

in fact, even main menu is a world

narrow aspen
red inlet
#

problem:
I have 22 cannons slotted in SlotManagerComponent but only the 1st one named Turret is able to pull ammo from the vehicle trunk. The rest are named Turret01 Turret02 etc is the name of the slot itself representative of a Variable in script? If so how can I make it so the rest of the turrets behave the same way

#

to test it i have the cannon replacing the just the btr turret and it reloads just fine

tawny lotus
#

I would like to show some information (e.g., markers) on GM map. Any hints on what to look for or where to start?

spark otter
#

Im struggling to figure out how to update the players loadout preview in the conflict respawn menu. Anyone familiar with that system?

#

I have the player and the loadout, but I have no idea where I need to go from there.

fringe prairie
# minor agate <@224964807252508672> <@207234901672591360> this last part is also why I keep me...

Trying to keep it simple, but there is a lot of data only server can gather and need to send to players via player controller. The codec itself doesn't have any logic outside of calculating how many bytes to serialize for a string for example. Not reaching out for components, etc. Just a complex class with a bunch of data. Before I had a replication sandwich with one class holding an array of another class, both with codecs, and have started ditching that and instead client side create that container and only send the embedded objects to players. Seems to be helping network traffic.

Really it took me a while to realize the power of replicating directly to each player controller, before each entity had a component with a rplprop for the network members, this meant for 10 devices, every player would recieve the replication bump for those 10 devices with 10 or more network members. There is a reason why this mod isn't public yet and in limited testing, but I figured out pretty quickly to leave RplProps as state holders if everyone needs to know about them, and just Rpc to player controller when complex data is needed by that specific player.

#

@fervent cedar this also might benefit you. Depending on how you need to implement it, now spatial relevancy really will dictate if 10000 rplprops hangs a player/server. I am weaponizing spatial relevancy by registering local entities (which are "broadcasting" camera feeds) to the local player controller when the onRplName triggers, and in the deconstructor unregistering it. Which is a lot better than me spamming Replication.FindItem(rplId) to see if that object server tells me is broadcasting is actually streamed.

ornate flame
#

Hey hi, does anyone know what happened here?

fringe prairie
fringe prairie
#

Remove one of the conflicting mods. Not easy to identify which mod it comes from from the logs. You can also try opening workbench with all the mods enabled (create project, open with, select all mods being used on server) then the workbench will point you to specific files that are bad in script editor, then you can find what mods conflict there.

fervent cedar
# fringe prairie Trying to keep it simple, but there is a lot of data only server can gather and ...

x_
to me the problem of replicating directly to each player is
writing more code and total amount of more scripted commands need to run (as opposed to C++)

example 10 000 data items, with 5 fields each.
Means 50 000 scripted function calls per client.

Also imagine manually handling jip and live data edits.
Such as player5 joins server, needs to access all data,
Start sending all data (10 000) to him,
item5455 in the data was sent to him, but now was updated.
item 7544 in the data was NOT sent to him, but was updated.

All that micromanagment, is it worthj it in the end.
When I could have (non-spatial) replicated entities with RplProps instead.
They C++ code makes sure it's updated and jip sync'd.

fringe prairie
# fervent cedar <:x_:1384086533354557540> to me the problem of replicating directly to each pla...

Yep, in my case I can afford to send updates with an entire network member array but worst case is 100 members not 10000 lol. Now there is encode/decode delta, mario might be able to help with that. You can still use RPC to send the data through player controller when players need the data, and have the system just sends one RPC with array, not 50000 entities with rplprops doing it themselves. I feel like if you can avoid it, players don't need to have data for 50000 entities, server can hold it and client can request through player controller depending on need.

RplProp does nicely handle the live data issue though, hm.

fervent cedar
pliant ingot
#

It faster, but when you overload your server with 100k random packets - it may not be so "fast"

fervent cedar
fervent cedar
#

I've done a data manager before that just sends 1 RPC per frame for example.
Just handles all players so technically you just wait longer if there are too many players/datas.

#

That seems like a good way for some cases, but it's just so tiresome to write

pliant ingot
fervent cedar
minor agate
#

Rplprop on 2 ints or so will be faster than manually doing the rpc combo

#

As i mentioned before. It all depends on the data and how often it should be updated, and when

minor agate
#

As always and as with any code, it depends on the developer

minor agate
#

As replication runs every fixed frame

#

So you are just doing it in bulk, just with more work

minor agate
fervent cedar
minor agate
#

Think about it 😅

fervent cedar
#

realistically right now I need a Rpl system to
1.
attach ribbons to entities, helmets, cars, buildings etc.
For identification.
Technically these could be thousands
2.
Custom map markers with extra data and 3d stuff

minor agate
#

You can achieve it with minimal work and minimal data in comparison

sweet badger
slow acorn
#

For a custom backpack should we still report this error? 2025-07-30 07:30:16.212 RPL : rpl::Pip::ProcessNetToGame 2025-07-30 07:30:16.212 INVENTORY (E): CIRCULAR ROOT STORAGE FOUND!!! Please report via feedback.bistudio.com. Thank you. Details: Prefabs/Bergen/RL_Backpack_Bergen_Black.et Prefabs/Bergen/RL_Backpack_Bergen_Black.et Prefabs/Bergen/RL_Backpack_Bergen_Black.et Prefabs/Bergen/RL_Backpack_Bergen_Black.et Prefabs/Bergen/RL_Backpack_Bergen_Black.et Prefabs/Bergen/RL_Backpack_Bergen_Black.et Prefabs/Bergen/RL_Backpack_Bergen_Black.et ...5 minutes later 2025-07-30 07:35:18.900 ENGINE (F): Application hangs (force crash) 303 s 2025-07-30 07:35:18.900 ENGINE (F): Crashed 2025-07-30 07:35:18.994 ENGINE (E): Application crashed! Generated memory dump: <REDACTED PATH>

#

I assume it's detecting the backpack inside of itself?

hard fjord
#

!verify

upper kiteBOT
craggy jolt
#

What are the options to making configs more editor friendly? I hate how non-descriptive folded array items are. Can't I say make it show one of the fields like name instead of generic config class name?

#

Is SCR_BatchPrefabTitle a thing for configs?

torn bane
minor agate
craggy jolt
#

Now if only you could make it also show an icon like weapon preview hmmyes

#

BaseContainerCustomTitleField looks to be ready made decorator for a single property

ocean kernel
#

Love it when modders make clothing you can put into itself

#

To be fair I have no clue why the game's inventory system allows putting item in itself

#

Just another Reforger Quirk™

#

Same thing with being able to put a vehicle entity inside a backpack

dark ocean
ocean kernel
#

It thinks putting a 1000kg vehicle in a backpack is fine

#

If anything it should be disabled by default with an option to enable it

#

I have put tanks inside other tanks before

#

And helicopters in my pocket

lime glade
#

Hey I'm brand new to scripting, however I'm working on a V-22 Osprey. Anyone have any advice how to make a custom flight controller for it? Specifically how to change the direction of lift

lime glade
ocean kernel
#

Can we have some script changelog for the exp

desert escarp
#

However, if you want look into my mod, Realistic Combat Drone if you want to see how I did it for a client authoritative model

torn bane
fervent cedar
#

version control diffs eventually
Nice arkenfrog promised us version ctonrol diffs (eventually)
x_

lime glade
desert escarp
ocean kernel
#

There is no "learn programming with reforger" guides so you need to acquire programming abilities elsewhere, then come back and use them in Reforger

gusty pulsar
#

Where I can find Arma Reforger ES api?

torn bane
#

A what API?

gusty pulsar
#

I found it, nevermind

gusty pulsar
#

or enfusion script?

maiden goblet
#

.c is silly and confusing, both for people and software like code editors; it's already taken by c/c++. Hope Arma 4 changes it to .es or sth.

pliant ingot
maiden goblet
ocean kernel
#

.arma

#

Arma has 4 letters

#

Arma 4 confirmed

dark ocean
maiden goblet
#

Makes sense, just unfortunate.

dark ocean
#

though .c would be absolutely the very last suffix I'd pick as a developer

ocean kernel
#

What would changing the suffix break lol

dark ocean
#

infinite amount of places where it can be hardcoded because "this will obviously never change"

ocean kernel
#

Didnt know it was this bad

desert escarp
#

Works on Dedi, SP, etc... but do we just do ifdef to have it work in workbench

desert escarp
#

Same way as he did

pliant ingot
#

this should works in WB

desert escarp
#

I want to check if the server is running the code and if so return

pliant ingot
#

but also triggers during edit mode

desert escarp
#

Would EnableStreamingConNode cause the "client" to not be a proxy anymore

#

No but currently m_RplComp.IsProxy() is returning false on listen servers

pliant ingot
desert escarp
#

So how can I check for a client/server that works both in listen and dedicated

pliant ingot
#

it mb return false for clients until it fully initialize, not sure

desert escarp
#

I do that but that also returns false for the client so I can't have any client side code running

solid hearth
solid hearth
#

I concur, .c is an awful choice.

desert escarp
#
if (!m_RplComp)
    m_RplComp = RplComponent.Cast(owner.FindComponent(RplComponent));
        
if (m_RplComp && !m_RplComp.IsProxy())
    return;

//Client BS
#

I understand that, then how exaclty do I bypass this check in a listen server

pliant ingot
#

Your entity have rplcomponent?

desert escarp
#

Yes

pliant ingot
#

when you check this condition?

desert escarp
#

EOnFrame

pliant ingot
#

mb try to define RplLoad for your component and set some flag to true in it

#

so we will known if this entity is actually streamed in and not created locally

desert escarp
#

Couldn't I just do

if (!m_RplComp)
    m_RplComp = RplComponent.Cast(owner.FindComponent(RplComponent));
if (RplSession.Mode() != RplMode.Listen)
    if (m_RplComp && !m_RplComp.IsProxy())
        return;
pliant ingot
desert escarp
#

Really?

#

Im so confused on why that is bad to use

pliant ingot
#

So if we want to remove hardcoded check for IsServer then we shouldn't use Replication.Mode() too

spark otter
#

What would I look for now that ```cs
SCR_CampaignTaskSupportEntity

pliant ingot
pliant ingot
desert escarp
pliant ingot
desert escarp
#

I don't really understand what you're asking

#

That's what is printing out in the WB when I just press play

pliant ingot
#

So then what you want in WB? to run your code? but this is server

desert escarp
#

I'm using OnFrame to do checks for HUD theres no reason for the server to do these checks. I do that above so the servers not running needless code but this causes it to not draw HUD on SP and WB

pliant ingot
#

System.IsConsoleApp()

desert escarp
#

That easy?

solid hearth
#

That easy.

desert escarp
#

I love software development

solid hearth
#

And as mario would say I'd use the dedicated tool and not rely solely on what WB and WB+Peerclient is producing, results are weird at times.

pliant ingot
solid hearth
#

Is it really hard tho? It's sort of same concept.. checking if player controller exists.. doesn't exist then it must be a console... right..?