#enfusion_scripting

1 messages · Page 2 of 1

river imp
#

He's talking about the keybind lol

spark otter
#

oh, thats a thing? lol

river imp
#

Must be broken in experimental

#

In stable branch it only works if you have multiple lines selected

pseudo merlin
#

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.

ocean kernel
#

I have it on /

#

It used to work

thorn anchor
#

is there a way to find a component from rplid?

river imp
#

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

thorn anchor
#

i did. and that part works. no issue there.

river imp
#

Then i'm not sure what your problem is

thorn anchor
#

its when it called for ownership change in the component im getting a replicationerror

river imp
#

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

thorn anchor
#

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.

river imp
#

Not sure if its needed but I pass true for alwaysNotify

thorn anchor
#

i was getting rplid and not identity. those are two seperate things right?

river imp
#

Look at the paramaters for the Give method

thorn anchor
#

yeah

quaint raptor
#

Hi

#

My scope is in my gun in arms 3 please help

river imp
#

This isn't an Arma 3 channel

river imp
thorn anchor
#

rplid vs rplidentity. those are two different things right?

river imp
#

They're literally 2 separate classes lol

#

if they were the same thing one of them wouldn't exist lol

thorn anchor
#

yeah lol, i had a brain fart. but also, in peer tool since the peer identity is 0. is that going to return null?

river imp
#

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

pseudo merlin
ocean kernel
#

