#enfusion_scripting

1 messages · Page 1 of 1 (latest)

jade owl
#

i mean, simple trigger trig on my condition right? it suppose to fire every time i enter in right? it does print on console ( including dedicated server ) but not the sound

#

and ye i use rpc rpl broadcast

river imp
#

if you're not replicating your functionality correctly then you'll have different results when testing on a dedi

jade owl
#

in this func it should replicate it to all clients

#

but on dedi, it only fire one time

#

@river imp u want me to send u full code?

river imp
#

AudioSystem.PlaySound doesn't seem to be called in any vanilla scripts. Which to me would indicate it's not the proper way to actually be playing sounds.

ocean kernel
#

Works for me

river imp
#

I never said it didn't work.

jade owl
# ocean kernel Works for me

Do you have any suggestion to make the sound fire more than one on dedicated server, streamed to all clients connected?

river imp
#

call play sound twice

#

Or am I confused as to what you mean by that?

jade owl
river imp
#

In my tests it works perfectly fine.

#

be more specific about what you mean

#

If your trigger entity isn't set up correctly it will only fire the first time

jade owl
#

a trigger in specific position, player walk in , sound need to fire each time he go there, once the player need to hear it as well

jade owl
minor agate
#

It's not usable

#

It will get called every time that the entity streams out

jade owl
abstract crescent
river imp
#

I would say it's moreso unusable because you can't mod that class to begin with.

hazy cradle
#

I'm in the open source everon life mod im trying to learn how to script UI and get it to work in game

I may be wrong still very new to scripting here
but from what I understand this script EL_BetaHud.c is spawning in the ICONS and updating the food hunger and money

I'm just wanting to learn how this works so I can attempt to make the money value just display on the HUD of my mod im trying to make im referencing this mod because it works on here

so I think it spawns in the HUD because I do not see anything overwritten in chimera menu with this layout no entries with it

i don't see it in the player manager HUD components I also don't see it reference in the game mode so i have no idea how this is working other than just pure scripting alone I tried copy and pasting to see if it would work on my mod but no luck how do you guys figure this kind of stuff out I've torn it apart piece by piece but i cant seem to figure out how it works

river imp
#

What's EL_MoneyUtils.PREFAB_CASH?

#

From what I can tell it will change the money "text" when that prefab is added/removed from the owners inventory

#

Spawn some {5439738849229352}Prefabs/Items/Currencies/MoneyStack.et prefabs to see if it works correctly

slow acorn
#

Is there a method to replicate CharacterIdentityComponent to clients? Server side I'm running

Identity characterIdentity = identityComponent.GetIdentity();
characterIdentity.SetName(fullName);
identityComponent.CommitChanges();

But it seems clients can't see the change if they are in game when the change is made. New clients can see the change.

high hawk
#

I stumbled across SCR_EditorToggleUIComponent while I was checking out different layouts. I had been meaning to find an event like this, just kept forgetting. I'm looking the get the playername and and ID when this is triggered.

I also saw the GameStatsApi class has EditorStart. Which path am I better going down?

high hawk
#

Would it also work adding a event to the SetMessage() function in SCR_ChatMessageLineComponent?

#

ScriptedWidgetEventHandler Could solve this possibly? (Getting chatlogs)

#

just had a look in SCR_ChatMessage I think I can tackle this

minor agate
high hawk
minor agate
west prism
#
class S3C_InterfaceSettings : ModuleGameSettings
{
    [Attribute(defvalue: "0.25", uiwidget: UIWidgets.Slider, params: "0 1 0.01", desc: "Changes the opacity of the 3PP crosshair")] // #locale
    float m_fCrosshairOpacity;
}

//inside my modded SCR_InterfaceSettingsSubMenu
m_aSettingsBindings.Insert(new SCR_SettingBindingGameplay("S3C_InterfaceSettings", "m_fCrosshairOpacity", slider.GetName()));
LoadSettings();

sliderComponent.SetLabel("Crosshair opacity");
sliderComponent.SetShownValueMultiplier(100);

Hello, the SetShownValueMultiplier does not seem to work, my slider works fine but it goes from 0% to 1% instead of 0% to 100%, what am i doing wrong?

#

UpdateValue() isn't called in the slider component when calling SetShownValueMultiplier that's why it's not showing in the interface

#

Had to do this to make it work somehow, the final text values are not multiplied by the m_fShownValueMultiplier when m_bRoundValue is false

modded class SCR_SliderComponent : SCR_ChangeableComponentBase
{
    override float UpdateValue()
    {
        float value;
        if (m_wSlider)
            value = m_wSlider.GetCurrent();

        // Update displayed text, optional secondary value display
        if (m_wText && m_wText.IsVisible())
        {
            float value1 = value * m_fValueMultiplier + m_fValueOffset;
            float value2 = value * m_fSecondaryMultiplier + m_fSecondaryOffset;

            if (m_bClampValue)
            {
               value1 = Math.Clamp(value1, m_fMinValue, m_fMaxValue);
               value2 = Math.Clamp(value2, m_fMinValue, m_fMaxValue);
            }

            if (m_bRoundValue)
            {
              //value1 = RoundValue(value1 * m_fShownValueMultiplier, m_iDecimalPrecision); default
                value1 = RoundValue(value1, m_iDecimalPrecision);
              //value2 = RoundValue(value1 * m_fShownSecondaryMultiplier, m_iDecimalPrecision); default
                value2 = RoundValue(value2, m_iDecimalPrecision);
            }

            value1 *= m_fShownValueMultiplier; // <-- moved here otherwise it's only multiplied if m_bRoundValue is true
            value2 *= m_fShownSecondaryMultiplier; // <-- same

            m_wText.SetTextFormat(m_sFormatText, value1, value2);
        }

        return value;
    }
    
    //------------------------------------------------------------------------------------------------
    override void SetShownValueMultiplier(float multiplier)
    {
        super.SetShownValueMultiplier(multiplier);
        UpdateValue(); //<-- added this otherwise the display text does not update when calling this function
    }
};
#

I'll let it here if someone needs in the future idk

slow acorn
#

I enabled "Log actions" in the Diag menu under Game code -> User Actions. But do not see any logs for user actions in the console. Am I missing something?

west prism
#

I got a TouchComponent and use SetEventMask(EntityEvent.Touch) on a box and on my chimera character, but when i collide with the box nothing happens in my EOnTouch function, is it normal?

#

There's also an OnContact event, whats the difference between those?

#

OnContact works because those two entities have rigidbodies, so what's EOnTouch for?

river imp
#

iirc, EOnTouch fires once when something touches the object and EOnContact fires the entire time something is contacting the object.

#

I was messing with EOnTouch last night and couldn't get it to fire at all though.

#

Not sure what's changed.

#

You do have to set the active entity flag

#

but even so, nothing happens.

west prism
#

Maybe it's not implemented yet

river imp
#

It used to work

west prism
#

oh

river imp
#
class ZEL_TouchTestEntity : GenericEntity
{
    //------------------------------------------------------------------------------------------------
    override private void EOnTouch(IEntity owner, IEntity other, int touchTypesMask)
    {
        PrintFormat("OnTouch triggered by entity %1 of type %2", other,touchTypesMask);
    }
    //------------------------------------------------------------------------------------------------
    void ZEL_TouchTestEntity(IEntitySource src, IEntity parent)
    {        
        SetFlags(EntityFlags.ACTIVE);
        SetEventMask(EntityEvent.TOUCH);    
    }
    //------------------------------------------------------------------------------------------------
}
#

Used to be all you need ^

west prism
#

Yeah i saw that in the SCR_SectorSpawn entity script

river imp
#

I guess the functionality was removed. Yet another change that wasn't documented in any patch notes (that I can recall).

jade owl
abstract crescent
#

Can i block item pickup by specific player without changes in player prefab? I tried use "InventoryItemComponent" in item, but didnt find any way.

river breach
#

how to teleport player from server ?

keen stag
#

When the game ends, how to know what team won?

clever oxide
#

What does it mean the description at WorldTimestamp GetServerTimestamp();

"This timestamp may jump forward or experience time dilation (slow down or speed up), but it will never go backwards."

How Slow down or Speed up? Is it sensitive to Day/Night Duration? Or what?

hollow oak
#

sorry for tagging an old post but did you manage to solve this issue? Still getting Reason: Dedicated server is not correctly configured to connect to the BI backend. error 😦

river imp
#

That means your server isn't connecting to the backend?

hollow oak
river imp
#

Because your server isn't connected to the backend

#

The error gives you a link to follow

#

If you only get that error sometimes then it could just be that the backend is down.

hollow oak
river imp
river imp
hollow oak
river imp
#

Actually after further reading Ark explained that it wasn't the issue. So now I have no idea what it is lol

#

It must be server/backend related then.

vernal moat
river imp
#

I didn't think to ask but, just assumed that he wasn't calling it himself and the mod was spitting the error when it tried to get the PlayerIdentityId

hollow oak
vernal moat
#

looks nice enough i dont much about EDF or GetBackendEnv stuff

#

koth is using a slightly modified EDF version

#
    static string GetPlayerUID(int playerId)
    {
        #ifdef WORKBENCH
            return string.Format("bbbbdddd-0000-0000-0000-%1", playerId.ToString(12));
        #endif
        
        if (!Replication.IsServer())
        {
            Log("GetPlayerUID can only be used on the server and after OnPlayerAuditSuccess.", LogLevel.ERROR);
            return string.Empty;
        }

        string uid = GetGame().GetBackendApi().GetPlayerIdentityId(playerId);
        if (!uid)
        {
            if (RplSession.Mode() != RplMode.Dedicated)
            {
                // Peer tool support
                uid = string.Format("bbbbdddd-0000-0000-0000-%1", playerId.ToString(12));
            }
            else
            {
                Debug.DumpStack();
                Log("Dedicated server is not correctly configured to connect to the BI backend. playerId is "+playerId, LogLevel.ERROR);
            }
        }

        return uid;
    }
    ```
#

allowing to handle peer tools mainly

river imp
#

I haven't had to modify any of those classes and never have any issues testing in peertool

#

It's so weird that you have to and I don't.

hollow oak
vernal moat
river imp
#

I've been using it since the day it was uploaded and never had any issues

river imp
#

No

vernal moat
hollow oak
vernal moat
#

i think we are misunderstanding 😄

river imp
hollow oak
river imp
#

I just looked at the first release on git

#

If you couldn't get a PlayerIdentity (then called PlayerUID) it would use "BBBBDDDD-0000-0000-0000-%1", playerId.ToString(12)

#

same as it does now

vernal moat
#

hum actually

#

the issue is that OnPlayerAuditSuccess does not trigger for peer tools

#

so i have to also handle OnPlayerConnected which in my case also calls GetPlayerUID method shown above

river imp
#

OnPlayerAuditSuccess used to get called on peer tools

#

That or i'm losing my mind.

#

I don't test on a dedi.

#

I've always used peer tool and distinctly recall getting the PlayerUID from on audit success

#

I'm sure you could do a search and see where I tell people to call it from that method

#

I do remember having to switch to using OnPlayerConnected though.

river imp
hollow oak
# river imp ?

I thought it might be because of usage webproxy db somehow

vernal moat
river imp
#

I don't remember 100% accurately.

#

I do know it was before the framework was even released.

vernal moat
#

per arkensor words (as much as i remember) audit success means BI servers properly auth you, so it make sens that they cant auth random peer tools

#

tho i suggested to use the new diag exe version to bypass this and simulate the proper behavior

river imp
#

Oh, I bet that's when I switched to on connected though

#

before I knew to use the diag executables lol

vernal moat
vernal moat
river imp
#

Regardless, I distinctly remember getting the player UID from on audit success and i have never tested on a dedicated server.

#

How long ago that was I don't know

#

How long you were able to do that, I don't know either.

vernal moat
#

¯_(ツ)_/¯

#

arma 4 will answer this

hollow oak
#

in theory there's a way to get rid off bi uid completely by just creating uuid randomly

river imp
#

Then you won't have persistence

hollow oak
#

So I could add another identificators such as username and steamID (for PC)

river imp
#

You can't get their steam ID

hollow oak
#

as a disadvantage - you'll have to use some sort of whitelist

river imp
#

Too much trouble

#

Not worth it

#

I have a whitelist mod

#

And it uses the player UID lol

open pier
#

No reason to add a second layer to something that's unique per account anyways

west prism
#

why would you create an uuid when you can use their uid

tawny lotus
#

Is there a preference to do one over the other:

{
//fill the array with strings
}```
..or..
```array<string> FillArray()
{
//fill the array with strings
return filledArray
}```
pseudo merlin
#

I use return whenever i have one value.
out if i need multiple.
But that's just me.

pliant ingot
tawny lotus
pseudo merlin
#

But the out array has to be pre-defined?

pliant ingot
tawny lotus
high hawk
#

@minor agate anything new with Systems or Controllers in 1.3?

fervent cedar
#

🙏 arma reforger world controller 2025

high hawk
#

I think its mah powertoys app but win + alt is making my tool play pong on my screen, cannot seem to find a keybind for debug menu, halp 59918pepeangry

