#enfusion_scripting

1 messages ยท Page 11 of 1

minor agate
#

for example the character

#

etc etc

#

There can be other worlds

ocean kernel
#

That just crashes the game though so irrelevant

minor agate
#

A modder might create one

craggy jolt
#

I guess the reason is: "OOP philosophy uber alles"

half patio
#

is it possible to create a world that users can join into and walk around/practise shooting or flying while waiting in qeuee ? like they can walk up to a sign in the "waiting world" to click which server to join or is that just not possible yet with arma. idk if im making sense at all

ocean kernel
minor agate
#

It's a legitimate question

#

So basically, don;'t do static for systems

ocean kernel
#

Technically possible does not mean actually works, in my case it didn't

minor agate
#

You will cause issues, specially if a modder creates another world

minor agate
#

You probably did something wrong

#

Or a system with static messes you up

#

Hence why do it correctly

ocean kernel
#

If I am doing modding and I get game crash it means there's bug in the game or engine. I should get error not crash.

half patio
minor agate
#

The reason why I am telling to not do that is because of that and more things

#

Misbehavior bc suddenly a system used the wrong system it connected to

#

and many other things

#

Anyway this is not changing, it is more prevalent on A4

#

So you have to learn it if you want to do stuff in A4

#

current docs are in doxygen

ocean kernel
#

But that implies your entities are spawning in those secondary worlds. My entities only spawn in the primary world.

craggy jolt
#
SomeSystem.Cast(GetOwner().GetWorld().FindSystem(SomeSystem))

vs

SomeSystem.GetInstanceThatMatters() //static variable
minor agate
#

If you somehow got the system on the second world to handle some of your entities

craggy jolt
#

Though second approach assumes you're NEVER going to execute the code outside of main game world otherwise it might mess things up

minor agate
#

Then that's where you find issues

#

Or items in second world registering into your first world system

#

Which is common case for inv preview items messing with main world systems

#

When they should not

#

Suddenly you get two items representing the same but technicalyl different because they both used the main system

craggy jolt
#

I guess it makes sense, I just hate calling lots of functions not understanding what they do exactly and how slow they are

half patio
minor agate
minor agate
#

Also noticed I am a bit high in tone, sorry. I got caught mid migraine

#

But just avoid doing the static

#

Specially if you want to transfer nicely to A4

#

Or if you want to not mess with mods that make custom extra worlds

#

and specially if you want to also deal with preview world

half patio
#

yeah fair enough. your good man, hopefully your migraine goes away soon ๐Ÿ˜„

also thanks for letting me know about this. didnt think it was possible till now. ill look more into in the future

minor agate
ocean kernel
#

Haha that's crazy

craggy jolt
#

That's whole lot of gets and then a cast VS single static variable

#

I wish I knew how to profile to test

minor agate
ocean kernel
#

The only way I know how to time something is to use two System.GetTickCount()

minor agate
#

But you do not have profiling tools we use

ocean kernel
#

timeSlice doesnt work, time/unixtime obviously also doesnt

minor agate
#

At some point maybe we will provide it, but if so then only for scripts

ocean kernel
#

the diag menu script profiler is useful but only in some cases

craggy jolt
#

GIB diag_codePeformance-like tool where you can feed it code bit and it measures it

ocean kernel
#

But if you're going to give modders low level and nuanced features then it seems a bit weird a profiler doesnt come with it

minor agate
#

Decision was mostly to it showing things that could be sued for hacking, or some other itnernals

#

But for only scripts it should be fine, but it is not prepared to only show that

ocean kernel
#

Does it matter? There are still hackers and reverse engineers everywhere. You tell us protecting our stuff is fruitless but it seems like you restricting access to profiler for those reasons accomplishes... not much

minor agate
#

But I do see it big priority, as I do see lots of modders that do care for performance but have no proper way of knowing

#

And it does affect the game

#

In many cases many have slowed down the game more trying to optimize network performance

#

Moving the latency from the networking layer into the actual game

#

Making it worse

#

But they could not measure that

ocean kernel
#

Is that why there is packet loss on localhost nowadays?

minor agate
ocean kernel
#

And the vehicle simulation desync correction got much worse in recent months

minor agate
#

It can trip things

#

This is specially common thing when people misuse calllater

#

It always shows up after callqueue implosion

#

CallQueue on it's own is not bad

#

The issue is people using the general game one for it

#

They should use their own instance of CallQueue

#

Suddenly you have a queue system with hundreds of thousands of things to process every frame to know if it should call them or not

#

Having your own on your own system, ticked by it only having stuff relevant to you. Is better than the general one

ocean kernel
#

I wanted to write my own callqueue as an exercise but not being able to pass functions as parameters nuked it

minor agate
#

It's what GetCallQueue() does anyway

ocean kernel
#

Yeah but I mean from scratch

minor agate
#

The limitation saved you then

ocean kernel
#

No I mean I still did it using a few maps and scriptinvokers

#

You'd be proud

minor agate
#

Why?

ocean kernel
#

But I could have not used scriptinvokers if I could pass functions as parameters

minor agate
#

You can just create a new instance of CallQueue

ocean kernel
#

There's a few reasons. One of them is I want to collect metrics on execution every time it runs.

minor agate
#

Yeah if you had the profiler you would not need that

ocean kernel
#

Not just for performance reasons, for observability reasons when I export metrics from the server to pushgateway

minor agate
#

There is a whole class for that

#

forgot the name, sec

#
// From Debug class
    //! Starts measuring time until EndTimeMeasure() is called.
    static proto void BeginTimeMeasure();
    //! Ends time measurement which began with last BeginTimeMeasure() call.
    static proto void EndTimeMeasure(string title);
#

Let me gather how to get the print as I do not recall that rn

craggy jolt
#

I see there is SCR_TimeMeasurementHelper which uses System.GetTickCount()

minor agate
#

Unfortunately

ocean kernel
#

I mean it will still work to measure how fast it runs relative to another run

#

Even if the time units are inaccurate or something, you can still see if something is twice as slow

minor agate
#

Yeah but it adds random overhead

half patio
#

hey mario idk if your still on but im thinking of writing a email to the bohemia support regarding my mod to make sure my idea isnt against any eula/BL's TOS etc etc i know its vague but would it be wrong of me to seek clarification before i start making it

minor agate
#

And trips the CPU even more when it comes to caches and stuff

#

It fucks you up for actual measurement

ocean kernel
#

Thats ok if I just want to see how much slower function A is than function B, since both measurements factor in the overhead

#

It doesnt work for measuring how fast the function actually is in real time, but it's still useful

minor agate
#

I see what you mean

ocean kernel
#

I would like to see real world examples of common performance issues found in the game and mod scripts

#

I'm sure there's a big list you guys have and you could post it with how to fix it

minor agate
#

Engine events (EOnXXX) on components instead of Systems

#

The usual ones we keep repeating

#

We repeat them for a reason

#

Components being used for processing logic themselves instead of just holding data

#

etc etc

#

Which the game is full of as well

craggy jolt
#

What's wrong in having logic in say gamemode component?

minor agate
ocean kernel
#

By the way any idea why MPTest loads fine when running server on android but Arland stops loading and just sits using 50% of a cpu core never loading into the actual world?

minor agate
ocean kernel
#

I was testing on my Galaxy S24

minor agate
#

It will show you some of the issues there

#

The reason of not being able to know when to do something is also that

half patio
ocean kernel
#

No just server

minor agate
#

(The reason why people do CallLAter next frame or after 10s)

#

All because of logic in components and entities, instead of a systematic way

craggy jolt
#

I'm no expert on anything to say, but I still feel confused about systems a bit, feels like them going against ECS approach

minor agate
#

In A4 we might just block ticked engine events outside of systems

ocean kernel
#

It's all because of convenience right? Like nobody wants to make a system just to do something every frame

minor agate
#

It's protected by Unity iirc

#

The way it is designed for us is this

half patio
#

i know its stupid of me asking this but is it possible to save all scripts that are viewable in the arma forger in the script editor to a folder on my desktop ?

minor agate
#

Entities for defining something existing in the world (With world related physical attributes like transforms), Components to add data to said entites, and to replicate state. And then systems to process everything.

craggy jolt
#

Why is gamemode, faction manager, etc. are entities then? Outdated approach?

craggy jolt
minor agate
#

As I said before, the game itself is not a good example.

#

And modders just take what they see there

ocean kernel
#

The unity ECS patent is more about memory allocation than design of the system though

craggy jolt
#

Yeah I was talking about ECS idea in general

craggy jolt
fervent cedar
#

Sooo... about them world controllers 2

#

๐Ÿ™ soon

minor agate
craggy jolt
#

So how would you reimagine factions in ideal world then? Faction system and then how do you define factions? In the system itself?

#

Factions aren't physical, they don't need world transformation, placing "faction entity" would be wrong design then

#

They can't be data of some entity, as that entity has world transformation too

#

Current implementation of factions being data of a component of a game world entity is wrong too

minor agate
#

You can use attributes on systems

#

And you can also just read any .conf from anywhere

craggy jolt
#

Not trying to be annoying, I'm just trying to grasp the proper design philosophy you'd expect

fervent cedar
#

configs are annoying to edit / manage, no?

minor agate
#

Everything where you set data in Enf is a config

#

.conf, .et, .enat, .ragdoll, etc

#

even the anim graphs

ocean kernel
#

What are the advantages of your config system than say using json?

craggy jolt
#

Honestly the #1 thing I don't like about new engine is having to click around stuff, I like consoles and editing text files

#

Editing configs through menus is indeed very annoying

ocean kernel
#

True, especially since it loves to crash when I copy and paste using the UI

fervent cedar
#

Same, many times I have wanted to do mass edits or go over thigns faster, just open the .conf in text editor blobdoggoshruggoogly

minor agate
#

Old decision

#

Not changing

#

So no need to argue

#

Everything is built on top of that

fervent cedar
#

conf is fine, just needs more UI/UX

minor agate
#

Like everything

ocean kernel
#

Didnt mean as an argument, genuine question, maybe they do something better

craggy jolt
#

I wish "Text view" was editable, or at least copy-pasteable

minor agate
#

I mean technically you can do similar things, it might actualyl be more text on json

#

The only thing tho, is that configs here mimic memory layout when binarized

fervent cedar
#

And also weather config is very very annoying and infuriating

minor agate
#

So it's faster to parse even on source format

ocean kernel
craggy jolt
minor agate
#

And you will never get that support

#

It's unsafe

fervent cedar
#

emat and stuff is nice tho it looks good in txt file and I just use FileIO to edit them most of the itme hmmyes

ocean kernel
#

Imagine being the developer doing those UI widgets for the weather editor having to build UI entirely around array indices instead of you know, KEYS