its correct tho :((((((((

#

No wait

#

/ is incorrect, inverted question mark is correct

#

Thanks bro

thorn anchor
#

im gonna blame it on being fasted.

frail hound
#

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"

river imp
ocean kernel
#

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

frail hound
frail hound
open pier
#

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

floral zenith
#

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?

sweet badger
floral zenith
sweet badger
#

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.

candid garnet
#

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?

floral zenith
minor agate
sweet badger
minor agate
#
map<ResourceName, ref array<bool>> mapEnabled = new map<ResourceName, ref array<bool>>();
minor agate
minor agate
candid garnet
#

then map in map would be:

map<ResourceName, map<string, bool>> mapEnabled();

or do you also have to ref the inside map as well?

minor agate
#

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

candid garnet
#

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

minor agate
#

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.

minor agate
#

rule of thumb, that is the case most of the time

candid garnet
#

ah ok. so when I'm all done with my method, if I use a ref, I should delete the ref before my return?

minor agate
#

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

candid garnet
#

alright, this is for a editor plugin, so I won't have to deal with any RPC atm which is nice.

open pier
#

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?

river imp
#

Create a base container instead of spawning

fathom pewter
#

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

river imp
fathom pewter
river imp
#

And create a base container and you can get whatever info you want from it

frail hound
#

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... 😦

frail hound
frail hound
#

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

bright burrow
#

Hey, anyone out there able to create logic so that Enfusion Persistence can be used with multiple factions instead of just one?

icy nest
thorn anchor
#

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.```
kind widget
#

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?

pliant ingot
kind widget
ocean kernel
#

Well jsonapistruct will make your mod break anyway so

pliant ingot
pliant ingot
kind widget
#

okay i got it, thanks guys
bohemia keeps surprising me

pliant ingot
thorn anchor
#

is there a way to view all the actions for actionlistener?

clever oxide
#

check actions in chimerainput.conf

thorn anchor
clever oxide
thorn anchor
#

yeah i found it now. i dont know why i didnt think of checking system folder

torn bane
kind widget
torn bane
#

I guess try if it works 🙂 context validity can be mostly ignored

kind widget
ocean kernel
#

JSON is not typed so it's a bit moot

thorn anchor
#

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.

eager harbor
#

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.

open pier
eager harbor
#

ok so replacing it is, thanks!

thick arch
#

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.

river imp
#

Why are you doing it so low in the hierarchy?

#

If it's specifically for characters do it in SCR_CharacterInventoryStorageComponent

frail hound
#

Has anyone encountered something similar? When running locally everything is fine, when I run dedicated under a character the models hang

sleek dove
#

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

thorn anchor
wind condor
#

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

wind condor
#

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

lament oxide
#

What is the call for wait/sleep in enfusion? I need to delay a part of my script by 10 seconds.

fervent cedar
#

you can call a fucntion later

lament oxide
#

That's what chatgpt said as well, but it wouldn't work in the context of the script I'm in.

river imp
#

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.

storm bobcat
#

I also wonder, how does it not work?

#

If nothing else, split the function in 2, and pass the needed context through callLater, yeah?

frosty coral
#

Is .SetLocation(ESystemLocation.Server) supported already? Seems like my system still being created on a client.

topaz locust
#

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.

ocean kernel
#

what exactly isnt working in the videos

shadow oxide
#

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());
    }
}
river imp
shadow oxide
# river imp 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.

river imp
#

owner.GetPrefabData().GetPrefabName()

shadow oxide
#

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

thorn anchor
river imp
#

He needs the prefab name to compare to his prefab

shadow oxide
#

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

river imp
#

Then in your custom component subscribe to SCR_CharacterControllerComponent.m_OnControlledByPlayer

shadow oxide
thorn anchor
#

find your charactercontroller component. then charactercontroller..m_OnControlledByPlayer.Insert(function)

i think thats how you would.

shadow oxide
#

So I do it through the character prefab then and not just a line of code?

thorn anchor
#
        if (charComp)
            charComp.m_OnControlledByPlayer.Insert(testfunction);```
#

Zelik can correct me if im wrong but it would probably be like that.

shadow oxide
#

I will give that a try, thankyou very much!

topaz locust
ocean kernel
#

How do you propel it forward?

topaz locust
ocean kernel
timid citrus
#

Or just a limitation of the engine?

ocean kernel
#

It's because the server and client disagree on the physics state, so the server "corrects" you

timid citrus
#

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

rapid ferry
real trail
#

Can someone disable this stupid assert.
Where i should store VoN characters now?

river imp
#

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.

shadow oxide
river imp
#

You're entering it as a "function call" and not as a function.

shadow oxide
#

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!

thorn anchor
# shadow oxide - Ah I've got it to stop erroring by adding the parameters to the function im in...

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");
    }
}
west prism
#

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?

thorn anchor
#

what is the best method for declaring a position on my component? pointinfo then getting the transform?

river imp
#

Maybe not between the two but they both have possible variable name conflicts

gloomy flume
#

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

thorn anchor
#

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.

gray dagger
#

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?

worn root
gray dagger
worn root
#

They still have a loadout component so you can dress them however you like

gray dagger
cyan seal
#

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));
    }
}
ocean kernel
#

Is there still no method to log chat messages on server without sending them via rpc from clients?

thorn anchor
fringe prairie
#

Not super familiar but onnewmessage might fire off for every client that recieves a message

cyan seal
fringe prairie
#

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

river imp
river imp
# cyan seal I’m encountering an issue when sending a chat message to the server via RPC. The...
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));    
    }
    //------------------------------------------------------------------------------------------------
}
cyan seal
#

it work very well now. im so new to this game scripting still feels good

ocean kernel
#

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

eager raft
#

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

ocean kernel
#

Not without breaking the EULA atm

eager raft
#

Oh my god, i hope it will change. My entire project depends on the possibility to migrate to Arma 4

ocean kernel
thorn anchor
#

Is there a way to reference another components positioninfo .ie pointinfo or entityslotinfo. without rewriting a pointinfo script.

pliant ingot
ocean kernel
#

I upgraded to a super ultrawide for this

torn bane
torn bane
# eager raft Anybody knows if Enfusion will support dll imports in the future ?

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.

ocean kernel
#

Cant mod BaseChatChannel in exp

#

Can mod FactionChatChannel

#

Ugh

fringe prairie
#

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...

serene yew
#

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 🤨

ocean kernel
#

Yes without it you are kinda modding the attributes out

serene yew
#

I guess it kinda makes sense as modded is basically inheritance under the hood.

open pier
#

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

ocean kernel
#