fervent cedar
#

win + alt or win + ctrl

#

I haven't tried bvut maybe numpad can control it too?

#

Is there a way to toggle the debug menu instead of having to hold ndown the keys? 🤔

high hawk
#

thankyou

ocean kernel
#

Yes you can place something heavy on the keys then you dont have to hold it down

thick arch
#

anyone know how to disable colliders on a character entity/player? currently doing:

Physics physics = owner.GetPhysics();    

physics.SetInteractionLayer(EPhysicsLayerDefs.CharNoCollide);
physics.ChangeSimulationState(SimulationState.NONE);
physics.EnableGravity(false);
physics.SetVelocity(vector.Zero);
physics.SetAngularVelocity(vector.Zero);
physics.SetMass(0);
physics.SetDamping(1, 1);
physics.SetActive(ActiveState.INACTIVE);

every frame, but that isn't having any effect in a server environment.

#

ChangeSimulationState seems to allow me to have vehicles ignore character colliders, just need a method to have other characters ignore eachothers colliders (player and AI)

livid forum
#

👇

just put the mutitplier to 0, should work no?
Tested it a bit and I couldnt figure out to zoom anymore, even when I switch the keybind.

#

☝️

ocean kernel
#

I just made it call GetGame().RequestClose()

river breach
#

is there a way to reload world

#

from script

sweet badger
ionic pewter
#

Is there a way to interact with thing outside of a vehicle? example. say you're coming to a gate, and want to be able to "interact" hit the button to open the gate without getting out of the vehicle

spark otter
#

I would think that should be possible with scripting!

#

I would put the action for it up on the visor of the vehicle as if it were a garage door opener

ionic pewter
# spark otter I would think that should be possible with scripting!

Okay, so I'm trying to create a basic 'repelling' test using helicopters. As a starting point, I'm using a ladder for testing. I've managed to spawn the ladder as an entity child of the helicopter, so it's properly attached. Interestingly, ladders allow interaction with other objects. For example, if I climb up the ladder, I can enter a seat directly from it—but I can't do the reverse. That's the issue I'm trying to figure out right now.

thick tinsel
#

Sorry to dig up a year old post, however I am trying to work out how to disable refunding of items, gear, weapons etc as supplies. I see the sell multiplier is still set to 0. Does this mean that it has not yet been implemented and therefore I have to play around with the generators to disable supplies for conflict?

high hawk
# ionic pewter Okay, so I'm trying to create a basic 'repelling' test using helicopters. As a s...

I'd recommend looking at making a customer "repel" action, and allowing it to be performed by a passenger. Take a look at the handbrake, lights etc and how it works with seeing if the player is in the specific 'compartment'

Also for your ladder, u could probably just add the ladder component to the heli (could be wrong) but then you can just define the entry and exit positions to your liking.

ocean kernel
#

Make an action that ejects and ragdolls the player and sets their gravity to 0.1

#

Done

ionic pewter
#

@high hawk Thanks, I'll look into that further. Regarding the handbrake and lights, I find it quite frustrating to develop mods in this environment due to the many limitations on what I can access.

For example, I created a mod for the flashlight Flashlight Stays On When Dropped, but I couldn’t find any references to the button that toggles it on or off, as it seems to be locked behind inaccessible systems. This makes it difficult to find real use case examples in the code, which is quite irritating.

high hawk
high hawk
#

Sure

quaint basalt
#

I am only starting to mess with replication
I am trying to send code to be executed on server, after key pressed.
Here's the code:

override protected void EOnInit(IEntity owner)
{
    GetGame().GetInputManager().AddActionListener("ActionToggle", EActionTrigger.DOWN, OnToggle);
}
    
    
protected void OnToggle(float value, EActionTrigger reason)
{
    Rpc_AskToggle();
    Rpc(Rpc_AskToggle);
}
    
[RplRpc(RplChannel.Reliable, RplRcver.Server)]
void Rpc_AskToggle()
{
    if (!Replication.IsServer())
        return;
    // code
}

But the Rpc_AskToggle does not run on server as I imagined it should. What am I missing here?

ocean kernel
#

Is the entity you are running rpc from owned by the client?

quaint basalt
#

hmm, yes, I think

#

I need to give ownership to server?

slow acorn
slow acorn
quaint basalt
# slow acorn In the words of lord Mario "You can only communicate from client to server if th...

Ok so this entity is a gadget, when I have this ScriptedUserAction assigned to this entity , it does run on server:

class ZEL_SpawnUserAction : ScriptedUserAction
{
    ResourceName m_PrefabPath = "{FFF30795991DC01C}Prefabs/Rocks/Granite/Rock.et";
    //------------------------------------------------------------------------------------------------
    override bool GetActionNameScript(out string outName)
    {
        outName = "Spawn Rock";
        return true;
    };
    //------------------------------------------------------------------------------------------------
    override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
    {
        if(!Replication.IsServer())
            return;
        
        Resource LoadedResource = Resource.Load(m_PrefabPath);
        if(!LoadedResource)
            return;
        
        IEntity Rock = IEntity.Cast(GetGame().SpawnEntityPrefab(LoadedResource));    
        if(!Rock)
            return;
        
        vector WorldTransfrom[4];
        pOwnerEntity.GetWorldTransform(WorldTransfrom);
        Rock.SetWorldTransform(WorldTransfrom);
        Rock.Update();
        SCR_EntityHelper.DeleteEntityAndChildren(pOwnerEntity);
    }
    //------------------------------------------------------------------------------------------------
}``` (I copied and pasted code found on this channel)
slow acorn
#

@quaint basalt ScriptedUserAction is automatically performed on the server and user side by default. So not a great comparison . I can help you over a screen share if thats easier for you

thick arch
slow acorn
thick arch
slow acorn
river breach
#

how to make player use spectate camera when dead ?

river imp
#

@quaint basalt

#
modded class SCR_FlashlightComponent : SCR_GadgetComponent
{
    //------------------------------------------------------------------------------------------------
    [RplRpc(RplChannel.Reliable, RplRcver.Server)]
    void Ask_Authority_Spawn()
    {
        Resource LoadedResource = Resource.Load("{50A68300B537EDFA}Prefabs/Items/Food/ArmyCrackers_Soviet_01.et");
        if (!LoadedResource || !LoadedResource.IsValid())
            return;
        
        IEntity Crackers = GetGame().SpawnEntityPrefab(LoadedResource);    
        if(!Crackers)
            return;
        
        vector WorldTransfrom[4];
        m_CharacterOwner.GetWorldTransform(WorldTransfrom);
        Crackers.SetWorldTransform(WorldTransfrom);
        Crackers.Update();
    }    
    //------------------------------------------------------------------------------------------------
    override void OnToggleActive(bool state)
    {
        super.OnToggleActive(state);

        if (m_bActivated)
            Rpc(Ask_Authority_Spawn);
    }
}
boreal swan
#

Are there any plans or ETA for Enforce Script syntax highlighting e.g. in PrismJS?

boreal swan
# minor agate No plans

I just realized that the syntax highlighting exists on BIKI already. I guess it can't be easily ported?

abstract crescent
#

I want collapse functions and classes code in script editor inUA_pepe_crying

frosty coral
#

if a vanilla method commented as "// unused" does that mean that it will likely be removed in the future?

river imp
#

It probably just means its unused. Things that will be removed are marked as obsolete

trim lagoon
#

hey can anyone tell me how to setup a new gamemode? I´m thinking of a gamemode that only shows one AO at the time for both factions, if any of the two captured the AO another single AO will be set for both factions. Is it possible to script such a scenario with the workbench? The game should give the players the optjective that need to be captured and shows it on screen when its active and when its captured

tawny lotus
#

Is Loiter waypoint supported in current version? Seems that giving it to an AI, does nothing.

errant wren
#

Tell them to defend

#

At the loiter spot

tawny lotus
high hawk
#

Can someone explain how I would subscribe to this event:

void ScriptInvokerOnPossessedProxyMethod(int playerID, bool isPossessing, RplId mainEntityID);
typedef func ScriptInvokerOnPossessedProxyMethod;
typedef ScriptInvokerBase<ScriptInvokerOnPossessedProxyMethod> ScriptInvokerOnPossessedProxy;

[ComponentEditorProps(category: "GameScripted/GameMode/Components", description: "")]
class SCR_PossessingManagerComponentClass : SCR_BaseGameModeComponentClass
{
}

class SCR_PossessingManagerComponent : SCR_BaseGameModeComponent
{
    protected ref map<int, RplId> m_MainEntities = new map<int, RplId>();
    protected ref ScriptInvoker Event_OnPossessed;  // <-- I want this one, so I know when GameMaster or any editor possessed
    protected ref ScriptInvokerOnPossessedProxy Event_OnPossessedProxy;
river imp
#

My first question would be, as per usual. What are you actually trying to do?

high hawk
#

Or should I go to one of the editor components that have a public getter

river imp
#

I know want you're asking for help doing. I can read lol. I was curious as to what you're actually trying to do, because there may be other ways to achieve whatever it is you're trying to do.

high hawk
#

I'm just trying to log gamemaster usage so I can put a little more trust into my admins. I don't really need to log everything that happens, just if it was possessed and when.

river imp
#

Oh okay, I'm not too sure about the gamemaster stuff but, I'll hash out something for you.

high hawk
river imp
#

Well, it's just a ScriptInvoker

high hawk
#

in editor manager?

#

I been just having a look

#

Brings me to my next question, no experience using scriptinvokers, you cannot use protected ones right?

#

Probably a stupid question to most, but I wanna learn a lil

fringe prairie
#

If there is not you can mod the class to make a helper method which returns the script invoker

high hawk
#

yeah just didnt know around invokers, cheers

river imp
#

Okay, So I'm confused a bit. Why did you want to use the SCR_PosessingManagerComponents script invoker?

high hawk
#

hah, just found SCR_ScriptInvokerHelper aviator

high hawk
#

Its, on GameMode, so thinking logically (for me) I looked there first

river imp
#

But what would the Posessing manager have to do with gm mode?

high hawk
#

Possessing another mode?... I then went through the editor stuff. I was simply asking how to sub to an event, then we went on this lil journey together.

#

Plus, have you seen how much there is to the Editor side of things?

river imp
#

I just thought you knew something that I didn't

high hawk
#

Wouldnt be worth the battle even if I did

river imp
#

Possession happens when a player takes control of a "controller" in most cases.

high hawk
#

Define possession

river imp
#

Take control of.

#

Like a ghose possesses someone

#

ghost*

high hawk
#

So one would say possession manager could potentially lead to what I was looking for at first glance?

river imp
#

If GM mode had a controller that you connect to

#
[ComponentEditorProps(category: "GameScripted/Misc", description: "")]
class ZEL_ScriptInvokerExampleComponentClass : ScriptComponentClass{}

class ZEL_ScriptInvokerExampleComponent : ScriptComponent
{
    PlayerManager m_PlayerManager;
    //------------------------------------------------------------------------------------------------
    override void OnPostInit(IEntity owner)
    {
        SetEventMask(owner, EntityEvent.INIT);
    }
    //------------------------------------------------------------------------------------------------
    override void EOnInit(IEntity owner)
    {
        m_PlayerManager = GetGame().GetPlayerManager();
        if(SCR_PlayerController.GetLocalControlledEntity() != owner)
            return;
        GetGame().GetCallqueue().CallLater(DelayedInit,1000,false,owner);
    }
    //------------------------------------------------------------------------------------------------
    void DelayedInit(IEntity owner)
    {
        SCR_EditorManagerCore core = SCR_EditorManagerCore.Cast(SCR_EditorManagerCore.GetInstance(SCR_EditorManagerCore));
        if (!core)
            return;

        SCR_EditorManagerEntity editorManager = core.GetEditorManager();
        if (!editorManager)
            return;        
        
        editorManager.GetOnOpened().Insert(FunctionToInvoke);    
    
    }
    //------------------------------------------------------------------------------------------------
    void FunctionToInvoke()
    {
        int PlayerID = m_PlayerManager.GetPlayerIdFromControlledEntity(GetOwner());
        Rpc(Ask_Authority_PrintStuff,PlayerID);
    }    
    //------------------------------------------------------------------------------------------------
    [RplRpc(RplChannel.Reliable, RplRcver.Server)]
    void Ask_Authority_PrintStuff(int PlayerID)
    {
        PrintFormat("%1 Opened GM Mode",m_PlayerManager.GetPlayerName(PlayerID));        
    }
}
high hawk
jade owl
#

hI here capture the flag template, working in dedicated server ( in workbench u can see the print for each rpc call but u wont hear sound's event or hint notifications else ur in dedicated ) all features of classic CTF of arma 1-2-3 , spawn no entry protection, custom stam/jump/speed etcc
try it, make it better or use it to make ur own, i hope to see many servers with ctf mode online since was my favorite mode of arma , including warfare ( old benny style )
Enjoy https://drive.google.com/drive/folders/1UtGB9tIGMjfGby0R7IUqvG9rWqF0_Jsm?usp=drive_link

shadow oxide
#

Hello, Im new to scripting and have been reading the wiki's. Im having an issue where my class isnt highlighting teal and isnt being recognized as valid for configs... Does anyone know why this might be?

spring shale
#

Well valid for configs requires a special header.
If you put a space between the: it might make it show up teal.

Also too if you're inheriting from something. You're generally going to overwrite what your putting down in your example.

shadow oxide
#

What a disgusting url

#

I got it to work by recreating it in the game scripts folder and adding this header which I got from an existing context action. I wonder why the wiki tutorial doesnt mention the requirement of a header.

spring shale
#

When you do base container props, It's basically going to make that into a config file generator. If I recall correctly.

So you generally don't want any real functions in it.

The general context action, might require the matching class header. I can't remember. I'd have to load up my computer and not going to do that at the moment.

shadow oxide
#

Does anyone have a good way of creating a scriptable camera and then setting its transform? I found some brief convos in this channel, but no one has actually said how to create it

scarlet sage
#

Now dumb question, how does one override or edit an exsiting script 😅

scarlet dune
#

save it @scarlet sage

#

so you would edit it then save it

scarlet sage
#

Essentially how do I edit a locked script 😅

scarlet dune
#

do you have a sqf editer program

scarlet sage
#

Yup

scarlet dune
#

well if its locked i wouldnt mess with it

scarlet sage
#

I want to edit the scrip (the one above) to make it so AI don't spawn until a player comes within a certain distance. I'm working on developing a PvE Conflict

scarlet dune
#

what kinda file is that

shadow oxide
scarlet sage
#

Its to help maximize the efficiency of the PvE game mode

scarlet dune
#

but what kinda of file is that there

#

thats not a reg sqf file is it

#

is that a pbo file

#

thats just an image

#

so are you saying the pbo is locked

spark otter
#

sqf is not a thing in reforger

scarlet sage
#

This is where it's located, It was suggested to me to look in this file and edit it to adjust the spawn radius. I found in the code where I need to adjust it, but can't make any adjustments

spark otter
scarlet dune
#

oh sorry m8 im in the wrong channel oops

spark otter
#

then add "modded" in front of the classname

scarlet sage
#

lol, its okay Scotty

scarlet dune
#

i dont have reforger

scarlet sage
#

There is no override 😅

spark otter
#

then duplicate and change the name to something unique to your mod

scarlet sage
#

kk

spark otter
#

Like in my pve mod, I changed SCR to CPR

scarlet sage
#

like this for Modded?

#

I believe it worked!

#

I just have to make some adjustments and play around, but thank you!

scarlet sage
spark otter
spring shale
#

Related

civic finch
#

how do i make it so i can appear near radio operators without having to activate it every time the server restarts

high hawk
#

Does a directory for FileIO operate different on Windows and Linux?

#

string directoryPath = "$profile:/Path1/Logs";
vs
string directoryPath = "$profile/Path1/Logs";

#

Or as I read from MarioE, using absolutepath is preffered? meaning just list the entire dir and the file name + extension?

torn bane
high hawk
#

Sooo, MapMarkers or MapEntities Editor? Idk, there is a few configs sitting in the map Dir.. More than I'd like to have seen. How would one utilize a custom marker? Or start looking, just like any info would be greatly appreciated hmmhd

remote moss
#

What can I use to judge if a player is making contact with an object or not?

dapper warren
#

Hi - if I want to slow down the fall of a player and I have a script for that how can I attach that script to the base character so it works for every player? (this is for the rappel mod)

thorn anchor
#

what are the main storage components used on players? im trying to figure out how to manipulate inventory with inventoryaction.

thorn anchor
#
{
    #ifndef DISABLE_INVENTORY
    //------------------------------------------------------------------------------------------------
    override protected void PerformActionInternal(SCR_InventoryStorageManagerComponent manager, IEntity pOwnerEntity, IEntity pUserEntity)
    {
        Print("Running loot action");
        
        manager.SetLootStorage(pOwnerEntity);
        

        array<IEntity> itemsToMove = {};
        array<BaseInventoryStorageComponent> outStorages = {};
        
        itemsToMove.Clear();        
        manager.GetAllRootItems(itemsToMove);
        PrintFormat("total items: '%1'", itemsToMove.Count());
        
        if (itemsToMove.IsEmpty())
            Print("failed to find items");
            return;
        

        foreach (IEntity item : itemsToMove)
        {
            if (item)
            {
                PrintFormat("'%1'", item);
                manager.MoveItemToVicinity(item);
                
                manager.TryRemoveItemFromInventory(item);
            }
        }
    }
    #endif
};```
#