fervent cedar
#

the order gets wrong

#

It happend like 3+ times maybe more

#

WEather eddcitor should really use the conf model, so they parameters are the same

ocean kernel
#

weather editor still crashes when you click the curves wrong?

minor agate
#

not the conf system

fervent cedar
ocean kernel
minor agate
#

But the configuration mimic the attributes they have set

fervent cedar
#

The problem is that the weather editor is really cooll and useful and fun.
But I can't create a script and FileIO the changes after updates ๐Ÿ˜ญ

minor agate
#

If they set these attributes to be used directly by the code

#

then they would probably be a mess internally in the file

minor agate
#

You should use the base container api

#

base container are the config underlying system

fervent cedar
#

๐Ÿค” that can edit files and parameters?
THere any examples for base container api usage in vanilla?

half patio
#

is there a way i can open all the scripts from the arma folder that you can see in the script editor on visual studio code ??

fervent cedar
#

One example of configs I sometimes wanted to edit all the vhcsurface to edit all terrain roughness / friction.
Just made fileIO and changed the things....

I must look into this "base container api" sounds promising

minor agate
ocean kernel
#

Ok how about

#

Config config = new Config.Load(ResourceName)

silver acorn
#

Yo its me or the workshop is dead ?

minor agate
#

LoadContainer

ocean kernel
#

nice

#

then I can just cast it to the related class?

minor agate
ocean kernel
#

Well I want to load the config and interact with it

#

Do I need to CreateInstanceFromContainer?

minor agate
#

BUT

#

If you want it to be created into a script class from it

#

Then yes, that method

ocean kernel
#

That's ok, only twice as much boilerplate as I would like, but one extra line is not that much

minor agate
#

LoadContainer loads the actual data container (tied to a file)

#

CreateInstanceFromContainer creates an instance based on that

#

If we did not give you this control you would also complain

#

I feel like

#

Better to give it

#

You can make your helper functions if you want to minimize and know the specific usage you will give

#

We don't so that is why you get the raw API

fervent cedar
#

meowsweats been creating overrides w/ .meta files on fileIO

minor agate
#

Sometimes when we know we do add it

ocean kernel
#

Btw why does SCR_JsonLoadContext.ReadValue("", ...) fail when reading to a variable that has a key with a default value that the json config does not have?

minor agate
#

Like the Utils classes

desert escarp
#

Is there no way to override a desctructor?
Just getting this when I try

scripts/Game/SALRHS_SAL_DroneHudComponent.c(21): error: Function '~SAL_DroneHUDComponent' is marked as override, but there is no function with this name in the base class

there is definitely a desctructor method in the base class

minor agate
#

But it;s hard to know all

desert escarp
#
override void ~SAL_DroneHUDComponent()
    {
        super.SAL_DroneHUDComponent();
    }
minor agate
fervent cedar
minor agate
#

If you want to remove previous behavior, not possible

#

for example this works

#
modded class SAL_DroneHUDComponent
{
    void ~SAL_DroneHUDComponent()
    {
        // Some new code here
    }
}
#

Notice that there is no override

#

and no super

#

Only thing you can do is append logic to the original

#

same for constructor

#

And the reason is to not make script instance creation and deletion slower for everything

#

This is why, in many classes you se an Init method

#

that is called only on constructor

#

So that we can give modders ability to fully modding it

ocean kernel
#

by the way, do [attributes] work for default values when creating an instance with new?

ocean kernel
#

For example here is the config definition

[BaseContainerProps(configRoot: true)]
class ServerMessageConfig {
    [Attribute("", desc: "Discord link")]
    string discordLink;

    [Attribute("1", desc: "Should message open automatically when joining server")]
    bool openOnJoin;
}

and this is json

{
    "discordLink": "https://something",
}

then:

SCR_JsonLoadContext ctx = ctx.LoadFromFile(path);
variable = new ServerMessageConfig;
ctx.ReadValue("", variable);
// false
minor agate
#

idk

#

I have never touched that API myself

ocean kernel
#

I feels like it should load what it can and keep openOnJoin as default

minor agate
fervent cedar
#

No I didn't even know that was a thing, I'll try it out some time today to use BaseContainerTools

minor agate
#

Then on top of what I show you there

#

also use/deal with the ResourceManager

#

For example if you need a meta file

#

resourceManager.GetMetaFile(filePath);

#

You will notice,that the meta file itself is a BaseContainer too

#

Which means you can use the BaseContainer class family

minor agate
#

ConfigClassHere someVar = SCR_ConfigHelperT<ConfigClassHere>.GetConfigObject(configPath)

ocean kernel
#

Nice

#

That is more or less what I would have had to type up on my end anyway to get what I want

torn bane
void chasm
#

Is it possible to set a maximum rank on a player?

#

For example I want the maximum obtainable rank to be corporal

quiet drift
fervent cedar
#

the basecontainer is kinda annoying but looks like it works


        m_API.SetVariableValue(
            entitySource
            , {
                new ContainerIdPathEntry("components", componentIndex)
                , new ContainerIdPathEntry("Simulation") 
                , new ContainerIdPathEntry("Axles",t_Index)
                , new ContainerIdPathEntry("Suspension") 
            }
            , "MaxSteeringAngle"
            , "" + t_fSteeringAngle * 1.5
        );

going through hierarchy of multiple containers x_

#

it does however beat manually changing values on prefabs etc. with a mouse and keyboard

craggy jolt
#

How do you upcast from BaseWorld to World? ๐Ÿค”

#
SomeSystem.Cast(World.Cast(parent.GetWorld()).FindSystem(SomeSystem))
``` => `Cast not supported on type 'World'`
sweet badger
craggy jolt
#

What a mess

#
SomeSystem.Cast(ChimeraWorld.CastFrom(parent.GetWorld()).FindSystem(SomeSystem))
#

@minor agate Is this still faster than addressing a static singleton variable?

craggy jolt
ocean kernel
#

Now add 4 null checks

craggy jolt
#

Might as well crash the game if its null at that point blobdoggoshruggoogly

craggy jolt
#

GIB walrus operator

craggy jolt
dire sinew
#

Just do implicitly directly tbh: ChimeraWorld world = ent.GetWorld();

pliant ingot
vernal moat
craggy jolt
vernal moat
craggy jolt
#
ChimeraWorld world = ChimeraWorld.CastFrom(gameMode.GetWorld());
```Vanilla lines everywhere
west prism
#

anybody can help me to make a server like Dayz?

sweet badger
sweet badger
craggy jolt
#

Just got a real lesson why its bad, had gamemode prefab with my component open in workbench tab and it messed with same gamemode instance and component in world editor, making workbench component "singleton" instead of world editor one.

#

Vanilla components also sent out warnings:

21:08:37.802   SCRIPT    (W): 'SCR_AdditionalGameModeSettingsComponent' exists twice in the world!
21:08:37.802   SCRIPT    (E): Trying to register a SCR_BuildingDestructionManagerComponent, but one is already registered!
21:08:37.802   SCRIPT    (W): 'SCR_PerceivedFactionManagerComponent' exists twice in the world!
21:08:37.802   SCRIPT    (W): 'SCR_PlayerListedAdminManagerComponent' Multiple instances of the 'SCR_PlayerListedAdminManagerComponent' exist in the world!
ocean kernel
#
if (SCR_Global.IsEditMode())
    return;
craggy jolt
#

Yeah, but I guess I'm gonna try doing it the right way without singletons

ocean kernel
#

I won't. The right way for me is the way that's convenient for me.

fringe prairie
desert escarp
#

Give it like 4-5 more years in A4 when you'll find a niche fix in this channel to an issue you've been having for days

sleek dove
#

Casting down world need to use special CastFrom method

inland bronze
#

Is there an example you could provide with moving the attributes to the entity class, or a vanilla script to reference? Not entirely sure what you mean

#

I guess more so I understand how to move it there, but not sure how to access that attribute in the component once moved

#

or wait, should work as

CE_UsageTriggerAreaClass attributes = CE_UsageTriggerAreaClass.Cast(GetPrefabData());
``` yeah?
torn bane
inland bronze
#

Additionally, to go back to the original issue I was having, I verified it's not a timing issue, nor does it seem to be related to any EntityFlags, as clearing them does not making a difference.

But it's %100 related to the TriggerAreaEntity being a child of the building. The component variable can be set with a area entity that is not a child of the building, just not with one that is a child. So I'm not sure what I could do to fix that currently ๐Ÿค”

#

other than, yknow, making the area entity not a child of the building, but kinda not an option with how it's been setup

sleek moat
#

anyone had an issue when spawning a prefab via an action it is spawning a duplicate of the prefab? The script isn't running twice

ocean kernel
minor agate
ocean kernel
minor agate
#

But you do not use Exp

ocean kernel
#

I will if it means my code works correctly

minor agate
#

๐ŸŸฉ

ocean kernel
#

I have been working on this project on and off for like 7 months now

sleek moat
fringe prairie
#

Yes MANW submissions needing to be functional with latest version of the game would be a nightmare if a massive update comes out right before the deadline haha.

red cedar
#

is there a handy way to know which map the server is running on via script without reading the mission headers ?

#

why is it always when i ask for help that i find it...
GetGame().GetWorldFile() does the job

minor agate
#

It's like when you learn from a new brand you never "seen/heard" before and then suddenly you notice it everywhere in the streets

red cedar
#

same happens when i learn a new word in english, it only starts to exist after i learn it lmao

ocean kernel
#

what is this

00:35:06.074 WORLD        : UpdateEntities
00:35:06.074  WORLD        : FixedFrame
00:35:06.074   SCRIPT    (E): Usage of released BaseResourceObject 0x000002B2F8562F70 in:
00:35:06.074   SCRIPT    (E):    -- Stack trace --
00:35:06.074   SCRIPT    (E):    HandleMeleeSound() scripts/Game/Character/Melee/SCR_MeleeComponent.c : 214
00:35:06.074   SCRIPT    (E):    ProcessMeleeAttack() scripts/Game/Character/Melee/SCR_MeleeComponent.c : 315
00:35:06.074   SCRIPT    (E):    Update() scripts/Game/Character/Melee/SCR_MeleeComponent.c : 472
00:35:06.074   SCRIPT    (E):    HandleMelee() scripts/Game/Character/SCR_CharacterCommandHandler.c : 20
00:35:06.074   SCRIPT    (E):    -----------------
00:35:06.075   ENGINE    (F): Crashed
00:35:06.560 WORLD        : UpdateEntities
00:35:06.560  WORLD        : FixedFrame
00:35:06.560   RENDER       : ----------------------------------------------------------------
00:35:06.560   RENDER       : ----------------------------------------------------------------
00:35:06.560   RENDER       : Rend: Fps:1000000.00 (0.00ms) | Present 0.00ms | Wait4GPU 0.01ms (graphical 0.00 + copy 0.01) | defrag 0.00ms
00:35:06.560   RENDER       : Rend: DP:0000 DPI:0000 DPR:0000 DPID:0000 Tri:00000 Vert:000000 CSRun:00|AllV:00x(00000) AllI:00x(00000) BegV:00x(00000) BegI:00x(00000)|TRes:0291
00:35:06.560   RENDER       : ----------------------------------------------------------------
#

guid 9d662355-6080-4cf8-b5af-4af984ff82fa if anyone's interested

spark otter
#

Im trying to do a loadout saving mod and Im really struggling with how this system works. Why is c SCR_PlayerController.GetLocalPlayerId() always returning 0 on server. If I skip the check for ```c
if(playerId == SCR_PlayerController.GetLocalPlayerId())

