#enfusion_scripting
1 messages · Page 18 of 1
Been an issue for a good while for me, though it’s gotten less consistent. I just chocked it up to Workbench being Workbench for some CPUs
my friend have the same issue while streaming on discord but only while streaming
Hello. I created a UI and want to attach it to this screen. Does anyone know where I should attach my script to? Thanks
Would look for the inventory HUD scripts/UI layouts and investigate how they work
What are you looking to add?
InventoryMenu20.layout iirc
Thanks. just a UI from a mod I'm working on. Figured it's better to have it there than in the actual game screen. there's a good empty space below the "vecinity" section so it would fit nicely there. I was hoping I wouldn't have to actually use the same layout as the InventoryMenu20.layout to add my stuff but not sure if there's another way!
Is it possible to use generic types or is it an internal only thing? I found this, but not sure how to return just a generic type
#enfusion_scripting message
class TestClass<Class T>
{
T TestMethod(array<T> items)
{
return items[0]
}
}
You can, and this should work I think, except for the missing semicolon and probably a missing ref in the array type since T is a class
Check e. g. SCR_Stack for an example of generics
You can mod it, add your component, and set its Z order, should not be too intrusive ideally unless it starts intercepting gameplay inputs
You can mod the menu and override OnMenuOpened(I think that may be the function) and just create your widget and add it to the workspace
Alright thank you both. I'll try it!
Hello, todays experimental version contains the next iteration of the persistence system which has finalized script APIs. So anyone looking to implement save/load logic into their custom gamemodes can start playing around with it. Therre are some more bugs and crashes in the system so I would avoid Everon as map and recommend Arland or the included persistence feature test map. I have some minimal info prepared where to start looking for the feature, just waiting for it to be published on the biki.
https://community.bistudio.com/wiki/Arma_Reforger:Startup_Parameters#worldSystemsConfig
https://community.bistudio.com/wiki/Arma_Reforger:Server_Config#persistence
https://community.bistudio.com/wiki/Arma_Reforger:Persistence_System
The stable release of 1.6 will have JSON as data format enabled which we later switch to binary once we had mode time to test. But for workbench development JSON is better to debug anyway. The first 1.6 release will NOT include any HTTP functionality, as I could not finish it in time. It will come with a later update to 1.6 though. But the local disk mode is sufficient for any plain save/load operation where you do not need to edit the data while turned off. There is no 1mb limit anymore as we no longer use JsonApiStruct at all in the system.
If a player is shot by a vehicle, the instigatorvehicle will be that vehicle.
Any suggestions how i would get the Player or AI entity of the one who actually fired the vehicles weapon?
I can get the vehicle pilot through Vehicle.GetPilot, but what about gunner or commander?
I assume REST for external save systems will still work?
rest api is untouched in 1.6
That holds implications that it might be touched in the future o-o
yes we plan to
I have question about HTTP: is it possible add tag or some marker for mods that use HTTP requests in code to avoid unexpected results without checking mods code every time?
Not as a removal I suppose, more of a feature update / change
I do not have any idea what you mean
its more about security, not scripting. But we cant control http requests from mods as game servers administrator. Is it possible to somehow identify workshop mods that use HTTP requests in their code?
Like markers or tags in workshop?
No
It will take some time to appear on the biki so in the mean time here you go: https://gist.github.com/Arkensor/8076951b4df3be40ca479fe9c18e3f39
Run Wireshark or some other network analysis tool if you want to check if/what requests mods are making
Also you can prevent mods making requests as a server administrator, block connections to those IPs in firewall
We have released a script repository on GitHub for the Arma Reforger modding community to track script differences between release versions. This will allow modders to easily take a look at what has changed between release versions while working on updates for their mods.
The current GitHub release is for Arma Reforger Experimental releases. A repository for Arma Reforger Stable will follow the release of Arma Reforger's 1.6 update.
https://github.com/BohemiaInteractive/Arma-Reforger-Script-Diff-Experimental
Contribute to BohemiaInteractive/Arma-Reforger-Script-Diff-Experimental development by creating an account on GitHub.
Can you tell roughly what scope you aim to cover with the initial prod release of the new persistence system? It sounds like it already covers more than EPF did, will Conflict stuff like supplies be covered?
That's already all covered.
Sweet, also you mentioned it can't really handle a map the size of Everon, would you say Kolguyev is usable with it yet?
For anyone that wants to test persistence for GM in workbench, open GM_Arland.ent and make sure to select the correct system config:
What determines the order of tools in the world editor toolbar? I'd like to group my tools together.
will we be able to save progress in console offline too?
Yes or even better persistence test map which loads much quicker. its located in featuretests folder
Yes it does, for local save game data for sure, maaaaybe (and i mean maybe), also http connections from console to somewhere. We will have to see about platform restrictions. The data is fixed format so it can not be mis-used for arbitrary requests
What's the name of the ent file? I don't see any featuretests folder...
ohhhh maybe those are excluded from public builds ... did not know that. makes sense though. too much data that is not needed. ok so then GM arland is the fastest yes
my world was basically MPTest with some examples of each thing that can save and load to run quick tests in
Yes if you have shell access to the filesystem it is quite easy, can also test locally if you dont have this level of access on the serverside
You can grep relevant keywords and it will find them in mod pak files 🙂
It is also a good way to find the mod that is crashing your server due to compilation failure but the modder intentionally chose a tag in their mod to make it harder to locate
Is there any obvious reason that EOnInit (or any other function) isn't being called here?
[ComponentEditorProps(category: "GameScripted/Misc", description: "")]
class MCAT_InputTestComponentClass : ScriptComponentClass
{
}
class MCAT_InputTestComponent : ScriptComponent
{
[Attribute("Jump", UIWidgets.EditBox, "The name of the input action to listen for.")]
private string m_sActionName;
//------------------------------------------------------------------------------------------------
override void EOnFrame(IEntity owner, float timeSlice)
{
Print("EOnFrame", LogLevel.NORMAL);
}
//------------------------------------------------------------------------------------------------
override void EOnInit(IEntity owner)
{
Print("test init");
SetupInput();
}
void SetupInput()
{
if (!GetGame().InPlayMode())
return;
InputManager inputManager = GetGame().GetInputManager();
if (inputManager)
{
inputManager.AddActionListener(m_sActionName, EActionTrigger.DOWN, OnActionTriggered);
}
}
protected static void OnActionTriggered()
{
Print("Testing");
return;
}
//------------------------------------------------------------------------------------------------
override void OnPostInit(IEntity owner)
{
// remove if unused
// SetEventMask(owner, EntityEvent.INIT | EntityEvent.FRAME);
}
//------------------------------------------------------------------------------------------------
override void OnDelete(IEntity owner)
{
// remove if unused
}
/*
override void EOnActivate(IEntity owner)
{
super.EOnActivate(owner);
SetEventMask(owner, EntityEvent.FRAME);
}
override void EOnDeactivate(IEntity owner)
{
super.EOnDeactivate(owner);
ClearEventMask(owner, EntityEvent.FRAME);
}
*/
}
I'm really stumped on why none of my events are being called at all
eoninit will not be called if during postinit (mb constructor too) someone will not set event mask for init entity event
same for frame* events (but you can set/unset it at any time, not only in init)
Im trying it out for conflict on Kolguyev, but it does not seem to be working. Maybe Im missing how to enable it or something. I cant tell where the save file is actually saved either. Maybe I need to activate it via script or something?
also tried the new CLI param for world systems, but thats not very clear how to use that either.
I went to the config file in the setup section of the new doc page, but everything seems already enabled. How am I supposed to tell if its working or not?
You're using the GameMasterSystems.conf mentioned by Arkensor and Kex?
I'm guessing for it to run in Conflict we'll need to add the persistence system to an override of ConflictSystems.conf?
Im going to try that next. I was trying to get it to work on my scenario which is conflict based. ConflictSystems.conf already has Conflict.conf linked in the persistence section.
Out of curiosity, are scripts simply interpreted or is there some sort of JIT?
I figured it out lol, persistence system is running fine using either GM or conflict systems configs, you just gotta manually save/load the session via GM menu, there's no autosave on shutdown / autoload last save on startup yet it seems or I've just missed a config setting for it
I was expecting EPF-style autosave/load
I guess should be able to script that in to gamemode start/end events or something
Editor chugs a bit when loading a session on Kolguyev (I can see why Everon for now was disadvised 😆 ) but otherwise seems to work great, awesome job Arkensor and team 👍
Idk how much your scenario relies on script/prefab/config overrides but I got so many compile errors on my 1.4 source in 1.6 I think I'm just gonna start fresh and cherry-pick systems over one at a time
even deleting all my scripts still gave compile errors, they didn't go away until I deleted prefabs and configs too 😄
Yeah Ive been working on it all through 1.5 and 1.6. From what I remember, the new task system was the biggest thing that took me the longest to figure out. Theres still some wonky stuff too though. Like in workbench if I start getting errors I shouldnt like that, many times a restart of workbench magically lets scripts compile when they wouldnt right before restarting.
glad you figured that out though, I had suspected that might be the case!
Yeah fortunately my only overrides for task system previously was disabling it so I got to just delete all those overrides 😄
nice! I know the feeling of starting over though! I've had to do that 3-4 times since the game launched! Sometimes its a good thing so you can better organize and clean up a bit!
Yeah I was wanting to do an almost full rewrite anyway so it's perfect timing for me haha
What does it mean when my input context is yellow? I activated the context from script, but its not working
This is what I did to activate the context based on what's in SCR_IntroSplashScreen2Component.c
void ActivateContext()
{
if (!m_bShouldActivateContext)
{
return;
}
// Print("Context Tick", LogLevel.DEBUG);
GetGame().GetInputManager().ActivateContext(m_sContextName);
GetGame().GetInputManager().ActivateAction(m_sActionName);
GetGame().GetCallqueue().CallLater(ActivateContext, 0)
}
Huh, I fixed it by increasing the context priority from 0 to 15, anything 10 or below doesn't seem to work for some reason
Actually, it might be a bit smarter to just make my action part of GlobalContext for what I'm doing
Depending on your action you should either A) add it to a context that already exists(that's relevant to your action) or B) create your own context and call ActivateContext in an OnFrame event.
So I think Im stuck on GetSaves: cs SaveGameManager SGMan = GetGame().GetSaveGameManager(); array<SaveGame> sGames = {}; SGMan.GetSaves(sGames, "3BE30F418DCEE458"); is giving me an error on that 3rd line: ```
RESOURCES (E): Wrong GUID/name for resource @"{0000000000000000}3BE30F418DCEE458" in property "<missing-def>"
why tf does a fresh custom faction duplicated from US and name changed in UIInfo show up as Sowjets?
did you call RetrieveSaveGameInfo first?
void HandleStartup()
{
const SaveGameManager manager = GetGame().GetSaveGameManager();
manager.SetSavingAllowed(true);
manager.SetEnabledSaveTypes(ESaveGameType.AUTO);
manager.RetrieveSaveGameInfo(null, new SaveGameOperationCb(OnLoad));
}
void OnLoad(bool success)
{
const SaveGameManager manager = GetGame().GetSaveGameManager();
array<SaveGame> saves = {};
int count = manager.GetSaves(saves);
if (manager && count)
manager.Load(saves[0]);
}
void HandleShutdown()
{
const SaveGameManager manager = GetGame().GetSaveGameManager();
manager.RequestSavePoint(ESaveGameType.AUTO, flags: ESaveGameRequestFlags.BLOCKING);
}
Works but I can't find an event/method to call HandleShutdown that doesn't also get triggered by calling Load (load ends game -> starts new game from save) so it keeps getting stuck in a loop
literally just duplicated US faction, changed their key + UI info and it also happens
factions in 1.6 are fucked
Ok I figured it out, faction names in 1.6 seem to be hardcoded based on faction key, completely ignoring the UI Info you put in for them if the key isn't one of the vanilla ones. Only factions with the vanilla faction keys get names now apparently.
Previously you could give a custom whatever faction key you want and everything would work ok, someone has broken something here
With faction key = US (or presumably other vanilla keys) the custom UI info name shows up as expected, with any other faction key the name becomes Sowijet
yes I did call that first in game mode constructor but thats too early I think, so trying a delay when saving is already set to true. Maybe you are looking for ```cs
ESaveGameRequestFlags.SHUTDOWN
I used shutdown initially and changed to trying autosave in case the save w/ shutdown flag was triggering another shutdown causing the loop
but the loop happened because HandleShutdown triggers whenever I call manager.Load
Trigger it in event invokers bound in game mode start
modded class SCR_GameModeCampaign : SCR_BaseGameMode
{
override protected void Start()
{
m_OnStarted.Insert(PostStartSetup);
m_OnGameEnd.Insert(PreShutDown);
super.Start();
}
void PostStartSetup()
{
MO_GameModeStateSystem.GetInstance().HandleStartup();
}
void PreShutDown()
{
MO_GameModeStateSystem.GetInstance().HandleShutdown();
}
}
This is how I was triggering it
saving and loading both works, its just that loading causes game mode to end -> causes it to save and load again in infinite loop
if there was something like m_OnGameExit that didn't get triggered by calling manager.Load then it would be ez
I suspect someone has added some of that goofy if (factionKey == hardCodedValue) kinda logic seen above into Faction.GetFactionName, so GetFactionName is only returning a name if the faction's key is one of the vanilla ones
Wish more stuff was scriptable so we could fix it when they break it
Ill have to give your method a go tomorrow. I tried to do ```cs
manager.SetSavingAllowed(true);
Links to biki now added
vanilla gamemodes are already setup, but the mission header is still not enabled by default in experimental, due to some left over issues that would otherwise crash. but modders can just play via workbench or enable it manually in the mean time.
It does, but not killing the game anymore. it was too unreliable for server exe before the OS said "enough, you shut down now".
Saving is done via exit to main menu, explicit save buttons, auto save interval or scripted events
Shutdown has its own save type, better to use that than auto.
All this grabbing of save, loading etc is handled in the game code already, for you there is nothing to do. start your mission with persistence system enabled and either continue from main menu which will load it or for non UI or development purposes use https://community.bistudio.com/wiki/Arma_Reforger:Startup_Parameters#loadSessionSave
GetFactionName returns the info from the UI info name property if set or emtpy string
Persistence megathread
^^^^ Persistence discussion goes here please
Because I can not pin a thread - thank you discord - I am pinning this message.
Then why did it not return info from the UI info name property when it was set as in my example?
See how I put "Players" in the info but the game gives me Sowijet
There seems to be a bug in 1.6 where the UI info only gets read when FactionKey is one of the vanilla factions, if I change the key to US the custom UI info name shows as expected
I do not know much about this faction setup, its more a question for #enfusion_configuration as it has nothing to do with scripting. but either way if you think there is a bug please make a feedback ticket with the minimal steps to reproduce this
I was mostly hoping someone would pipe up and just tell me I'm an idiot and doing something obivous wrong, but I just set up a minimal repro mod that triggers it, will open a ticket now
Does Enfusion offer a predefined event that directly intercepts experience gains?
thanks Ark!
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
{
vector mat[4];
IEntity.GetTransform(mat);
Print( mat );
}
scripts/Game/Components/UserActions/SCR_BangaloreDuplicateAction.c(11): error: Trying to call non-static function 'GetTransform' as static
Welp
pOwnerEntity.GetTransform(mat);
Can i see where these are defined like pOwner and pUserentity
Where *
Thank you for your help
They are defined at the start of your example in the method signature:
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
Generally if you want to see where the values that get passed into something might come from, you can search for usages (ctrl+shift+F and search for PerformAction()
If you want to see the definition of IEntity (or any class/method/prop) you can ctrl+click on it and the editor will take you to the definition
Actually, to check out where a symbol is defined, you can do CTRL+LMB on it to jump to its definition.
In this particular case pOwnerEntity is the entity the action is attached to / being activated, and pUserEntity is the entity performing the action (player or AI character)
Yeah ctrl+lmb on something to go directly to it's definiton, and just do project wide search to find usage examples if you want an idea of where the data getting passed in comes from
i don't understand 🫠
gotta do a null check on owner first
If you don't see notnull on the type, always assume there is a situation where it could be null
pOwnerEntity.GetYawPitchRoll(orient);
scripts/Game/Components/UserActions/SCR_BangaloreDuplicateAction.c(13): error: Too many parameters for 'GetYawPitchRoll' method
I see that the out is array of size 3
but i am not sure what i am doing wrong
Is this a function i can only use on players?
It's not the parameter, it's the return value, so
vector orient = pOwnerEntity.GetYawPitchRoll();
It's kinda deranged how enforce script expresses vector types using array access syntax tbh
Why would I be getting ```
Bad type 'SCR_GameCoresManager'
Because of a different compile error elsewhere that stops vanilla from compiling
well how am I supposed to figure that out when the only compile error is this?
Its not a bad type, but it cant get past that point!
ok so apparently I had done a duplicate to override the entire file. Then I commented out everything in the file. Only once I actually deleted the file with everything commented out would it compile correctly.
So I guess it was still reading the file with commented code in it, essentially wiping the vanilla file.
Yes, same path leads to file patching 🙈
which EntityEvent should i use??? for physics update
OnEFrame only works but coming for GD background it very unefficient Phsyics Has its owns Independent framwe logic loop
i tired EOnSimulate And also SetEvenet mask for it it doese do a simpel print
The issue was the context priority was too low, but in the end I ended up moving my action into GlobalContext
Yes, and applying your action to a relevant context will fix the issue. I.E. Inventory actions should be added to the inventory context etc.
Is there a way to get an npc to aim and trigger a primary fire of a weapon as if there was a button press method?
does anyone know what the function is for the camera system?
What do you mean?
Do you want to create a custom camera?
i was trying to create a first person camera for game masters to spectate with
RE making the WB remember selected systems config, it would nice if we also had an option here to just use whatever system config is specified in the mission header
Can BI please stop doing these hardcoded faction key checks? Pretty sure these should be referencing the SCR_GameModeCampaign.m_sBLUFORFactionKey etc configurable Conflict belligerent faction keys, not hardcoded faction key constants. It's this kind of stuff that leads to bugs like https://feedback.bistudio.com/T195459
ah nvm I jumped the gun on that one, GetFactionByEnum actually does check the campaign keys internally
still tho there are tons of hardcoded faction key checks around
You can kind of do that by adding a game master camera plugin
it's a pretty nifty system, i need to do a write up on it
Because the way the GM camera works:
On simulation, it processes a stack of changes.
For example the player can move it around, that's one layer of "changes"
Then there is terrain level stuff, so closer to terrain the slower it should move, that is another layer which affects previous ones.
Then there is the hover functionality, which biases the camera to have rotational assist, or snapping to a target.
All of these get stacked and whenever a change happens - the script marks the old data as dirty, and camera translates to new position,
As a result of all the layers acting on it. Very smart approach to the problem. All done in script, not game code.
You would need a game master context action:
extend SCR_BaseContextAction
Which would be added to overridden EditorModeEdit.et under the SCR_ContextActionsEditorComponent.
Then you extend SCR_BaseManualCameraComponent, and add it to overridden ManualCameraEdit.et under the entities components.
You would get your component with something like this:
// Get the GM camera
SCR_ManualCamera gmCamera = SCR_CameraEditorComponent.GetCameraInstance();
s_OverrideComponent = AG0_PlayerCameraOverrideComponent.Cast(gmCamera.FindCameraComponent(AG0_PlayerCameraOverrideComponent));
The priority set on the component determines at what time in the stack does it run (first or last), you want to be last so that snapping, terrain, etc. does not interfere. (though iirc low number means low priority, so you want it to be really low number?)
You'll have to look through the source classes or find the examples in #1430441381649715220 which allow you to set the camera on a broadcasting device. Biggest issue I think is hiding the head/head clipping for first person, also first person and third person are slightly misaligned in engine. Found this out taking the player camera's transform, and copying it to a PIP camera, had some mean frame imperfect lag, due to PIP camera (arbitrary camera index) not matching script "idea" of where a transform actually is at that point in time.
Wonder if the systems conf used in the project settings works now?
Ah yep it does, completely forgot about that one thanks
I asked about it forever ago(could never get it to work) and never got a response. But seeing your post I assumed they probably implemented functionality for it.
So I made a generic entity with an EOnInit override and put it into the world, but EOnInit is never called, what am I missing here? Do I have to set an event mask or put the script in a specific directory?
class MO_Spawn_AreaClass : GenericEntityClass
{
}
class MO_Spawn_Area : GenericEntity
{
[Attribute("RANDOM", UIWidgets.Auto, desc: "Area name to match against infil action name", category: "MercOut!")]
string spawnAreaName;
override void EOnInit(IEntity owner)
{
PrintFormat("MO_Spawn_Area.EOnInit(): Registering Spawn Area '%1'", spawnAreaName);
MO_GameModeStateSystem.spawnAreas.Insert(spawnAreaName, this);
}
}
Constructor -> seteventmask -> INIT
Ah yep that was it thanks, for some reason I thought it was all by default and you just had to do that to set it to something else
Play mode in world editor loads no mission header, so as such it is not taken from there.
This was very helpful. Thank you!
Any quick way to make weather work outside of the world bounds? Or just make the world bounds yuge?
Are there any plans to allow modding shaders or is that unlikely to ever be a thing?
No
I'm assuming that's due to having to deal with console specific SDKs for shaders?
It probably wouldn't be practical from a cost standpoint, but depending on how shaders are compiled for Enfusion, could you handle compiling shaders for consoles during some sort of backend processing step after mod upload?
Proprietary technology which we can not share even if we wanted to (which we do not). Without it you can not develop these shader.
Gotcha. (You don't have to answer this, I'm just curious) Is that refering to the shader compiler or the shaders themselves? (I'm not trying to argue with you, I completely understand, I'm just wondering)
And TBH it's probably for the best as well, given some of the rendering tech I've seen in Enfusion, allowing user made shaders could make things a bit more difficult. It's also probably best for everyone to use the same material workflow anyways to prevent fragmentation when it comes to addon development
@torn bane is there any way to spawn helis wothout rockets loaded, i.e. with empty pods without extra scripts? Just changing values in workbench?
I have an array in an ScriptedUserAction , how do i access this array from another scripteduseraction?
How do i add a new chat command, does anyone have a example for it?
I have one in the custom callsigns mod
It’s super easy, just copy the usage of BanCommands.c, or my implementation
You can set permission level, etc. so much easier than Minecraft plugins lol
Thanks, i´ll check it out
You would either need to find a way to get a reference to that user action instance or possibly make the array static so it can be read w/o an instance.
If they are both on the same action manager component you could probably use FindComponent on the owner entity to look up the other action. But otherwise I would probably recommend moving this array to somewhere more easily accessible. I usually just whack custom client side logic into an override on SCR_PlayerController (which is very easy to get a reference to) unless it becomes complex enough to warrant its own class
Hey so i wanted to see if someone could help me try to get supplies and added ai to our server just dont know how and I was wondering if someone would be able to provide some assistance to me with it or atleast walk me through it
for ARMA REFORGER
There are cases where a game has multiple faction managers. Using GetGame().GetFactionManager() returns the first one found. What is the way to find all faction managers in use/available?
No, there shall only be one faction manger. multiple is invalid
Yeah, I can see that and it's reported as an error.
Heh, I maybe worded my response badly. 🙂 I noticed a situation where a gamemode has defined the faction manager. Now, as a next step someone adds a mod with a new faction. This new faction is not automatically included in the existing faction manager. Adding a second faction manager, kinda fixes the issue, but is not the right way (as mentioned above). I don't have a way to ask for all existing factions includind the added one.
I don't have a way to ask for all existing factions includind the added one.
That. 👆 The faction system lacks a central registry (analogous to entity catalogs for vics/items/etc.), but a major issue for me is the fact that factions have to be statically defined on FactionManager in the first place.
Exactly. They should be dynamically added to the list when a new modded faction is included.
GM view works properly. When a faction is not listed in faction manager, then the AIs are not available for spawning.
You can have factions in files that arent defined in faction manager, but those won't work well either way so feel free to ignore them
Faction manager should be enough realistically
Thats the registry
It's not. The prefab hierarchy in vanilla is:
- FactionManager_Base - this has no factions
- CampaignFactionManager (Conflict?)
- FactionManager_Editor (GM game mode?)
- FactionManager_USxUSSR (Combat Ops?)
- FactionManager_FFA (?)
Following this pattern new game modes should inherit FactionManager_Base. Where do you add your modded faction, so that all of them could use it?
FactionManager entity should have an attribute to statically define list of faction keys to use (for WB users) that'd use an underlying API to dynamically load them from a central registry, defined by a standalone .conf. That way one could still use the current pattern, but it would also work for universal game modes that decide factions at runtime.
Also another side effect of having anything possible declared in FactionManager upfront is that these factions appear in the GM interface. If the game mode logic is built around specific faction roles, it is undesired for the GM to have the ability to spawn completely unrelated faction elements (and players assume "if it shows up in UI, I can use it").
Hello, quick question if anyone can help please?
i have been trying to get menuspawnlogic to work with EPF_BasicRespawnComponent so that faction selection is available on joining the server for say civilian and police. i understand this only works with SCR without making custom scripts. Just wondering if anyone has already achieved this or can guide me in the right direction please...
I got it working with a custom respawn system component and a ton of overrides to Conflict+EPF stuff, it was very painful to get working properly because EPF's base respawn system component overrides-out a ton of calls needed for the spawn menu so you gotta figure out what to call for your game mode w/o calling too much to cause players to spawn before EPF properly inits them.
I would strongly suggest starting in 1.6 Experimental with the new persistence system as it already supports vanilla menu spawn logic and EPF is going to be deprecated in favour of it
in 1.6 has epf been integrated to vanilla?
not exactly, there is a new vanilla persistence system that replaces 1.4 savegame system + EPF
it has better performance than EPF and supports all vanilla stuff out of the box, there is a megathread here: https://discord.com/channels/105462288051380224/1430828753717559430
Legend thank you 
So, I have this character placed in World Editor and I've added a component from the BIKI tutorial to it: https://community.bistudio.com/wiki/Arma_Reforger:Create_a_Component
I've added some debug prints in the code, and based on them the component is active and running. However, nothing is happening despite of that when I run back and forth in the play mode in World Editor. ```csharp
// Editor attributes
// ...
protected Shape DrawLine(notnull IEntity from, notnull IEntity to, vector offset)
{
Print("Entering DrawLine method");
vector points[2] = { from.GetOrigin() + offset, to.GetOrigin() + offset };
float distance = vector.Distance(points[0], points[1]);
if (m_bLineFadeInOut)
{
int alpha255 = 255 * (1 - ((distance - m_fTriggerRadius) / (m_fWarningRadius - m_fTriggerRadius)));
m_iTempLineColour = m_iTempLineColour & 0x00FFFFFF | (alpha255 << 24);
return Shape.CreateLines(m_iTempLineColour, ShapeFlags.TRANSP, points, 2);
}
else
{
return Shape.CreateLines(m_iTempLineColour, 0, points, 2);
}
}
//------------------------------------------------------------------------------------------------
override void EOnFrame(IEntity owner, float timeSlice)
{
super.EOnFrame(owner, timeSlice);
vector ownerPos = owner.GetOrigin();
m_fCheckDelay -= timeSlice;
if (m_fCheckDelay <= 0)
{
m_fCheckDelay = m_fCheckPeriod;
m_aNearbyCharacters.Clear();
owner.GetWorld().QueryEntitiesBySphere(ownerPos, m_fWarningRadius, QueryEntitiesCallbackMethod, null, EQueryEntitiesFlags.DYNAMIC | EQueryEntitiesFlags.WITH_OBJECT);
}
m_aShapes.Clear();
m_aShapes.Reserve(m_aNearbyCharacters.Count());
foreach (IEntity character : m_aNearbyCharacters)
{
Print("In foreach loop");
vector characterPos = character.GetOrigin();
if (vector.Distance(characterPos, ownerPos) > m_fTriggerRadius) // in the warning zone
{
Print("Drawing a line");
m_aShapes.Insert(DrawLine(owner, character, m_vOffset)); // draw line
}
else // in the trigger zone
{
Print("Teleporting!");
vector dir = vector.Direction(ownerPos, characterPos).Normalized();
character.SetOrigin(ownerPos + dir * m_fTeleportDistance); // teleport
}
}
}
//------------------------------------------------------------------------------------------------
// QueryEntitiesCallback type
protected bool QueryEntitiesCallbackMethod(IEntity e)
{
Print("Checking entity...");
if (!e || !ChimeraCharacter.Cast(e)) // only humans
return false;
Print("Entity of correct type found!");
m_aNearbyCharacters.Insert(e);
return true;
}
//------------------------------------------------------------------------------------------------
protected override void OnPostInit(IEntity owner)
{
m_aShapes = {};
m_aNearbyCharacters = {};
m_iTempLineColour = m_LineColour.PackToInt();
Print("OnPostInit");
SetEventMask(owner, EntityEvent.FRAME);
}
}
The console log prints mostly these debug lines regardless of the distance from the character with the component attached: WORLD : UpdateEntities WORLD : Frame SCRIPT : In foreach loop SCRIPT : Teleporting! WORLD : UpdateEntities WORLD : Frame SCRIPT : In foreach loop SCRIPT : Teleporting! WORLD : UpdateEntities WORLD : Frame SCRIPT : In foreach loop SCRIPT : Teleporting! Also the "Checking entity..." and "Entity of correct type found!" debug prints appear occasionally (based on a pattern that I haven't figured out yet), but the code never enters the DrawLine method.
What might be wrong here?
The code flow seems to change when I shoot the character. After that the console logs keeps spamming this instead; ```
WORLD : UpdateEntities
WORLD : Frame
SCRIPT : Checking entity...
WORLD : UpdateEntities
WORLD : Frame
SCRIPT : Checking entity...
Found the first error with debugger... The querying method includes the character itself in the results 😄
Hmm... The script only recognizes the character with the component itself but not e.g. my character when I test it in the World Editor. What could cause this?
(I edited the code to skip the origin character): ```csharp
// ...
m_aShapes.Clear();
m_aShapes.Reserve(m_aNearbyCharacters.Count());
foreach (IEntity character : m_aNearbyCharacters)
if (character == owner)
{
continue;
}
// ...
Sometimes WB bugs out scripts when dealing with components
Restart workbench and try again
Roger, trying it now
Aaand there we go, for some reason the character that I spawn in when pressing the play button is GameEntity instead of ChimeraCharacter 😄
Is there a shortcut to play as a unit placed in World Editor?
Dropdown by play button "play from camera position"
Oh nm
Yeah that's what I've used so far but it causes problems as the player character has weird type(s), like being GameEntity or GenericEntity instead of SCR_ChimeraCharacter. Thanks in any case! 👍
I'll send you my dev spawn function you can prob adapt it.
Nope its still just a chimera character, what you are hitting is a piece of equipment as the print says. a glove to be precise. perhaps worn by the player char you are looking for
If you return false from a query it will stop and not find other entities that would come laterr. its not a yes no filter.
Hmm... Why doesn't the the teleport/line draw part kick in until I switch the type check to e.g. the GameEntity?
//------------------------------------------------------------------------------------------------
// QueryEntitiesCallback type
protected bool QueryEntitiesCallbackMethod(IEntity e)
{
if (ChimeraCharacter.Cast(e))
m_aNearbyCharacters.Insert(e);
return true;
}
this checks for characters and also implicitly that they are not null. though a query never returns a null entity to the callback by design
Testing it now, thanks
Damn, it works like a charm 👍 Maybe it could be added to the related wiki article?
Sorry for my dumb question, but RestApi in Infusion works fine? I can't get data from http 🙁 Every time i get data length 0
POST is ok, but GET not working for me
Yes, it's work fine.
Hmm... Can you show me you simplest query to get some data from http?
I'm doint something like this:
auto ctx = GetGame().GetRestApi().GetContext("http://127.0.0.1/");
auto content = ctx.GET_now("unixtime/");
PrintFormat("[HTTPQ] %1", content);
I can't understand why always returns a data size of 0 and an empty response. Whatever I output on the page, it's always 0. No errors, everything is fine, but... Zero.
First, don't use *now variants
I've tryied it only today. All other variants was like ctx.Get("");
What? What's code?
class Bridge_HttpCallback : RestCallback
{
override void OnSuccess(string data, int dataSize)
{
PrintFormat("[Bridge_HTTP] OnSuccess - datasize %1", dataSize);
Print(data);
}
override void OnError(int errorCode)
{
PrintFormat("[Bridge_HTTP] OnError — %1 (%2)", errorCode, typename.EnumToString(ERestResult, errorCode));
}
override void OnTimeout()
{
Print("[Bridge_HTTP] OnTimeout");
}
}
class Bridge_HttpTester
{
protected RestContext m_pContext;
protected string m_sBaseUrl;
protected string m_sHeaders;
void Init(string host = "127.0.0.1", int port = 80)
{
m_sBaseUrl = string.Format("http://%1:%2/", host, port);
m_pContext = GetGame().GetRestApi().GetContext(m_sBaseUrl);
m_sHeaders = "Content-Type,application/json,User-Agent,Bridge_HTTP-Test";
PrintFormat("Base URL: %1", m_sBaseUrl);
PrintFormat("Host: %1", host);
PrintFormat("Port: %1", port);
PrintFormat("Headers (will be set): %1", m_sHeaders);
m_pContext.SetHeaders(m_sHeaders);
}
// GET
void Get(string path = "unixtime/")
{
if (!m_pContext)
{
Print("[Bridge_HTTP] err pContext!");
return;
}
string fullUrl = m_sBaseUrl + path;
PrintFormat("[Bridge_HTTP] try GET %1", fullUrl);
PrintFormat("[Bridge_HTTP] headers: %1", m_sHeaders);
m_pContext.GET(new Bridge_HttpCallback(), path);
}
}
// autostart
modded class SCR_BaseGameMode
{
override void OnGameStart()
{
super.OnGameStart();
Print("[Bridge_HTTP] diag - ok");
auto http = new Bridge_HttpTester();
http.Init("127.0.0.1", 80);
http.Get("unixtime/");
}
}
WHOA/// Sorry, is it too much?
Your callback should be alive until request is fully completed, in your code - it will be deleted right after OnGameStart
Second, simple example:
class MyRestApi {
protected static ref MyRestApi myRestApi;
protected ref RestCallback myRestCallback;
static MyRestApi GetInstance() {
if (!myRestApi) {
myRestApi = new MyRestApi();
myRestApi.myRestCallback = new MyRestCallback();
};
return myRestApi;
};
RestCallback GetCallback() {
return myRestCallback;
};
};
class MyRestCallback : RestCallback {
override event void OnSuccess(string data, int dataSize) {
PrintFormat("%1.OnSuccess(%2, %3))", this, data, dataSize);
};
override event void OnError(int errorCode) {
PrintFormat("%1.OnError(%2))", this, errorCode);
};
override event void OnTimeout() {
PrintFormat("%1.OnTimeout())", this);
};
};
In remote console:
auto api = MyRestApi.GetInstance();
auto callback = api.GetCallback();
auto context = GetGame().GetRestApi().GetContext("http://localhost:5000");
context.SetHeaders("Content-Type,application/json");
context.GET(callback, "/path/to/endpoint");
context.POST(callback, "/path/to/endpoint", "{\"string\": \"Hello World\"}");
context.PUT(callback, "/path/to/endpoint", "{\"string\": \"Hello World\"}");
context.DELETE(callback, "/path/to/endpoint", "{\"string\": \"Hello World\"}");
Thank you so much! I spent 5 days on this. Even ChatGPT couldn't help me. Thank you again so much!
SetHeaders taking an associative array string encoded by joining with comma. How do you then encode a comma into a field value?
You don't
Chatgpt knows nothing about our game, you can ignore anything it says or any other LLM
@torn bane i understand, but Enfusion for me - dark forest for now 🙂 Oh! One more moment - i've sent you PM in X, ignore it 🙂 Since 2002, I've dreamed of working for Bohemia on Arma, but... Unfortunately, I'm too weak as an IT specialist for your company 🙂
I wont be home for a few hours but I when I do ill send how I make calls to my web server if you don't figure it out by then
There are many other positions that do not require you to script or program, although it is always qelcomed for you to know as it can help.
3D artist, animator, producer, game designer, QA, etc
It said that Enfusion Script supports exception handling so that must be true
And that the only "catch" is that there is no "finally" block
I choose to believe ChatGPT over Arkensor
Not for me, i can't relocate from Russia...
Claude does reasonably well, but a base understanding is required like with any usage of AI to check it, verify, and ensure it is actually doing the right things.
school math - matrices 🙂
It's even more fun when you're used to Z as vertical and keep wondering why Y axis is putting things in the sky 😄
believe it or not. Linear algebra, and for high order tensor algebra makes your life way easier when dealing with stuff
One day I'll understand it
Beyond3D 3.0
I have updated one of my scripts because they have modified things in OnDamageStateChanged in the experimental version, but when I update it, I get all these errors about vanilla things, which I don't call at any point...
scripts/Game/Components/Custom_CharacterDamageManagerComponent.c(10): error: Overloading event 'OnDamageStateChanged' is not allowed
I'll leave this here in case anyone else has the same problem. The issue was related to EEditableEntityLabel, which, as it is currently designed, needs to be redone with every major update in order to re-add all the missing code.
So... any particular reason the campaign building system refuses to consume supplies unless SCR_GameModeCampaign is the current mode... this change seems... dumb.. and I hate it.. very much..
Yes because the campaign building system is for campaign mode ... it does not work without it as the data for it is on campaign gamemode and its components
worked fine before
i mean yoyu can have a loook at the scripts and submit feedback and or mod a change if needed
You wouldnt want a building system outside of conflict in the game anyway, right?
not necessarily
I'm wondering if there is a way to pass unrealized damage from HZ to its parent HZs. By unrealized damage I mean the damage when HZ already has no health left. Are my attempts futile?
More simply: RHand has 0 health, you shoot it and I want the damage still pass to main health HZ
I don't think this is true, the configuration for building is done via SCR_CampaignBuildingManagerComponent, which the GM game mode prefab also has.
Technically speaking the building system is apart of the editor with just has interactions with the resource system, basically a limited version of GM.. and the resource system afaik is meant to be a flexible and usable system by all.. This change is a 1.6 specific thing, supplies are even put down as a disabled resource type on the editor gamemode now and I just don't get why this was done.
I have a custom game mode and prefab, if I switch the entity class type to campaign gamemode it works fine. I've gone up and down SCR_GameModeCampaign and there's nothing particularly fancy or needed. It's just some type of hard-coded lock as if it's there's some disgusting cast type dependency somewhere that really isn't needed, this all worked perfectly fine since 1.1 up to 1.4 so I just don't get the change. After sleeping it's fine, it's w/e, I'll just make my class inherit off campaign and disguise myself. Lesson of the day is don't be lazy just do everything from scratch, don't use any vanilla systems if at all possible cause it just leads to ruin later on 
supplies are even put down as a disabled resource type on the editor gamemode now
No, this isn't just a 1.6 thing, it has been for a long time. Disabling the resource type just means that services are unlimited and need no supplies, which imo is a sensible default for GM. Besides GM can reenable global supply usage via the scenario properties.
Did you try enabling overkill on the HZs? Otherwise you could probably override HijackDamageHandling, which is exactly meant for redirecting damage.
Is there a way to get the playerId of a player from a GUID besides manually looping through and checking every connected player Id
Probably not, but I wouldn't really worry about it, especially when the look-up is only done once per player. Otherwise, you could always just implement a cache.
I wouldn't be too surprised, it seems a few conflict things got hard coded in 1.6 like faction names on welcome screen only work if faction key is one of the 3 vanilla conflict factions
Yeah It's all interconnected pretty deep.
I was kinda hoping a lot of it would become more independent having seen refactor notes that some conflict stuff should be pulled out into their own systems, but in 1.6 some things seem to have taken a step backwards becoming even more tightly coupled with the game mode
But let's be fair, it overall used to be way worse in the older code base. For instance, the ambient patrol system used to be deeply embedded in the conflict game mode class before it got refactored into a system.
Yeah overall I think 1.6 is much improved in that same fashion. I'm guessing some of this was just to get things working in experimental while refactoring is still in progress, hopefully just some loose ends that get tied up before release 🤞
Yes please! Loose ends like persistence crashing servers! 
do you mean BI identity GUID or persistence UUID for a player? If the latter then I think something like PersistenceSystem.GetInstance().GetId(playerController) to get UUID from controller and PersistenceSystem.GetInstance().FindById(playerUuid) to get controller (from which you can call .GetPlayerId to get current session player ID) from UUID should work
BI Identity
Its looking like I'm just gonna prep an array when I need to check cause I need it all at once anyway
Damn it! I was sure overkill is already enabled but it was only enabled for resilience, not for health 
Yeah it works
Hi, could I get some help with Replication? I have an Entity that I want to use as a manager for an array I have. So the server spawns the Entity in, it's a prefab that I have given a RplComponent to. The Entity has a public function like .RequestAddRecords(...) that I want my own menu to be able to use. But I don't know how to get a reference of the Entity from within my menu's class. I'm thinking of using the RplId of the Entity when the server spawns it in, but I don't know if I can synchronize it so client's get it whenever they first open their menus
I wouldn't do it like that, maybe there is a reason to, but have such data stored on a server/client side system and have your menu talk to the client side system, and have the serverside push data to the clientside if needed
or server side system with modded player controller methods to allow granular control of data being sent from the system to specific players
The client will simply not be able to resolve the entity, by design, without some hoops to jump through if you must go this route (like disabling streaming, I'd search for that in this channel for info)
Simply register your entity in your menu after init
Since it's streamed to the client
It will be on the client
Or just use a game system
Yes you can do that also if you want to spend more time for questionable benefit
Just worried if the intent is using the entity as a global manager lol
Like the weather manager, or faction manager...
Can we still not rpc from client to server in a game system?
Idk, haven't tried
Each player owns their own client game system I suppose. If it's "Both" or "Client".
So the server runs 50 game system instances for 50 players? Otherwise how rpc from client

Sounds like an entity with extra steps
I always used entities, I just recall game systems being "the better way".
If anyone is dumb enough to run the building system outside of being SCR_GameModeCampaign like myself and want resource consumption (supplies) I found the demon change... SCR_CampaignBuildingManagerComponent::OnEntityCoreBudgetUpdated specifically 
const SCR_GameModeCampaign campaign = SCR_GameModeCampaign.GetInstance();
if(!campaign)
return;
All replicated world systems are owned by server. This means that replicated world systems can broadcast information to all clients, but they cannot communicate with specific client (neither sending, nor receiving). We'll talk about communication between specific client and server in section World controllers.
While owner of replicated world system is always server, owner of world controller is always one of the players. This allows owner player to communicate with server through the world controller and it also allows server to send information only to particular player via their controller.
Yeah, entity with extra steps
Even if we exposed it, under the hood it would also just loop through and check. Storing them in an array is not really needed, you can loop through them on demand unless you need to do it like every frame.
I see, well I had to add those lines to fix an issue. Did not know that the system would work without it, given how it was located in campaign scripts and is campaign named I assumed it would not. We'll find a better check
It indeed functions perfectly fine outside of campaign, nothing in resource consumption is really campaign specific, I realized after finding it and comparing it against old code it was done because of the new persistence system cause it used to be something like:
SCR_GameModeCampaign campaign = SCR_GameModeCampaign.GetInstance();
if (campaign && campaign.IsSessionLoadInProgress())
return;

There are two things, one is avoiding re-consumtion of supplies when loading a save and the compositions are loaded in, the second is a replication error that got fixes in the mean time. The check for save game load is done entirely independently of gamemode, but the error fix still relies on it. It may not actually work without campaign mode, you just did not observe the error logs. set your level to debug and #restart your server and you might observe the "unregistered network item" error prints which we fixed. the code is specifically asking for campaign mode down the road from that method
ahh I'm not gonna lie idk what systems and controllers are. I'm going to re-read the docs now that I have attempted something. If it clarifies things, my project is a menu which looks like the players-list-menu when you are in a match. But you can add bots which recursively place NPCs. Then the Entity-thing is a Manager where the bots are just values stored in an array in the Manager. Hopefully that makes sence. I've copied the examples from the docs and made them work, but I guess I need to go back and understand what they do
To be fair I'm pretty sure supplies are even referred to as "CAMPAIGN" for the budget 😅 but yeah defs something that should be part of base sandbox and not tied to Conflict IMO
Entity is the system with extra steps if you use it like that
No u
Entity have other things undergoing on the engine, like simulation, some resolution of resource usage, more complex replication hierarchies, more data to process, longer data/memory usage, more fragmented processing/computation, etc etc
Systems are, more simple and systematic internally.
also you can rpc and use rpl props on systems
And you can start using and checking out World Controllers and World Systems + Event System in 1.6 currently.
Although you might find issues, port is recent
World Controllers makes you avoid using Player Controller with components for stuff
Is there any documentation about World Controllers yet?
There has always been
On doxygen
Roger, will check it out
Also beware that we are moving away from BIKI. So in future you will see a lot of updates to doxygen which is what we will use for official docs
Yeah there was some discussion about it recently
So are the introductory scripting tutorials on BIKI becoming obsolete as well?
They will be ported in different manner to Doxygen
Documentation != Tutorials also
So the only way to access doxygen is by opening the zip folders inside Arma Reforger Tools\Workbench\docs ?
No, we have hosted one too
Ok rip can't check because cloudflare also just blocked me now that I am in mexico
.
So I can't open BIKI
It should be in the main scripting page for Enforce Script
At the top it should have a link to it
Most successfull CF user at our company
Alright I will check! I'm in Mexico too so let's see if I can access
Where can I control creating a new group upon a new (no persisted data for them) player joining a faction? I used to apply my custom logic for this in overrides to EPF methods for handling new player setup but with the new persistence system I'm not sure.
I'm using SCR_MenuSpawnLogic with a forced faction, that faction has no predefined groups and one gets auto-created but I can't seem to find any references to create or join group methods anywhere that relates to a new player joining
SCR_BinLoadContext is broken in exp. Loading back the same class saved previously with SCR_BinSaveContext returns most fields as NULL, interestingly it happens only ingame, and works as expected from WB.
(on a side note, the binary format also changed since 1.4, which is a pretty significant change, yet I think I haven't seen it in any changelog or communication)
https://enfusionengine.com/api/redirect?to=enfusion://ScriptEditor/Scripts/Game/Respawn/Logic/SCR_SpawnLogic.c;517 is called for spawning a new player, which just runs the same logic it used to in prior versions.
Minimal repro as feedback ticket please. There were some known bugs in experimental that I fixed, just wanting to make sure I caught this as well
There is not much to say about it. We do not document the internal layout of the format as it shall not be parsed externally. We will make more changes to it over time. What's true is that on 1.6 any older files can no longer be read
We will make more changes to it over time.
What's the point of having a file format that randomly receives backward compatibility breaking changes? I understand it's not documented, I don't need to parse it externally, but I expect it to work within Enfusion realm.
I think it should be signaled it's not meant for use by modders then.
For example, if I used binarized format with EPF, all campaigns in progress of my playerbase would be dood now. 😉
oh no lol
Binary is the fastest and most compact container, the speed comes with the compromise of not always being backwards compatible. This is the first breaking change it received since it released and it will probably not break again until future game titles.
Its absolutely meant for modders, we only use it for save game data otherwise in vanilla. If you need a well defined, always compatible format, you need to use json
Save game data is generally not always compatible between game and or mod versions. No way around that even with JSON container.
i can see that and agree totaly
Campaign saves for my mod are backwards compatible since first version (back on AR 1.1), that's one of my core design principles. I go extra lengths to ensure that, as people typically spend many weeks on a single playthrough.
Either way, please send me an example to validate your issue. I can do so tomorrow. If the bug is still present then it will be fixed in the next 1.6 update after stable release
Thanks, I'll do that next week, as I'm busy right now working around that for tomorrow.
Deadline for any fixes I can do is this week (incl weekend). If it is not fixed by then you have to wait very long for it to arrive. this applies to anything in the game
If I had the privilege to pick one wish, I'd say the invalid pointers from FindEntityByID are more important to me. 🙂 But I heard it did not reproduce in internal build as opposed to exp.
hay your really cool man @ Arkensor
Thats engine and fix is off the table to be done this week. Will come later.
@torn bane any plan in the 1.6 update(s) to fix the "create/update prefab" problem that makes a bad Editable Prefab? Looks like a null pointer scripting issue https://feedback.bistudio.com/T195486
I do not see any progress on it yet, besides being assigned for evaluation, so probably not.
Will persistence no longer crash the server on stable release?

I'm still a bit worried that these changes won't get tested on experimental first.
Yeah it kiiinda feels just a tiny bit rushed in my opinion. Don't get me wrong is great to finally have 1.6 on stable but there are some stuff in exp that are currently not working for me for example the audio is behaving very weird on xbox
Yeah I thought that was the plan, give us time to get our scenarios ready, but... 🤷♂️ I guess we're just getting thrown into the fire! Cross your fingers!
There are two wolves in me. One wishes the stable release will be a completely different and polished version to have the base game in a good condition, the other wishes it will be close to the exp build, as otherwise all of my testing and effort on experimental doesn't make any sense.
Well, not completely thanks to the efforts of documenting the new task system and persistence.
Very true, Id probably have a week's worth of work to do if it were not for the experimental branch. I just really wanted to test the persistence out before stable. Oh well! Ive got PTSD from removing a feature before its replacement was ready, so this persistence stuff was pretty triggering lol
Is there anyway to pull an items supply total, like how much supply is needed to pull this item from an arsenal, without spawning the item and without having to loop through every single faction config
I don't have the faction of this item in this instance
That doesn't make sense, as available items and their costs are faction-dependent definitions.
We have our own system for distributing gear to players with our own gear script system, so we don't have to make a million prefabs for different factions.
I've made a supply menu like the old KP Supply Menu that reads from our gear configs and want it to work with the default supply system
So its not ran off of the arsenal and numerous items can come from seperate factions
Point being it goes against how vanilla works, so I don't think you will get around compiling the costs by iterating over all faction item configs.
Rip makes sense
Yeah I can see the vanilla menu spawn logic is requesting faction and notifying client they are ready to spawn, but I can't see where it's autocreating a group for them down either code path, guessing it must be getting triggered by some script invoker bound from somewhere else
breakpoint here and you will see how the flow goes https://enfusionengine.com/api/redirect?to=enfusion://ScriptEditor/Scripts/Game/Groups/SCR_GroupsManagerComponent.c;1095
I ended up just not worrying about controlling the autocreated group and just created my custom group and "moved" the player to it which deletes the autocreated one instantly 🙂
What improvements to json and function callbacks are there in 1.6?
I think two biggest things I've complained about aside from exception handling
can script invokers not be used from inside a system or am i tweaking?
just aint doing anything 
They can. They have not been touched in AR.
seems like my mission is stuck with debug defines like ENF_WB on a regular server, not sure
are you going to update the EDP+EPF for 1.6 ? @torn bane
Anyone else getting this, when pressing play in previously created GM scenario in 1.6 World Editor?
@torn bane it's looking like the scenario transition jip error got much worse with 1.6, do you know anything about this?
i was just updating my scenario loading mod, and it seems to happen every time in MP now, during 1.3 it was less than 20%
All of my custom classes are getting a Broken expression error.
Am I missing something with how classes are structured now?
I get this err.. .warning too. Yes to All and I can continue.
Anyone else getting this error when doing a shift+f7?
Yes the update introduced new errors on top of previous errors
ie. still crashes when recompiling scripts with behavior editor open, but now also likes to throw the above error on top
Been getting that all month on 1.6, usually I usually just click retry and it seems to flush completely. Clicking abort makes it go away for the rest of the session but if you're having to go in an out of a world/scenario idk what effect it has 
yeah i got those resource leak errors pretty regularly when recompiling in 1.6 exp
I am but it will take me some time, I have to do significant changes to make EPF play ball with with the respawn system
If you have a 100% repro please report it to us. We are still looking for the root cause(s) of the issue.
seems to be as simple as attempting a transition with a client connected
check the main workbench console, the error can be in a previous file and it simply hits on the first line of a new unrelated file
Yep, that was it. It seemed to be erroring in another file.
So how do I spawn shell projectiles now huh since they cant have rplcomponent
Which mods to load etc etc. Or is it vanilla for you?
I was testing with my Scenario Reload Menu mod loaded, but I will verify it happens without anything else
how long do you think it will take is there any ETA ?
I have a new version running, at least in SP, no time for peertool testing setup currently. you guys can try it out. will publish in the next few minutes
ok nice thx
The 🐐
Just discovering this and wow this is sucks.
Reason: Invalid prefab type '{13772C903CB5E4F7}.et' on 'EPF_ItemSaveData:69038733-0000-0001-0001-47a08f0021b6' could not be spawned. Ignored.
Class: 'EPF_PersistenceManager'
Function: 'SpawnWorldEntity'
Stack trace:
Scripts/Game/EPF_PersistenceManager.c:158 Function SpawnWorldEntity
...
is there way to fix this ?
In our own custom gamemode we now just have this random loading screen causing the entire gamemode to break as it never advances past this
What was added to cause this?
are you using epf ?
No
Loading placeholder on respawn system, if you made your own you have to properly deal with it or disable it on the attributes
could you see this ?
@torn bane
Disabled the respawn in the attributes and it is still there
And if I outright disable the new respawn system it barks errors in a bunch of places
disable respawn system in gamemode
it will cause a couple of exceptions but at least u will your menus
I did and now I get a bunch of errors from other systems
ignore
This seems quite silly
it is
it's ok if you are not actually using this system, just override problematic methods
2 problems here
- this happens when u set big values for transmitting range in
BaseRadioComponent(probably >= 70000) - typo in names
Disabling all respawn systems in the gamemode and player controller mp worked for me
No errors
Only thing that I now notice is that means selecting respawn in the escape menu is completely tied to the system
🙂
Are there even any maps that contain a distance of 70,000 meters?
set the placeholder layout file to empty
That wont mess with anything just disabling the loading screen?
it's impossible, every update is breaking something
this is the base everon life framework, I cannot even touch it since it' s a workshop dependency
it's not, but:

there are still some exceptions, because base game mode doesn't check if respawn system != nullptr
do we know any problems with the workshop?
delete it from your drive
I have send an update forr it, it should compile and i could spawn. what else is broken in it I do not know. Try to migrate away from using it
I normally override OnPlayerSpawned in my gameMode component, that no longer works today. What's the best alternative solution now?
I use this to show my own respawn menu logic
I use OnPlayerSpawnFinalize_S but not sure if it will work for your use case
Is there a better way to get all supplies in an area without having to do a sphere query and manually get all local supplies myself
\
Is there any reason as to why now in 1.6 the prefabs in groups don't spawn in based off of their order anymore?
This worked fine since 1.2.1
What mod is this Lobby system btw?
It's the Coalition Reforger Framework
Removed linebreaks from chat?? Whhhyyyyy 
was abused in not so nice ways among a few other tricks
Yea I figured. I hoped there would be a more elegant way to patch that so that we could still use it for legitimate means
Any suggestions for scripts then, or is it just breaking things out into multiple messages?
into multiple messages would be the safest solution looking at how much I had to dumb down the chat
What's the proper way to consume resource from supply tents
any way to replace the old spawn component in the new EPF?
Does the spawn delay have any effect?
None
Damn. They bork it then.
who was messing with the doors this update 
SCRIPT (E): @"Scripts/Game/SimpleChatRoles.c,182": Undefined function 'SCR_RespawnSystemComponent.GetPlayerFaction'
SCRIPT (E): Can't compile "Game" script module!
Scripts/Game/SimpleChatRoles.c(182): Undefined function 'SCR_RespawnSystemComponent.GetPlayerFaction'
PROFILING : Script validation took: 1159.015500 ms
if (!entity.FindComponent(SCR_ResourceComponent))
return true;
SCR_ResourceComponent resComponent = SCR_ResourceComponent.Cast(entity.FindComponent(SCR_ResourceComponent));
float storedResources = 0;
SCR_ResourceConsumer resConsumer = SCR_ResourceSystemHelper.GetStorageConsumer(resComponent);
if (!resConsumer)
return true;
storedResources = resConsumer.GetAggregatedResourceValue();
Currently grabbing the overall supplies in entities and for some reason this is not updating
for (int i = 0; i < supplyItems.Count(); i++)
{
IEntity supplyDepot = RplComponent.Cast(Replication.FindItem(supplyItems[i])).GetEntity();
Print(supplyDepot);
SCR_ResourceComponent resComponent = SCR_ResourceComponent.Cast(supplyDepot.FindComponent(SCR_ResourceComponent));
SCR_ResourceSystemHelper.GetStorageConsumer(resComponent).RequestConsumtion(((float)supplyCounts.Get(i)));
}
This is how I consume the supplies on the auth, and it updates in game
Just for some reason not with GetAggregatedResourceValue
Seems to actually do nothing looking at the code
It's updating on the auth but not on the clients for some reason
Ended up saying fuck it and just create a replicated variable that tracks all the supply counts instead of trying to make this system work
Seems that you are grabbing a singular depot storage, and not what the base detects.
So it wont update what you wanted to check because supplies were not taken from that depot but other containers
Do supplies only work in bases like that?
Cause these would be free floating around the map
The consumer in bases, detects its own depot and other thing in certain radius + connected services
So updating the consumer on a lone depot doesn't update it necessarily?
Things should update when used. But depends on what you were targetting
Can you give me whole context?
For bases
You want to get consumer with id default
Not id stored
Stored is for singular depots (composition of containers as in a prefab)
Default is used for services
A base is technically a service
There is some explicit logic around to look up and consume from the "master provider" which bases rely on
All you have to do
This is my current work around but the callback was how I was getting the consumer in client
Is get base entity, find res component
Find res consumer with id default
Request consumption
Done
for (int i = 0; i < supplyItems.Count(); i++)
{
IEntity supplyDepot = RplComponent.Cast(Replication.FindItem(supplyItems[i])).GetEntity();
SCR_ResourceComponent resComponent = SCR_ResourceComponent.Cast(supplyDepot.FindComponent(SCR_ResourceComponent));
SCR_ResourceSystemHelper.GetStorageConsumer(resComponent).RequestConsumtion(((float)supplyCounts.Get(i)));
}
This is my current way of requesting consumption which results in it not updating on the client
However the depot still updates
loving 1.6, however as it usually happens, new update broke some stuff
I'm getting
"Unknown type 'SCR_SoundManagerEntity"
and
"Can't find variable 'soundManagerEntity"
on my Wirecuters mod - what whould one have to do to make it work again?
just worth double checking is the supplyDepot entity the actual main one with the xMilitaryBaseComponent on it? I found some Conflict base prefabs had slightly different setup in 1.6 and I had to do stuff like checking parent of entity in some places
With the new persistence, will there be more documentation on how to setup server config? It seems like most links touch on certain aspects of it but don't tie it together at all. Trying to understand this a bit more but seem to have not made it far
More specifically heres the example for the config:
"persistence": {
"autoSaveInterval": 15,
"hiveId": 1337,
"databases": {
"webapi": {
"preset": "{0123456789ABCDEF}Configs/Systems/Persistence/Database/JsonWebApi.conf",
"options": {
"url": "https://persistence-db.armareforger.local:5539/api/v1?query=parameter&and=more",
"headers": {
"X-API-KEY": "4rm4R3f0rg3r",
"Content-Type": "application/json"
}
}
}
},
"storages": {
"session": {
"database": "webapi"
}
}
}
Theres no mentions of what JsonWebApi.conf might contain or how to use it
Also the stuff with it being a webapi in general, will there be something about how to setup and use that system? Also what if using in file in general?
If I can link this to the backend I already have setup using REST, that'd be dope. I just can't seem to wrap my head around how to start configuring stuff. Also persistence just saves the bundle right now, is there anyway to make those save individual collections? If I understand the bundle correctly, this will be quite the large single file for the player's we have to migrate Just read why this is setup this way
Do not use GetStorageConsumer for bases or services
It's wrong
It gets consumers for Storage composition or vehicles
nothing related to a base's supplies, not even a regular service's
So you are only getting the depot spawned with the base, and using from that
do
resourceComponent.GetConsumer(EResourceGeneratorID.DEFAULT, EResourceType.SUPPLIES);
instead
I could've sworn I did that and it resulted in all the supply depots around me having 0 supply
Its not using bases like traditional conflict, its legit just supply prefabs placed on the map
If you want those detected
you must use default
because STORED ones, only detect the depots spawned within the same prefab
nothing else
Okay will try again tomorrow
If you are doing custom UI, and you want the value in the UI to update constantly when an interaction to the supplies happens even outside of the player then you need to get a handle to the consumer
read this, it will explain that and how
You do not need to do the Component definition thing, you can just use the already done one for Supplies in PlayerController
Also, do you know why prefabs in groups now no longer spawn in their order anymore
Possibly related to the "group role preset" system, might be wrong but I think player roles available for a group are defined in that now and that group members prefab array in your screenshot is just for spawning AI characters
this stuff
I've encountered several crashes when spawning a group of people and then deleting them. Has anyone else encountered this?
This happens without mods too.
Might be a dumb question, I haven't been paying much attention though...
Is there somewhere we can see all the code changes in the recent update? I'm coming across a number of issues and kind of flying blind
That config does not exist yet, webapi will come later. Was just an example for what the config can do
Did you really repro this without mods? I was only able to repro this with my zombie mod but not vanilla groups... can you share repro?
Yes, I initially noticed this with your mod. But then I tried it without mods, and the game crashed.
But my tools crashes pretty much all the time. Could it be a coincidence?
There are no crash files, the game froze completely without an error, and started consuming all my RAM.
okay thank you, do you happen to have migration examples for EPF -> base game persistence?
Yeah I noticed the RAM blows up, but for me it crashes with crash GUID. Of course it follows the pattern of useless logs.
I will provide them on EPF github as soon as I can spend time on it. Right now fixing bugs, and crashes. The usual
Bet thank you
Thank You, your framework is really dope
You mean the new one?
it appears that when i create a callback instance for a request :
void ConnectUser(notnull SDS_ConnectUserJson connectInfo, int playerId)
{
if(!m_isBackendReady) {return;}
ref SDS_ConnectUserCallBack callback = new SDS_ConnectUserCallBack();
callback.SetPlayerId(playerId);
connectInfo.Pack();
m_context.POST(callback,ENDPOINT_CONNECT_USER, connectInfo.AsString());
}
The (callback) instance is destroyed before i can get a response from the rest api :
-----[KE-SDS] SDS_ConnectUserCallBack instance is destroyed
Is there any other way to keep it alive other than to store it in a map and destroy it after i receive my response ?
I havent really tested the new one, in the other project ,where i use your spawn system etc there are few mods broken, so i do wait for now. Yesterday i spent much time reworking this rpc problem with rhs, so i only ran your persistence for the vehicles on the other server
No you need to keep it. if you destroy callback, we cancel request internally
Ok, that's good to know !
And i also have this small question, is the RegAll method new ? It is really convenient so thanks a lot for adding it :)
Switch to json save/load context, do not use json api struct, it is rather limited to small fixed field requests
can we serialize and deserialize objects with it ?
Last time i used it i had to manually specify each fields and it was rather painful
It always could
anyway yes
it can't when you're stupid enough to not know how 🤷♂️ (meeee)
but thank you i'll look into it
Currently getting this when launching my server; does anyone have any ideas of where to start to figure out which mod in my list is the culprit?
Scripts/Game/GME/Editor/Containers/Backend/SCR_EditorAttributeStruct.c(4): Unknown type 'SCR_EditorAttributeStruct'
Ignore, can see someone else has asked about this in #reforger_troubleshooting
We removed it. what mod relies upon it depends on full error message in your logs
GME is most likely Game Master Enhanced
Aha, that would make sense
Cheers lads
Is there a way to search the script diff on github without half of the page flickering?
Otherwise what happened to rt widgets? They are no longer projected on my mesh
There was an attribute removed from them and if its present it breaks the layout idk if that's your problem
Also I've seen where if it was a previous UI prefab that's no longer available it will cause the UI to not be visible
Manually deleting Prefab: {GUID} from the meta files fixed it for me
Thank you doubly on this, i made a server config to run with my peer tool and it caused my peer tool to not work properly. It'd let me load it up but never got passed the loading screen, removed it and boom works again.
Guess the main point to that was to change the autosave interval, couldnt find out how to do it in the workbench or anywhere besides that, waiting 10 minutes to test persistence saves is a bit long
Hello guys i made bulldozer, so i want to add to it an key to build a dirtpile in front of its blades, im not expert on scripts and stuff like that, any one here can guide me?
You can't manipulate terrain in runtime, but you could have a prefab mesh dirt pile spawn
Thats what i mean
But how can i do it? _)
Not at my pc rn but the class or method is something like SpawnEntityPrefab
Alright bro, i apprecait ur help, can u show me if u have time, thanks for respone.❤️
Is there anyway to lower the time it takes persistence to save outside of the server config? I can "use" the config and get the time down, but then my peer tool breaks so can't actually test anything.
event void OnWeaponActive();
How do i use this event callback?
Mods need to be updated, EPF is alraedy, but your local copy apparently not
EPF and EDF work as they did before the update?
Check the biki, it's in the server config under the persistence section
That's exactly what I did and am using but it makes my peertool not load my world. Although it doesn't crash so it does work by giving me 1 minute saves which i can see in the logs. But that doesn't help me when trying to actually test stuff.
If I run peertool without the server.json, it loads right and I get 10 minutes persistent save intervals, with the server json it doesn't work.
Anyone else have issues with render targets and switching layouts on them
Hey so I'm gonna be running some experiments with making an accurate HMD for helicopters, has anyone had any experience trying to make something like that
WCS has one for the Apache, I helped Aussie with parts of one for the Blackhawk, have some plans to build my own, what's up? There is a couple ways to go about it.
Well I want to make a script that would allow for the base game Huey and also the RoR falcon to have a fully functional HMD similar to the IHADSS, how difficult was it to do?
And id rather avoid using AI where possible so I can actually learn the ins and outs of it
Note I'm not a member of RoR this is just a personal project
Couple ways to go about it, could put a script component on the vehicle, which activates the HMD for a passed user, the script would load a given layout and update it if active. The layout could have images and text on it which the script dynamically updates based on the vehicle signals.
Other method is putting stuff under the vehicle's HUD component (probably a better solution), but need to mod the vehicle HUD parent layout to make your "hmd" slot. At the end of the day the easy but not super optimized solution is just running a script which spawns the hud for the pilot and updates it. But the HUD component will handle the init/destruction for you.
Okay so modifying the HUD component is the better way to do it, just more complicated?
Probably yeah, you'd create a derivative class, etc. I mean it's not the worst thing in the world, depends on knowledge of scripting and how everything is nested
Okay makes sense
Also 1.6 broke my layouts (that's why they are bugged but half of the problem)

On PC, the layout fails to render which results in a white render target (this is fine), on Xbox it looks like the GPU died (within the render target)
A H
Also my layout is complaining because I have strings which say #1 ENG FAIL etc. and it's trying to localize it, guess I should do localization but I have such a backlog of things to work on I can't do it right now, how to suppress this caution?
@minor agate Did something change with the new update with RplSave writing
writer.WriteInt(m_iCompanyCallsign);
writer.WriteInt(m_iPlatoonCallsign);
writer.WriteInt(m_iSquadCallsign);
writer.WriteInt(m_iCharacterCallsign);
writer.WriteInt(m_iRoleCallsign);
writer.WriteBool(m_bAloneInGroup);
writer.WriteInt(m_iFactioniD);
This is base game code using the helpers which I thought we should not use
Everyone gets that apparently, you can safely ignore it
How do you make use of an event in a another component?
I'd like to use
override void OnFired(IEntity effectEntity, BaseMuzzleComponent muzzle, IEntity projectileEntity)
in SCR_MuzzleEffectComponent
Same
Also 1.6 brings a lot more stutters to tools and sometimes it even totally freezes my system, so I have to hard reboot pc
if the event calls/class exposes an event invoker you can bind your own listener to it with .Insert(MyListenerMethod), otherwise override the method to call yours with the args then return a call to the same method on super. or vanilla. so it calls your logic then continues with the default logic
That's a fact, I had Tools completely freeze twice now. Never happened on pre-1.6.
Is Math.Clamp broken?
A: Nope, it was a MeIssue.
Should be after a small fix I made right now https://github.com/Arkensor/EnfusionPersistenceFramework/releases/tag/0.6.15
what has changed with the chat system?
i can get everything to work but adding color now
PSA: SCR_MapCampaignUI is still in the generic MapFullscreen.conf even though it's conflict-specific.
never mind got it fully working
i did i think what do i miss?
@umbral spade do you have some kind of repro for the AI group crash with no mod?
no, I just get crashes like that. It was a coincidence.
Oki thank u
so is modifying {3B230AAC5252108F}Prefabs/MP/Modes/Conflict/GameMode_Campaign.et not a thing anymore? Since the update it's throwing errors that keeps saying after override the there are two in the world and it's not allowed. If so, this keeps us from overriding scenarios time/date/starting inventory/basic scenario defaults across all maps on a server.
whats the shortcut to add an attribute above your variable, i cant see it in the options and i keep pressing it
nvm found it in the plugins section at the bottom
The latter is only the issue. There are two gamemodes in the world probably. would help to know the error
Below is what error I receive when attempting to Override GameMode_Campaign.et to modify start time and add EPF in the attempt to load the scenario save and entities in the world when server restarts. This is strictly an override not duplications of GameMode_Campaign.et. Everytime the server restarts because of an error since 1.6 update the game mode restarts without loading game save. Terminal log shows that it is saving game state but apparently 1.6 won't load the save when restarted.
DEFAULT (E): Multiple game mode entities present!
DEFAULT (E): oldEntity: @"ENTITY:0" ('SCR_GameModeCampaign') at <0.000000 0.000000 0.000000>
DEFAULT (E): newEntity: @"ENTITY:3" ('GameMode_Campaign1', SCR_GameModeCampaign) at <0.000000 0.000000 0.000000>
ENTITY : Create entity @"ENTITY:3" ('GameMode_Campaign1', SCR_GameModeCampaign) at <0.000000 0.000000 0.000000> @"{3B230AAC5252108F}Prefabs/MP/Modes/Conflict/GameMode_Campaign.et"
SCRIPT (W): 'SCR_AdditionalGameModeSettingsComponent' exists twice in the world!
SCRIPT (W): [SCR_GroupTaskManagerComponent.SCR_GroupTaskManagerComponent] instance is missing
SCRIPT (W): 'SCR_PerceivedFactionManagerComponent' exists twice in the world!
SCRIPT (W): 'SCR_PlayerListedAdminManagerComponent' Multiple instances of the 'SCR_PlayerListedAdminManagerComponent' exist in the world!
Re-create your override from scratch, it creates duplicate component insances because the setup has changed
I noticed all of the GetPlayerIdentityId related functions are marked as obsolete in BackendApi and that BackendAuthenticatorApi is disabled on dedicated server. Is there a new method somewhere for getting unique id of individual player?
player identity utility that all vanilla scripts link to. has peertool polyfill support. its basically a better version of a modded wrapper I introduced on early access launch. We will later wire that scripted one up to new identity provider that is in the works - which should work out of the box with peertools (using -username to assign "unique" identities). So if you want some script that will work now and in the future, use the scripted wrapper, it will probably stay for the rest of the games lifetime. Do not call backend api or player manager directly
Sweet, thanks for quick reply. i'll check it out (SCR_PlayerIdentityUtils::GetPlayerIdentityId, for others in future)
can anyone help me fix this error with zel banking please, when creating a account and purchasing a bank card this pops up and then when ignored the bank card is there and working... But it throws this error everytime you get a bankcard from the teller.
Virtual Machine Exception
Reason: NULL pointer to instance. Variable 'ProfileName'
Class: 'ZEL_BankCardEntity'
Entity id:4611686018427388361
Function: 'SetMaterialData'
Stack trace:
scripts/Game/Entities/BankCard/ZEL_BankCardEntity.c:174 Function SetMaterialData
scripts/Game/Entities/BankCard/ZEL_BankCardEntity.c:135 Function Ask_Authority_UpdateData
scripts/Game/Entities/BankCard/ZEL_BankCardEntity.c:117 Function SetAccountInfo
scripts/Game/UserActions/Teller/ZEL_Teller_CreateAccount_UserAction.c:69 Function SpawnCard
scripts/Game/UserActions/Teller/ZEL_Teller_CreateAccount_UserAction.c:41 Function PerformAction
scripts/Game/Interactions/SCR_InteractionHandlerComponent.c:235 Function DoProcessInteraction
scripts/Game/Interactions/SCR_InteractionHandlerComponent.c:763 Function OnPostFrame
you are the man!
It's fixed. Next time there's an update give me time to fix whatever may have gotten broken.
is this kind of rpID sensible?
If you're asking if that's what an RplId should look like, then the answer is yes
thanks!
this is suppose be the ID of a chracter but when i do finditem it doesn't work
The player isn't an item, lol
You can validate RplId's with RplId::IsValid
Replication::FindItem works for anything. Has nothing to do with inventory items.
You should share your code. It's possible that the replication of the entity isn't initialized yet on the client.
Especially if you just spawned the entity with a script and immediately pass its RplId to a broadcast RPC.
Awesome thank you, i was unsure if it was something I was doing wrong at first. Cheers zel
protected void SetupGuidanceOnProjectile(IEntity projectile, ChimeraCharacter shooter)
{
SCR_MissileGuidanceBase g = SCR_MissileGuidanceBase.Cast(projectile.FindComponent(SCR_MissileGuidanceBase));
if (!g)
{
if (m_Debug)
Print("[GuidanceSelector] Projectile has no SCR_MissileGuidanceBase, skipping");
return;
}
// Set mode
g.SetMode(m_DefaultMode);
// Set shooter replication ID
if (shooter)
{
RplId sid = RplId.Invalid();
RplComponent rc = RplComponent.Cast(shooter.FindComponent(RplComponent));
if (rc)
sid = rc.Id();
if (!sid.IsValid())
sid = Replication.FindId(shooter);
if (sid.IsValid())
g.SetShooterRpl(sid);
}
// Select and attach guidance strategy
GuidanceStrategy strat;
switch (m_DefaultMode)
{
case SCR_EGuidanceMode.SACLOS:
default:
{
strat = new StrategySACLOS();
break;
}
// Add additional modes here if needed
}
if (strat)
g.AttachStrategy(strat);
if (m_Debug)
{
string who;
if (shooter)
who = shooter.ToString();
else
who = "<null>";
Print(string.Format("[GuidanceSelector] Bound guidance to %1 | mode=%2 | shooter=%3", projectile, m_DefaultMode, who));
}
}
override void OnInit(IEntity missile, SCR_MissileGuidanceBase base)
{
m_Base = base;
m_ShooterId = base.GetShooterId();
m_Shooter = ChimeraCharacter.Cast(Replication.FindItem(m_ShooterId));
vector o, d;
bool gotLOS = SampleLOS(o, d);
if (gotLOS)
m_LastCmdDir = d;
}
Oh wait should it be World.Replication?
I have checked that the RPLID i get in the first script is the same in the second
if (!sid.IsValid())
sid = Replication.FindId(shooter);
Remove this part. It's pointless. Getting the ID from the RplComponent is good
But that means you should do the cast correctly
The ID is for the RplComponant and not for the character...
Which is why you get null here
ChimeraCharacter.Cast(Replication.FindItem(m_ShooterId));
And then use RplComponent::GetEntity to get the character
@river imp There is also this one when im using the zel ui for thr shop system, dont know if theres anything you can help with here too please or is it for ADM to fix?
GUI : Creating menu 'ADM_ShopMenu'
RESOURCES : GetResourceObject @"{DF4CC8BEDB0858A0}UI/Layouts/Menus/ShopMenu/ShopMain.layout"
GUI : Layout load @"{DF4CC8BEDB0858A0}UI/Layouts/Menus/ShopMenu/ShopMain.layout"
GUI : Widget prefab @"{A5D822A6CBEB8003}UI/layouts/Menus/Common/MenuBackground-NoScripts.layout"
GUI (W): Overridden prefab member 'BackgroundImageFilter' (GUID: '{604F7067D0A2A068}' type: ImageWidgetClass) no longer exists in prefab
GUI (W): Overridden prefab member (GUID: '{5CFCF5E894AE6628}' type: ImageWidgetClass) no longer exists in prefab
GUI : Widget prefab @"{BBD087BFC198428A}UI/layouts/WidgetLibrary/BaseElements/WLib_MenuBaseSimple.layout"
GUI (W): Overridden prefab member 'Overlay' (GUID: '{604F7067D0A2C729}' type: OverlayWidgetClass) no longer exists in prefab
GUI : WidgetManager: CrateWidgets @"{DF4CC8BEDB0858A0}UI/Layouts/Menus/ShopMenu/ShopMain.layout"
GUI : WidgetManager: CrateWidgets @"{7513528C6C68D18A}UI/Layouts/Menus/ShopMenu/ShopList.layout"
SCRIPT (W): EditBoxFilterComponent used on invalid widget type.
GUI : WidgetManager: CrateWidgets @"{7513528C6C68D18A}UI/Layouts/Menus/ShopMenu/ShopList.layout"
SCRIPT (W): EditBoxFilterComponent used on invalid widget type.
RESOURCES : GetResourceObject @"{8C726E31F48200A5}UI/Layouts/Menus/ShopMenu/ShopCart.layout"
GUI : Layout load @"{8C726E31F48200A5}UI/Layouts/Menus/ShopMenu/ShopCart.layout"
GUI (W): Overridden prefab member 'BarterItemContainer' (GUID: '{605C6E092B3AD1B2}' type: HorizontalLayoutWidgetClass) no longer exists in prefab
RESOURCES : GetResourceObject @"{E1119D334BD43966}Prefabs/Items/Wallet/ZEL_Wallet.et"
WORLD : Entity prefab load @"{E1119D334BD43966}Prefabs/Items/Wallet/ZEL_Wallet.et"
RESOURCES (E): Wrong GUID for resource @"{50995CC6E9526553}Assets/Wallet/ZEL_wallet.xob" in property "Object"
Cash get stuck on checkout and the market freezes
would someone be willing to help me with makin a mortar mod
Stop spamming the scripting channel with errors. Layouts got broken for some reason. Adam will fix it when he has time.
if (mgr)
{
string message = "Server: " + dataShort;
mgr.OnNewMessageGeneral(message, 0, -1);
PrintFormat("[tech] short info - %1", dataShort);
}
else
{
Print("[tech] no info! Waiting...");
}
I can't figure out what ID I need to specify to send a message to the global chat as the Server, so that it looks normal, without a ":" before "Server"?
Now i'm getting " : Server: <my_data>". I need to send it in GLobal, not System chat.
I'm thinking probably not, but do we have enough access to script "instances" of areas like an instanced dungeon type of system?
If the "instance" is just a prefab
Basically how I did my "Hideouts" for an Escape game mode.
I unpublished it at some point apparently.
Ah
check out my simple chat roles if you get stuck..
Regardless, Create a prefab of your "instance". In my case it was a building(one of the bunkers) with the door components disabled. Then just spawn it in and teleport the player(s) inside it.
Not sure if you can spawn other maps as instances. I beleve that would get tricky.
is it in workshop? can you give me id?
or git? 🙂
mgr.OnNewMessage(message);
string dataShort = "You Can Do It";
SCR_ChatPanelManager mgr = SCR_ChatPanelManager.GetInstance();
if(mgr)
mgr.OnNewMessage(string.Format("Server: %1",dataShort));
I missed that part. Regardless, why in global? Everyone should see all the messages in system chat.
mgr.OnNewMessageGeneral(string.Format("Server: %1",dataShort),0,-1);
cos few messages will sent as Server to Global (id 0) and other to group
Problem being, it expects a player name
🙁
If you look at the function you'll see why that happens.
You have a few options.
- don't send system chats to the general channel.
- Mod the class and add your own function to it
There is not only system chat messages 🙁 There is few RP messages (in group channels) 🙁
add a new function to the class or override the OnNewMessageGeneral function
ok, will try it, thx 🙂
How does the player request the items in a vehicles inventory
I see until it is opened GetItems() populates nothing on the client
I'm using SCR_MapMarkerManagerComponent to create a marker with InsertStaticMarker(). All good in previous version, but now in 1.6, SCR_MapMarkerWidgetComponent gives a VME with Reason: NULL pointer to instance. Variable 'm_wMarkerTimestamp'. Anyone else seeing this?
I don't but i do remember having issues with widgets where m_wRoot was null and that was because i had overridden a method and forgot to call the base, could that be the case for you too?
I vaguely remember this error and I'm pretty sure it was because MarkerTimestamp a text widget was missing on a layout, can't remember for the life of me what though I'll have to dig through my commit logs
Good point. Seems to be an issue with my MapMarkerBase. Atleast it was missing the new (?) MarkerTimestamp.
This was missing. Now I get the m_wRoot null issue. Well, now I know where to look.
Ah yeah found it, I had to add that text widget because I have a custom layout for markers. Good luck with the null m_wRoot issue that I didn't have 
Uh, I introduced the m_wRoot issue myself with a typo. All good now. Thanks @solid hearth and @red cedar for help.
the best new feature in 1.6 is the script editor crashing on every build
02.11 2025 21:11:10
Assertion failed
Program: N:\SteamLibrary\steamapps\common\Arma Reforger Tools\Workbench\ArmaReforgerWorkbenchSteamDiag.exe
File: D:\jenkins\workspace\continuous_branches_stable_1.6.0\ARGamecode\Enfusion\GameLib\Source\GameLib\Framework\GameApp.cpp
Line: 1283
Reason: Resources are leaking! Check log!
[zlibVersion]: ??? addr:0x7ff7f88dc4c2
[zlibVersion]: ??? addr:0x7ff7f88dc748
[nvtt::CubeSurface::toGamma]: ??? addr:0x7ff7f7dba41e
[nvtt::CubeSurface::toGamma]: ??? addr:0x7ff7f6df4fae
[nvtt::CubeSurface::toGamma]: ??? addr:0x7ff7f6e149cc
[nvtt::CubeSurface::toGamma]: ??? addr:0x7ff7f6dc4236
[QObject::qt_static_metacall]: ??? addr:0x7fffd60424c1
[QMetaObject::activate]: ??? addr:0x7fffd6044fd4
[QAction::activate]: ??? addr:0x7fffae3735b1
[QMenu::actionGeometry]: ??? addr:0x7fffc7ff3fe3
[QMenu::actionGeometry]: ??? addr:0x7fffc7ff3db1
[QMenu::mouseReleaseEvent]: ??? addr:0x7fffc7ffa432
[QWidget::event]: ??? addr:0x7fffc7e86630
[QApplicationPrivate::notify_helper]: ??? addr:0x7fffc7e434c2
[QApplication::notify]: ??? addr:0x7fffc7e41658
[QCoreApplication::notifyInternal2]: ??? addr:0x7fffd6003b8f
[QApplicationPrivate::sendMouseEvent]: ??? addr:0x7fffc7e46446
[QWidgetRepaintManager::updateStaticContentsSize]: ??? addr:0x7fffc7eac0f9
[QWidgetRepaintManager::updateStaticContentsSize]: ??? addr:0x7fffc7eaa18f
[QApplicationPrivate::notify_helper]: ??? addr:0x7fffc7e434c2
[QApplication::notify]: ??? addr:0x7fffc7e425f6
[QCoreApplication::notifyInternal2]: ??? addr:0x7fffd6003b8f
[QGuiApplicationPrivate::processMouseEvent]: ??? addr:0x7fffadff895c
[QWindowSystemInterface::sendWindowSystemEvents]: ??? addr:0x7fffae0547db
[QEventDispatcherWin32::processEvents]: ??? addr:0x7fffd61908b0
[QWindowsGuiEventDispatcher::processEvents]: ??? addr:0x7fffae308619
[QEventLoop::exec]: ??? addr:0x7fffd600a694
[QCoreApplication::exec]: ??? addr:0x7fffd6002082
[nvtt::CubeSurface::toGamma]: ??? addr:0x7ff7f6dc609c
[zlibVersion]: ??? addr:0x7ff7f947c750
[zlibVersion]: ??? addr:0x7ff7f9479aea
[BaseThreadInitThunk]: ??? addr:0x7ff8e275e8d7
[RtlUserThreadStart]: ??? addr:0x7ff8e334c53c
[RtlUserThreadStart]: ??? addr:0x7ff8e334c53c
(Press Retry to debug the application - debugger must be attached)
Buffer Overthrow
Idk that sounded better in my head
Hi I would like to double check something, we can not use WorldController.FindMyController() yet in arma reforger right? (The Enfusion Script API docs say "Legacy world systems do not support world controllers.")
You know, most games would be able to enumerate all game controllers (even if it's still up to 4 if the devs insist) whether or not they have the same name. So, multiple vJoy devices should be detected like any other controller even if they have the same OEM / device name. However, it's not even the first vJoy device that takes precedence either. I guess I need to make a ticket to ask the devs to do something that is kind of an industry standard, and it works on all the games I know of, old and new. Just saying.
I was on the understanding that legacy world systems exist, but you can create the new non-legacy ones now, which would have support for worldcontrolelers
It's a bit much to mark GetPlayerIdentityId obsolete without pointing to the replacement function / wrapper. And, it's obviously only deprecated if the wrapper still calls the original function. Just saying. lol
I just wanna celebrate real quick. I think I have my per-player-controller which my menu uses that can RPC on the server. I haven't done the implementation fully but my client seems to have the correct Replication ID to their controller. Thank you for reading my blog
🎉
New official script github has been setup now : https://github.com/BohemiaInteractive/Arma-Reforger-Script-Diff
You can use it for future update to see exact changes, hopefully it will help you guys
@minor agate you know exactly, but I think now it is working with the 1.6
How do you search here without it freezing the whole page?
There is third party to open those as web browser, otherwise just check it out locally, and just search locally.
The most important is now as soon update is drop, it will also be uploaded here, so you will see in git diff exact changes at each lines
Yeah I appreciate it
Pre 1.6 this example worked on a dedicated server. Calling RL_TestUtils.SpawnAndStartMoving() server side. Now the entity will spawn and the origin changes on the server, but the new position does not replicate/update client side. Any clue what changed in 1.6 to break this? ```class RL_TestUtils
{
static void SpawnAndStartMoving()
{
Print("SpawnAndStartMoving");
Resource prefabResource = Resource.Load("{8154532BBAD4C09C}Prefabs/MP/Campaign/Assets/CampaignRadioBox.et");
if (!prefabResource || !prefabResource.IsValid())
{
Print("prefabResource failed to load");
return;
}
EntitySpawnParams spawnParams = new EntitySpawnParams();
vector transform[4];
Math3D.MatrixIdentity4(transform);
transform[3] = "129.578 1.026 140.605";
spawnParams.Transform = transform;
spawnParams.TransformMode = ETransformMode.WORLD;
IEntity newEntity = GetGame().SpawnEntityPrefab(prefabResource, GetGame().GetWorld(), spawnParams);
GetGame().GetCallqueue().CallLater(RL_TestUtils.MoveUpABit, 1000, true, newEntity);
Print("SpawnedEntity"+newEntity);
}
static void MoveUpABit(IEntity entityToMove)
{
vector vehicleRotation = entityToMove.GetYawPitchRoll();
vector vehicleOrigin = entityToMove.GetOrigin();
vector vehicleForward = vehicleRotation.AnglesToVector();
vector targetOrigin = vehicleOrigin + vehicleForward * 1.1;
PrintFormat("Entity %1 Current Pos %2 Target Pos %3", entityToMove, entityToMove.GetOrigin(), targetOrigin);
entityToMove.SetOrigin(targetOrigin);
entityToMove.Update();
}
}```
RESOURCES : GetResourceObject @"{2EB880C768FDC52F}Prefabs/MP/TestLobby.et"
WORLD : Entity prefab load @"{2EB880C768FDC52F}Prefabs/MP/TestLobby.et"
WORLD (E): Unknown class 'SCR_TestLobbyEntity' at offset 20(0x14)
ENGINE (W): Can't load prefab Prefabs/MP/TestLobby.et
RESOURCES (E): Failed to load
RESOURCES (E): Could not load the prefab '$ArmaReforger:Prefabs/MP/TestLobby.et'
Not sure how I managed to get this vanilla file error. No overrides or duplicates of it.
Any direction at all would be appreciated
so weird bug i use armst platform and they use persistence but i have a issue when somone logs out their charcter stays on the server idle then when they relog it spawns them as a totally new character is this a problem on your side?
I haven't looked into it much. We added a DeleteEntityAndChildren after EPF_BaseSpawnLogic.OnPlayerDisconnected_S You could try to get in touch with Arkensor
ill try to d him ig just know hes probally really busy
Maybe try #1430828753717559430
LOL nvm, apparently you're not using vanilla persistence.
https://enfusionengine.com/api/redirect?to=enfusion://ScriptEditor/Scripts/Game/GameMode/SCR_BaseGameMode.c;995 this is where you normally get it deleted. Noteably the spawn logic can not prevent the deletion, only reconnect component can
Ahh so they added " If conditions to allow reconnect pass, skip the entity delete"?
Ooof, no I see the issue in our vanilla scripts. I'll fix it. You can add a reconnect component to your gamemode and have it enabled to fix the issue in the meantiime
😅 Maybe you can also see the issue in this? I also tried using EPF_WordUtils.ForceTransform
This should not be done in the first place. spawn it with correct transform directly.
No you can move things but a second after creation will probably not arrive on client on time so it gets instant spawn anyway. also make sure you have an RPL component on the entity
The CallLater has true for the repeat param so it should continue to move. The CampaignRadioBox I used in the example does have an RplComp. It is static but even with that unchecked it still doesnt move. This is simplified version of a function I had working before 1.6. After 1.6 it suddenly does not work. I can Rpc Broadcast the new position but that wasnt required before.
do we have any smart action for AI to let them build like a player?
Been trying to achieve this for my domination pve mod. I did my research and couldn't find a way but I'm sure it's possible
so it kit saving not a thing anymore?
Can anyone confirm that this is the correct script that I should be inheriting from if I'm making a mod that utilizes the existing logic for building with the multitool?:
SCR_CampaignBuildingBuildUserAction
I can't find one that has a more generic name, and wasn't sure if this is scoped for just the campaign.
Is there a simple way to get a total damage value for a vehicle - helicopter in my case? I don't think helicopters have a thing like IsVehicleOperable.
Neat, calling SetRenderView after RemoveRenderTarget instantly crashes
You'd have to iterate over the HitZones and check their DamageState using GetDamageState(); if you want overall health of the vehicle. However, if you just want to find out if it can move, there is a check for that which is inherited from the BaseControllerComponent: CanMove()
Thanks, I'll take a look at that.
When you're logged in github you can press dot . to open VSCode in the web browser with the repo open.
Or replace .com with .dev in the url:
https://github.dev/BohemiaInteractive/Arma-Reforger-Script-Diff
Can anyone tell me what's the correct method to detect roads? I want to spawn vehicles only on roads but no success so far
have a look at RoadNetworkManager::GetClosestRoad
or the other methods in that class if they're more applicable
Does anyone know why Im suddenly getting these blue debug cubes in play mode after 1.6? they show whether in GM or not
they do not show in edit mode, only in play mode
Thank you so much
they are only showing on compositions that I spawn via code, and only on one, possibly the last one I spawned
Anyone else have the annoying poison pop up?
Its a menu I can't seem to get rid of
I also can no longer open the debug menu as well
Since 1.6
me too haha
The game is obviously warning you about poison
Can anybody tell me about the proper set up for a world controller as an analogue to the player controller?
I've switched the majority of my data transfer to a controller which the system talks to on the serverside, and the controller then RPCs itself with the information to whatever player I am trying to specifically send that information to. I guess the question I have is:
How many instances of a world controller are there? I think I messed myself up with this RPC rodeo because if there is one on the server, and one per client, then the data I am sending is trash and I need to check who to send it to more than likely. The docs don't elaborate much on this.
My ideal flow of data is:
Server calculates and creates data via serverside system
Server sends data for each player to the controller
Controller sends data down to it's client which needs that data for storage.
Client components (items, etc.) talk to the controller to retrieve such cached data.
Is there a good explanation for the difference between public and private for controllers? Unique is explained as a single instance (makes sense).
No clue where else to ask this, but everytime I try to load any of the maps I've made it always says "load world error." Does anyone know how to fix this?
Looking more into my issue, when the following runs:
AG0_TDLController controller = AG0_TDLController.Cast(
GetSystems().FindController(AG0_TDLController, playerID)
);
controller is NULL
So I double checked the InitInfo and I am adding the controller there .AddController(AG0_TDLController). This runs well after a player has joined and is initialized.
The system is:
class AG0_TDLSystem : WorldSystem
I have tried both Server and Both for location.
The controller is:
AG0_TDLController : WorldController
The controller is set public.
I wonder if somehow the system is being treated as a legacy system, it is defined in the systems config. I also wonder about the differrence between ints and PlayerIds in terms of what object type they are, which could be why this is failing
Ok, so player manager assigns ID 1 and the controller is assigning ID 0? This is a workbenchism of course but need to do testing to see if this is offsetting all playerids in MP.
Yea I feel like I’m being cooked I need to log what the game thinks a player id is on dedicated because the player id given by the controller is 0 on workbench and looking for player 1s controller on dedicated gives me null. I’m giving up for the night.
I do something similar to this in Overthrow if that helps:
My Spawn Logic will create the entity and then pass ownership of the entity to the player then I use that for all RPC requests from the player
claude generated implementation plan is here: https://github.com/ArmaOverthrow/Overthrow.Arma4/blob/main/Design/OverthrowController.md
Was advised to avoid entities and my system is a background thing that needs to push data to specific players due to the large amount of data there is/can be. An entity will still replicate that data to all players within replication distance, or all players regardless.
I see
not sure why'd youd avoid entities though, it really is a barebones entity
the components on that entity do the work
it could just be a generic entity
The mod potentially has hundreds of “devices” (components) which would store arrays of data based on their connectivity with other devices, updated constantly. Not good for network traffic, been there done that.
A player only needs to know what they need to know, if this was a smaller project, would be an issue
I dunno though it also kinda seems like you're trying to reinvent the wheel. the ECS in reforger is already there and does those things if you just write custom replication and JIP
I see, so entities have overhead, dont create thousands of them
or use them as a database
fair enough
kinda not very true to the ECS method of architecture though. an entity should only have the overhead of the components attached to it
an empty entity with zero components should do nothing but occupy memory on the server
but oh well
If I wanted players to own the entities they are playing with, it could work, but such ownership can be counterproductive especially with devices potentially being placed down (but I still need to use them), so I have to develop on the basis that every device could be interconnected, and 50 connected devices each storing their own array of the other 49, and wanting to update constantly would not be good for me - so I decided to have the system prepare that info, and give only a player carrying such a connected device the single list of 50, and it gets rid of the headache of assigning and transferring ownership, etc. if an entity is “permanently” owned by the player you could argue that you can just RPC to the owner from server and back. But because I need to know what’s connected to what, spawning an entity is probably equally as difficult as making a controller. Before the recent change it was actually incredibly easy to just piggy back on the player controller and you didn’t have to set anything up at all
no its incredibly easy to spawn an entiy and give them ownership its literally 2 lines
you dont need to code the entity if you dont want to, it could be a GenericEntity with some components on it
those components could store and replicate references to the other 49 entities
via RplId
your game mode or similar global entity could handle spawning and recieve self-registration requests then update all 50 as the devices come online and run their constructor
@wet trench Yes it does work now. Only issue you will find is that FindController(SomeIDHere) will only work for the first player that got a controller. It seems to be bugged for that atm, even though the rest functions fine.
Interesting, @minor agate if you read up I’m having an issue where the first player has ID of 0 for the controller, does this mean 1 is skipped and the rest would have 2 and on?
The id part is scuffed 🙂
That is why FindController is bugged
Yeah… I thought I was going crazy
What would you recommend in the meantime for system that must contact specific players
Is just finding by playerId that is broken
You can use the controller
Just FindControler(pId) won't work
You can externally store which controller belongs to which player
but otherwise you can just go back to PlayerController entity for now
After 1.6 I can’t RPC to it from System as it’s protected method now
You can!
It's just that RPCs were never expected to be used like this
somePointer.Rpc
You were always supposed to call it on within the class itself
(There is some context based shenanigans with it)
you can put a component on the controller and still use Rpc that way, just call your component method then that does the Rpc
So to avoid issues, it is now protected with an message
So the way to do it is to create your own public method to call it safely
Yeah, which makes sense, should ask the server side version first.
I already swapped pretty much everything over, so I’ll just need to figure out how to store the controller RplIds. Tomorrow problem
hmm thank you
Is there a list of deprecated functions and what they were replaced with?
https://community.bistudio.com/wiki/Arma_Reforger:Workbench_Plugin
Is this still valid? I thought we couldnt make workbench tools anymore.
And what part about it was a problem for you? Please be more precise what issue you have
I don't like bumping my own questions but I genuinely cannot solve this problem or figure out where to even begin looking.
I just remember trying to make editor tools before, and it had been taken out and made protected. I'll look at this more though.
Like to make a custom menu in the menu bar
Hello, can you send me on DMs your log files?
That is odd. It would have affected our other plugins
Which are all scripted the same as you would as modder
Were you like, inheriting from an existing tool?
If so, then know that you can mod the original, override the vanilla method and mod away the private by ignoring it on the override signature
Method signatures are moddable that way
Protected itself should work on inheritance
Feel silly for asking but which set of log files, reforger workbench or reforger itself?
protected and private are accessible in modded classes
It was a while ago I will have to get more details, but while I have your attention, the magnifying glass button does not navigate to and show the relevant file anymore like it used to in the resource browser
For me since 1.6
Well scratch that its working now idk
Is Play From Camera Position accessible anywhere in script?
There is possibility to cause to go to play mode with WorldEditor::SwitchToGameMode but not to set the flag for Play From Camera Position as far as I know
If you have Play From Camera already enabled, and you call this method then it will play from camera as well
Trying to make a dev spawn mode that bypasses server authority stuff
Obviously the reason is because play from camera mode doesn't work for me. I'm assuming because custom camera manager.
Ty
bypasses server authority stuff
Uhm, what do you mean?
for my splash screen database connecting / main menu / character creatino flow
I want to test that stuff on dedi with real game client, but when in editor just want to be able to get in with a player to test new mechanics
You can not have mods loaded in main menu
and going back to main menu, then to play session resets the mods and state
Any mod that we find that do such thing is not allowed
welcome screen i suppose
and any exploits or bugs found to have that is going to be patched
Cool yeah not trying to do anything like that.
We do not allow Main Menu to be touched for security purposes
Okay good
Just letting you know before more time is wasted if that was the case
This main menu
Yep appreciate it.
Ok, so not game main menu
But server main menu or so?
If so, then that is completely fine
Yeah, its fine. Don't worry
No messing with server browser trying to put it our layouts either I assume?
I did toy with that before and got backend connection errors
This checkbox disabled destruction or the whole entity?
on Tree_Base and DestructibleTree_Base
Did you hit Win Key + Alt at any point? This looks like what happens when you enable the World > Show entity bounds option in that little menu that pops up with that key combo
Whats everyone doing for spoofing peer tool IdentityId's (UUID)? Would I just generate a ID if one is not found on a player connection? Or has someone got a quick little tip they wanna share 
only thing i have found is to have an approved mod list and if they have a mod not on the list it denys the connection
mmmm, No sorry.
Peer Tool clients don't have IdentityId's
t'was looking for a solution to tht, but ty
using existing identity util that comes with the scripts
hah! neat, what im looking for, cheers
cool deal
Control+Enter automatically creates null checks now? Was this added in 1.6 or have I just been missing out
rpphone working in 1.6 finally
Is weapon dropping now hard coded in 1.6
I see the method that drops the weapon but it is an external we cannot override
and the only code exposed to us that uses it does not stop the weapon from dropping of I override it
does anyone know about a mod that saves inventory and position as u log out so u keep that when logging back in? or has the experience to make something like that. id love to see that since i need that for a server but have no clue how to make that
@minor agate
SCR_ResourceComponent resourceComponent = SCR_ResourceComponent.FindResourceComponent(supplyDepot, false);
if (!resourceComponent)
continue;
SCR_ResourceConsumer consumer = resourceComponent.GetConsumer(EResourceGeneratorID.DEFAULT, EResourceType.SUPPLIES);
if (!consumer)
continue;
Print("Requesting " + supplyCounts[i] + " Supplies");
Print(consumer.RequestConsumtion(supplyCounts[i]));
}
I followed what you said and this is not consuming the resources
For example this is the supplies I am using
The truck has the action to consum them
Got it
SCR_ResourceComponent resourceComponent = SCR_ResourceComponent.Cast(supplyDepot.FindComponent(SCR_ResourceComponent));
if (!resourceComponent)
continue;
SCR_ResourceConsumer consumer = resourceComponent.GetConsumer(EResourceGeneratorID.DEFAULT_STORAGE, EResourceType.SUPPLIES);
if (!consumer)
consumer = resourceComponent.GetConsumer(EResourceGeneratorID.DEFAULT, EResourceType.SUPPLIES);
if (!consumer)
return;
consumer.RequestConsumtion(supplyCounts[i]);
Consumtion
Is that a rip from GTA, or just using their artwork?
so, now the dedicated server tool doesn't have ENABLE_DIAG defined, only ENF_WB. was it like that before though?
@hybrid veldt
Yeah, A typo we could not change as it would break a lot of mods. So we just kept it
Is there still a way to obtain the current scenarioId by script?
How do you work I can't figure out how you work with scripts. The tool crashes every fifth recompilation, and when I try to open my GUI, it crashes.
Can you only have one World System in a game? I would like to add my own feature into the game but I don't want it to be the entire game mode. I would really like to use World controllers
I'll check, it may be related to the gproj defines now being read for script compilation too and not only validation
What makes you think that? You can add as many as you like to the systems config
Hmm I see what I was doing wrong. I was making my own config instead of adding my system to the regular config. Cheers
use of images/data from other games (GTA in this one I believe) will get your mod banned
so u know. dont do it
It was just an example
dont do it as an example either
I’m allowing player to put their own background
Alr alr
risky
?
It’s like in FiveM phones they put the link of an image and it’s the background
Is it not allowed?
if people use your mod to spread stuff they are not allowed, your mod might get removed as well
I would also check the regular dedicated server having ENF_WB somehow when it should be a debug-only thing. Or, we just need a new define that is only on the SteamDiag exes. Odd situation.
fiveM is not really know for following rules
Yeah I know, but I thought I could allow players to put their own image
I would not recommend that
Artwork as background, but I learned now that is not allowed, so it’ll be replaced with no copyright backgrounds (the phone itself is a rework of the Kodi rpphone)
just rename it and make an alias for the typo?
Yes there is a mistake currently. We enabled the ability for modders to define script preprocessor toggles via the gproj file and right now even non diag linux servers think they are a windows diag workbench
we will fix it in a future update.
We enabled the ability for modders to define script preprocessor toggles via the gproj file
This is an awesome change, I don't think it's been mentioned in any changelog?
Truth be told, a lot of things are missing from the changelog, but that is my fault, I am buried below a lot of work and simply did not dedicated any time to submitting info for it. Also that is why some modding articles are not released yet. I will catch up on this and try to pick out some highlights for next exp/stable changelog even if they may have already technicially been released 😉
Hello, I was wondering what the best practice is for replicating a hashmap from the authority to all clients, I currently am doing a (kinda scuffed) method.
I am currently separating the key (playerID) and value (Data Container) into two separate arrays, replicating those arrays, then stitching them back together on each client whenever there’s an update.
This works, but I had the nagging sensation this isn’t best practice lmao. Let me know if anyone has any other solutions!
I could tell you but mario would time me out
Not sure if the best solution, but you can use RplSave and Load method too. There you could seriialize the map by writing count and then key value and read it back. Not sure if that is the best approach. @minor agate will probably run to his desk as soon as I say anything to correct me
Guys, can you help? After the update, this error appeared in my mod after any change in the code. It's not critical, and I can safely update the mod, but the problem is that if I load the game with only my mod, I get a white screen.
New error we all get, ignore it
I understand that this is a new error, but because of it, the mod doesn't work, and if I try to load the game with only my mod, there will be a white screen, but without my mod, there won't be a white screen.

Something else besides that then, sounds like a map error or something if all you see is a white screen
Like the custom world you are trying to open doesnt have the map it needs anymore in your mods
You should comb through the console log upon opening workbench with the affected mod and booting into the world. Your issue is probably buried deep in the logs. Something small like a bad attribute on some material file or config but not workbench breaking enough to stop it from running.
Alright, I'm too lazy to mess with this, I'll just re-release my mod.
Tons of people getting it. They are releasing a hotfix update this week or next I believe. I imagine it will be one of the things fixed.
Just click ignore
I hope so, because without my mod I can't play the campaign; my mod provides too much immersion.
why do you need to have the data on the client and server? why not just serve data by network requests from the client if they ask for it?
Because I do, all clients need to be synchronized with all the data that’s on the server across replication bubbles. Otherwise the experience gets degraded as you see information that’s old, hasn’t been updated in awhile, etc.
Best way I’ve come up with is a hashmap with a players ID as the key and a replicable data container class that stores/replicates all the information we need
here’s the git repo with the code.
it sounds overengineered to me when you can just broadcast a change to all other clients when a client induces an update on the server
hopefully by not sending full arrays and maps of data but only necessary incremental updates
I mean that’s what I do, it’s just the replication I’m asking for help on
So I would advise sending updates since that’s pretty much what you want, send the key and the data object to the players that need it, either via player controller or the new controller set up
Yeah, the thing is all players need all the data since I need to be able to quickly look up data when displaying nametags or icon updates. (Having a nametag pop up then update after popping up would get distracting) I guess the only real data separation is the faction each player is on.
I like to use the controller as the cache which holds the data, and on it methods to accept changes by key
It’s instantly available
And updates come from system
You could also do a system which exists on server and client if you aren’t afraid of all players having the data, but it makes it harder in the future to provide certain data to specific players
For example the enemy team doesn’t need to know your teams positions, or maybe you have squad markers or group data that other groups don’t need
You’d shoot yourself in the foot with network congestion if you go a “I have massive data” route, because say you can do delta updates over network, the initial sync still has then potential to stall replication
You can still do it of course, sometimes you have to, but a hybrid approach might be best
Hmmm, fair, do you have any examples of the player controller route? Cause that may be the best route since I can separate information to each players faction as that’s the only real option right now
So TDL used to work that way, but I switched to world controllers (pretty much same idea)
Server side system, collects and refines the data.
A class which holds the data; with proper encode decode, etc. methods so you can just send RplProp that class.
Modded SCR_PlayerController with the RplProp which uses said container class.
A method on it which the system sends the data to, which sets the RplProp, then bumps replication with Replication.BumpMe()
Then local methods to talk to the class and pull data as needed ReplicatedClass.GetPlayerNametag(playerId)
Which since it’s stored in the rpl prop, as long as it’s not null you can instantly get your data from other classes on the client by talking to the player controller
Is there possibly a vanilla method to get whether a entity is sitting on the terrain rather than a structure? I.E. dirt instead of a sidewalk
Or maybe even something I could reference on how to determine such?
Do you have a git or can point me towards any implementations of a system like this?
@arkensor do you have any idea why this might be happening? It happened with our ChimeraCharacter at first now with some custom shorts we have in our mod
I'm still stuck on this error with EPF
SCRIPT : GetResourceName 'Scripts/Game/EPF_PersistenceManager.c,155'
RESOURCES (E): Invalid ResourceName format @".et" in property "m_rPrefab"
SCRIPT (E): Virtual Machine Exception
Reason: Invalid prefab type '{752C8D1934A4ECEE}.et' on 'EPF_ItemSaveData:6909778d-0000-0001-0001-57d0af807376' could not be spawned. Ignored.
Class: 'EPF_PersistenceManager'
Function: 'SpawnWorldEntity'
I can give the full stack trace if needed just didn't want to make more of a wall of text if it's not needed.
`[RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
static void StartSirene()
{
array<string> sirenes = {"Siren1", "Siren2", "Siren3"};
foreach(string siren: sirenes)
{
IEntity sirenEntity = GetGame().GetWorld().FindEntityByName(siren);
SoundComponent sirenComponent = SoundComponent.Cast(sirenEntity.FindComponent(SoundComponent));
//sirenComponent.Activate(sirenEntity);
AudioHandle sirenAudio = sirenComponent.SoundEvent("SOUND_SIREN_LP");
sirenesAudio.Insert(sirenAudio);
}
GetGame().GetCallqueue().CallLater(StopSirene, 10 * 1000, false); // 2 minutes
}`
On workbench it works fine, on server not, why? Maybe I did something wrong with RPL? I'm calling this method from non RPL method
Or how to enable siren sound in GenericEntity(SirenMilitary_E_01) and disable after few seconds
GitHub/Tactical-Data-Link
Fixed in latest version of EPF
hey man, sorry to bother, as now when I get the persistence id of a baked map entity it's always the same, in the moment that I try to get it on a dinamically spawn entity (like a car bought from a store) the persistence ID get changed every time I reload the workbench (not in the file, just in game)
this is always the same in the file but in game I'm getting another ID
Hello everyone!
I’m aware this question might have been asked before, but I couldn’t find a clear answer.
Could someone please explain how to create a script or trigger for a toxic zone where wearing a gas mask prevents damage?
I saw such a system implemented in a project that has since been taken down by its author.
I apologize in advance for my English — I’m using a translator.
OnAuthorityReady seems to only run on server for my World Controller, is this intentional? OnRplGiven doesn't seem to work, or maybe it doesn't work in the way I expect. No vanilla controller uses it, not present in 1.6 at least.
Thank you
WB works fine, on server not
most likely problem is "how you call it"
intentional
Can you give more information and context?
What are you trying to do?
Yes of course, thats exactly what it should do. If you do not load the entity back but spawn a new one it gets a new id. map entites have fixed ids
is there a way to get that persistent id?
(the one in the file I mean)
May I kindly ask you to read the inline documentation on persistence system first before asking basic questions?
Can I write you in DM?
I read the docs but using this function is giving me a variable ID.
I buy a vehicle -> I get an id saved in the file -> restart the workbench and when I'm in game the persistence id is different
This looks like EPF mod, it has full documentation on github, please consult that.
Hello !
What would be the most optimized way to get players (or SCR_ChimeraCharacter) around a player ?
(ran client side so it's not like it will NUKE server fps, but still)
I might be wrong here as I'm quite rookie with Enfusion still, but check the code in this tutorial. There's QueryEntitiesBySphere method: https://community.bistudio.com/wiki/Arma_Reforger:Create_a_Component#Add_Code
yeah this look much better than getting all players and doing a distance check
Thank you !
Yes
Sent you one yesterday also figure you're backlogged
does anyone have some scripting to test the reconnect component? perhaps, you could prespawn an entity that is being preserved like a net disconnect, but just hand it to the first client to connect in workbench / dedicated server tool. this would let you test the reconnect dialog and what not, including restoring previous game state related to the player's entity.
Use peertool or decicated server that you connect to from workbench or client exe. To force a reconnect stimply go to ask manager, details, and kill the exe process. Not the main task manager view that shows only the application name. Ending task there asks the app to end gracefully which will make the client do a "proper" disconnect from server
does virtual player id work at all now? when you reconnect, you are just the next playerId. so, it's never worked, even if you get the CLI arguments to relaunch the exe manually, and only the workbench (host) player has UID (sometimes) to maybe get the same playerId back, but just not possible in any case
Reconnect works now since 1.6 yes, even for peertools
ty. I didn't realize that would be working perfectly. I can debug some problems I am having with faction streaming of dynamic map markers and some player-specific data store stuff. FYI, it's not 100%, you don't always get reconnected to same playerId, which is fine, you can redo it, it will probably work the second time if it missed the first by chance, but your old body is still there like a dummy AI. not sure, still looking into it. I think I will also need some code to deal with private group rejoin on reconnect. I see there is a SCR_AIGroupSerializer though.
I’m trying to add shops to my server for players to buy and sell item found in game basically redoing DayZ through reforger how can I add shops
Sounds like you’re wanting a mod on the workshop, which you can just search the Reforger workshop for.
And wrong channel, please use an appropriate channel in the future
I was told to go here sry
What channel do I need to go to?
Hey !
This channel is meant for modders to discuss and help each others with modding, maybe the mod you're looking for already exists but i wouldn't know.
Unfortunately no one here is going to make a mod based on what you need, you can always get started and learn how to script tho 🤷♂️
Not looking for someone to do it for me I want to do it but don’t know the information
the bad news is that it's going to take you a fewmonths before you understand what you're doing.
The good news is that bohemia made a serie called bootcamp which will walk you through the basics about the workbench and enforce in general :
https://youtu.be/Fgl_mAHReP4
it is actual programming so it's going to take time.
I'd recommend you watch these bootcamps :
#1 Introduction to enfusion
#2 Modding patterns and workflow
#4 User interface and HUD
#5 and #6 on replication (THE MOST IMPORTANT in my opinion)
https://reforger.armaplatform.com/news/modding-boot-camps-introduction
This Modding Boot Camp seminar was originally held on the Arma Discord Server on November 20th, 2024.
Join Modding Supervisor Mario Enríquez for our first Modding Boot Camp, where he gives a quick overview of the Arma Reforger Tools and Workbench.
00:00 - Modding Boot Cam...
Thank you
I'm facing some issues with the QueryEntitiesBySphere method.
For some reason only the entity highlighter in blue (my palyer) is queried while my peertool isn't (the red one)
What am i doing wrong ?
(delay in between queries is 5 seconds)
void QueryNearbyEntities()
{
m_nearbyPlayers.Clear();
m_world.QueryEntitiesBySphere(
m_currentCamera.GetOrigin(),
m_EntityProximityQueryRadius,
QueryEntitesFinishedCallback,
null,
EQueryEntitiesFlags.DYNAMIC | EQueryEntitiesFlags.WITH_OBJECT
);
}
protected bool QueryEntitesFinishedCallback(IEntity e)
{
if (!e)
return false;
ChimeraCharacter chimera = ChimeraCharacter.Cast(e);
if(!chimera)
{
return false;
}
m_nearbyPlayers.Insert(chimera);
return true;
}
Yo that highlight shader is cool
Hello bacon !
Don't ask 😉
this is so frustrating holy shit 😭
protected bool QueryEntitesFinishedCallback(IEntity e)
{
if(ChimeraCharacter.Cast(e))
m_nearbyPlayers.Insert(chimera);
return true;
}
If you return false you abort the query
oh
i guess that makes sense if we're looking for a specific entity 😭
Thanks a lot you don't know how long i've been slamming my head against the wall on that
This is sick !
Thanks
Hey @torn bane is this crash known?
19:36:05.838 PLATFORM (E): Failed to create save. Maximum playthrough or save point number exceeded!
19:36:05.865 ENGINE (E): Application crashed! Generated memory dump: /tmp/78e106df-0e74-4666-7931699c-648e36a4.dmp
yes do not create a save ech minute or so