I had a thing for that

#

Cant find it tho

#

There are resource browser methods in Workbench, you can make a workbench plugin

shadow oxide
#

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?

open pier
eager raft
# torn bane If at all then only for dedicated servers. Unlikely ever for clients no matter w...

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

ocean kernel
#

What

eager raft
#

?

eager raft
ocean kernel
#

Just impressed by the complexity of your use case

eager raft
coarse pasture
#

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

river imp
#

You can only get the player UID from the server, you get it from the backend api

coarse pasture
#

Matching that to a player number/id that is

river imp
#

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.

coarse pasture
#

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

river imp
#

#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.

karmic drum
#

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

coarse pasture
# river imp If you're getting the uid from the player id, you'd then have to pass it to the ...

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
river imp
river imp
#

Client?

inland bronze
#

Is it possibly to change the mesh object of a prefab in runtime?

#

I believe not, yeah?

river imp
#

Yes

inland bronze
river imp
#

IEntity.SetObject

#

It can break things

inland bronze
#

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

river imp
#

Depends on what it is really

inland bronze
river imp
#

I don't mean, what the xob is lol

inland bronze
#

Oh sorry, misunderstood

thorn anchor
#

entityflags?

river imp
#

clearing the VISIBLE EntityFlag only hides the mesh. Actions and colliders are still there

#

gotta destroy the physics too

thorn anchor
#

ahh

open pier
#

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

shadow oxide
#

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);
inland bronze
shadow oxide
shadow oxide
inland bronze
#

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

thorn anchor
#

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.

shadow oxide
#

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

thorn anchor
#

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.

shadow oxide
thorn anchor
#

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.

fringe prairie
shadow oxide
#

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?

fringe prairie
#

What you could do instead is array<IEntity> PlayerList_Entities = J3FF_PlayerListMenu.GetPlayerListEntities();

shadow oxide
thorn anchor
#

you can do findhandler, findanywidget etc to get the widget or get a componet on a widget.

thorn anchor
open pier
abstract crescent
#

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).

high hawk
#

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?

topaz locust
shadow oxide
thorn anchor
shadow oxide
# thorn anchor 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();
thorn anchor
#

you could have your main menu send to your widgetcomponent. you are trying to populate the widgetcomponent?

shadow oxide
#

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

thorn anchor
#

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.

shadow oxide
#

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

thorn anchor
#

you are passing the array from your menu?

#

im not super skilled so im trying with what I know.

coarse pasture
# river imp Who is moving the camera?

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.

thorn anchor
#