red cedar
#

when i had to toy with the loadouts i just made my own system as i found it less confusing

abstract crescent
#

u should use GetLocalPlayerId for client side logic only.

spark otter
#

so how does a vanilla dedicated server return the correct player id when a player has a saved loadout?

#

is DoSendPlayerLoadout and DoSetPlayerHasLoadout not actually run on a dedicated server? if not, what tells the server that there is a loadout and its valid?

#

I gotta be missing something cuz if that always returns zero, saved loadouts would not work in vanilla

abstract crescent
#

GetLocalPlayerId works only on client side, server sends DoSendPlayerLoadout by Rpc to all players and players locally filter message by "playerId == SCR_PlayerController.GetLocalPlayerId()"

spark otter
#

yeah I threw a print in DoSendPlayerLoadout that is only showing on the server though. should be showing on client no? ```c
[RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
override protected void DoSendPlayerLoadout(int playerId, SCR_PlayerLoadoutData loadoutData)
{
Print("[CPL DEBUG] DoSendPlayerLoadout - playerId: "+playerId+", local playerId: "+SCR_PlayerController.GetLocalPlayerId()+" Local Loadout avail? "+GetLocalPlayerLoadoutAvailable().ToString());
if (playerId == SCR_PlayerController.GetLocalPlayerId())
m_LocalPlayerLoadoutData = loadoutData;
}

#

Im thinking Im just going to add an action to the arsenal to load their loadout, that will probably be much easier.

abstract crescent
#

do u see this two videos about replication and how it works?
https://youtu.be/asWxIIHT6d0?list=PLfUcrRpCM_fKjkTrkV-bqnknVbFCPA3YU

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
spark otter
#

I know the basics yes

#

from what I understand that function should be executed on both server and all clients

#

but the print is only printing on the server

#

which makes no sense to me

ocean kernel
spark otter
#

does it not execute on the client at all?

minor agate
#

So broadcast is useless here

spark otter
#

I mean its a vanilla function

#

I only added a print

spark otter
#

hah yeah I figured it worked fine in vanilla... ๐Ÿคทโ€โ™‚๏ธ

minor agate
#

iirc the player controllers in AR only exist on their specified clients

spark otter
#

It is a bit janky in vanilla too though, so maybe I should just add an action to load loadout on the arsenal instead.

minor agate
#

Always ask / test

abstract crescent
#
  • debug and breakpoints are yours best friends ๐Ÿ˜„
minor agate
#

It's on SCR_ArsenalManagerComponent

#

in vanilla

#

Which is on gamemode, which is on all players

#

So the broadcast must work

spark otter
#

yeah I have no idea why its not printing on clients at all. Ive already spent days on this so Im just going to quit and do an action to load instead.

minor agate
#

You should have called it from auth

spark otter
#

Vanilla function calls it, away from PC rn

spark otter
#

How do I tell if those are called from authority or not?

slow acorn
#

How does one force a player to face a certain direction live? SetYawPitchRoll does not seem to be doing the trick alone. Offering 2 cookie for example ๐Ÿช

fringe prairie
#

There's RplRole, forget how to get it lol

ocean needle
#

what would be the best way to pass (or fetch) a value to a user action from another?

i have a user action to skip time and a user action to adjust the time between 1-24 hours but i have no idea how to get the time value to the first user action

any help would be much obliged

fringe prairie
# ocean needle what would be the best way to pass (or fetch) a value to a user action from anot...

Quick breakdown:

User actions trigger on server and client for that set entity instance. Think of it like broadcast, so all players in the area run the script locally even if they aren't the one that pressed the button (this is also why it gives you a pUserEntity so you can filter). This can be used to have a user action trigger for everyone when one person pushes it, but it won't trigger again when a new player joins the game, so desync happens.

Depending on needs, in your example you probably want time set globally, but you need to get current time locally. UserAction has a function called "GetActionName" which you can override in your version of the action to return the current time (for the action text). Get the current time probably from ScriptWorldClock. Set on server (technically ScriptWorldClock says set world time only works on server so might be ok just calling it directly and not having to mess with the other methods to disable local broadcast/sending data locally).

ocean needle
#

in my case itll only be used in sp probably shouldve mentioned that sorry

ive also already got the time changing with screen effects and stuff setup i just dont know how to communicate the 12 hour sleep time to the script that does the main stuff

river imp
desert escarp
#

I've had issues calling broadcasts from the PC even if it was on the authority

timid citrus
#

Is there a way to add visual gizmos i cant find any methods that work

#

Like a ring around an area

desert escarp
craggy jolt
#

Anyone managed to have Debug.KeyState working?

#

Trying to get left shift state with Debug.KeyState(KeyCode.KC_LSHIFT) but its always 0

#

Wrong context perhaps?

#

Using in _WB_AfterWorldUpdate

#

Tried adding Debug.ClearKey(KeyCode.KC_LSHIFT); before of after the check, same picture

delicate edge
#

Hey all, has anyone figured out how to extract name of MapDescriptorComponent? I'm trying to scan the map for all the cities and extract their names

delicate edge
#

Nvm, if anyone has this problem I resolved it using SCR_EditableCommentComponent, it's usually assigned to the same entity that MapDescriptorComponent points to

west prism
#

when i set building on map there is grass inside can i do something like grass cutter or so, or is something in options?

craggy jolt
#

Why doesn't _WB_GetEditorAPI work (returns null) on some entities like GenericEntity but works on say SCR_DestructibleBuildingEntity?

torn bane
narrow aspen
#

Any direction to add a new comsumption type inside ResourcePlayerContoller for arsenalitem request? for exmple a persistance bank account for player.

#

any specific RPL operation need to be cared?

craggy jolt
#

But if I attach same component to SCR_DestructibleBuildingEntity, event function _WB_AfterWorldUpdate fires in both Workbench and World Editor

#

This explains why API was null because function was firing inside workbench and not world editor

torn bane
#

It may be setting some flags that cause it to activate

craggy jolt
#

๐Ÿค”

torn bane
#
//! Called after updating world in Workbench. The entity must be visible in frustum, selected or named. You can use editor API here and do some edit actions if needed.
#

Is your entity visible, selected or named? ๐Ÿ™‚

craggy jolt
#

Visible and selected, but not named

#

Naming did nothing

torn bane
#

Maybe releated to ```
//------------------------------------------------------------------------------------------------
override int _WB_GetAfterWorldUpdateSpecs(IEntitySource src)
{
return EEntityFrameUpdateSpecs.CALL_WHEN_ENTITY_VISIBLE;
}

#

My bottom line is that generic entity or others are not inheriently different, their setup simply has a lot more configured. So check what is the minimum needed to get it to call by looking at how others did it

#

on generic entity it says

//! Called after _WB_OnInit or also later when editor needs to know whether _WB_AfterWorldUpdate needs to be called and when. Return value can be either 0 (event will not be called at all) or any combination of EEntityFrameUpdateSpecs. Avoid CALL_ALWAYS flag whenever possible to prevent performance issues
    event int _WB_GetAfterWorldUpdateSpecs(IEntitySource src);

so it returns 0 by default which means it will not be called at all as the docs says.

craggy jolt
#

No way to enable that from the component so I don't have to touch the entity I assume?

#

Using my component under generic entity is a no go then it seems

#

Anyway, thanks for the explanation

quiet drift
#

Hello, I have a replication of a variable and the players change it's state by pressing a button, should I keep the call on local client when publishing the project update ?
I don't remember if players can play reforger without internet connection and if yes, if the replication work also without internet

dire sinew
#

SP requires similar considerations like hosted server. For instance, the method specified at onRplName has to be called manually for the server.

quiet drift
#

In this one I have to call it also on local client otherwise I couldn't test it anymore outside of MP environment

ocean needle
ocean kernel
#

any secret stuff make it to the hotfix?

ocean needle
outer token
delicate edge
#

Is there any way to access pathfinding api from script? (i.e. to calculate on-road distance between points)

limpid bloom
#

After installing the ConflictPVERemixedVanilla2.0 addon, I get this error when I try to test the conflict scenario I made. Does anyone know how to fix this?

spark otter
desert escarp
#

Is there a way to grab an image of what a camera is looking at?

desert escarp
#

@ocean kernel I believe you've done something like that

#

I think I may have found it in SCR_CameraPostProcessEffect

ocean needle
#

is there any way to change the players angle? just want to force them to look in a specific direction
only thing ive found that sorta works is CharacterControllerComponent.SetHeadingAngle but is there anything that takes a vector? every other method ive tried hasnt worked or something has prevented it

ocean kernel
#

At this point it's hard for me to think about what I didn't do

desert escarp
#

Or does it even care about the UV Map

ocean kernel
#

I always try to make sure the screen is separate mesh then it has its own material

#

UV is how texture is projected on model

west prism
#

anybody can help, when i jump from aircraft car. in water i die is there fall damage to edit?

fervent cedar
#

Just override the lookup/lookleft inputs until character looks at sth

#

screen to world position to see how far from center the position is

