#enfusion_scripting
1 messages · Page 2 of 1
oh, thats a thing? lol
Must be broken in experimental
In stable branch it only works if you have multiple lines selected
Again?
No it's working fine.
I'm using it all day long.
May you once again have to reset/rebind the key to fit your keyboard.
is there a way to find a component from rplid?
use the rplid to find the entity, then find the component on the entity
This works, on a door that's a child of a building
Do exactly that ^
Then show the menu
i did. and that part works. no issue there.
Then i'm not sure what your problem is
its when it called for ownership change in the component im getting a replicationerror
I'm confused why you're calling it in the component to begin with
Create a static function for the server to call that sets the ownership of pOwnerEntity to pUserEntity
Absolutely nothing should change in the componet when the ownership changes
It should just be giving the player ownership of the entity that owns it
Thus allowing the player to rpc data from the client to the server and vice versa
so i legit just find user rpl component, get id.
find owner rpl component and then run give.(userid) from there?
i think i know my issue now.
Not sure if its needed but I pass true for alwaysNotify
i was getting rplid and not identity. those are two seperate things right?
Look at the paramaters for the Give method
yeah
This isn't an Arma 3 channel
Look at what BaseRplComponent::Id returns
rplid vs rplidentity. those are two different things right?
They're literally 2 separate classes lol
if they were the same thing one of them wouldn't exist lol
yeah lol, i had a brain fart. but also, in peer tool since the peer identity is 0. is that going to return null?
again, those are 2 completely different classes
one is a string that represents a players Unique ID and the other is the identity for the rpl component
Guess you know.
Still just in case: #enfusion_scripting message
its correct tho :((((((((
No wait
/ is incorrect, inverted question mark is correct
Thanks bro
I cant believe i fought with it this whole morning just for it to be that.
im gonna blame it on being fasted.
I mean - i have custom controller, default baseChar, im spawning character, but cannot give a control for real player.
Like in admin mode -> "Play As Character"
There's way more to it than just giving ownership. Perhaps find where the "Play As Character" button is being called and see what B.I. does.
Soooo
Whats the least effort way to serialize an entity and then unserialize it into another entity
For example arsenal loadouts serialize the whole entity and then unserialize it to the spawned character after spawning
Basically copy paste, sorta
Yeah, but i can't find a admin component or some like this, than question about some material's/link's/hint
There is so strange logic on infinity await's and "Can"requests. I wanna just understand some things, and primary of that is what's responsible for control agent
(Like a some of "simple" logic with basic rplrpc for understanding)
Try doing anything with resourceName? Sounds like you got it right there if you're looking for the actual name not the prefab ID.
I always check what autofill can do after putting a . after some variable I'm trying to use. You can definitely do it without spawning the item but you'll need that prefab ID from somewhere initially to then extract the actual name
I'm trying to create a magazine through base.et, but the script part doesn't work, even doing the same as on the website.
Is it correct to duplicate the MagazineWell script?
Well you can't name the classes the same as the existing ones
These are the vanillas, which are already in the file, so it gives an error
If you duplicate a script from vanilla, it will duplicate the classes, which will have the same name. This results in an error as classes cannot share names.
like this?
map<ResourceName, array<bool>> mapEnabled = new map<ResourceName, array<bool>>();
can you do a map initializer syntax? obviously I'm getting it wrong if you can.
map<ResourceName, array<bool>> mapEnabled = {
"prefab_1", array<bool> = { false, false },
"prefab_2", array<bool> = { false, false },
};
how about a map in a map?
hmm, so I have to do a dozer, or delete these others?
You are missing a ref for the array, unless you have these arrays stored and owned somewhere else
If you duplicated a file with the intent of using the classes within as a basis for your own, you have to rename them.
map<ResourceName, ref array<bool>> mapEnabled = new map<ResourceName, ref array<bool>>();
can you do a map initializer syntax? obviously I'm getting it wrong if you can.
Nope
You can also do this if you want to avoid the long line. This will only work for local variables of course as if you try to do this on a class body, then the compiler will think that it is a method.
map<ResourceName, ref array<bool>> mapEnabled();
then map in map would be:
map<ResourceName, map<string, bool>> mapEnabled();
or do you also have to ref the inside map as well?
map<ResourceName, ref map<string, bool>> mapEnabled();
Beware that ref is not always needed
It's only needed if you do not have other strong references to the object soemwhere else (Aka having ref to it somewhere else)
No refs => the object gets deleted
i've been just following what the compiler tells me for ref so far unless I'm making a whole new base class then it REALLY screams at me
Adding ref everywhere is also a problem, as you might cause it to never get deleted or the sin of causing a leak.
So keep track of your refs.
Yeah, this can land you in what I just said.
rule of thumb, that is the case most of the time
ah ok. so when I'm all done with my method, if I use a ref, I should delete the ref before my return?
Is to only add ref to the thing that called new for the instance
In other words, only do it on the owner/creator of the instance
alright, this is for a editor plugin, so I won't have to deal with any RPC atm which is nice.
finally found a log print for the RplSchedulerError
RplSchedulerError: Generated task provided id of removed or never registered item!
Anyone have any idea as to what this could be coming from/how to debug?
Create a base container instead of spawning
hello! anyone have recommendations what would be the best solution for the player to spawn at a random POI (could be coordinates or incorporate vanilla spawn points) unless they have a command tent or deployed radio? I am also completely fine with hand jamming some code if someone could point me in the direction where spawn locations are handled
I could be overlooking it or maybe its somewhere odd but I have looked through basegamemode, respawncomponent and respawnsystemcomponent scripts
You should probably look into the actual game mode that you're using.
I found what I was looking for! I appreciate it!
And create a base container and you can get whatever info you want from it
I mean - i have custom controller, default baseChar, im spawning character, but cannot give a control for real player.
Like in admin mode -> "Play As Character" or onSpawn logic
I checked spawn logic, but i didn't see anything in it... 😦
Resolved -> SCR_PlayerController.SetInitialMainEntity(entity)
thank you very much in advance
WORLD : UpdateEntities
WORLD : PostFrame
GUI : ImageSet load @"{82943F12E604FF4E}UI/Imagesets/WeaponInfo/WeaponInfoAlpha.imageset"
GUI (E): Not found
GUI (E): ImageWidget::LoadMaskFromSet can't load ImageSet 'UI/Imagesets/WeaponInfo/WeaponInfoAlpha.imageset'
I don't know, how restore it
Hey, anyone out there able to create logic so that Enfusion Persistence can be used with multiple factions instead of just one?
You have to make a new script where you declare the new class for your magazine, using the one you found in vanilla script as ref. Make a new script, copy line 3 to 8, replace "Stanag556" by "YourWeaponMagWellName" (whatever you want here) Shift+F7 to compile and reload script, now your new type of magwell should appear in your mag prefab list. Do not copy entire vanilla script
Any clue why this would be displaying? think its something with the doorslotcomponent and doorcomponent below it.
ENTITY : Init entity @"ENTITY:2305843009213693962" ('GenericEntity','Assets/Structures/BuildingsParts/Doors/Door_Shed/Door_Shed_02_Right.xob') at <124.469513 1.155844 123.586472>
RESOURCES (W): Trying to register more apertures per portal! Max supported apertures per portal are 4.```
hi, i've question about json responce parsing
class SomeResponce : JsonApiStruct
{
string someString;
void SomeResponce ()
{
RegV("someString");
}
}
looks like parsing totally breakes if i've got { "someString": null } in responce. What can i do with that?
you can use "software" parser from 3rd party mod 
I can write my own just for this case, sure... but it looks strange that the built-in parser can't handle nulls, so I think I'm missing something
Well jsonapistruct will make your mod break anyway so
builtin are very limiting, it's primarily used for constructing enforce classes 1:1
I can write my own
It's already done in workshop
okay i got it, thanks guys
bohemia keeps surprising me
61DAA7B4B5025363 
is there a way to view all the actions for actionlistener?
check actions in chimerainput.conf
thank you, i was trying to find a config but searching input didnt show it.
chimeraInputCommon.conf at configs/System/
yeah i found it now. i dont know why i didnt think of checking system folder
Do yourself a favor and use https://community.bistudio.com/wiki/Arma_Reforger:Serialisation#JSON. it may support null, but maybe not, but it is more flexible for your use cases anyway. i could add null -> "" support if json standard intends it. normally string is a primitive type and null is for object types :/
string stringValue;
loadContext.ReadValue("key1", stringValue);
what value will stringValue have if "key1": null?
or loadContext will be invalidated?
I guess try if it works 🙂 context validity can be mostly ignored
yep it works, thanks
JSON is not typed so it's a bit moot
Having this weird replication bug, when first player attaches code lock and opens the door. Replication for the door state doesnt update. when second player gets added to the guest list. replication is then fixed.
Could this be due to the first player being given owner of the entity? im assuming I should pass it back to the server after the rpc is completed.
Hi, I'm new to scripting in reforger, but making a very basic mod to allow slow focus pulling as an extension to SetFocusToCursor in SCR_FocusManualCameraComponent, just have a question about structuring the modded file...
If I'm overriding an init or exit method where the order of operations seems important, do I use super.EOnCameraInit() and append the added/modified code, or do I have to replace the code entirely with the additions/modifications in their relevant position within the code?
Trying to learn best practices to avoid having to rewrite entire functions if things get deprecated in future, and keep my patches small.
super will run the code in the function* you are overriding
ok so replacing it is, thanks!
Hey, does onyone know of a way to get the base character entity a BaseInventoryStorageComponent is being used in?
im using OnItemAdded to basically filter out a item being picked up from certain players, but need a method to find out the parent character entity from a BaseInventoryStorageComponent on a character/storage entity.
nvm, found that spamming GetRootParent() from the BaseInventoryStorageComponent owner entity works.
Why are you doing it so low in the hierarchy?
If it's specifically for characters do it in SCR_CharacterInventoryStorageComponent
Has anyone encountered something similar? When running locally everything is fine, when I run dedicated under a character the models hang
If your entity type doesn't have any RPC or RPL_PROP or RPL_CALLBACK like OnRplSave or OnRplLoad, it will not be considered as replicated, so you will not be able to do that. Since RplComponent is handling the replication of the entity itself, it has already that, so it is safe to assume that using the RplId of it will always work
if im updating an entity and that update should only occur on certain user actions, using rplprop and replication.bumpme() is fine right? especially since replication.bumpme() is only called when values in my rpc are able to be changed?
Hello fellow scripters,
i have a trouble where people are spawning to fast attack chopper after dying, therefore infantry gameplay is ruined becasue there is to much chopper in the air.
i notice after spawning a vehicule you have to wait 300 secondes but i dont know where to modifiy this value
1st idea was to play with the cooldown in the editable compnent (first pic) but if i put something diiferent than 1 i cant take out the vehicle
2nd idea was to look inside of the base code and i found that rank has an effect on a cooldwon but i am not sure it's the cooldown link the spawning a vehicle (i have came across a setting in the conf file of a faction (pic 2) but i haven't tested to change it
i have seen two other people asking and never get an answer so i was wondering if anyone find some info on it ?
thanks a lot
Edit: the request CD line play on the cooldownb of the vehicle
for the moment we cant make that for each vehicule but at least it's global
?
What is the call for wait/sleep in enfusion? I need to delay a part of my script by 10 seconds.
GetGame().GetCallqueue().CallLater(<function>, 10*1000, false);
you can call a fucntion later
That's what chatgpt said as well, but it wouldn't work in the context of the script I'm in.
Then you'll have to make it work within that context because we don't have wait or sleep functions.
CallLater is all we have unfortunately.
Maybe think about it like this. You need to reshape the problem to where callLater will work
I also wonder, how does it not work?
If nothing else, split the function in 2, and pass the needed context through callLater, yeah?
Is .SetLocation(ESystemLocation.Server) supported already? Seems like my system still being created on a client.
Is it not possible to update vehicle physics via script in a server/client setting? It seems no matter what I do to try and replicate, the vehicle's physics does not update on the server if a client is the one activating the effect.
Works fine locally but not on client/proxy
what exactly isnt working in the videos
Does anyone know why this might not be working? I expect it to print the name of the entity in console when I take control of it, but it does nothing:
modded class SCR_CharacterControllerComponent
{
override void OnControlledByPlayer(IEntity owner, bool controlled)
{
//m_OnControlledByPlayer.Invoke(owner, controlled);
super.OnControlledByPlayer(owner,controlled);
Print(owner.GetName());
}
}
GetName doesn't do what you think it does.
It looks like the use of it is what was causing the print to not run at all, or was running but empty and didnt show. Yikes, thanks for that heads up.
Do you know of a way to get the prefab name or id of the entity? I want to only do something if the entity is my custom character.
I was trying to originally use a custom component with EOnInit or OnPostInit but I don't know how to delay their execution until the player has controlled the unit.
owner.GetPrefabData().GetPrefabName()
Thankyou! Do you happen to know anything about how it might work with the component? I figure it will be better to only run the code on my character, and not run a check on every single character I spawn
are you just trying to get the name of the character/player?
He needs the prefab name to compare to his prefab
For the component, I would like to have a component on my character that waits until a player is controlling that unit for it to run.
If you're familiar with arma 3 modding, it would be like an init on that player class that had an exitwith if no player was controlling it
If code block I sent is the only way to do it with OnControlledPlayer then thats fine, but using a component would be cleaner I think
Then in your custom component subscribe to SCR_CharacterControllerComponent.m_OnControlledByPlayer
Do you think you could provide an example line of code? Im sorry, I have no idea how to do that
find your charactercontroller component. then charactercontroller..m_OnControlledByPlayer.Insert(function)
i think thats how you would.
So I do it through the character prefab then and not just a line of code?
if (charComp)
charComp.m_OnControlledByPlayer.Insert(testfunction);```
Zelik can correct me if im wrong but it would probably be like that.
I will give that a try, thankyou very much!
The first video the vehicle isn't getting pushed forward on the client side. The second is it working properly on the server side
How do you propel it forward?
Physics.ApplyImpulse()
Server Authoritative Vehicles will make this difficult, you need to apply impulse on owner and server, and it will be laggy.
Sorry to jump in but do you know what resource causes this to be laggy? Is it like better CPU or more RAM on the server or anything like that would help it? Or is it just bandwidth or what
Or just a limitation of the engine?
It's because the server and client disagree on the physics state, so the server "corrects" you
Like interpolation or whatever
Or lack thereof something like that I don't know haha
Just curious if there's any way to address it. Like if you modify the server tick rate or something
you can look at the way I did airplanes. Essentially I just wrote my own networking component to not deal with server authorative issues. I just broadcast the position/orientation from owner to proxies&server
Can someone disable this stupid assert.
Where i should store VoN characters now?
When spawning an entity and then calling SCR_EntityHelper.SnapToGround, why doesn't the function replicate to clients if the spawned entity is a firearm?
It works with everything else, including grenades. Just doesn't replicate to clients if the spawned item is a firearm.
Also setting the items YPR doesn't replicate to clients if its a firearm either.
I tried this and unfortunately it did not work :(
I got the error : Cannot convert 'void' to 'OnControlledByPlayer' for argument '0' to method 'Insert'
And when I modified the code to look like this: charComp.OnControlledByPlayer().Insert(StartSpectate(owner)); it gives me: Method 'OnControlledByPlayer' is protected
You're entering it as a "function call" and not as a function.
Yup saw that, however its giving a not compatible with prototype error now. Ill share the code
SCR_CharacterControllerComponent charComp = SCR_CharacterControllerComponent.Cast(owner.FindComponent(SCR_CharacterControllerComponent));
if (charComp)
{
charComp.m_OnControlledByPlayer.Insert(StartSpectate);
}
^ the OnControlledByPlayer void takes two parameters, but when I tried to add said paramaters, like this: charComp.m_OnControlledByPlayer(owner, true).Insert(StartSpectate);
It gave an error and said the m_OnControlledByPlayer function didnt exist
Ah I've got it to stop erroring by adding the parameters to the function im inserting instead.
Looks like it still fails when used in EOnInit but does work in OnPostInit That's good enough.
Thanks for all the help!
well eoninit is instant, postinit is after everything is setup. so its probably trying to call the script before anything exists.
class TestcharComponentClass : ScriptComponentClass
{
}
class TestcharComponent : ScriptComponent
{
//------------------------------------------------------------------------------------------------
override void OnPostInit(IEntity owner)
{
SCR_CharacterControllerComponent charComp = SCR_CharacterControllerComponent.Cast(owner.FindComponent(SCR_CharacterControllerComponent));
if (charComp)
charComp.m_OnControlledByPlayer.Insert(PrintName);
}
void PrintName(IEntity owner, bool controlled)
{
PrintFormat("%1", owner);
Print("Test");
}
}
Could someone help me out here
Not sure why it refuses to compile? I’m not very scripted savy. (Backstory, I’m trying to use Naomyths F-4 in our server)
Is this a “my” side kinda issue or no?
what is the best method for declaring a position on my component? pointinfo then getting the transform?
Mod conflict with WCS and Gregs NVGs
Maybe not between the two but they both have possible variable name conflicts
so i got a good ol question, how would i allow a mod to create a console command for a server, or is that not a thing
Am I blind, is there a way to have a pointinfo get position info from entityslotinfo on another component? Or is there a good way to set a vector in one component and have multiple position contexts read from that?
I was thinking about getting the vector from the entityslotinfo but I’m unsure the best way to go about this.
Or if there is a way to have pointinfo context stay static and now follow an object when it moves.
Hello, I try to make a cinematic shot, but my soldier won't walk, and the weapon is on the ground. I use a script event with this code:
`class Troops_Class: CinematicEntity
{
void OnKeyFrame_ScriptEvents_0()
{GenericEntity soldier = GenericEntity.Cast(GetWorld().FindEntityByName("soldier"));
CharacterControllerComponent c = CharacterControllerComponent.Cast(soldier.FindComponent(CharacterControllerComponent));
c.ReloadWeapon();
vector direction = {0,0,1}
c.SetMovement(2. direction);}
};`
can anyone help me?
Hey, you need an actual player character with movement components and such, this is just the sample character you can pose
do you mean the Character_US/USSR... prefabs?
Any of these
They still have a loadout component so you can dress them however you like
doesn't work either
I’m encountering an issue when sending a chat message to the server via RPC. The received data appears multiple times instead of just once. How can I send it a single time without broadcasting it to other clients?
modded class SCR_ChatComponent {
override void OnNewMessage(string msg, int channelId, int senderId) {
super.OnNewMessage(msg, channelId, senderId);
BaseChatEntity channel = BaseChatEntity.Cast(GetGame().GetChat());
LogChatMessage(msg, senderId, channel.GetChannelName(channelId));
}
}
Is there still no method to log chat messages on server without sending them via rpc from clients?
Where is the RPC?
Check if the replication is server. As well.
Not super familiar but onnewmessage might fire off for every client that recieves a message
yeah, i think main problem is that. i will try to do it in previous callbacks
Not sure how ownership of messages is handles haha, guessing that component exists for every player so you'd want to avoid RPC unless you compare senderId to current player
So that way each player only RPCs if the message was sent by them
That is if the server can't see them at all like what bacon was alluding to
Send the Log then super? Nvm, I see what's going on
modded class SCR_ChatComponent : BaseChatComponent
{
//------------------------------------------------------------------------------------------------
override void OnNewMessage(string msg, int channelId, int senderId)
{
BaseChatEntity channel = BaseChatEntity.Cast(GetGame().GetChat());
if(SCR_PlayerController.GetLocalPlayerId() == senderId)
Rpc(Authority_LogMessage,msg,channel.GetChannelName(channelId),senderId);
super.OnNewMessage(msg,channelId,senderId);
}
//------------------------------------------------------------------------------------------------
[RplRpc(RplChannel.Reliable, RplRcver.Server)]
void Authority_LogMessage(string msg, string channelName, int senderId)
{
string playerName = GetGame().GetPlayerManager().GetPlayerName(senderId);
Print(string.Format("[%1] %2 :\n\t%3",channelName,playerName,msg));
}
//------------------------------------------------------------------------------------------------
}
Yeah! this is how its done 😄 thanks
it work very well now. im so new to this game scripting still feels good
Since null checks are like 30% of my code, I wish there was a short circuit operator
Or something to avoid the boilerplate of assigning a variable and checking if it's null every 5 seconds
Anybody knows if Enfusion will support dll imports in the future ?
I made several useful tools and mods using dlls on Arma 3 and it would be great if i could reuse them on Arma 4
Not without breaking the EULA atm
Oh my god, i hope it will change. My entire project depends on the possibility to migrate to Arma 4
Or something like assignment expressions, or something like the walrus operator in python, etc
Is there a way to reference another components positioninfo .ie pointinfo or entityslotinfo. without rewriting a pointinfo script.
Same for downcast and auto - it's annoying to write SCR_FkingLongNameComponentOrEntnityShfbjaucbdjiwdjhcusiiqjsjcjcnjs 3 times
I upgraded to a super ultrawide for this
Unlikely to come. Considered nonsensical gimmic by those who decide if they want to add it.
If at all then only for dedicated servers. Unlikely ever for clients no matter which platform. Any third party service integration can already be done via remote (or local) web server and http protocol. No direct memory access transfer of data. No injecting of code that manipulates our engine based on reverse engineering.
Does GetOnPlayerKilled just not fire for a registered client when they crash a helicopter with component on it? Too sleep deprived to put together an isolated test but I am registering it on clients and it just won't fire, yet OnControlledEntityChanged does...
is it expected that user will copy attributes of the class he mods?
//[BaseContainerProps(), SCR_BaseContainerCustomTitleEnum(EEditableEntityState, "m_State")]
modded class SCR_FriendlyEditableEntityFilter
{
}
this always results in a whole workbench hanging for me at 99% when switching to game mode
works fine after uncommenting the attribute 🤨
Yes without it you are kinda modding the attributes out
I guess it kinda makes sense as modded is basically inheritance under the hood.
Is there anyway to dump all the prefab IDs used in any of the mods loaded on workshop? Assigning names manually is rough, definitely looking for an easier way
I had a thing for that
Cant find it tho
There are resource browser methods in Workbench, you can make a workbench plugin
Thank you ill look into that
I am trying to run this code from within a function that is being inserted into an event, however the CreateCamera never runs. Does anyone know why that might be?
J3FF_SetCamToFP instance = new J3FF_SetCamToFP();
GetGame().GetCallqueue().CallLater(instance.CreateCamera, 1000, false, _unit);
Im basically trying to call a method that doesnt exist in this file via a callLater
I was able to get it working by having an inbetween method, however I'd like to avoid this if possible. Does the CallLater command just not allow for you to call methods outside the current code scope?
Got it, just need to refine my searches. Thank you ❤️
Hmmm, i see. The problem is i won't be able to communicate over servers, use megaphones, pdf viewers and writers, text editors, voice recognition systems. I'm also working on overlays, for dental operations and surgery... it's sad to know i won't be able to reuse them on Enfusion... If we can't import DLLs, we at least need to be able to execute external applications with parameters and read output
What
?
Nevermind i forgot about the remote server communication thing. I could still make a local server execute other applications and read data from the local server
Just impressed by the complexity of your use case
So far, i haven't seen anyone using Arma 3 or Enfusion on the way i'm using it. It all started with a megaphone idea ^^
Hey folks, anyone have some guidance on getting the matching UID(reforgerid) to player number/ID? Ideally if it can be done client side by an admin?
Got a script working to move a players coordinates when I provide a name/number but not found a good system for UID
You can only get the player UID from the server, you get it from the backend api
If I’m already providing the UID as an input client side, is there a way to do it client side?
Matching that to a player number/id that is
You can't be providing the UID client side because the client can't get the UID
You might be providing the player id client side.
Manually getting the UID from BM RCON. Use case for reference is moving the camera to a specified players coordinates. Client chat command Examples:
#movecamera uid/forgerid
#movecamera playername
Player name or ID(number) works fine and moves the camera to the coordinates. I can match the UID to a player id on the server side but it fails to move the camera on the client side which I’m wondering is a timing related issue
#id Gets the local players id
If you're getting the uid from the player id, you'd then have to pass it to the client.
Hii, how can I make the character always spawn with a specific loadout? Right now, they spawn with a random loadout from the faction's loadout list
I have the match working fine:
SCRIPT : [GM Tools] Reconstructed identifier: '7cf4a162-92d0-41ca-8808-2e9432124328'
SCRIPT : [GM Tools] Processing identifier: '7cf4a162-92d0-41ca-8808-2e9432124328'
SCRIPT : [GM Tools] Identifier appears to be a Reforger ID
SCRIPT : [GM Tools] Searching for player with UID: '7cf4a162-92d0-41ca-8808-2e9432124328'
SCRIPT : [GM Tools] Found 1 connected player(s)
SCRIPT : [GM Tools] Player 1 (Hovi) has UID: '7cf4a162-92d0-41ca-8808-2e9432124328'
SCRIPT : [GM Tools] Found exact UID match for player 1 (Hovi)
SCRIPT : [GM Tools] Player position: <10166.047852, 2.619999, 1539.677979>
SCRIPT : [GM Tools] 'Hovi' moved camera to 'Hovi' (ID: 1) at position 10166 2.62 1539.68```
But for whatever reason client is not moving the camera to that position. My only guess is that because its doing that match server side there and there's some timing issues with the position being reported to the client? I'm doing a little rewrite here to see what I'm missing but I've been bashing my head against this for a couple of days now
That has nothing to do with scripting. Change the values on the gamemodes SCR_RespawnSystemComponent
Who is moving the camera?
Client?
Is it possibly to change the mesh object of a prefab in runtime?
I believe not, yeah?
Yes
ty so muchh
yes to the first question, or the second question?
Hmmm, basically I just need the mesh to go invisible on an action. So if there's better ways to do so, I'm open to ideas
Depends on what it is really
It's a vanilla crate model, this one https://enfusionengine.com/api/redirect?to=enfusion://ResourceManager/$ArmaReforger:Assets/Props/Military/SupplyBox/SupplyCrate/SupplyCrate_01_item.xob
I think there's some way to do it through an animation component or something, but it doesn't have an armature/skeleton so it doesn't work
I don't mean, what the xob is lol
Oh sorry, misunderstood
entityflags?
clearing the VISIBLE EntityFlag only hides the mesh. Actions and colliders are still there
gotta destroy the physics too
ahh
RplSchedulerError: Generated task provided id of removed or never registered item! id=0x80004E48
Has anyone ever encountered this error? and if so mind sharing what steps you took to fix it? I believe its been causing a lot of FLOODED/STALLED crashes that we've been getting
I have code that looks like this, but I feel like I could do this easier with casting, however I don't know enough about it. Would casting be better here? And how would I go about it?
PlayerManager test = new PlayerManager();
array<int> _players = {};
test.GetPlayers(_players);
GetGame().GetPlayerManager();
Ah cool. How do you know to do that though? I can't seem to search that/its not a function within game
Yes I'm aware of that, thats what I was doing in the first place. I just meant that how you knew to get the player manager through GetGame()
Kinda just learn it over time tbh, I look at vanilla scripts a lot for reference
With practice of writing scripts comes learning the functions in the engine
getgame gets the main game class then you can get most of the managers from there.
Looking at vanilla script is the biggest thing. if you are trying to find how to do something. search for it there and look at related methods.
Alright, I'm pretty knew and finding the lack of wiki and ability to google to be pretty jarring. Thankyou for the suggestions
While I have you, do you happen to know of a way to get all units in general too? Like all AI as well
yeah it is super jarring. I havent ever coded before reforger well basic basic like middle school type stuff lol.
if you search on here too sometimes you will find good info. I found an obscure little issue I had that someone had a fix for a year or two ago.
also just so you have it in the back of your head. if something isnt working how it should even though you took the right steps. try restarting workbench. ive had to do that a few times because for some reason it started to glitch out.
Yup I've been searching this channel like crazy haha😂
configs seem like they require you to restart WB when you override them as well. idk I have a feeling my mod is very poorly coded but we will see when im done.
You can do it via api if you can keep data under 1MB
I'm having trouble accessing a variable from one script to another, here is the relevant code for both:
//SCRIPT 1
class J3FF_PlayerListMenu: MenuBase
{
protected ref array<IEntity> PlayerList_Entities = {};
void blablabla
{
PlayerList_Entities.Insert(test);
}
array<IEntity> GetPlayerListEntities()
{
return PlayerList_Entities;
}
}
//SCRIPT 2
class J3FF_SetCamToFP: ScriptedWidgetComponent
{
override bool blobloblo
{
J3FF_PlayerListMenu playerListMenu = new J3FF_PlayerListMenu();
array<IEntity> PlayerList_Entities = playerListMenu.GetPlayerListEntities();
}
}
In the second script PlayerList_Entities is an empty array. I tested my getter in script 1 and it returns correctly, just not in script 2. Any suggestions?
you are creating a new list menu, which might not be populated? Unless you are dong so in a constructor, you have created a new instance
What you could do instead is array<IEntity> PlayerList_Entities = J3FF_PlayerListMenu.GetPlayerListEntities();
Trying this resulted in the error: Trying to call non-static function 'GetPlayerListEntities' as static. And I can't set that method to static because it can't access the variable it needs to return then
is the widget in your menu?
you can do findhandler, findanywidget etc to get the widget or get a componet on a widget.
m_EditBox = SCR_EditBoxComponent.Cast(rootWidget.FindAnyWidget("EditBoxMain").FindHandler(SCR_EditBoxComponent)); this is inside my menu. to get the component. then you can run methods from m_editbox.
Still cant thank you enough for this. The amount of time saved is insane, fairly certain theres like 2.5k-3k items that i wouldve had to enter manually.
does anyone know, can i add WBData to my project? How can i do this if i can?
I want use own "png" file in workbench in another addon that uses addon with this "png" files.
I created "WBData" directory in project directory and import "png" there, but "png" files disappeared in addon after publish ("edds" files left only).
If I'm attaching/spawning a entity at runtime, would it be better to set the slot to the slot manager or set the entityslotinfo in the actionmanagers context action context?
Where can I find this? Been looking through your airplane stuff and have yet to see any reference to a network component
Project Redline: Core. Contribute to ralian/R3D_CORE development by creating an account on GitHub.
The first script is the menus function, my content is within the OnMenuOpened method. The second script is a component in the menu, my code is within a OnClick method (its a button). So i already have the widget there. Im not sure how that helps though :(
you can cast the widget and then cast data to and from your main menu.
I'm sorry, I'm having a hard time understanding this. Within the OnClick override bool in my second script I have access to the widget im clicking with w. And the menu's scrip, script 1, has a method in it called GetPlayerListEntities. Do you think you could provide a small example for how casting would get me the array result from that method?
I thought I had it like this, but unfortunately it still returns empty:
MenuBase test1 = new J3FF_PlayerListMenu();
J3FF_PlayerListMenu test = J3FF_PlayerListMenu.Cast(test1);
array<IEntity> PlayerList_Entities = test.GetPlayerListEntities();
you could have your main menu send to your widgetcomponent. you are trying to populate the widgetcomponent?
I'm not trying to populate the widget component, I just want to get the contents of an array that was defined on menu creation so that I can use it
What im doing is:
Create menu, create widgets within menu (buttons) create array and insert value of button into it,
Then when said button is pressed I want to get the value associated with it by getting the defined array and selecting it based on the buttons index
this is super crude but try something like this.
array<IEntity> playerarray;
void OnMenuOpen()
{
TransferEntityArray(playerarray)
}
void TransferEntityArray(array<IEntity> arraydata)
{
testwidgetcomponent widget = testwidgetcomponent.Cast(rootwidget.findanywidget("widgetname").findhandler("testwidgetcomponent"));
widget.InputEntities(arraydata);
}
// widget
array<IEntity> playerarray = {};
void InputEntities(array<IEntity> arraydata)
{
playerarray.Copy(arraydata);
}```
basically have the method in your widget, call on a method on your menuopen, find the widget and the handler on said widget. cast the widgetcomponent. run the method you set up inside the widget to send the array from your menu to the widget.
im sure there is another way though.
I tried entering your code and some modifications had to be made, like adding ref to the array definitions and I swapped out the rootWidget.FinyAnyWidget("widgetName") with my widget that I create.
I got it to not give any code errors now, but I don't know what to pass to InputEntities it needs an array paramater to represent arraydata
you are passing the array from your menu?
im not super skilled so im trying with what I know.
The client moves the camera since. Finally got it working, server provides finds the player match and position, provides it to the client in a server command result, client parses the position from the chat and moves the camera to that location.
@shadow oxide See how this gets the component, then im able to run a method through that casted component? if you look at editboxcomponent, there is ways to set and get values. you should be able to do something similar with your situation. instead of getvalue youd set your array. and have it be copied in your method.
you could add me and show me your menu hierarchy. maybe thats where an issue is.
m_EditBox = SCR_EditBoxComponent.Cast(rootWidget.FindAnyWidget("EditBoxMain").FindHandler(SCR_EditBoxComponent));
if (m_EditBox)
{
}
protected void ValidateText()
{
if (!m_lockManager || !playerID)
return;
string text = m_EditBox.GetValue();
}```
I'll send you a dm with a broader view of my code, right now im not following how that code block will help
hi im trying to make a script that checks if a player is within a zone and but how can i see what faction that player is in?
what about BaseGameTriggerEntity?
Faction GetFaction()
inside SCR_ChimeraCharacter
might also help 
how do i go about making a callback function?
You cant pass functions as parameters to your own functions, only those made by BI
How do you bind user input to execute code?
In ArmA 3 we had CBA
CBA_fnc_addKeybind
["ADDON_NAME", "ID", ["NAME", "TOOLTIP"], {//CODEDOWN}, {//CODEUP}, [DIK_KEY, [SHIFT, CONTROL, ALT]], EVERY_FRAME_WHEN_KEY_DOWN, DELAY_ON_KEY_DOWN, OVERWRITE_OLD_CBA_KEYBIND]
User inputs 'x' -> Prints "Hello"
If of interest to the question I would like to bring up a layout when a button is pressed. (https://community.bistudio.com/wiki/Arma_Reforger:Layout_Creation)
Currently I am using the wiki code to execute on addAction.
you can call one using script callqueue and pass the function name as a string
https://github.com/Arkensor/EnfusionDatabaseFramework/blob/20c0fbf251fae89446a61fa511649850c29c0b52/src/Scripts/Game/EDF_ScriptInvokerCallback.c#L25
Arkensor creates his own helper around it in his database framework, but you can see on line 25 it just uses the script callqueue
is this only for BI methods?
nope, you can call it on any instance of a class
what would be a simple example of its implimentation?
didnt see your message i ended up using GetFactionKey()
TM
MyClass inst();
GetGame().GetScriptModule().Call(inst, "SomeFunction", false, param1, param2, param3);```
There are tiggers for that already
How to save variable on server, so it can read again on server restart?
like
bool Trigger0Activated=false;
SaveState()
{
Trigger0Activated=true;
SaveVariableToServer(Trigger0Activated);
}
ReadState()
{
ReadVariableFromServer(Trigger0Activated);
bool TriggerStatus=Trigger0Activated;
Print("TriggerStatus ",TriggerStatus);
}```
Found Grok solution looks like working if i restart Tools and then scenario
// Static variable for in-memory tracking
static int restartCount = 0;
// File name for saving the counter
const string SAVE_FILE = "$profile:restartCount.txt";
// Function to load the restart count from a file
void LoadRestartCount()
{
if (FileIO.FileExists(SAVE_FILE))
{
ref FileHandle file = FileIO.OpenFile(SAVE_FILE, FileMode.READ);
if (file)
{
string line;
if (file.ReadLine(line))
{
restartCount = line.ToInt(); // Convert the string to an integer
}
file.Close();
}
}
else
{
restartCount = 0; // Initialize if no file exists
}
}
// Function to save the restart count to a file
void SaveRestartCount()
{
ref FileHandle file = FileIO.OpenFile(SAVE_FILE, FileMode.WRITE);
if (file)
{
file.Write(restartCount.ToString()); // Write the count as a string
file.Close();
}
}
void Main()
{
LoadRestartCount(); // Load the saved value
restartCount++; // Increment after loading
SaveRestartCount(); // Save the new value
Print("Scenario has restarted " + restartCount + " times.");
}
Vibe Coding mods
Hello, I don't script but I have a little bit of understand of how code works in reforger, I'm animator, actually I create my animations based on the m/s set by the game. I want the game to use the m/s of the root of my animations instead of the linear m/s of the game setting. I don't think there is anything that I can do from the animation editor or the character component in the prefab. Is there anyone who know if it's possible to do it with a script, so once my animation tag or event is true, the script replace the external root motion set by the game by the actual root bone (Entity position) of my animations ?
I just want to know from programmers point of view if this is doable and with what reforger script this should start :3
Actually the entity position bone is the root, but it's just serve to tell where is the character in the space, If I move the entity position with the character, the character stay in place in game. If I move the character but not the entity position, the character move in game but once the animation is finished, the character will snap back to the entity position.
yea like this #enfusion_scripting message
you could use script invoker I think, and get the bone local position, convert to world space, and then on server, move player to that position
no idea on specifics
There is Animation utility if you look that up in the script tools
Okay thank you
can someone explain me how to activate this box? it not show up when i write the code
FileIO.FindFiles(folderPath2, files, FindFileFlags.FILES);
scripts/Game/6467360649B45BBC/PersistentRankl.c(94): error: Can't make callback from unknown method 'basePathStr'
scripts/Game/6467360649B45BBC/PersistentRankl.c(103): error: Can't make callback from unknown method 'folderPath1'
scripts/Game/6467360649B45BBC/PersistentRankl.c(111): error: Can't make callback from unknown method 'folderPath2'
How would i bypass this
it should just appear when you type. its only going to show data that is available globally or within your class structure though.
whats the most efficient way to cause a method to pulse a few times? just using calllater on a reset method?
hello everyone, long time lurker, first time modder/poster
Desperately need some help in my script IM trying to make. I want to make a ghost camera spawn and owned by the player that they can fly around until the GM/zeus spawns them back in
I made a script basic and not sure what to do next on how to test it/build it/anything..
Overriding the SCR_GetInUserAction to prevent getting in when the vehicle is locked, and on Peer, the override seems to work fine on the front vehicle doors, but not the rear ones..? Both work fine on server
Here's my override: ```cs
modded class SCR_GetInUserAction : SCR_CompartmentUserAction
{
protected CONVICT_VehicleKeyLockComponent m_pCONVICT_KeyLockComp;
//------------------------------------------------------------------------------------------------
override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
{
super.Init(pOwnerEntity, pManagerComponent);
m_pCONVICT_KeyLockComp = CONVICT_VehicleKeyLockComponent.Cast(pOwnerEntity.FindComponent(CONVICT_VehicleKeyLockComponent));
// failsafe in case it's an entity in a slot containing the action for some reason lol
if (!m_pCONVICT_KeyLockComp && pOwnerEntity.GetParent())
m_pCONVICT_KeyLockComp = CONVICT_VehicleKeyLockComponent.Cast(pOwnerEntity.GetParent().FindComponent(CONVICT_VehicleKeyLockComponent));
}
//------------------------------------------------------------------------------------------------
override bool CanBePerformedScript(IEntity user)
{
if (m_pCONVICT_KeyLockComp)
{
// Check if vehicle is locked
if (m_pCONVICT_KeyLockComp.IsVehicleLocked())
{
return false;
}
}
return super.CanBePerformedScript(user);
}
//------------------------------------------------------------------------------------------------
override bool CanBeShownScript(IEntity user)
{
return CanBePerformedScript(user);
}
}
I've been searching around for a way to create an invisible slot on a character, and give a gadget when a player enters a vehicle, and remove that gadget when they leave the vehicle. How possible is this and what would the best way be to go about it? I don't want to potentially mess up other systems that rely on slots ideally.
what action is linked to those doors, might be using different action context that is not using your scripted action context?
It’s the SCR_GetInUserAction, I believe. It works fine on server, but not peer, which makes me believe it’s a replication thing, but I’m not sure how…? And why front would work and not back on peer
So if you are not using replication, some actions that are processed by components will not propagate to peers, like if a variable (isVehicleLocked) is set by one player, but for other players it is still false - you'd need proper replication (RplProps) to address that, but that really doesn't seem like the core of this issue if the front doors are locked
I noticed you have something which checks to see if action is embedded in slot manager, so if that is the case for the rear doors, that logic might not be finding the component correctly?
Which seems like it should but adding to debug logs would help narrow it down a bit
I was thinking this.. but odd that it'd work fine on server, but not on peer? And it seems to print the component fine in peer logs when I look at the action context
I think it's something beyond the specific action, because I additionally get the Open action for the door, which is an entirely different action
Are you rpcing the variable that's controls if the vehicle is locked.
If only the server knows that value then of course it will only work on workbench and not on a client
yes, it is setup as a RplProp
Which it should be known on peer, because the front doors can't be accessed lol
just not the rear ones
I think it's something with how the rear seats are setup, maybe, because they contain the get in action for the rear, not the vehicle itself. And I just don't see how I've not accounted for that already, but it seems to be accounted for on server, just not on peer.
I'll have did it like in the video, normally it should shown but it doesn't
Only like float or cases appear
By calling the method with the correct parameters. There are no flags for findfiles, there is only callback for results and path to search in
/*!
\brief Find files with extension in given path on all FileSystems accessible for game
@code
array<string> files = {};
FileIO.FindFiles(files.Insert, "configs/", ".conf");
files.Debug();
@endcode
*/
static proto bool FindFiles(FindFilesCallback callback, string path, string ext);
Is there anyway to spawn prefabs on top of buildings
vector initialLocation = {grid1, 1000, grid2};
SCR_TerrainHelper.SnapToGeometry(finalSpawnLocation, initialLocation, {}, GetGame().GetWorld());```
It seems that this still spawns it only on the ground rather then on top of actual geometry
Is there something i can do to fix this or what exactly is the problem here?
RPL (E): RpcError: Calling a RPC from an unregistered item! itemType='script::Game::SCR_ChimeraAIAgent', rpc='RplFireteam'
//------------------------------------------------------------------------------------------------
[RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
protected void RplFireteam(RplId fireteamRplId)
{
Managed fireteamRpl = Replication.FindItem(fireteamRplId);
if (fireteamRpl)
{
SCR_AIGroupFireteam fireteam = SCR_AIGroupFireteam.Cast(fireteamRpl);
if (fireteam)
m_Fireteam = fireteam;
Print("SCR_ChimeraAIAgent > RplFireteam" + " > " + fireteam);
}
}
The Rpl is infact in SCR_ChimeraAIAgent class.
Try SCR_EntityHelper().SnapToGround()
Could be that you are calling it too early, like during OnPostInit or EOnInit, so the entity is not inserted into replication yet
This could rly be the case!
Thank you, will try to delay it. 👍
Probably a very stupid question, but can you tell me if the calls made through GetGame().GetBackendApi().GetPlayerIdentityId are somehow cached for repeated requests or not? I want to make for my server a small addon for ServerAdminTools to return their GUID in addition to player nicknames.
I think they are in memory from when the player joins the server and authenticates
no backend call is made here I think
the output has always been instant for me
So it shouldn't negatively impact server performance?
correct
admin tools even saves the connected players to json file
using this I think
Hmmm, will look into that possibility now, sounds more interesting. Thanks for the help 🙂
in stats json file
Do not use call later, do it on RplSave if on auth. Or RplLoad if on proxy/owner
Is character limit of string.Format removed in upcoming update?
1023 is not nearly enough
How do I hide everything that isnt my mod in here? I only want to see my scripts here

Not in 1.3, in the next major update after
What about a markdown parser lol
Yeah call later was pretty much my master plan.
Alright will check the Rpl stuff.
Thank you. 👍
Nein. Write your own in script
Lol no
@torn bane sorry for ping, but does EPF_PersistenceComponent::GetPersistentId(IEntity) need to be rpc'd? Or what could I be doing wrong?
string vehicleUID = EPF_PersistenceComponent.GetPersistentId(vehicle);
``` gives me a null error on peer
here's the full error
00:49:15.741 SCRIPT (E): Virtual Machine Exception
Reason: NULL pointer to instance
Class: 'EPF_PersistenceComponent'
Function: 'GetPersistentId#2193876'
Stack trace:
scripts/Game/EPF_PersistenceComponent.c:73 Function GetPersistentId#2193876
scripts/Game/EPF_PersistenceComponent.c:66 Function GetPersistentId
scripts/Game/CONVICT/Components/Items/VehicleKey/CONVICT_VehicleKeyComponent.c:61 Function IsVehicleCompatible
scripts/Game/CONVICT/UserActions/Vehicle/CONVICT_UnlockVehicleUserAction.c:58 Function CanBePerformedScript
scripts/Game/CONVICT/UserActions/Vehicle/CONVICT_UnlockVehicleUserAction.c:77 Function CanBeShownScript
The whole system is server side only. Clients have no knowledge of persistence
So the answer is yes, it needs to be broadcasted to peers?
Where we at with collapsing code blocks?
Eh, ideally not. What is a client supposed to do with it? Best to use the proper RplId to refer to things on the client
Essentially, I'm trying to verify the persistent Id of a vehicle to a stored vehicle persistent Id on a key (to match the key to the vehicle so it can be locked/unlocked). If there's a better way you can recommend, I'm open to examples 😅 Just mainly stuck on the replication part, which always trips me up
Checking the key should be done on the server anyway. If needed I would replicate the entity I'd of what the key can unlock or vice versa and not the persistence id. It's much more data to replicate
How would I track it across restarts then if using the entity Id, because it resets right? I guess that's the whole reason I'm using the persistence Id
I can try and find my modid for you to download on how I have achieved it. (Away at work, not access at the minute)
Basically, when a user finds a 'key' from looting, they can walk up to any vehicle they find, and "cut a key". This action generates a random uid for the vehicle and key (which links them) and then the lock/unlock actions show and can be performed if the keyid and vehicle I'd match.
yeah, I'd appreciate it when you can! Almost exactly what I'm trying to achieve lol
Anyone have an example of adding a new reason to ArmaReforgerScripted.GetFullKickReason? Or a better method. For some reason my override doesn't seem to running at all
That's in PlayerManager isn't it?
How would one give a gadget to a player? Specifically surrounding vehicle context.
Anyone have some way to troubleshoot replication errors more in depth?
Getting: RplCorruptionError: Could not read stream header.
Which is followed by: Reliable channel's order sequence appears to be stalled. Terminating connection.
which is causing mass client disconnects
From memory there are some functions in the base charactercontroller class
I want to create a method to check player inventory and confirm if a specific item is present. I assume I would use the string of the entity name. this is what i have so far but it seems I am not using the correct functions to get the entity name of the inventory item...
protected bool PlayerHasItem(IEntity player, string itemName)
{
// Get the player's inventory component
InventoryStorageManagerComponent inventory = InventoryStorageManagerComponent.Cast(player.FindComponent(InventoryStorageManagerComponent));
if (!inventory) return false;
// Get all items in the inventory
array<IEntity> items = new array<IEntity>();
inventory.GetItems(items);
// Check each item
foreach (IEntity item : items)
{
// Compare the item's class name with the required item name
if (item.ClassName() == itemName)
{
return true;
}
}
return false;
}
no on server you use the id, server knows this key unlocks this vehicle by persistence ids. but to the client you connect them via rplids after loading the entities. Design your systems like persistence would not exist and its supposed to be all during one session - and then save and load that with the least amount of effort. Why? Because if you start to hard rely on specifics of how persistence works, changes to its behavior because e.g. you switch to a different underlying database storage might fuck you over big time.
Your idea is not wrong, but a few things:
ClassName()refers to the entitiy class, which is no longer the same as in A3. So you usually get GenericEntity for all of them. In AR prefabs are usually the thing you are looking for.- When dealing with prefabs it is best to pass around ResourceName and not just plain string, as it can cause bugs when mixing them without great care.
- Always spend an extra 1-2 minutes scrolling through the available class apis and search by some names you would expect the methods to have. What you would have found are these:
InventoryStorageManagerComponent.GetDepositItemCountByResource()or thisInventoryStorageManagerComponent.CountItem()
protected bool PlayerHasItem(IEntity player, ResourceName itemPrefab)
{
// Get the player's inventory component
InventoryStorageManagerComponent inventory = InventoryStorageManagerComponent.Cast(player.FindComponent(InventoryStorageManagerComponent));
if (!inventory) return false;
SCR_PrefabNamePredicate searchPredicate();
searchPredicate.prefabName = itemPrefab;
int count = inventory.CountItem(searchPredicate);
return count > 0;
}
I see, Awesome. Thank you, just what I needed! Now I might be able to finally get this working.
side note...how you get discord to display fancy colors when using the ?
I appreciate the help!
counter strike syntax highlighting
There were also some bugs with it, I think 1.3 update fixes them already, if not the next major version would.
Beautiful...This method works.
I used these attributes
[Attribute("false", UIWidgets.CheckBox, "If true, requires the player to have a specific item to teleport")]
protected bool m_RequireItem;
[Attribute(ResourceName.Empty, UIWidgets.ResourcePickerThumbnail, desc: "Prefab needed to teleport", "et")]
ResourceName m_RequiredItemPrefab;
added some debugging to PlayerHasItem
protected bool PlayerHasItem(IEntity player, ResourceName itemPrefab)
{
if (!player)
{
Print("Player entity is null!");
return false;
}
InventoryStorageManagerComponent inventory = InventoryStorageManagerComponent.Cast(player.FindComponent(InventoryStorageManagerComponent));
if (!inventory)
{
Print("No inventory component found on player entity: " + player.GetName());
return false;
}
Print("Checking for item: " + itemPrefab);
SCR_PrefabNamePredicate searchPredicate = new SCR_PrefabNamePredicate();
searchPredicate.prefabName = itemPrefab;
int count = inventory.CountItem(searchPredicate);
Print("Found " + count + " items matching " + itemPrefab);
return count > 0;
}
The funny part is I thought it wasn't working then realized the item was in an RHS plate carrier and once I switched the item to my backpack, it worked. Makes sense, I may need to use an additional check with RHS class apis in mind maybe. Either way, I'm stoked. Thanks Again dude.
good point. I will test this out tomorrow, thanks 🫡
yea true, that way may be better for this use rather than CountItem
CountItem (InventorySearchPredicate predicate, EStoragePurpose purpose=EStoragePurpose.PURPOSE_DEPOSIT)
I will have to check but i assume the RHS plate carrier with the inventory has the PURPOSE_DEPOSIT ticked...
either way, Ill test the GetDepositItemCountByResource for sure.
Its the clown shoe slot
I have the same problem with a custom entity I imported...always stuck to my shoe when in inventory lol.
I'm starting to mess with EveronLife too, right on man.
Forgot that we added that. Correct, even better choice
Hi, new update sort of broke my mod in the enum ECurveType there was NaturalCubic but now its just CatmullRom and CurveProperty2D / any insights on this?
I asked about it a few months ago I guess its gone for good
Yep, since it is a UAV following a perfect circle I ditched the spline interpolation and added logic to cumpute the position using a circle parametic equation, so it will work with CatmullRom
Bro
doesn't make sense but works haha
You dont even need a spline for a circle its just pi times radius
Yes, I guess I wanted at some point to have the UAV deviate or look erratic instead of perfect
Ah yeah could do some kind of on rails movement
Equipped weapon is where each weapon slot on the char is stored. So 2 primarily. One hand gun. Two grenade slots
what are the prompts called in reforger? like anything that is floating. ie pickup item, close door. etc
no the actual ui prompts. i know what useractions are
yeah!
holograms?
i gotta wait for my game to update so i guess ill just wait to search lol
i managed to break my useractions on my prefab. no clue how but canbeshown is not being called now.
Was going to type up a question based around this because I was trying to use EPF for vehicle locking persistence, thank you for this answer and thank you Cashew for the question
may be ... auto test still works in 1.3
Best to copy the json you think works, and the class struct you want to apply it to and let me debug it. Can do it later, will be gone for ~1h
Also don't ping me on update day.
I know I have mods that break and I'll fix them.
I am sorry
@torn bane Is there a proper way to use the editboxfiltercomponent? I noticed some comments in the base script about it needing to be applied twice or something. Im getting SCRIPT (W): EditBoxFilterComponent used on invalid widget type. but its functioning as intended.
Anyone know how I would be able to go about troubleshooting replication issues? Like finding out what items are in replication and staying there. Feel like theres something stacking up replicated items but dont know what/where to begin troubleshooting
@torn bane Sorry for ping but while using EPF, how can I find the m_sId or _id of an entity? trying to use the component.GetPersistentId() method but it seems to return the actual component's ID for the session. What can I use to return the persistence ID for the entity itself? I cant seem to find anything, been at it for hours now :c
component persistence id is correct. the component has no id, its the one of the entity its attached to
Could my mismatched Ids that are returning be because I am modding the EPF_VehicleSaveData class by chance?
Mismatch sounds like you are spawning something new and not loading it back so it gets new ids assinged
Would i be able to accomplish this by putting a component.Load(vehicleEnt) in the EOnInit of my modded Vehicle class?
Thank you i'll look into it
SCRIPT (E): Virtual Machine Exception
Reason: Division by zero
Class: 'SCR_2DPIPSightsComponent'
Function: 'UpdateCamera'
Stack trace:
scripts/Game/Weapon/Sights/SCR_2DPIPSightsComponent.c:641 Function UpdateCamera
scripts/Game/Weapon/Sights/SCR_2DPIPSightsComponent.c:888 Function OnSightADSPostFrame
huh
Theres not even any division at that line
Why is VME lying to me
why... why... why is this now being enforced on people using this system. Why is this not a config option. 
Have looked at it and after some tinkering, im a bit more confused than before. In order to load I need the persistenceId from the vehicle, which is what i'm having an issue getting and trying to use the mismatched one it doesnt do anything.
Also if spawning the vehicle on server start is already handled, wouldnt these Load functions end up spawning the vehicle in a second time? Most if not all seems to end up with a .SpawnWorldEntity
when an update is made we need more of a clarification regarding actual changes. The update changed how sound events are handled and changed a variety of trigger based sounds
commmunication is much appreciated
what would be the simplest way to have a component call back to a menu?
SCRIPT (E): @"Scripts/Game/Destruction/ML_ModdedDestructionMultiPhaseComponent.c,24": Function 'ApplyDamagePhaseData' is marked as override, but there is no function with this name in the base class
SCRIPT (E): Can't compile "Game" script module!
Scripts/Game/Destruction/ML_ModdedDestructionMultiPhaseComponent.c(24): Function 'ApplyDamagePhaseData' is marked as override, but there is no function with this name in the base class
ENGINE (E): Cannot create new instance of World Editor because its dependent on working scripts
when running the script, this error, how could it be fixed?
well menus are local. the callback is based on if the passed value was accepted or not. I ended up just having the menu send a reference to itself to the component. then the component rpc's another method with the true or false statement, which calls back onto the menu function to tell it if the menu was accepted or not. Just avoiding having the correct value shown to the client. like a ghetto scriptinvoker i guess lol.
rplrcver.Owner. that will only send this call to the entity who currently owns the component entity?
now to just have it pass ownership back to the server on completion.
hmm thats a good idea. you basically rpc open the menu from within your component so there is no need to try to send it over.
would make closing the menu easier, especially since ill want to return ownership when the menu is closed.
ill look at it in the morning.
How do I clone the character entity?
Or rather, spawn a character and then apply the same loadout to it or whatever
Like spawning a player, when the serialized entity is unserialized into a newly spawned character
Good question, maybe our loadout code could be re-used but in general, it perhaps works if you json or binary serialize the char entity, know the prefab, spawn the prefab and spawn it and then load the context onto it. but if you mainly care only about eqipment and not all of the individual states of all the components, then perhaps a custom scrip to copy over prefabs is easier and faster
I am using ChimeraCharacter.et to create my own prefab entities, not sure if this might help you. Currently able to modify/add more config options to it as well as my own unique script.
Not sure if you remember my messages yesterday about the new update breaking after 1.3, Im trying to understand why my unique script is breaking more after the new update and for the life of me cant fix it. Any chance anyone here at this point able to work with the meshes in scripts as well as on event trigger for a death.
Dont have my code with me atm.. At work but will do my thing after work
Cant work on my project though because it just keeps crashing with zero useful logs
you n me both.. Current project breaks a bunch of editors..
I can fix script errors but I cant fix crashes with no logs
one of the worst bosses in the arma reforger gameplay which is often refered to as modding
It's frustrating. I want to start a project. Crash crash crash. Okay I guess I'll try doing something different. Crash and my prefab changes revert. Sigh. I should get hazard pay for this.
you're getting paid for this 
I wish
there isnt really any harm is letting a user client have ownership of a prop hey? I guess once the user shouldnt be able to access it ownership should be taken away.
Only if the player owns the prop
I just have the menu passed in the intitial request. with an rpc that bools true or false, and calls a method inside the menu.
with a ownership transfer method that is called whenever a player closes the menu or fails/completes a task.
rplprops are only updated by conditions in their params or by bumpme()?
ahh okay
lot of JIP errors since update :/
have to restart server after every RequestScenarioChangeTransition it seems (players encounter JIP errors and server seems to lose bi backend connectivity)
does other people use it with no issue ?
when I have multiple of the same item in my world. I get JIPError for some reason.
for resting id want to have my rpl state overide to runtime for an item?
18:21:11.029 RPL : ServerImpl event: connected (identity=0x00000000)
18:21:11.043 WORLD : UpdateEntities
18:21:11.043 DEFAULT : BattlEye Server: Adding player identity=0x00000000, name='JoJo'
18:21:11.043 DEFAULT : BattlEye Server: 'Player #0 JoJo (xxx:62298) connected'
18:21:11.043 DEFAULT : BattlEye Server: Setting GUID for player identity=0x00000000, GUID=76561198059231407
18:21:11.043 DEFAULT : BattlEye Server: 'Player #0 JoJo - BE GUID: 2666fa459cae7339e97f6edc99d0a019'
18:21:16.543 SCRIPT : ----- KOTH: CheckGameEnd BLU=0 RED=0 IND=0
18:21:25.809 WORLD : UpdateEntities
18:21:25.809 RPL : rpl::Pip::ProcessNetToGame
18:21:25.809 RPL (E): IReplication::JIPError: Inconsistent item table on Slave connection. Item is missing or different item was loaded in its place. (con=0x0)
18:21:25.842 WORLD : UpdateEntities
18:21:25.842 RPL : rpl::Pip::ProcessNetToGame
18:21:25.842 RPL (E): IReplication::JIPError: Terminating connection. (identity=0x00000000)
18:21:25.842 WORLD : UpdateEntities
18:21:25.842 RPL : rpl::Pip::ProcessNetToGame
18:21:25.842 DEFAULT : BattlEye Server: Disconnect player identity=0x00000000
18:21:25.842 DEFAULT : BattlEye Server: 'Player #0 JoJo disconnected'```
is there something we should know about Jip/Rpl from this update ?
Hi guys, who knows how to fix it?
what can we do with this playeridentity component
i see it adds some info when you hover over a player in GM
but is there a way for players to loot that from a body and read it?
whats the purpose other than gm info
yes
i saw that but how do i interract with it
how did you get to view that
yes how, you hover your cursor?
ok so mines broken
lol
thats why i was asking lol im like how tf do i see it
i guess zeliks character conflicts with the way it works
How do you hide UserActions until the requirements are met?
still appears sadly. im gonna try CanBeShown
Hii, how can I have infinite ammo? I want the magazine to maintain, for example, the maximum of 30 bullets, depending on each magazine, and when they run out, the player has to reload.
I don't know if to have infinite ammo while maintaining the maximum number of bullets in the magazine and reloading, what I should do is try to remove the magazine from the inventory when it reloads and add a new one that is full.
Do you know if there is a better way to do it?
How difficult would it be to implement a way to interact with an object (say a TV screen) and have it show different images? Similar to the ACE Slideshow system from the previous game?
Seems like a much needed QOL mod for milsim units
I use it just fine
that is easy, what you'd want to show is the hard part.
For example, does the mod come with the assets, do you update the mod for operations? Do you create a system that let's you type? Do you rebuild Slideshow creator virtually? Haha
@fringe prairie I suppose it would have to be the middle option - For the time being, where each operation is built in Enfusion we would need to add the images to an Asset folder and allow the 'system' to pull them from there
I've mostly been working on terrains so far, so not sure where to begin working on something like this. Do you know where I could look to start?
I have #1353365881933135893 which is APL - you can look at that for an idea. Basically the way I did it was putting a component on an object, and user actions which find that component and tell it to do stuff
component handles replication using RplProps, that way people joining/entering the area aren't desync with what pages are on, etc. You'd probably want to use something watered down in terms of complexity for this - just an action to turn screen on/off, a page switcher, and just load each layout based on page index/page config. Layout can be built pretty easily by hand in workbench, so you'd just have a generic entity or something with the screen attached to it via slot manager component - and just do everything to that screen
The key scripts to look at in MFDF are MFD_Power, and MultiFunctionDisplayComponent's TurnDisplayOn/Off, InitializeLayout, and UpdatePage functions.
@fringe prairie Thats really useful mate, thank you very much! I will look into getting started here and will post back once I've got my head around it! Appreciate it 🙌 🔥
yeah he just fixed it
It's been working since yesterday nightish haven't had an issue with it 
How can you RPC to a specific, potentially non-owner client without using Broadcast?
nvm
Hiya - question regarding api calls…
Can I add an Authorisation header? I can’t seem to find anything on the wiki todo with headers…
https://community.bistudio.com/wiki/Arma_Reforger:REST_API_Usage
Because I know it can’t do custom headers, but the Authorization header is standard in http requests
In case anyone wants to know users don't own radio components when they are holding them :)
I'll send example of header syntax in a moment
AFter the update we are getting this replication warning in the backend
01:28:21.410 RPL (W): IReplication::ReadPastBoundary: Item read past boundary of its written init data. item=0x800BF524, layout='script::Game::SCR_ExtendedCharacterIdentityComponent', initSize=18b, overBoundary=138b
is this something on Bohemias end after the update? If so is there anyway to properly report it, I know its just a warning but I feel like it may cause some more problems under the hood especially with the increase of Rpl errors we've been receiving
context.SetHeaders("Content-Type,application/json");
Headers is a string with key value pairs that alternate every comma, so basically:
context.SetHeaders("Content-Type,application/json,Authorization,Bearer adfjikafuidasfd");
Many thanks 🙏
Did you ever figure this out?
Eh I guess it can be 0 on peertool, seemed to work after testing more
but 0 evaluates to false so doing if(rplIdentity) will not run lol
Can't remember the enscript syntax ATM but you should be able to do a more explicit notnull condition to avoid the case of 0 being considered "falsy"
Yeah I figured, there is "IsValid" but not sure if that has same pitfall, I just needed the basics to get this to work because I was initiating an action on client that needed to be RPC to server
and despite many instances in this chat where "you should never need to do that", UI dialogs are client only so this was the only way of sending input to server
Yeah when trying to integrate Conflict deploy menu into my EPF-based mod I had to do something similar (replace deploy click handler with Rpc to CreateCharacter method on server) which seemed to work fine just passing the playerId, is there a particular reason you need to pass their RplIdentity instead of playerId?
Server owns the item and client renders UI, so owner is server and only owner can RPC to server
Basically there is component on item I need to process client input via GUI dialog
so the issue was really figuring out how to temp transfer ownership to allow the RPC and have server take it back once it gets that info
So checking for playerId wouldn't have gotten me anywhere because the server doesn't know anything about what the client inputted.
Morning, replication question: If i move a item from my player inventory into a vehicle trunk. And this vehicle will drive by another player. Who is the owner of the item? Myself or the driver?
Server I think based on what I just went through
But not confirmed, about to find out myself with some stuff I'm doing
The server
TY
should be in the profile defined by peertool config
So My Games > PeerPlugin1 > logs
At least for me
Pretty new to Enfusion myself so take with a grain of salt but what I've found so far is pretty much everything is owned by server except for specific client side things like UI/menus
Or things that are controlled like vehicles
Even then there is no escape from eternal void of server
I wish there was better documentation
notepad on windows 11 refreshes when window becomes active again
so tabbing to it means log should be up to date
not what you asked but best of what i know
Yeah driver seat occupant becomes vehicle owner but AFAIK any items in its inventory are their own Rpl'd entities, might be wrong but I don't think vehicle ownership change propagates to inventory entities?
probably not
So you probably still wanna test yourself or wait for someone more experienced to weigh in to be sure @serene fox but I think item put into vehicle inventory would become owned by server since it's no longer attached to client-owned playercharacter
Is this component on item?
Where is the component located, will inform the answer
I know how to proceed if it's a vehicle or a item, if it's attached to character I'm not exactly sure but if it's being treated like item, owner is server which is why the main client sees the menu when you RPC the owner.
Hm, what invokes close menu?
Do you happen to have a check that is accidentally returning early?
Regarding peertool - works nicely. I go back to main menu with it and want to test to rejoin the workbench server. Which IP/port should I use? 127.0.0.1:2001 does not connect nor to the actual IP.
might be in the initial server startup in the log console, I just close out the window haha since it launches a new window anyways when I start it again
You lost me here... sure, the peertool window starts again when press play in WB. I'm trying to test the situation when a player joins a server after some time.
I tried. Got a really weird error ... looking at that one now.
That is what I get with 0.0.0.0:2001. Both WB and Game are on 1.3.0. Files are verified.
@west prism best advice I can give is log before you trigger that function and see if you see anything anywhere
Is there a method for moving an item from one storage to another storage in a different entity?
I found TryMoveItemToStorage but it doesnt refund me supply from arsenal
When I move item to arsenal storage with it
I think you first have to remove it from wherever it is?
Oh I have to Rpc for the refund separately, things cant Just Work in this game, have to do 50 lines of boilerplate
I'm at war with the game over dialogs, noticed your hack of just sending a message from the client when they want to log into admin tools haha
Yes and this is required because just giving them the admin role does not give them full admin privileges, it gives them admin but its not admin but its a little admin but not really
As per the usual
I'm also trying to figure out if you can give ownership of an entity embedded within slot manager to someone who is not the owner of the vehicle. Will find out how much the game hates me allowing user input to get sent to server by non-owners
Like the auto-admin feature gives them access to some of the admin functionality but they still have to #login to use commands, since you need to use special #login to become full admin because just giving you admin role is not full admin apparently
Since I presume the game will laugh at me if I try to give ownership of the entire vehicle to a player who is not the pilot
Well it's elegant in a way, dialogs really should have OnConfirm callback run on server unless I've just been using them wrong
Next update #login will be changed to /login and all passwords will get compromised /s
is there a way to see how may players are in queue ?
Hello, let's say I need to do about 200 of couple meters traces simultaniously on frame. It's very unlikely to happen in real world scenario, but still there is a chance. Currently i'm doing it on clients, locally, one trace per client. How bad would this be doing them on server?
200 times worse?
that's a good thing. a method should have specific single responsibility, not have 10 different hidden side effects that caller has no control over
The default behavior for placing an item in an arsenal in the game itself is to refund supply, so I expect it to refund supply when I deposit items in it
TryMoveItemToStorage is an abstract method for inserting items to any storage, not just arsenal. that expectation would be valid for TryMoveItemToArsenal
look at it this way: you can always call TryMoveItemToStorage followed by whatever is needed to perform the refund. if refund logic would be embedded here, another person wouldn't be able to just insert the item without the refund if they needed to
I see where you're coming from but it doesn't make logical sense to me that depositing an item does not do the things depositing an item does just by depositing an item, and I have to do things that arent depositing an item to get the effect of depositing an item.
In game I put stuff in the box, I get supply back. In script I put stuff in the box, I don't get supply back. Dope design.
Anyway no point in wasting time on this, it's a very common theme in this codebase.
because you're looking at it from functional perspective, not as a software engineer
I'll just vibe code my way through it
true, because it's rooted in design philosophy. it's really an sdk, not just a scripting interface for modders. though I understand your point of view
Whether supplies are refunded or not should be controlled by things like if supplies are enabled or not, not by having to call extra methods
Especially since everything in the game has a resource component now
can't agree, there still may be a valid case where one may want to insert an item to arsenal without performing a refund (not as a player, as a code flow), while generally having the refunds feature enabled
I'm trying to cook for you, but it might not work anyways
Also I cant find a method to simply check if I can afford the item in the arsenal
in vanilla game and conflict. consider the case in which someone is developing a completely different gamemode, but still wants to reuse certain elements as building blocks
Make sure to never open a menu on server as it will hand and crash clients lol
Below code is vibe coded with what's left of my brain cells - do type checks, etc.
Doubt this is the way to do it but you can always try
//Need to get ClientLobbyApi instance - figuring out if this will work will make or break the rest of this.
BackendApi theBackendApi = GetGame().GetBackendApi();
ClientLobbyApi theClientLobbyApi = theBackendApi.GetClientLobby();
//We need callback for room
protected ref ServerBrowserCallback m_CallbackFoundRoom = new ServerBrowserCallback();
//Also need search IDs - though we only need one
protected ref SCR_GetRoomsIds m_SearchIds = new SCR_GetRoomsIds();
//Need empty array to store rooms in when found in callback function
protected ref array<Room> m_aDirectFoundRooms = {};
protected Room theRoom;
//! Reaction for rooms found by id response
protected void DoRoomStuff()
{
//Get current room ID
string roomID = theBackendApi.GetDSSession().RoomID();
//or = SCR_SessionInfo.RoomID(()???
m_SearchIds.RegisterId(roomID);
theClientLobbyApi.GetRoomsByIds(m_SearchIds, m_CallbackFoundRoom);
m_CallbackFoundRoom.event_OnResponse.Insert(OnRoomFoundResponse);
}
protected void OnRoomFoundResponse(ServerBrowserCallback callback)
{
switch (callback.GetResultType())
{
// Success
case EServerBrowserRequestResult.SUCCESS:
{
theClientLobbyApi.Rooms(m_aDirectFoundRooms);
// No rooms received
if (m_aDirectFoundRooms.IsEmpty())
{
//Print something idk
//JoinProcess_OnFindRoomFail(null, -1, -1, -1);
break;
}
// Get first room
theRoom = m_aDirectFoundRooms[0];
FollowUpFunction();
break;
}
// Error
case EServerBrowserRequestResult.ERROR:
{
//print
break;
}
// Timeout
case EServerBrowserRequestResult.TIMEOUT:
{
//print
break;
}
}
// Clear
callback.event_OnResponse.Remove(OnRoomFoundResponse);
}
protected int FollowUpFunction()
{
Print(theRoom.GetQueueSize());
return theRoom.GetQueueSize();
}
wow nice!
thank you
From searching this discord, the hopes you won't get a null return are not very high
the game UI is very visible and moddable, obviously can't mod it as scripts aren't loaded on menu, but if you cross your fingers methods might still work because server is running - but you might need to find a way to exfiltrate the data such that the server might not know what that API is, but clients do
The king is typing
Main menu modding is not gonna work if you return from the game back into it, any mods is unloaded. Any script thread from it killed.
Yep, but while in server API might be accessible?
Or is it only a thing when you are in the menu
Yes the server could potentially know about itself. The lobby api seems like the right place.
I just am not sure if the server has the ability to search for rooms in this convoluted way, but there doesn't seem to be any other way to get room info than replicating what the serverbrowserui does
Arsenal item refunding is done via RpcAsk_ArsenalRefundItem. Arsenal itself is just an entity holder and has little to know logic. The RPC is fired from inventory.
I would have personally also done it via OnItemAdded on arsenal storage manager, not sure why they did not go that way, but each programmer has their own ways of doing things
Hm
Why does putting items in the arsenal refund their full cost and not the refund amount?
M16 just gave me 8 supply
It costs 8 supply to take out
Refund should be 3 or 4 or something
This is vanilla btw, but in game master
I think the costs are simply configured differently. Check the method I named to see how. Entity catalog probably.
Shouldnt be getting full cost of it back 😮
//~ Check if it can refund if resource cost is greater than 0
if (resourceCost > 0 && !TryPerformResourceGeneration(generator, resourceCost))
return;
IEntity parentEntity = inventoryItemEntity.GetParent();
SCR_InventoryStorageManagerComponent inventoryManagerComponent;
//~ On item refunded just before the item is deleted
SCR_ArsenalManagerComponent.OnItemRefunded_S(inventoryItemEntity, PlayerController.Cast(GetOwner()), arsenalComponent);
if (parentEntity)
inventoryManagerComponent = SCR_InventoryStorageManagerComponent.Cast(parentEntity.FindComponent(SCR_InventoryStorageManagerComponent));
if (inventoryManagerComponent && !inventoryManagerComponent.TryDeleteItem(inventoryItemEntity))
return;
else if (!inventoryManagerComponent)
RplComponent.DeleteRplEntity(inventoryItemEntity, false);
if (resourceCost <= 0)
return;
generator.RequestGeneration(resourceCost);
Wonder if the last line makes it generate twice or something
First TryPerformResourceGeneration then generator.RequestGeneration(resourceCost);?
hey arkensor, since update koth have JIP errors after changing scenarios with RequestScenarioChangeTransition then servers need to be manually rebooted :/
would you have any idea on what update changed to create this issue ?
Sadly, we also have these issues. I would recommend you to add code that on gamemode end shuts down via requestshutdowntransition or game.request exit and have your docker watchdog or what ever autoreboot. We do not yet know what causes the JIP. There is something invalid inserting itself into memory of the replication table which fucks it up badly, but its hard to trace which code did it.
oh ok good to know its known from you guys
yeah shutting down servers was my last resort gonna do that now
thank you !
Yeah it sucks because you loose the players briefly, but we discovered this issue literally last minute before the release and could not cancel it anymore because of it. Known issues list should contain that this is an issue.
https://reforger.armaplatform.com/known-issues its not there
Anyone know how to "activate" a mortar shell. I want to spawn a mortar above a player have it explode once it collides. Ideally would have all the sounds of an active mortar as well
Using this prefab currently:
{38BAE094333E31BF}Prefabs/Weapons/Ammo/Ammo_Shell_81mm_HE_M821.et
What controls whether weapon rank requirement is enabled or not?
Ah just conflict game mode lol
idea ??
PSA to anyone using Math3D.Curve: the lookup parameter changed from 0-1 to your configured domain (xMin-xMax). in 1.3. no longer a percent
I'm creating mapmarkers with SCR_MapMarkerManagerComponent either with InsertStaticMarker or InsertStaticMarkerByType. Players joining after the creation of the markers, don't see the earlier markers. How should I make the late joiners see the markers?
Hmmm.. or is it so that peertool behaves differently. Testing on DS seems to work as expected. On DS the markers are seen properly.
SCRIPT (E): Virtual Machine Exception
Reason: NULL pointer to instance. Variable '#return'
Class: 'SCR_MortarShootAction'
Function: 'CanBePerformedScript'
Stack trace:
scripts/Game/UserActions/SCR_MortarShootAction.c:66 Function CanBePerformedScript
scripts/Game/Interactions/Display/SCR_ActionMenuInteractionDisplay.c:845 Function CompareNewDateWithOld
scripts/Game/Interactions/Display/SCR_ActionMenuInteractionDisplay.c:820 Function SetDisplayData
scripts/Game/Interactions/SCR_InteractionHandlerComponent.c:787 Function OnPostFrame
Hey guys, what's the problem? After 1.3 when I load my mod with weapons and want to use the mortar gives this error and does not fire a shot
Anyone had luck using external code editors for enforce script?
yea just use vscode with c# highlight and that's about it
pros and cons:
- doesn't close when workshop crashes
- doesn't automatically start when workshop starts
readValue fails to load JSON if any "optional" fields are missing in the json (even though it would be standard to define defaults in a constructor or elsewhere). This is with SCR_JsonLoadContext for unmarshalling json to plain (undecorated) class instances. This was changed early on in 1.3 experimental.
Anyone know how I can add a new component to the PlayerController?
The same way you do with every other entity. Override the prefab and add the component to it.
Ah, I didn't spot that there was a prefab for it!
Found it now, cheers Zelik 🙂
Most entities have a prefab.
👍 I've been trying to hack together WCS' Loadout Editor for Game Master, and I needed to add something to it
this is absolutely awful for any communities running shorter form scenarios like reforgerlobby
This is less than optimal though 😂
Is there a way to get current available list of signals? For current vehicle in particular, I don't see it currently in debug menu
Will someone create a mod to disable the Game Master budget?
is it redunant to do this? I guess doing an rpc on its own is only ran through the channel that the method is set to?
{
if (!Replication.IsServer())
{
Rpc(RpcAsk_Action);
return;
}
RpcAsk_Action();
}```
Easiest way to make a GM spawnable item only be able to be spawned by admins?
make everyone admin
Any way to utilize -srcDefine with workbench instance (seems -srcDefine doesn't work at all.... im dumb nvm
)
Plz expose the code for Door/SlidingDoorComponent so I can adapt it to make a custom overhead/garage door component
how do I go about grabbing the entity a player is looking at? or nearby entities of a certain type around the player?
IEntity targetEntity = GetGame().GetPlayerController().GetPlayerCamera().GetCursorTarget(); the latter is more complicated but can be done with QueryEntitiesBySphere
You probably should unless you only want it to be done on client
then from Server - RPC what that thing does to clients if needed
@west prism it's only bad for certain checks.
In your case, you only want the code to run on the server (and for the player if in solo GM scenario), doing that is fine.
But let's say you want to check if not server, that would fail when player is in solo GM because they are the "server" - so all code would fail in that case
Same situation, it's good to ask here because that way someone can search for it in the future
So if you have a mod that is only ever being used on servers, it’s fine to use?
Also if I wanted a variable to only be exposed to the server. Not having an RplProp on it is good enough? Only replicating the variables that are needed?
like calling a method that Rpc server and runs a check comparing the client provided value to the non rplprop value?
So it's a bit more complicated, code that only runs on the server, fine to use IsServer
UserActions are powerful in that aspect that they can run on both concurrently
Ahh yeah, I had a section of my code that checks for isserver then gives ownership to player.
but some things have to be done on clients, but server is authority so if you do something like turn a screen on, and run the code on both, it will seem to work, but only for those in streaming range
anybody that joins later, or enters streaming range after, won't see the thing you have done unless server replicates it
So clients will have different states for the local script - like if you increment a number by one when a user action is pressed, server and client will store that initially, but new clients will see 0
That is what makes replication necessary, but it all depends on what you do. Some things are done on server and replicated automatically, but it doesn't hurt to RPC to owner and repeat, or even broadcast it depending on what it is
ahh okay. So if the user set a variable through rpc and it wasn’t Replicated. It shouldn’t matter as long as that variable isn’t needed constantly. As long as they rpc to a method that is asking to see said variable.
But for variables, RplProps are the easiest thing to implement to keep variables syncronized, RPCs are kind of manual in comparison
And you can only RPC from owner to server, and for items, server tends to own them anyways so you'd need convoluted way to have server initiate ownership change, so that client can then RPC the server
So I like to think of RPCs as ways to do requests rather than network syncronization
Yeah I give ownership through useractuon and it opens a menu which rpcs. When menu is closed or task is finished. Server takes ownership back.
Yep, had to do same thing for a dialog I made, it's convuluted but only way to get data from a player
I was just curious the best way to have a variable be on the component but not have it ever be available in anyway to the player. Like if you wanted to keep a code private. Not having it replicated but having the server rpc and compare and return true or false, would be logical right?
Like it’s working now because the methods are being ran serverside so it never needs to be replicated to clients.
Replication is so confusing, still learning how to use it efficiently.
So as you know, script is available to clients and server, but each are their own simulation, you can declare variables at beginning of class that server instance of script sets, and yes you could RPC from owner to server but in your case I would use a RplProp that you think would be fine sharing with clients, if you don't want to make the main variable a RplProp
Because otherwise once you RPC to server for that true/false in example provided, you don't actually return a value with RPC, so instead you'd have to RPC back to owner to set owner variable/run owner function
I guess if you are more specific on why you want to keep variable value private it would help inform the best case
A passcode
I have an rpc to set code, and one that takes an input code and returns true or false if it’s the same as the set code.
There is an RplProp that basically always says if a code is set or not so that clients will know if they can set one or if they have to try unlocking.
Ah, so in that case RPC to server with provided code, only server updates it's local variable representing passcode, and server checks in the RPC call from owner if valid, if so, RPC back to owner telling them how to proceed, but really in this case owner shouldn't need an RPC if you are let's say, initiating an action on server anyways like manipulating player, item, etc.
Because it depends on what you want to do with that true/false value.
If you are simply displaying dialog saying "Good or bad" then, yeah RPC back to owner to tell them passcode attempt success/failure (kind of like next step logically). You don't want to run logic for that mechanism on the client at all, ideally, and instead only RPC to owner informing them of pass/fail.
well the true or false then runs other actions outside of it.
I have a few variables that are replicated fo basically check if they are on a list and if a code is set. But with menus and how they are local. I might rewrite some of the code. It works but it’s kinda janky as i have rewrote and modified it 2-3 times to make it simpler and smoother.
I would have the RPC be the end of that function, and have the response from the server kind of act like a callback
Yeah I RPC back to a callback in the menu.
which runs a different function, and you could pass a bool with the RPC
yeah I did a rpc that is a bool with a enum for whichever action it’s related to.
The menu part is what I’m finding is super janky. I am right now essentially calling a method that sets the instance of a menu in my component then Rpcs the logic. The callback references the menu and function to either say good or bad and continue from there.
Do people sometimes have RPCs in a separate class to clean up their main component code?
You can only RPC in the same class save for some exceptions. Best way to organize imo is just order of operations with ordering your functions
bump 
How do I set all the clothes to the same rank without piercing each one?
clothes so that they are of the same rank*
Define easy.. Not an ideal way but you can probably achieve it by overriding SCR_ContentBrowserEditorComponent::CanPlace
Extend EEditableEntityFlag with your own flag and check against it from SCR_EditableEntityUIInfo
CanPlace should be running client-side so you'd just get the playerId and query IsAdmin I assume. You'd then just set your flag on the desired prefabs SCR_EditableEntityComponent. I sort of do some foolery like that with the flags.
Speaking of stuff like this - how hard was it for you to build the loadout editor and how hard would it be to create something similar for vehicles? I guess on a scale of 1 to insanity haha. I think it would be a fun project for myself but don't want to sign up for infinite pain. GM entity browser is just not very optimal for selecting vehicle variants,
Most of the editor is my own thing so it was relatively easy. If you build your stuff to depend on vanilla stuff then it will be painful and break all the time, at least in this area. It's not currently without issues, but all issues with it are related to how the game does things, not my systems.
^ stay away from vanilla systems as much as you can...
Not that there are any vanilla vehicle garage systems, but yeah
This is actually really insightful take. Like it makes sense when you read it, but it's not something that one might consider until it's too late 😅
This was made back when I was way more incompetent too so it should be motivating to undertake something similar
It's kind of an analogy to having server with tons of dependencies: a nightmare to maintain since it's very likely that some of the stuff doesn't work correctly/hasn't been fixed (yet)
Did you ever find a solution for this? If yes, I'd be curious to know...
is there a way to restart the game server ?
How do I assign all the equipment a single rank?
How to prevent vehicle from being removed by GC system? I spawn vehicles in distant points of interest, and when players reach them, they're usually gone already. I looked at ambient vehicle spawn code (since they're not despawned by GC) and didn't noticed anything special there.
Is there any way i can debug this?
30.03 2025 21:03:27
Unhandled exception
Program: C:\Arma Server\Server 3\arma_reforger\ArmaReforgerServer.exe
Reason: Access violation. Illegal read by 0x7ff7c38889f0 at 0x2cddc0cf1f8
Class: 'SCR_InventoryStorageManagerComponent'
Function: 'Invoke'
Stack trace:
Scripts/Game/Inventory/ScriptedInventoryStorageManagerComponent.c:23 Function OnItemRemoved
Scripts/Game/Inventory/SCR_InventoryStorageManagerComponent.c:564 Function OnItemRemoved
Vehicles spawned via script/gm browser don't really go into garbage collection until someone interacts with it (gets in and then out). If they are then something else is forcing them in when they spawn.
is there a way for the script editor to automatically fill arguments for an overrided method?
For real? Thats a bit of a bummer
The real bummer is the one in VehicleControllerComponent which is used for putting in and out of collection will not fire sometimes so you'll get vehicles still in collection while being operated and then players get sent to spawn screen confused, then on the other hand you have vehicles forever left out in the open if you rely on the internal collector alone.
I've spent a lot of time working with that system and it's not a bad system but it could be better... They mostly just need to address the events not firing properly and it'd be a really good system.
I had that happen to me a couple times, thought I got GM deleted haha
Hello all, cpl things
SCR_ is a faction prefix?,
I can't seem to find how player speed is driven for running. I'm assuming with all the new fancy IK anim movement it's not as simple anymore. I've looked at the PlayerController class and at glance value it doesn't seem to have any utility methods for controlling speed.
In that same breath, I'm trying to find now what drives the animation speed
So SCR means scripted, usually it extends a base class
wow haha
Example being SCR_PlayerController which extends PlayerController, usually it has more methods to help with scripting
That makes a ton more sense
So a class without SCR might be really empty, but the SCR version has a bunch of methods exposed to you to do stuff with it, sometimes an SCR class is useless, depends
Right. That makes sense. Seems to be kinda the same story, walk speed can be set at a flat value but looks like the animation controller picks up the rest?
another thing. ChimeraCharacter? Is this like CA_Man in a3?
SCR_ is a convention used by scripters to denote something done by a scripter.
It does not necessarily mean scripted class all the time, although coming from our vanilla scripts it then should be
But you will also from case to case find BaseClassWhateverScripted
Which is the same
In other cases you will find it without it and they are scripted (Non CPP classes)
^^ Yeah I found this to be the case most times when comparing the two
In the future, you will be able to mod CPP/Engine classes too but no ETA on that yet.

(Native methods would not be moddable, but event ones could).
Reason why it is blocked at the moment is due to some memory layout considaerations and limitations.
Hey that's still awesome. Really liking the lower level approach here Vs A2 A3 . It was very difficult to do anything complex without extending
@ocean kernel 
Yeah appreciate the correction, I guess I was always under the impression that the SCR classes were expanded versions for scripters.
AnimationController reveals no more than PlayerController. Getters and setters but nothing more than that fro mwhat I can see?
@remote oar I see this in the scripts:
SCR_CharacterCommandHandlerComponent - creates CharacterMovementState
CharacterMovementState - float m_fMovement; //! current movement (0 idle, 1 walk, 2-run, 3-sprint), only if the command has a movement```
Not sure if this is a byproduct of current character animation, or script command for movement - that stuff might be engine side especially with player movement being a tough thing to expose IIRC from the last time it was asked here concerning localized physics.
That's what it looks like. There is lso the CharacterCommand components that drive a portion of this in some way too with the ragdolls, slopes, etc
damn
where is player setVelocity[0,10,0] when you need it the most
I mean, you could still do that - just wouldn't look great haha
make sure to run EOnFrame and set velocity to current velocity plus 10
Oh yeah it would be nuts. I remember that's how some people were doing some hacky shit but it would end up in just clipping the ground and killing you, or the vehicle you were in lol
Fake news
Oh yeah setting velocity to 10 aloe wouldn't do much
Actually, there is:
GetMovementState
for anim?
Yeah, under CharacterAnimationComponent - so you can atleast get the current movement index
sweet I'll take a look at that thank you
Anyone that Actually knows how to script know why im getting an error? tbh i just chatgpt the script. What im trying to do is make an explosive round. Any ideas?
I have created a gui and added a keybind to chimeraInputCommon but i'm not quite sure where i have to have the AddActionListener?
When modding a script class, never place your file under the same directory as the original as you will ovewrite the original file instead
Change the file name or create a special folder for your scripts instead.
I tried to report it here in the discord way back on march 7th and multiple people posted about it since then. But anyways, would this be a good fix? (How would it affect those without a bat program that acts as a watch dog to automatically restart the server?) ```c
modded class SCR_GameModeCampaign
{
override protected void OnGameModeEnd(SCR_GameModeEndData endData)
{
super.OnGameModeEnd(endData);
if(Replication.IsServer()) GetGame().RequestClose();
}
}
In your menu, add it on open, remove it on close?
Hello everyone, I have a question, I'm trying to change the mechanism of capturing points and create a mandatory capture sequence. I modernized my controlpoints and when entering a point, its sequence is already determined and the previous point is checked, but for some reason I can't stop the capture. I even completely removed OnCaptureStart and BeginCapture but the capture still continues, although the notification says that "this point cannot be captured, move to the previous one". Does anyone know how to solve the problem?
Would also like to have extensions back for the server 
curious, is there a way to determine if the connected player is from a certain region?
first numbers of their ip is a region
Can one help me out with this?
I basicly want a component addition, where the "Extra Option" only gets displayed when the upper box is ticked.
But havn't found any good reference on how to do this
if one could point me to a proper documentation on how to populate a game component with options, (nested) lists and such things that'd be great. Or just solving this specific issue would be nice already
Is there something from the vanilla scripts you can go off?
have tried to find something usefull, but I've had a hard time finding something so far
(technically there is, but lookin through the definitions, I couldn't find the spot where that got defined)
I have a feeling "SCR_UniversalStorageComponent" has this when you tick Use Coefficient (something like that, don't remember exactly)
When you tick the option it lists more options/Changes the attributes available. It's somewhere down the bottom of the component list.
yeah that's exactly what I've found too, or the Use Virtual Inventory Replication, but havn't found where the attribute got defined x)
If you go to those classes, at the top where:
class SCR_BlahBlah : Blahblah
{
}
Is, right click on Blahblah and go to "go to definition" or whatever it is. Then just cycle through to the inherited class. Maybe you will come across the base attributes for it 🤷🏻 sorry for the poor help, I'm not near a computer 😅
haha you good m8, I'm sure neither ^^
already did that, but nothing found there <.<
I guess I have to go through every other fuckin class mentioned in the whole ass script till i find it .........
hopefully one knows what I'm lookin for before I loose my mind xD
at least I know I'm not fully on the wrong track with my approach ~
That's how I would do it, but I'm sure someone will have a better way or even know how to do it, must be that perfect time where everyone else is asleep in the world 😄
true...
anyone know if there is a similar func in reforger?
https://community.bistudio.com/wiki/getUserInfo
thats from A3
defvalue = "1", if you want to dynamically show or hide, its not yet possible to do via script
that bein written within the [] of the attribute?
any direction for adding like campaign defend/capture tasks in SF so the QRF AIs can take some area back from players
default value yes, search for it and see how it is used elsehwere. but the show if other option is set will not be possible until we make an update to the game some day. i have requested it now, but it will take a while for it to be added
cool, thanks for the heads up and the request
i use SetTransformWithChild()
https://i.imgur.com/oc16Bp7.png
https://i.imgur.com/GV6TvmQ.png
https://i.imgur.com/qgPr8TO.png
Ural trucks teleports ok, infantry squad too,
but LAV25 and BRDM
wrong height
they have common EnvironmentProbeEntity as child
https://i.imgur.com/I69Amq2.png
if i delete it (EnvironmentProbeEntity) nothing changes, whats wrong?
https://i.imgur.com/uQUz49a.png
it wasn't a problem in pre 1.3v
it finds the manager but wont register the AddActionListener i have the keybind in chimerainput does anyone have an idea?
modded class SCR_PlayerController
{
override protected void UpdateLocalPlayerController()
{
super.UpdateLocalPlayerController();
Print("Player Controller");
InputManager inputManager = GetGame().GetInputManager();
if (!inputManager)
return;
else
{
Print("Manager Found")
}
inputManager.AddActionListener("OpenCalsMenu", EActionTrigger.DOWN, OnKeybindPressed);
}
void OnKeybindPressed() {
Print("Keybind pressed");
// GetGame().GetMenuManager().OpenMenu(ChimeraMenuPreset.CalsMenu);
}
}
Hello, what happen when there is two same script loaded at the same time (each one of them is in a different mod) for exemple "modded class" SCR_CharacterCameraHandlerComponent, with same override but with different values ? One of them is loaded first or there is incompatibilities and the game will crash ?
Nevermind im just stupid
Hi, can anyone tell me what the problem is? I wrote this code to cancel the capture of a point under certain conditions, but it still starts capturing even though the algorithm works correctly, does anyone know how to defeat this magic?
Is there any tutorial on how to make it so a custom keybind can be reassigned to a different key by the user ?
could try printing, im not familiar with that area. does begincapture get called repeatedly? also when submitting code on discord do code
What is this crash? db2a7b1e-6f40-4cf9-b78d-f7cf496a6ae6 seems to happen when I exit play mode
Or 7ed4ff0b-760a-4aa1-83f4-d9dab0d0f01a
Of course the crashes contain zero useful logs
can you create dynamic user actions? that add and subtract actions based on script conditions? if so, is there an example?
Anyone else notice that MapItem.GetPos() returns "0 0 0" on DS. Works perfectly in WB. This broke in 1.3.0.
Pointer type 'Physics' can only be used with local variables
So I should use GetPhysics() every time I need it instead of storing it in a var on init? But why 🤔
I figured out that for some reason OnCaptureStart and BeginCapture don't work when directly canceled (I mean return false or return null). I found that it sends to SCR_CampaignSeizingComponent in the EvaluateEntityFaction() method and here I already implemented my checks when capturing.
No
Yes, because the pointer would be invalid if you store it, but it is very fast query, you can still keep it in the method, just not part of a member
What was the reason of removal of SoundComponent from entities on dedicated server side? Scripters can no longer "broadcast" audio from server (by simply starting playback on server tied to game logic and then in-engine code magic makes it happen automatically on every client) because sound component no longer exists on dedicated server. 😢
I get that it was probably done because dedicated server is a console app, but IMO it was perfectly fine before and now you need to jump hoops and play client-server-client rpc ping-pong to just play the sound (and if you will rpc the sound call to every client, it will be played multiple times, and you can no longer do it from server just once).
Also, it introduced straight up audio bug - for example, there are some cases when destruction sound playback doesn't trigger on dedicated server because there is a obligatory System.IsConsoleApp check in SCR_DestructibleHitZone.PlayDestructionSound, 237 line, and considering that damage calculation is server authority, destructable entities sometimes destroys just silently.
No u need to stop ddosing the server
im just trying to reconnect 
would be nice if there was a print that told me all the things replicating when i get the flooded error
would be reaaaaaaaaaaal nice
but instead we got.... nothing!
do i have to make a stink about it every single day now?
this has been a problem for months
i just need 1 hint at whats causing it from my logs PLEASE
Has anybody ever gotten BaseUserAction::SetCannotPerformReason() to work? Can't seem to get it to show the reason in-game on the action UI 
doesnt EL use it for when you dont have the items to process something, it will say "missing required items"
Maybe, I'll take a look. I've looked at vanilla usage of it and I'm doing exactly how it says it needs to be done, and it just doesn't effect it at all, it seems.
Yeah, EL does use it and I have it setup similar to them 
Doesn't even seem like the vanilla reasoning works currently
Having a couple odd issues:
These are my custom actions that attach and detach a crate via a vehicle's SlotManagerComponent. On detach, it puts the entity where it should (at the player's feet), but it can only be accessed in the vicinity at original point of attachment. Here's my code for detaching it:
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
{
if (m_SelectedCrate)
{
IEntity crateEntity = m_SelectedCrate.GetOwner();
if (m_CrateStorageSlot.GetAttachedEntity() == crateEntity)
{
// to make the mesh visible again
Resource m_CrateObject = Resource.Load(m_sCrateObject);
BaseResourceObject baseResource = m_CrateObject.GetResource();
if (baseResource)
{
VObject asset = baseResource.ToVObject();
if (asset)
crateEntity.SetObject(asset, "");
}
// for detachment
m_CrateStorageSlot.DetachEntity();
vector mat[4];
pUserEntity.GetTransform(mat);
crateEntity.SetTransform(mat); // set to player position
}
}
}
Second issue: as seen in the video, when the mesh is detached, it goes "invisible" depending on the viewing angle 
I thought maybe it was the geometry not moving with it, but viewing the geometry with the debug menu, it seems to move with it fine
You forgot to call Update method after setting the transform, so the bounding box is not correctly updated
yup, that was it, thank you!!
I would think you could using a custom class that stores a bool or bools that dictate if other actions can be seen or not.
But those actions would all have to be scripted in advance, can't do them on the fly.
I've been asking this for a hot minute now, no responses though, I wish debugging replication could be made easier
well something odd: if i dont have workbench running it doesnt flood me out nearly as often
In reverse I have workbench up while i have arma up most of the time and i dont normally get kicked like everyone else :c
ive tried so many things and always end up with different results. removed 90% of things from my map, still flooded
installed server onto a win10 machine... nobody got flooded out UNTIL it restarted the first time, then people got flooded again
I've been playing with the idea that nodes/items in replication are not getting removed properly from user actions, which afaik has replication already handled so leaves me just scratching my head. Deep diving into this issue again today, need these logs from replication if its even possible. A whole stack trace instead of just generic "RplShedulerError" with some basic information would be dope to be able to look at. I dont want the answer, I just want to know how to troubleshoot in order to find the answer 😭
Arkensor commented on this somewhat recently, Bohemia is aware of the issues and guidance right now is server container restart
I'll see if I can find the reference
I already do this
Game.RequestClose() then a watchdog will start it back up right away
You think this change would have affect over vehicle sounds? Right now our server doesn't play any vehicle sounds until we get near a custom building near the airfield. In a heli you can start to hear it from 50m north of Tyrone, to the south side of the airfield. And in a vehicle you can start to hear the engine from about 200m away, and at like 180m away you can completely hear the vehicle sounds. Seems like its a replication bubble that we enter and are able to hear vehicle noises again
Yes.
that ace medical literally goes off every 5 seconds lol any ideas on solution
I've fixed a bug causing it to not work with CRX just recently.
If you are not using it i have no clue.
it probably affects a lot, as it's just a common sense to put game logic and calculations on server and tie audio cues to game logic and this thing makes such approach not working anymore. Honestly, removing SoundComponent from entities on dedicated server is such a bizzare decision and I hope it will be reverted, because:
- it removes code parity between listen server and dedicated server requiring doing more special treatment for dedicated server and ohhhhhhhh how much A3 was plagued with this spaghetti and code bloat treating all the single player, listen server and dedicated server special cases.
- Overcomplicates the code by requiring doing a lot of RPC calls. The best example is that you have game logic on server that requires you to play the sound cue on all clients, your entity has RplComponent and SoundComponent in prefab settings, but, as I said before, dedicated server entity no longer has sound component.So, what you're gonna do - pick one of the clients randomly to play sound and his machine should broadcast audio to anyone else? Making an broadcast RPC call that will play the audio multiple times X number of connected machines? Considering that clients are "unreliable narrators" and shouldn't be trusted with game logic - this is stupid.
- SoundComponent tied with RpcComponent makes audio to be executed on all machines, and you will certainly get multiple sound playback on Rpc calls without a lot of special treatment. You didn't needed to do hat before.
- Seems that the game code is not ready too, as I have noticed at least one vanilla bug where sound playing code on dedicated server is never executed for any client because dedicated server has no audio component (
SCR_DestructibleHitZone).
so, tl;dr - SoundComponent should be available on dedicated server with limited working API to at least be able to raise .SoundEvent("SOUND_EVENT_NAME") as it was before instead of straight up removing it.
Now to think on how to get our sound working on the whole map instead of in the replication bubble of, im pretty sure a light thats placed up in the airfield
networkViewDistance: 15000 maybe 😎
I think you need to tune rplcomponent of your entity and enable entity presence for clients out of network bubble (so, always)
Will look into this, thank you for the insight. We've been scratching our heads over here.
Is there a way to select which entity the sound replicates off of? Like how the server auto selects the current entity being used
With that, could I make a GenericEntity in Monti, add the RplComponent and SoundComponent to it, select that as the main sound manager and then enable the entity presence out of network bubble?
or possibly use the SCR_SoundManagerEntity instead of GenericEntity
Yeah exactly
I think it should be mandatory to flag mods that come with AI generated code somehow
The amount of generated AI images on the posters/thumbnails is starting to annoy me a bit ngl. I always notice the AI pattern thing.
Many are using chat bots to generate images.
Proper A.I. image models can already do some pretty amazing stuff. 😉
I wish I could force feed chat-gpt all the arma/enfusiom docs. Maybe I'd understand replication better 
If there were some default image templates (like for A3), you'd see less AI generated images (not all, but less).
Finding jpeg for mandatory thumbnail of your tiny 1-line "x10 supplies" mod is annoying.
I can create some default workshop thumbnails, with AI 😅
Is anyone able to tell me how to make a custom control setting that can be binded by the user?
(Dom’t need the inputmanager part of the code, just how to allow a user to rebind it)
Did anything change with signal manager? My signals are not signaling anymore ingame. WB, Peertool, Dedicated Server Tool all work 
Where do I edit the rank of items in the arsenal?
If I wanted to give a helicopter a jet engine to propel it forward is my only option physics impulses? Or is there an option that is compatible with server authoritative vehicles?
Not too familiar with the Enfusion engine, but before I started learning wanted to know if what I want to do is even possible. Is it possible to create a ban management admin interface in Arma Reforger?
Also, would it be possible for it to be server-side only so playstation 5 players can still join?
https://reforger.armaplatform.com/workshop/5AAAC70D754245DD
And yes mods can be server-side only I don't know if that one is but probably.
You can have serverside scripts but the client needs the mod even if its just a serverside scripts loader. PS5 will be getting mods soon so there's no point in seeking vanilla compatible solutions.
The only unmodded servers will be official ones at that point.
I see that you're the creator of these mods. As someone who has 0 experience with enfusion what do you recommend me to read to learn to do what I'm trying to do? The Wiki seems to be lacking a lot of information...
In regards to scripting, the modding ecosystem assumes you already know object oriented programming. Have a look at entities and components labeled SCR_Something to see some "real-world" scripting usage. Some stuff may not be visible to you as engine code is not visible.
I would suggest making a goal that is something really basic, instead of jumping right into managing bans.
I work as a programmer, so that's taken care of. Just a bit confused with even creating a mod and trying it on my own server...
I'll take your advice and start with something even more simple
You have a youtube channel @ocean kernel ?
two options for testing on server:
- publish mod to workshop, load mod on dedicated server as normal (just see normal server setup guide https://community.bistudio.com/wiki/Arma_Reforger:Server_Hosting https://community.bistudio.com/wiki/Arma_Reforger:Server_Config)
- if you don't want to publish to test, load mod locally like this: #enfusion_terrain message
Thanks for the info.
Question - I'm seeing a behavior where if I register an action listener for the input manager to call a function it works on the server side the localhost but on the client (peer tool) it won't call the function
action listeners are local to the game that's running it
override event void OnPostInit(IEntity owner)
{
super.OnPostInit(owner);
Print("RangeFinderUAVSpawner: PostInit");
s_OnBinocToggled.Insert(OnBinocularsToggled);
SetEventMask(owner, EntityEvent.INIT | EntityEvent.FIXEDFRAME);
Print("RangeFinderUAVSpawner: Initialized");
m_Sights = BaseSightsComponent.Cast(owner.FindComponent(BaseSightsComponent));
if (!m_Sights)
{
Print("RangeFinderUAVSpawner: BaseSightsComponent not found on owner.");
}
if (!UAVManager.s_Instance)
new UAVManager();
InputManager im = GetGame().GetInputManager();
if (im)
im.AddActionListener("SpawnUAV", EActionTrigger.DOWN, OnSpawnUAVRequest);
}
//-----------------------------------------------------------------------------
protected void OnSpawnUAVRequest()
{
Print("OnSpawnUAVRequest");
How can I set up so that the client can make the call to the server to run the function?
This class extends from SCR_BinocularsComponent
If anyone has that problem, use BaseItemAnimationComponent instead of AnimationControllerComponent. Its just broken and does not play any animations ingame
Hey there everyone, super new to the whole modding scene but very familiar with coding (C,C++,Python, SQL, etc). I have a project in mind that has scripting components, essentially the idea for the mod is to create a ghost entity on player death and instantly allows/tps them to become said entity.
I have two scripts, one listens for player death (SCR_HitZone = OnDamageStateChange) and the other creates said ghost entity on death and gives certain control(Hook the death signal to the StartSpectating method(IEntity))
This all spawns an entity I called GhostSpectator.et that has all the components as above. Unfortunately, this is where my knowledge stops in the matter...
For the life of me, I cant figure out how to finalize/test now that my scripts compile and are successful in the proper calls/methods (took me a while to find the right ones). Essentially, my saving grace has been this discord and helping me here and there. I have had alot of people chime in when I get stuck and now is one of those moments...
All I ask is for 5 minutes of anyone's time who has any inclination that they might be able to help me. Sending out the SOS, Thank you all in advance as I know this isnt much to go off of. Will happily provide more info if useful/open to DM's!
is there any one what is RHS_RhinoAttachmentComponent
some sort of attachment from RHS, quick google shows its a counter IED device. Id assume its the component to said item in RHS
How can I trigger something on the server from an input action?
Attaching this simple component to a prefab allows me to print by pressing the action key on the localhost but fails to do so on the peer client
[ComponentEditorProps(category: "GameScripted/Misc", description: "Tests an input")]
class TestInputComponentClass : ScriptComponentClass {}
class TestInputComponent : ScriptComponent
{
override void OnPostInit(IEntity owner)
{
super.EOnInit(owner);
Print("TestInputComponent: EOnInit");
Print("ONPOSTINIT: " + owner.GetName());
GetGame().GetInputManager().SetContextDebug("RangeFinderUAVSpawner", true);
GetGame().GetInputManager().AddActionListener("SpawnUAV", EActionTrigger.DOWN, OnTestAction);
SetEventMask(owner, EntityEvent.FIXEDFRAME);
}
override void EOnFixedFrame(IEntity owner, float timeSlice)
{
GetGame().GetInputManager().ActivateContext("RangeFinderUAVSpawner", 1000);
}
void OnTestAction()
{
Print("INPUT CALLBACK: TestAction was triggered!");
}
}
Is there any other way to do this?
What changed in GM functionality that the client's UI breaks when budget cap is disabled?
I'm stuggling to find the placing flow for GM since there's 50000 methods involved seemingly
what do you mean by breaking? iirc all placeable object tiles will just appear locked
and do you mean IsBudgetCapEnabled() == false, or some other way to disable?
Yeah I tried that it bugs out
Works serverside
This what happens on client, something is blocking it with zero logs
try overriding SCR_PlacingEditorComponent.IsThereEnoughBudgetToSpawn if you haven't already
it sorted the same exact issue for me, but I only override limits for testing within workbench, so no guarantee for clients
I will inflate the budgets to 999999
at least it's something
sounds like the most bulletproof and futureproof approach
inflating the budgets didnt change anything
I wonder if ctrl+spawn is controlled separately
Idk if you figured it out but I override something in PlacingObjectEditor
I'll find it when I get to my pc.
Oh didn't see but keeyan posted it.
Yeah the thing that remains now is to allow Ctrl+ click
It only places once then cancels
0-3 yup
TY!
you can technically have more too, BTR is 0-7 iirc
and they usually go:
L01 - index: 0
R01 - index: 1
L02 - index: 2
R02 - index: 3
enable mergephysics and registerdamage too
Awesome thank you
Ctrl+F'ed walrus operator and bacon already mentioned it. Introducing it would cut down on so much script clutter.
is there a way to get the rplid/playerid of the person who called a server rpc w/o sending it thru manually?
pretty sure its SCR_PlacingEditorComponent::CheckBudgetOwner
unsets the selected prefab right after spawning something if the budget is blocked
maybe try making that a no-op
ah actually its both of these. this is minimal of your mod with ctrl+click support
modded class SCR_BudgetEditorComponent
{
override bool IsBudgetCapEnabled()
{
// this makes the ui look proper
return false;
}
}
modded class SCR_PlacingEditorComponent
{
override bool IsThereEnoughBudgetToSpawn(IEntityComponentSource entitySource)
{
// this allows the item to actually spawn
return true;
}
override void CheckBudgetOwner()
{
// do nothing. this prevents selection from clearing after placing over budget
}
override void OnBudgetMaxReached(EEditableEntityBudget entityBudget, bool maxReached)
{
// do nothing. this prevents selection from clearing after placing over budget
}
}
I still hate that mouse wheel switches script editor tabs instead of just scrolling the tabs list horizontally
My biggest issue is not being able to collapse code blocks I think
Is there any trick in getting ItemPreviewWidget to work? I'm trying to raw script the widget to display something with no success.
There was a method to make a preview from any entity into it
ItemPreviewWidget itemPreview = ItemPreviewWidget.Cast(GetRootWidget().FindAnyWidget("ItemPreview0"));
if(itemPreview) {
m_World = BaseWorld.CreateWorld("Preview", "Preview");
BaseWorld world = m_World.GetRef();
// world
Resource rsc = Resource.Load("{4391FE7994EE6FE2}Prefabs/World/Game/InventoryPreviewWorld.et");
if (rsc.IsValid()) GetGame().SpawnEntityPrefab(rsc, world);
// cam
world.SetCamera(0, "0 0 -1", "0 0 0");
world.SetCameraType(0, CameraType.PERSPECTIVE);
world.SetCameraNearPlane(0, 0.001);
world.SetCameraFarPlane(0, 4000);
Resource rsc2 = Resource.Load("{BBB50A815A2F916B}Prefabs/Weapons/Magazines/Magazine_545x39_AK_30rnd_Ball.et");
if (rsc2.IsValid()) {
vector mat[4];
Math3D.MatrixIdentity4(mat);
m_Model = GetGame().SpawnEntityPrefab(rsc2, world);
m_Model.SetOrigin("0 0 0");
m_Model.SetTransform(mat);
}
RenderTargetWidget itemPreviewRT = RenderTargetWidget.Cast(itemPreview);
itemPreviewRT.SetWorld(world, 0);
}
```Where I'm at
What about ItemPreviewManagerEntity.SetPreviewItem or ItemPreviewManagerEntity.SetPreviewItemFromPrefab
Haven't tried that, assumed I could get it to do something without a manager.
I use it for my loadout editor
That manager is always in the world since it's used for... all item previews
But seeing that the ItemPreviewManagerEntity.SetPreviewItem is proto function, I'm starting to feel there is some engine magic involved
I took cues from PreviewWorldExample in scripts/Game/Entities/PreviewWorld.c but it seems to be ancient judging by file paths to prefabs there
Yeah, that instantly worked, even for entity spawned into script created world
I still wonder what's missing in my script, is it even possible to get it to render the world without that manager?
Yeah if you've ever used the loadout editor the entity preview is done through a dynamically spawned world
And the inventory character screen actually I think
But less visually impressive
Dis what I needed thank
Not really magic, what it does it mirrors the entity hierarchy with a new one, with only MeshObject set to the entity, so you don't spawn a new prefab in another world, since the whole logic would run. In the end it is calling InventoryItemComponent::CreatePreviewEntity really, and this should take care of everything
Then there is a bit more about setting the refresh rate of the RenderTargetWidget in case it is dynamic, and handling the transform of where it should spawn in the preview world
I would highly suggest to use SetPreviewItemFromPrefab as much as possible, if it is entity that don't change visually, since it is caching and reuse the entity, but I don't think even vanilla using it that much
Thanks, both SetPreviewItem and SetPreviewItemFromPrefab work well for me
I still wonder what I was missing in my script, in the end widget didn't display anything at all (not even world background)
By the quick look of it, were you not setting the camera position at 0 0 0 and model at 0 0 0 ?
So your camera was inside your model
Thought this was an issue, but playing around with coordinates didn't solve it. What I have right now is camera being 1 meter back from 0,0,0:
world.SetCamera(0, "0 0 -1", "0 0 0");
and the model itself should be at 0,0,0:
m_Model = GetGame().SpawnEntityPrefab(rsc2, world);
m_Model.SetOrigin("0 0 0");
m_Model.SetTransform(mat);
Spawning large object like a house should still show something even if both object and camera are at 0,0,0 but nope, nothing
Use something else that is not "Preview" "Preview"
Also tried "InspectionPreview"
And random strings, no change
On both?
Yes
Not much else to share, that was the entire function, called from OnMenuOpened, the menu layout is just square ItemPreviewWidget with default settings (and dummy text above it)
So far I can only assume that its impossible to create a world, spawn an entity in it and have it rendered in ItemPreviewWidget without ItemPreviewManagerEntity, all vanilla usages seem to lead there anyway
When spawning a world is this done via prefab, I guess see how bacon creates a world? If you are creating your own that might be the issue?
The preview manager is purpose made for this, as it also caches info per prefab so the cost is usually only on first open.
Edit; I see it was already explained. But yes you probably won't get far trying to reimplement this on your own in script
Hmm, I'm not even sure if there are real working examples of vanilla scripts creating a world and using it for ItemPreviewWidget. Doing .CreateWorld( search brings up few results, some look very outdated. Inventory scripts seem to pass entities that already exist in main game world into SetPreviewItem
I'm just curious if I can get it to work, manager only lets you provide single entity, what if I want to setup a scene.
scripts/Game/Entities/PreviewWorld.c seems like an example of a scene with multiple entities but it seems to point to non-existent entities, this is where I based my script attempts on
Then your prefab needs to be a whole scene. If you are talking about runtime creation of it then an alternative is always to put them locally in the main world and point a camera at them
The preview world demo script there was last touched 5 years ago, not sure if it is still working
Yeah, it points to old asset paths, guessed so that its ancient
I have been able to create a world, rename the layer extension to prefab extension and create it as a prefab in the (main) world for spawning a small scene dynamically. All of my attempts to create a completely new world also failed