regardless of loot count im getting the same array print out.

thorn anchor
#

hmm does does modifying an inventory not work as an action because the player being modified cant be modified locally by another player?

#
{
    #ifndef DISABLE_INVENTORY
    override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
    {
        SCR_InventoryStorageManagerComponent manager = SCR_InventoryStorageManagerComponent.Cast(pOwnerEntity.FindComponent(SCR_InventoryStorageManagerComponent));
        if (!manager)
            return;
        
        Print("Running loot action");
        
        manager.SetLootStorage(pOwnerEntity);
        

        array<IEntity> itemsToMove = {};
        array<BaseInventoryStorageComponent> outStorages = {};
        
        itemsToMove.Clear();    
        outStorages.Clear();    
        manager.GetItems(itemsToMove);
        manager.GetStorages(outStorages);
        PrintFormat("total items: '%1'", itemsToMove.Count());
        PrintFormat("total items: '%1'", outStorages.Count());
        
        if (itemsToMove.IsEmpty())
            Print("failed to find items");
            return;
        
        foreach (BaseInventoryStorageComponent storage : outStorages)
        {
            foreach (IEntity item : itemsToMove)
            
            if (item)
            {
                PrintFormat("'%1'", item);            
                manager.TryDeleteItem(item);
            }
        }
    }        
    #endif
};```
river imp
#

What's the use case for that?

thorn anchor
#

stripping gear off of a body. potentially stripping gear off a body into another storage entity.

#

I tried to do moveitemtovicinity() but couldnt get it to work either. counts are coming back right now as i modified it.

thorn anchor
#

got it to work finally. idk why it wasnt before. i think i had a pair of brackets missing

river imp
#

Why do you have a nested foreach?

static vale
#

Can someone explain to me why the surface transform(param.TraceNorm) isn't right for creating decals on anything not the terrain?

Decal decal = world.CreateDecal(
            param.TraceEnt, 
            intersectionPosition,
            param.TraceNorm,
            0.0,
            2.0,
            0,
            5,
            1,
            "{A8D6D483CF4BB8FC}Assets/Decals/Blood/Blood_Pool_Decal4.emat",
            10,
            0xFFFFFFFF
        );
#

If i flipped the TraceNorm then the decal partially works

Decal decal = world.CreateDecal(
            param.TraceEnt, 
            intersectionPosition,
            param.TraceNorm * -1,
            0.0,
            2.0,
            0,
            5,
            1,
            "{A8D6D483CF4BB8FC}Assets/Decals/Blood/Blood_Pool_Decal4.emat",
            10,
            0xFFFFFFFF
        );
visual atlas
#

how can one draw a line on the screen in release game?

river imp
thorn anchor
river imp
# thorn anchor dumb mistake, wasnt needed. i fixed it now.
    override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
    {
        SCR_InventoryStorageManagerComponent manager = SCR_InventoryStorageManagerComponent.Cast(pOwnerEntity.FindComponent(SCR_InventoryStorageManagerComponent));
        if (!manager)
            return;
        
        manager.SetLootStorage(pOwnerEntity);
        
        array<IEntity> itemsToMove = {};    
        manager.GetItems(itemsToMove);
        if (itemsToMove.IsEmpty())
            return;
        
        foreach (IEntity item : itemsToMove) 
            manager.TryDeleteItem(item);
    }  
#

The jacket and stuff will all be gathered from GetItems

thorn anchor
#

does try delete, fully delete the entity?

river imp
#

there's no need to get storages too

visual atlas
river imp
visual atlas
#

draw a line. from one point to another. on the screen

#

the most basic form of computer graphics

#

Shape class does this but is only enabled in debug game

thorn anchor
#

Getitems will make it so all the individual items get dumped instead of keeping them in the clothing right? i did getrootitems instead. only issue is it seems like it didnt grab the watch off the body.

river imp
#

GetItems gets everything

#
foreach (IEntity item : itemsToMove)
{
    Print(items);
    manager.TryDeleteItem(item);
}
#

You'll get null prints because it will get to an item that was in a jacket that has already been deleted because the jacket was deleted.

river imp
#

Create a layout, get the workspace, create the widget from the layout in the workspace, draw a line on it.

visual atlas
#

ty for the tip

#

will try that

thorn anchor
#

trydelete works but not what im doing. I am wanting the items to come off the player. in the future I might have it go into a new spawn storage on the body.

if i getitems, it will just dump every items out of each clothing piece. if i getrootitems, it gets the top level inventory.

#

its working fully now though.

river imp
#

Not sure why you were using TryDeleteItem in the first place then

thorn anchor
#

ahh i switched it while testing

#

my first code has it. my bad.

river imp
#

That gives no indication of weather the other function will call successfully or not

#

always test with what you're trying to do and not some other "replacement" function

#

Not all functions will work just because another one does.

thorn anchor
#

yeah thats true

river imp
# visual atlas ty for the tip

A simple search for "Line" in Find Symbol would have given you some prime examples of what you're trying to do. Check out the MapLine class.

static vale
elder wigeon
#

Hey guys! Can anyone tell how i can get via script if base is in friendly radio range or not?

#

For conflict

#

I want to repaint the default yellow flower

shadow oxide
#

I'm trying to attach a camera to a players head and im losing my mind with the offset. For some reason putting a negative number in the up axis of the vector creates a positive value during runtime... No clue why. Here is my relevant code, let me know if more is required:

_unit.AddChild(entity,_unit.GetBoneIndex("Head"),EAddChildFlags.AUTO_TRANSFORM);
        
vector transform[4];
transform[3] = "0 -0.5 0";
entity.SetLocalTransform(transform);
abstract crescent
high hawk
#

Storages placed at runtime, do they need to be updated once the entity they are attached too is spawn/placed in the world?

#

I imagine it'd be similar to how SCR_PlacingEditorComponent works with CreateEntityOwner() ?

high hawk
#

omg lmao, never mind. Had weight set to 0 hmmyes

south path
#

Hey all, does anyone know, what is the proper way to RPL a .OpenMenu(...) to all players?

high hawk
red escarp
#

Zelik i need merg everon life hud of money with your money for banking

river breach
#

how to have entity load before another ?

torn bane
river breach
#

lower as in actually lower in the hierarchy ?

torn bane
#

hierarchy has a special meaning, not sure what you mean. we simply load each layer in the order they are in and then each entity from each layer in their order. it is just co-incidence ratherr than design, but you can somewhat rely on it if you want to

river breach
#

s first will load first ?

#

@torn bane

minor agate
thorn anchor
#

what would be the best logical way for two nearby components to sync together? if for example I wanted both doors to open and close if even of them were touched?

keen stag
#

how to send a message from the player to the server ?

fringe prairie
#

I have found myself in same predicament, I just want to move a bone on clients peepoDownCry

#

I saw your post about turning it into a ScriptGameComponent - very weird if this works.

minor agate
minor agate
#

Read a bit (Just a message on top on what exact path means in this engine).

#

Exact Path in Engine does not mean absolute path

solid hearth
#

Question about navmesh... It has zero relation with players correct? Just a random question came into my mind about players falling through certain objects when going into an uncon state and curious if navmesh affects that.

fringe prairie
ocean kernel
#

Well hold on there for a second. I am an AI agent so I need it.

rapid ferry
fringe prairie
# rapid ferry ScriptGameComponent with TickOnProxy works for alot of things I do

Yeah - on workbench my bone movement works fine, for context I am doing it on a vehicle because moving/scaling the bone is the only way for me to modify this base game vehicle. It's not working in MP and the script is running on clients, even after the switch to ScriptGameComponent. I wish there was more documentation on bone stuff haha

zealous valve
#

is iplayerID the server id (player 1,2,3,4) or the identity (498534f9-c799-43d5-xxxx-f0bbcbab5a58)?

zealous valve
#

damn, still no way to query unique ids then?

errant pilot
#

hey would anybody know how to adjust the despawn timer on dead bodies?

fringe prairie
#

For anyone with issues using SetBone (on a vehicle) because Animation Graph doesn't have scale node for bones, use the proc anim editor to scale bones to your delight. Even script doesn't work, ran on server and clients. #procanimforever

south path
#

Does anyone know how to replicate a .OpenMenu to all players? Ive tried it with the normal method and with the BumpMe() by watching over an isActive bool.

fringe prairie
south path
#

I try to open a custom vote menu for all players trough the menu manager. GetGame().GetMenuManager().OpenMenu(ChimeraMenuPreset.VoteMenu);

#

i want this to be executed for all clients

ocean kernel
#

How would I iterate over all factions available in the game, not just current world?

thorn anchor
#

how much of a learning curve is the reforger database mod? im thinking of using it for a project where I want the plaintext variables to be held server side maybe in a database and have the client make attempts at the data to be able to access it.

#

Hmmm, should the supply crate prefabs that have an actionmanager with inventory open action, also have a inventorymanager component on them by default?

main cradle
#

How can I change the supply costs for spawning a vehicle?

zealous valve
#

You can adjust the rank needed to spawn the entity there too

main cradle
#

thx

dapper warren
#

How can I create a placeable area like the spawn point but instead for detecting entities? To allow a GM to place detection area that can trigger AI spawning or other events mid game

abstract crescent
#

What is wrong with **SCR_EditorManagerCore **class?
It gives me exception error when i try to modded it.
My code is:

{}```
Exception is:
Reason: NULL pointer to instance. Variable 'Event_OnEditorManagerInitOwner'