#


                CharacterAimingComponent t_Comp_Aim = GetAimingComponent();
                CharacterHeadAimingComponent t_Comp_HeadAim = GetHeadAimingComponent();
                if (t_Comp_HeadAim && false) {

                    float t_fRightAngle = t_Comp_HeadAim.GetAimingRotation()[0];
                    float t_fUpAngle = t_Comp_HeadAim.GetAimingRotation()[1];

                    bool t_bIsGoingUp = t_fRightAngle > 0;

                    if (t_fRightAngle > 1 || t_fRightAngle < -1) {

                        float t_fMissingFromMid = t_fRightAngle;
                        float t_fChange = t_fMissingFromMid;
                        
                        if ((t_fRightAngle < 5 && t_bIsGoingUp) || (t_fRightAngle > 5 && !t_bIsGoingUp)) {
                            t_fChange = 5;
                        };
                        t_fChange = t_fChange * dt;

                        if (true) {
                            t_fChange = 0 - t_fChange;
                        };

                        // f_ActMan.SetActionValue("CharacterFreelookHorizontal", t_fChange);
                        // Print(t_fChange);
                    };

                    // float o_fUpAngleLimitUp = 1;
                    // float o_fUpAngleLimitDown = -1;
                    float o_fUpAngleLimitUp = 10;
                    float o_fUpAngleLimitDown = 5;
                    float t_fUpAngleMid = o_fUpAngleLimitUp - o_fUpAngleLimitDown;
                    t_fUpAngleMid = o_fUpAngleLimitUp - t_fUpAngleMid;

                    float o_fUpAngleLimit2Up = t_fUpAngleMid + 5;
                    float o_fUpAngleLimit2Down = t_fUpAngleMid - 5;

                    // if (Math.RandomFloat(0, 100) > 95) {
                    //     Print(t_fUpAngle);
                    // };

I did this once to make the character look centered in the car once

#

                        f_ActMan.SetActionValue("CharacterFreelookHorizontal", t_fChange);
                        f_ActMan.SetActionValue("CharacterFreelookVertical", t_fChange);
#

basically simulates moving the mouse(or any input) in freelook

#

SCR_CharacterControllerComponent > OnPrepareControls
There's an example of overriding this function in vanilla somewhere too

ocean needle
#

legend ty

dire sinew
vocal fable
#

would anyone care to help me understand what relates to player aiming/raising weapon. im trying to create a zone that prevents shooting and use of grenades but having no luck finding what actually controls that

fervent cedar
#
            f_ActMan.SetActionValue("CharacterFire", 0);

Basically you do this every update and it will force the characterfire input to be 0

#

Even if a player clicks left mouse, the input in-game will be 0

vocal fable
#

so gun wont work but if they click UI in same zone it will work?

fervent cedar
#

Yea

vocal fable
#

you OG

fervent cedar
#

This ActionManager manipulation is really good and can do a lot with

vocal fable
#

Thank you very much!!!!!

vocal fable
fervent cedar
fringe prairie
# desert escarp Or project a camera onto a material

Set the material BCR map to $rendertarget (like on a 2 polygon screen)
Use SetRenderTarget with layout (with items nested under RTTextureWidget) to put GUI > any $rendertarget on the IEntity
Put camera on the GUI layout using RenderTarget under the RTTextureWidget.
Searching the terms I've given you should fill in the blanks - don't have it in front of me. MFD Framework does this (except cameras for now)

timid citrus
#

Don't suppose I can change camera far plane max distance?

fringe prairie
timid citrus
fringe prairie
#

Oof, think engine holds a deathgrip on it tbh

fringe prairie
#

Also with all of this work on cameras how do you propose deconfliction? @desert escarp

Working on some camera stuff right now and I know cameras are also used by some other mods and I can see an issue with two components colliding on the same camera index. Not sure if there is a good way haha

desert escarp
#

Its only on the client as well no one else gets the camera spawned

fringe prairie
# desert escarp Idk if this is the solution but for me I spawn cameras only on the clients that ...

There isn't a "good" way to get if a camera is currently in use, as far as I can tell. My initial idea would be a gentlemen agreement to standardize index usage. The "camera entity" is just a wrapper entity that manages a camera with given index. As far as I can understand all cameras "exist" but only viewed when called by the RenderTarget widget's SetWorld method. The camera entity simply translates transforms to the camera, unfortunately.

timid citrus
fringe prairie
#

Which is also why you only ever get the position from the engine with stuff like "GetCamera" it always exists, you just manage the position of it. They are never created or destroyed by us. SetWorld might do something under the hood to "activate it", maybe manipulation of the camera is not allowed before SetWorld is called - or SetWorld is simply a way to translate whatever index, it's data, from a given world to the layout, haven't gotten that far but it's my assumption.

feral falcon
#

Might be a weird question... in other languages you can essentially override or implement a way of hashing or comparing. Is there a way to add that to our custom types? I see the string type has a hash/compare function albeit it's an external thing?

Would like to have a type be used in a set or map, where checking for its existence doesn't need to be done by ref... if that makes sense

minor agate
#

You can have multiple worlds at the same time

fringe prairie
#

Figured as much just didn't know if setworld actually tells the camera to instantiate in engine or if they just "exist" and have data based on the SetCameraEx - etc. functions.

slow acorn
#

How does one force a player to face a certain direction live? Offering 3 cookie for example

inland bronze
#

3 cookies now? Man that's a good deal, if I only knew sadge

desert escarp
#

How do I blacklist an item from being saved in a loadout

ocean kernel
west prism
#

"Can someone help me make a ShopSystem and Zelik_Banking so that I can buy from a Trader using ZEL_Cash?"

red cedar
#

When spawning in a medical kit in my player's inventory via script i receive this message(and the items refuses to spawn)
'SCR_ResupplySupportStationComponent' needs an entity catalog manager!
Tho my game mode does not use any supplies or whatever, is there something i'm missing in the prefab's config that is preventing me from spawning theme or some kind of manager in the world ?

open pier
#

Is there a specific function I can call to find all entities by type? More specifically finding any vehicle on the map and storing that result into an array?

pliant ingot
open pier
ocean kernel
# open pier There happen to be a more minimal way to do this? Just looking to find them once...

untested but feel free to try it

SCR_EditableEntityCore core = SCR_EditableEntityCore.Cast(SCR_EditableEntityCore.GetInstance(SCR_EditableEntityCore));
set<SCR_EditableEntityComponent> entities = new set<SCR_EditableEntityComponent>;
core.GetAllEntities(entities, true, false);

foreach (SCR_EditableEntityComponent editableEntityComponent : entities) {
    if (editableEntityComponent.GetEntityType() == EEditableEntityType.VEHICLE) {
        Vehicle veh = Vehicle.Cast(editableEntityComponent.GetOwner());
        // ...
    }
}
#

Btw are maps some sort of extremely underperforming data type? I dont see them often in vanilla code

open pier
open pier
torn bane
open pier
# torn bane If the saving is related to persistence, then vanilla will take care of this in ...

Yeah, mostly issues with different entity types, Characters, Vehicles, Items, saving at different times before the restart which players have utilized to dupe items 8^). Figure just finding EPF_PersistenceComponent on each entity that allows this and calling .Save() on it is a workaround.

Glad to hear that'll be a vanilla feature in the near future too. We end our game with a timed call to GetGame().RequestClose(); atm, with our docker container set to restart: unless-stopped to get it back up.

torn bane
torn bane
# open pier Yeah, mostly issues with different entity types, Characters, Vehicles, Items, sa...

GetGame().RequestClose() yup that is more or less what the new command will do, except also save and when it is all comitted to local storage or e.g. HTTP, then it will shut it down. And then docker or a batch script or what ever can restart it. rcon command will make it so that server hosts can control the server via web UIs and not kill the app but rcon connect to it to do stuff instead.

#

The problem is exactly why with EPF shutdown saving is sadly not as reliable. there might be some changes beteen last auto save and shutdown, and not all data might be written on shutdown before it gets killed

open pier
# torn bane `GetGame().RequestClose()` yup that is more or less what the new command will do...

The commitment to the storage is the tricky part I had to wrap my head around, figure let it loop through saving, give it a few seconds then Close. And yeah what I read in EPF it did look like it was handled automatically, but as the dupes arose, we realized it wasn't all saving everything as it should have. Characters are always where they should be, while you'd find your vehicle a few minutes back

ocean kernel
torn bane
ocean kernel
#

I mean just the time taken to make a decision. With map it would be constant time vs longer depending on how many statements you go through.

pliant ingot
minor agate
ocean kernel
#

vs if (...) { return ScriptComponent; } 10 times

open pier
minor agate
#

Why enum?

ocean kernel
#

I'm giving an example to get a straight answer to my question

minor agate
#

It depends on your data

ocean kernel
#

Ok forget it I'll just measure it on my own and never tell anyone the results

minor agate
#

No matter what

pliant ingot
minor agate
#

There is no magic thing that works best for all

ocean kernel
#

Okay so

#

map<string, string> 10% slower than a chain of 20 ifs

#

map<int, string> faster

#

I guess it's hashing those strings

#

makes sense

dire sinew
#

Did you check arrays? They likely outperform maps when you got so few entries.

fervent cedar
#

I always assume maps are faster tahn arrays especially when accesing random eelemnts

minor agate
#

Simple arrays are usually king. Dont over complicate it. The pc also wont like it

ocean kernel
#

It sucks a bit because maps are really convenient for me

fervent cedar
#

foreach and looking for the
t_Data.m_sDataID == "DataIDImLookingForTonight"
over an array of data class is better than using a map
with <string, data> and just using map.Find("DataIDImLookingForTonight",t_Data)

#

?

#

I always assume map find is faster because forEach stuff menas more actions executed in scripting

west prism
#

anybody can help with trader Clothing

pliant ingot
high hawk
#

You have set it up incorrectly

floral sun
#

I created a simple entity with the following code, and EOnInit isn't being called for some reason. Did I do something wrong?

[EntityEditorProps(category: "GameScripted/Misc", description: "")]
class M_TestEntityClass : GenericEntityClass
{
}

class M_TestEntity : GenericEntity
{
    //------------------------------------------------------------------------------------------------
    override protected void EOnFrame(IEntity owner, float timeSlice)
    {
        // remove if unused
    }

    //------------------------------------------------------------------------------------------------
    override protected void EOnInit(IEntity owner)
    {
        Print("Init Test Entity");
    }

    //------------------------------------------------------------------------------------------------
    void M_TestEntity(IEntitySource src, IEntity parent)
    {
        // SetEventMask(EntityEvent.INIT | EntityEvent.FRAME);
    }

    //------------------------------------------------------------------------------------------------
    void ~M_TestEntity()
    {
        // remove if unused
    }
    /*
    override void EOnActivate(IEntity owner)
    {
        super.EOnActivate(owner);
        SetEventMask(owner, EntityEvent.FRAME);
    }
 
    override void EOnDeactivate(IEntity owner)
    {
        super.EOnDeactivate(owner);
        ClearEventMask(owner, EntityEvent.FRAME);
    }
    */
}
#

Ah, forgot to uncoment SetEventMask(EntityEvent.INIT | EntityEvent.FRAME);

#

This helped

#

Another question, how can I have something only run when the game is actually running and not just in the World Editor?

inland bronze
high hawk
#

Yes

fringe prairie
#

I am trying to use a ScriptGameComponent, and it fires on server but not clients. Do you have a solution for using a component across GenericEntity AND GameEntities? Curious to know your approach.

#

OnTicksOnRemoteProxy, obviously

craggy jolt
#