@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();
}```
shadow oxide
#

I'll send you a dm with a broader view of my code, right now im not following how that code block will help

sand mortar
#

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?

livid forum
#
Faction GetFaction()

inside SCR_ChimeraCharacter

might also help hmmyes

candid garnet
#

how do i go about making a callback function?

ocean kernel
#

You cant pass functions as parameters to your own functions, only those made by BI

shy steeple
#

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"

#

Currently I am using the wiki code to execute on addAction.

rapid ferry
candid garnet
rapid ferry
#

nope, you can call it on any instance of a class

candid garnet
#

what would be a simple example of its implimentation?

sand mortar
rapid ferry
river imp
#

There are tiggers for that already

winter jay
#

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![blobcloseenjoy](https://cdn.discordapp.com/emojis/700312018430722060.webp?size=128 "blobcloseenjoy")  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.");

}

ocean kernel
#

Vibe Coding mods

quiet drift
#

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.

fringe prairie
#

no idea on specifics

#

There is Animation utility if you look that up in the script tools

gray dagger
#

can someone explain me how to activate this box? it not show up when i write the code

gloomy flume
#

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

thorn anchor
thorn anchor
#

whats the most efficient way to cause a method to pulse a few times? just using calllater on a reset method?

crystal cypress
#

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..

inland bronze
#

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);
}

}

fringe prairie
#

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.

fringe prairie
inland bronze
fringe prairie
#

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

inland bronze
#

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

river imp
#

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

inland bronze
#

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.

gray dagger
gray dagger
torn bane
# gloomy flume FileIO.FindFiles(folderPath2, files, FindFileFlags.FILES); scripts/Game/6467360...

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);
desert escarp
#

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

pseudo merlin
#

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.

frosty coral
sleek dove
pseudo merlin
#

This could rly be the case!
Thank you, will try to delay it. 👍

lapis creek
#

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.

ocean kernel
#

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

lapis creek
#

So it shouldn't negatively impact server performance?

ocean kernel
#

correct

#

admin tools even saves the connected players to json file

#

using this I think

lapis creek
minor agate
ocean kernel
#

1023 is not nearly enough

ocean kernel
#

How do I hide everything that isnt my mod in here? I only want to see my scripts here

ocean kernel
torn bane
ocean kernel
#

What about a markdown parser lol

pseudo merlin
torn bane
ocean kernel
#

Lol no

inland bronze
#

@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
torn bane
inland bronze
#

So the answer is yes, it needs to be broadcasted to peers?

ocean kernel
#

Where we at with collapsing code blocks?

torn bane
inland bronze
torn bane
#

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

inland bronze
high hawk
# inland bronze How would I track it across restarts then if using the entity Id, because it res...

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.

inland bronze
slow acorn
#

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

high hawk
fringe prairie
#

How would one give a gadget to a player? Specifically surrounding vehicle context.

open pier
#

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

high hawk
honest umbra
#

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;
}
torn bane
# inland bronze How would I track it across restarts then if using the entity Id, because it res...

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.

torn bane
# honest umbra I want to create a method to check player inventory and confirm if a specific it...

Your idea is not wrong, but a few things:

  1. 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.
  2. 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.
  3. 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 this InventoryStorageManagerComponent.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;
}
honest umbra
#

side note...how you get discord to display fancy colors when using the ?

torn bane
honest umbra
#

I appreciate the help!

ocean kernel
#

counter strike syntax highlighting

torn bane
#

There were also some bugs with it, I think 1.3 update fixes them already, if not the next major version would.

honest umbra
#

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.

torn bane
#

Forgot that we added that. Correct, even better choice

ocean kernel
#

Hand slot?

#

Or maybe it's the holster

dapper warren
#

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?

ocean kernel
#

I asked about it a few months ago I guess its gone for good

dapper warren
#

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

ocean kernel
#

Bro

dapper warren
#

doesn't make sense but works haha

ocean kernel
#

You dont even need a spline for a circle its just pi times radius

dapper warren
ocean kernel
#

Ah yeah could do some kind of on rails movement

torn bane
#

Equipped weapon is where each weapon slot on the char is stored. So 2 primarily. One hand gun. Two grenade slots

thorn anchor
#

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.

open pier
torn bane
#

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

red escarp
#

@river imp

#

Zeliks your addon bankink is broken with 1.3

river imp
#

I already fixed it

#

Download the update

red escarp
#

Ohh thanks

#

What the different?

#

In line 50 prefab

#

For i understand

river imp
#

I know I have mods that break and I'll fix them.

red escarp
#

I am sorry

thorn anchor
#

@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.

open pier
#

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

open pier
#

@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

torn bane
open pier
torn bane
#

Mismatch sounds like you are spawning something new and not loading it back so it gets new ids assinged

open pier
open pier
#

Thank you i'll look into it

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

solid hearth
#

why... why... why is this now being enforced on people using this system. Why is this not a config option. why

tired rover
#

So uh what happened with triggers

#

Why don’t they make sound anymore

open pier
#

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

tired rover
#

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

thorn anchor
#

what would be the simplest way to have a component call back to a menu?

cosmic mango
#
 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?

thorn anchor
#

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.

thorn anchor
#

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.

ocean kernel
#

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

torn bane
#

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

crystal cypress
# ocean kernel Like spawning a player, when the serialized entity is unserialized into a newly ...

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

ocean kernel
#

Cant work on my project though because it just keeps crashing with zero useful logs

crystal cypress
#

you n me both.. Current project breaks a bunch of editors..

ocean kernel
#

I can fix script errors but I cant fix crashes with no logs

fervent cedar
ocean kernel
#

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.

ocean kernel
#

I wish

thorn anchor
#

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.

river imp
#

Only if the player owns the prop

thorn anchor
#

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()?

thorn anchor
#

ahh okay

vernal moat
#

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 ?

thorn anchor
#

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?

vernal moat
#
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 ?
sullen oar
#

Hi guys, who knows how to fix it?

ocean kernel
#

Where did SCR_CharacterDamageManagerComponent.OnInit go

gloomy lynx
#

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

narrow fulcrum
#

How do you hide UserActions until the requirements are met?

narrow fulcrum
#

still appears sadly. im gonna try CanBeShown

karmic drum
#

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?

topaz pebble
#

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

solid hearth
fringe prairie
#

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

topaz pebble
#

@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?

fringe prairie
#

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.

topaz pebble
#

@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 🙌 🔥

gloomy lynx
solid hearth
#

It's been working since yesterday nightish haven't had an issue with it Shruge

fringe prairie
#

How can you RPC to a specific, potentially non-owner client without using Broadcast?

#

nvm

rare sparrow
fringe prairie
#

In case anyone wants to know users don't own radio components when they are holding them :)

fringe prairie
open pier
#

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

fringe prairie
rare sparrow
#

Lad

#

Top bloke over here

fringe prairie
#

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

midnight talon
fringe prairie
#

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

midnight talon
fringe prairie
#

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.

serene fox
#

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?

fringe prairie
#

But not confirmed, about to find out myself with some stuff I'm doing

serene fox
#

TY

fringe prairie
#

should be in the profile defined by peertool config

#

So My Games > PeerPlugin1 > logs

#

At least for me

midnight talon
#

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

fringe prairie
#

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

midnight talon
#

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?

midnight talon
#

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

fringe prairie
#

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?

tawny lotus
#

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.

fringe prairie
tawny lotus
fringe prairie
#

Try 0.0.0.0:2001?

#

Should be the same but who knows

tawny lotus
#

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.

fringe prairie
#

@west prism best advice I can give is log before you trigger that function and see if you see anything anywhere

ocean kernel
#

Is there a method for moving an item from one storage to another storage in a different entity?

ocean kernel
#

I found TryMoveItemToStorage but it doesnt refund me supply from arsenal

#

When I move item to arsenal storage with it

pseudo merlin
#

I think you first have to remove it from wherever it is?

ocean kernel
#

Oh I have to Rpc for the refund separately, things cant Just Work in this game, have to do 50 lines of boilerplate

fringe prairie
#

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

ocean kernel
#

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

fringe prairie
#

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

ocean kernel
#

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

fringe prairie
#

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

fringe prairie
#

Next update #login will be changed to /login and all passwords will get compromised /s

keen stag
#

is there a way to see how may players are in queue ?

frosty coral
#

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?

ocean kernel
#

200 times worse?

dark ocean
ocean kernel
dark ocean
#

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

ocean kernel
#

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.

dark ocean
#

because you're looking at it from functional perspective, not as a software engineer

ocean kernel
#

I'll just vibe code my way through it

dark ocean
ocean kernel
#

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

dark ocean
#

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

fringe prairie
ocean kernel
#

Also I cant find a method to simply check if I can afford the item in the arsenal

dark ocean
fringe prairie
#

Make sure to never open a menu on server as it will hand and crash clients lol

fringe prairie
# keen stag 😦

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();
}

fringe prairie
#

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

torn bane
#

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.

fringe prairie
#

Yep, but while in server API might be accessible?

#

Or is it only a thing when you are in the menu

torn bane
#

Yes the server could potentially know about itself. The lobby api seems like the right place.

fringe prairie
#

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

torn bane
ocean kernel
#

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

torn bane
#

I think the costs are simply configured differently. Check the method I named to see how. Entity catalog probably.

ocean kernel
#

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);?

vernal moat
#

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 ?

torn bane
# vernal moat hey arkensor, since update koth have JIP errors after changing scenarios with `R...

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.