Exception in:
203: SCR_InfoDisplayExtended::OnStartDraw
```202: SCR_EditorManagerCore core = SCR_EditorManagerCore.Cast(SCR_EditorManagerCore.GetInstance(SCR_EditorManagerCore));
203: core.Event_OnEditorManagerInitOwner.Insert(OnEditorInit);    ```

It doesnt see or doesnt init **Event_OnEditorManagerInitOwner** parameter from vanilla class
open pier
river imp
grizzled estuary
#

I'm a bit confused, but maybe someone knows the answer or can help.
I'm currently trying to save JSON files with the UID for each player on the server with various variables in them, and I want to load these JSON files as well. How does this work exactly?

normal pendant
#

I am just starting out with scripting for enfusion. One thing that has come up is if it is possible to alter a players max movement speed when not sprinting. Assuming it is where would should I be looking within the scripts?

river imp
normal pendant
#

I am familiar with C# and can read the scripts in game. It's more a case of information overload and not being quite sure where to start looking 🙂

normal pendant
#

I have skimmed through these and will probably end up reading them all in my usual disjointed way. I am just unsure as to what actually controls a characters movement speed. Using the search bar only gets me so far.

river imp
#

Using the search bar is the only way to figure things out. And learning to find things for yourself is way more useful than having someone tell you where to look. Regardless

#

I think you're only valid option is CharacterControllerComponent::SetDynamicSpeed

#

maybe CharacterControllerComponet::SetMovement

normal pendant
#

Dynamic speed sets the lerp between min and max, I could not find an actual ability to set the max speed directly which is what I was looking for. I had thought I could limit the max dynamic speed setting but it feels ... hacky

river imp
#

In this game jank is sometimes the only way

#

like every other arma game

#

The movement speed of the character is tied into the speed at which the animations play

#

There probably isn't a way to set it directly.

normal pendant
#

Asking is normally my last option. It just surprised me that this isn't exposed. I assume they are using root motion but in other games there is normally a way of accessing animation speed. (not always admitadly).

#

thanks for the help. I think at least for testing purposes I will start with the dynamic speed, if anything it will allow me to see if its something worth messing with for my purposes 🙂

#

and perhaps that is only control I can mess with

river imp
#

I don't think you're gonna be able to set the speed higher than whatever the default max is.

#

Try getting the SCR_CharacterDamageManagerComponent and calling SetMovementDamage with a negative value lol

normal pendant
#

at least I am trying to slow it down

river imp
#
        SCR_CharacterDamageManagerComponent  Comp;
        Comp = SCR_CharacterDamageManagerComponent.Cast(pUserEntity.FindComponent(SCR_CharacterDamageManagerComponent));
        Comp.SetMovementDamage(0.9);
#

Closer to 1 the slower

#

But don't set to 1

normal pendant
#

that is another way. If I control speed via dynamic speed control that doesn't have to interact with the damage scripts. Only issue is detecting if a player is using a gamepad as dynamic speed is not set.

#

I have a starting point at least. It would be nice if there was a more direct way of affecting it rather than poking it from different places 😄

river imp
#

Also you'd have to somehow stop them from changing the dynamic speed

normal pendant
#

thats easy you can check current dymaic speed and set it after a threshold, the only issue is that its never set for ppl with gamepads... thinking about it however it is probably set to 1 for gamepads so they can use an analogue stick to control speed. In which case I am over thinking all this as long as I make the check and then set if the value is higher than I want then it would affect everyone the same way.

#

requires testing

river imp
#

I don't think checking the dynamic speed on tick is worth it.

grizzled estuary
ocean kernel
#

Dont use JsonApiStruct lol

high hawk
ocean kernel
ocean kernel
#

Did anyone have some suggestions on how to include a json file with the mod and dump it into the profile folder on first start?

#

If I have to create all those maps for a default config I'm gonna scream

dark ocean
#

@ocean kernel you can register the json file to be included with your mod („import and register” or whatever its called in the RMB context menu), then access it with FileIO

ocean kernel
#

What would be the path to the file? Just ResourceName?

dark ocean
#

cant remember, bit I do that in my project and can look it up later

ocean kernel
#

If you could it'd be great, I'll let you know if I figure it out before then

dark ocean
#

will do mate

serene fox
#

Hi, im spawning a Prefab Local (ChimeraGame -> SpawnEntityPrefabLocal)
So, i do not add RplComponent to this prefab. But, if the Script runs and the Prefab spawns i still get Error that there is no RplComponent... For what?

ocean kernel
#

Thanks

minor agate
#

Local entity/component does not mean the Rpl stuff is gone, nor not needed anymore

#

At that point, the stuff will still be there and they will just point authority to be your client where you spawned it locally on

serene fox
#

Oh ok, i was thinking local stuff does not required Rpl. Thanks Mario

minor agate
#

As this specific case would be broken there 🙂

#

If you did it with Auth/Proxy/Owner, then it would instantly work if done locally

delicate edge
#

lol, I love finding this type of comments

thorn anchor
boreal swan
thorn anchor
#

ahh okay

midnight talon
#

Are there any community DB drivers for EPF? MongoDB's viral licensing is incompatible with the setup of most game hosting providers and I'd rather not expose a DB over public internet

ocean kernel
#

Reforger -> HTTP server -> database

#

Ideas for preventing AI characters from entering vehicles? Ie. immediately eject them if game master tries to jam them into a vehicle

midnight talon
#

Yeah I see the MongoDB driver is implemented as a HTTP proxy, I was just wondering if anyone already wrote one for any other DBs before I look into writing one myself

ocean kernel
#

Writing a domain specific HTTP server for your project will probably be faster than learning someone else's general purpose framework

#

Whether it will be better or not is debatable LMFAOOO

midnight talon
#

Like EPF already persists characters and vehicles for me, if I rolled my own solution I would have to reinvent those wheels

ocean kernel
#

The server does that by default even without mods tho

boreal swan
midnight talon
boreal swan
midnight talon
ocean kernel
#

Yeah thats fair

#

Good point

thorn anchor
#

is the only logical way to have secure server side logic to use basesystem?? I want to store secure codes but having them client side leaves them open to being exploited.

trim aurora
#

Has anyone here got the ModifyLayers command of the WorldEditorAPI to work? I mean changing the ground surface.
This is my script. When I use the FilterMorphOperation.ADD operation it crashes and with any other it does nothing. Am I making a mistake or is this function just broken?

    [ButtonAttribute("Paint Area(s)")]
    protected void Paint() {
        // init tool
        m_API.BeginTerrainAction(TerrainToolType.SURFACE_PAINT);

        TerrainToolDesc_LayerAdd toolPaint = new TerrainToolDesc_LayerAdd();
        toolPaint.fOuterSize = 5;
        toolPaint.fInnerSizePercent = 10;
        toolPaint.fAngle = 0;

        toolPaint.fAddNormalized = 1;
        toolPaint.pMaterial = Material.GetMaterial(m_surface);


        if(!toolPaint.pMaterial){
            Print("Could not load Material! Material should have been: " + m_surface, LogLevel.ERROR);
            return;
        }

        Print("Material: " + toolPaint.pMaterial);

        // paint coords
        for (int i = 10; i < 15; i++)
        {
            for (int j = 10; j < 15; j++)
            {
                m_API.ModifyLayers(i, j, FilterMorphOperation.ADD, toolPaint, FilterMorphShape.ROUND, FilterMorphLerpFunc.LINEAR);
            }
        }

        Print("Should have done something!");
        m_API.EndTerrainAction();
    }

midnight talon
# boreal swan Using third party framework would require understanding it as well (I believe). ...

Yeah but like I've only just started dipping my toes into how stuff works around here. I work as a cloud SE for my day job so HTTP APIs are piss easy. The problem for me would be that I wouldn't know where to even start looking for the best place in Reforger script land to hook calls to my custom persistence API if I made one, I think it would take 10x longer for me to figure all that out and get my mod back to persisting what EPF already does than it would to just write a DB driver for it that other people could benefit from too

queen silo
torn bane
# midnight talon Yeah but like I've only just started dipping my toes into how stuff works around...

Be warned that I am bringing the functionality of my mod in an adapted form to vanilla and will then deprecate my mods. For API design it means that you may not need to focus as much on the complex queries you can do in the mod for now, as vanilla will only be a simple key value CRUD interface primarily. Might add more complex queries later but I found out that in reality most content for mods will cross reference things via ID anyway and unpacking complex data structure to find some inner values is usually not worth the effort and the wrong thing to search for

abstract crescent
#

Can i get any issue if delete all entities inside inventory in destroyed vehicle?
I remove all items from **ScriptedBaseInventoryStorageComponent **by **RemoveItem **and then call **delete **for items entity.

torn bane
abstract crescent
#

And one more question. How can i check access player or faction to pickup and move item? I locked it in ScriptedUserAction, but i cant do any check in inventory menu ( opens on tab ). **InventoryItemComponent ** hasnt any function to check who works with this item. I dont know how to block pickup and moving items for specific players or factions.

torn bane
#

Locking items is for operation synchronization. Not for disabling anything for gameplay. Modding the user actions is the correct approach

ocean kernel
#

How can I verify if Resource.Load() works?

#

Oh IsValid lmao

abstract crescent
#

I can block dragAndDrop by disabling **Draggable ** in InventoryItemComponent, but right mouse button ignores that

torn bane
thorn anchor
#

player identity is the unique id for a player right? im assuming because playerid is different based on when they have joined?

rapid granite
#

Wassup gang. Trying to script BTR in reforger tools to fire the turret on command. I was able to do it with the vehicletrack in cinematic tools but it fires the machine gun instead of main cannon. Can someone point me towards where i might find the name of the primary cannon or any info related? Thanks

thorn anchor
#

what was the script you are using to fire?

thorn anchor
rapid granite
# thorn anchor what was the script you are using to fire?

I actually used the "vehicletrack" (cinematic timeline event) but it only has the option for "turret shot" and i cant find anywhere to command which turret so assumed I would have to manually script it instead. I had a lot of trouble trying to use the turret components though, when i added turretcontrollercomponent the BTR turns invisible.

rapid granite
thorn anchor
#

in resource browser you can grab seperate components of vehicles so i grabbed the turret and there was 2 weaponslotcomponents. one with the main gun and one with the coax.

rapid granite
abstract crescent
#

Can i get players entity from vehicle?

spark otter
#

Yeah get the slots

abstract crescent
# spark otter Yeah get the slots

yes. i founded already
``` Vehicle vehicle = Vehicle.Cast(GetOwner());

        if (vehicle)
        {
            SCR_BaseCompartmentManagerComponent mngr = SCR_BaseCompartmentManagerComponent.Cast(vehicle.FindComponent(SCR_BaseCompartmentManagerComponent));
            array<BaseCompartmentSlot> compartments = {}; 
            
            mngr.GetCompartments(compartments);
            
            foreach (BaseCompartmentSlot compartment: compartments)
            {
                if (compartment)
                {
                    ChimeraCharacter character = ChimeraCharacter.Cast(compartment.GetOccupant());
                    
                    if (character)
                    {
                        // do smf
                    }
                }
            }
        }```
livid pagoda
#

Is there actually anyway to rotate the player's first person camera? Eg: Forward and Backward, Left and Right (in code)

livid forum
#

drag ur mouse to the left or right hmmyes

river imp
livid forum
livid pagoda
#

You guys have astonished me with your amazing skill, yet my problem hasn't been solved 🤔

livid pagoda
#

Whenever I call like SetYawPitchRoll() it doesn't actually update the camera

river imp
#

Animations probably override your call

livid pagoda
#

Animations don't control the actual camera movement, but the head

#
CameraBase camera = cameras.Get(0);

vector angles = camera.GetYawPitchRoll();
angles[0] = 0; // Set angle to 0
        
camera.SetYawPitchRoll(angles);

Here is what I'm doing

#

Internal code uses this function, and theirs works

river imp
#

Where does it do that?

livid pagoda
#
m_camera = g_Game.FindEntity(m_cameraEntityName);
vector angles = Math3D.QuatToAngles(outQuat);
m_camera.SetYawPitchRoll(angles);
#

AutoTestGrid.c and MotionComponent.c

river imp
#

Have you used AutoTestGrid to see if it works?