BaseWorld::proto external bool QueryEntitiesByAABB(vector mins, vector maxs...
What are mins and maxs relative to here? Am I right to assume they're opposite vertices of a cuboid with world 0 being the center of it?

#

So say Vector(0,0,0), Vector(12800,12800,1000) would cover the entire Everon?

craggy jolt
#

Is there no GetVariableValue in World Editor API? No way to say read directly from the edit controls?

#

Attempting to do something with VolumeEntity, hoped to read its BoundingVolume values off workbench controls at set them to accessible member variables during editing as there are no proto functions to access it otherwise. Are my attempts futile?

craggy jolt
#

Tried doing this on an entity (tried both child of GenericEntity and VolumeEntity) to no luck:

    [Attribute(uiwidget: UIWidgets.BoundingVolumeEditor)]
    protected ref BoundingVolumeScr m_bbTest;
#

Still no volume widget working. Is there a trick to it or my attempts are futile?

#

Copy pasting the size manually works, if only I could make it paste size to accessible member class automatically

#

Waiting for a dev to tell me its futile and I'm wasting my time

#

inb4 code your own bounding box manipulation widget

minor agate
craggy jolt
#

VolumeEntity has bounding volume property but its hardcoded and inaccessible

high hawk
#

Rigidbody

And set bounding box maybe?

Also Diagtool should have this info, maybe I'm wrong pepeSmirk

craggy jolt
# minor agate I do not understand what the issue is

So I tried having my own bounding volume property (BoundingVolumeScr) and then
a) Have bounding volume tool work on the property directly ([Attribute(uiwidget: UIWidgets.BoundingVolumeEditor)])
b) Copy VolumeEntity's hardcoded bounding volume to my own property through API tools but there is no property getter only setter (SetVariableValue)

#

Neither of these worked:
a) Widget doesn't appear no matter what I did
b) No getter to script-copy hardcoded volume to accessible volume property

craggy jolt
minor agate
#

It's there on Engine rn, just not on AR version

craggy jolt
#

You mean uiwidget: UIWidgets.BoundingVolumeEditor doesn't?

minor agate
craggy jolt
#

There is no way to copy the volume data produced by the widget to scripted attributes through WB API either, right?

#

Not through attribute proto getter but through API somehow similar to how you can edit by path through WorldEditorAPI::SetVariableValue?

craggy jolt
#

Thanks, I'll check it out

serene fox
#

Morning, is there a build in method, to check if the character is inside defined bounds?

desert escarp
#

Or would I need a HUD on the player with an RTTextureWidget at all times?

#

and just reference that and set it throught that

fringe prairie
#

Look up SetRenderTarget method, used to be called SetGUIWidget, in the script editor

desert escarp
fringe prairie
#

Pretty much, one widget type is for the set render target which will be the parent widget, and then your camera will be the other widget which supports the set render view method

desert escarp
# fringe prairie Pretty much, one widget type is for the set render target which will be the pare...
class SAL_DroneCommandStationComponentClass: ScriptComponentClass
{
}

class SAL_DroneCommandStationComponent: ScriptComponent
{
    Widget m_wRenderWidget;
    override void OnPostInit(IEntity owner)
    {
        SetEventMask(owner, EntityEvent.INIT | EntityEvent.FRAME);
    }
    
    override void EOnFrame(IEntity owner, float timeSlice)
    {
        if (!SCR_PlayerController.GetLocalControlledEntity())
            return;
        
        if (vector.Distance(SCR_PlayerController.GetLocalControlledEntity().GetOrigin(), owner.GetOrigin()) > 30)
        {
            if (m_wRenderWidget)
                delete m_wRenderWidget;
            return;
        }
        
         if (!m_wRenderWidget)
        {
            m_wRenderWidget = GetGame().GetWorkspace().CreateWidgets("{8B20F97E05A3E8E4}UI/CommandStation/CommandStationViewer.layout");
        }
        
        if (m_wRenderWidget)
        {
            RTTextureWidget textureWidget = RTTextureWidget.Cast(m_wRenderWidget.FindWidget("RenderWindow"));
            textureWidget.SetRenderTarget(owner);
            textureWidget.SetRenderView(owner, GetGame().GetWorld().GetCurrentCameraId());
        }
    }
}
#

Tried this and it's not rendering anything in the window

#

This is the layout

wild glade
#

Hi, does anyone have an idea, why my entity is not showing in the Entity Browser in the World Editor?
appearently there was an issue with another script, which caused the scripts not to reload properly

craggy jolt
#

The use of plural is prohibited at the end of combined keywords: e.g TAG_NotificationsComponent โ†’ TAG_NotificationComponent
What if my component defines lots of notifications in it? And I don't need several components per each notification. Convention still applies in that case?

hallow portal
#

Are we allowed to commission jobs here?
Happy to drop $100.

Really need a mod that api calls my backend to fetch user rank level.
Than using that level display the matching png rank symbol next to there name in the scoreboard, group menu, chat, voice chat, nametag ect.
So I would host the 100+ rank pngs in the server which the mod can use to display on the user.

I have the api/config setup
https://reforger.armaplatform.com/workshop/65D4909D9907A616-ZSURanks

Just completely lost for doing the above.

Basically end goal is to achieve insurgency sandstorm ranksystem thay fetches that info from my database.

So if anyone is happy to build this mod for me and hand over right to the code. Ill purchase it for $100 USD.

If this isn't allowed than my bad, Please remove ๐Ÿซก

Arma Reforger

Dev Test

craggy jolt
#

Gonna have to hand type the numbers and hope they fit the volume I need manually for now

craggy jolt
craggy jolt
fervent cedar
craggy jolt
#

Does component EOnDiag work at all? No matter what I do I can't trigger it to run.

#

Diag menu World -> Entity diag is true

red cedar
pliant ingot
craggy jolt
craggy jolt
#

So few options to draw debug from component side in world editor edit mode

#

Do I have to create my own entity on ArmaReforgerScripted constructor and have that do the drawing each world editor frame then?

#

About to try, unless somebody stops me and tells a better way

minor agate
#

You can just do it on the component itself

#

For WB, you must use the __WB methods

craggy jolt
minor agate
#

EOnFrame version in WB Word Editor (Edit mode) is the _WB_AfterWorldUpdate

#

EOnDiag
There is a setup for this, let me dust it as I do not recall it

craggy jolt
craggy jolt
#

Overloading event '_WB_AfterWorldUpdate' is not allowed ๐Ÿค”

minor agate
#

Override

#

no overload

craggy jolt
#
    override int _WB_GetAfterWorldUpdateSpecs(IEntity owner, IEntitySource src)
    {
        return EEntityFrameUpdateSpecs.CALL_WHEN_ENTITY_VISIBLE;
    }
