#enfusion_scripting

1 messages · Page 28 of 1

minor agate
#

No, this is wrong here and would cause memory problem. Local variables should never have a ref on them.
That is for member variables only

#

This is also wrong, as it would also cause a memory problem which is why ref IEntity throws a compile error

#

As IENtity is created by CPP and owned there, so it must never have a ref in scripts

#

The issue is not a memory problem with the array, it is something else

dusk pollen
#

@minor agate what is with AI being jank on dismounting?

#

I would upload a video but discord no perms

minor agate
dusk pollen
minor agate
restive island
minor agate
minor agate
#

ref just creates a smart pointer of sorts

minor agate
#

Doing it C style with int someIntArray[5] = {0, 1, 2, 3 ,4}; creates a static one

restive island
#

btw whats the deal with these:

minor agate
#

They are more passed like that then to become compiled with those types from the get go

#

so that VM introspection and reflection can make use of them without issues if they were never used

#

Mostly for internal purposes

#

It's just so that the VM knows and creates those array classes right away

#

Whenever you use a templated class, each new type you add to their arguments creates a new class

#

They do not exist until you do that

#

That is what those are doing

restive island
#

so i can use TVectorArray foo = {}; ?

minor agate
#

Using {} does not define if dynamic or static

#

{} on dynamic array type just creates a new object

#

If you have it as a member, and the class is the owner of the array then you need ref

#

But again refs for local variables (Method variables) is always wrong

minor agate
dusk pollen
#

Does Enforce Script have turnary operators?

#

e.g.

        Vehicle vehicle = Vehicle.Cast(vehicleEntity);
        CarControllerComponent carController = vehicle ? CarControllerComponent.Cast(vehicle.GetVehicleController()) : null;
        if (carController)
        {
            carController.SetPersistentHandBrake(true);
            VehicleWheeledSimulation wheelSim = carController.GetWheeledSimulation();
            if (wheelSim)
                wheelSim.SetBreak(true, true);
        }
maiden goblet
fringe prairie
#

Need generic/extensible vehicle sim!

Vehicle controllers, sim components, compartment managers, and nwkmovement components operate mysteriously and depend on eachother in ways extremely difficult to work around. I know that it was talked about to potentially open this up for A4 - but please ensure this happens!

#

But if you want an easy crash, give a helicopter two main rotor configs in the simulation component. Instant crash.

ancient venture
#

Hello! I heard a while back that there was potentially someone with a script that allowed reloading/racking a bolt while ADS?

spark otter
#

Is there an alternative to TraceParam.TraceMaterial? That seems to only give one material when a couple may be overlapped. I'd like to get all overlapping materials instead of a single (random) one. I'm trying to determine if a pos has a hard surface vs dirt, and some positions have both overlapped, but it only gives me the dirt one.

restive island
ancient venture
red cedar
ancient venture
#

Ah okay, not necessarily a mod I figured, more of a script to be implemented into a rifle AFAIK

red cedar
#

Afaik the animation are really hardcoded in AR so doing anything via script for that will be really challenging, also you're very unlikely to have anyone just write a whole mod worth of scripts just for you like that

#

Can happen, just unlikely

ancient venture
#

Kk, wasn't sure if it already existed, heard some talk a while back that someone was developing/had developed something like that, thank you!

tranquil shard
restive island
ancient venture
#

No, not auto reload. I'm meaning the fact that every time you have to rack another round, you have to fully come off what you were mounted on, then mount the bipod again, then reacquire after every shot

#

As compared to just staying ADS while reloading

#

Having to remount with the bipod after every shot, then reaxquire completely as it often resets the view to the default compared to what you were looking at, rather than being slightly offset target after reloading while ADS

hollow oak
#

Hey folks! A quick question here.

Does GenericEntity object have an impact on performance? For example, if I'm using GenericEntities as position helpers, and I have a lot of them - could it decrease the performance?

open pier
red cedar
#

Especially in a single player mission

hollow oak
red cedar
#

Usually what cost the most is initializing all of the content, rendering the entity, replicating it accross all clients, etc.

Almost none of those apply to your case so it should be fine.

hollow oak
#

Btw, can I change user settings using scripts? For example, if I want to set user's music volume?

red cedar
#

I'd advise against doing that

#

You can alter user settings via scripts but you'd be better off sinply giving them a pop up advising them to have their music settings turned on for a better experience

hollow oak
#

some things I can't really handle. Adding action listener is one of them =(((

I have pseudoUnix system with pseudoVim, that could even save newly created files in pseudoFileSystem (json file actually coolfrog )

