#enfusion_scripting

1 messages Β· Page 24 of 1

cobalt shadow
#

I set the hitzone to the only collider for the xob.

unique bolt
#

Anyone else struggling with performance in the enfusion script editor? Are there particularly bad mods for performance I should avoid and is there a profiler for the editor I can use to track down the problem?

midnight talon
serene fox
#

Does anyone know if its possible to attach a local Camera to a Vehicle which is not owned by the player? AddChild is not working...

river imp
serene fox
unique bolt
# midnight talon In general I find running it with a ton of script mods makes it lag out really b...

I guess what I'm trying to understand is what in the mods is causing it to lag out - Is it the number of scripts or script overrides in particular?

It also seems like a weird behavior that it would be stalling only when the script editor window is focused... Something is definitely wrong in here.

The behavior is strangely similar to the lag you see when opening the arsenal during gameplay - particularly when you view it through the resource monitor and watch the CPU spikes.

pine sun
#

Hello, how can I install Arma Reforger mods on Nitrado??

gloomy lynx
#

as long as you are using the parent mod in the server config it should download the dependancies

pine sun
#

What do I need to put in the script?

gloomy lynx
#
    "bindAddress": "0.0.0.0",
    "bindPort": 2001,
    "publicAddress": "192.168.9.10",
    "publicPort": 2001,
    "a2s": {
        "address": "192.168.9.10",
        "port": 17777
    },
    "rcon": {
        "address": "192.168.9.10",
        "port": 19999,
        "password": "changeme_withoutspaces",
        "permission": "monitor",
        "blacklist": [],
        "whitelist": []
    },
    "game": {
        "name": "Server Name - Mission Name",
        "password": "",
        "passwordAdmin": "changeme",
        "admins" : [
            "76561198200329058"
        ],
        "scenarioId": "{ECC61978EDCC2B5A}Missions/23_Campaign.conf",
        "maxPlayers": 32,
        "visible": true,
        "crossPlatform": true,
        "supportedPlatforms": [
            "PLATFORM_PC",
            "PLATFORM_XBL"
        ],
        "gameProperties": {
            "serverMaxViewDistance": 2500,
            "serverMinGrassDistance": 50,
            "networkViewDistance": 1000,
            "disableThirdPerson": true,
            "fastValidation": true,
            "battlEye": true,
            "VONDisableUI": true,
            "VONDisableDirectSpeechUI": true,
            "missionHeader": {
                "m_iPlayerCount": 40,
                "m_eEditableGameFlags": 6,
                "m_eDefaultGameFlags": 6,
                "other": "values"
            }
        },
        "mods": [
            {
                "modId": "59727DAE364DEADB",
                "name": "WeaponSwitching",
                "version": "1.0.1"
            },
            {
                "modId": "59727DAE32981C7D",
                "name": "Explosive Goats beta",
                "version": "0.5.42"
            }
        ]
    },
    "operating": {
        "lobbyPlayerSynchronise": true,
        "joinQueue" : {
            "maxSize" : 12
        },
        "disableNavmeshStreaming": [
            "Soldiers",
            "BTRlike"
        ]
    }
}```
pine sun
#

Because I tried to install Anizay, but my server won't start anymore.

pine sun
#

"dedicatedServerId": "nitrado_ni12582850_1",
"region": "EU-FFM",
"game": {
"name": "Eroforger",
"password": "eroforger25",
"passwordAdmin": "",
"scenarioId": "{1A07351573BDF963}Missions/GM_Anizay.conf",
"maxPlayers": 18,
"visible": true,
"gameProperties": {
"serverMaxViewDistance": "1600",
"networkViewDistance": "500",
"serverMinGrassDistance": "50",
"disableThirdPerson": false,
"battlEye": true,
"VONDisableUI": false,
"VONDisableDirectSpeechUI": false,
"VONCanTransmitCrossFaction": false
},
"mods": [
{
"modId": "65EAE3654D22184A",
"name": "Anizay-MANW 2025",
"version": "1.0.3"
}
],
"crossPlatform": true,
"supportedPlatforms": [
"PLATFORM_PC"
],
"admins": []
},
"operating": {
"lobbyPlayerSynchronise": true,
"joinQueue": {
"maxSize": 10
},
"slotReservationTimeout": 60,
"disableAI": false,
"aiLimit": -1
}
}

pine sun
minor agate
#

By sharing this you just leaked your server password

pine sun
minor agate
#

YOu are using MANW version of tha tmod

#

Which might be outdated already

pine sun
#

Thx

fringe prairie
#

However FindItem must find an item to attach it to, so if the item is out of streaming range a RplId is useless until it is streamed in

sweet badger
#

Has anyone ever found a fix to the script editor being barely usable when many mods are loaded?
I am referring to the long freeze (good part of a minute with many mods) that happens whenever the window becomes active.

#

I assume this is just another issue with the Workbench and not avoidable, just checking in to hopefully be proven wrong.

pseudo merlin
#

You have other editors open at the same time like world editor?

midnight talon
sweet badger
pseudo merlin
#

Well this was how i fixed my script editor lag, when i had world and behavior tree editor open while messing with script editor.

sweet badger
#

I find the issue quite unbearable, e. g. with ~100 mods, every time I move to a different window and back in, I have to wait over 30 seconds, and that's despite having a relatively modern CPU.

midnight talon
#

I suspect the root issue lays somewhere in Script Editor's LSP (or whatever equivalent system it uses for typing/autocomplete) backend struggling to complete calls in a timely manner when it has to merge too many overrides.

Like if you have 10 mods overriding the same method, script editor has to merge all 10 of them to get the final type info for that class to present correct autocomplete suggestions to you when doing your own override. If you have 100's or 1000's of stacked overrides it starts to add up

pseudo merlin
#

Does it do anything or just freeze?

sweet badger
#

Freeze + CPU load, completely unresponsive

pseudo merlin
#

I would have said maybe the auto compile script thing.

midnight talon
sweet badger
midnight talon
#

Nah it happens with auto compile off

pseudo merlin
#

Sorry but blobdoggoshruggoogly

midnight talon
#

Like I was saying I think it's related to script editor's LSP or equivalent functionality

#

The editor needs to basically be compiling scripts constantly in the background to give proper type information/autocomplete etc and I think it's this process that starts to chug on codebases with lots of stacked overrides

sweet badger
#

Perhaps, though idk why it would need to redo this every time the window becomes active. Maybe also bad code, who knows.
I wish I could say I hope this will get fixed soon, but the issue has existed for so long now despite coming up every now and then that I'm not that optimistic

pseudo merlin
#

I'm not sure if devs would fix/look into this if it requires 100+ mods.

#

Its rly a lot.

sweet badger
#

Happens with less mods too, but to a lesser extent.

pseudo merlin
#

Did you report it or did anyone already talk to you about it?

#

Dev wise.

gloomy lynx
#

script editor started lagging profusely after 1.6

#

even if its off it still does it

#

like i mean its not turning off

pseudo merlin
#

Well i don't rly have a lot of experiance with using this many mods at the same time, but for me the auto script compile thing works.
Its pretty much the very first thing i always disable whenever i reset workbench.
Maybe there is something in the background i'm not aware of but at least i don't get the auto compile anymore.

sweet badger
sweet badger
#

Simply the presence of an empty script file could significantly increase the duration

midnight talon
#

so probably not specific to stacked overrides but maybe still related to how script editor merges scripts or something

sweet badger
#

That would be my best guess blobdoggoshruggoogly
Either way, nothing we can do but suffer

pseudo merlin
#

Its lagging rly badly even with just 13 mods?

midnight talon
#

so weird that it tanks WB perf so hard but actual compiler speed seems unaffected

midnight talon
#

Why does SCR_PlayerIdentityUtils.GetPlayerIdentityId(playerId) sometimes randomly return an uppercased UUID for peertool clients? This breaks player UUID checks (e.g. I have their lowercase UUID tracked, trying to find that UUID in a map using an uppercased version returned later fails)

First log showing lowercase UUID is being called in a persistence deserializer, but when I later try to get player UUID again later inside an SCR_GameModeComponent it gives uppercased UUID

candid garnet
#

I'm having an issue where the ResourceNamePicker does not want to choose a file sometimes. Sometimes it does, and then sometimes it refuses until I change the name of the file to something else and back again:

    [Attribute(defvalue: "", uiwidget: UIWidgets.ResourceNamePicker, desc: "xyz where space is the separator", params: "xyz", category: "Import")]
    protected ref array<ref ResourceName> m_sImportDataFilePaths;

bug? or should I use a different widget. It has to be an array widget

midnight talon
#
    [RplProp(), Attribute(desc: "Whitelist of EntityCatalog entries to filter for this trader", uiwidget: UIWidgets.ResourcePickerThumbnail, params: "et", category: "Dynamic Economy - Traders")]
    ref array<ResourceName> itemWhitelist = {};

works as expected for me

#

oh wait you're using ResourceNamePicker, I used ResourcePickerThumbnail. Maybe give the thumbnail one a try and if that works it must be some issue specific to the name picker one?

candid garnet
midnight talon
#

oh that's an actual file extension? I just assumed it was some placeholder value lol

candid garnet
#

no and discord will mute you if you put the . starting so be careful

#

but xyz file is a point cloud data file

midnight talon
#

ah ok, if the thumbnail picker doesn't work either it could be something specific to that extension type. Does that same issue happen if you change it to select some extension native to Enfusion like .et instead for that property?

candid garnet
#

FileNamePicker also fails. These files can be infinitely big depending on how many trees people generate in gaea. I'm just trying it with 20k lines, but some people have done 600k lines

#

okay so... filenamepicker and making the array an array of strings instead of ResourceName and then casting it later is working more consistently

midnight talon
#

Sounds like maybe another case of type auto conversion maybe not working as intended if the only difference between working and not is whether you type it as ResourceName vs string

candid garnet
#

yeah so i changed the import array to strings, then I did a cast later:

ResourceName filePath = (ResourceName)m_sImportDataFilePaths[fileIdx];

//later
ResourceName filePathStr = filePath.GetPath();

so I can use GetPath()

since ResourceName doesn't have a Cast method. No compiler errors

midnight talon
#

And it all works fine in runtime?

#

I swear I remember someone from BI saying ResourceName is just a string, which clearly isn't the case if you can get different behaviours between typing something as that or string

candid garnet
#

i mean its a child class of string with some added engine methods

torn bane
# midnight talon Why does `SCR_PlayerIdentityUtils.GetPlayerIdentityId(playerId)` sometimes rando...

because i am using our new hexdecimal to string converter which is upper case by default. but it should always be the same, it does not change when called.
the uuids starting with 00bbbddd mean they are peertool placeholders. the other ones are from your workbench host or other real players with associated steam accounts.

You tolowered your string somewhere to get the first print line. i'll change the util to be lowercase consistently with other uuids. did not notice, thx

torn bane
midnight talon
torn bane
#

the wrapper method always returns the same format, hash maps do not care about a mixed case, it will just work when you pass the same key every time

midnight talon
#

The first UUID was exactly as returned by the util, as I mentioned it seemed to return a different result depending on where I called it.

midnight talon
#

As I mentioned in my first post about it, I got lowercase UUID when calling it from a serializer, but uppercase when I called it from a gamemode component

torn bane
#

There is no code path that would allow different return formats.

midnight talon
#

The only reason I discovered this oddity in the first place is my lookup for the UUID later was failing, because it was trying to look for uppercase UUID but lowercase one was tracked, map.Get() returned null

torn bane
#

Reproduce it and step through with a debugger to see whats going on.

cobalt shadow
#

Using scripts could I allow a player on this stretcher to be worked on (Ace Medical) by someone not inside a compartment like the doctor compartment inside ambulances? Allowing CPR and all the other ACE Medical things.

pine nacelle
#

Hey curious if anyone knows of a script or could help me make sense of a script that would only allow you to join a faction on a server if you were recruited from within a radius at there base? Trying to utilize this for a survival type server

unique bolt
# sweet badger That would be my best guess <:blobdoggoshruggoogly:748124048025714758> Either w...

I have been struggling with the same thing - It's pretty infuriating having to wait 30s every time you focus the script editor window.

I've been trying to see if there's some EInit code or something that's getting run during edit time or when the scripts reload that might kick off some log info.

Any telemetry around this problem would be useful at this point.

It's suspicious to me that the thread stalls look similar to lag you see when loading the arsenal sometimes so I'm thinking it has something to do with loading resources from disk.

Anyways, I'm continuing to debug this as it's getting in the way of our server development, so if you find anything or want to collaborate on getting a solution, feel free to DM me.

sweet badger
#

At this point I doubt this is something we can fix on our end, would have to be solved by BI probably

#

Which so far they haven't, but who knows, maybe someone is reading along and decides to finally have a look

unique bolt
unique bolt
#

Does anyone know what the default element size is for an array in enfusion?

river imp
#

The size of the element in bytes?

unique bolt
# river imp The size of the element in bytes?

Sortof - A managed array by default will have a certain number of elements reserved - That will be the size of the unmanaged block of memory that backs the array. If you keep adding elements to the array, eventually the underlying system will re-allocate the backing array to accommodate the extra items, so it has to move all the old items into the new contiguous array.

It's why they have a Reserve() call on the arrays.

If it's relatively small and people call .Insert() for large list items one at a time, there's a good chance it's re-allocating the arrays multiple times before the inserts finish... so it'll be really bad for performance and memory fragmentation.

river imp
#
array<string> Array = new array<string>();
Print(Array.GetSizeOf());
#
SCRIPT       : 56
#

seems to be 56 regardless of element type

unique bolt
#

I think in c# it's like 4 elements... so if you have 1000 items being added to a list and you add them 1 at a time without reserving, it would allocate:
array[4]
array[8]
array[16]
array[32]
array[64]
array[128]
array[256]
array[512]
array[1024]

so basically an extra 1020 elements and 8 extra managed objects that need to be cleaned up by GC immediately after the operation completes.

Rather than just
array[1024]

If you were to call array.Reserve(1000) before inserting.

river imp
#

It seems to be 0, with 56 bytes being for the container itself.

unique bolt
#

Yeah I can't seem to get the underlying size - There may be some pooling system in their virtual machine for all the array types.

#

I ran some tests on size and it's always the size of the elements + 56.

minor agate
river imp
minor agate
#

as it's on CPP side

#

There, you are getting what the array object itself takes

river imp
#

And getting the size of a populated array shows a size increase. Am I confused about something or what?

unique bolt
#

I can't seem to demonstrate any performance benefit to using reserve...

Very weird.

river imp
#

Reserve is only called like 150 times

minor agate
river imp
#

Oh, okay.

#

Kinda weird to have a function called GetSize, that doesn't get the actual size lol

minor agate
#

Otherwise the alloctor will just move the offset limit ptr around tand that is is

minor agate
unique bolt
#

I thought about that - Tried allocating new arrays to see if it was the array pool. It might be the remote console's runtime that's stopping it from showing anything.

minor agate
#

Container classes in Enforce, are not really inheriting from Class internally even

#

It shows like that, but it is not on the internals

#

So they behave differently

#

They are also quite legacy so it uses so old stuff that still has to be updated

minor agate
river imp
#

Oh, Mario the FT thing we talked about the other day, I forgot to do it but, did you want me to sub you to it?

unique bolt
#

Here's the test I ran:

int InsertTestSize = 100000;
int NumTests = 100;
array<array<int>> Arrays = new array<array<int>>();
Debug.BeginTimeMeasure();
for (int test = 0; test < NumTests; test++)
{
Debug.BeginTimeMeasure();

array<int> Array = new array<int>();
//Array.Reserve(InsertTestSize);
for (int i = 0; i < InsertTestSize; i++)
{
    Array.Insert(i);
}
Arrays.Insert(Array);
Debug.EndTimeMeasure("UnReserved 100000");

}
Debug.EndTimeMeasure("Total");

minor agate
river imp
#

haha

minor agate
#

Do bigger test

#

hundreds of million

river imp
#

100K isn't shit for Enfusion

minor agate
#

IF you want to see anything

unique bolt
#

I would still expect there to be a measurable difference between reserving and not... /shrug

#

I ran with 10,000,000 - Same results.

unique bolt
minor agate
#

Dev only tool for now

minor agate
#

So you should not worry much about it

unique bolt
#

Yeah I thought maybe it could be contributing to that stall out with the script editor.

minor agate
#

Nothing to do with scripts

#

The parser seems to freak out a little after some changes to it sometime ago

unique bolt
#

Does it run like intellisense? EG some background task that tries to parse the scripts before compile-time?

unique bolt
#

Gotcha - I'm assuming this is on dev radar then and to just sit tight till next release or something.

Having the autocomplete parse run on callback for the window focus seems to be the most frustrating pain point - Is there a way to disable it? Not fun waiting for 20s every time I switch back and forth from discord...

minor agate
#

Like the game issues, other bugs from engine that affect the game as whole and workshop upload issue

unique bolt
#

I don't supposed I could convince a producer to schedule in a toggle to disable the autocomplete in the script editor options could I?

river imp
#

Maybe on the Feedback Tracker as a feature request

#

But good luck

#

How many dependencies are you using? I've never had that issue before.

unique bolt
#

about 80 - It adds up quick - Ace and WCS are like 30 mods combined.

river imp
#

Is your mod actually dependent on all of those?

#

Often people use mods as a dependency when they don't actually need to.

unique bolt
#

I'm not sure - I'm helping debug some issues from a server config that someone else is managing.

A lot of it is modifications to the arsenal, so they need to understand all the objects that get added.

river imp
#

I would say that 95% of those mods don't even need to be a dependency and they can just be used on the server.

#

Unless your(or their) mod is actually using things from those mods in a particular way, then they aren't actually dependent on those mods.

unique bolt
#

Is there a way to check the references to see what I can remove?

river imp
#

Not 100% sure

#

I know i've seen some context menu that has "find references" somewhere but, i've never actually used it.

#

Think about it like this though, a dependency is literally something your mod is dependent on. I.E. My mod is dependent on Redline_Core if I need to inherit from one of their classes or one of their prefabs.

unique bolt
#

No, I get it...

river imp
#

Yeah, a lot of people don't though.

#

That's how you end up with mods that have 80 dependencies.

unique bolt
#

The child dependencies still need to be included as well right?

sweet badger
timid citrus
#

Any dependencies of dependencies are added afaik

river imp
#

As they should be

timid citrus
#

Ya

unique bolt
#

Will indirect dependencies be loaded if I kick off the in-editor play button to test stuff?

river imp
#

They kinda have to, do they not

unique bolt
#

that's what I would have thought - But if they aren't added the mode might just throw shittons of errors and die.

river imp
#

If I use "Redline_SuperCoolHilo" as a dependency and it requires "Redline_Core" then I need "Redline_Core" as well.

unique bolt
#

And those affect the editor stall right?

Like reducing the dependencies is the overall dependencies - not just the direct ones.

river imp
#

I would assume so, they have to be loaded for their dependecies to be loaded.

minor agate
#

But newer version of Workbench has Workshop integrated to it and allows you to manually download mods from there or automatically when you load some addon. Same for updating

severe owl
#

Is there a chance we may get more shapes for BaseGameTriggerEntity? spheres are nice and all but I really need a cylinder so i can make the zone uniform from ground to skybox while still being able to get and set the radius dynamically.

The bounding box doesn't have any options to adjust the size once set, and polyline seems to not work at all with the same constraints as the bounding box.

Or is there another way to get players inside a defined area that doesn't require checking every player in the server in batches (like the restrictionzones do) to see how close they are to the zone?

midnight talon
open pier
severe owl
#

Yeah still have to check every player though to see how close they are to the entity, where as the BaseGameTriggerEntity does some engine magic it seems to detect only the enities within the trigger that you can then filter.

#

so anyone outside of the trigger it doesn't even see or care about

river imp
#

You channge the bounds....

severe owl
#

"skybox while still being able to get and set the radius dynamically."

river imp
severe owl
#

you cannot change it dynamically by getting the radius there is no GetBoundingBoxSize(), SetBoundingBoxSize() etc.. like there is for the sphere with GetSphereRadius() and SetSphereRadius()

river imp
#

Why would you need to?

severe owl
#

Because I want the zone to dynamically adjust

#

Example I want the zone to be 50% of the distance from MOB to the first capture point (capture points will not be the same on every map), the sphere can do that but It would be great to have the zone be a cylinder instead of a sphere so that its uniform from ground to skybox. Currently you can get closer to the center of the zone without being inside of it due to the curve of the sphere

river imp
#

Yea, I misinterpreted what you meant when when I skimmed over your post.

#

You're only real option is to write custom functionality.

#

Polyline could maybe work, But I don't think we can create them at runtime.

#

They also don't have anything drawn for debugging, I had to write my own functionality for that.

#

What exactly are you trying to do to everyone in that zone?

severe owl
#

All good, yeah I just hate that custom functionality would be having to check all players to see if they are in the zone (Like the contaiment/restriction zones do) while the above entity doesn't need to do that and only cares about entities inside of it, I guess i'll have to keep messing with polylines then sadcat

river imp
#

If you give a clear example of what you want to do to those players, there way be a more convenient way to do whatever it is you're trying to do.

severe owl
#

pretty much an inverse restriction zone so you don't die when leaving but you cannot enter unless you are of the correct faction, which makes it more of a warning zone if you are getting to close to the enemy main base.

I have every thing else for it good and working with the sphere It just that if you are flying a helicopter you can be high enough to fly over the sphere since it doesn't go to the skybox, and if the sphere is to big it ends up convering areas you don't want covered

#

the restriction/containment zones do this by checking every player on the map in batches of 10 to see if any in that batch are in a zone which to me is just ineffienent, since we have this method that checks just who is in or enters the zone and everyone else on the map it doesn't care about so it doesn't even waste time checking them.

river imp
#

If you're trying to limit players from being x meters from x MOB, the height should be taken into consideration as well if you ask me. So the sphere would be the best approach, If the limitation is 50 m and i'm 60 m in the sky, i'm not too close. MOBs are "hardcoded" are they not? So why the need for dynamic size changing. if you know exactly where they're gonna be? If you don't wanna use the sphere use the bounding box and make it incredible tall and x size. If the first capture point is 500 m away and you're doing dynamic sizes, you're gonna have a huge sphere.

#

the first capture point is 100 m away, it's "trigger box" is the red one, alternatively the first is 500 m away, it's "trigger box" is blue.

#

In this example, lets say the first one is the one thats 500 m away. it's sphere would then encapsulate the other capture point. Meaning the enemies wouldn't be able to be at a point that they currently control. I don't play the game but, I just realized that the capture point's may or may not be "in order" depending on the game mode. If they are ordered, The dynamic sizing approach won't work for the above reason. Otherwise, that approach would work, assuming the closest one is considered the 'first" one.

#

On the other hand, if you use a bounding box trigger shape, with no intention of altering its size. You would get a result like this, and it would work every time.

#

In this example. the limitation is 50m in either direction around the MOB and 500m vertically.

severe owl
# river imp If you're trying to limit players from being x meters from x MOB, the height sho...

the issue is I don't want people to be able to be 60 meters over the top of the zone, it should be 60 meters from the center from gound to skybox. which is where a sphere would be great cause then I get the height benefits of the bounding box but the exact radius I want as well which can dynamically update depending on the values I give the zone and the map being played.

Not sure what you mean by mobs being hard coded but the idea is it doesn't mater where the mob or first point is, for any scenario i can tell the sphere to make itself a percentage of the distance to the first non-hq point, you can't use a bounding box cause then if there is a map/scenario with points within 500 meters of the mob the bounding box is now in the wrong spot and covering a capture point.

Capture point order and all that doesn't matter.

#

if BI adds the cylinder option it would pretty much give the best of both worlds just surprised it wasn't a default shape to use

river imp
#

The locations of the MOBs are static, are they not?

#

The distance to the "first" capture point is relevant, if the capture points are ordered. Idk, what game mode you're using, if you're using a game mode that has the capture points chosen randomly and their capture requirements are in order then your logic is flawed regardless.

severe owl
#

I could make a scenario with mobs or capture points anwhere on the map they are not fixed

severe owl
#

i do not calculate the radius of the sphere based on capture order

#

its on the point closes to the mob

#

but again

#

all that logic is down pat

#

its the fact i want a cylinder

#

so you can't fly above the sphere and be over the top of the MOB that the sphere currently surrounds

river imp
#

You didn't say that originally, you said the "first" point. Not the closest, and depending on the game mode, first doesn't always mean the closest.

severe owl
#

be to make itself a percentage of the distance to the first non-hq point,

#

is what i said

#

the first would be the closest

river imp
#

the first would only be the closest if the game mode works that way.

#

"Example I want the zone to be 50% of the distance from MOB to the first capture point "
If your game mode makes the first one the "closest" then you logic is fine. You've never expressed that is how the game mode that you're using works though.

severe owl
#

Ok so I guess to calrify it will always stop at the closest point

#

still need it to be a cylinder

#

xD

#

so I will just have to hope we get that

#

maybe come arma 4

#

πŸ™

river imp
#

Doubtful but maybe.

#

Regardless, If you lose the entire idea of dynamic sizes you can simply use a bounding box trigger.

#

You could even make a few of different sized and just choose which one to spawn.

#

sizes*

severe owl
#

Yeah but that’s not happening as the dynamic size is needed

river imp
#

No it's not lol

severe owl
#

I’m not making a bounding box for each map

#

To make a zone to the closest base

river imp
#

You just want it. lol

severe owl
#

When I can just calculate the distance and make a circle

#

That goes the same height to the sky

river imp
#

You wouldn't make one for each map, you would make maybe 4. And use the size you need depending on the situation.

severe owl
#

and then what if the map maker makes a new scenario with a point closer and that new point is within my bounding box

river imp
#

Then you choose a smaller one to spawn.

severe owl
#

so instead of having 1 prefab that can self adjust no matter the map, situation, scenario. I make 4 fixed ones?

river imp
#

You can argue how that's not "great" or whatever but prefabs are kbs in size.

#

And they can all inherit from a single parent making the child prefabs even smaller.

queen furnace
#

Does anyone know of a mod like a 5-minute game start timer where they can't turn on the vehicle?

queen furnace
#

HQ

#

It's for multiplayer, like in conflict, 5 minutes of preparation, the Barbies get made up, and then only leave the main area with all the vehicles

neon elbow
#

uhhh, I don't know of any mods. But I think I made a timer that started only when the game mode began

#

Oh man, what a mess lol

neon elbow
#
    protected void WaitGameStart(IEntity owner)
    {
        float TotalDuration = (m_iSeconds * 1000) + (m_iMinutes * 60000);
        if (isGameRunning())
        {
            Print("The vehicle will now move");
            ClearEventMask(owner, EntityEvent.FRAME);
            GetGame().GetCallqueue().CallLater(GrabVehicle, TotalDuration, false, owner);
        }
        else
            Print("The vehicle is waiting for the game to start")
    }
    
    override void EOnFrame(IEntity owner, float timeSlice)
    {
        //There are issues with stopping the checks for every frame. Please fix this.
        m_fCheckDelay -= timeSlice;
        if (m_fCheckDelay <= 0)
        {
            m_fCheckDelay = m_fCheckPeriod;
            WaitGameStart(owner);
        }
    }
    
    protected bool isGameRunning()
    {
        SCR_BaseGameMode checker = SCR_BaseGameMode.Cast(GetGame().GetGameMode());;
        return checker.IsRunning();
    }
queen furnace
#

Add components to the game mode by generating scripts if

#

Anyway, in that thing about scripting or what I mean with ChatGPT lol

queen furnace
#

I'm still an expert at checking the workbench console log and seeing if the script is going well, but I don't know how to create it; otherwise, with AI I would already make it haha

neon elbow
#

uhh, I was thinking that you would put the component into the vehicles that you want to stay locked until the timer has expired

#

The code I posted is just part of something else. What's important is the IsRunning() method

#

within the SCR_BaseGameMode class

#

Basically You want to check if the game is running. If it is, start the timer. If the timer has expired, set the cars to unlocked.

#

oh, can you not post links to the BIKI anymore?

#

I can help you make a component if you want. But I don't currently know how to lock and unlock vehicles. If you don't have time right now please look at the component tutorial at the BI community wiki

turbid crypt
queen furnace
#

Not only lock and unlock, but also allow them to get in normally but not be able to start the vehicle so they don't move forward and respect the 5 minutes

sinful oasis
#

Why is this only working for PC, not PS5? PS5 users can supposedly ADS with no issues at all. Untested on Xbox. Anyone got a clue lmao, this is insane

restive island
shell quarry
#

Hello i'm new to enfusion scripting (but not at programming things), I attached a prefab to another (static object to a truck) and i would like to know how to retrieve the attached prefab object from the owner IEntity, api docs does not mention a suitable method for this. just saw FindComponent but i do not think it is correct for my use

shell quarry
#

by adding BaseSlotComponent and then a RegisteringComponentSlotInfo

#

saw in the tutorial wiki (the mounted gun on the car)

#

oh well, now i see, may be the RegisteringComponent... so i need to use IEntity#FindComponent ?

torn bane
spare kraken
#

did you find it out? I'm wondering the same

tough cave
#

is it normal for SCR_CharacterDamageManagerComponent to only ever have 1 instance count no matter how big the inheritance chain of prefabs is? all the other components on the character will count up to however deep you are, starting at Character_Base. Like, you could be 14 deep on most components, but this one will always say 1.

minor agate
#

That is telling you how deep you have to go to find a modification of the component

tough cave
#

yea, it's usually a sign of broken inheritance, but I wasn't sure.

minor agate
#

It can have any number

#

It does not mean it's broken

#

It just tells you on what level the last modified version of the component is at on the inheritance tree path

#

It has nothing to do to instances count

tough cave
#

well, that was the wrong word, but it should be counting up unless it's special. just making a note of it because I was looking (something was broken with hit reg somewhere in my mods I use).

minor agate
#

You must have modified it somewhere to reduce the count

tough cave
#

I am in an empty test mod. so, no mods, just messing with base game prefabs

minor agate
#

Or someone removed the component on the base

#

and added it again

#

Whcih essentially creates it again but with diferent ID

#

Meaning yours will be broken now and treated as new

#

But in this case you would see it as two components on the prefab

#

Sometimes our own devs mess up and do that

#

and it affects mods like this

timid tree
#

would it be possible to make commanding menu entries for firing ScenarioFramework triggers?

minor agate
sinful oasis
shell quarry
#

Is there a way to change the root prefab class from static to dynamic (or kinematic) to make the (atm static) object rotate via scripts? i tried overriding EOnFrame and set the appropriate Flags but it seems not doing anything

timid citrus
river imp
timid citrus
#

Yeah just make it inactive / no gravity probably be fine unless you need kinematic for a specific reason.

late locust
#

Why is the position of SetBoneMatrix being added instead of set? thonk

minor agate
#

It sets the offset of the bone basically

#

Not the state

late locust
#

Wait is it the same with rotation then?

minor agate
#

Yes

brazen sphinx
minor agate
#

Think of it as similar to slapping the procedural nodes in Anim Editor

late locust
#

Thats why my bones are flying all over the place

#

Should be called AddBoneMatrix then hmmyes

minor agate
#

The matrix is fixed

#

And that matrix is used to make the animations's poses

#

In math terms, it's what is used as basis

late locust
#

All I want is to make a bone look at a position

#

So I guess I have to convert everything to local offsets then

minor agate
#

If anim graph is running, then use anim graph

#

If it's not the use the barebones low level bone api

late locust
#

the fabrik ik node in anim editor has no limits so im trying to make my own solver with limits hmmyes

minor agate
late locust
#

its the only way

minor agate
#

According to docs, it has

late locust
#

Well a single one yeah

#

not per bone

minor agate
late locust
#

Yeah thats one value for all bones

minor agate
#

Use IK2 Target with chains then?

late locust
#

I have a IK2 Target

#

I need to set the min/max rotation for each axis for each bone, cant do that anywhere currently

minor agate
#

After the path of the IK target

#

Use a Constraint node then

#

Limit it there

#

It's under procedural node group

late locust
#

Hmm will check that out, thanks

#

But is a script for that really that bad for performance?

minor agate
#

Small script that animates player for just moving forward is slower than almost whole player graph

#

Graph gets compiled, and working on more directly and lower level

#

It will always be faster

late locust
#

But I need a script for setting the ik target position anyway

minor agate
#

Plus it does many optimizations that simply you can't do on scripts

minor agate
#

You can feed info to the graph from scripts

late locust
#

Im doing that already, but if I add a little bit of math and move some bones, cant be that bad, not like im spawning 1000 mechs

minor agate
#

You are forgetting the part of whole scripted solver every frame

#

Use the graph, it will save you time

late locust
#

Yeah "little bit of math"

minor agate
#

and it will be more stable

late locust
minor agate
#

And I recommend it because there was some talk before to remove SetBone and so due to they having no need to be there

#

its there due to legacy

#

So it could be removed at any point

late locust
#

What nooo

#

Removing set bone but not adding vector into the anim graph notlikemeow

minor agate
#

The vector thing

late locust
#

And that for every IK Target

minor agate
#

I think you can set predictions from script iirc

late locust
#

Also if setbone getting removed no point in finishing my cloth simulation I guess πŸ™ƒ

minor agate
#

You can only Get rip

#

You could do IK Target setting πŸ˜›

late locust
#

Pretty sure that does nothing

#

And thats only characters

minor agate
late locust
#

Well that would be great

minor agate
#

Looks like it wa added when needed when someone was working on characters and added it there

#

instead of base

late locust
minor agate
#

but that was also the reason it was wanted to be removed

#

for misuse

#

But if it start to be misused badly

#

And cause instability then that forces the hand

late locust
#

Its just way easier to setbone via script than use and make a whole anim graph for it

minor agate
#

So modding is taken into account, specially recently

#

But modders themselves will not be added into these things

#

Not viable

#

But you get the mod dept as representative/voice

grim barn
minor agate
#

Thank you for the reminder

limber sparrow
#

Hi, is there a way to make it possible for AI bots to trigger the Area Trigger Resource?
At the moment it seems to work only on Player for me..

modern marlin
#

Hi. I've been trying to detect grenade explosions ( at minimum just want to know where the grenade goes off ). I've tried various things including attaching components to the grenade prefabs ( also the warheads) but I don't even seem to get calls to EOnInit . Is there a simple mechanism to do this? ( the BaseDamageContext does not seem to include grenades as a damageSource either if using DamageManager components.) I must be missing something here?

oak thorn
grim barn
# minor agate Thank you for the reminder

Lol anytime, this has been a pain in the backside to try and create custom projectiles. Especially since we cant fully edit them to how we want ( from personal experience) it would be nice to soon be able to fully edit them, as a lot of Sci-fi mods rely on it, especially the big ones like auto turrets and Gf

#

Nice to see the acknowledgment

#

thank you

limber sparrow
# limber sparrow Hi, is there a way to make it possible for AI bots to trigger the Area Trigger R...

Hi, I am looking to make an AI vs AI tug of war.
I have set up an Area that has a Layer that has a Slots which spawn entities.
the Area has a Trigger resource
{2CB3F93211D06F83}Prefabs/Systems/ScenarioFramework/Triggers/TriggerDominance.et
and is set to Dynamic Despawn when nobody is in the trigger
It works when Player enters the trigger area,
But when AI units enter trigger area nothing spawns.

To find out if it is because of the trigger itself I have put the trigger separately and put some spawn code into it, and the trigger worked regardless if Player of AI entered it. But I dont know who to make it spawn a Layer with lots of Slots or even a single Slot, at the moment I can only spawn one entity per one trigger.

So if I could make an Area Trigger get activated by an AI Bot or get a custom trigger spawn a Layer, that would be very helpful.

Thank you

pseudo merlin
#

I have 2 scripts with the same class name.
modded SCR_AICombatComponent : ScriptComponent ( the first )

and

modded class SCR_AICombatComponent : SCR_AICombatComponent( the second )

Is this okay-ish or bad: ( Its working but i like to make sure )

pliant ingot
#

when you mod class you don't need to specify parent

#

and multiple modded are ok

pseudo merlin
#

Oh rly?
I did not know.
Thank you. πŸ‘

sleek moat
#

Is there anything earlier to detect a players id joining than AuditSuccess? OnConnected seems too early for the uid to be read and compared

torn bane
pliant ingot
#

why eventprovider is limited to just new stuff from world systems? scriptinvoker is way better...

#

how to get join code on DS? Or parsing log is only way?

tawny lotus
#

How to find which weapons (and what ammo) is available on e.g. helicopter "gunship hedp"? Trying to use GetWeaponsSlots() returns nothing.

static vale
#

Would you expect that a trace excluding the player entity would exclude that players vest and helmet?

It seems like currently even thou the vest/helmet are children of the player, they are not excluded? Any easy way to exclude them?

red cedar
desert escarp
#

But this was for client sided code. As client side players do not track children of other entities it seems

static vale
desert escarp
#

Maybe inventory items are different. In that case you could just do GetRootParent and see if it casts to a ChimeraCharacter

abstract nymph
#

Hello, could you help me with replication? Currently, when the player triggers "void TogglePower()", the action is played locally, but other players and the server don't see anything. If the server triggers it, then all players see the same thing. How can I make the client push to all players? I tried to follow the example in the RplRpc and RplProps Wiki, but it doesn't work... Thx for your help

class FRM_ScreenCoreComponentClass : ScriptComponentClass {}

class FRM_ScreenCoreComponent : ScriptComponent
{
    protected IEntity m_Owner;
    protected bool m_bPowered;

    // ------------------------------------------------------------
    override void OnPostInit(IEntity owner)
    {
        super.OnPostInit(owner);
        m_Owner = owner;
        m_bPowered = false;
        m_bBootFinished = false;
        LoadLayout(m_rLayoutPowerLess);
        ApplyTextureAt(0);
    }
    // ------------------------------------------------------------
    void TogglePower()
    {
        m_bPowered = !m_bPowered;
        Rpc_TogglePower(m_bPowered);
        Rpc(RpcClient_TogglePower, m_bPowered);
    }
    // ------------------------------------------------------------
    [RplRpc(RplChannel.Reliable, RplRcver.Owner)]
    protected void RpcClient_TogglePower(bool PoweredRPC)
    {
        Rpc(Rpc_TogglePower, m_bPowered);
    }
    // ------------------------------------------------------------
    [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
    protected void Rpc_TogglePower(bool PoweredRPC)
    {
        m_bPowered = PoweredRPC;
        if (m_bPowered){    
            //m_bBootFinished = false;
            LoadLayout(m_rLayout);
            ApplyTextureAt(0);
        }
        else
            //m_bBootFinished = false;
            LoadLayout(m_rLayoutPowerLess);
    }
etc next of the code......
red cedar
#

The way you should call it would be Rpc(Rpc_TogglePower, arg1);

#

Oh nvm

#

You did it just below

#

Also if togglepower is client sided a client cannot broadcast anything

#

You'll need to go from client -> authoritx -> broadcast

pliant ingot
#

And I haven't encountered any situations where it broken yet.

abstract nymph
desert escarp
minor agate
#

It's a really bad antipattern that unfortuntely is everywhere in AR, and due to that it kinda forces you to use it

#

We do not use script invoker at all in A4 for example

red cedar
minor agate
#

Just event system, and even system came from needs of A4 for proper systematic events

#

AR got it as a nice bonus if someone wants to use it

#

In AR, only systems and controllers have the event system

pliant ingot
abstract nymph
minor agate
#

and these two, are supposed to be the soruces of all logic in Enfusion

#

So anythingt aht should trigger an event, should come from that

#

not entities, not components, not a random class

#

Not using systems, and not using proper events is the source of the initialization issues you face currently, or the need to do "CallLater" to do something after next frame and so

#

Also, events should be simple side effects. Ask yourself if you really need to make an event to make your class talk to another Related class

#

Events should not replace direct calls

red cedar
#

Events are convenient sometimes nodding_fish_emoji not optimal but convenient

minor agate
#

You should only make events, for when you want to expose a side effect to an UNRELATED class

minor agate
#

and cutting corners lead to issues

#

Event System is the answer to keeping events, but keep them still systematic and controllable

#

And people cutting corners is the reason it has strict restrictions

red cedar
#

(Jk future me already happened)

minor agate
#

If you want to somehow port your system/feature a bit nicer to A4 later on

#

I recommend to start already by using systems and event system

#

ScriptInvokers will not be a thing at all in A4

#

ScriptInvokers allows you to very easily by it's design to fall into recursive events, or event hell

#

And such thing is cause of compilation error in Event System

#

And VMEs

#

Which architectural wise, is not easy to solve depending on complexity

#

Also event system handles memory properly

#

So it won't mantain your classes alive by accident like how it happens with ScriptInvokers

#

Or cause corruption when you pass a pointer class

desert escarp
# abstract nymph Oh... so what should I do? Because my entity is a prefab screen.

Could create a ClientToAuth manager in the player controller with

void TogglePower(bool power, RpcId tabletId)
{
    Rpc(Rpc_TogglePower, power, tabletId)
}

[RplRpc(RplChannel.Reliable, RpcRcvr.Server)]
void Rpc_TogglePower(bool power, RplId tabletId)
{
    IEntity tablet = Repliaction.FindItem(tabletId);
    if (!tablet)
        return;

    //find your tablet component
    //Call the broadcast method here like you would.
}

You can get replication RplIds by doing Replication.FindId(ITEM).

Also sorry if its wack, sudo code Im typing on my phone off the top of my head.

minor agate
#

Plus they are faster

#

And you can define order of execution

#

Less memory usage as well

#

And less clutter in code

red cedar
# minor agate Or cause corruption when you pass a pointer class

Question about arma 4, will we see more vanilla "system" we can lean on for modding , such as for example radar implementations, guided missiles logic etc?

I feel like currently it is quite a shame that modders have to make their own which then cause compatibility issues, either you use an existing framework such as wcs_armements or do your own thing, idk i just feel like those should come with the base game

minor agate
#

It's impossible to foresee what a modder might want to do in all cases

#

Systems are made with moddability in mind since the beginning, if that might answer your question

abstract nymph
red cedar
desert escarp
pliant ingot
minor agate
#

So you should not expect it to be copy of Arma 3

#

There might be things that are not planned at all

#

different games

#

It's not Arma 3 Remastered (Enfusion version)

#

For any answer on what will be in there

#

You have to wait for the roadmap

red cedar
#

I see, i guess time will

#

I'm both excited and kind of scared i won't lie 😭

minor agate
#

You won't get answer on design features here. Only some tech perhaps but not design

abstract nymph
pliant ingot
minor agate
#

Use filtered events for that

#

Give the entity as filter

red cedar
pliant ingot
minor agate
#

On later update you will get possibility of using string on it

desert escarp
minor agate
red cedar
#

There was one time i was so lazy i converted the class to json, sent it to the server then serialized it back to a class nodding_fish_emoji (i'm lazy asf)

minor agate
#

It will make a mess of scripts, specially for those modders that are careless or not technical

#

It's the same reason we are not providing lambdas too

minor agate
minor agate
#

Just beware that when you throw the event

#

The would be first parameter to feed the provided event is the filter

#

So that will be used to know which filtered event connections to call

#

So that mean that the event signature has to have the type arg for it too

#

Which is a way to enforce you on passing around the filter to received events. which you can use for further tracking if needed

#

It's also used for static compile time event type and signature checking

#

So no more random invalid connections being added like with invokers later on corrupting things

shell quarry
# river imp Why does i tneed to be kinematic if all you want to do is rotate it?

i tried settings the correct flags but it wont rotate via scripts, idk if i doing it right way but in short term i am overriding EOnFrame and added the script as component to the prefab. then placed the prefab in the test world but it just stay there and wont rotate. For rotation i manipulated the Angles via getAngles() and then setAngles()

river imp
#

That's not needed to rotate an entity

shrewd nova
#

Add one bone, weight mesh to it, record 360 degree spin anim, import all, add anim to player component.

tough cave
midnight talon
minor agate
#

So we prefer to avoid it

#

It has good uses, but it is more often abused and breeding ground for misuse.

#

And that will be found out more on a development environment where not everyone is technical

#

not to mention to make such things even more complicated for those non technical modders

#

We aim to provide a simple scripting language, not a full feature set language with all the tools that there could be.

restive island
#

Are there any plans in BI to train an AI model on Enforce scripting?

static vale
#

Is there a way project a camera onto a material? For example a mirror or tv screen?

clever marlin
#

and its expensive

static vale
# clever marlin rendertarget

Also i saw an example from i think bacon. Where he had a keypad and could the numbers on said keypad. How is that done?

clever marlin
#

you create a layout for both of these. but the keypad numbers can either be a txt widget or you could do an imageset and use image widgets in the spots where the keys would be on your layout

#

something like that

static vale
clever marlin
#

set the bcr to $rendertarget

#

in the material

#

can click the little dropdown arrow where u put in edds

shell quarry
maiden goblet
tough cave
#

the modders themselves are already agentic. they display Aggregate General Intelligence and communicate over a Discordful API. also, free.

gentle cradle
#

im not going to go into detail on here, but there are plenty of free models out there that you can add a knowledge base to.

unreal heart
#

Morning Folks, Trying to get this parajump from the DC3 working. I'm trying to spawn a player directly into a moving aircraft's passenger seat via script. I have the BaseCompartmentSlot and the player entity, but I can't find the correct API call to move the player into the compartment. I've tried MoveInVehicle, GetInVehicle, SetCompartment, MoveEntityInside, and OpenCompartment but none exist. What's the correct method to programmatically place a player into a vehicle compartment?

sour prawn
#

How can i override the input of the helicopter to assign a value ex: 0.00 and block any further inputs ? for ex : the cycling

tawny lotus
#

Having a weird issue with in game entity browser (GM). I have defined spawnable helicopters (modded) in
...Mod\Configs\Editor\PlaceableEntities\Vehicles\Vehicles.conf . All good in WB - works as expected and the helicopters are found in GM. Opening this in game (SP or MP), shows nothing. I'm missing smth somewhere but what?

Solved: Dang, this was a #me-issue. I did not have all the files in my development branch.

tawny lotus
#

How to find which weapons (and what ammo) is available on e.g. helicopter "gunship hedp"? Trying to use GetWeaponsSlots() returns nothing.

restive island
restive island
gentle cradle
shell quarry
#

player

open pier
#

I think we're all forgetting that BI doesn't want their IP be used to train AI

torn bane
#

If there is ever a MillerGPT then it would come from us. You don't have permission to provide our scripts to other parties for training

shrewd nova
#

The one unreal has is pretty damn useful, if enfusion had one then it would be very useful for new people to do the correct things instead of trial and error for months for lack of documentation

maiden goblet
red cedar
#

Good reason to ban ai code from the workshop then nodding_fish_emoji

gentle cradle
candid garnet
#

If I wanted slop I'd go to Chipotle

candid garnet
open pier
red cedar
empty anchor
#

I'm trying to figure out how to find a random position within a ScriptedGameTriggerEntity, but not sure if a trigger is the right entity to base this off? Any pointers would be appreciated

shrewd nova
#

It’s shipped with a ai that is pretty much a tutorial agent

open pier
#

A replication agent would be all that I want yeehaw

shrewd nova
#

Finding the absolute truth for how some Enfusion stuff works is a task in itself. You got this discord and a few wikis.

#

Most modders I see are learning through trial and error

open pier
shrewd nova
#

Yeah we need some good examples of multiplayer replication to learn from

#

A sample mod that does that would be amazing

minor agate
#

No need to guess

#

Just beware

#

That there is no permission at all from us to use our data/code to train AI

open pier
minor agate
open pier
shrewd nova
#

Simple working examples

minor agate
#

at that point you spent the same time to rebuild a example game which is not worth it

#

sample mods re basic, like weapon as sample and so

#

For the rest, docs and the game should suffice

shrewd nova
#

Mp replication needs more attention for explanations

minor agate
shrewd nova
#

Yeah you’ve given us all the ingredients

#

But what about the recipes

minor agate
#

And the modding bootcamps for replication

#

They teach you everything you need to know as modder.

minor agate
#

So no sample toy mods

gray thistle
#

hello

I’m trying to edit here, but I can’t. What is the reason?

minor agate
#

We are making them reference actual current game features and impl

shrewd nova
#

Yeah soo make the stuff from the modding boot camps, sample mods

minor agate
#

Which is why we are phasing out wiki

#

and go with doxygen as we can valiate things automatically there

#

See if it breaks right away

open pier
minor agate
#

We are taking different aproach, sample mods as people have said to us before

#

are useless as they often miss key things

#

Or do not really get them anywhere

#

Better to show based on actual game

open pier
minor agate
#

There will be guide/tutorials

#

But not standalone sample toy mods

shrewd nova
#

I learned more from the sample car than anywhere in the biki or discord

#

But ok

minor agate
gray thistle
minor agate
#

What I am saying is, we are showing these tutorials (Like the one you find for sample car) not on sample mods anymore

#

But on actual things that are in game

#

So that is is actually more true to how things were done in game

shrewd nova
#

Half your modders are very hands on

minor agate
#

And changes propagate after updates

#

That way is true to how things are set up

#

not artificial

#

And they do not become outdated quickly

#

It's just better reference material

#

I do not see how that is worse

#

You are still provided with the tutorial/guides the same

#

Just with actual game content

#

and with no pipeline that is often not the same used as game that is done in samples

restive island
#

a "cheat sheet" would be nice to have like 100 examples on how to call things, set them, etc. Example: see players held weapon name; view players inventory item names; check if player x is at base y; check base y if any players nearby; get count of vehicles player x has spawned; get name of base where prefab xyz was build by player; ...

minor agate
#

This means, that for those features/impl we take as base. Their sources will be provided

#

But no more synthetic sample mods

open pier
true haven
#

if u want ur own label, choose a random numb.

shrewd nova
open pier
minor agate
#

You are not reading it seems

shrewd nova
#

I am reading I get the point but I don’t agree

minor agate
#

I am not trying to be annoying here, but read again please

#

It will be the exact same as sample mods

#

Just the sample will not be a toy project

#

It will be an asset or whatever that is actually in game

#

Better quality base, something that is in game

open pier
minor agate
#

You get the tutorial on it more grounded to actual reality

shrewd nova
#

Take the gun sample mod for example

#

The bull pup

minor agate
#

How will that restrict it?

shrewd nova
#

That’s not in the game and it’s showing how to make something entirely new

minor agate
#

We can combine multiple things

#

I am not saying for some things, we will not add new things

#

I am just saying that the target now is to try to use actual game as base for samples

#

compared to how it was done in the past to have samples separate completely

#

Which very quickly makes it obsolete and pain to mantain

shrewd nova
#

There’s still no tutorial for vehicle animations

minor agate
#

I am telling you docs and so are being worked on

#

Tbh I got tired already of this conversation

#

Seems like going in circles

maiden goblet
minor agate
#

We are aware docs are not ideal right now, many are being created. Different systems for it are being set

#

But we tell you we are on it, and complain about the same right away

gray thistle
shrewd nova
#

No offense but you guys have β€œbeen on it” for a few years on some stuff

#

Sorry if I’m not immediately taking your word

minor agate
#

I guess there is no point to continue then

shrewd nova
#

That’s sincere I get your position.

#

But you gotta see it from my side

restive island
minor agate
#

You have been told what is being done about. New people got hired to do it.

#

At some point you will receive it.

#

It's not lies. We gain nothing on that, just more resentment towards us.

#

So I will leave it there with you, seems we must show it, not say it.

shrewd nova
minor agate
#

It's my job to take that, and remove it.

#

On your case is actually providing thsoe things. It just went in circles so no need to spam anymore πŸ˜…

restive island
#

@minor agate is it possible to have weekly update discussions in the voice channel? Just for awareness of what's happening BI side that would be of concern for modders, but not a "my mod isn't working plz halp" session.

minor agate
#

It is viable yes

#

Bit I am not sure how productive it would be all the time

#

But we can try

shrewd nova
minor agate
#

At least it would be nice way to connect modders to us as a person reather than corporate/company thing

#

Modding Bootcamps Q&As were heaviliy liked

#

When I did the modders united discord where we held roundtables voice chats with 25 devs where modders could ask anything was also extremely liked

restive island
minor agate
restive island
red cedar
minor agate
restive island
#

i have a full time job and starting a small business so I'll ask 100 dumb questions without regret πŸ˜‚

minor agate
#

we invited around 300 modders, and 25 devs were around (Even those that are not even here in this discord, so a bit more unique than usual)

#

Open stages where people could talk to us, get answers, discuss problems and solutions

#

etc

restive island
#

25 devs might be overkill for a weekly update/round table/karaoke session

minor agate
#

This might be too much to always make (It was quite insane to pull off), but we can do smaller ones from time to time here

#

But it showed what I wanted to show internally with this, that personal contact to modders is better than corporate contact.

#

As modder myself before, my biggest gripe was feeling unheard/left out by devs.

#

So that is why there is a lot of direct involvement of devs here

#

You can always ask us for things

minor agate
#

Same for the modding bootcamps Q&A

#

Even our own devs hosting them really liked it

#

Many have asked if it can be done again

#

Issue is that for regular devs, there is the risk of them breaking NDA

#

by accident

restive island
#

Maybe for every big release a well organized large one is done prior the release, while the others can be small and just to relay information

minor agate
minor agate
minor agate
restive island
#

I'd take a day off work too, beats sitting in meetings πŸ˜„

minor agate
#

Except when someone mentioned mod monetization

restive island
#

You could probably get the Twitch Reforger content partners involved, im sure they'd find it cool playing with/talking to devs and modders. Though i dunno if modders are gonna be as social as they are πŸ˜‚

minor agate
#

To test their mods with us, check issues and performance more directly

#

Both for bonding and finding/solving/spotting issues

minor agate
#

In any case, any change/improvement for modding should/must reach me

#

So you can always ask me anything

#

or request

#

So do not be afraid of breaking the discord rule of no pinging/dm BI devs, as I am exception to that.

open pier
open pier
restive island
#

im getting used to object oriented coding, i've only ever used py API calls when I need something πŸ˜„

open pier
restive island
ocean kernel
#

grok is this true

buoyant peak
#

Hello everyone, i've a small issue.
On my spawnLogic, i create the entity and then setInitiamMainEntity via playercontroller.
(I also notice the respawn component that i've spawn) but i've always this black screen.

Can someone help me ?
Thank you !

torn bane
# buoyant peak Hello everyone, i've a small issue. On my spawnLogic, i create the entity and th...

This looks like the loading placeholder which is normally destroyed automatically when spawn requests are handled. if you made your own spawn logic you may either disable it in the attribute settings of the spawn system on gamemode, or clean it up on the client aftet the spawn is completed https://enfusionengine.com/api/redirect?to=enfusion://ScriptEditor/Scripts/Game/Respawn/Logic/SCR_SpawnLogic.c;595

buoyant peak
#

Oh I see ! Thank you for the informations

quiet drift
#

Hi, If I insert a scriptinvoker in the constructor of a weapon animation component, am I obligated to remove it to avoid memory leak ?
I spawn an entity and to make sure it's destroyed when the weapon become inactive, I copied the system of the flare anim comp. I have trouble to understand if I shoud .remove and how I can do that since there is no OnDelete() or similar method in the generic component

SN_WeaponComponent weaponStateComp = SN_WeaponComponent.Cast(ent.FindComponent(SN_WeaponComponent));
if (weaponStateComp)
weaponStateComp.GetOnWeaponStateChanged().Insert(OnWeaponStateChanged);

#

In the flare anim comp, it seems like .Remove(OnWeaponStateChanged); is never done, or I can't find it

pliant ingot
#

wtf?
code:

instigatorCharacter.GetFaction().IsFactionFriendly(playerCharacter.GetFaction())

1st photo: in caller of Faction.IsFactionFriendly - different factions
2nd photo: in function SCR_CampaignFaction.DoCheckIfFactionFriendly that called by Faction.IsFactionFriendly - same faction
🀯

pseudo merlin
#

Double check. πŸ˜‰

#

Just to make sure.

pseudo merlin
#

Already happened to me as well.

pliant ingot
# pliant ingot wtf? code: ```c instigatorCharacter.GetFaction().IsFactionFriendly(playerCharac...

Something is broken... 😐

auto a = SCR_ChimeraCharacter.Cast(instigatorContextData.GetVictimEntity());
auto b = SCR_ChimeraCharacter.Cast(instigatorContextData.GetKillerEntity());
Print(a);
Print(b);
Print(a.GetFaction().IsFactionFriendly(b.GetFaction()));
Print(b.GetFaction().IsFactionFriendly(a.GetFaction()));
        
auto af = a.GetFaction();
auto bf = b.GetFaction();
Print(af.IsFactionFriendly(bf));
Print(bf.IsFactionFriendly(af));

Result:

1
1
0
0
pseudo merlin
#

Only thing i could think of is to Print af and bf, to check if it is, what it is supposed to be. blobdoggoshruggoogly

pliant ingot
pseudo merlin
#

Yes i know.
But you have to start somewhere.

pliant ingot
#

its full vanila

pseudo merlin
#

Its the only thing you have no print for.

pliant ingot
#

I only mod this function to add Prints, no other mods presented

pseudo merlin
#

Yes i understand.

torn bane
umbral spade
#

Hi! Could you please tell me how to find the code that deletes empty magazines?

candid garnet
umbral spade
#

Thanks for the advice, but I couldn't find anything about deleting magazines. I tried searching for conditions that would delete a mag if it's empty, but I couldn't find anything either.

I'm asking here in case this is hardcoded into the animation or something like that, and there's no point in searching through the code.

torn bane
river imp
# umbral spade Yes

Until, the feature request I put in is added (if it ever is) doing so is kinda pointless tbh. You would only be able to fill the ammo and not add ammo in different patterns.

midnight talon
#

yeah it would be amazing if engine allowed us to manually pack mags like in Tarkov. Also subsonic ammo is something we're still missing

restive island
#

What's it whining about when I want to grab the string a function returns, but an error says the function has no return statement?
** No return statement in function returning non-void 'SCR_MilitaryBaseComponent.GetCallsignDisplayName'**

granite tendon
#

I would like to use some methods in my mod from another but without dependency. it means that I want to check if external mod is loaded on server and if yes, then use those external methods. is there any way to do that?

open pier
torn bane
worldly pier
#

SCRIPT (E): @"Scripts/Game/RpLife/Core/EconomyManager.c,21": Operator '-=' not supported with array accessor []
SCRIPT (E): Can't compile "Game" script module!

do anyone know why im geting this

kind widget
red cedar
timid citrus
#

Does the _S suffix on some methods mean server?

#

or static

red cedar
#

Like OnPlayerInitialized_S means the player has fully finished initializing iirc

restive island
torn bane
restive island
red cedar
#

Currently you're not returning anything, so you're returning void, which is incorrect

#

By returning super.MethodName() you are basically allowing the base method to "resume it's normal work"

restive island
#

Why wouldn't super.GetCallsignDisplayName(); already do that since it has a return in it?

midnight talon
red cedar
midnight talon
#

If the result of the call to super method doesn't get returned or output by your override any way then your override is effectively trying to swallow the output

red cedar
#

Just because b has a return doesn't mean that it will impact every other method that calls it

#

If your return type is different than void you will ALWAYS need a return statement in your method

restive island
#

im gonna need a Ghost drink to digest this

midnight talon
#

Just think of it like your override is composing a call to the other method

#

The other method still does it's return in your override's call to super method, then your override does nothing with that instead of returning it

red cedar
restive island
#

yes python, rarely needed to utilize classes

red cedar
#

If not then yeah i feel you, inheritance is one of the most confusing thing to learn for most people but as soon as you'll understand how it works you'll never forget it

red cedar
restive island
#

yea, learning cpp as i go with a book, and brocode, and modding

midnight talon
restive island
#

i think i get it, just weird im returning a super of a method that has a return in it already

#

yes i primarily do functional programming

midnight talon
#

Think of it executing over the input like
pipe(vanilla.method, override.method)

Is the same behaviour as calling super.method in your override, but never returning in your override would be like override.method in the functional example returning nothing and nuking any data from the previous function

#

This allows you to also cache the result of the vanilla functionality and apply mutations on top of that value before returning a different value, in your original override you could do return super.GetCallsignDisplayName() + " test"; to return vanilla callsigns suffixed with test

restive island
#

so essentially if I override any method with its own return, I need to have it as return super.method()

#

bc otherwise the Method() will just have its return go to super

midnight talon
midnight talon
torn bane
#

No, super.GetCallsignDisplayName() gets you the value when executed of the parent method. a string. what you do with it is of no concern. but the method you override expects you to also return some string, it can be something unrelated, but there must be one

midnight talon
#

Otherwise code that calls GetCallsignDisplayName() expecting a string and getting void from your override would break

#

Whether or not you actually call super.method() will depend on if you want your override to still execute vanilla logic, sometimes you will want to do it before or after your override logic or not at all, but your override has to be compatible with the original method's input and output types

restive island
#

think i get it now, just weird since the super call is pasting code back in so i wouldnt have thought of needing a return for it

red cedar
#

That would be php require

#

The way a method is called is with some silly things happening in the stack, basically toying with the program counter to make execute bit of code from somewhere else and then come back to the point it was before the call.

red cedar
restive island
red cedar
#

I'm not an assembly expert you might no more, all i know is that you save parameters and the program counter (which is not really the same as the address once it is compiled in opcode) regardless i won't spread my science too much on that i don't understand this subject enough to confidently affirm anything.

But with the exception of some methods that are "optimized" by the compilator calling the base or another method isn't the same as copy pasting it

open pier
red cedar
#

Anecdotal

restive island
#

I understand inheritance, it's just figuring out how to call things in other files to use in logic, using types, and return issues like above

open pier
#

Very basic but a static class can be used like this:
GSE_AddonUtils.GetPlayerName(arg)

Else you have to instance the class you want to use which varies depending on where the class you want to use a method is in

GameMode gameMode = GetGame.GetGameMode()

gameMode.Method()

restive island
#

What if I'm trying to pull something not static and is protected, I know it will change? I get errors trying to just pull the name of the base/callsign of where something was built no matter what I try: Inheriting, overriding, inline calls (below).

// Trying to grab from a protected string in SCR_CampaignMilitaryBaseComponent.c from myfile.c
string baseName = SCR_CampaignMilitaryBaseComponent().GetBaseName();
Print("The base name where new service station built: " + baseName);


// SCR_CampaignMilitaryBaseComponent.c
class SCR_CampaignMilitaryBaseComponent : SCR_MilitaryBaseComponent
{
    // Code ...
    [Attribute("#AR-MapSymbol_Installation", desc: "The display name of this base.", category: "Campaign")]
    protected string m_sBaseName;
    // Code ...
    
    //! Returns the name of this base
    string GetBaseName()
    {
        return m_sBaseName;
    }
};
pliant ingot
candid garnet
#

In other words, get the mil base entity first, then grab its mil base component, then you can mess around with it.

#
SCR_CampaignMilitaryBaseComponent milBaseComp = SCR_CampaignMilitaryBaseComponent.Cast(someEntity.FindComponent(SCR_CampaignMilitaryBaseComponent));
if (milBaseComp)
{
    // milBaseComp.DoMyMethod();
}
restive island
pliant ingot
#

someEntity is just a variable name, that must be at least of type IEntity, the easiest way to get it is to use FindEntityByName function which is on World, that you can get by GetWorld from Game which can get by GetGame function.

#

And of course for this method entity must be named, but not all names that you can see on left side of World Editor is real names... you need name that can be set in top right corner of World Editor when you select any entity...

restive island
#

I might need some kind random GUID to get the base name, or find the closest base to the built prefab, so they get treated properly

restive island
restive island
#

dang, still says it's null

restive island
red cedar
restive island
# red cedar World.FindEntityByName??
void GetName(){
    IEntity findprefab = GetGame().GetWorld().FindEntityByName("LFD_FD_US"); //LFD_FD_US named on E_prefab, left side of World Editor
    SCR_CampaignMilitaryBaseComponent milBaseComp = SCR_CampaignMilitaryBaseComponent.Cast(findprefab.FindComponent(SCR_CampaignMilitaryBaseComponent));
    if (milBaseComp)
    {
        // milBaseComp.DoMyMethod();        
        Print(milBaseComp.GetBaseName());
    }
}
#

its not saving the name so maybe thats why it's null

red cedar
#

You renamed the entity in the world right? Not in the prefab?

restive island
#

did both, i get a VM crash when doing it in world

red cedar
#

You can't rename an entity in the prefab iirc, only in a world, the name must be unique, if the vm crash at runtime it's likely because you're not checking your values and calling methods on null variables

restive island
#

Dang it. It does stick in world, but adding another of the same object will make it crash

#

This mod is meant for PvE and PvP, so each thing will need a unique ID to identify what base it's at

#

Or just whatever base is closer to it

red cedar
# restive island Dang it. It does stick in world, but adding another of the same object will make...

I'll be heading to bed now so can't really assist you longer but make sure the names are unique in the world

Check that before calling methods on your entities / comps you check that they're not null, also usually there are many other ways to find entities than doing a findentitybyname.

Usually you can make it so that the entity itself announce it's existence to a game mode component for example which means you won't need to name every tent / base.

restive island
#

ok, many thanks for your help!!

pliant ingot
pliant ingot
restive island
midnight talon
sleek moat
#

Does anybody have a decent way to detect or prevent hackers getting on the server and doing stuff like spawning buildings? We've been having issues recently were people are able to get on and then they will spawn in buildings not even available on GM etc

So i don't think detecting a GM would be enough

restive island
#

also ensure your Admin password isn't something like "password"

kind widget
sleek moat
#

It's definitely not them gaining admin as its passworded with only like 4 people knowing it and we change it regularly plus they don't show up as an admin in game

river imp
#

I mean, B.I. should breach their contract with BattleEye or whatever because it apparently hasn't worked in the 30 years they've been using it.

restive island
#

I use this to grab what's being placed, maybe you can use it to see what's getting placed and go from there. Player placement uses SCR_CampaignBuildingPlacingEditorComponent.

modded class SCR_PlacingEditorComponent : SCR_BaseEditorComponent //GM placement only
{
    override protected void OnEntityCreatedServer(array<SCR_EditableEntityComponent> entities)
    {
        foreach(SCR_EditableEntityComponent Comp: entities)
        {           
            string gm_spawned = Comp.GetPrefab();
            Print(gm_spawned);
        }
    }
};
#

There's something else that can give you the unique instance ID and vector coordinates of placed entities in the world viewer output, I'm not sure what library it is though

forest arrow
#

Hello. I have two points. Is it possible to find road or road points between them? For road or roads which are connection both point

sturdy pollen
#

Is it possible to connect enfusion to external APIs

torn bane
forest arrow
sturdy pollen
empty anchor
#

Is it possible to return the mins and maxs of the GenericTerrainEntity bounding box? I tried returning it with

GenericTerrainEntity terrain = GenericTerrainEntity.Cast(GetGame().GetWorld().FindEntityByName("Terrain"));
        terrain.GetBounds(mins, maxs);

But they just return <0,0,0>

candid garnet
empty anchor
river imp
#

Querying the entire map is the worst way to do what you're doing

empty anchor
# river imp What specific class?

Custom entity thats based off GenericEntity. I was trying to see if there was another way of achieving this as qurrying the entire map did seem a bit ridiculous

river imp
#

In your class define a static array of that class then each entity can add itself to it when created and removed itself when destroyed.

empty anchor
#

Ahh that makes sense. Thanks for the advice

river imp
forest arrow
river imp
#

You're not explaining the outcome of what you're asking to do, if you explain that then there might be some optimal way to do it.

#

If you think that(the way your're suggesting it be done via your question) is the only way that it can be done, in most cases you would be incorrect.

#

There are numerous ways to do things, and have the desired outcome.

ocean kernel
#

ctrl + click no worky anymore

restive island
#

To drill into items? it does, but it's picky what it'll do it to now

vague obsidian
solid hearth
#

I suppose it'd be SCR_HeadgearInventoryItemComponent::DetachHelmet

static vale
#

How can i get navmesh data on a building? Basically i want to find a reachable position in a building

pliant ingot
#

World Systems have RplLoad/RplSave stuff or I need to manually sync through World Controller? (Because there is no definition for them in base class like for entities and components)

minor agate
#

They do not have to be in base class

#

If they are rpl enabled, then rpl system will look out for those, if defined

ocean kernel
#

Do I need to script physics to be active for an item so that it falls down when game starts or the entity is spawned?

#

I thought setting rigidbody to active would do it but guess not

tawny lotus
sour prawn
#

how does the RHS vehicle NV component works and how can I bind a custom key to activate it ?

candid garnet
#

Right click it and go to script to see how it works?

pseudo merlin
#

Even if the position is not reachable, the A.I. will move, as long as it can towards the position and cancell, whenever it reached a dead end.

static vale
pseudo merlin
#

It's very complex to say the least, but working pretty well.

clever oxide
#

Hi! How to get vehicle attachment in proxy if i spawn it to empty slotmanager slot by server side script?
Slotmanager's slot returns null for GetAttachedEntity() in proxy, works only in server however i see the replicated object on vehicle.
And i not see it in IEntiy childrens list.

NVM. I found it in childrens.

solid hearth
#

Pretty sure you have to replicate that yourself per client the server doesn't do it. Since the server owns the vehicle and controls it things seem synced up.

static vale
#

How do i change the position of where a grenade is thrown? Is it hard coded?

For example i want to create a underhand throw. I see overhand throw in player_main.asi, but don't understand how the overhand throw is triggered. And how it could change the actual position of where the grenade is thrown from?

buoyant peak
#

Does someone have a idea how can I replicate a map ? Using RplProp ? Or any other solution ?

clever oxide
red cedar
#

Hello hello ^^

Since the changes made to restCallbacks I'm wondering what would be the cleanest approach to callbacks.

A mod of mine has a LOOOOOT of different callbacks and using .SetOnError() / SetOnSuccess and pointing to a method in the class isn't a viable option for me. I guess i could create a static class and point it there but i'm not sure.

What would be the best approach? I liked the approach we previously had with creating a class and overriding OnError or OnSuccess

buoyant peak
#

Hello I try to use the dedicated server tool. But when I use It I can't get the player's UID. But when I work with the WB It works.

Does someone have an idea ?
Thank you

buoyant peak
red cedar
# buoyant peak So how can i do ?

on the WB fake uids are being generated.

Using dedicated server tool you're emulating the way a dedicated server would work, the issues are

  • Uids are only available after OnAuditSuccess_s
  • Only one instance can have a UID, since all of your instances are linked to the same instance, so the other one won't have a UID assigned iirc
buoyant peak
carmine vapor
#

I'm trying to find a tutorial on how to edit entity attributes through a script mod, can't seem to find a tutorial. Want to be able to keep a character in an unconscious state through the attributes menu when in the properties tab on a character entity

#

I assume a script mod can add a toggle button in the attributes menu

red cedar
#

@buoyant peak actually i believe UIDS are simply not available on DS tools, if you want to create fake uids you can use that instead :

static string GetPlayerUID(int playerId) 
    {
        if(!Replication.IsServer())
        {
            return string.Empty;
        }
        
        string uid = SCR_PlayerIdentityUtils.GetPlayerIdentityId(playerId);
        if(!uid)
        {
            return string.Format("bbbbdddd-0000-0000-0000-%1", playerId.ToString(12));
        }
        return uid;
    }

This way it generate a fake uids when you can't retrieve it from the backend

torn bane
red cedar
buoyant peak
red cedar
#

because personally i've never had an issue fetching a UID

buoyant peak
#

On dedicated server I can't recover the uid but in the Workbench I've my real player UID (Not a fake one)

midnight talon
#

The debug executables have some kind of polyfill to make UIDs work in local testing

torn bane
buoyant peak
torn bane
#

both need to be backend connected, there is no magic on the debug one

ocean kernel
#

Do we have script functionality to force a character entity to use an animation, anm file? With no changes needed to animation component. Literal "play this anm on this entity"

midnight talon
#

Oh right that was debug client needed for use as peertool to get the fake UUID, idk about DS tool

red cedar
#

I noticed today that if two different mods declare a variable with the same name, it doesn’t trigger any compilation error. Instead, one mod can end up interacting with the other mod’s instance of that variable.

Is this intentional behavior?

The issue I ran into was that Sen’s Discord Player List mod declared a RestContext named m_RestContext, and my mod used the exact same variable name. A server happened to be running both mods simultaneously, and what ended up happening was that my mod was sending requests using his RestContext instead of mine and occasionally maybe flooding his logs (oops).

Once I identified the root cause, the fix was straightforward. However, it still feels like the compiler should either:

  • Properly encapsulate each mod’s variables so they can’t interfere with each other,

  • or throw a compilation error when duplicate global variable names are declared across mods.

pseudo merlin
#

Why doesn't this give an error?
string buildingSearchPurpose "BuildingGarrison";
It's missing the =.
Maybe good to know for the compiler or whatever does the error stuff.

#

There is 1 or 2 other script things i've noticed, which doesn't give an error, when they should.

clever oxide
#

strange Print output
SCRIPT : string buildingSearchPurpose = ''

timid citrus
red cedar
#

Good to know, guess i'd know if i played the game

timid citrus
#

Hehe

minor agate
#

If so. Don't do that

#

global methods and global variables are not emant to be modding friendly

#

And should not be used by modders, it's there more for very specific usages for us

red cedar
minor agate
#

it's a modding mechanic for them being there since DayZ

#

Allows people to change the value of them on other mods

red cedar
#

what's the benefit of one variable replacing another if the mod isn't marked as a dependency ?

Is it to make "soft dependencies" possible or?

minor agate
#

only the exact path of the script files is hwat is used to define compilation order

#

exact path is the path like Scripts/Game/...

red cedar
#

I'm just still confused since i don't really see the benefits of having a mod being able to replace another mod's variable like that and in my case it ended up having unexpected behaviors.

minor agate
#

It's just old decision from a really long time ago that is problematic to change now with the resource database and project ordering

red cedar
#

fair enough, was pretty confusing to debug

pliant ingot
red cedar
#

I see

#

I guess I deserve it for assuming i was the only one to name my restcontext m_RestContext in a vanilla class (very clever i know)

storm shore
#

What could cause the following to occur (simplified the code)

  • Server can find an NPC using his name
  • Client can't find the NPC using his name
  • This is all being run in a component attached to the PlayerController (where I attach most my components)
  • NPC is properly replicated, this block of code only begins when the client interacts with the NPC
{
    string npcName = "testGuy";
    IEntity npc = GetGame().GetWorld().FindEntityByName(npcName);
    if(npc) Print("Server found testGuy");
    
    Rpc(RpcDo_ClientFindTestGuy, npcName);
}

[RplRpc(RplChannel.Reliable, RplRcver.Owner)]
protected void RpcDo_ClientFindTestGuy(string npcName)
{
    IEntity npc = GetGame().GetWorld().FindEntityByName(npcName);
    if(!npc) return Print("Can't find NPC");
}```
open pier
#

I have a slight feeling that that call FindEntityByName, is meant for server side usage only

#

Are you able to pass the IEntity through the rpc call or does the compiler yell at you about codecs?

solid hearth
#

Just have the server send the RplId of the entity to the clients and the clients resolve the entity through its RplId

storm shore
solid hearth
#

Does it have an RplComponent?

storm shore
#

Has a prefab but has been placed on the map and renamed to use findByName, which works when the client searches for him to place a marker on him.

solid hearth
#

Hmm can't remember if map placed entities are replicated or well registered in replication right away, technically speaking all clients should know about them. I haven't personally messed with a setup like that too much so I have no more ideas.. Only other idea is if you're using this entity for other things on the client you could have some logic setup and when the entity is created register it to that logic which will serve as a tracker for it. But I don't think that's really needed someone who does have experience with that might chime in salutt

storm shore
solid hearth
#

Very strange indeed hmm

river imp
#

Setting the name isn't replicated

storm shore
restive island
#

What if I just need the base name where a service component was built, not all the bases it's registered to?

misty cipher
#

Need help with working a component script i need to show up in 'add component'.
How do you work the component class to get it to show up as a component?
In this script i want to play a sound when the player spawns in.
https://imgur.com/a/lw74o09

storm shore
misty cipher
#

it is in scripts/Game/GameMode/Components

I am unsure on how you work the ComponentClass structure to be able to use the SCR_SpawnLogic parent to work the OnPlayerSpawned_S() method

#

iv tried it in scripts/Game as well

misty cipher
#

I have read it.
i just need to inherit from SCR_SpawnLogic
But everytime i try the 'add Component' in world editor it cannot find the script

#

the structure of the Component class structure at the top is something i just cant get my head arouind

storm shore
restive island
#

shift+F7 for shortcut

storm shore
#

A question about creating NPCs to use as shops in my game mode.

Parent is GenericEntity, he has a BaseLoadoutManagerComponent that I use to put clothes on him.

This worked fine, however because the RplComponent had 'Rpl State Override' set to runtime, clients could not find the NPC by name, so I changed that to 'None'

Now when a client sees the NPC, the clothes are sitting in a pile at their feet and they're in their underwear.

So I've fixed the issue of not finding the entity by name, but now they're all naked.
Any ideas?

river imp
river imp
restive island
#

This is returning a function address like in the comments below, how can I get it to cough up what's being returned?

modded class SCR_ServicePointComponent : SCR_MilitaryBaseLogicComponent
{
    override ScriptInvoker<SCR_ServicePointComponent, SCR_MilitaryBaseComponent> GetOnBaseRegistered()
    {
        if (!m_OnBaseRegistered)
        m_OnBaseRegistered = new ScriptInvoker<SCR_ServicePointComponent, SCR_MilitaryBaseComponent>();

        Print(m_OnBaseRegistered);
        // Returns: ScriptInvokerBase<func> m_OnBaseRegistered = ScriptInvokerBase<func><0x000002A71C20E0F0>
        
        Print(m_OnBaseRegistered.Type());
        // Returns:  ScriptInvokerBase<func>
        
        return m_OnBaseRegistered;
    }
}
river imp
#

What?

dense delta
#

hi guys, can some help me with a thing? Im trying to add a script into GameMode_Campaign.et using the onverride method but I dont know how to do it

river imp
restive island
#

oh lawd another thing to read up on nootlikethis

river imp
#

If you want something to happen when the base is registered, then you'd get that script invoker and insert a function into it that would be called when the invoker has Invoke() called on it

#

Pretty sure script invokers are covered on the wiki.

restive island
#

thanks, ill check into it

river imp
river imp
#

yes

#

They're calling Insert and Remove on TAG_EventHolder

#

and instead it should be .GetOnScoreChanged().Insert/Remove

karmic pivot
#

Hello! Is there someone that could help me with a loading screen mod I am creating? Specifically I am trying to create a Random Loading Screen mod, where the loading screen changes at every loading you go through. I've tried to implement a lot of different systems, but none have worked... I am not even sure if something like this would be supported by the engine.

queen silo
river imp
restive island
#

Whats a quick simple way to get what base a service station is built at, because im getting nowhere in SCR_ServicePointComponent. I could pull its XY coordinates to do +/100m, but that just sounds painful

#

actually that'd be kinda funny, then I can make a mod where a heli has to refuel everything

river imp
#

You need to look into some of the systems that handle the creation of such things. Hint: Search GetOnBaseRegistered in the script editor.

#

That script invoker is getting invoked somewhere.