```in my component code
#

Wut, I'm mixing something up

craggy jolt
#

I swear I tried _WB_GetAfterWorldUpdateSpecs inside component but it was erroring out with something similar

minor agate
#

You probably broke the compiler with something else somewhere (It happens)

craggy jolt
#

I get why it didn't work, I copied it from SCR_DestructibleBuildingEntity which is an entity and component has different function signature

#

fml, I spent half of today finding a way to draw debug for a component, rearranging my entire setup, etc

#

Big thanks for making me try that again, I was sure this function is only for entities

floral sun
craggy jolt
#

How do I know that furniture belongs exactly to certain house? It doesn't have Hierarchy component, so I can't reach either way. I see that SCR_DestructibleBuildingEntity does bounding box lookup for stuff to delete, I assume that's the only way?

frosty coral
craggy jolt
torn bane
torn bane
craggy jolt
#

Hypothetically, just wondering what you'd see as best solution.

torn bane
#

hierarchy on each would be ideal, but takes the most memory. having the root at least know all children would be neat so you can have some change to figure out the relationship in reverse for edgecases. it would have meant that if the house is destoryed we know which children to destory also ... we will see what solutions we come up for A4. it faces the same issues as AR in this regard

timid citrus
ocean kernel
#

the Shape class is very helpful

#

and debug text in world space

minor agate
#

So if anything. I would say just something to keep tabs, but not provide the same that hierarchy does

frosty coral
#

Since there is hierarchy discussion. Is there any performance (or memory, or any) cost to having this tick checked, if there is little to no parent-child assignment/unassignment happening.

ocean kernel
#

Hierarchy is such a basic concept though? Like all the clothes of a character etc... I would have thought something so basic and frequent would be made to be very efficient?

open pier
#

Is there any better way to be able to troubleshoot issues with replication? Our entity delete bug is back and I'm thinking it's too much stuff being replicated. Did some things to hopefully fix it, mainly adding if(!Replication.IsServer()) return; to user actions. Which seemed to help a little bit, until our player base and invisible entities, like gamemode, our safezone, in a certain bubble get deleted again. Anytime we put the server up, its a ticking time bomb.

ocean kernel
#

User actions have their own replication methods that determine if it runs on server or not

#

Actually I think it's pretty much only local or local+server, nvm

open pier
#

From my understanding from what's been said in here, if the user action isn't purposely isolated, it's automatically replicated on server and clients

ocean kernel
#

Only within the replication range

#

Well, if the entity is replicated on clients

#

Doesnt necessarily mean only in range

open pier
#

Which our safezone is normally bustling with people and a ton of stuff happening so I'd imagine there's a ton being replicated already

#

Previously, the gamemode got deleted, we thought that was the issue so we moved it far far away from everything, then after a couple months of it not happening. It happened again but the gamemode wasn't getting deleted with the rest of em. It mainly happens around the safezone and anyone and anything within it seems to get shoved off the stack and poofed away

#

To be able to run the diag arma on a running server would be dope, but understandably it's a huge security issue

ocean kernel
#

you can, but you need all players to be on diag also

open pier
ocean kernel
#

Is there a method to get me the highest rank out of all items the player is carrying?

#

Or do I have to iterate over all items then get their rank

minor agate
#

Add it everywhere and you lose it

#

The issue with buildings is that instead of only them being meshes and coliders on the parts of them. They are whole entities

#

Which means you have to do more expensive calculations, messing more with the scene tree which is affected more hwavily if the children entities are actually chindren and not flat. Same for replication if they happen to have rpl component. Among other things.

#

It is not the same as proxies on buildings lile in RV

#

It was just more convenient for env designers to work the buildings like this

minor agate
ocean kernel
#

Also how do I completely reset the perceived faction thing? The intention is to load a loadout

open pier
narrow aspen
#

Dose the tryConsumption and trySpawnIntoPlayer function in ResourcePlayerController work on client side? And what can I do to add a additional consumption in it, to say a score/money account link to a serverside file

minor agate
#

@torn bane

torn bane
#

Unlikely as it's not configured to be insert able. I have another person in my DMS with the issue. Let me check their log

#

But GetGame().GetGameMode() becomes null mid game, which can only really happen if the entity was deleted. I told them to put a logger component on it and this was the result

2025-07-12 19:41:18.710  SCRIPT       : RL_GameModeRoleplay Other Delete
2025-07-12 19:41:18.710  SCRIPT       :    -- Stack trace --
2025-07-12 19:41:18.711  SCRIPT       :    ~RL_GameModeRoleplay() Scripts/Game/Core/EL_GameModeRoleplay.c : 12

So it was likely gamecode who deleted it. Very very odd

#

My only thought is that it is some script that is looking for entities at 0 0 0 from a query, and queues it to be deleted later by some mechanism which is fired from our code, so you do not see it in script. Move your gamemode to something like 123456 -6666 123456 where no world query would ever hit and see if it still happens?

ocean kernel
#

i didnt even mod any of those

22:16:01.986 WORLD        : UpdateEntities
22:16:01.986  WORLD        : FixedFrame
22:16:01.986   SCRIPT    (E): Usage of released BaseResourceObject 0x0000029EA9B8A020 in:
22:16:01.986   SCRIPT    (E):    -- Stack trace --
22:16:01.986   SCRIPT    (E):    HandleMeleeSound() scripts/Game/Character/Melee/SCR_MeleeComponent.c : 214
22:16:01.987   SCRIPT    (E):    ProcessMeleeAttack() scripts/Game/Character/Melee/SCR_MeleeComponent.c : 315
22:16:01.987   SCRIPT    (E):    Update() scripts/Game/Character/Melee/SCR_MeleeComponent.c : 472
22:16:01.987   SCRIPT    (E):    HandleMelee() scripts/Game/Character/SCR_CharacterCommandHandler.c : 20
22:16:01.987   SCRIPT    (E):    -----------------
22:16:01.987   ENGINE    (F): Crashed
22:16:02.085  WORLD        : FixedFrame
22:16:02.085   RENDER       : ----------------------------------------------------------------
22:16:02.085   RENDER       : ----------------------------------------------------------------
22:16:02.086   RENDER       : Rend: Fps:1000000.00 (0.00ms) | Present 0.00ms | Wait4GPU 0.01ms (graphical 0.00 + copy 0.01) | defrag 0.00ms
22:16:02.086   RENDER       : Rend: DP:0000 DPI:0000 DPR:0000 DPID:0000 Tri:00000 Vert:000000 CSRun:00|AllV:00x(00000) AllI:00x(00000) BegV:00x(00000) BegI:00x(00000)|TRes:0357
22:16:02.086   RENDER       : ----------------------------------------------------------------
#

stack trace doesnt tell me anything, I didnt touch any of those

#

gg

inland bronze
#

Trying to wrap my head around replication a bit.

I have a server-side system that sets a custom class variable in a component. Custom class has the replication methods set up (inject, extract, etc.). I have the variable set up as a RplProp in the component, and when I go to set it from the server-side system, I do Replication.BumpMe() (in the component) upon setting the variable. But still, the variable returns null on client.

What am I missing? Assuming it's since I'm setting it from a server-side system

fervent cedar
#

returns null? What are you RplProp-ing?

inland bronze
# fervent cedar returns null? What are you RplProp-ing?

A custom class

With some janky testing Rpc'ing, I can get the variable to return as not null with a key press, but can't get it to set properly like I need to from the system.

And then additionally either way, can't get the variable to not be null when trying to perform a useraction unless I do Replication.BumpMe() in the useraction, which not sure about that thonk

open pier
# torn bane But GetGame().GetGameMode() becomes null mid game, which can only really happen ...

I think it was you who recommended me the same and I got the same result. We have moved the game mode which stopped it from showing it being deleted in the logs. On everon we have our gamemode even farther than that I believe, far asf in the NE or NW direction of the map. Which leads me to believe it's something with replication because it doesn't happen to everyone, just player entities mainly in the area of our safezone and our safezone entity.

#

When I am able to tonight I'm going to add some logging components to the character and anything else that seems to be affected. Vehicle don't seem to get deleted

desert escarp
#

But the RplProp should be the class itself

#

like [RplProp()] SAL_RplClass m_RplClass;

#

As an example

#

Then just change the variable in the class object and call replication bumpme

#

Also should use RplSave and RplLoad so it replicates as well

inland bronze
# desert escarp The variable itself should use the extract, inject, etc...

I think you misunderstood or I was hard to understand.

The variable is a custom class. So protected ref CustomClass m_CustomClass; And that variable is setup as the RplProp.

The custom class has the extract, inject, etc. methods is what I was saying.

Very new to setting up a custom replicated class, so definitely learning as I go. I watched the bootcamps on replication, but I guess what I'm trying to do wasn't really covered and that's where I'm getting stumped a bit.

And not many vanilla classes to reference for my situation ๐Ÿค”

#

I just need to ask more questions, but hate hogging up this channel with so much stuff ๐Ÿ˜…

desert escarp
#

Here's an example

#

This is one we use to have slot data for our gamemode

inland bronze
#

Immensely helpful, actually, thank you! ๐Ÿ˜„

minor agate
#

Something did went wrong during that call. Thats it.

rapid ferry
#

Any ideas why removing from my map says false? .Remove returns false,

    protected ref map<IEntity, int> test = new map<IEntity,int>();
    override event protected void OnPostInit(IEntity owner)
    {
        test.Insert(owner, 69);
        Print("Contains: " + test.Contains(owner));
        Print("Value: " + test.Get(owner));
        Print("Remove: " + test.Remove(owner));
        Print("Contains: " + test.Contains(owner));
    }```
Results in:
```  SCRIPT       : Contains: true
  SCRIPT       : Value: 69
  SCRIPT       : Remove: false
  SCRIPT       : Contains: false```
#

Not a big deal, but was confusing

west prism
#

anybody know how i can reduce Fall Damage

#

not OFF

#

can someone help with Fall Damage Reduction? i die when jump just from house

fervent cedar
west prism
#

yeah but there is speed i dont know how i have to set up it to make distance dont deadly by 4meters House

ocean kernel
west prism
#

it was hard work ๐Ÿ˜„

minor agate
ocean kernel
#

Ok cool I'll just give up on this project I've put a hundred hours in then

minor agate
#

Even on our side on the cpp level, it wont twll you directly

#

Report the crash instead, then we can have a look

#

Indirect crashes are not something you could get a direct pointer to

#

They would not be indirect in those cases

#

So when you arrive there then is huge pain

ocean kernel
#

It could at least tell me the class name of the resource object or something

minor agate
#

And check

ocean kernel
#

Is there something beyond spam?

minor agate
#

Yes iirc

#

Let me grab it in a bit

ocean kernel
#

spam isnt even mentioned on wiki

minor agate
#

Released object is telling you that you tried to use a resource that was invalid (cleared)

#

The fault is most likely at what tried to use it on that callstack

#

Not checking for validity

ocean kernel
#

Couldnt the type be inferred from what it was trying to use?

minor agate
#

If the handle is invalid, it lost all info

ocean kernel
#

Same crash different stack trace

minor agate
#

Same crash type*

#

Do you have mem dump along with thess?

minor agate
ocean kernel
#

I did press send

#

No I don't believe so. It happens after a custom character dies.

#

Or gets melee damaged apparently

west prism
#

can i fix this error?

#

its about 300 errors like this

minor agate
# rapid ferry

The return description is quite unfortunate. What it was actually trying to convey is that it will return true if the element was actually removed after the call, and false if it didn't exist and failed to remove.

#

Ah I misread. That is odd. I will check

minor agate
# ocean kernel

They both are actually related PepeHmmm. In terms of how they happened.

#

It happens when there is a Trace check for when doing damage or so.
TraceParam.SurfaceProps is what is causing the issue.

#

In those cases, that is the BaseResourceObject that was released before you were finished using it

minor agate
#

Are you doing something on client while it is far away from something else (Like long distance hit)?

#

Or deleting an entity after it or something else being hit?

#

@ocean kernel Main issue is that the scripts there expect it to not be released

#

If anything the vanilla scripts in the callstack are faulty

#

I will report internally. These errors are bad.

#

Should be sorted quickly. If you see more of this kind please report them

storm shore
#

I'm trying to achieve what the AttachTo function did on Arma 3 by spawning a prefab and using AddChild to attach it to a vehicle.
Basically trying to add cargo to trucks... However, if the two objects collide, the physics goes all weird.

Is there a way to make the child object not collide with other objects? To more closely simulate how the AttachTo function worked?

The attached object is purely cosmetic

fringe prairie
#

Or the other options to disable physics interactions

minor agate
#

Think of them as memory points with slot setup like in A3

#

IF you get the slot from scripts, you can dynamically attach things to it iirc

#

Yeah you can

#

EntitySlotInfo.AttachEntity

#

Get it from SlotManagerComponent.GetSlotByName

#

Have the slot itself set to merge physics on the configuration

storm shore
#

Thanks, I'll check it out

craggy jolt
#

How can you work with world editor hierarchy? I can't seem to find proper commands in World Editor API

#

WorldEditorAPI::ParentEntity - add children to parent
WorldEditorAPI::RemoveEntityFromParent - remove children from parent

#

These are all setters, but where are getters?

#

Oh, its in BaseContainer, expected it all to be handled through API

craggy jolt
#

@minor agate Can I ask for your wizard advise on Debug.KeyState? Does it not work at all at this point?

analog python
west prism
#

yeah its a custom Map

#

but i have next problem with GameMaster i dont know how i can activate them

#

that i can log in on server

#

and i have no idea how to make Zelik Banking use by ShopSystem

#

i cant find any info what i have to do, maybe u need some scripts to get work it...

ocean kernel
analog python
# west prism yeah its a custom Map

you can fix it by manually editing your layer file or updating the prefab used

Search for:

$grp PowerlineEntity {

Replace with:

$grp PowerlineEntity : "{613763D114E7CD1C}Prefabs/WEGenerators/Powerline/Powerline.et" {

./Worlds

half patio
ocean kernel
half patio
#

Damn fair enough, was gonna ask how to go about uv mapping your models haha. Algoods

ocean kernel
#

Just find some tutorial online idk

half patio
#

Yeah fair

craggy jolt
#

Am I right to assume that entity initialization order is not guaranteed and can change at any time?

craggy jolt
#

Yeah seems so, my gamemode components sometimes init before other entities, sometimes after.

ocean kernel
#

wonder if thats the issue

#

Yeah I shoot the robot in the head and my game crashes

#

might be head collider

wild glade
frosty coral
wild glade
#

With overriding, you mean this?

craggy jolt
#

Same, the docs seem to be outdated, the only way to run your systems is to override ChimeraSystemsConfig.conf in your mod and add your system there and then restart the workbench.

frosty coral
ocean kernel
craggy jolt
#

Thought I was getting weird entity world return on Workbench opened prefab, but it seems that World Editor inits the entity twice for some reason??

#

Open prefab in Workbench:

ENTITY       : Create entity @"ENTITY:1" ('SCR_BaseGameMode') at <0.000000 0.000000 0.000000>
 SCRIPT       : !!! Constructor :: ENT world = 0x0000024584F44020 {}
 SCRIPT       : !!! Constructor :: No WE API, no WE world!
 SCRIPT       : !!! Constructor :: GAME world = 0x0000000000000000 {}

Press Edit Prefab:

ENTITY       : Create entity @"ENTITY:3" ('GameMode_MyMode1', SCR_BaseGameMode) at <0.000000 0.000000 0.000000> @"{2E59B96BE0446D05}Prefabs/MP/Modes/GameMode_MyMode.et"
 SCRIPT       : !!! Constructor :: ENT world = 0x000002456865C520 {}
 SCRIPT       : !!! Constructor :: WE world = 0x000002456865C520 {}
 SCRIPT       : !!! Constructor :: GAME world = 0x0000000000000000 {}

ENTITY       : Create entity @"ENTITY:3" ('GameMode_MyMode1', SCR_BaseGameMode) at <0.000000 0.000000 0.000000> @"{2E59B96BE0446D05}Prefabs/MP/Modes/GameMode_MyMode.et"
 SCRIPT       : !!! Constructor :: ENT world = 0x000002456865C520 {}
 SCRIPT       : !!! Constructor :: WE world = 0x000002456865C520 {}
 SCRIPT       : !!! Constructor :: GAME world = 0x0000000000000000 {}
#

Well, apparently it just initializes the world in World Editor twice over, still weird though

wild glade
#

Anyone knows why I get this error: Undefined function 'BaseWorld.FindSystem' for GetGame().GetWorld().FindSystem()?

craggy jolt
#

You need to cast BaseWorld to ChimeraWorld

#

ChimeraWorld.CastFrom(GetGame().GetWorld())

wild glade
#

thank you! some guides seem to be pretty outdated pepeHmm

craggy jolt
#

Is there a quick way to tell if entity world is Workbench world?

#

BaseWorld().IsEditMode() is true for both workbench and world editor

#

Can't see anything like IsWorkbench()

#

Check Entity World != World Editor World I guess

wild glade
#

Line 15 returns NULL, is there another "init" method for entities, instead of the constructor, where the Systems are expected to be initialized?

craggy jolt
#

You need to check if your world is ChimeraWorld, if not that CastFrom will be null

#
        ChimeraWorld world = ChimeraWorld.CastFrom(owner.GetWorld());
        if (!world)
            return;
```How vanilla does it
wild glade
#

ahh okay, got it!

craggy jolt
#

Nevermind my comment about WB and WE, You're doing GetGame().GetWorld() that alone will return null and you'll be casting null and then calling a function on it

#

GetGame().GetWorld() is not null only during play mode in World Editor and in game

topaz pebble
#
2025-07-13 12:45:40: Scripts/Game/vehicles/ScreenToggleComponent.c:44 Function EOnFrame
2025-07-13 12:45:40:   SCRIPT    (E): Virtual Machine Exception
2025-07-13 12:45:40: Reason: NULL pointer to instance. Variable '#return'
2025-07-13 12:45:40: Class:      'ScreenToggleComponent'
2025-07-13 12:45:40: Function: 'EOnFrame'```

Anybody know what would be causing my server to spam this error? Seems to be having a large effect on server FPS
#

Looks like its trying to call a vanilla script but cant find it?

vast flower
#

I want to create a DoT area (essentially "burning ground"). What's the most preferable way to check if character went inside this area (to apply DoT effect on him), or I really should just do QueryEntitiesByAABB check within EOnFrame event handler?

#

I noticed that barbed wire applies bleeding damage on collision (contact) here, maybe I could spawn something like invisible passable sphere and apply DoT effect in similar manner?
upd: seems that there's no way to create trasnaprent-passable area that could trigger EOnContact

clever oxide
#

Hi! Is there a way to update entity when i edit basecontainers at runtime? ent.Update() not helps.

sleek dove
torn bane
sleek moat
#

Share whole code

craggy jolt
#

I have a attribute in my class:

    [Attribute()]
    protected ref PointInfo m_vCenter;
```Any way for it to initialize to `PointInfo` by default? Not sure what could be in `defvalue` for that.
sleek dove
craggy jolt
#
        if(!m_vCenter)
            m_vCenter = new PointInfo();
#

Guess I need to set it through World Editor API?

hallow bolt
#

Hi guys, does anyone know what triggers a character's ECharacterLifeState to change? I'm trying to revive a dead character

wild glade
#

Where would I place utility code? In my case: I want a method, which returns a specific system. Would I just put it in a class with a static method?

torn bane
wild glade
#

a singleton in the system is a good idea!

minor agate
#

So this will only initialize the default when it's called when the game is running

#

There is no way to do proper custom object default other than null through the base container system

#

Forcing values the other way you mentioned is quite hacky and I suggest to not do it as we at any point take the ability to do that.

#

Do what NiiRoZz mentioned

hallow bolt
#

I've got down a bit of a rabbit hole with reviving dead characters. Can any bohemia peeps tell me if I'm wasting my time / death changes things that can't be accessed by scripts?

ocean kernel
#

devs why u troll me like this

#

loading loadouts in a test world loads guns without flash hiders

#

on arland loads fine

#

god

torn bane
ocean kernel
#

Better to just keep them uncon and then un-uncon. Maybe you could even do it without changing animation to uncon so they remain ragdolled.

hallow bolt
#

I considered keeping them uncon but don't wanna mess with the vanilla damage to death. If there a way to make them uncon instead of dead when they would normally have died?

ocean kernel
slate raft
#

Anyone know if I should be able to serialize WorldTimestamp with JsonApiStruct? Simply trying with RegV makes it ignore it. Looking at workarounds, WorldTimestamp has a ToString(), but I don't see anyway to reverse that.

torn bane
ocean kernel
#

Just stringify it

#

You cant read it then tho

#

Damn I just tried to pass a reference to world editor api from edit mode to play mode and wiped out workbench

open pier
#

@torn bane There happen to be any solution to the entity delete issue? Or do you know what information I could get that could help further pinpoint the cause of this?

wild glade
#

Hi, I'm wondering on how to spawn a Mechanized Infantry Group. I can only find on-foot infantry in Prefabs/Groups.
Is there a certain way to spawn vehicles with infantry in it?

jade shore
#

Hi, I am in dire need of assistance. I am having a hard time understanding how would it be possible to modify the Death Screen overlay. I found a template I like made by someone named Iron Beard, essentially I would want to pull information out through DataInvestigator and IEntity.

Problem is, I have no Idea how to properly apply those values. Do I need to go through the mission template too ? Any assistance would be welcomed.

inland bronze
#

Trying to understand custom class replication some more. ContainerRplId and ReadyForItems come up null in Inject() and PropCompare() on peer. Trying to set them from a server-side system. Could the issue be coming from setting it in the system or more so from the custom class replication?

class CE_SearchableContainer
{
    protected RplId ContainerRplId = RplId.Invalid();
    protected bool ReadyForItems = true;

    bool RplSave(ScriptBitWriter writer)
    {
        writer.WriteRplId(ContainerRplId);
        writer.WriteBool(ReadyForItems);
        
        return true;
    }

    bool RplLoad(ScriptBitReader reader)
    {
        reader.ReadRplId(ContainerRplId);
        reader.ReadBool(ReadyForItems);
        
        return true;
    }

    static bool Extract(CE_SearchableContainer prop, ScriptCtx ctx, SSnapSerializerBase snapshot)
    {
        snapshot.SerializeInt(prop.ContainerRplId);
        snapshot.SerializeBytes(prop.ReadyForItems, 4);
        
        return true;
    }

    static bool Inject(SSnapSerializerBase snapshot, ScriptCtx ctx, CE_SearchableContainer prop)
    {
        snapshot.SerializeInt(prop.ContainerRplId);
        snapshot.SerializeBytes(prop.ReadyForItems, 4);

        return true;
    }

    static void Encode(SSnapSerializerBase snapshot, ScriptCtx ctx, ScriptBitSerializer packet)
    {
        snapshot.EncodeInt(packet);
        snapshot.EncodeBool(packet);
    }

    static bool Decode(ScriptBitSerializer packet, ScriptCtx ctx, SSnapSerializerBase snapshot)
    {
        snapshot.DecodeInt(packet);
        snapshot.DecodeBool(packet);
        
        return true;
    }
    
    static bool SnapCompare(SSnapSerializerBase lhs, SSnapSerializerBase rhs, ScriptCtx ctx)
    {
        return lhs.CompareSnapshots(rhs, 4)
            && lhs.CompareSnapshots(rhs, 4);
    }

    static bool PropCompare(CE_SearchableContainer prop, SSnapSerializerBase snapshot, ScriptCtx ctx)
    {
        return snapshot.CompareInt(prop.ContainerRplId)
            && snapshot.CompareBool(prop.ReadyForItems);
    }
}
fringe prairie
#

I like finding random nuggets in the scripts while I go insane looking into making my own GM camera.
Link is broken but there is a heatmap generator for FPS on maps?
ar-heatmap.bistudio.com

inland bronze
minor agate
#

You can do Rpl on sytems.

#

See the Replication Bootcamps for example. We replicate a system in one of them.

minor agate
#

Just do it manually, don't use the helpers as rather than help they damage more because of this, and they are way slower performance wise as well

#

@inland bronze Saying that.
This should do it

class CE_SearchableContainer
{
    static const int DATA_SIZE = 5; // ContainerRplId (4 bytes) + ReadyForItems (We'll send it as 1 byte)
   
    protected RplId ContainerRplId    = RplId.Invalid();
    protected bool ReadyForItems      = true;

    bool RplSave(ScriptBitWriter writer)
    {
        writer.Write(ContainerRplId,       32); // 4 bytes * 8 = 32 bits.
        writer.Write(ReadyForItems,        1);
        
        return true;
    }

    bool RplLoad(ScriptBitReader reader)
    {
        reader.Read(ContainerRplId,        32);  // 4 bytes * 8 = 32 bits.
        reader.Read(ReadyForItems,         1);
        
        return true;
    }

    static bool Extract(CE_SearchableContainer prop, ScriptCtx ctx, SSnapSerializerBase snapshot)
    {
        snapshot.SerializeBytes(prop.ContainerRplId,       4);
        snapshot.SerializeBytes(prop.ReadyForItems,        1);
        
        return true;
    }

    static bool Inject(SSnapSerializerBase snapshot, ScriptCtx ctx, CE_SearchableContainer prop)
    {
        snapshot.SerializeBytes(prop.ContainerRplId,       4);
        snapshot.SerializeBytes(prop.ReadyForItems,        1);

        return true;
    }

    static void Encode(SSnapSerializerBase snapshot, ScriptCtx ctx, ScriptBitSerializer packet)
    {
        snapshot.Serialize(packet, CE_SearchableContainer.DATA_SIZE);
    }

    static bool Decode(ScriptBitSerializer packet, ScriptCtx ctx, SSnapSerializerBase snapshot)
    {
        return snapshot.Serialize(packet, CE_SearchableContainer.DATA_SIZE);
    }
    
    static bool SnapCompare(SSnapSerializerBase lhs, SSnapSerializerBase rhs, ScriptCtx ctx)
    {
        return lhs.CompareSnapshots(rhs, CE_SearchableContainer.DATA_SIZE);
    }

    static bool PropCompare(CE_SearchableContainer prop, SSnapSerializerBase snapshot, ScriptCtx ctx)
    {
        return    snapshot.Compare(componentRplId,    4)
            &&    snapshot.Compare(componentRplId,    1);
    }
}
inland bronze
minor agate
#

Just do what I said

#

That other codec is not good example, and has some flaws

minor agate
#

But about those serializeInt, ReadInt, etc helpers

#

Always use the RAW bytes or bits ones

minor agate
#

We actually replicated an array there, of custom data to use for blips on a radar

inland bronze
# minor agate We actually replicated an array there, of custom data to use for blips on a rada...

I watched the first one but missed the second one, I believe. Will give it a watch as I'm also doing an array of custom data ๐Ÿ˜„

Additionally with the code you provided, in PropCompare(), it should be

snapshot.Compare(prop.componentRplId, 4) && snapshot.Compare(prop.ReadyForItems, 1)
``` yeah? With the `prop.` before each variable?
As well, with those adjustments, still getting `componentRplId` returning as null on client in `PropCompare()` only, which could be my error somewhere tbh
#
static bool PropCompare(CE_SearchableContainer prop, SSnapSerializerBase snapshot, ScriptCtx ctx)
{
    return snapshot.Compare(prop.ContainerRplId, 4)
        && snapshot.Compare(prop.ReadyForItems, 1);
}
``` is what I have currently
minor agate
#

Dont check it there

#

Check it at runtimw else where

#

Dont use codecs for anything other than codec stuff

#

Do not do logic on them for your system or feature

#

Leave it strcitly for replication alone

inland bronze
#

like I'm not doing a print or anything

minor agate
#

Can you show me the error?

inland bronze
#
23:25:59.689   SCRIPT    (E): Virtual Machine Exception

Reason: NULL pointer to instance. Variable 'ContainerRplId'

Function: 'Compare'
Stack trace:
Scripts/Game/CentralEconomy/CE_SearchableContainer.c:200 Function PropCompare
``` and what I sent is lines is 198-203
#

could it maybe be more so with if I'm not doing the Rpc's properly from my system...?

minor agate
#

That is odd, null should work

inland bronze
# minor agate How are you doing it?
Rpc(RPC_AskSetContainerRplId, rplId, container); // called from another method

[RplRpc(RplChannel.Reliable, RplRcver.Owner)]
protected void RPC_AskSetContainerRplId(RplId id, CE_SearchableContainer container)
{
    container.SetContainerRplId(id);
    
    Rpc(RPC_DoSetContainerRplId, id, container);
}

[RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
protected void RPC_DoSetContainerRplId(RplId id, CE_SearchableContainer container)
{
    container.SetContainerRplId(id);
}
minor agate
#

Systems only broadcast

inland bronze
inland bronze
#

oh, from testing, don't even need to Rpc it, it seems? Doing just container.SetContainerRplId(id); works with printing in client logs, but still getting the null error on client launch

west prism
#

where can i change Garbage Options?

#

or is there working mode on workshop atm

ocean kernel
#

How do I get explosion scale from warhead prefabs dynamically when said warhead is spawned

#

Do I have to do some weird prefab container source reading

torn bane
west prism
#

my Vehicle is gone, so i try config

#

now damaged vehicles stay or?

#

what about abandoned ?

torn bane
#

Hover over the properties for tooltips what they do

west prism
#

so now damaged vehicles should stay

#

and destroyed deleted without of lifetime of check player?

torn bane
west prism
#

there is Mode in Workshop
but i have no idea where u can edit Abandoned vehicles

#

After latest arma update no longer works NOTE:

#

And when i shoot at cars added by mods no Smoke coming some cars dont take damage i dont know whats happend

#

need i prefab or what or edit some config

#

that by 50% lower start smoke just exploding by high speed crash

fervent cedar
#

I can give an example if you need something to get started

ocean kernel
#

So for example warheads have explosion scale and tnt equivalent

#

Would be dope to get those numbers

fervent cedar
#

I'm right next to those ones, kidna

#

ChargeWeight is next to tnt

ocean kernel
#

holy smokes I think I should cache results of this

fervent cedar
#

Yes thats what I do with a MAP ๐Ÿ™‚

#

Technically the best would be to generated the data in workbench

#

Or on init or sth

#

And generate for all prefabs etc...

ocean kernel
#

Oh that's smart. But I would need to have a list of all warhead prefabs.

fervent cedar
#

Hmm...

ocean kernel
#

Especially if I want to do it for modded

azure pebble
fervent cedar
#

Is there a easy way to get all prefabs?

ocean kernel
#

I could cache it on server and client, and client could get server's cache on connect ๐Ÿ˜„

fervent cedar
#

I know how to do on workbench

ocean kernel
#

The longer the server runs the better the initial cache for players would be

fervent cedar
#


// Grab reference to ResourceManager 
ResourceManager resourceManager = Workbench.GetModule(ResourceManager);
if (!resourceManager) {
    return;
};
array<ResourceName> selection = {};
resourceManager.GetResourceBrowserSelection(selection.Insert, true);
// Verify if something is selected - if no, exit method & print error message
if(selection.Count() == 0){
    Print("No elements are selected in Resource Browser");
    return;
};

can grab all hilighted resourfcees

#

But I don't know how to query all prefabs in-game???

#

//! Object used for holding filtering params for ResourceDatabase.SearchResources() method
class SearchResourcesFilter : Managed
{
    string rootPath; // Exact path format expected (e.g. "$ArmaReforger:Prefabs/Weapons")
    ref array<string> fileExtensions; // File extensions without leading dot (e.g. "emat")
    ref array<string> searchStr;
    ref array<string> tags;
    bool recursive = true; // When enabled, we wil search whole sub-tree
}

//! Callback used for processing results from ResourceDatabase.SearchResources() method
typedef func SearchResourcesCallback;
void SearchResourcesCallback(ResourceName resourceName, string exactPath = "");

typedef func FindFilesCallback;
void FindFilesCallback(string fileName, FileAttribute attributes = 0, string filesystem = string.Empty);

frogthinking

ocean kernel
azure pebble
#

you could get global signal explosion iirc

#

audio has it used somewhere in scripts

ocean kernel
#

That sounds a lil better maybe

ocean kernel
solid hearth
#

eeeh Is it intended or a bug that EOnContact does not work in Dedicated for player character colliders? It processes vehicles fine but player character colliders are a no go. Or is it simply because the server is not processing physics for player characters since they're owned by the player and the player is responsible for physics updates Sadge

half patio
#

anyone know how to unpack the .pak files ? i want to grab all the scripts and open them up in visual studio code

ocean kernel
#

Already went through this with my mech when I was making it break trees and fences walking into them

oak onyx
#

im brand new to arma

#

i need help

solid hearth
#

Yeah.. it's what I gathered.. Kind of sucks but sort of makes sense from a flow standpoint. Trying to create a bouncing betty mine and it's going to be janky communicating back and forth adding unneeded delays.

fervent cedar
# oak onyx im brand new to arma

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
ocean kernel
solid hearth
#

Yeah sort of, the contact starts the animation and yada yada.

ocean kernel
#

You probably dont want clients to have authority to detonate the mines

solid hearth
#

Server will detonate the mine as it should I'm just going to do what you said and have the player responsible for the contact tell the server to start the whole chain.

ocean kernel
#

Right so hackerman can then remotely detonate all mines on the server

solid hearth
#

Deal with enough of them roleplaying they're in the Wanted universe* curving their bullets tired

ocean kernel
#

Tbh add serverside anticheat, if player position is > 50m but they somehow collided just instaban

wild glade
#

is there a method which resembles C#'s String.PadLeft?

minor agate
ocean kernel
#

Is there a scriptmodule resembling javascript's is-odd

wild glade
#

Can't find variable 'SCR_DateTimeHelper'
How is it not there, when the class literally exists? ๐Ÿ‘€

minor agate
minor agate
wild glade
wild glade
minor agate
#

They are layers

#

Core module gets compiled first

#

Gamelib module gets compiled second, and has access to Core module.

#

Game module gets compiled third, and has access to Gamelib, which makes it have access to Core

wild glade
#

Ahh okay, got it, thanks!

torn bane
ocean kernel
#

Can I have DIY namespaces if I just make global variables and nest instances in them

torn bane
#

I did that some time ago in DayZ. So I had CF.FeatureName.FeatureClassName ... it was magical - and so annoying we simply switched back to CF_ prefix

ocean kernel
#

One huge QOL upgrade would be to stop having to Class.Cast and have it inferred by the compiler from the type declaration of the variable or parameter type

#

Also collapsing code blocks for god's sake

torn bane
#

Implicit casting only works for downcasting. on upcasting the user must make an informed decision or else you can accidentally upcast into something that it not actually possible by easy mistake

ocean kernel
#

Then throw a VME, it's my problem at that point

#

I'm just sick of MyType myVariable = MyType.Cast(something)

torn bane
#

do auto mytype = cast then

ocean kernel
#

Does autocomplete work when its auto?

red cedar
#

from my experience it didn't

#

i only use auto in the remote console

ocean kernel
#

I'm okay with typing variables, but the cast is just annoying

#

Especially since the compiler knows what type I want

#

So MyType myVariable = (auto)Something could hint to the compiler to use the type from the variable definition

#

It doesnt have to try to be smart

torn bane
#

Implicit upcasting is only a thing in unsafe type languages, anywhere else you have to do an explicit cast. and the difference is that you need to write "Cast.", the typename and surrounding () is the same usually. var meh = (Type)base;

#

It is not about not knowing or smart or not, it is an intentional design decision to protect users from bad actions

ocean kernel
#

Yeah but, the pain is unnecessary

#

Thank god I have an ultrawide

minor agate