livid pagoda
river imp
#

There is no MotionComponent

livid pagoda
#

It seems there is

river imp
#

Well excuse me for B.I.s mistake.

ocean kernel
#

File name vs content

livid pagoda
#

My only idea is something if overriding it but I can't find it, or know how to find whats accessing it

river imp
#

Like I said, Animations override bone positions.

livid pagoda
abstract crescent
#

@livid pagoda
can it help u ?

{
    override void OnUpdate(float pDt, out ScriptedCameraItemResult pOutResult)
    {
        super.OnUpdate(pDt, pOutResult);
        
        PrintFormat("%1", pOutResult.m_CameraTM);
    }
}```
livid pagoda
abstract crescent
#

Reload scripts and enter in player 1th person view?

livid pagoda
abstract crescent
#

every frame

livid pagoda
#

Huh, even with saving and reloading even if there is an error in the file it's not reloading it

livid pagoda
#

Can I modify it here or something?

#

Oooo I can, last problem is I'm really bad at transforms and don't know how I would like add 45 degrees

visual atlas
#

do constructors only work for Managed classes? when i do

{
    void Something()
    {
        // does not get run
    }
}

but as soon as i change to
class Something : Managed

it does get run

#

nope jk constructor still doesnt run

river imp
#
class Something
{
    void Something()
    {
        Print("YO!");
    }
}
#
Something Dude = new Something();
#
SCRIPT       : YO!
visual atlas
#

yeah just like that

#

well singleton style

static RE_AdminESPManager GetInstance()
    {
        if (!m_Instance)
        {
            // i cant figure out how to make consturcotr work FEREEEEEEEEEEEEE
            m_Instance = new RE_AdminESPManager();
            m_Instance.Init();
        }
        
        return m_Instance;
    }
#

i just added the Init since constructor wasnt being called 🤔

#

must be user error. thanks zelik

coral sorrel
#

Looking at prefab "explosions TNT small" TimerTriggerComponent. I was trying to see if I could create an explosion as a cone from an origin rather than a sphere around an origin. When I look at the properties of this component I can't seem to find any actual script that I can interact with, should I just assume its all engine code?

Tried searching for explosion in 'find symbol' and didn't come across anything that helped point me in the right direction.

Just looking for a lead because I've stalled a little on this.

boreal swan
#

Excuse me for a dumb question, but are interfaces a thing currently or will they be in future when it comes to Enforce Script?

ocean kernel
#

@dark ocean FileIO.OpenFile doesnt work with included json files in dedicated server, but SCR_JsonLoadContext.LoadFromFile does work

#

?????

#

But FileIO.OpenFile works in WB

torn bane
#

FileIO is for direct file access, by passing virtual file system usually. Meant for workbench plugins mostly. Workbench has full operating system access to file io, hence the dangerous api call confirm window when used. load context uses the normal game file system which can handle everything - and is locked down partially for normal game executable

ocean kernel
#

Weird inconsistency and of course zero logs when using FileIO

#

Logs could have told me

#

I guess its workaround time

#

I guess I can make a .conf, with all of my jsons defined as strings inside

#

and load it as a resource

honest umbra
#

Trying to get loot spawner to spawn inside storage component, cannot find this example prefab anywhere in your mod. I tried on my own by taking the shipping container prefab, adding the SCR_Universalinventorystoragecompant to it, along with action manager so player can interact. I got the storage part working, being able to add and take items. I cannot figure out how to get the tiered loot spawner .et with my custom config to work with this, spawning the loot inside of the storage. I tried adding the spawner.et into the SCR_Universalinventorystoragecompant under 'initial storage slot' and no luck. Also tried adding the tieredspawner componant to the prefab and no luck. Any help would be much appreciated!

torn bane
ocean kernel
#

LOL

#

Anyway

#

I just need to dump the jsons into the server profile folder as templates for folks

#

conf wont work for my stuff since it has maps without keys known beforehand

#

and this 1999 software doesnt know how to represent them in attributes

dark ocean
ocean kernel
#

Its ok I figured it out thank u

abstract crescent
#

Can i get **enum **name?

{
    ONE, TWO,
}
...
PrintFormat("%1 %2", ETest.ONE, ETest.TWO);```
It prints numbers "0" and "1". How to make print "ONE" and "TWO" ? Is it possible without extra array with names?
ocean kernel
#

try typename.EnumToString

abstract crescent
autumn jewel
#

Hello, I play on a server where most of the players want 1st person when on foot and 3rd person when in a vehicle, however one of the Admins cannot play in 1st person as it makes them ill, is there a way to make it so admins can be 3rd person on foot, but the previous rules apply to everyone else?

spring shale
#

Motion sickness sucks. Turning up the servers FOV and turning down his mouse movement speed should help. Other then that, I don't know of any mod. Although I have never looked.

minor agate
ocean kernel
#

He has motion sickness

spring shale
autumn jewel
spring shale
#

Yeah. Off hand. I don't see why you couldn't. Basically you would just whitelist a certain amount of people and allow them to have both first and third. And then the other s have the code applied that says "no third person for you"

ocean kernel
#

Do we have a way to force 3rd person for when players are in a vehicle yet?

serene fox
#

Hi, following problem: I have set a vector worldPosition inside a Config:
m_WorldLocation 1116.528 41.759 11682.838
If i now teleport a player to this location and debug the vector, the result is:
885.619995,18.094000,1483.889038
I do not understand why the vector is different?? The player always teleports into the ocean

thorn anchor
#

@spring shale Is it possible to have a componentclass be replicated only on the server? im trying to implement code storage into a json file without having to use a basesystem.

winter jay
#

What i should add in my code
so hint sent to every player on server?

I assume that it is some kind of RPL ?

    bool KSHM_Destroyed=false;
    void MCU_Trcuks_Trigger()
    {
        bool Truck0=false,Truck1=false,Truck2=false;
        IEntity Target0 = GetGame().GetWorld().FindEntityByName("Target_0");
        IEntity Target1 = GetGame().GetWorld().FindEntityByName("Target_1");
        IEntity Target2 = GetGame().GetWorld().FindEntityByName("Target_2");
        DamageManagerComponent Target0dmg = DamageManagerComponent.Cast(Target0.FindComponent(DamageManagerComponent));
        DamageManagerComponent Target1dmg = DamageManagerComponent.Cast(Target1.FindComponent(DamageManagerComponent));
        DamageManagerComponent Target2dmg = DamageManagerComponent.Cast(Target2.FindComponent(DamageManagerComponent));
        if(KSHM_Destroyed==false && Target0dmg.GetHealth()<=0 && Target1dmg.GetHealth()<=0 && Target2dmg.GetHealth()<=0)
        {
            // Create the hint
            string hintTitle = "Victory!";
            string hintDescription = "All HQ Trucks has been destroyed!";
            float duration = 10; // Duration in seconds
            EHint type = EHint.UNDEFINED; // Hint type
            bool isTimerVisible = true; // Show timer bar
            EFieldManualEntryId fieldManualEntry = EFieldManualEntryId.NONE; // No field manual link
    
            // Create the hint info
            SCR_HintUIInfo hintInfo = SCR_HintUIInfo.CreateInfo(hintDescription, hintTitle, duration, type, fieldManualEntry, isTimerVisible);
    
            // Show the hint
            SCR_HintManagerComponent.ShowHint(hintInfo);
            KSHM_Destroyed=true;
            
        }
    }```
winter jay
#

also, how to simply reload world and restart current mission via code?

hollow oak
#

is it possible to get texture name from material?

#

or only hardcode like that 😦

ocean kernel
#

Lol this kinda looks like a job for a texture atlas

winter jay
midnight talon
dapper warren
#

How can I persist data across entities and have it modified by an attribute in the game master ui?

river imp
minor agate
minor agate
ocean kernel
#

I mean you could have a simple texture with 20 card variants and just change their UV

minor agate
minor agate
#

Then you do not wreck moddability for whatever this is for

ocean kernel
#

Can you assign imageset to mesh?

#

Without rt texture widget?

sleek dove
#

Just create an texture which is your image and apply it in your mesh 😄

#

You can maybe use the Refs in the material to change the BCRMap at runtime, but not sure if it is working correctly

ocean kernel
#

Should work

#

Thats what I was going for

late locust
#

Talking about Refs, how do you ref a vector4 for the color? thonk

ocean kernel
#

what is a vector4

late locust
#

ikr

ocean kernel
#

I thin it's actually regular ol vector because there is no alpha channel in materials in the colors

#

The alpha has a separate slider that would be a float

#

Is my best guess

#

Collimator component has color refs

late locust
#

Looks like vec4
Color_3 0 1 0.198 1

ocean kernel
#

It works for collimators

#

So its vector

#

alpha is ignored

#

by shader

#

ok???

#

check this out

#

alpha do nothing

#

vector is fine

late locust
#

Yeah true

ocean kernel
late locust
#

Now I just need to get it working 🙃

late locust
#

I used it before but my world crashes on load now, fun

late locust
#

Ok fixed, works with normal vector

ocean kernel
#

awesome

icy nest
#

Hi people ! I was oriented to this to get the speed signal from a wheeled vehicle, is there any equivalent for airspeed for an helicopter or is extrapolate from that same signal ? as I can't find any reference similar to GetAirspeed in VehicleHelicopterComponent

late locust
#

How does the character identity work exactly? Does it copy the mesh from the head and body identity prefab into its own mesh
or does it spawn the head and body identity prefab and uses that?

wooden cape
#

What's the most efficient way to move an already placed prefab? IE

IEntity obj3 = GetGame().GetWorld().FindEntityByName("obj3");

IEntity pole = GetGame().GetWorld().FindEntityByName("indrespawn");

vector newPos = obj3.GetOrigin();

pole.SetOrigin(newPos);
ocean kernel
#

Are you going to be moving it 5 times per frame? If not dont worry about it

wooden cape
#

Nah I'm just updating a respawn location per objective destruction. In short we have a respawn system built that's based on a prefab location.

#

I just didnt know if SetOrigin() is correct in nature for it

ocean kernel
#

It should work, if it has rpl component it should sync

abstract crescent
eternal pewter
frosty coral
#

Is it ok to put an Rpc method into ScriptedUserAction? Or does it have to be entity/component? Because i'm getting "Undefined function" error upon compile, while trying to follow scripting example from the wiki.

frosty coral
dull glacier
#

Could someone help me with targeting the EntitySlotInfo with the ActionManager, Disabling and Enabling or using the Attach and Detach Function for a prefab

tawny lotus
#

What is the best way to find the name of my mod via script? I'm looking for the ID found in addon.gproj.

With GameProject.GetAvailableAddons and the GetAddonTitle the mod is the first one, but is that always true?

abstract crescent
tawny lotus
thorn anchor
#

It is possible for a component to be replicated only on the server? So that I can pass client data to it and have it sorted within this component?

abstract crescent
river imp
#

His terminology is wrong. But he wants to have the data only exist on the server and have the data be populated by clients rpcing data to it.

abstract crescent
#

Replication.IsServer() cut logic for server

protected void RpcBroad_SendData(int data)
``` send to players if need
river imp
#

He doesn't want to send the data to the clients

#

He wants to send data to the server from the clients, at least from what I got from his message.

thorn anchor
#

yeah! youre right Zelik. Is there a way to do this? or would I need to deal with a system?

river imp
#

IIrc systems can only rpc data from server to clients and not the other way around. Unless it's been fixed in experimental.

thorn anchor
#

also is playeridentity what I would want to use to log a players uniqueidentity? im assuming it is but ive heard various terms thrown around while searching discord.

#

ahh okay.

river imp
#

It really depends on what you're actually trying to do.

#

You're always so vague

thorn anchor
#

I want to send codes to the server side to store there from a usergui. I then will have another usergui that will attempt that code and make a request to the server side to verify the code. that way the user can never have access to the codes.

hollow oak
#