But I had to add this ugly Enter button, because I don't understand how AddActionListener works. I've added PcEnter to chimeraInputCommon.conf in CharacterGeneralContext. But nothing happened =((

hollow oak
#

is there a special menu context for that?

red cedar
# hollow oak yep

Try putting your action in MenuContext and see if it triggers then

hollow oak
red cedar
#

Also did you add an action listener?

hollow oak
red cedar
#

Yup

hollow oak
#

I believe it should be done somewhere else 🙁

And I've also added GetGame().GetInputManager().AddActionListener("PcEnter", EActionTrigger.DOWN, ExecuteCmd);

red cedar
hollow oak
tulip mural
#

hi,
is there a destruction component which makes the parent prefab collapse when its children break?
I dont think a DestructibleMultiphaseComponent does what I want and I havnt really understood how the DestructibleBuildingComponent works yet.
I made this Tunnel Netting prefab and I'd like to use the vanilla woodlogs holding it up and when they break the mesh collapses.

red cedar
# hollow oak

so the way i set my keybinds is like this, under Actions i set up the bind and then under ref of the context i want it activated in i write it down there

#

Then it's your typical

m_inputMgr.AddActionListener(OPEN_STATS_MENU_ACTION_NAME, EActionTrigger.DOWN, OpenPlayerStatisticsMenu);
hollow oak
#

oof, any changes in chimeraInputCommon could cause a freeze

red cedar
#

😭

#

the workbench sometimes cause my lapbottom to be hard stuck and i need to restart it using the power button

hollow oak
#

ok, adding it to MenuWidgetActiveContext doesn't do anything
👺

red cedar
#

and also make sure the component is referenced in the playercontroller entity

hollow oak
#
class KUZ_PcCommandHandler
{
    
  //------------------------------------------------------------------------------------------------
  void Prepare()
  {
    s_sOpenedVimFileName = "";    
    s_FileSys = new KUZ_PcFS();
    s_FileSys.SetCurrentDir("home", "dwarden");
    s_bIsInVim = false;
    s_iLineNum = 0;
    Widget w = GetRootWidget();
    array<EditBoxWidget> cmdLines = {};
    for (int i = 0; i <= 25; i++)
    {
      cmdLines.Insert(EditBoxWidget.Cast(w.FindAnyWidget(string.Format("CommandLine_%1", i))));
    }
    foreach (int i, EditBoxWidget cmd : cmdLines)
    {
      if (i == 0)
      {
        continue; // skipping the first line
      }
      cmd.SetEnabled(false);
      cmd.SetVisible(false);
    }
    RichTextWidget prompt = RichTextWidget.Cast(w.FindAnyWidget("Prompt_0"));
    prompt.SetText(GetPrompt());
    GetGame().GetInputManager().AddActionListener("PcEnter", EActionTrigger.DOWN, ExecuteCmd);

  }
red cedar
#

oh

#

yeah

red cedar
hollow oak
red cedar
#

could you show me the code that instanciate this class ?

hollow oak
#
class KUZ_GenericInteraction : ScriptedUserAction
{
    [Attribute()]
    string ActionName; // yep I forgot to follow scripting conventions =(


    override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
    {    
        KUZ_GameMode gm = KUZ_GameMode.Cast(GetGame().GetGameMode());
        IEntity m_Player = GetGame().GetPlayerController().GetControlledEntity();


        switch(ActionName)
        {
            
              case "turn_on_pc":
            MenuBase myMenu = GetGame().GetMenuManager().OpenMenu(ChimeraMenuPreset.KUZ_PcID); 
            KUZ_PcUI myMenuUI = KUZ_PcUI.Cast(myMenu);
            ref KUZ_PcCommandHandler pcCmd = new KUZ_PcCommandHandler();
            pcCmd.Prepare();
            //delete(pcCmd);
            break;
        }

}
hollow oak
red cedar
#

well the issue here is that for example, the ActionName is never assigned any value

#

so KUZ_PcCommandHandler is never instanciated

#

and your action listeners are never set up

hollow oak
#

as I said everything works just perferctly well, except the fact that I had to use Pc enter button

red cedar
#

however it's impossible for your code to reach this line

#

that's the issue

cloud rock
#

he means that you use ActionName in your switch since its never gets a value you never go to the case

red cedar
#

yeah i'm not very good at multi tasking sorry

hollow oak
hollow oak
cloud rock
#

could also be that you need to activate the inputcontext but i am not sure anymore been a while since i did something with keybindings

red cedar
#

Scripted user actions and keybinds are completely unrelated

cloud rock
hollow oak
red cedar
#

have a nice evening

hollow oak
fringe prairie
# hollow oak you have been very helpful, for that i'm giving you my best regards! I was just ...

So my recommendation right, is that you want to listen to that action while the menu is open, you can assign a custom menu context to the menu, or essentially piggyback off of menu context. Assuming you are piggy backing, you need to register an action listener from within your menu instance on menu open, binded to that action under the menu context. It should be pretty easy to test. Don't do registration on the use of the action, because it is not very reliable and a bit confusing to debug. Register and unregister the action from inside of the menu code, basically.

hollow oak
fringe prairie
#

Ok, and your action is called what in the chimeraInputCommon.conf?

fringe prairie
#

what context is that assigned to?

hollow oak
#

it's in

#

MenuContext

#

And I also added

#

and I've made a debug print if MenuContext is active and it is

fringe prairie
#

Is the action here in Contexts?

hollow oak
fringe prairie
#

things get really wierd with this and action refs, I need to see more than your screenshot, where the action is in chimera input common

hollow oak
#

then in

#

it is in there

fringe prairie
#

is it also a base action?

#

since an action ref needs an action (think of it like a simple mapping)

#

like here:

hollow oak
fringe prairie
#

Have you restarted WB yet?

hollow oak
fringe prairie
#

Also, did you duplicate or override that file

#

because typically all of those should not be bold, it means they are new

#

which they aren't

hollow oak
#

it doesnt allow to override it

fringe prairie
#

since you already made a duplicate of it

#

go to your version

#

see if you right click it

#

does it say "navigate to original"

hollow oak
#

I'll try to recreate it

fringe prairie
#

Yeah basically means your file wasn't doing anything

#

because you didn't override to add the actions to the one the game is actually using

#

you just made a copy with changes, lol

#

after overriding, you will need to restart WB to have changes take effect

hollow oak
#

No effect. I'll try to restart Wb

#

yaaay

fringe prairie
#

just make sure to remove the action listener on menu close

#

so it doesn't try triggering on broken instance

hollow oak
#

Thank you kindly!

fringe prairie
#

Also your action is very generic, might be collision with another mod adding same reference, might not hurt, but could help to label it something custom, or make your own menu context using the refs you want and point the menu config to your context

hollow oak
#

that was a tough one!

hollow oak
craggy jolt
#

Why does enums method in [Attribute()] decorator has to be static?

#

What I'm trying to do is make a drop down list to select from items defined in array before

#
[BaseContainerProps(configRoot: true)]
class TestConfig
{
    [Attribute(defvalue: "")]
    protected ref array<string> m_aLines;

    [Attribute(defvalue: "", UIWidgets.ComboBox, enums: Testest())]
    protected string m_sBestLine;    
    
    static ParamEnumArray Testest()
    {
        ParamEnumArray params = new ParamEnumArray();
        ParamEnum p = new ParamEnum ("Testest", "Value");
        params.Insert(p);

        return params;
    }    
}

Trying to populate m_sBestLine selection list box from m_aLines values

#

Trying to access non-static member 'Testest' from static method '#CreateAttributesTestConfig'

#

if I remove static in hopes to be able to use this to access config class instance itself

#

I guess there is no way to achieve this?

clever oxide
#

Maybe declare static ref instance?

minor agate
#

They are processed statically, they do not know about your instance. It's on per class basis, right after compilation. But before the main function of the script module runs

craggy jolt
#

Custom attribute titles, custom attribute enums, etc.

minor agate
#

Even dynamic

craggy jolt
minor agate
#

Its possible from CPP, the dynamic list thing too

#

But not from scripts

craggy jolt
#

for scripts*

#

Would make configs so much more readable

river imp
#

What's not readable about them that needs to be "more readable"?

storm bobcat
#

Could use some guidance on this:
I want to do something similiar to WCS backpack dpeloyment that requiers a teammate to be near by.
I want to make the requirement to be group based.
What class do I start with?
How do I get a player's group?
And how do I get the players or specifically their character from the group?

errant wren
#

Look through the player prefabs and find which component is associated with groups and find where they are defined in code. You can right click and click search for “definition in code” or something like that

#

Or it might be in the GameModeComponent itself

storm bobcat
#

I didnt think to check components. Good shout

#

SCR_GroupsManagerCompoent

#

Its on GameModeComponent

errant wren
#

Everything in game is built through prefabs pretty well so its always worth digging through them and checking components as their values also give you additional clues and its just easier

#

I came from dayz and at first it was such a game changer. Finding stuff in dayz script was hell

craggy jolt
#

And its folded by default

light bay
#

Is there any way to maintain AI persistence? I want that in Street Fighter with dynamic despawn, if the server restarts, the AI ​​that died doesn't reappear and doesn't duplicate.

open pier
storm bobcat
#

I have never gotten the player ID before. I found an example, but I am hoping someone can clear this up for me before I get through testing.

I am modifying a Action script.
I need to get the player id. Does the action script run from the client or server?

#

If I try to get the player id from the action CanBePerformed script, will it run on client?

storm bobcat
#

int

#

The int id. I need to get the player's group

river imp
#

CanBePerformed is client side.

dire sinew
#

As for the action itself, it's configurable

#

But I think the local client knows its ID

#

You should be able to get it from the player controller

river imp
#

Depends on the action though.

storm bobcat
river imp
#

The action you're modding may or may not be client only

storm bobcat
#

How do I see if it is client/server?

dire sinew
#

You can look where HasLocalEffectOnlyScript is overwritten. I think inventory is client side.

#

Check in inherited classes

storm bobcat
#

Is that a method attribute?

#

Or variable?

spark otter
#

PTSD triggered 😭

dire sinew
#

A method

#

that returns a bool

river imp
#

by default its false

#

so the action you showed

#

it will be false

dire sinew
#

But for instance, SCR_InventoryAction overrides it to return true

river imp
spark otter
#

trying to get uuid on client action lol

river imp
#

Oh

storm bobcat
#

So should I assume this runs on both client and server? I already am, but that means I should be extra careful to guard against null player manager references?

river imp
dire sinew
#

No, only client when HasLocalEffectOnlyScript returns true

storm bobcat
#

Correct. That is not overriden for the backpack deploy action; it defaults to false. Which means it runs on client and server, right?

river imp
#

yes

storm bobcat
#

Does the server care about actions?

#

Can the CanBePErformedScript run on server without a character/ui?

river imp
#

CanBePerformed is client only

storm bobcat
#

So its for other parts. Gotcha! Thanks yall!

river imp
#

if HasLocalEffectOnlyScript == true then PerformAction is only called on client

#

if it's false PerfromAction is called on server and client

spark otter
storm bobcat
#

***PerformAction ***

#

I understand now

#

👍

dire sinew
river imp
#

Yes, in this instance I don't think he'd be doing that.

storm bobcat
#

We are past what I am trying to do. This is all good knowledge for me!

storm bobcat
#

I am attempting to make the radio backpacks require a certain number of group members in order to be spawned on.

Both the deploy action and spawn request will require X amount of players.
So looking at the group data, I found this:

#

Any chance yall know if disconnectedPlayerIds is held for a longer time, or until a player reconnect timeout ends?

#

Or rather, should the total group member count include the disconnected player ids?

river imp
#

Test it to see?

storm bobcat
#

BuT i HaTe tEsTiNg

river imp
#

sucks to suck

storm bobcat
#

I figured I would have to.

river imp
#

How do you think we know all the things we know?

dire sinew
river imp
#

Not from asking people, that's for sure.

#

One could assume since players and disconnected players are stored separately then, the group defines it's current members or count as the player ids count and disconnected players aren't included.

#

Otherwise a server that runs for 40 hours straight would have groups with player counts in the hundreds...

marble ridge
storm bobcat
#

I actually just wrote that part, and was checking the methods and found it.

#

Apprec

marble ridge
#

but hopefully you may never have to deal with the disconnected list

river imp
#

You shouldn't have to.

#

Not sure why you would really.

#

If all the members of a group disconnect the the group count would be 0.

#

And if that's the case there isn't anyone to spawn on anyway.

#

fedora confirmed what I expected, so just GetPlayerCount() of group and if less than x don't allow the thing to happen.

#

Pretty simple.

restive island
#

What's the best way to find out which entity spawned a vehicle using IEntity foo? I'm trying to find it and access its Fuel Manager component.

spark otter
restive island
#

not sure if i can pull that info (spawning entity) from the vehicle itself

spark otter
#

looks like in SCR_FuelSupportStationComponent there is a variable for that ```cs
protected SCR_FuelManagerComponent m_SupportStationFuelManager;

restive island
solid hearth
#

Worst case just query the entities near the vehicle, check if it has SCR_EditableEntityComponent and then check the labels for SERVICE_FUEL shrug

restive island
#

i could, that way players can decide what depot to remove the gas from for their vehicle. Maybe also change the color of the vehicle placement thing to yellow if it's outta gas

#

or i can be evil and just have the vehicle have a gallon of gas from the get go and make them manually refuel it every spawn

serene fox
#

Hi, what is the best way to check if a "BaseInventoryStorageComponent" is on a Character? Do i need to check the whole Hierarchy? Because the storage can be child from another storage.

torn bane
serene fox
# torn bane Asking the characters storage manager for all storages it knows, if the count is...

its on an invoked method. Its now working with a "WHILE"

    //------------------------------------------------------------------------------------------------
    void OnParentSlotChanged(InventoryStorageSlot oldSlot, InventoryStorageSlot newSlot)
    {
        // Check if the newSlot owner is a Character    
        if(!Replication.IsServer()) return;
        
        if(newSlot) {
                
            // Get the root slot/root storage
            InventoryStorageSlot cSlot = newSlot;
            while(cSlot) {
                newSlot = cSlot;
                cSlot = cSlot.GetStorage().GetParentSlot();
            }
        
            SCR_ChimeraCharacter newSlotOwner = SCR_ChimeraCharacter.Cast(newSlot.GetOwner());
            if(newSlotOwner) {                
                if(m_itemComp) m_itemComp.m_OnParentSlotChangedInvoker.Remove(OnParentSlotChanged);
                GetLayerTask().REAPER_SetTaskState(SCR_ETaskState.COMPLETED);                
            }    
        }
    }
torn bane
#

the better approach would be to listen to item removed event on chars inventory manager

#

if you want to do it from items pov, you can still do that but the event is fired after it happened. so keep that in mind with the logic. you can also make use of getrootparent of the entity which will then be the char

amber moat
#

@torn bane

Is there ANY script API current or planned to enumerate roads in a loaded world and read their geometry (splines / vertices / segment endpoints)?

#

For modders building custom in-game map UIs that need road rendering, what’s the recommended approach?

torn bane
#

I am not sure, but have forwarded your question

amber moat
#

Is the .ent (EBIN) binary format documented anywhere external modders can reference? Parsing .ent offline would let us extract road entities without any runtime API.

torn bane
#

Nope no parsing that, it will change from update to update

#

If you wanted to extract them all then a workbench plugin would be the way, no never to ever load files manually

#

all data is accessible in workbench editor apis

amber moat
#

Yes but that’s not what I’m trying to do

torn bane
#

What i mean is you can always grab data in workbench, process it, and write some custom data into file shipped with your mod, if you need to compute some road network data. anyway i will let you know if i hear back

amber moat
#

does the editor expose RoadEntity spline data via a method like GetSplinePoints() / GetVertices(), or is it a different accessor pattern?

#

I got it

#

So to be quick

#

I am basically scanning the data for maps at runtime

#

I don’t want to have json for data in my mod

#

Buildings and map image are ok for now

torn bane
#

Yes I understand, i suggested it because you mentioned reading and parsing mod files, which you can not do from the the client exe, only in workbench

amber moat
#

Ok one more if you don’t mind can the engine MapWidget be mounted as a sub-widget in our own UI tree (off-screen / RTonly) and configured via MapRoadProps to render JUST roads to a render target we control? If yes, id composite the engine’s own road render under our canvas at runtime no data extraction needed, fully runtime, works on any map. If the engine MapWidget can’t be invisible / RT-only, that path’s closed too.

#

Sorry I’m looking at options and for now all I tried is a dead end

torn bane
#

No that is not possible

amber moat
#

Ok thanks a lot!

#

I’ll wait for your api response if anything comes out. I honestly digged a lot and I couldn’t find anything

#

Basically no API, no proper custom map widget for now. not with all the data unless loaded manually in the mod files.

#

This is where I’m at

torn bane
amber moat
#

Ok so how will u guys let modders create their own map widgets ? Especially because your vanilla widget is difficult to work with if not impossible sometimes

torn bane
#

If and what settings might be there for maps in the future we will see. You could make a modding feedback ticket and ask for options to e.g. show only roads, not sure if it can be implemented.

storm bobcat
#

Does anyone know of a fix for the command truck deployment issues?
Issues:
Supply not pulling from iteself (known)
Supply resources saying 0/0 even when beside external depots
Spawn point not showing on map

red cedar
amber moat
red cedar
#

lmao

mossy spade
# amber moat does the editor expose RoadEntity spline data via a method like GetSplinePoints(...

Nope, but the spline is just a Bezier curve with 4 control points (though there's some hacked-in magic constant applied to control points), so you can "reverse-engineer" it.

What i mean is you can always grab data in workbench, process it, and write some custom data into file shipped with your mod, if you need to compute some road network data. anyway i will let you know if i hear back
This is exactly what FF does for its custom road network system, but as far as I remember almost all the data can be also pulled at runtime. Very early FF did that, I only switched to offline generation because road network construction in script was way too slow (linking junctions and splitting/merging segments to ensure a clean graph).

You can look up FF sources as a learning material.

amber moat
zenith relic
#

Is there anyone who could help me finish setting up my shop system in my server and my zeliks character mod?

red cedar
#

😭

#

Ask gemini

subtle sparrow
amber moat
subtle sparrow
amber moat
#

yes but not through normal export

#

i wantit scanned at runtime

#

no mod files for maps

#

otherwise my mod would need to be 300mb

subtle sparrow
#

I’ve done something similar with my atak

amber moat
#

oh wow

#

would u be willing to explain? i can give u my scripts for buidlings and map picture

#

so u can complete yours

subtle sparrow
#

Yea tomorrow I can talk more about it

amber moat
#

sounds good!

#

ill take a look at your scripts

zenith relic
#

That looks amazing tbh

subtle sparrow
amber moat
#

thanks a lot!

#

GetRoadsInAABB

#

so basically RoadNetworkManager + rpc

#

bro this is so good

river imp
#

@amber moat I was gonna mention the road network manager earlier and got sidetracked

#

I know you can get the points of the road and even the width

amber moat
#

RoadNetworkManager.GetRoadsInAABB + BaseRoad.GetWidth/GetPoints

river imp
#

Hopefully that's all you need to do what you're trying to do

amber moat
amber moat
#

For map image I gave up. I will do a procedurally generated grid so it will be like Minecraft 💀

amber moat
#

this is the result, but it kills performance at 256, even with all sorts of optimizationsi tried max is 128. i scrateched that and decided ill go with no image

tough cave
#

just curious, but what was the deal with having to get RplId with GetEntity from RplComponent when there's FindItem and FindItemId? It seems like the latter is used for ChimeraCharacter. Is that a central config thing or is it the prefab config? The RplComponent on the root of prefab is standard.

fringe prairie
#

What exactly are you trying to do, because your message reads multiple ways lol

tough cave
#

I just didn't get why FindItemId is -1 at least early on. I'll try with a character instead. Server should be able to send RplId early in game setup. But maybe RplComponent is more reliable than other ways of getting RplId directly from Entity.

inland bronze
#

what am I looking at here? Script obfuscation or something else? thonk

red cedar
#

If that can secure their work from being yoinked then so be it

spark otter
red cedar
#

They said they didn't like it, usually when you obfuscate your code it means you have something to hide, but the rules aren't explicitly banning it.

And considering how easy it is to get your stuff yoinked if that can allow modders to protect their work then i support it lol

radiant robin
#

Is there a way to dynamically resize storage volume while preserving items? I would like to let rp players upgrade a safe to have more storage.

Please ping me if you can help at all

marble ridge
#

^^^ I now want to find this mod just for the sole purpose of de-obfuscation. 😜

storm bobcat
#

So like, if the KOTH or Narcos Life mod (idk if they come the open source life mod) obfuscated their stuff to prevent rips and copy cats, i would understand. But the majority of scripted functionality is patch mods and simple. I think they should be open sourced for the community.

Thats my hot take.

river imp
river imp
#

What really blows my mind is there is an RP server that was able to monetize even though they obfuscate and have already had numerous strikes for misconduct.

ocean kernel
#

Theoretically against the rules, practically idk

river imp
#

As long as your server is bringing in players it's okay to break the rules? That's how it seems from a bystanders point of view at least.

lean moth
solid hearth
red cedar
river imp
#

You're the one that's supposed to do something about it

#

Not B.I.

#

If anything, DMCA B.I. for hosting your stolen IP. It will get handled real quick then, I promise.

lean moth
river imp
amber moat
#

dmca bohemia, u need to have proper license

lean moth
red cedar
# river imp It's YOUR responsibility to enforce YOUR license

Ok, which button do i click to remove the mod?

I've made the reports, given them documents with code comparisons with explaination on why using my method is way less efficient in their case and all I've gotten in return was "next week bro trust me" for 2 months.

red cedar
#

And shuffling a few lines

amber moat
lean moth
lean moth
#

Then again, I have no idea and don’t really care how Europe works either 😂

amber moat
#

europe is worse dont worry u are not missing anything lol

lean moth
#

Oh I’m aware 😂

red cedar
lean moth
amber moat
#

in my personal experience with dmca and gdp stuff i have seen multiple cases of companies ignoring dmcas, did not end well if theip right holder is serious and has docs all set

#

companies not enforcing can lose benefits

lean moth
#

If you have clear evidence, absolutely. Which is why they kill model rips instantly. Code is a much murkier water.

amber moat
lean moth
#

There’s a massive body of case law about this in the US

red cedar
lean moth
#

Legal actions over a video game are silly, people are going to steal your stuff

ivory cobalt
#

Something flattery but I get it. As above a license is only as good as your abilities to enforce it

red cedar
#

I was under their impression that they kind of cared about it since modders are basically what makes arma what it is, but ehh

red cedar
ivory cobalt
#

Intellectual property is enforced by law in most countries

red cedar
amber moat
ivory cobalt
#

i hear alot of folks use ai for lawyer 🤣

red cedar
red cedar
ivory cobalt
#

dont let shit get you down though man. people will always take its in their nature

red cedar
#

I mean i won't i'll move on.

But i likely won't be updating those mods as i'm not trying to give that specific team more code to yoink and train their llm with

#

I still laughed when i saw the AI-written comments of it struggling to implement my codec

ivory cobalt
#

see small things

river imp
lean moth
ivory cobalt
#

probably worded poorly but if you are being sued you bet someone will come serve you if court action ends up being taken though

lean moth
river imp
lean moth
#

Because it’s a video game

river imp
#

If you don't think there have been lawsuits over video games then you're definitely mistaken.

lean moth
#

One of the most convoluted areas of law, and somehow everyone thinks it’s black and white

river imp
#

Unless you're explicitly speaking about modding.

red cedar
# lean moth Great thing no one is getting sued, either

I mean i still feel like taking someone else's work is incredibly messed up.

It's so disrespectful to other people who have spent time making their mod what it is.

ESPECIALLY considering that for most modders you can just ask them "hey i was interested to know wether i could yoink that feature/those lines of code from your mods" and 95% of them will say yes.(unless you're asking to yoink their whole entire mod)

dire sinew
lean moth
#

Of course I’m talking about mods. It’s frivolous, there are no damages. I’m sure a case out there could be found where a community was taking in boatloads of cash and got shafted x

torn bane
#

Take your offtopic elsewhere, this channel is about scripting.

red cedar
#

Isn't copy pasting someone else's code related to scripting? It says anything related to scripting

river imp
#

Yes but, it turned into IP/law discussion.

red cedar
#

Fair

river imp
#

I'm more than happy to continue the discussion in another channel.

red cedar
#

I don't believe they have channels for this kind of discussion so.. I'm guessing it will likely die here.

lean moth
#

Sounds about right for any IP conversation

serene fox
#

Hi, i currently have an issue with GroupManager:

        const int playerID = SCR_PlayerController.GetLocalPlayerId();
        
        Print(playerID);
        
        SCR_GroupsManagerComponent groupsManager = SCR_GroupsManagerComponent.GetInstance();
        if(!groupsManager) return;
        
        Print(groupsManager);
        Print(groupsManager.IsPlayerInAnyGroup(playerID));
        
        SCR_AIGroup playerGroup = groupsManager.GetPlayerGroup(playerID);
        if(!playerGroup) return;

If the player in SP dies, the GroupManager will no longer return any group, But, if check the Group Manger UI on deploy menu, im still in "Aplha" also, if i start a fresh game and do not have any controlledEntity yet, i still have a group. So why i do not have a group after death?

river imp
#

The deploy menu shows you in a group but you're probably not actually in it until you take control of your character?

serene fox
#

But why should you removed from a group when you die?

river imp
#

So when you deploy you can join a new group if you want to?

#

Or to not take up a group slot for when a new player joins?

serene fox
#

When staring the game, you join "Alpha" then GRPMgr return such group, even you still not have a contolledEntity. Now you deploy and die, you do not have a group.

river imp
#

Yes, so when you first join it forces you to a group, when you die it removes you from the group, so at the deploy menu you can choose to join a new group. But, who knows why it actually works the way it does.

serene fox
#

It does not force me in a group, i join it

river imp
#

"if i start a fresh game and do not have any controlledEntity yet, i still have a group"

serene fox
#

Yes, because you first join a group and then selecting the Player

river imp
#

And by default you are already in a group.

#

Alpha.

#

That's odd.

torn bane
#

We only remove players from groups on disconnect. Debug the method you are asking and see where it returns false

storm bobcat
#

My first thought is that somewhere in the chain of a getting a player's group, it fails to retrieve it due to the player being dead.
Just simply that. So do what ark said. It could just be simple faulty condition that never caused a bug, and you might be the first person to notice it.

#

@serene fox ^

serene fox
#

currently checking the methods

#
modded class SCR_GroupsManagerComponent : SCR_BaseGameModeComponent
{
    override SCR_AIGroup GetPlayerGroup(int playerID)
    {
        SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
        if(!factionManager) return null;
        
        Faction faction = factionManager.GetPlayerFaction(playerID);
        if(!faction) return null;
        
        array<SCR_AIGroup> playableGroups = GetPlayableGroupsByFaction(faction);
        if(!playableGroups) return null;
        
        for (int i = playableGroups.Count() - 1; i >= 0; i--)
        {
            //---------------------------------------------------------------------------
            Print(playableGroups[i].GetPlayerIDs());
            // m_aPlayerIDs will hold my playerID, when i die, its also in the array. 
            // But when the respawn menu opens, the array gets empty!
            // ---------------------------------------------------------------------------
            if (playableGroups[i] && playableGroups[i].IsPlayerInGroup(playerID))
                return playableGroups[i];
        }

        return null;
    }
}
serene fox
#

SCR_AIGroup -> RemovePlayer() -> This method will never be called! But the array will still loose my playerID

amber moat
#

I basically just move players once they are in a group. Not before.

#

They can spawn in any group and they will automatically moved to the one assigned

heady sphinx
#

You could have asked me on Discord why my code looks like this.
But you decided to do it behind my back; essentially, you're just trying to steal someone else's work.
That's why me need to obfuscate work; you sitting in my Discord, trying to pull out my code behind my back 😄

inland bronze
#

As I’ve given you scripts that I’ve posted in the discord, Id think you’d realize that I’m trying to help with your mod and am capable of doing my own script work, I don’t need to steal lol

heady sphinx
#

That's why you came here instead of asking directly on Discord.
Cool, keep up the good work!

inland bronze
#

Literally irrelevant to the point lol. Modders help modders, every one looks at each other’s code. I’d question why you’re so secretive of your code to obfuscate it?

You can look up my mods and see my code is not obfuscated, everyone is free to open and look at them

clever marlin
#

yo cashew link the mod

inland bronze
shrewd nova
#

There’s a ton of mods with obfuscation… one of them is extremely popular and is monetized

#

So if that one doesn’t get taken down for it it’s safe to say that obfuscation is allowed

heady sphinx
# lean moth https://discord.com/channels/105462288051380224/976155351999201390/1387510773755...

Well done, I'm happy for you.
We will destroy anyone who tries to protect their code and develop the Arma community, all so that others can steal your work.
I don't care that one of these closed mods runs servers with 500+ players and generates some income for the game developers, I don't care that they popularize the game among the community.

Anyone who wants to spit on those who make content for the game, I invite you to my thread https://discord.com/channels/105462288051380224/1499084979832094830

coarse moon
red cedar
#

Unless told to change it

clever marlin
red cedar
#

I'd rather be in violation of Bohemia's tos than have my work stolen again.

red cedar
#

Lmao

#

@heady sphinx mind if i dm you?

minor agate
red cedar
minor agate
#

And yes. On the changes to EULA and ToU this year. Obfuscation will be officially banned.

#

For now its tolerated but people unfortunately have abused it

red cedar
#

i mean i wasn't promoting breaking the tos tho ? I just said that if i had to choose between being in violation of the rules or have my work stolen again i'd rather be the one in the wrong than have my work taken again.

minor agate
red cedar
#

i did 2 months ago

minor agate
#

If in game report is taking too long then send it to me or horrible goat

#

Game reports take longer because we have to filter through many of them, and research them

#

As we do not ban without investigation

#

Only case where a ban is done directly is when a DMCA is issued

red cedar
#

I've dmed horriblegoat two documents with side to side comparisons. all i was told is "yeah next week we'll handle it, trust trust" and from my perspective nothing has moved since

minor agate
#

On which you are in legal problem if thr DMCA is not proper

#

But normal reports get investigated

minor agate
red cedar
#

Sure

storm bobcat
#

I am trying to understand the entity budget system for campaign and how to make a vehicle XP cost and individual/category vehicle cooldown.

#

Where is the method that defines whether an entity can be spawned based on budget?

#

Can I get any tips on how to integrate this into the building/budget system?

#

Or here is a question, anyone know what class/method I can put a breakpoint in to start investigating the call stack when clicking a rank locked vehicle here?

quasi osprey
#

im looking for a scripter for 3 projects if your intrested in more details hmu it should not be to time consuming for you

quasi osprey
#

oops mb so many channels forgot abt that

spark otter
storm bobcat
#

There is no XP cost budget in the game. Rank requirement != XP cost

spark otter
# storm bobcat I specified my vehicle cooldown a bit more above. Definitely do need to some scr...

My bad! The way you worded it, I thought you just wanted to adjust the rank (xp) required to get the vehicle. As far as cooldown, I mentioned where you can set the values. Cooldown is set per rank, not per vehicle. But you'll probably have to write your own system to make it per vehicle/category instead of rank. I don't remember what exact class handled this, but I do remember the whole system being quite complicated.

storm bobcat
#

With high modularity comes a high requirement of knowledge

storm bobcat
#

I think I have started to figure it out. These systems are spread out so much

storm bobcat
#

What is the difference between GetOrigin and GetTransform?

spark otter
#

examples in comments

craggy jolt
dire sinew
#

Transform just stores a lot more like a basis set for the orientation and scaling in the first three components.

storm bobcat
#

Question about the Update method.
I want to modify the radio backpacks to automatically destroy themselves if they run out of supplies / respawns.
I am currently looking at the Update method to add this functionality. Does it run on server and client? If I want to destroy the object, I should only call it once and from the server, right?

river imp
storm bobcat
#

I would check for the respawns and destroy from the update method

#

Thats my current implementation that I am working on.
So does the update method run on server and client? It runs on client.
How do I make the behavior server only so I dont have multiple clients attempting to destroy it?

river imp
#

I don't know where the update method runs, test it to find out.

#

One would assume since the server is the authority that it runs on the server and maybe replicates to the clients engine side.

spark otter
#
    /*!
    Updates entity state/position. Should be called when you want to manually commit position changes etc
    before trace methods etc. Entity is updated automatically at the end and the beginning of simulation step,
    when it has EntityFlags.TFL_ACTIVE flag set.
    \returns Mask with flags:
    - EntityFlags.UPDATE - hierarchy has been updated
    - EntityFlags.UPDATE_MDL - model hierarchy has been updated
    */
    proto external int Update();
#

I assume youre talking about the update for IEntity

river imp
#

I wasn't sure

#

But, that update runs on server and then client, if i'm not mistaken.

#

Or a better way to put it, is, the server calls Update then that update is replicated to the client.

river imp
#
class TestAction : ScriptedUserAction
{
     override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity) 
     {
        if(Replication.IsServer())
            pOwnerEntity.SetOrigin(Vector(0,1,0));
        else
            pOwnerEntity.Update();
     }            
};

simple confirmation

midnight talon
minor agate
minor agate
#

Or simulation components

red cedar
#

do we have unsigned int in enforce ? idk if i'm rarted (i am) or if i'm doing something wrong

red cedar
red cedar
#

Thank you btw*

craggy locust
#

Could anyone please advice me on what could be the best method to find out whether a player have weapon?

fringe prairie
#

Could use a inventory search predicate if last one

#

First two are easier

craggy locust
# fringe prairie Held or in slot, or anywhere in inventory?

Thanks, well, that is a bit complicated, but for starter, for primary weapon, being held or on sling.

Im trying to determine whether a player is threat, meaning the gun is visible and not hidden in inventory, like in backpack or clothing.

red cedar
river imp
#

m_HandSlot = CharacterHandWeaponSlotComponent.Cast(owner.FindComponent(CharacterHandWeaponSlotComponent));
Why is this always null? lol

red cedar
#

Custom playermanager kick/ban reasons when?

craggy locust
red cedar
craggy locust
#

I have used GetCurrentWeapon(), but it always return null

red cedar
red cedar
#

Regardless here is a basic method :

bool IsCharacterArmed(notnull SCR_ChimeraCharacter character)
    {
        BaseWeaponManagerComponent weaponMgr = character.GetWeaponManager();
        
        array<BaseWeaponComponent> weaponsComps = {};
        weaponMgr.GetWeapons(weaponsComps);
        
        foreach(BaseWeaponComponent wpnComp : weaponsComps)
        {
            string weaponType = SCR_Enum.GetEnumName(EWeaponType, wpnComp.GetWeaponType());
            Print("Weapon found : " + weaponType);
            if(wpnComp.GetWeaponType() != EWeaponType.WT_NONE)
            {
                return true;
            }
        }
        
        return false;    
    }

Usage :

    void DoStuff(notnull SCR_ChimeraCharacter character)
    {
        
        LogKittenEye("IsCharacterArmed : " + IsCharacterArmed(character));
    }

You might want to add other "non threathening" weapontypes such as smokegrenades for example but this code will let you know if a character (player or AI) is armed

#

feel free to also remove the log statements etc

craggy locust
red cedar
#

You're welcome !

river imp
red cedar
river imp
#

What I posted just returns true or false if any of the weapon slots have a weapon in them

red cedar
#

Oh wait

#

You used get weapon list

river imp
#

No need to iterate the slots and check they "type" of each

red cedar
#

honestly only thing i can say to defend myself is if they want to allow certain items that count as weapons (eg : smokes)

#

that's the only defense i have left lmao

river imp
#

No need to defend yourself lol

#

Just showing you that what he was trying to do could be a two liner

red cedar
#

fair

#

i think your solution might be wiser

#

unless they're trying to whitelist some weapon types... idk how i didnt notice getweaponlist it's right below getweapons 😭

river imp
#

one weird thing I just learned

#

You can't define arrays like

array<IEntity> Weapons();

if your function doesn't exist within a class

red cedar
#

That's odd lol

river imp
#
class HelperThing
{
    bool HasAnyWeapon(notnull SCR_ChimeraCharacter Char)
    {
        array<IEntity> Weapons(); 
        return Char.GetWeaponManager().GetWeaponsList(W);
    }
}

vs

bool HasAnyWeapon(notnull SCR_ChimeraCharacter Char)
{
    array<IEntity> Weapons = {}; 
    return Char.GetWeaponManager().GetWeaponsList(W);
}
#

I guess you probably just can't do it in the main scope

red cedar
#

also i had a bit of a weird question zelik,

I doubt you remember but you kind of initiated me to scripting back when i got started in 1.2, and I was wonderring : Out of the people you start getting started (or you've seen start) if you had to guesstimate how many gave up within a few weeks vs how many actually learned to script in enfusion.

What would the numbers be ?

river imp
red cedar
#

that's a shame

river imp
#

Yeah, glad to see that you stuck around.

red cedar
#

kind of insane that after all this time you're still helping out newcommers.

river imp
#

One of the big problems when I try to get people started is, they expect me to be involved in their entire learning experience and to just endlessly answer questions and I unfortunately just don't have time for that, especially with numerous people.

red cedar
#

from my limited experience helping out people i've noticed that redirecting them to the bootcamp video / wiki pages is often very poorly taken by them.

river imp
#

That's also an issue with the current culture of the world.

#

Everyone thinks that they are entitled to direct answers for every question.

#

Because they've had google at their fingertips their entire lives.

river imp
red cedar
river imp
#

If you're not gonna put in the effort to actively do the hobby, you should just stop tbh.

red cedar
#

it was better when stackoverflow would be your best friend

red cedar
river imp
#

The future of humans having no knowledge and needing a robot to do things for them. Imagine, being the only person left that knows how to write scripts when AI dies. lol

#

We're on a tangent lol

red cedar
#

I assume you're not studying anymore but you should see the current technical debt in our universities...

#

feels like an idiocracy skit

river imp
#

On the subject of scripting though. It's pretty hard to teach people these easily comprehendible concepts.

#

I can explain it all day but, I can't understand it for you.

red cedar
#

at the end of the day it all comes down to effort, time and practice.

river imp
#

Yes

#

And when you finally get to where you can do something without actively thinking about what you're doing, that's when you're actually good at it.

red cedar
#

it's also very enjoyable to feel independant in the workbench.. knowing where to look at, developping the intuiton etc.

#

it was such a liberating feeling when i started "feeling like i could do anything". of course that's an exxageration there is still a lot of things i haven't even touched when it comes to scripting or the workbench,

But when i realized that i could start swimming on my own it felt very liberating.

lean moth
river imp
#

The actual problem is no one that gets into modding(that has 0 experience) takes into consideration the prerequisites for it.

#

If the company requires the skill set for you to be hired, it's a skill set that is required for modding. Because they are the same thing. Modding == Game Development.

red cedar
#

I feel like that isn't necessarily the candidate's fault, i have this feeling that the workbench tries to advertise itself too much as "beginner friendly" or "for everyone" while for example in scripting you will likely need some oop / c# experience.

#

at least that's how i felt when i started. but i had already toyed with c# / asp.net quite a lot in the past so for me the hardest part was mostly learning replications, where to look for and engine specific ways of doing things.

gentle cradle
#

Most people have family and lives and don’t have the time to learn coding. Ai to save the day 🙂

river imp
#

If you don't have time for your hobby, find a new hobby that you actually have time for?

gentle cradle
#

lol

gentle cradle
lean moth
red cedar
#

or do you actually mean what you say ?

lean moth
gentle cradle
#

Oh I actually mean it, ai is a tool nothing more but I’m not going to give up time with family and friends to learn something when I don’t have to.

river imp
gentle cradle
#

Real life comes first, always.

river imp
#

Yeah, and programming isn't a real life skill that can be used elsewhere.

red cedar
gentle cradle
river imp
#

You don't need a formal education to learn any of this.

gentle cradle
red cedar
#

you could look up zelik's chat history, this guy has been helping newcommers get started with scripting for years now

#

Me included.

gentle cradle
red cedar
#

sure there are a few gatekeepers but trust me when i tell you this : The AR modding community is one of the most generous one you will ever come across

gentle cradle
river imp
gentle cradle
river imp
red cedar
toxic lake
#

We’re a hell of a lot better off sharing information now for reforger than we ever were for a2/a3, that was actual bad gatekeeping

red cedar
toxic lake
red cedar
#

gaaa gaaa gooo goo ?

ocean kernel
#

To be fair some folks come in asking for help expecting someone to teach them programming from scratch in 5 minutes, then get upset and call it gatekeeping

maiden goblet
#

There is no tutorial "Learn to code with Reforger script", but if you already know how to code, it's a very quick and simple language to learn.
So best way to help these people is probably to tell them to go learn coding with another language that actually has resources for learners.

marble ridge
maiden goblet
# coral matrix https://www.learncs.org/

Nowadays C# nearly as bloated as C++. Like, endless features to get lost in. Maybe Unity C# a better option; Unity is some ancient much more simple version of C#.

open pier
#

Step 1: learn python
Step 2: dive right into enfusion script(skip the bootcamps)

toxic lake
#

Step 1.1: Struggle and ask ChatGPT

open pier
#

Step 1.2: become entirely dependent on chatgpt

restive island
#

Is there a slick method in enf script to truncate a vector, like <123.03 557.11 167.23> into <100 500 100>?

red cedar
cobalt shadow
open pier
#

oh chatgpt, can thou tell me, what is causing this unknown exception error? Make no mistakes.

true haven
#

Thats ancient the og's just copy paste the errors

red cedar
ocean kernel
cobalt shadow
#

RESOURCES (E): Wrong compile/name for resource @"{A7C69A3FCFF7420E7}Prefabs/stuff/emoji/rocketship/blastoff.et" in property "m_sEntityPrefab"

red cedar
#

this it the last thing you see before ending up with the CommandProcessor

fringe prairie
#

Tools are only as good as the user using them, though ChatGPT is a blunt tool, not really well suited. Claude on the other hand can be pretty intelligent with reasoning and troubleshooting.

trim aurora
#

Looking at the Primitive Types in the wiki: Do I understand correctly that there isn't a byte data type or similar?
So if I only need 4 bits of data I would still just use an int?

sweet badger
trim aurora
sweet badger
#

It doesn't really matter though unless you're dealing with huge amounts of data, these are basically micro optimizations.

#

I've done something like that for my Map Drawing mod, I basically packed a lot of different data together into 2 integers for transmission over the network.
This theoretically improved the efficiency significantly, but I highly doubt it would have mattered if I hadn't done that.

trim aurora
craggy locust
#

Thank you very much for the help Zelik and HideoutKitty ^^ Its working now. I didnt give up, i rarely do. ^^

sweet badger
#

I would have appreciated at least a byte datatype as well, they have been a couple of situations where I wished for one

clever marlin
storm bobcat
unique harbor
# river imp On the subject of scripting though. It's pretty hard to teach people these easil...

I cant really talk much about "scripting" since my scripting knowledge is from A3's goofy code, but sadly I notice that people are less eager to learn than back when i was teaching Nurse students how to do their stuff.
Right now in terrain making, when I try to help someone I notice a lot of backlash because I send them for example the Atlas 2 (the holy bible of map making in enfusion basicly).
They simply do not read said help or just do "a" part of it and skip steps, causing them to fall in even a deeper hole than they are in, even with explaining that they need to follow step by step, this goes wrong a lot of time.

Due to the "luxery" of people needing to learn less to go around has sadly it's negative spire that people sadly do not want to use effort to learn or understand something and when help is given its 5/10 times with people getting anoyed cause you dont explain every bit of detail to them while they can perfectly find that intel themselves within the link(s) that were just provided, or even worse, when I litterly state: google this ect, they go 1 sec after saying it: "cant find it", there is just no effort a lot of time.

OR you have the scenario when people complain about "doing work" and want always an "easy out option" wich isnt there always and moan when they actually need to do some "developping" , this just hurts, since modding is about passion in my eyes and not about: who can push out the most stuff within the least amount of time.

But on the positive note, this is not for everyone, there are also a good amount of people that just need a small push into the right direction and they start to "fly" on their own.
They do their own research and developthemselves.
I saw plenty of nice screenshots of people working on their project(s), I got to met plenty of cool and amezing talented people this way, from scripters to modelers to map makers.,

And I do think, still having the group out there, willing to do effort, hard work and dedication, for the love of their hobby, is still worth it (to some degree) to try to help someone out when they ask for it.

red cedar
unique harbor
# red cedar Sounds like gatekeeping you should embrace ai

"reaperdrone has been send to your location"

All jokes aside, I am very much anti AI, mostly because I do think artists deserve money for their labor, also an artists puts out more quality than AI.
Same as scripting, a scripter can script way better than AI.

red cedar
#

So am i don't worry

red cedar
#

Is there a way to forcefully load a specific area on the map using a vector for examplev (on the client's side)

sweet badger
red cedar
subtle sparrow
open pier
storm bobcat
red cedar
restive island
#

Is there a class that can truncate whole numbers? floor() in Math.c only does float

red cedar
restive island
#

if:else if chain it'll hafta be

restive island
#

At what point is using a Case chain more advantageous than an if:elseif chain, >50 conditions?

river imp
restive island
#

im not set on down, it can be up as well but ceiling and floor only work on float

river imp
#

What determines the way you're rounding?

#

You need to pick a direction.

#

up or down

restive island
#

down then, making backup coordinates: if you're at coord 2141 160 500, it should turn into 2100 100 500

#

i just made a long if:elseif chain for it

river imp
#

Why are you "making backup coordinates"?

restive island
#

in case the map being played returns Null for support station calls to get the base name. The coords get turned into a string and take place of what would be a base name

river imp
#

Why do you need to round those?

#

If you're storing a vector as a string as a name, why not just keep it what it is?

spark otter
#

what does Math.Round(5.5) do? up or down?

river imp
#

up

river imp
#

You're just overcomplicating things for no reason at this point.

restive island
#

so giving it general coordinates based off of position is more accurate and less likely to appear more than once

#

but precise coordinates are too precise, Im basically defining an area around the entity coord

river imp
#

There's 0 reason your generic naming should ever be the same for any of them though.

restive island
#

in testing, it happens where a boundary is named the same as another boundary elsewhere so I need a way to make sure theyre treated correct

river imp
#

You iterate the 01 at the end each time

#

FIA_SupportStation_01,FIA_SupportStation_02,FIA_SupportStation_03

restive island
#

i could, but it wouldnt work right. truncating the coords to general coords makes it so i know if a entity was built around location xyz already

river imp
#

It would work right if you did it right.

restive island
#

it is right as-is, these are a backup so it doesnt return Null

river imp
#

These stations should be build for factions bases, it only makes sense that they would be named for the faction they were created for.

restive island
#

thats not how the logic works, especially if GM places them around

river imp
#

And when they are built by a gm they still have a faction don't they?

restive island
#

the faction is irrelevant

river imp
#

Maybe if you're not naming them accordingly

#

Regardless, do it however you want. But giving the coordinates as names and having to do >50 else ifs is a horrible design.

restive island
#

it doesnt have >50 elseifs, more like 10. that was a general performance question

river imp
#

Regardless, not a good design at all.

#

From a logical standpoint that makes no sense.

restive island
#

it makes sense for what the mod does, and it's only if something goes wrong with getting support station info

river imp
#

Naming them coordinates makes no sense regardless, that's not a good design.

#

The only thing that should matter in this case is which faction it was made for and how many they have.

#

hints the generic name FIA_SupportStation_01

restive island
#

that wouldnt accomplish what the mod is supposed to do

river imp
#

If you say so. I'm just trying to point you in the right direction by pointing out good game design vs bad game design. If the coords of the thing are so important, you can get the coords of the thing from it, regardless of its name.

#

If you're just trying to stop one from being created to close to another one store them in a static array and then check to see if any are too close, use the tag system, or a grid map.

restive island
#

whats a grid map, map coord blocks? edit: nope, needs to be relative coordinates to ensure spacing

open pier
river imp
#

and the doxygen docs didn't exist.

open pier
river imp
restive island
#

yea I already have that with closestbase, but there are instances where it doesnt trigger correctly in HQC. So if my truncating is used for entity X coordinates that resolve to <800 400 100>, then entity Y is placed and its coordinates also resolves to <800 400 100>, entity Y will trigger a different condition.

restive island
pliant ingot
minor agate
#

another version of that is
value - value % 100

trim aurora
#

Is it possible to use out on a static array of a object?
Example: protected bool TryGetTilePoints(int x, int z, out int tilePointIndices[4], out DAB_TerrainObstaclePoint tilePoints[4])

I get the error even though the passed in parameters match:
.../DAB_TerrainObstacleGrid.c(113): error: Cannot convert 'DAB_TerrainObstaclePoint[]' to 'DAB_TerrainObstaclePoint[]' for argument '3' in method 'TryGetTilePoints'
(Or am I missing something obvious?)

trim aurora
# rose coral Does the signature match?

I call it like this:

  DAB_TerrainObstaclePoint tilePoints[4];
  int tilePointIndices[4];
  if(!TryGetTilePoints(x, z, tilePointIndices, tilePoints))

And function signature is this:

protected bool TryGetTilePoints(int x, int z, out int tilePointIndices[4], out DAB_TerrainObstaclePoint tilePoints[4])

The problem does not exist with dynamic arrays.

shell quarry
#

why is it not updating?
ImageWidget rowBackground = ImageWidget.Cast(m_wPlayerRowWidget.FindAnyWidget("Background"));
rowBackground.SetColor(m_Row_ColorA);
rowBackground.Update();

It's white...

#

protected ref Color m_Row_ColorA = new Color(111, 168, 220, 1);

craggy jolt
#

How do entities behave in ItemPreviewManagerEntity.ResolvePreviewEntityForPrefab? Do they auto delete somehow? I see that SCR_LoadoutRequestUIComponent.SetLoadoutPreview creates preview entity (character) but never deletes it

minor agate
craggy jolt
#

Am I missing something, does it endlessly creates more and more preview characters?

minor agate
#

not the main world

craggy jolt
#

Yes, but all I see is entity creation over and over with no cleanup afterwards

#

So I wonder how they're cleaned up

minor agate
craggy jolt
#

No manual delete in SCR_LoadoutRequestUIComponent

minor agate
craggy jolt
#

So entities in preview world delete as soon as you lose variable reference to them?

minor agate
#

I have no idea on that. IIrc they were not deleted but reused

#

But I might be wrong. I recall this from long time ago when we were dealing with virtualization

#

I would need to check what is the current impl. Or find someone that knows

craggy jolt
#

The entity is spawned using ItemPreviewManagerEntity.ResolvePreviewEntityForPrefab in this case, same resource used each time

craggy jolt
minor agate
#

And when you call it again on the same resource

#

Then it searches for the already previously created entity with the same prefab GUID

#

If so, then it just returns it again

#

If not found then it creates it again

#

That's what is in the cpp impl

craggy jolt
#

Aha, so this explains it a bit

minor agate
#

If created then it inserts it as map["ResourceNameGUID"] = Entity

craggy jolt
#

Got it, so it is safe to just summon same assets over and over and have the engine handle it rather than keeping track of loose entities and delete them myself

minor agate
#

It seems it waits until preview world itself deletes

minor agate
#

You will actually cause the UI to lag a bit when dealing with the item previews each time

craggy jolt
minor agate
#

As it will need to stream in all the resources again if they were flushed and what not

craggy jolt
#

Speaking of this, I was wondering if there is a reliable way to preload the asset before making it appear in item preview widget on UI. Arsenal doesn't solve this, you open it and items in the list are missing textures and materials for a bit before they're streamed in.

minor agate
minor agate
#

I guess that?

#

But I am not sure if this preloads assets

craggy jolt
ocean kernel
#

In 1.7 can we pass functions as arguments yet?

storm bobcat
river imp
red cedar
river imp
#

The probably wont

red cedar
#

Would be sick if we could have await and get a return from an rpc call

river imp
#

MethodToCall is called on proxies when the prop is updated through replication

#

That's about as close as it gets.

red cedar
river imp
#

If the owner rpcs a value to the server, to have the server change the value for them, the server knows the value.

red cedar
#

I'm not available to vc rn.

My use case that i had in mind is when the server want to get a client's value that isnt replicated.

For example : i want the server to know a player's screen resolution i'll have to rpc to the owner so that it can rpc it back.

rose coral
river imp
minor agate
#

(I got auto moderated notlikemeow )

minor agate
#

But maybe an util for that might be interesting

river imp
serene fox
#

Hey, if i change the Transform of a "PointInfo" with:

 "proto external void Set(IEntity owner, string boneName, vector matInOwnerSpace[4]);"

The attached Entity will not updated. Can i force a Update?

dire sinew
fringe prairie
red cedar
#

I'd rather get shot than script in JavaScript

fringe prairie
#

Reminds me how there is a minecraft server framework for bedrock which allows people to create plugins in JS, python, C#, C++ and all of it is compatible with the game

#

Obviously what we have makes more sense - but projects like that are always fascinating

river imp
fringe prairie
#

It was a joke about await

river imp
#

Suuuuuuure it was lol

fringe prairie
#

I'll await myself out

river imp
#

Error 404

red cedar
fringe prairie
#

But speaking about this kind of thing, imagine that websocket connections probably out of scope due to engine limitations (single thread), but it would be nice to be able to subscribe to events, etc. from a web api, so polling is less necessary. With my API I am polling repetitively for updates - and maybe I am missing something, but it is not as efficient as I would like it to be.

open pier
storm bobcat
#

Also also, I think the game server just mainly handle game server things. It probably shouldn't handle things such as IoT and non-game web requests.

fringe prairie
winter jay
#

I've got bunch of "Unhandled exception" server crash logs,
i'm trying to pinpoint issue

On current 1.6 patch Arma reforger,
When 2 cars frontally collides between each other, sometimes it causes server crash
I was passenger two times in vehicle in that situations

My ai found something useful or its just hallucination?

SCR_FlammableHitZone flammableHitZone = SCR_FlammableHitZone.Cast(GetDefaultHitZone());
Instigator fireInstigator = flammableHitZone.GetFireInstigator(); // <-- CRASH
if (fireInstigator && flammableHitZone && IsOnFire(flamma...

When two cars collide frontally and take damage, the damage system attempts to update the instigator.
This calls ShouldOverrideInstigator.
GetDefaultHitZone() returns a regular HitZone (not always a SCR_FlammableHitZone).
SCR_FlammableHitZone.Cast() returns null.
The vanilla code calls GetFireInstigator() on null before the if guard ever runs.
Result: Server hard-crashes with NULL pointer to instance exactly when the collision processes its damage.
Fix

modded class SCR_VehicleDamageManagerComponent
{
    protected override bool ShouldOverrideInstigator(notnull Instigator currentInstigator, notnull Instigator newInstigator)
    {
        SCR_FlammableHitZone flammableHitZone = SCR_FlammableHitZone.Cast(GetDefaultHitZone());
        if (flammableHitZone)  // <-- null guard
        {
            Instigator fireInstigator = flammableHitZone.GetFireInstigator();
            if (fireInstigator && IsOnFire(flammableHitZone) && flammableHitZone.GetFireInstigator() != newInstigator)
                return false;
        }

        if (newInstigator.GetInstigatorType() == InstigatorType.INSTIGATOR_NONE)
            return false;

        return true;
    }
}
fringe prairie
winter jay
#

Moment of server freezes then insta crashes after few seconds

winter jay
fringe prairie
#

base logs are good, the minidumps only post iirc. on the diag versions like workbench or diag version of the game

storm bobcat
#

How/where do I find these strings?

restive island
storm bobcat
minor agate
#

Script is single threaded

#

But everything else is not

#

Thats why you have some features that are heavy specifically in cpp

fringe prairie
tender cairn
tender cairn
errant wren
winter jay
# winter jay Moment of server freezes then insta crashes after few seconds

On pure vanilla 1.6 crashes(0 mods), i hopes that 1.7 fix that issue
Or it might be caused by network
my ural 2 players, all other bots(passengers),
another ural 2 players, all other bots(passengers)

1(moddded)
2026-05-19 10:10:44 (UTC) : Version: 1.6.0.119 - Report Result: - SUCCESS - Crash GUID: 424889a9-0d0b-4567-abd8-0b5eef355ab7
2(pure vanilla game master)(on video)
2026-05-19 12:12:51 (UTC) : Version: 1.6.0.119 - Report Result: - SUCCESS - Crash GUID: e8f906d1-93cb-40c2-9865-2c9174fb111e

trim aurora
#

Is there an easy way to find what is breaking the autocomplete in a script file (not the plugin)? Last time I had this problem, it was a { in a string, but this time I just cannot find what the problem is, and it is getting annoying to type every variable name out.

errant wren
#

God dont mod dayz then… its notepad++

open pier
hoary steeple
#
modded class Vehicle {}

Unknown type Vehicle

modded class BaseVehicle {}

Engine class 'BaseVehicle' cannot be modded.
How am I supposed to mod all the vehicles? I want to add an action to them all.

open pier
minor agate
open pier
amber moat
amber moat
storm bobcat
amber moat
#

Still something to keep a sharp eye on though. People are creative

restive island
errant wren
#

You only need to load that mod once as it exports the readable string table to your profile

restive island
#

BI needs to build it into WB so it's easy and fast to reference when typing it out

gloomy lynx
#

its 2026 my guy

#

we have more than 1 core now

#

imagine when youre forced to make the next arma game work on ARM based systems

#

doesnt take much foresight to see the direction everything is heading

#

so much has changed in just the past 4 years, the rate of advancement in tech\software is outpacing the time needed to make a complete product. by the time you finish something it could potentially be obsolete.

#

i havent really seen any companies talking about this publicly

#

all the BI devs should be watching the youtube channel: 'two minute papers'

maiden goblet
#

Feel like you have never written multi-threaded software, or you would not be making such comments. Making Reforger scripts multi-threaded would raise intracatable problems

gloomy lynx
red cedar
maiden goblet
gloomy lynx
#

its an amazing channel, showing the bleeding edge of computing

lean moth
pliant ingot
# gloomy lynx its 2026 my guy

It's not big problem if scripts is used only for "scripting" and not for inventing new physics for thousands entities.
Bigger problem in my opinion - we lost scheduler from sqf 🪦

amber moat
minor agate
#

But illiteracy of the end user with how to handle multi threading

amber moat
minor agate
#

Which unfortunately is even problematic for some experienced programmers

#

If you have worked on multi threaded systems in considerably big projects with multiple developers you would very easily find yourself into the pains and struggles of trying to keep multithreading actually be useful

red cedar
minor agate
#

Now imagine that on with modding. All the random modders that might or might not know anything about this topic

#

Using it freely

red cedar
minor agate
#

If you do not find yourself with data races or hard crashes, you will find yourself with managing the main loop with the other logic be more time consuming and sluggish than if it was single threaded environment

#

Multi threading is not a silver bullet for "free performance". If badly used it can very easily be worse for it

clever marlin
#

reforger is already a veritable helter Skelter of data races... still awaiting

minor agate
#

Big majority of engine and game is not done in scripts.

#

And the part of the game done in CPP has access to multithreading and is using it

gloomy lynx
#

cpu architecture is peaking currently, we cannot make transistors any smaller than they currently are.
it might mean that we are hitting the ceiling for single core performance, and the only answer now is to add more cores.

#

this is probably the main limiting factor to single threaded systems, is the ceiling has arrived, now its about making the software as efficient as possible, and once that is achieved theres no other route than to multithread that system.

minor agate
#

Research it, its good topic but its not what you are thinking it is

gloomy lynx
minor agate
#

Even comms between cores is slower for many things

lean moth
minor agate
#

That alone if used badly is worse than single threaded impl of something

minor agate
gloomy lynx
#

thats not what im getting at, i genuinely want to know what you think is the limiting factor

#

why have very very few games ever gone above that 128 mark?

minor agate
#

If that is what you will try to point to

gloomy lynx
#

data-per-player

minor agate
#

Games are more full of resources, hardware is maxed. But this wont be solved by multithreading

gloomy lynx
#

at 128 players thats half a gig per second depending on the game, some less, some more

#

1 thread 128 instances 2-4mb per instance

minor agate
#

Thats not how it works

#

And the problem is not the amount of data

gloomy lynx
#

a system is constrained to its slowest moving part

minor agate
#

But how it gets processed and the orchestration behind it, or scheduling if you may

#

Plues the hardwarwe limits of working with multiple cores

#

A single core well used is better than randomly used cores

#

And data between cores does not pass around free

#

For games you need things in specific times, in order

#

Schedules, blocked, resumed

#

At the end it has to land on main loop, that is main thread

#

Many processes will have dependencies

#

Which block each other

#

Which causes a halt to everything else

#

Then it becomes worse

#

Its not that common when you will have processes in a game that do not depend on each other

gloomy lynx
#

so in your opinion where is the limitation, physical cpu design? OS design?
im learning here.

minor agate
ocean kernel
#

Yes but multithreading

minor agate
#

Games done by engines that abstract things bring problems here and there

ocean kernel
#

But what if two cores instead of 1, thats double the fps

gloomy lynx
#

lol bruh

minor agate
#

You will see older games from old days using hardware very smart

#

But that part of game development is not too common and used anymore

gloomy lynx
ocean kernel
#

If you use 10 cores maybe you can have lumen

minor agate
ocean kernel
#

Somehow reminds me of inverse square root magic in quake 3

minor agate
#

You need to develop games fast, you now have time to update later on

#

People on n64 or so before could not do that

#

For example

gloomy lynx
#

game devs in the 90s were pioneers of their craft

minor agate
#

There is more leeway on the market now, and in development trends

gloomy lynx
#

its crazy the lengths they went to to get their games small enough to fit on a disc, while also being a complete game with no way of ever patching it

#

today, lots of games are 100gb+

minor agate
#

But there are other examples bigger than that

#

But that is like the popularized example

ocean kernel
#

But respect for coming up with it

minor agate
sweet badger
ocean kernel
#

Tbh the game slows down from other things before AI brain becomes the bottleneck

gloomy lynx
#

so the shit part about using multithreading is synchronizing them all?

sweet badger
ocean kernel
#

Back then also we didnt have AI LOD I think

#

Or it wasnt working or something

minor agate
ocean kernel
#

Why give calllater if calllater bad

#

You give I use

minor agate
#

Individual ones are fine

ocean kernel
#

Ok but I will use global calllater to tick my own callqueue duckshield

minor agate
vernal moat
minor agate
#

When badly used by own game plus mods

#

And this freezes the main thread

#

Which freezes the replication threads because they depend on it

vernal moat
#

like i create my own callqueue, calllater for many various reasons, each one of them freeze rep thread or you are talking about using calllater in some cases/events or whatever that it makes replication wait for it

#

ha ye ok

#

so using it in wrong places basically right ?

minor agate
#

The problem with call later we have is with people using the one in game class for everything

#

They should create their own and tick it

#

At some point it ends up with huge list of things to tick and check

vernal moat
#

arf ok koth r doing this since many montheses since when you said sometimes, because of mods, callqueue explode

minor agate
#

And the whole thing when processing uses a main mutex that lasts until finishing it

vernal moat
#

i thought i could find another way to fix more replication issues in koth

#

yep make sens

minor agate
#

So anything relying on scripts or things relying directly or indirectly from scripts has to wait

minor agate
#

Its not a savior tool. It has good and bad usages

minor agate
vernal moat
minor agate
vernal moat
#

but afaik and talk with arkensor, its more an engine network/gamemode issues (everyone being in same bubble network constantly spawning, shooting ect)
its way better than a year ago tho we could not go past 80ish players

minor agate
#

That error gets shown when rpl system finds itself in a very corrupted state that it stops itself. And then crash the game

minor agate
vernal moat
minor agate
#

Does it happen only with your mod?

vernal moat
minor agate
vernal moat
open pier
#

When thread execution docs? You're just casually dropping straight ball knowledge rn Mario

minor agate
vernal moat
#

hurry bottle is nearly down

red cedar
#

How expensive would a check like this be to run every frame (the player wouldn't be touching his game, just watching it atp)

            m_targetWeaponMgr = m_targetEntity.GetWeaponManager();
            if(m_targetWeaponMgr)
            {
                m_targetSightComp = m_targetWeaponMgr.GetCurrentSights();
            }

Currently the way i have it is that i have this if stament before

if(!m_isTargetAiming && isPlayerAiming)

to basically only set m_targetSightComp when the player aim in/out but i want to now check for scope switch and i'm wondering wether i can run the check every frame or like every 2 seconds ?

ancient venture
#

Does anyone know if it's possible to change the report of a rifle depending on the ammo fired? I am trying to add subsonic rounds, and for the bullets configuration i can just remove the supersonic Crack audio, but I can't find anything in the config to change the actual report depending on ammo type. Im assuming its either a config or a script solution but I've got no clue

red cedar
#

i think you'd have to make your bullet go slower than the speed of sound if you want it to be "subsonic"

#

i could be wrong

ancient venture
#

Im more meaning the report of the rifle, since I believe that supersonic crack is also played when firing, not just from the bullet?

#

Ive edited my rounds to be subsonic upon leaving the barrel, but the supersonic crack still plays

#

Id like it to play for supersonic rounds, but not play for subsonic

#

Its easy to change for downrange, but from the rifle is what I'm having issues with

#

So for example, I fire with a subsonic. The observer hears the subsonic audio as the bullet goes past, but the rifle still plays the firing audio as if its still firing something supersonic. I could go in and change the audio for firing to not include that crack, but then it wouldn't play when firing a supersonic round AFAIK

red cedar
#

they toy with guns a lot

red cedar
#

thanks