vernal moat
torn bane
#

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.

vernal moat
static vale
#

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

ocean kernel
#

What controls whether weapon rank requirement is enabled or not?

#

Ah just conflict game mode lol

stable verge
#

idea ??

rapid ferry
#

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

tawny lotus
#

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?

tawny lotus
#

Hmmm.. or is it so that peertool behaves differently. Testing on DS seems to work as expected. On DS the markers are seen properly.

pearl sun
#

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

edgy field
#

Anyone had luck using external code editors for enforce script?

fervent cedar
#

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
tough cave
#

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.

icy rampart
#

Anyone know how I can add a new component to the PlayerController?

river imp
icy rampart
#

Found it now, cheers Zelik 🙂

river imp
icy rampart
#

👍 I've been trying to hack together WCS' Loadout Editor for Game Master, and I needed to add something to it

zinc dirge
icy rampart
#

This is less than optimal though 😂

quaint basalt
#

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

stable verge
#

Will someone create a mod to disable the Game Master budget?

thorn anchor
#

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();    
    }```
ocean kernel
#

Easiest way to make a GM spawnable item only be able to be spawned by admins?

frosty coral
#

make everyone admin

ocean kernel
#

Dont think there is a way to do it in vanilla

solid hearth
#

eeeh Any way to utilize -srcDefine with workbench instance (seems -srcDefine doesn't work at all.... sadCat) im dumb nvm

slow acorn
#

Plz expose the code for Door/SlidingDoorComponent so I can adapt it to make a custom overhead/garage door component

candid garnet
#

how do I go about grabbing the entity a player is looking at? or nearby entities of a certain type around the player?

slow acorn
fringe prairie
#

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

fringe prairie
#

@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

thorn anchor
#

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?

fringe prairie
#

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

thorn anchor
#

Ahh yeah, I had a section of my code that checks for isserver then gives ownership to player.

fringe prairie
#

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

thorn anchor
#

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.

fringe prairie
#

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

thorn anchor
#

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.

fringe prairie
#

Yep, had to do same thing for a dialog I made, it's convuluted but only way to get data from a player

thorn anchor
#

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.

fringe prairie
#

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

thorn anchor
#

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.

fringe prairie
#

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.

thorn anchor
#

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.

fringe prairie
#

I would have the RPC be the end of that function, and have the response from the server kind of act like a callback

thorn anchor
#

Yeah I RPC back to a callback in the menu.

fringe prairie
#

which runs a different function, and you could pass a bool with the RPC

thorn anchor
#

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?

fringe prairie
cosmic mango
#

How do I set all the clothes to the same rank without piercing each one?

#

clothes so that they are of the same rank*

solid hearth
# ocean kernel bump <:crypeepo:804561165677101106>

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.

fringe prairie
# ocean kernel bump <:crypeepo:804561165677101106>

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,

ocean kernel
#

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.

solid hearth
#

^ stay away from vanilla systems as much as you can...

ocean kernel
#

Not that there are any vanilla vehicle garage systems, but yeah

boreal swan
ocean kernel
#

This was made back when I was way more incompetent too so it should be motivating to undertake something similar

boreal swan
#

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)

tawny lotus
#

Did you ever find a solution for this? If yes, I'd be curious to know...

keen stag
#

is there a way to restart the game server ?

cosmic mango
#

How do I assign all the equipment a single rank?

vast flower
#

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.

serene fox
#

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
solid hearth
candid garnet
#

is there a way for the script editor to automatically fill arguments for an overrided method?

ocean kernel
solid hearth
#

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.

fringe prairie
remote oar
#

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

fringe prairie
remote oar
#

facepalm wow haha

fringe prairie
#

Example being SCR_PlayerController which extends PlayerController, usually it has more methods to help with scripting

remote oar
#

That makes a ton more sense

fringe prairie
#

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

remote oar
#

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?

minor agate
#

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)

remote oar
#

^^ Yeah I found this to be the case most times when comparing the two

minor agate
#

In the future, you will be able to mod CPP/Engine classes too but no ETA on that yet.

remote oar
minor agate
#

(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.

remote oar
#

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

fringe prairie
remote oar
#

AnimationController reveals no more than PlayerController. Getters and setters but nothing more than that fro mwhat I can see?

fringe prairie
#

@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.
remote oar
#

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

fringe prairie
#

make sure to run EOnFrame and set velocity to current velocity plus 10

remote oar
#

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

remote oar
#

Oh yeah setting velocity to 10 aloe wouldn't do much

fringe prairie
#

Actually, there is:
GetMovementState

remote oar
#

for anim?

fringe prairie
#

Yeah, under CharacterAnimationComponent - so you can atleast get the current movement index

remote oar
#

sweet I'll take a look at that thank you

sullen epoch
#

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?

sand mortar
#

I have created a gui and added a keybind to chimeraInputCommon but i'm not quite sure where i have to have the AddActionListener?

minor agate
#

Change the file name or create a special folder for your scripts instead.

spark otter
# torn bane Yeah it sucks because you loose the players briefly, but we discovered this issu...

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();
}

}

thorn anchor
flint fog
#

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?

candid garnet
#

curious, is there a way to determine if the connected player is from a certain region?

gloomy lynx
dense jackal
#

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

high hawk
dense jackal
#

(technically there is, but lookin through the definitions, I couldn't find the spot where that got defined)

high hawk
#

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.

dense jackal
#

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)

high hawk
#

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 😅

dense jackal
#

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

dense jackal
high hawk
dense jackal
#

true...

rare sparrow
#

thats from A3

torn bane
dense jackal
narrow aspen
#

any direction for adding like campaign defend/capture tasks in SF so the QRF AIs can take some area back from players

torn bane
#

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

dense jackal
winter jay
sand mortar
#

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);
    }
    
}
quiet drift
#

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 ?

flint fog
#

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?

red cedar
#

Is there any tutorial on how to make it so a custom keybind can be reassigned to a different key by the user ?

thorn anchor
ocean kernel
#

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

candid garnet
#

can you create dynamic user actions? that add and subtract actions based on script conditions? if so, is there an example?

tawny lotus
#

Anyone else notice that MapItem.GetPos() returns "0 0 0" on DS. Works perfectly in WB. This broke in 1.3.0.

late locust
#

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 🤔

flint fog
sleek dove
vast flower
#

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.

gloomy lynx
#

soooooo.... any way to debug rpl flooded yet?

ocean kernel
#

No u need to stop ddosing the server

gloomy lynx
#

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

inland bronze
#

Has anybody ever gotten BaseUserAction::SetCannotPerformReason() to work? Can't seem to get it to show the reason in-game on the action UI hmm

gloomy lynx
inland bronze
#

Yeah, EL does use it and I have it setup similar to them Hmm

#

Doesn't even seem like the vanilla reasoning works currently

inland bronze
#

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 thonk

#

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

sleek dove
#

You forgot to call Update method after setting the transform, so the bounding box is not correctly updated

inland bronze
#

yup, that was it, thank you!!

spark otter
# sleek dove No

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.

open pier
gloomy lynx
open pier
gloomy lynx
open pier
# gloomy lynx ive tried so many things and always end up with different results. removed 90% o...

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 😭

gloomy lynx
#

hmmmmm is the engine trying to load things twice??

#

causing flooded rpl

fringe prairie
#

I'll see if I can find the reference

reef aurora
#

anyone else getting this since updates 🤦‍♂️

open pier
#

Game.RequestClose() then a watchdog will start it back up right away

open pier
# vast flower What was the reason of removal of `SoundComponent` from entities on dedicated se...

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

reef aurora
pseudo merlin
#

I've fixed a bug causing it to not work with CRX just recently.
If you are not using it i have no clue.

vast flower
# open pier You think this change would have affect over vehicle sounds? Right now our serve...

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:

  1. 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.
  2. 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.
  3. 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.
  4. 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.

open pier
#

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 😎

vast flower
open pier
# vast flower I think you need to tune rplcomponent of your entity and enable entity presence ...

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

ocean kernel
#

I think it should be mandatory to flag mods that come with AI generated code somehow

minor agate
pseudo merlin
#

Many are using chat bots to generate images.
Proper A.I. image models can already do some pretty amazing stuff. 😉

open pier
pliant ingot
outer token
#

I can create some default workshop thumbnails, with AI 😅

red cedar
#

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)

late locust
#

Did anything change with signal manager? My signals are not signaling anymore ingame. WB, Peertool, Dedicated Server Tool all work thonk

storm bobcat
#

Where do I edit the rank of items in the arsenal?

ocean kernel
#

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?

unreal monolith
#

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?

timid citrus
ocean kernel
#

The only unmodded servers will be official ones at that point.

unreal monolith
ocean kernel
#

I would suggest making a goal that is something really basic, instead of jumping right into managing bans.

unreal monolith
#

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 ?

rapid ferry
dapper warren
#

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

ocean kernel
#

action listeners are local to the game that's running it

dapper warren
#

    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

late locust
crystal cypress
#

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!

civic finch
#

is there any one what is RHS_RhinoAttachmentComponent

crystal cypress
dapper warren
#

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?

ocean kernel
#

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

dark ocean
#

what do you mean by breaking? iirc all placeable object tiles will just appear locked

dark ocean
ocean kernel
#

Yeah I tried that it bugs out

#

Works serverside

dark ocean
ocean kernel
#

ok lets see

#

ok progress

#

now it works but can't ctrl+spawn

dark ocean
#

it sorted the same exact issue for me, but I only override limits for testing within workbench, so no guarantee for clients

ocean kernel
#

I will inflate the budgets to 999999

dark ocean
#

at least it's something

dark ocean
ocean kernel
#

inflating the budgets didnt change anything

#

I wonder if ctrl+spawn is controlled separately

solid hearth
#

I'll find it when I get to my pc.

#

Oh didn't see but keeyan posted it.

ocean kernel
#

Yeah the thing that remains now is to allow Ctrl+ click

#

It only places once then cancels

gloomy lynx
#

what do i do with this in slot manager
0-3? for 4 wheels?

#

for SCR_WheelSlotInfo

gloomy lynx
analog python
#

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

gloomy lynx
craggy jolt
visual atlas
#

is there a way to get the rplid/playerid of the person who called a server rpc w/o sending it thru manually?

visual atlas
#

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
    }
}
craggy jolt
#

I still hate that mouse wheel switches script editor tabs instead of just scrolling the tabs list horizontally

ocean kernel
#

My biggest issue is not being able to collapse code blocks I think

craggy jolt
#

Is there any trick in getting ItemPreviewWidget to work? I'm trying to raw script the widget to display something with no success.

ocean kernel
#

There was a method to make a preview from any entity into it

craggy jolt
#
    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
ocean kernel
craggy jolt
ocean kernel
#

I use it for my loadout editor

#

That manager is always in the world since it's used for... all item previews

craggy jolt
#

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

craggy jolt
ocean kernel
#

yippee

#

I use the render target widget to render my character preview world

craggy jolt
#

I still wonder what's missing in my script, is it even possible to get it to render the world without that manager?

ocean kernel
#

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

sleek dove
#

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

craggy jolt
#

I still wonder what I was missing in my script, in the end widget didn't display anything at all (not even world background)

sleek dove
#

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

craggy jolt
#

Spawning large object like a house should still show something even if both object and camera are at 0,0,0 but nope, nothing

minor agate
craggy jolt
#

And random strings, no change

minor agate
#

On both?

craggy jolt
#

Yes

minor agate
#

Share whole code including UI layouts

craggy jolt
craggy jolt
#

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

fringe prairie
torn bane
craggy jolt
craggy jolt
#

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

torn bane
#

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

craggy jolt
#

Yeah, it points to old asset paths, guessed so that its ancient

rapid ferry
#

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