just deleted my whole project =(( i wish delete button would just place project to rec bin =(((((

thorn anchor
#

basically controlling if a user has permission for an object or not. it would be nice to just have this info on every entity that its being used on. rather than calling to a system and writing the info to a json file. so if the entity is removed all the instance and data is removed in the process.

river imp
#

Not sure exactly what you're trying to limit the use of but, it sounds like your idea is gonna cause a bunch of network traffic.

thorn anchor
#

limit the exposure of a code to an entity. it will only be sending traffic when its being claimed, locked and unlocked.

river imp
#

You definitely don't wanna be checking if every item in the game can be used by rpcing checks to the server.

thorn anchor
#

no! it would only be sending that check when an object is having a useraction complete on it.

river imp
#

You're worried entirely too much about security for a game that is like 80% console players lol

thorn anchor
#

aight lol, i didnt realize it was that many console players lol. Sorry, i just get ptsd from arma 3 days lol.

#

I guess I implement that if there was a need for it in the future.

rapid ferry
#

A single boolean check is only a few bytes, broadcasting that unreliably wouldnt be an issue. Imagine how much data signals and stuff for vehicles and every item in your network bubble uses. Imo send it and see if it works

boreal swan
rapid ferry
thorn anchor
#

would a component on the entity suffice? I would end up using the useraction to open a usermenu and the data would be sent from that user menu to server.

rapid ferry
#

You can make an invisible user action that your visible user action triggers. Kinda weird to think about but I like to use it for client/server communication without an extra component. It just uses the actionperformer component that already exists on the character

#

But yes, if you want to do it with a component you can, itd be easier to think about

thorn anchor
#

ahhh I see. okay ill much around with it.

late locust
#

Can you not material ref via custom entity on a character? Not sure if the body identity prefab is even spawned.
But I tried it on the body identity and on the char directly. Both dont change my color.
It kinda only works with a custom ChimeraCharacter but not with a SCR_ChimeraCharacter blobdoggoshruggoogly

river imp
late locust
river imp
late locust
#

Custom body identity ?

river imp
#

Luckily I just happen to have a custom everything lying around lol

late locust
#

Can you show the material file?

river imp
#
MatPBRSkinProfile : "{E96F2D55763F627D}Assets/Characters/Basebody/Data/Basebody_01_Male_Body.emat" {
 TCModFuncs {
  TCModShift "{64DF5477A8D7E09E}" {
   ShiftU 0
   Refs {
   "ShiftU" "SCR_ChimeraCharacter.m_Value"
   }
  }
 }
}
late locust
#

Hmm thats what I have but with color

river imp
#

Wdym with color?

late locust
#

Im using PBRMulti with Material 2 and 3

 Refs {
  "Color_3"
  "SCR_ChimeraCharacter.m_vColor3"
 }
river imp
#

Oh I see

late locust
#

It works on a normal entity but not char

river imp
#

Weird

#

Have you tried a component instead of an entity?

#

Not sure it will make a difference.

late locust
#

It has to be an entity no?

river imp
#

No

#

Iirc, early on it didn't work with entities.

elder wigeon
#

Hey guys! Does anyone know how to disable AI mortar HE rounds? If there is no option to choose, I want them to shoot smokes instead

rapid granite
#

Reforger Tools crashing everytime i try to script character movement (or use charactertrack event) is this a known issue and is there a workaround available? Thanks

spark otter
late locust
violet rover
#
class Class_A : ScriptComponent
{
    protected override void OnPostInit(IEntity owner)
    {
        ref array<ref Class_B> someClassBs = SomeFunc();
        // can access all Class_B's and their attributes here without problem -
        // except for its foo attribute
    }
    
ref array<ref Class_B> SomeFunc()
{
    ref RefLosingClass embeds = new RefLosingClass();
    ref array<ref Class_B> classBList = {};
    
    for (whatever)
    {
        ref RefLosingClass refLosingClass = new RefLosingClass();
        // fill refLosingClass with data
        classBList.Insert(new Class_B(
            refLosingClass // still has its data here
        ));
    }
        
    // refLosingClass is already null here even tho it has ref in Class_B
    return classBList;
    }
}

class Class_B
{
    ref RefLosingClass foo; 

    void Class_B(RefLosingClass foo)
    {
        this.foo = foo;
    }
}

Can someone explain to me why refLosingClass gets set to null after the for loop? i get that the local var loses scope, however Class_B should still hold a ref to it, right?

elder wigeon
maiden goblet
#

sorry If my explanation is shit I'm not very smart ey

spark otter
violet rover
violet rover
# maiden goblet Have you read this page? https://community.bistudio.com/wiki/Arma_Reforger:Scrip...

i have :D i get the concept of strong and weak refs, but it doesnt show my specific problem.

however i just realized that how you initialize the array seems to matter too for some reason?

ref array<ref Class_B> classBList = {}; // doesnt work, loses ref
ref array<ref Class_B> classBList = new array<ref Class_B>(); // works

the fist one should also just create a dynamic array https://community.bistudio.com/wiki/Arma_Reforger:Scripting:_Values#Array which should keep the value by reference.

also its not the "top layer" object that gets lost, Class_B objects get returned properly, its only the object inside that class that loses ref, so i understand even less how initializing that array changes behavior

minor agate
#

If you do the incorrect ones there, than you corrupt the VM at some point

thorn anchor
#

Hey Mario, when in a localhost with peertool is the peertool identity shared with the main user or is it slightly different and unique?

umbral merlin
#

!vertify

#

I was banned from a combat op servers for being transgender

minor agate
#

@umbral merlin Also off topic for this channel

thorn anchor
#

Hmm, im having an issue getting my menu to replicate properly. Should i be calling the menu from rpc?

#
    {
        if (m_lockManager)
        {
            CL_CodeLockClaimMenu codelockUI = CL_CodeLockClaimMenu.Cast(GetGame().GetMenuManager().OpenMenu(ChimeraMenuPreset.CodeLockClaimMenu));
        
            if (codelockUI)
            {
            codelockUI.SetTargetEntity(pOwnerEntity);
            codelockUI.SetUserEntity(pUserEntity);
            }
            else
                return;
        }
        else
            return;
    }```
umbral merlin
#

!vertify

umbral merlin
#

Hi guys

#

I enjoy reforger, it reminds me of Private Armstrong and his journey on Everon in the original Oporation flashpoint before codemaster stole it.

thorn anchor
# minor agate Depends on your whole logic.

hmm i think that is my issue. I should make my action localonly to avoid opening the menu for others. but I guess I need to rpc the menu to my component to get it to update.

brave trench
#

Has anyone trained AI on Enfusion coding? I imagine that will be extremely helpful

candid garnet
#

just learn C# and you'll be good to learn HOW to read the dev code to know how everything works. AI will not fix overarching program design.

fervent cedar
#

language models only work well with sqf because of all the open web sqf problem solving and forums.
discord is a black hole of information, so enfusion stuff is not gonna catch up, also because the threading structure is bad in discord.
Even if you download the #enfusion_scripting channel, it's wrose by default compared to sqf resources

But you can get c# basics from text generators

high hawk
#

Is there a way to Get the closest 'town/POI' (Anything from the map really) by script? I want to Display a notification with the closest data

#

Similar to how the Vanilla map in conflict tells you "You are nearby: ...."

candid garnet
fervent cedar
#

fair
best resources for enfusion coding is the script editor and the vanilla enfusion code

coarse pine
#

When running BaseRadioComponent.SetPower() from an Action with HasLocalEffectOnlyScript set to false, it crashes the workbench (when testing with peer tool) with no errors.
The BaseRadioComponent is a child of a vehicle that the player is in, so I guess the player is the owner of the vehicle?
Bug or a feature?

coarse pine
#

Setting the frequency on a transceiver the same way does not crash so this is only to do with the BaseRadioComponent.SetPower()

random moat
#

Any Bohemia dev can objectively confirm wether the Map tool for drawing lines that is only available in singlplayer currently is that moddable to be shown multiplayer?

frail hound
#

What's component invoke SCR_RespawnSystemComponent.OnInit(owner). Cannot find, but when i create custom scr extended by RespawnSystemComponent onInit not invokable... :/ Manually only. Sorry for my eng*

torn bane
frail hound
#

But in default component, some like SCR_BaseGameMode is working cool*.

torn bane
frail hound
frail hound
#

Thank you very much...😅

torn bane
frail hound
#

@torn bane So did I understand correctly that if I want to, for example, create onInit, which should be called when an instance is created... I can't do this unless I write an external control technology (script)?

frail hound
torn bane
#

those are events for workbench plugins and scripts. they are not firing in normale game. hence the wb prefix

minor agate
#

For example making the method show in the scripts group in a named entity

#

That also poses some limitations like arkensor said that it blocks overloading.

#

You can make a custom method that you just made from scripts have the event keyword and it will expose them just the same as I described.

#

So, do not use the event keyword as reference for methods that are used as events 🙂

elder wigeon
thorn anchor
#

[Rplprop()] doesnt need parameters technically? it should update when replication.bumpme() is called?

I might have to watch the bootcamp video, I read the wiki and sorta am gettin the info but replication seems so confusing with the terminology.

boreal swan
minor agate
#

The params in there are all conditional

boreal swan
#

What would the condition be if it isn't specified? RplCondition.None?

minor agate
#

Proxy iirc

#

I'll have to check.

#

Ypu can check it anyway on the script definition

inland bronze
#

When creating files (.conf, for instance) in the $profile folder, if I only want to create it in the server's profile, do I need to check if it's a server first? Or does it do that already?

If needed, then how to do so?

#

Like, for clarification, I don't want the files to be created in any player's profile folder as well

river imp
#

If you want to only do it on server you must make sure you're only doing it on the server.

thorn anchor
#

This is due to one of my methods with an Rpc that has method parameters? i dont have any other errors now so im lost.

Scripts/Game/Map/Markers/Objects/SCR_MapMarkerBase.c(3): error: Constructor of type `IEntity` must not have any parameters when used in RPCs or replicated properties. Scripts/Game/Map/Markers/Objects/SCR_MapMarkerBase.c(3): error: Method `IEntity.Encode` is missing. Scripts/Game/Map/Markers/Objects/SCR_MapMarkerBase.c(3): error: Method `IEntity.Decode` is missing. Scripts/Game/Map/Markers/Objects/SCR_MapMarkerBase.c(3): error: Method `IEntity.SnapCompare` is missing. Scripts/Game/Map/Markers/Objects/SCR_MapMarkerBase.c(3): error: Method `IEntity.PropCompare` is missing. Scripts/Game/Map/Markers/Objects/SCR_MapMarkerBase.c(3): error: Method `IEntity.Extract` is missing. Scripts/Game/Map/Markers/Objects/SCR_MapMarkerBase.c(3): error: Method `IEntity.Inject` is missing. Scripts/Game/Map/Markers/Objects/SCR_MapMarkerBase.c(3): error: Type `IEntity` cannot be replicated due to previous errors.

river imp
#

You can't pass entities as params for rpc calls

thorn anchor
#

ahh okay, hmm. Is there a better way to do this?

{
    protected CL_CodeLockManagerComponent m_lockManager;
    protected DoorComponent doorComp;
    protected IEntity UserEntity;
    protected IEntity OwnerEntity;
    
    override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
    {
        m_lockManager = CL_CodeLockManagerComponent.Cast(pOwnerEntity.FindComponent(CL_CodeLockManagerComponent));
        doorComp = DoorComponent.Cast(pOwnerEntity.FindComponent(DoorComponent));
    }
    
    //------------------------------------------------------------------------------------------------
    override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
    {
        if (!m_lockManager || !pOwnerEntity || !pUserEntity)
            return;
        
        OwnerEntity = pOwnerEntity;
        UserEntity = pUserEntity;
        
        if (!Replication.IsServer())
        {
            RPC_RequestAttachCodeLock();
            return;
        }
    }
    
    [RplRpc(RplChannel.Reliable, RplRcver.Server)]
    void RPC_RequestAttachCodeLock()
    {
        if (!m_lockManager || !OwnerEntity || !UserEntity)
            return;
        
        if (Replication.IsClient())
        {
            CL_CodeLockClaimMenu codelockUI = CL_CodeLockClaimMenu.Cast(GetGame().GetMenuManager().OpenMenu(ChimeraMenuPreset.CodeLockClaimMenu));
        
            if (codelockUI)
            {
            codelockUI.SetTargetEntity(OwnerEntity);
            codelockUI.SetUserEntity(UserEntity);
            }
        }
    }
    
    override bool CanBeShownScript(IEntity user)
    {
        if (m_lockManager.GetLockAttached())
        {
            return false;
        }
        else
        {
            return true;
        }
    }
    
    override bool CanBePerformedScript(IEntity user)
    {
        if (m_lockManager.GetLockAttached())
            return false;
        else
            return true;
    
    }
    
    override bool GetActionNameScript(out string outName)
    {
        if (doorComp)
            outName = "Attach codelock to Door";
        else
            outName = "Attach codelock";
            
        return true;
    }
}
#

I had this working before, but when I introduced a menu UI, the replication wasnt there.

river imp
#
class CL_CodeLockClaimUserAction : ScriptedUserAction
{
    protected CL_CodeLockManagerComponent m_lockManager;
    protected DoorComponent m_DoorComponent;
    //------------------------------------------------------------------------------------------------    
    override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
    {
        m_lockManager = CL_CodeLockManagerComponent.Cast(pOwnerEntity.FindComponent(CL_CodeLockManagerComponent));
        m_DoorComponent = DoorComponent.Cast(pOwnerEntity.FindComponent(DoorComponent));
    }
    
    //------------------------------------------------------------------------------------------------
    override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
    {
        if (!m_lockManager)
            return;
        
        if(SCR_PlayerController.GetLocalControlledEntity() == pUserEntity)
        {
            CL_CodeLockClaimMenu codelockUI = CL_CodeLockClaimMenu.Cast(GetGame().GetMenuManager().OpenMenu(ChimeraMenuPreset.CodeLockClaimMenu));
            codelockUI.SetTargetEntity(pOwnerEntity);
            codelockUI.SetUserEntity(pUserEntity);
        }    
    }
}
thorn anchor
river imp
#

Yes

#

Or you can just make the user action not broadcast

thorn anchor
#

local action only? is there any downsides to doing that if the menu is only meant to be visble to that player?

river imp
#
class CL_CodeLockClaimUserAction : ScriptedUserAction
{
    protected CL_CodeLockManagerComponent m_lockManager;
    protected DoorComponent m_DoorComponent;
    //------------------------------------------------------------------------------------------------    
    override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
    {
        m_lockManager = CL_CodeLockManagerComponent.Cast(pOwnerEntity.FindComponent(CL_CodeLockManagerComponent));
        m_DoorComponent = DoorComponent.Cast(pOwnerEntity.FindComponent(DoorComponent));
    }
    //------------------------------------------------------------------------------------------------
    override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
    {
        if (!m_lockManager)
            return;
        
        CL_CodeLockClaimMenu codelockUI = CL_CodeLockClaimMenu.Cast(GetGame().GetMenuManager().OpenMenu(ChimeraMenuPreset.CodeLockClaimMenu));
        codelockUI.SetTargetEntity(pOwnerEntity);
        codelockUI.SetUserEntity(pUserEntity);
    }
    //------------------------------------------------------------------------------------------------    
    override bool HasLocalEffectOnlyScript()
    {
        return true;
    };
    //------------------------------------------------------------------------------------------------
}
#

Menus are only local anyway

#

There can be data that is replicated making them look the same for everyone

thorn anchor
#

ahh okay ill just do that.

river imp
#

but there isn't shared menus

thorn anchor
#

each menu is its own instanced, im assuming what you are getting at.

river imp
#

And the server doesn't open menus, unless you're hosting and you're the sever and a client

thorn anchor
#

ahh okay.

river imp
#

Not only are menus instanced(like everything else) but they are only local

thorn anchor
#

ahh. so to have that menu send data out, you would need to use an rpc to the authority to request the info be changed? i dont know if my terminology is right.

river imp
thorn anchor
#

yeah i did that before lol

river imp
#

And a menu opens for everyone

#

Specifically a local instance of the menu

thorn anchor
#

I turned it off not realizing that the reason the peer wasnt updating the component was because of replication. as im assuming my character is the authority?? since its hosting the server hmm.

open pier
#

Is there anyway to troubleshoot RplSchedulerErrors? We get dummy spammed with them and I'm unsure where to start trying to troubleshoot/fix it

river imp
#

I've never even see RplSchedulerErrors before

open pier
#

Going to log into the box in a minute here to get the full error being sent

river imp
#

There should be nothing Rpc related in user actions

#

They don't even have the Rpc function.

#

example:

#
Rpc(Ask_Authority_Method,param);
thorn anchor
#

ahh okay.

#

That makes sense.

inland bronze
# inland bronze When creating files (.conf, for instance) in the `$profile` folder, if I only wa...

Additionally, when it comes to creating .conf files in the profile folder, how can I read it from script?

This is what I currently have:

string m_sDb = string.Format("%1/%2", DB_DIR, DB_NAME_CONF);
        
if (!FileIO.FileExists(m_sDb))
{
    CreateConfig();
}
else
{
    Resource holder = BaseContainerTools.LoadContainer(m_sDb);
    
    m_randomizedConfig = CONVICT_RandomizedAIInventoryConfig.Cast(BaseContainerTools.CreateInstanceFromContainer(SCR_ConfigHelper.GetBaseContainerByPath(holder)));
    
    if (!m_randomizedConfig || !m_randomizedConfig.m_RandomizedItemData)
    {
        Print("[CONVICT] CONVICT_RandomizedAIInventory.conf can not be found! This is typically located in your server's profile folder, please resolve!", LogLevel.ERROR);
        return;
    }
}
``` which prints the error, and I assume because my .conf doesn't have a GUID attached to it. So what would I need to do instead, if possible?
river imp
#

manually create a meta file when the conf is created on the server

#

Are you expecting people to create this config or is it gonna be supplied?

sleek monolith
#

hey! somebody know how to add an arsenal to a object like a safe? :) thx in advance. :) greets!

river imp
#

What?

inland bronze
#

also, how to do the meta file creation? thonk

river imp
#

If so just supply the meta file too

#

Otherwise you have to create one at runtime

#

From scratch

#

All of that is only handled in workbench.

#

There aren't any functions to crate meta files at runtime, that's done by the resource manager or whatever it's called and it can only be done in workbench.

inland bronze
#

Ohhhhh okay, I think I see. So basically, I have it setup to create the file at runtime, but then it's up to the server owner to register it through Workbench?

#

If so, that's fine. The goal was for them to basically run server once, which then creates the files, then they stop the server and edit what is needed in the file

river imp
#

It's easier to just use a json file

inland bronze
#

Oh it is, but .conf seems to be more beginner friendly when editing in Workbench, I think at least

river imp
#

Sure, conf files are easy to edit because they have a ui in workbench

#

You should just supply a conf in the mod and allow people to override it.

inland bronze
#

Only reason I don't do it that way is because then you have to have a whole other mod just to override it, which seems unnecessary

river imp
#

Most communities and people hosting servers have the own mods to begin with.

#

What about the server providers that don't give much access to files.

#

That stops your flow dead in its tracks.

#

If they have limited access to altering files on the server they're renting, then what happens?

#

Same limitation would happen with local json files as well though.

#

That's why its best to just supply a conf in the mod and allow overriding of it.

inland bronze
#

I would hope a server provider allows access to the profile folder lol, seems like such a basic needed feature for a server host

#

I get your point though

river imp
#

I'm pretty sure file restriction is why people hate Nitrado.

ocean kernel
#

Dont worry about that, it will motivate people to find a provider that respects their users

#

So it is net positive

spark otter
#

RIP nitradont

ocean kernel
#

There are providers that dont allow server to download mods from workshop, and require you to upload them via FTP.
There are providers that dont allow editing files that aren't server config json.
There are providers that dont let people change scenarios beyond conflict (yes, really).
There are providers that dont let users use RCON.

#

Dont let any of this stop you.

river imp
ocean kernel
#

RIP half of the playerbase not being able to use your mod since they dont have a PC

river imp
#

That too ^

ocean kernel
#

Probably more than half tbh

#

So yeah, config in profile folder is da way

river imp
#

If you only allow it through creating a mod, they're required to have a pc

#

Server conf, is the best way but, not necessarily the most user friendly

ocean kernel
#

Realistically it's the only choice

river imp
#

And their server provider could halt that process in it's tracks.

ocean kernel
#

Good, less business for providers that don't respect their customers

river imp
#

If people are expected to then open the conf in workbench and edit it though, they're kinda required to have a pc in the first place.

#

Might as well just use a json file.

ocean kernel
#

Yeah json wins. Editing those on a smartphone is hell, but at least it's possible for those that don't have a PC.

#

A lot of folks also have a PC but play Reforger on console only.

river imp
#

His whole point of using confs was ease of access.

#

But editing them via text editor is basically the same as editing a json file via text editor.

ocean kernel
#

in that regard json wins because it's the same format they edit in other places ie. server config

river imp
#

A lot also has to do with what is stored in the conf/json to begin with though.

#

How are people expected to know the ResourceName of the item that they're wanting to add to the conf/json?

#

They have to have a pc and workbench in that case.

#

Which would make creating a mod and overriding the conf the best way, regardless.

sleek monolith
#

..to an object like this :)

river imp
abstract crescent
river imp
#

Or just inherit from the prefab you want and change the mesh

sleek monolith
#

alright and thx a lot ya!! 🙌

spark otter
river imp
#

The only foolproof way is to make a mod that overrides the config file. Every other way could have issues that restrict it.

spark otter
# river imp But in most cases communities have their own mod.

Personally, I hate dependencies, so I dont like having a "server mod" that has a long list of dependency mods that Im editing. Cuz if one dependency goes down, I have to go and publish an update to get things working again. I prefer to make "fix" or "edit" mods for each individual mod, so if the mod goes down I can easily just edit my mod list to get it working again.

river imp
#

If they're gonna have to boot up workbench to edit the conf, or to look up ResourceNames then they might as well add one more dependency and override a conf file lol

pine nacelle
#

Hey I have a question if i have a custom SCR_chimeracharacter script how can i set that up to work with a character prefab? like if i had a post frame script that altered size?

thorn anchor
#

if my useraction has logic in the CanBeShown(). is there any point of having the same logic in CanBePerformed()?

river imp
#

You can probably still do it but you're gonna have undesired results.

river imp
#

And you don't even really need to do that

thorn anchor
#

ahh good call. Hmm okay. because if its not shown its not even possible to attempt to perform hey

river imp
#

CanBePerformed can't actually be performed if the actions isn't shown

#

Both of which are called on frame when looking at the "context" of the action

thorn anchor
#

ahh so logically it probably makes most sense to just have it only true to avoid it running additional logic.

river imp
#

so CanBePerformed can always return true,

#

yes

#

then CanBeShown will show it and people can perform the action

#

if CanBeShown returns false, it won't be shown for the player to perform anyway

thorn anchor
#

Can I dm you a few of my scripts

pine nacelle
fervent cedar
#

Altering scale from animations maybe?

fervent cedar
pine nacelle
bronze dune
# ocean kernel Yeah json wins. Editing those on a smartphone is hell, but at least it's possibl...

Hey @ocean kernel bacon, I dmed you about some scripting stuff. Me and you talked way back in alpha (end of 22) when you helped me get started and I wanted your input on a few things with regards to scripting and mod production. Just reaching out through here to make sure you take a look at the DM, as it offers an interesting proposition. Also the answer is "most likely" to a question you posed to me back then. Based on the experience ive had since.

thorn anchor
#

Can someone link me or show me basic replication for using a uimenu to send values to a component and have it replicated? its working on my main client but still wont on my peer client. causing me grief.

abstract crescent
river imp
#

It works the exact same way as described here except the values come from a menu, go to a component then get rpcd

#

Character clicks a button in the menu, the menu changes a value in the component, the component then asks the server something based on the value that was changed.

pliant ingot
frail hound
#

I understand that it’s probably my fault, but maybe someone has encountered a similar problem.

What I did -> Pulled out DefaultPlayerControllerMP, simplified the components, but! - everything related to UI, especially HudManager, was moved entirely...

In the default prefab has effect in ScreenEffect's i have one too

WORLD        : UpdateEntities
 WORLD        : PostFrame
  SCRIPT    (E): No Slot Widget for Layer Slot: 
  SCRIPT    (E): Virtual Machine Exception

Reason: NULL pointer to instance. Variable 'm_wRoot'

Class:      'SCR_BleedingScreenEffect'
Function: 'AdaptiveOpacity_Initialize'
Stack trace:
Scripts/Game/UI/HUD/SCR_InfoDisplay.c:455 Function AdaptiveOpacity_Initialize
Scripts/Game/UI/HUD/SCR_InfoDisplay.c:432 Function OnStartDraw
Scripts/Game/UI/HUD/SCR_InfoDisplayExtended.c:231 Function OnStartDraw
  SCRIPT    (E): Virtual Machine Exception

Reason: NULL pointer to instance. Variable 'm_wRoot'

Class:      'SCR_BleedingScreenEffect'
Function: 'AdaptiveOpacity_Initialize'
Stack trace:
Scripts/Game/UI/HUD/SCR_InfoDisplay.c:455 Function AdaptiveOpacity_Initialize
Scripts/Game/UI/HUD/SCR_InfoDisplay.c:432 Function OnStartDraw
Scripts/Game/UI/HUD/SCR_InfoDisplayExtended.c:231 Function OnStartDraw
  SCRIPT    (E): 'SCR_PlayerTeleportFeedbackUIComponent' could not find 'SCR_PlayerTeleportedFeedbackComponent', make sure it is added to the player controller

Resolve -> "Copy" sometimes doesn't work correctly. Param LayerName was empty in default handler

tawny flax
#

afternoon guys, anyone got any idea where i would start with creating a range finder (Scope & Handeld)

clever oxide
#

How can i reset eventhandler usage on entity?
When i kill vehicle by Zeus lightning the destroyed vehicle runs OnDestroyed eventhandler and all ok, but
when i use RPG, the eventhandler called on windows or lights. I repair vehicle and use again but no eventhandler anymore.... When i destroy vehicle totally later no called OnDestroyed eventhandler.

In OnDestroyed eventhandler description:
"when the default hit zone is set to destroyed"
the default hitzone is "HULL" on vehicle, why eventhandler run on vehicle parts like windows not on main entity and why run only once in entity lifetime?

#

ah found it sry
when register the eventhandler i used single use true
(i don't thinked its running on all parts if i register only the main vehicle ent)

#

and it runs only the first destroyed part

#

so if i need use on destroyed event on main vehicle i need cast "ent" to "vehicle" (to skip other parts)

grizzled estuary
#

What would be the ideal/correct way to get the playerId in this case?

modded class SCR_PlayerXPHandlerComponent : ScriptComponent
{
    override void OnPlayerKilled()
    {
        super.OnPlayerKilled();

        TEST_GUI_Settings GUI_Settings = TEST_GUI_Settings.GetInstance();
        PlayerManager playerManager = GetGame().GetPlayerManager();
        int playerId = playerManager.GetPlayerIdFromControlledEntity(GetOwner()); 
        SCR_PlayerController playerController = SCR_PlayerController.Cast(playerManager.GetPlayerController(playerId));        
        

        GUI_Settings.GiveToOtherVoid(playerId);
    }
}    
frosty coral
#
protected static ref set<int> s_iSomeSet = new set<int>;```
I'm trying to RplProp a set, but it doesn't work, while bool propetry just next to it getting Rpl.Bump()ed no issue. Or am i doing some sort of blasphemy with this?
ocean kernel
#

Dont think it works for set

#

Same with map

frosty coral
#

i'll try array then, thanks

#

why tho

frosty coral
#

array doesn't work either

#

ok, so i guess it is a blasphemy, as non-static array works

ocean kernel
#

Oh I didnt notice the static before

frosty coral
#

Is there any reason why you should not mod SCR_ChimeraCharacter? Or is it fine?

ocean kernel
#

Idk I do it fine

frosty coral
#

great, thanks

thorn anchor
#

is there a way to spoof identityid on peertool?

#

just realized that may be why my testing hasnt been working because the peertool has no identityid i guess??

ocean kernel
#

You could install the hacks that people use with steam

#

But then you risk being part of the botnet

thorn anchor
#

yikes lol

ocean kernel
#

In server admin tools v2 I have a helper method to fetch identity id where I substitute with a string if the game runs in dev environment

thorn anchor
#

i was hoping there was a workbench work around to get the peertool to have an id because when i print its ID it loads in with null id or empty i think.

#

if im in workbench does #ifdef workbench work across all?

ocean kernel
#
    static string GetPlayerIdentityId(int playerId) {
#ifdef WORKBENCH
        return string.Format("dev-playerid-%1", playerId);
#endif

        BackendApi api = GetGame().GetBackendApi();
        if (!api) {
            Print("ServerAdminTools_Util.GetPlayerIdentityId | Failed to get Backend API!", LogLevel.ERROR);
            return "";
        }
        
        string identity = api.GetPlayerIdentityId(playerId);
        if (identity.IsEmpty()) {
            Print("ServerAdminTools_Util.GetPlayerIdentityId | Empty Identity ID obtained from Backend API", LogLevel.ERROR);
        }
        
        return identity;
    }
thorn anchor
#

ahh okay thats how i was about to do it!

ocean kernel
#

I need it as a lot of my mod depends on identity id 😄

thorn anchor
#

yeah, its too bad there wasnt a built in peertool option to have an ID. I dont think it would be abuseable because peer tool runs on a development build right?

ocean kernel
#

Sometimes you do want things to fail if there is no backend, though

thorn anchor
#

this whole time im trying to troubleshoot my peer tool not registering and it was basically sending a null ID lol.

#

i have it checking backend too in my script. for some reason last night i had a weird loop happening.

#

Ive had a few weird things happening when I have restarted workbench for a while. need to remember to do that before i start messing with stuff.

ocean kernel
#

Sometimes backend works in Wb lol

#

Greatest mystery of our time

torn bane
thorn anchor
#

ahh i see what you did with your script too. I like that. if in workbench it will always have a mock id regardless.

#

if I dont have an rplprop on a variable. that variable wont get replicated to clients right, it will stay server side?

weary wasp
#

Where is the function which is executed when someones fire a weapon

#

I want to draw a line between the start pos of the bullet and the end pos of it

frosty coral
# ocean kernel Sometimes backend works in Wb lol

don't know if that's related but sometimes when i launch world editor and/or script editor very quickly after launching wb it gets stuck forever trying to link profile, so backend is unaccessible

thorn anchor
#

is this normal to see in log console when a peer tool is connecting?

WORLD        : UpdateEntities
 NETWORK   (E): Trying to register connection of possibly unauthorized client.```
frosty coral
thorn anchor
#

im assuming so but just wasnt sure.

dark ocean
#

is it possible to obtain typename from string? preferably with some check whether the typename is valid (defined)

river imp
#

string::ToType()

dark ocean
#

lol, such an obvious answer. gracias!

river imp
dark ocean
ocean kernel
#

To be fair, to type name would return "string"

dark ocean
#

it would be incosistent, the class is typename. tho the class should be type, and typename should be a typedef for string

#

actually, string-inherited class, not a typedef. just like we have Resource and ResourceName

river imp
#

Shoulda, Coulda, Woulda

thorn anchor
#

is there a custom param to have peer tool be in debug or workbench so it runs the workbench or debug ifdef properly?

river imp
#

Peers will never run "workbench code"

thorn anchor
#

My issue while testing is that my peer connects. it doesnt have an identity so it returns null. Wasnt sure if there was a good work around for this.

river imp
#

Getting the playeruid will only happen on the server

#

In your case that's workbench

#

Bacon has literally given you a way to fix that issue, why are you not using it?

thorn anchor
#

i did lol

#

unless like you said its not working as its being called client side rather than server.

#

ahh one sec.

thorn anchor
#

how do I give ownership to a proxy? thats my issue i think. client is only proxy. so trying to call this code gets dropped.

pine shoal
#

Hello, I'm new to Arma reforger, so to speak, and I've just started to figure it out.
I couldn't find any answers to these questions on the Internet:

  1. How to implement subtitles in a Scenario (screenshot 1)
  2. How to implement hints (screenshots 2)
  3. Is it possible to insert custom music and character voice acting, as in Arma 3?
    Thanks for attention.
river imp
thorn anchor
#

do i have to have a scriptinvoker or something for the server to watch for to give ownership of the component to whoever opens this menu? i cant seem to figure it out.

river imp
#

Uh, the server should be the one that is giving the ownership of the component to the character that opens the menu

#

iirc at least. Pretty sure the client can't give something to itself

inland bronze
#

What's the proper way to check if youre the server? Searching through the Discord and vanilla script, I see that Replication::IsServer() is better off avoided, so what's another way?

#

RplSession::Mode(RplMode.Dedicated) perhaps?

ocean kernel
#

If you want to check if server then use IsServer

inland bronze
#

Ah, so it's fine to use?

ocean kernel
#

Yes as long as you specifically want to check if it's server, sometimes people may want to check if owner or if authority

inland bronze
#

Ah gotcha gotcha, yeah, in my case just checking if it's server to create a file, and to not create it if on client

thorn anchor
#

I thought I was understanding reforger the best I could then replication came upon me and I’m sorta lost again. I understand the terminology well almost fully.

river imp
#

Not sure why you think you need a script invoker

thorn anchor
#

I don’t know honestly. Well I guess I could have the rplprop watch a method and if it returns true it will give ownership? Because it would be the server doing that not a player requesting it?

river imp
#

You're using a user action to show the menu

thorn anchor
#

Yeah

river imp
#

in perform action give the client ownership of the componet

#

component*

thorn anchor
#

Ahhhhh fuck lol

#

because user action is called from server.

river imp
#

user action is generally called everywhere

#

because by default it broadcasts

thorn anchor
#

Ahh okay. I’ll do that when I get home.

river imp
#
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
{
  if(Replication.IsServer())// Create a static function that can be called by the server, with an input for the "Item" and "New Owner"
    //Give Ownership of pOwnerEntity to pUserEntity

  //Just for Conformation, No need to check other proxies
  if(SCR_PlayerController.GetLocalControlledEntity() != pUserEntity)
    return;

  GetGame().GetCallqueue().Call(ExampleFunc,pOwnerEntity); //Call a frame later
}

void ExampleFunc(IEntity thing) //Will print if the caller of the function is the owner of the thing or not
{
  RplComponent Comp = RplComponent.Cast(thing.FindComponent(RplComponent));
  Print(Comp.IsOwner().ToString()); 
}
candid garnet
#

is there a way to get an array of all the layer paths currently in the world directory?

static array<string> GetAllLayerAbsolutePaths(string worldPath, string worldName)
{
    array<string> paths = {};
        
    string defaultLayerAbsFilePath;
    if (!Workbench.GetAbsolutePath(worldPath, defaultLayerAbsFilePath))
    {
        Print("Could not get absolute path for " + worldPath, LogLevel.WARNING);
        return new array<string>();
    }
        
    // something to grab all absolute paths here
        
    return paths;
}
shadow oxide
#

@spring shale Apologies for the ping, but I've seen some messages from you in here about tackling this issue and thought you might be good to ask.
I'm trying to attach a camera to the player using addchild, however the offset is never correct.
Here is my code snippet, do you have any suggestions?

_unit.AddChild(entity,_unit.GetBoneIndex("Head"));
                
vector transform[4];
transform[3] = "0 0 0";
entity.SetLocalTransform(transform);
entity.Update();

-edit SOLUTION:
This happens because of the "[ABOVE_TERRAIN] TerrainCollision" component that is on the camera. My solution is to duplicate one of the existing cameras and then disable this component. This makes the camera be placed at the correct position when using AddChild

candid garnet
# candid garnet is there a way to get an array of all the layer paths currently in the world dir...

Figured out a solution:

protected string GetLayersAbsoluteFilePath(string worldPath, string worldName)
{
    string worldAbsPath;
    if (!Workbench.GetAbsolutePath(worldPath, worldAbsPath))
        return;

    string layerAbsDir = FilePath.StripFileName(worldAbsPath);
    if (!layerAbsDir.EndsWith("/"))
        layerAbsDir += "/";

    return layerAbsDir + string.Format("%1_Layers", worldName) + "/";
}
WorldEditorAPI worldEditorAPI = SCR_WorldEditorToolHelper.GetWorldEditorAPI();
if !(worldEditorAPI)
    return;

string worldPath;
worldEditorAIP.GetWorldPath(worldPath);
string worldName = FilePath.StripExtension(FilePath.StripPath(worldPath));

string layerFolderPath = GetLayersAbsoluteFilePath(worldPath, worldName);

array<string> paths = {};
FileIO.FindFiles(paths.insert, layerFolderPath, ".layer");

// test
foreach (string path : paths)
{
    Print(path);
}
candid garnet
#

can I have an array as a value in a map?

minor agate
frail hound
#

How i can give a player control over entity. ?

frosty coral
thorn anchor
#

having issue giving ownership still

 RPL          : rpl::Pip::ProcessNetToGame
  RPL       (E): ReplicationError: Give called for identity which is not ready for replication! ident = 2147484207```
delicate edge
#

Hey all, what would be the best way to get custom code executed when mortar shell explodes? Is it custom projectile effect? I'm trying to set up a mortar training gamemode and use this code for hit detection/accuracy measurements.

ocean kernel
#

Maybe in the warhead

thorn anchor
ocean kernel
#

No I dont know what that means sorry

river imp
#

The rpl component is probably not set up correctly.

thorn anchor
#

Could it being a child object have anything to do with it?

river imp
#

Idk

river imp
#

I've never tired to give ownership of a "child object" to a player before

thorn anchor
#

like i dont think it should matter right. because im giving ownership from the rplcomponent on that object regardless.

river imp
#

Thinking it doesn't matter and it actually mattering are two different things.

thorn anchor
#

yeah i know.

river imp
#

If you wanna know for sure then test it and find out.

thorn anchor
#

well i tried getting the root parent and getting the rplcomponent from that but it still failed.

river imp
#

Change the state override to runtime Doesn't matter for setting ownership it seems.

thorn anchor
#
 NETWORK   (E): Trying to register connection of possibly unauthorized client.
WORLD        : UpdateEntities
 RPL          : rpl::Pip::ProcessNetToGame
  RPL       (E): IReplication::JIPError: Inconsistent item table on Slave connection. Item is missing or different item was loaded in its place. (item=0x40000068 layout=script::Game::SCR_SpawnPoint con=0x0)
  RPL       (E): IReplication::JIPError: Inconsistent item table on Slave connection. Item is missing or different item was loaded in its place. (item=0x40000069 layout=script::Game::SCR_EditableSpawnPointComponent con=0x0)
  RPL       (E): IReplication::JIPError: Inconsistent item table on Slave connection. Item is missing or different item was loaded in its place. (item=0x4000006A layout=script::Game::SCR_FactionAffiliationComponent con=0x0)
  RPL       (E): IReplication::JIPError: Inconsistent item table on Slave connection. Item is missing or different item was loaded in its place. (item=0x4000006B layout=script::Game::SCR_ResourceComponent con=0x0)
WORLD        : UpdateEntities
 RPL          : rpl::Pip::ProcessNetToGame
  RPL       (E): IReplication::JIPError: Terminating connection. (identity=0x00000000)```
#

peertool crashed.

river imp
#

JIP error

#

Join in progress error

#

I've literally never done anything that causes that.

#

Not sure what you've done

thorn anchor
#

well i deleted some code that wasnt needed and i dont have JIP error now while in rpl state override: runtime. but my useractions dont work on the door.

ocean kernel
#

using / to comment lines in exp editor borked?

river imp
#

It only works with multiple lines selected.

ocean kernel
#

Not for me it dont

spark otter
#
// for one line
/* for
multiple
lines
*/