#enfusion_scripting

1 messages · Page 10 of 1

desert escarp
#

Im spawning and attaching it on the server

sweet badger
#

You can also just do vector mat[3] = {"1 2 3", "4 5 6", "7 8 9"};

#

Would be the correct version of this, it was just missing the brackets

craggy jolt
#

Works with strings but I need curly braces to do statements inside

ocean kernel
#

the what now

sweet badger
craggy jolt
craggy jolt
desert escarp
sweet badger
#

Maybe vector was lower case

craggy jolt
#

Thanks, that's exactly what I wanted!

fickle widget
#

what could be the issue if my EOninit /OnPostInit of a prefab is not running after spawn via script 🤔

sweet badger
fickle widget
#

thanks, i'll try

red cedar
#

Is it possible to make it so that consoles have a mouse cursor in a menu ??
Or can they only tab in betweens buttons etc ??

dire sinew
#

How do I get IEntityComponentSource of a component that is a child of another component?

#

Nvm, IEntityComponentSource::GetObjectArray with "components" as variable name does the trick.

toxic lichen
maiden goblet
# toxic lichen

I guess you might be the only person trying to run tools on Linux, so you won't find any support.

midnight talon
#

@toxic lichen
I'm using workbench on Linux mostly okay but it probably heavily depends on distro and hardware

#

It's possible to edit scripts with VSCode or other third party editors but the workbench script editor is the only way to have good support for the language / global context in WB that I've seen

spark otter
#

Turned out, all I needed to do was this: ```c
modded class SCR_CampaignMapUIBase : SCR_CampaignMapUIElement
{
override protected void SetIconName(string name)
{
super.SetIconName(name);

    if (m_Base && m_wBaseName && m_wBaseNameDialog)
    {
        Color defaultColor = GetColorForFaction("");
        Color fiaColor = GetColorForFaction("FIA");
        Color ussrColor = GetColorForFaction("USSR");
        Color usColor = GetColorForFaction("US");
        
        if(m_Base.GetFaction().GetFactionKey() == "FIA")
        {
            m_wBaseName.SetColor(fiaColor);
            m_wBaseNameDialog.SetColor(fiaColor);
        }
        else if(m_Base.GetFaction().GetFactionKey() == "USSR")
        {
            m_wBaseName.SetColor(ussrColor);
            m_wBaseNameDialog.SetColor(ussrColor);
        }
        else if(m_Base.GetFaction().GetFactionKey() == "US")
        {
            m_wBaseName.SetColor(usColor);
            m_wBaseNameDialog.SetColor(usColor);
        }
        else
        {
            m_wBaseName.SetColor(defaultColor);
            m_wBaseNameDialog.SetColor(defaultColor);
        }
    }
}

};

foggy swift
# toxic lichen

it's pretty crappy in all honestly, i tried it on arch (and like stated you may have better luck on a different distro), but i just ended up caving in and setting up a windows partition. there's really not much of an advantage to running the workbench on linux though - even if it did have proper, full support

#

at some points when trying to edit script i would even have odd common occurences of caps lock turning on/off randomly, and when trying to type , it would type / instead lol

high hawk
#

What's the best path to go down with importing a custom heavy weapon such as a turret?

Is it easier to just use the base prefab or a prefab and replace the mesh object with my mesh? Or do I start from scratch considering I'll probably have to do some custom animations to make it half decent?

I have copied a tripod prefab to the T and it still won't fire.. I imagine it's Todo with different bone names that are not triggering events?

toxic bear
# toxic lichen

If you use the Editor on Linux and it keeps crashing .. check what're using .. are you using proton/wine? (Idk if this shit runs natively also .. should as it is written in C or C++) may it misses some libs or the wine prefix is wrongly setup, some wrong or old versions of libs .. You should've also a crash log .. check it also out.

fringe prairie
#

Nvm it’s a held weapon

high hawk
#

I've started redoing the skinning for a different tripod tho

#

tryin m60 as its more setup for my needs

fringe prairie
#

The tripod graph is actually better I think

#

It can use custom height info, though the tripod will be stationary

high hawk
ocean kernel
#

yeah just use tripod

#

for reloading maybe you can like

#

make it so they need to exit the turret

#

and load it through an action or something

#

play the car fixing/wrench animation

#

for reloads

#

that'll work

sleek moat
#

Does anyone know if the "roles" enums need to actually do anything? Or could I create my own enums in there to split players into "roles" without it actually having any perms tied to it

fringe prairie
#

Interesting question I have. I can edit a material in workbench while in play mode and my material edits apply within the play mode. Is there an API of some sort that will allow me to do this with code (without using SetMaterial as it is actually just ReplaceObject).

minor agate
#

Material mat = Material.GetMaterial(MaterialResourcePathHere)

#

Then use mat.SetParam(paramName, valuehere);

#

It will change it FOR ALL meshes using said material at runtime

#

It can be used in normal game as well

fringe prairie
#

Ok, that fits my usecase perfectly. I saw that earlier and wasn't sure if that would work. I'm doing something pretty hacky modifying emissive properties of a material using ParametricMaterialInstanceComponent. The issue is that if the original material's emissive color is not set white, SetEmissiveC/M has no actual affect on the material. So what I was doing was setting the emissive to the value I'd like it to be at, but then setting the emissive multiplier to 0, but because this only runs on my component it would leave items emissive such as with item previews, etc.

This should allow me to leave the base material's emissive properties alone, and just modify with code on the fly.

minor agate
#

As ParametricMaterialInstanceComponent wrecks object instancing

fringe prairie
minor agate
#

Many objects of the same shape, same material, same properties, etc they get loaded once, then copied around with changes to certain extent to improve performance.

#

(It's more complicated than that but that gives you the gist)

#

This

#

The one i told you with the Material class does not mess this up

frosty coral
#

What would be the simplest way to detect any projectile hits at the object with no damage manager/destruction component?

fringe prairie
# minor agate Then use `mat.SetParam(paramName, valuehere);`

Hate to bother you but what is expected for void value on SetParam. The .emat file doesn't give many clues. I have tried passing string "1 1 1 1", Color.White, {1.0, 1.0, 1.0, 1.0} etc. for Emissive and nothing seems to take effect though using ResetParam does function. Same with EmissiveLV - where the level doesn't seem to change no matter how I try to pass the (float?).

minor agate
#

Anytime you see void on a method, you should feed it a variable

#

In case of that one

#

has to be float value[4]

#

(Depends how it is stored in the emat)

#

If its 0 1.0 0.5 0.5 in the emat

#

the nyo uhave to do that static array of floats

#

Open the emat in text view and check

#

For example

fringe prairie
#

I was passing a variable to the function, but I guess my confusion hinged on how to instantiate the array of floats. So instead of:
protected ref array<float> newEmissiveColor = {1.0, 1.0, 1.0, 1.0};

I needed to do:
protected float newEmissiveColor[4] = {1.0, 1.0, 1.0, 1.0};

That fixed it, makes sense it should be fixed length.

minor agate
#

float newEmissiveColor[4]

#

that

#

not static keyword

fringe prairie
#

Yeah, feel like a noob on that one. Coming from JS has been a pain but I'm trying haha.

ocean kernel
#

Light a tiny gradient instead of sharp cutoff

fringe prairie
#

¯_(ツ)_/¯

#

Would have to know the material below the object

abstract crescent
#

can i send replication command ( Rpc(..) ) with data to specific player, not for all players?

desert escarp
#

specificy a playerId in the Rpc inputs then just add
if (SCR_PlayerController.GetLocalPlayerId() != playerId)
return;

abstract crescent
desert escarp
#

I don't believe there is a way to achieve what you are doing currently to my knowledge

#

Without that quick check in a broadcast

ocean kernel
ocean kernel
fringe prairie
toxic lichen
toxic lichen
foggy swift
#

😂

toxic lichen
ocean kernel
#

just make a vm with gpu passthrough for modding idk, lunix is unsupported so not sure why waste time

#

unless just for the fun of it

toxic bear
#

But I just do not like Windows

foggy swift
#

only reason why I tolerate it is because I used a heavily modified iso

toxic bear
#

I had also scripts for reedit etc .. but they always break bcuz of update and to lazy to keep updating the script just to have windows not use 10% of your hardware already .. if not more.

foggy swift
#

gotcha, the iso im using wasn't anywhere public from github or anything. my buddy made it and gave it to me

toxic bear
#

I hope he is a really good buddy coolfrog

pliant ingot
spark otter
#

RIP try breaking your formula into parts

red cedar
#

I wish we would get some HTML support or something in between like ASP.NET for UIS

This is just way too confusing

pliant ingot
spark otter
lean yew
#

@red cedar I'm having some trouble with PeerTool, it's silently failing to connect a new client. No errors on the console.

#

Log File^

red cedar
red cedar
lean yew
#

I'm currently rolling just the MpTest.ent without addons just to get the peerTool working.

red cedar
lean yew
#

I get this. It looks like it's starting up another client. And then it just silently crashes.

red cedar
#

Oh yeah

#

Ok

#

The executable is not correct

red cedar
lean yew
#

O.

#

Working now.

#

Thanks. That* feels* like it shouldn't just silently fail.

red cedar
toxic lichen
toxic lichen
#

Anyway. Is there a script responsible for the logic of character movement, for example, when walking? I'm looking at different controllers and components and can't connect where the direct logic is handled

#
class CharacterMovementState
{
    int m_CommandTypeId; //! current command's id
    int m_iStanceIdx; //! current stance, only if the command has a stance
    float m_fMovement; //! current movement (0 idle, 1 walk, 2-run, 3-sprint), only if the command has a movement 
    float m_fLeaning; //! leaning state (not all commands need to have all movements)
    float m_fDynamicStance;    //! current adjusted stance 0.f - 1.f, only if the command has a adjusted stance
    ECharacterDataState    m_DataState; //! simulation state flags

}

It's the closest thing I've found

midnight talon
toxic lichen
toxic lichen
#

Good afternoon. Could you tell me if it is possible to override the method or component responsible for the walking logic? I would like to influence all the characters with my mod, and therefore it would help me a lot to override the method (if it exists alone):).

I apologise for the ping after three years

craggy jolt
#

https://community.bistudio.com/wiki/Arma_Reforger:Entity_Lifecycle has no EOnActivate for Components, yet there is

    /*!
    * Event when component is activated.
    */
    event protected void EOnActivate(IEntity owner);
```in `ScriptComponent` and vanilla components seem to have it too in few places. I tried adding this event to my component but it never triggers. What is going on with this event for component?
high hawk
craggy jolt
#

I'm doing tests with -nds 1 -nwkResolution 10 server/workbench settings from recent replication bootcamp and peer tool client never gets script spawned objects streamed in for them. Only world editor placed entities stream in and out at close distance but server script spawned never do.

#

Spawning through remote console:

IEntity p = GetGame().GetPlayerController().GetControlledEntity();
vector t[4];
p.GetTransform(t);
Resource res = Resource.Load("{B1C6B4A379D1BB77}Prefabs/Structures/Houses/Garage/Garage_E_01/Garage_E_01_Base.et");
IEntity veh = GetGame().SpawnEntityPrefab(res);
veh.SetTransform(t);
veh.Update();
#

I wonder why

torn bane
fringe prairie
torn bane
#

Good news, our script wizard cast some spells and in one of the next major versions (likely not the very next one but the one after) this will be supported, so you can feature toggle using gproj and track those changes in your version control to share with collborators so you do not need to sync which cli param you all use. Thank you for the reminder about this 🙂

vast flower
#

Is QueryEntitiesByAABB faster than QueryEntitiesBySphere on large area checks?

abstract crescent
#

how can i know that player already connected and created on client side?
I use **OnPlayerConnected **or **OnPlayerRegistered **and send Rpc to client, but this client isnt init and hasnt name and id yet. **GetLocalPlayerId **returns 0 randomly, but its all ok when i use delay in 3-5 seconds.

Peer client logs without delay:

14:46:20.421   SCRIPT       : string message = 'DEBUG: SCR_PlayerController.GetLocalPlayerId 0'
14:46:20.421   NETWORK      : ### Creating player: PlayerId=2, Name=Player (0)
14:46:20.421   NETWORK      : ### Updating player: PlayerId=2, Name=Player (0), IdentityId=
#

SCR_EntityToolbarItemEditorUIComponent

abstract crescent
abstract crescent
# red cedar OnPlayerAuditSuccess?

it doesnt work for peer client, because peer client fails audit all time, but it can works for normal clients and flow

15:46:16.749   NETWORK      : ### Creating player: PlayerId=2, Name=Player (0)
15:46:16.750   NETWORK      : ### Updating player: PlayerId=2, Name=Player (0), IdentityId=
15:46:16.753   SCRIPT    (W): UpdateBlockList failed. Another request in progress.
15:46:16.853 BACKEND   (E): [RestApi] ID:[7] TYPE:[EBREQ_GAME_ListBlockedUsers] Error Code:400 - Bad Request, apiCode="InvalidInput", uid="DELETED :D", message="accessToken can't be empty"
15:46:17.021 BACKEND   (E): [RestApi] ID:[9] TYPE:[EBREQ_WORKSHOP_GetVersionSizeDiffWorkshop] Error Code:401 - Unauthorized, apiCode="Unauthorized", uid="DELETED TOO :D", message="Unauthorized"
red cedar
#

Peertool clients will always fail the audit as you only have one identiy id.

abstract crescent
#

but it doesnt call **OnPlayerAuditFail **too thonk
Ok. I understand. I will test audit on normal dedicated server.

manic venture
#

Is there a way to change movement speed through scripting?

I was able to scale the character but when the character is larger than a certain amount animation and speed are weird

red cedar
#

that's a bit of peertool jank for you

toxic lichen
# torn bane What exactly are you trying to change? Movement of entities is usually in c++

I want to make a mod that tracks the player's equipment and, in particular, inflicts minor damage if they move while their shoes are off. Literally damage from bumps on the ground)
I thought the easiest way would be to modify the component responsible for direct movement, but if there is a better way, I am willing to change my approach, because there is only script option

fervent cedar
toxic lichen
craggy jolt
#

Are there some debug shapes in vanilla AR similar to A3's arrows and spheres? I did quick search but couldn't find any.

#

Having to use crackers right now

fervent cedar
#

    override void _WB_AfterWorldUpdate(float timeSlice)
    {
        if (m_bVisualize)
        {
            auto origin = GetOrigin();
            auto radiusShape = Shape.CreateSphere(COLOR_YELLOW, ShapeFlags.WIREFRAME | ShapeFlags.ONCE, origin, m_fRadius);
            
            foreach (DoorStruct door : m_aQueriedDoors)
            {
                auto arrowShape = Shape.CreateArrow(origin, door.owner.GetOrigin(), 0.1, COLOR_GREEN, ShapeFlags.ONCE);
            }    
        }
        
        super._WB_AfterWorldUpdate(timeSlice);
    }
    
``` etc
craggy jolt
red cedar
red cedar
# craggy jolt What should I search for?

iirc

 protected ref Shape m_dbgInfantrySphere;
m_dbgInfantrySphere = Shape.CreateSphere(
            ARGB(255,   0, 255, 0),
            ShapeFlags.WIREFRAME | ShapeFlags.NOZBUFFER,
            iCenter,
            iRad
        );
craggy jolt
#

Ah, that's debug shape, thought there is a model or an entity

red cedar
#

Then i’m unsure sorry

neat oriole
#

There's a plane, cube and sphere in core->system->wbdata->materialEditor, but this is honestly more for showcasing materials I assume

inland bronze
#

Trying to find better ways to optimize mass entity spawning.

Is it possible to have entities spawn and a game system perform during the preload of the server or are we restricted to on init or post init?

#

I know there's the PreloadManager, which will handle prefabs and in-turn those entities, but I guess my issue is more so figuring out the game system in preload, unless I'm misunderstanding how the game systems work 🤔

#

Maybe on init is good enough, potentially

fervent cedar
#

I thought preloadmanager was to preload assets into memory or sth

inland bronze
# fervent cedar <:frogthinking:1342082089150844938> what about spawning 10 entities per frame, j...

For this case, no persistence. And was previously doing 1 entity spawning every half second, but the processing needed to determine which item is gonna spawn and which spawner was bogging down performance quite a bit, even with a bunch of limiters set (not a professional coder by any means).

So looking to do a mass spawn of items at server start to get all the entity spawns out of the way when basically no players are connected, and then go to work on the processing itself to reduce the performance drawn each time it checks afterwards for entity spawning.

But talking about possible 4500+ spawn locations across the map, with processing from a config with about 500+ possible spawnable entities total

#

Takes quite a bit processing power to sort through all of it 😅

#

Also probably mistaking PreloadManager from what it actually does

fervent cedar
#

Ahh, so you need a script that runs when the server starts the mission/game mode
And you need for the server to start the mission/game mode without any players connected.

I think you can just have a component in the game mode and call stuff from there

inland bronze
fervent cedar
#

think_turtle What is the slowest part ? Generate that once and save to .json 😄

torn bane
ocean kernel
desert escarp
#

I have an explosion my player spawns whenever my drone crashes into a player, is there anyway to set the player as the instigator of that explosion, I can't seem to find anything exposed to us

toxic lichen
static vale
desert escarp
#

Mortars are bullets still

static vale
#

demo charges then?

desert escarp
#

Hmm maybe I'll look there actually

torn bane
modest elbow
#

Trying to set-up the enfusion persistence framework, could use some assistance

high hawk
desert escarp
#

Yeah gotta find some voodoo wizard magic aka constructors to try and set the instigator on all clients at once whenever the drone explodes

high hawk
#

Rpc_DoTrigger

desert escarp
#

Yeah that has time tho to set whoever is setting the trigger to the mine

#

My explosion is instant

high hawk
#

Take a look at my proxy mines, I made my own custom trigger, may be something useful in there for u

desert escarp
#

Object detonates almost immediately after creation so the client has to get that change before it detonates easiest way is like I said just using a constructor

lean yew
#

I'd like a review on my mod (just two small scripts), the intent is to only allow Squad Leaders to transmit on platoon net and to limit the number of squads.

https://github.com/Prontious/EffectiveCommunications/blob/5b09f7e2825f96fe0b15eabd45d4e6f16b797984/Scripts/Game/GameMode/Squads/Modded/SCR_VONController.c (SL Transmit)
https://github.com/Prontious/EffectiveCommunications/blob/master/Scripts/Game/GameMode/Squads/Modded/SCR_GroupsManagerComponent.c#L6 (Limit Max Squads)

GitHub

Arma Mod. Contribute to Prontious/EffectiveCommunications development by creating an account on GitHub.

GitHub

Arma Mod. Contribute to Prontious/EffectiveCommunications development by creating an account on GitHub.

#

This is my first mod so will probably need a chunk of feedback. This works well on peer tool.

wet pecan
high hawk
craggy jolt
#

Thinking about using CircleGridMap, is there a quick way to get bounding sphere radius or I have to calculate/guesstimate it using IEntity.GetBounds?

craggy jolt
#

I'm confused about component events, I see that vanilla component scripts do stuff like

    override void OnPostInit(IEntity owner)
    {
        SetEventMask(owner, EntityEvent.INIT);
```but its already inside "post init" event, didn't it need a mask set beforehand somewhere? (like in component constructor)
#

Another thing, component set event masks to parent entities, not each individual componet. Say there is an entity with 10 components and 1 component sets FRAME event mask on constructor, does it mean because of 1 component engine will try to call EOnFrame on each 10 components?

#

Or does calling proto external int SetEventMask(notnull IEntity owner, int mask); sets the mask just for the component it was called from and not entire entity and all its components?

#

If there is an article explaining it that I missed, please point me to it. "Entity Lifecycle" doesn't.

craggy jolt
#

Okay, so I tested it and indeed it seems that proto external int SetEventMask(notnull IEntity owner, int mask); is contextual to the component its called from, it sets the event mask for the component itself AND entity, but not other components. What a strange system.

#

OnPostInit seems to be always called on components, I guess by the engine and not a script somewhere?

honest umbra
#

Question: in the script MapDescriptorProps.c. the function cs proto external void SetImageDef( string name ); lets you choose the icon. What imageset does this function refer to? there are many imagesets in the game. I input an icon name from the conflict imageset but on the map it shows a different imageset. Would be nice to know what this functing is referring to. Anyone know about this?

abstract crescent
# lean yew I'd like a review on my mod (just two small scripts), the intent is to only allo...

On first look:

  • add ".gitignore" file and put "resourceDatabase.rdb" in this file and delete "resourceDatabase.rdb" from git - this will help u in future.
  • rename "SCR_GroupsManagerComponent.c" to "MYTAG_GroupsManagerComponent.c"
  • rename "SCR_VONController.c" to "MYTAG_VONController.c"
  • replace "private const int MAX_SQUADS_LIMIT = 2;" with [Attribute(defvalue: "2")] parameter
  • add check for "groupsMgr" and "factionMgr"
  • using multilevels "if" inside "if" with 6 calls same "return super.ActivateVON" is not good, i think
abstract crescent
honest umbra
#

this is the one i used in the script

abstract crescent
#

If u cant find parameters in code, then try search in configs ? Can it use this ?
{FF6B20825D4A566C}Configs/Map/MapDescriptorDefaults.conf
{4FFDB559B60FC7BC}Configs/Map/MapDescriptorVisibilityDefault.conf

honest umbra
#

this is what shows up

honest umbra
#

nothing in the config relevant

#

so it is pulling from this imageset

#

the weird thing, the icon is it showing is a completley different string than what i set it as in the script

#

cs item.SetImageDef("Task_Evac");

#

lol its a ghost script too

#

found this ```cs
[Attribute("0", UIWidgets.EditBox, desc: "imageset Index, determines to which imageset should be referred for its image", "0 100 1")]
int m_iImageSetIndex;

it is in the script `SCR_MapDescriptorDefaults.c`
#

ok so SCR_MapEntity i guess deals with the default imagesets. ill chekc into that.

abstract crescent
honest umbra
#

I just searched m_aDescriptorDefaults and found it in mapentity.c

#

in that .conf file i see this, but man...i dont know what the value for each imageset is

#

bascially, how i have it setup is I am using the Icon entry from the MapDescriptorDefaults.conf

#

it is using imageset index = 1

#

you can use 0 - 100. i just wonder what exactly the image set index value refers to. like is each imageset linked to an index value? or does that mean how many imagesets are used? idk.

#

found another clue

toxic bear
minor agate
#

Constructor happens before, first step on init

#

EOnInit happens after WHOLE Entity and ALL components get initialized

minor agate
#

Quite wasteful to enable for all don't you think?

#

Also you can enable and disable on select components at runtime at will

#

Meaning that no need to do if checks on a boolean like (IsEnabledFrame) to work on frame

craggy jolt
ocean kernel
#

Sometimes I might depend on some data from it that is not available yet

torn bane
ocean kernel
#

nice

#

I thought that was just for the purpose of logging that I missed a component

craggy jolt
#

What would be the neatest way to check if entity has moved more than X meters since last position saved?

#

Methods I can think of:

  • A component to query to save the position and the check if parent entity moved, seems excessive for just one thing
  • A Managed to vector map? I guess using entity as key is possible?
ocean kernel
#

All you need is 50 lines of boilerplate and you're good to go. Since systems dont have a way to poll every N frames or seconds.

#

But I would use a system to register those entities and track their position changes over time

#

map<MyScriptComponent, ref MyClassThatIsAStructForMyData>

#

of course it can be a vector but I like to assume more data will be collected than just position in the future

craggy jolt
#

Thanks, gonna try going map route

ocean kernel
#

Of course you could also store all this data inside the component itself and just do array<MyScriptComponent> but I like having that data in the system

craggy jolt
#
IEntity p = GetGame().GetPlayerController().GetControlledEntity();
map<IEntity, vector> test = new map<IEntity, vector>();
test.Set(p, p.GetOrigin());
Print(test.Get(p));
```works out
#

Thanks for the advice, still just doing babby steps

ocean kernel
#

Just be careful with the entities being deleted etc

craggy jolt
#

Speaking of deletion, I have a grid map (CircleGridMap) with few objects in it, if I delete one (with SCR_EntityHelper.DeleteEntityAndChildren) and then query the grid map (FindEntitiesInRange) it crashes the game. I assume I need to make sure to Remove the entity from the grid map manually?

craggy jolt
craggy jolt
#

Is there a way to iterate through all prefabs available in game?

vernal moat
craggy jolt
serene fox
#

Hellloo 😄 Question: foreach() { continue; } <-- does continue means the same then "return next" so, skip the current item and resuming the next in the loop?

ocean kernel
#

It means go to the next iteration

#

break means stop iterating

static vale
#

Generally maps should be avoided when possible and you’d just create an array of a custom class(or component) if needed.

fringe prairie
#

Does anybody know how to get the list of materials used by a base .XOB. I can get the materials from a prefab only if that prefab overrides the default materials for the object. I've searched in here and only seen people talk about it but no implementation. I would assume I would just use base container again on it? Or do I need to inspect the meta file?

fervent cedar
fringe prairie
#

Yeah I tried basecontainer on the XOB and it didn't work (no surprise there) - because I'm sure the intention is to use VObject then GetMaterials (which gives me material names not resource paths), and without a way to resolve resource paths if I want compatibility with what I am doing I have to manually go to each prefab and overwrite the materials on the mesh object.

prisma lance
#

Hey guys, do anyone know how to edit richtext in layout via GM? 😅

thick arrow
#

is it possible to add an action to something with ActionsManagerComponent programatically?

static vale
craggy jolt
ocean kernel
#

I need ideas on tracking physics corrections of a vehicle

#

ie. when you desync from server and server corrects you

#

I suppose I can track changes of position that are not in the general direction of the object's velocity

red cedar
#

Just make them explode with the sound of an incoming rocket.
This way they think they died fairly and won’t blame desync

dusk bridge
#

Hey guys, do any of you know if it is possible to capture a screenshot automatically from a manualcamera component in my world? If so what are the mechanics of that, like where would it be stored?

#

Thanks so much

ocean kernel
#

Also

#

Need milliseconds unix timestamp

#

Also where is the logic for moving entities around as game master

#

Like dragging them around

static vale
# craggy jolt Why though, what downside you see here?

Not specially a downside but a way you can do it better. You should lean into OOP when possible. Not sure what your doing but if i wanted to check a players position against something. I would first move it client side to preserve server performance(unless you can't/have other concerns). Then a component would check player position and keep a variable for the last position, do any logic actions, ect

fringe prairie
#

I feel so close but so far. XOB files are prefixed with FORM, which means using base container tools gives error:
09:57:40.459 SCRIPT (E): Unknown class 'FORM' at offset 5(0x5)
So it can read the file, and if I could just read the file as text, I can substring hack my way to reading the materials (they are right there!!!), but it just crashes the game here. So then my next idea is FileIO or figuring out how to get LoadContext.ReadFile to accomplish the task.

ocean kernel
#

dont you just love being rewarded with a crash for compiling your scripts

fringe prairie
#

I am reading XOBs as strings using FileIO

fringe prairie
red cedar
next talon
#

Does anyone know of a way to prevent players from taking off armbands from loadouts such as the WCS armbands?

#

like its locked to their loadouts

ocean kernel
fringe prairie
lean yew
#

I've made those changes. Again, just to restate the goal: Only allow Squad Leaders to transmit on platoon frequencies and limit the number of squads that can be created.

broken karma
#

Is there anyone available that can dm me, im currently trying to write script for a harvesting system but keep getting errors and idk why... any help would be appreciated

honest umbra
abstract crescent
honest umbra
#

i am assuming yes, however i dont know how to edit it or add to it.

#

yes you can override

normal frigate
#

Hi guys, can you help,
can i in Server Admin Tools in
"repeatedChatMessages": [
{
"message": "Example",
"intervalMinutes": 1
},
Make more messages then one?

static vale
vernal hawk
#

Anyone got a good tutorial video on how to make armor function?

#

Because I cannot for the life of me find anything

sleek moat
#

Is there a way to have instances of things per player? I'm wanting to have an instanced interior without having to have like 60 under the map to tp people to individually

ocean kernel
#

You can spawn it locally sure

half patio
#

is it possible to create a readme file in my mod project ?

#

who ever check marked, how can i ? i dont see it

ocean kernel
#

does it include all txt files? what about md files

vernal moat
#

i think you wont be able to open it in the tools tho

shy steeple
#

I haven't found a way to write them nor create them though.

#

(directly through workbench)

shut hull
#

Anyone know how to get in touch with this mods creator? Exactly what I have been wanting with the exception of the status icons in top left corner. Would like to make those go away if its possible.

shy steeple
#

In your mod source directory

static vale
broken karma
#

Is there anyone available that can dm me, im currently trying to write script for a harvesting system but keep getting errors and idk why... any help would be appreciated

red cedar
#

I'm having an issue with one of my trigger entities for some reason the bIsEmpty is alwys true even when i get rid of the AddClassType or when i'm inside of the sphere.


     override void EOnInit(IEntity owner)
    {
        m_PlayersInside = {};
        m_UplinkComponent = ToW_VehicleUplinkComponent.Cast(
            owner.FindComponent(ToW_VehicleUplinkComponent)
        );
        
        if (!m_UplinkComponent)
        {
            IEntity parent = owner.GetParent();
            if (parent)
            {
                m_UplinkComponent = ToW_VehicleUplinkComponent.Cast(
                    parent.FindComponent(ToW_VehicleUplinkComponent)
                );
            }
        }
    
        
        AddClassType(ChimeraCharacter);
        SetUpdateRate(2);  
        EnablePeriodicQueries(true);
        
        super.EOnInit(owner);
    }

     override event protected void OnQueryFinished(bool bIsEmpty)
    {
        vector servPos = GetGame().GetPlayerController().GetControlledEntity().GetOrigin();
        float distance = vector.Distance(servPos, GetOrigin());
        Log("Distance: " + distance.ToString());
        if(bIsEmpty)    // bIsEmpty is always '1' even when I am inside of the sphere,and even when there is no class filter
        {
            return; 
        }
        
        super.OnQueryFinished(bIsEmpty);
        array<IEntity> entities = {};
        GetEntitiesInside(entities);
        Log("Entities in circle : " + entities.Count());
        
    }

Any help would be appreciated !

abstract crescent
#

Use ScriptedEntityFilterForQuery function to print in logs all entities in yours trigger

red cedar
abstract crescent
red cedar
#

I enable those in the EOnInit but i'll give that a try.

It works fine for my other trigger entities somehow.

abstract crescent
#

Or u can try put super.EOnInit(owner); in top of init function

red cedar
#

They are not queried tho (disabled the return statement on Bisempty

sweet badger
shy steeple
#

ReadMe.C

#

One giant comment block

half patio
#

Hmmm I might just make a .c script file and just do // and write the readme file there

Cause I’m making a chat moderation bot and the readme will explain a lot to people who might download it

half patio
shy steeple
sweet badger
#

It's the opposite, it only packages certain things

red cedar
#

I fail to understand why it doesn't detect my character while the radius of the sphere is 1.5KM and i'm right on top of the center...

abstract crescent
red cedar
abstract crescent
#

try to remove all enable/disable/set trigger code and make it from prefab options and check it

#

does it work with prefab settings?

red cedar
#

You mean with the prefab filter ?

sweet badger
shy steeple
#

You should work at BI

#

You seem to share the spirit

abstract crescent
red cedar
#

ok

#

No success so far :(

#

It’s the first trigger entity that i have that’s acting up. It’s so strange

abstract crescent
#

do you have another mods, can they change trigger class?

half patio
red cedar
half patio
# red cedar Lol

It’s true tho 😂 saw an image awhile back that this guy created a full on bar area inside of a house no one will visit on the edge of the world, the amount of detail he did was insane

#

Wish I saved the image 🤷🏼‍♀️

fringe prairie
fervent cedar
minor agate
fringe prairie
sleek dove
#

Your thing is weird, remap should take the same name as GetMaterials returns you

fringe prairie
#

Yes, remap was just an example, really I need the base material names so that I know what materials to edit

sleek dove
#

For example I opened BeeHive_Red and you can see that SourceMaterial is BeeHive_01_Main which is the name of the source material that you want to remap

#

and GetMaterrials should give you BeeHive_01_Main

fringe prairie
#

I don't necessarily need this for remap, trying to do material editing by modifying the material directly - as SetObject breaks animations.

#

I need the resource name for that, the name doesn't help me much.

#

I'll edit the ticket to be a bit less confusing in terms of purpose

sleek dove
#

Then material editing is also the same, you use material name not material path

fringe prairie
sleek dove
#

No this is just to get the material from path of the material

#

If you want to have default material path assigned on a mesh, I don't think there is any API for this

#

I guess you could maybe assign the xob directly on an empty entity, and maybe there is an API then to get the materials from it

fringe prairie
sleek dove
#

Yeah just saying that you want default assigned material to a material name seems easier, but I gess the last method API kinda says that

#

But reading the MeshObject will not give you anything, only new assigned material not all of them anyway

#

But why exactly you need original path? Because anyway if you dont put it in remap it will just use original, you want to do what exactly with it ?

maiden goblet
#

@minor agate Did you ever make that character on moving patform feature you mentioned a while ago?

fringe prairie
# sleek dove But why exactly you need original path? Because anyway if you dont put it in rem...

I guess I need to put in another ticket but if a material's Emissive color is set to black (default), the ParametricMaterialInstanceComponent does not successfully change the emissive color via the emisive user parameter. Was also informed by Mario that using that component creates issues anyways and for my use case I want to take a given IEntity, get it's materials, edit them during runtime. End state is being able to create different effects for weapons, vehicles, etc. Remap can't be used because SetObject breaks animation or cause game crash depending on object size, complexity, components. I am aware that editing a material edits all instances where it is used, that is my intention for this use case.

thick arrow
#

way to get bone/socket programmatically?

crisp maple
#

Hey lads. I am looking for someone who is knowledgeable in scripting to create something for me. It isn't a commission, just voluntary work. I have an idea that I'm sure could be possible, I just do not have the time to learn scripting to do it

scarlet iris
#

Hey @river imp sorry for reaching out here but need some help with your Zeliks Persistent Storage mod. just wondering if this mod is good to go out of the box just by adding the prefab to the world in workbench? or do I also have to set up EPF in some way? thanks!

dire sinew
crisp maple
#

Gotcha. Thank you 🫡

spark otter
#

how can I detect if the AI are in combat or not?

dire sinew
spark otter
dire sinew
#

What about checking known targets?

#

Let me check the method. I recently was trying to cluster enemies based on all known targets to decide QRF priorities.

#
foreach (AIGroup group : component.GetManagedGroups())
{
    SCR_AIGroupUtilityComponent utility = SCR_AIGroupUtilityComponent.Cast(group.FindComponent(SCR_AIGroupUtilityComponent));
    if (!utility || !utility.m_Perception)
        continue;
    
    foreach (SCR_AITargetInfo targetInfo : utility.m_Perception.m_aTargets)
    {
        SCR_AITargetInfo latestTargetInfo;
        if (!compiledTargets.Find(targetInfo.m_Entity, latestTargetInfo) || latestTargetInfo.m_fTimestamp > targetInfo.m_fTimestamp)
            compiledTargets[targetInfo.m_Entity] = targetInfo;
    }
}
#

They are on the perception component

spark otter
#

Ok cool, Im currently trying GetCombatModeActual/external under the group utility component.

sweet badger
dire sinew
#

Oh nvm, it actually already is an attribute in vanilla 😅

spark otter
spark otter
#

hmm, so its not perfect, apparently they can still be in EGroupControlMode.FOLLOWING_WAYPOINT and in combat at the same time. Maybe the target check would be better for this. I'm trying to write a check to respawn stuck ai, I just need to determine if they have stopped for a firefight or they are actually stuck.

vernal moat
#

👆 Arma 3 AI convoy disaster flashbacks activated jace_scared

spark otter
#

This is very strange, now they seem to just go idle after they no longer have a target. This is turning out to require a lot more scripting than I thought it would take!

#

is there really no, Im done with the fight, now Ill go back to what i was doing? This could be yet another reason my AI are getting stuck!

thick arrow
#

is there a way to check paint on terrain beneath character

#

and what is the method if so

tough cave
#

is there a way to run scripts in play mode without the ENF_WB and related workbench defines? trying to simulate a real server while still being able to debug

spark otter
# dire sinew ```cpp foreach (AIGroup group : component.GetManagedGroups()) { SCR_AIGroupU...

Thanks again guys! I ended up getting it going with: ```c
SCR_AIGroupUtilityComponent utilComp = group.GetGroupUtilityComponent();
if (!utilComp || !utilComp.m_Perception)
return;

bool groupInCombat = false;

if (utilComp.m_Perception.m_aTargets.Count() > 0)
{
groupInCombat = true;
}
And also @sweet badger thisc
SCR_AIGroupInfoComponent groupInfoComp = SCR_AIGroupInfoComponent.Cast(group.FindComponent(SCR_AIGroupInfoComponent));
bool groupIsIdle = groupInfoComp.GetGroupControlMode() == EGroupControlMode.IDLE;

static vale
magic moss
#

I’m looking for some help getting started with some proof-of-concept scripts in Arma Reforger. I want to set up my Workbench so I can test things in a proper multiplayer environment, but I’m not sure where to begin.

I tried this before but got frustrated because I kept spawning as a camera entity instead of an actual player, so I couldn’t really test what I needed.

My goal is to experiment with mods like a vehicle ownership and lock or unlock system that ties to player IDs.

If anyone has tips on setting up Workbench or testing ideas like this, I’d really appreciate any advice.

Thanks a lot for any pointers.

modest nebula
#

Is there a way to debug EOnInit methods for entities without Enfusion Studio dead locking itself?

At the moment I have my custom entity in the world with EOnInit method and I have break point in that method. Now when I run Validate and Reload Scripts in Script editor whole Enfusion Studio will deadlock since I will have the loading bar open and break point triggered in Script Editor. I'm not able to click anything to continue from the break point. Only thing that I can do is kill Enfusion Studio and next try remember take those break points off...

Or is there is something I do fundamentally wrong here?

lean yew
magic moss
static vale
pliant ingot
modest nebula
dire sinew
minor agate
#

You want a list of all materials in an XOB?

fringe prairie
#

Would like material resource names yes

#

Which you can get from a prefab, but it’s not reliable in the case for objects without any material overrides - where the prefab data for materials appears to be empty.

fringe prairie
# minor agate prefab or xob?

I would like to get it from the XOB ideally. Getting it from prefab was my fallback because sometimes it has the current materials.

minor agate
#

Not possible currently. Any addition to have this in the future will take months probably as well due to release process

minor agate
#

So we can't promise it anytime soon

#

We can add it no issues, just the release of it might take time.

fringe prairie
#

I can read from xob with fileIO because the materials are front loaded in the file but obviously there is no current API for it that works in production. I also tried to force the material data into the prefab by manually adding the material overrides, but if it’s the same material as the XOB workbench saves over the prefab to remove the references haha.

minor agate
#

With resource name or filesystem (Not the same)?

#

Use exact path

#

As mentioned here

#

You can see there what an exact path is

#

resource name is not filesystem related fully

#

The underlying system makes use of it

#

But it is not the same

fringe prairie
#

I’ll double check what I tried. I think I found that info when I implemented my attempt

minor agate
#

ResourceName and such is for ResourceDatabase related things

#

FileIO is mostly for Filesystem operations

#

Which can be problematic to use ResourceName as that can resolve to something that you do not want

#

And the API does not have it clear that it might be trying to read for Disk Filesystem or from virtual filesystem with ResourceName

fringe prairie
minor agate
#

That is local path

fringe prairie
#

Hm, so I should prefix with $ArmaReforger:, or I need to find the mod that it comes from? I feel a bit silly rereading now

minor agate
#

Same issues I told you before

#

Use Exact Path

#

and try

minor agate
#

Because if you have say

#

a file with same absolute path in ArmaReforger, and in ModA

#

then if you do $ArmaReforger: it will then load ArmaReforger one

#

instead of ModA's with $ModA:

#

This is also why we say as well the ResourceName is not a path

#

It's more complicated that than

#

It's also why File APIs do not use ResourceName

fringe prairie
#

👍, makes complete sense. I guess now I have to figure out what mod a given IEntity comes from.

minor agate
#

Then on callback you get

fringe prairie
#

HM that helps a lot thanks. And using this approach should work on clients, ideally?

minor agate
#

ResourceDatabase is used to make override, duplicate, inherit, etc happen to some extent

#

It's part of what resolves how it gets done

#

So it will give you that information, as it is part of the database of registered resources

fringe prairie
#

Well it's working so far, still giving the FileIO dangerous warning in workbench, but exact paths are being used so we will see how it works when published.

minor agate
#

enjoy

fervent cedar
minor agate
fervent cedar
#

ResourceName.GetPath();

minor agate
fervent cedar
#
            ResourceName t_rName = f_IEnt.GetPrefabData().GetPrefabName();
            string t_sResNamePath = t_rName.GetPath();
            // open old file and steal line 1
            FileHandle t_File_Old = FileIO.OpenFile(t_sResNamePath, FileMode.READ);
            if (!t_File_Old) {
                Print("no old file opened");
                // t_File_Old.Close();
                return null;
            };

            array<string> t_aSrc = {};
            array<string> t_aMat = {};
            bool t_bIsInMesh = false;
            bool t_bIsInMat = false;
            string t_sLineCurrent;
            while (t_File_Old.ReadLine(t_sLineCurrent) > 0) {
                if (t_sLineCurrent.Contains("MeshObject")) {
                    t_bIsInMesh = true;
                    continue;
                };
#

                if (!t_bIsInMesh) {
                    continue;
                };
                if (t_sLineCurrent.Contains("    }")) {
                    t_bIsInMesh = false;
                    continue;
                };


                if (t_sLineCurrent.Contains("MaterialAssignClass")) {
                    t_bIsInMat = true;
                    continue;
                };
                if (!t_bIsInMat) {
                    continue;
                };
                if (t_sLineCurrent.Contains("      }")) {
                    t_bIsInMat = false;
                    continue;
                };

                
                if (t_sLineCurrent.Contains("SourceMaterial")) {
                    t_sLineCurrent = t_sLineCurrent.Substring(23, (t_sLineCurrent.Length() - 24));
                    t_aSrc.Insert(t_sLineCurrent);
                    Print("S:" + t_sLineCurrent);
                };
                if (t_sLineCurrent.Contains("AssignedMaterial")) {
                    t_sLineCurrent = t_sLineCurrent.Substring(25, (t_sLineCurrent.Length() - 26));
                    t_aSrc.Insert(t_sLineCurrent);
                    Print("M:" + t_sLineCurrent);
                };


            };
            t_File_Old.Close();
minor agate
#

ResourceName works on string as it is a meta class (Yes, we have such things)

#

You can pass a string as ResourceName as well for the same reason

#

But on how they are intended to be used, and what they could hold. They are different

fervent cedar
#

I don't even believe this openFile stuff works on normal clients, I never tried it

desert escarp
#

Is there a way to reference a class object from another mod, but only have it use it if that mod is loaded

#

Trying to use the RHS Thermal system for my mod but don't want to have it as a depen, is there a more elegant way then a Compat mod

fringe prairie
#

It works! @minor agate thank you I will try to use refs responsibly now

#

@ocean kernel pinging you for visibility, FileIO does work but exact paths must be used as discussed earlier in conversation.

ocean kernel
#

it works ingame?

fringe prairie
#

ill try to get a log just to make sure

#

im doing many things to get materials lol

#

its not crashing me like it did before, so I'm assuming it is working

#

Changing from "Assets/mymodel.xob" to "$somemod:Assets/mymodel.xob"

#

Nvm celebrated early, turns out it failed anyways

#

Time to use refs irresponsibly

#

Maybe it works on a server

#

If it works on server, if I really want to use this idea I will have to do XOB material discovery on server and somehow propogate that to clients... seems like a lot of work until that API is implemented in a couple months (if it's added)

fervent cedar
#

If it doesn't, generate a json file in the workbench and have that in the mod

fringe prairie
#

Yeah I could figure out a way to do this but the system I am using needs to know what materials are actually loaded (some may not be but a massive array of materials will not be good for VRAM or performance)

#

I'm not going to bother having server do it because there is no efficient way to surgically give that info to clients.

open pier
#

@ocean kernel Sorry for ping but I was hoping you could help me understand something with the ServerAdminTools.
Right now our ban list contains a little over 1100 players. We are now unable to unban players through the tool, we unban them and whenever it refreshes the list, it places them back in. I tried to remove the banned players from the config file while the server was down, but when i put the server back up it just loaded up the old list.

Do you know some way we'd be able to get around this issue without us having to remove ServerAdminTools and put it back in?

ocean kernel
#

I've tested it with more than that and it was fine

open pier
#

So looking like removing and adding it back in might be the solution for us? We do have a secondary ban system but your Tools generally help with that and information about the server so for now we'd rather keep it in.

ocean kernel
#

???? I'm saying I tested the mod with more than 1100 bans and it worked fine

#

So unless there's some change in vanilla that makes this not work anymore the problem might be somewhere else

#

Also, you said that the mod loaded the old list when starting - it does not magically load old list, it loads what's in your config file

#

It's not smart enough to keep backups

open pier
ocean kernel
#

The mod loads the ban list from your config, what you saw was loaded from your config.

open pier
#

Does the config do exact name matching? Just incase something messed up I savee it as serveradmintools_config_backup.json

#

So that and the normal file are sitting in there

ocean kernel
#

There is only one config file. There is no loading alternate config files or keeping backups in the mod. No such functionality.

open pier
#

Which that config overwrote itself. I just might not understand how arma caching works in general if it loads the old list instead of the new one.

I've ran into somewhat the same issue when trying to migrate database entries for players with EPF. After the server starts back up, it loads the old entry.

ocean kernel
#

Configuration will be overwritten when there is an error loading it, and you will get an error logged to the config. There is no magical rewrite cache old list loading out of thin air in the mod.

open pier
#

I understand that, but it's what's happening

ocean kernel
#

You are welcome to open the mod in WB and check the scripts, I'm not going to argue with you about how my own mod works.

open pier
#

Not tryna argue, just trying to get some insight on the issue, which I do appreciate. From what you say it's something that is happening on our end essentially

ocean kernel
#

If you have discovered a bug then provide repro steps without any other mods loaded and I'll look into it.

open pier
ocean kernel
#

I am personally not aware of any mods that make server admin tools randomly rewrite configuration files with data it doesnt know about, but maybe there is something like that

open pier
#

Like I said too, we do have the same issue with EPF when trying to migrate entries even when the server is completely down. Could be the DS we use at this point if another mod is having the same type of issue

ocean kernel
#

Some server providers have ultra garbage systems that dont allow direct access to files safely, maybe it's one of those

open pier
#

This atleast points me away from the wrong direction. We don't use nitrado or any provider like that, ran on a Linux box so I have complete control

desert escarp
#

Do destructors fire when an entity goes outside of a clients Rpl bubble

red cedar
#

If i want to call a method periodically is there a better and more clean way to do it than using the call queue or not really??

vernal moat
sleek dove
open pier
# red cedar If i want to call a method periodically is there a better and more clean way to ...

I've been getting around CallQueue by utilizing anything that runs on frame/tick to update TickCount
Class variable:
int timeTillNextUpdate = 2000(ms);
int startTime ;

In the init,
startTime = System.GetTickCount();

In the update function, before any logic happens

if((System.GetTickCount() - startTime) < timeTillNextUpdate)
return;

startTime = System.GetTickCount();

Everything below will have to wait 2s to actually run

Unsure if it's a better way over CallQueue but what i've understood from some of the things mario says about it, is to not over use CallQueue and this is how I get around it for periodic updates.

open pier
ocean kernel
#

Too bad we dont have millisecond precision for unix timestamp

#

Then making systems that run every N millis would be ez

#

I mean it's still ez, I just want less boilerplate

#

boilerplate is so 1995

fringe prairie
#

Add cron jobs to admin tools V2

desert escarp
#

Anyone worked with the explosive system. I currently have a script that uses an explosive trigger component however after switching to this it seems that the explosives damage is GREATLY reduced. Any input in why this may be happening.

#

Like before I could hit in the middle of a wedge and kill a whole fire team but now I have to direct hit to maybe kill

fringe prairie
#

Interesting question, can you script inputs, such as that for vehicles via script - better do it from server perspective?

#

Talking about stuff like driving a vehicle manually (turn wheel left, increase gas, etc.)

high hawk
desert escarp
#

Its so weird, cause I just added the trigger component that now spawns the explosive instead of manually doing it and now it's fucked

desert escarp
#

Figured it out

#

The drones collider was taking all the damage

half patio
#

Can someone help me better understand the collab on the Arma tools ? I’m wanting to do a project with my mate but I’m having a hard time how the collab feature works ?

Will we be able to edit things in real time together or only one at a time or is it solely on my side if I’m the project owner ?

If that’s the case what’s my best options for collating with someone on a project ?

half patio
dusky latch
#

Hello Im working with EnfusionPersistenceFramework and have been trying to attach a persistant component to my character controller / chimera character. I have been able to have it work fine with world components just not players. Anyone have any cases of this. cheers

remote oar
#

Asking here as I don't know if this is a data or config question. Does enfusion/reforger have support for post process effects like in a3?

#

Trying to make a personal lighting aware material that acts as a mask on the player ui

deep cradle
#

Hi,

I've got this function that runs on gamemode start:

modded class PS_GameModeCoop
{
    override void OnGameStart()
    {
        super.OnGameStart();
        Print("✅ PS_GameModeCoop started successfully.");

    }
}

I'd like to find every instance of a particular prefab that is currently on the map, similar to something like nearEntities in A3 - Can anyone point me in the right direction?

torn bane
half patio
#

@ocean kernel you know of anyway to protect certain scripts from being practically ripped by others? im wanting to protect certain scripts from people from simply opening up the arma tool and copy and pasting said script?

fringe prairie
#

No way to hide scripts or the like.

high hawk
ocean kernel
west prism
#

anybody can help i just want buy with ZEL banking currency

clever marlin
#

everytime you add an item to the shop you need to configure its options and payment method. so if you want to buy Rifle_ak74.et with only cash you can just delete the other two entries for bankcard and bankcard+cash.

#

@west prism \

#

process will be. 1. add item 2. add payment method. 3. fill out relevant amounts. and tick relevant boxes

foggy swift
# west prism

you only need one merchandise entry and configure everything in that single entry. if you don't you're just gonna end up with duplicates

foggy swift
# west prism

never used that mod but there's no items in your shopping cart and i assume the total is calculated from that my guy

#

or viewing docs on the mod (if provided)/viewing source and seeing how it works, or asking the mod creator

narrow aspen
#

Hey guys, I what to manage the bases in conflict mode so only a specific group of bases will be seizable/show task. And I update the target group once all bases in this group are cpatured by players. What class/functions should I check?

midnight talon
narrow aspen
split loom
#

I'm on day 3 of trying to figure this out

#

Im trying to set a custom faction's loadout, but when i go to test in game, when i select the faction in the respawn menu on the World editor (just testing in base game GM arland scenario), this pops up

#

this is what comes up when i hit debug.

As far as i can tell, this is a base game script, that i did not edit or even open until this error appeared

#

this does not happen with other modded custom factions i have added to the Mod as a dependency so i can compare to, so i have zero idea what im doing wrong or what needs to be done to fix this issue

west prism
#

i get error
Scripts/Game/Entities/SCR_AIGroup.c(1): error: Unknown type 'SCR_AIGroup'

lean yew
#

Do I have to do something to a mod to build / publish /prepare it for XBOX, PC, PS5?

high hawk
#

@lean yew

stable trellis
#

Where can I find information about how to use the Enforce Script language in Arma Reforger?

neat valley
#

How do I made and add script that compare two Supply Depots and return the bool?

grave dock
#

This may be a complex question, but does anyone know if possible to do the below, and if so, how difficult it would be?
Is it possible to add a switch to the base radio model shown below that would effectively cycle between all RadioBroadcast.acp files listed in the Component?

fringe prairie
grave dock
#

No, trying to achieve something more complex and suspect this is actually the most likely solution.

I want to be able to have channels/stations/playlists on the radio that players can cycle through

grave dock
proven moth
#

Is it possible to learn programming by modding this game?
I have some minimal experience with programming in python and I know my way around AR Tools modding some other stuff.

Where would I need to start if I wanted to learn it?

ocean kernel
#

In the bohemia wiki there are plenty of pages but I dont think there is a fully features intro. But once you cross the barrier of entry and make your first component it will get easier over time.

proven moth
#

By the way this is 'C' programming language right?

ocean kernel
#

It's called Enforce Script

#

They made their own lil language

#

It looks loosely like c#

#

To me anyway, having experienced c# doing unity stuff

proven moth
#

Also what would be managable entry level mod to try making as a noob? 😄

ocean kernel
#

There are some differences between dayz and reforger. I would say step 1 is figure out how to create a scriptcomponent and attach it to and entity and have it do something. Anything. That should tell you more or less how the game engine works with scripts. Then I would suggest trying to mod an existing class or component and make it do something differently, which would teach you how you can influence things that are already there.

#

Maybe could flip those two things around in order since modding existing class is actually easier.

#

You can do a weapon modding tutorial just as an exercise to go over how the prefabs work

#

More practical

#

It's important to know your way around the editor, no need to bother doing retexturing or models to figure this out

proven moth
#

Will check it out. I actually already played quite a lot with prefabs when I was creating Drone Jamming Antenna for Salamis Realistic Combat Drones mod, but I was winging it the whole time. I don't know how i didn't come across these resources before, will definetly need to go more in depth . Thank you so much for all the information and help. Absolute legend!

grave dock
high hawk
grave dock
static vale
grave dock
#

Based on what I've seen of AI, if you're capable of asking it questions properly, it can absolutely write some code to get you a starting point to test with if you're coming in blind.

I've used it on several occassions for VBA as I haven't any knowledge of how to use it

static vale
grave dock
#

I'm going to attempt using it as a first pass for what I'm doing and see how far I get for now.
What I'd be curious to see is whether someone who really understands Enfusion and C is able to look at the code and see if they understand what it's trying to do.

ocean kernel
#

can we get a shorthand form of .Cast because im going nuts

#

Type declaration is fine with me I just hate the ClassName.Cast everywhere

solid hearth
#

You don't like doing SomeReallyLongClassName.Cast(entity.FindComponent(SomeReallyLongClassName)) cute_smile_cat_meme

#

wait, can't you already do that like (SomeClassName)myinstance

#

or am I dumb

grave dock
#

I only know SQL and python so I can't relate to any of this since I'm not coming from a development background

sleek moat
#

if i'm setting a bool on everyones player controller via gamemode component when the auditsuccess is called, do I also need to rpc setting that bool so the player themselves actually know about it?

solid hearth
#

Pretty sure that's server only so yes

timid citrus
#

Where is the enum for common item types? had it yesterday but can't find it now lol

ocean kernel
#

it needs to be smart enough to auto cast to the defined type

static vale
#

In fact include it in the find component as well

ocean kernel
#

There's a limit on the number of diags?

desert escarp
red cedar
#

i've noticed that in my game mode the killfeed is only shown to kill in which the player is involved or are in proximity off, does anyone know what might be causing that and how to fix it ?

Found it, go in the game mode component -> SCR_NotificationSenderComponent

frosty coral
#

Is it possible to somehow check if Hierarchy component exists in the entity at runtime? There is no "Hierarchy" typename .

south forum
#

Can i override defvalues of attributes in a subtype?

frosty coral
torn bane
solid hearth
#

Si template very handy.

torn bane
#

I hope one day we can get method templates, that would make a lot of things easier and allow for the convenience you ask, but for this all planets need to align correctly

minor agate
frosty coral
minor agate
minor agate
#

So you do not have parent still i guess.

frosty coral
minor agate
frosty coral
#

World Editor

minor agate
#

Ok

#

That is odd

#

Hierarchy comp and checking if it exists is useless

#

As all it does is call Addchild on the ent on init

frosty coral
#

So i have these barrels, they both initially had Hierarchy component enabled. They are part of a composition. I put GetRootParent() into CanBeShownScript, so if hierarchy enabled it doesn't show the action.

minor agate
#

Do you have some editable entity related component on them?

#

If so, remove it

frosty coral
#

Oh, hold on a sec

#

My bad, GetParent() works... Gosh

minor agate
#

Let me guess

frosty coral
#

Didn't reload scripts

minor agate
#

You were modifying on entity level and not prefab

#

Similarly common mistake

#

Still

#

😅

frosty coral
solid hearth
frosty coral
#

Sometimes asking a question here automatically fixes stuff at exact moment you gen an answer. Bang your head against the wall for couple hours/days, then FINE, I'LL ASK, and as soon as you ask it instantly magically fixes itself. But it only applies to the answered questions. Unanswered ones never fix themselves.

minor agate
minor agate
# frosty coral Sometimes asking a question here automatically fixes stuff at exact moment you g...

In software engineering, rubber duck debugging (or rubberducking) is a method of debugging code by articulating a problem in spoken or written natural language. The name is a reference to a story in the book The Pragmatic Programmer in which a programmer would carry around a rubber duck and debug their code by forcing themselves to explain it, l...

frosty coral
minor agate
#

And for the cases where it does actuslly fix itself
https://en.m.wikipedia.org/wiki/Heisenbug

In computer programming jargon, a heisenbug is a software bug that seems to disappear or alter its behavior when one attempts to study it. The term is a pun on the name of Werner Heisenberg, the physicist who first asserted the observer effect of quantum mechanics, which states that the act of observing a system inevitably alters its state. In e...

solid hearth
minor agate
torn bane
#
class Refinator9000
{
  template<Class T> DoStuff(T variable);
}
``` please 🙂 We can make one template class per method otherwise which is just omega ass backwards 🙂
solid hearth
#

Don't tease with stuff like that sadBork

#

korean mmo devs do enough with breaking my heart, can't handle any more.

minor agate
static vale
grave dock
#

Does anyone know how I can get the array for the filenames listed on SoundComponents in prefabs for the radios?

frosty coral
tepid heart
#

Hi for all ^_^

How can I change this default value for this attrubute?
m_iXpRewardTreshold

I tried like this, but can't select modded SCR_CampaignBuildingManagerComponent

grave dock
tepid heart
high hawk
grave dock
# high hawk Well why can you not make your own? I played around with this a long time ago an...

In your case, were you just using a single radio broadcast manager, with a single broadcast.acp and then configuring the radio to let you press a button to change songs I take it?

What I'm trying to do is let an additional button on the radio cycle through separate broadcast files entirely.

Unfortunately, my ability to script isn't great as I don't know any C, and I'm getting very confused looking at stuff trying to figure out why things aren't working as I'd expect.

I'm at the point now where I have the action correctly triggering what I want on the radio, but it isn't actually playing any sound from the next broadcast file in the sequence when cycled

sleek moat
#

seeing in workbench that spawning an entity with SpawnEntityPrefabLocal is spawning 2 prefabs, with one being at a weird angle.. any idea what might cause this? it's only being called once through a local action on PerformAction

minor agate
#

(Its being worked on, but as of now they are not moddable)

#

Its why you see a static method returning the default variable for something in some attributes

#

So that modders can do what you wanted. But this class does not havw that

#

What you can do isntead which is not complete by any means but will work to some extent is to override the OnPostainit method, detect if the variable is on default value then use yours by setting the variable there. Or just force yours no matter what.

ocean kernel
#

Inheriting my own sealed classes wouldve been dope

minor agate
#

You could seal it right after doing your inheritance i guess

west prism
#

anybody know how i do this BLue box lines deleted?

i use Shop System

#

after i buy a car its persistence on the map to see

rapid ferry
minor agate
#

So do not expect that behavior to be added.

#

sealed is to block inheritance. So being able to inherit does not make much sense

ocean kernel
#

Is there going to be a better alternative to protect classes from unwanted modification?

minor agate
#

Sealed is all you get. Which is basically a final class

#

Replacing a file is also not going to go away

feral falcon
#

Is there a way to calculate an entity size without spawning it into the world? I see IEntity has a function for getting size, curious if there's other ways

I have a dynamic spawn system, and would like to categorize based on size. Doing it by type isn't good enough.

feral falcon
#

Bounding box

minor agate
feral falcon
#

Figuring out size so I can determine if the vehicle will fit in a spawn point without colliding things

feral falcon
#

Darn. Right now the workaround has been to spawn those vehicles in the background somewhere, get size, then despawn - caching the result.

Trying to categorize things so I can safely spawn things. For instance, a small garage/storage building can fit a jeep.... but spawning a BTR in there is uh... not recommended. lol. Hilariously it will destroy the building amongst other things

minor agate
#

I would say to do it on some init process, do it once and cache the values.

feral falcon
#

Hold up there are multiple worlds? IS the preview world the one that's used when you see the.... ghosts of compositions?

minor agate
#

And yes, there are multiple worlds

feral falcon
#

oooooohhhh Interesting. Didn't realize there were multiple worlds active at once

minor agate
#

Which is why it is wrong to usually do GetGame().GetWord()

#

And also why I keep saying that Systems are NOT singletons

feral falcon
#

lol... I feel called out now 🤣 . Noted.... gotta stop doing that

minor agate
#

There can be the same system 4 times if you have 4 worlds at one

#

And caching them in a static variable will clash them

#

etc etc

minor agate
#

For example, if you will register an entity to a system. Then do not use GetGame().GetWorld()

#

use entity.GetWorld().FindSystem(...)

#

etc

feral falcon
#

omg that could be why I couldn't find the darn system. I was just learning about BaseSystems today. Found it werid it'd work in workbench but when in playmode the system didn't exist.

minor agate
#

Game world that is

#

And systems run on worlds

feral falcon
#

Mind blown. I had put the system into an override version of the game systems file. Had it loaded/active in the project. Will have to fiddle with it some more.

don't look at my code. you'll prob cringe

minor agate
#

And each world, has it's own configuration for systems

#

It might be set for one, but not for another

minor agate
#

The vanilla codebase does not place a good example on this either

#

If it works it works. But if you want to do things properly then now you know how

minor agate
#

The only bad practice you will not find on what I did though is bad ref usage PES_EvilRondo

feral falcon
#

I'm shocked my spaghetti code at this point runs 🤣

Looking for examples is admittedly not easy. I did find a WorldDocs file somewhere, I'm not sure how I found it but it was basically an entire file of documentation but that didn't explain it as well either. I learned stuff but didn't feel equipped to implement it myself

minor agate
feral falcon
#

Now that... that'll be fantastic lol. Teach us the ways

minor agate
feral falcon
#

Excited. Will certainly help bridge the gap between knowledge only the devs have vs the community.

#

Then the age-old problem.... keeping it up-to-date 🤣

minor agate
#

Something more manageable, with releases, versioning and nicier distribution.

#

Some system that is the same for us, than for the modders would be best.

#

Otherwise the conversion work takes qutie a lot

feral falcon
#

It's nice when you can generate static sites from the codebase documentation. Have it be filterable and what not.

torpid mist
#

Does anyone know where to go to make a Loading screen?

#

or how?

tough cave
#

template mod for loading screen on workshop

craggy jolt
#

Which world ChimeraSystemsConfig.conf systems are created in? All worlds (preview, custom, etc.) or only "main" game world?

pliant ingot
#

Not sure about custom

craggy jolt
#

Logically it should only be main world, but I still wonder

pliant ingot
craggy jolt
torn bane
craggy jolt
#

Huh, interesting

craggy jolt
#

What's the best place for DiagMenu.RegisterMenu menu definitions? I need to debug behaviour of my custom components and system that works these components. Can't have that in system as they don't exist in preview mode. There is no static constructor/init that's called once to register the menu.

#

I guess using gamemode manager component would fit but I'd like to debug my components without gamemode and manager component present

craggy jolt
pliant ingot
#

2 month ago, it was not

craggy jolt
#

-wrong-

vast flower
#

is there any way to get if entity is local for current client that executes the code?

pliant ingot
vast flower
craggy jolt
pliant ingot
#

In enfusion there are authority, owner proxy and remote proxy

vast flower
# pliant ingot What you mean by "local"?

well, I need to execute code in EOnInit only for, I guess, owner of the entity (in this case - player character entity), to initialize a bunch of local HUD displays and event handlers only for this player without doing it on other machines
previously I used player controller component, but I noticed that it's components are upper in initialization order and I can't reliably grab player character there as it may be not spawned yet
I guess I just need to check if code execute environment is owner of the entity

pliant ingot
craggy jolt
pliant ingot
#

Mb static member of class itself will be better

vernal moat
#

you can
thats where i do it, just use gamestart instead of constructor

modded class ArmaReforgerScripted
{
    override bool OnGameStart()
    {
        super.OnGameStart();

        #ifdef WORKBENCH
            KOTH_DebugMenu.Init();
        #endif
    }
    
    override void OnUpdate(BaseWorld world, float timeslice)
    {
        super.OnUpdate(world, timeslice);
        
        #ifdef WORKBENCH
            KOTH_DebugMenu.UpdateMenus();
        #endif
    }
}```
compact wigeon
#

hello all i have little trouble i modded for dayz and i have this error come to me :

Binarize started
Note: 'BuildingSuper' is declared, but definition was not found. Creating empty class

Someone knowing the trouble?

pliant ingot
vernal moat
quiet drift
#

Hello! It's been 4 days I'm trying to identify why my newly created scripted aim modifier is perfectly working in single player environment but in MP the new position of the weapon is not replicated for other players, I think that's because I didn't make replication, this is an aim modifier attached to the MuzzleComponent, using a bool variable to allow calculation the new aim, I get this bool from a public getter in a modded class of playercontroller, with a keybind that control it. Should I do a replication of this bool variable ? Does this would work like in the replication bootcamp ?

  • This is resolved
minor agate
#

I usuggest you do not call world editor edit mode preview

ocean kernel
#

Is there a separate SCR_PlacingEditorComponent for each game master?

#

heck

west prism
#

when open it in Enfusion tools it works fine, when i host on server i can only store Cars but cant get them UI stop to work...

craggy jolt
valid anchor
#

I'm trying to toggle capture zones mid game via set conditions or timers

#

unless there's an easier way to enable/disable the whole zone rather than play with active triggers?

static vale
#

How do i set the proper angle of a world.CreateDecal? When i just use the characters rotation, it doesn't work right. The actual decal is all over the place and does seem to have any relation to 0-360 degrees

        Decal decal = world.CreateDecal(
            trace.TraceEnt, // Entity 
            spawnPosition, // origin vector (position) 
            -trace.TraceNorm, // project vector 
            0.0, // nearclip
            3, // farclip
            character.GetAngles()[1], // angle 
            0.35, // size 
            1, // stretch 
            mat, //emat path
            -1,// lifetime, if <= 0 the decal is created as static
            color); //color of decal
devout shale
#

Can I hide Attributes in a subtype?

vernal moat
tepid heart
# minor agate What you can do isntead which is not complete by any means but will work to some...

Thx for answer ❤️

Like this?

modded class SCR_CampaignBuildingManagerComponent
{
    // [Attribute("5", UIWidgets.EditBox, "How many times player has to perform build step to gain a XP reward", "")]
    // protected int m_iXpRewardTreshold;

    //------------------------------------------------------------------------------------------------
    override void OnPostInit(IEntity owner)
    {
        //if (SCR_Global.IsEditMode())
            //return;

        // SetEventMask(owner, EntityEvent.INIT);
        
        super.OnPostInit(owner);
        
        Print("SCR_CampaignBuildingManagerComponent::OnPostInit::m_iXpRewardTreshold = " + m_iXpRewardTreshold);
        
        
    }

}
shadow hull
#

howdy y'all! Anyone here familiar with the Conflict gamecode? I'm trying to find someone to help me add a little something to it and I know from asking around it's definitely on the more challenging side

#

i'm trying to a group prefab field to SCR_GroupPreset, then parse out the character prefabs and assign them to the group member slots, and of course then spawn the player with that character prefab

#

it would live here (first shot), below, say, Group Size. And then the UI (secomd shot) would need to be tweaked by adding the character prefab name to the slot you're joining so you know what you'll spawn as.

#

on the plus side, if this is over everyone's head at least i won't feel bad for not figuring it out myself (c isn't something i'm comfortable with) 😆

spark otter
shadow hull
shadow hull
#

Thinking about what i'm doing above.... instead of pulling a prefab group it could just be a list and you select the character prefabs right below where you setup the group. Don't need to parse a group prefab at that point.

spark otter
craggy jolt
#

I guess it might not work if you need to init something that relies on world entities and such, but declaring diag menu could be OK it seems

valid anchor
craggy jolt
#

Sorry, I'm not the one to ask, still learning

hallow portal
#

Looking to start a project in the coming week,
Anyone able to highlight vanilla script files relating to the scoreboard and ingame name tags.

Looking to add a little rank image & number at the start of players names (Like insurgency sandstorm)

analog python
proven moth
#

Hello scripting magicians😁

Is it possible to limit one building so it can only be built on main base, with scripts?
I was looking if there is a way to change it through configs and didnt find anything. Any help is greatly appreciated.

I have drone station and would want to limit drone spam in this way.

red cedar
sleek moat
#

Is implementing a "server key" script to a mod allowed? So only specific servers can use it?

#

Guess like whitelisting people but for servers

high hawk
#

You could make a layout popup every x I guess (PTSD from A3 flying helicopters without dlc notlikemeow )

ocean kernel
#

Annoying popup would still be not allowed, once is fine, interfering with gameplay is not

high hawk
#

what if its a different cat meme everytime?

ocean kernel
#

if I have an array with 5000 elements should I sort it myself in N items per frame? or just call Sort()?

dire sinew
#

Or you use a sorted array object to begin with.

ocean kernel
#

Nah I use a map but I want to sort it for the purpose of displaying and paginating UI

#

When are we getting the ability to put methods inside maps? and pass them as parameters?

#

having a map with 10 methods to call based on some enum is better than 10 if statements

ocean kernel
#

How much slower is this than calling the actual method directly?

ocean kernel
#

Looks like it's 2.2x slower than direct, scriptinvoker with 1 method is 2.1x slower

minor agate
#

See this example vs their bytecode.

void SomeMethod(int fisrtValue, float secondValue)
{
    Print(fisrtValue);
    Print(secondValue);
}

void RunSomeMethodNormally()
{
    const int fisrtValue = 1024;
    const float secondValue = 0.1;
    SomeMethod(fisrtValue, secondValue);
}

void RunSomeMethodDynamically()
{
    const int fisrtValue = 1024;
    const float secondValue = 0.1;
    GetGame().GetScriptModule().Call(null, "SomeMethod", false, __void, fisrtValue, secondValue);
}

Bytecode

SomeMethod()
000252:0x00520558:    icall    Print(fisrtValue, _i8):__void
000253:0x00520568:    icall    Print(secondValue, _i8):__void
000253:0x00520578:    rts

RunSomeMethodNormally()
000260:0x005205d0:    call    SomeMethod(fisrtValue, secondValue)
000260:0x005205e0:    rts

RunSomeMethodDynamically()
000267:0x00520660:    call    GetGame()
000267:0x00520668:    icall    GetScriptModule(#return):#return
000267:0x00520678:    icall    ScriptModule.Call(null, _s'SomeMethod', false, __void, fisrtValue, secondValue, _c00000000, _c00000000, _c00000000, _c00000000, _c00000000, _c00000000, _c00000000):#return
000267:0x005206b8:    release    #return
000267:0x005206c0:    rts
ocean kernel
#

How much slower would MyMap.Get("something")() be? than direct

#

You know, if this was a thing

minor agate
#

also

#

Importance of const

ocean kernel
#

I assume faster than GetGame().GetScriptModule().Call

ocean kernel
#

And faster than a chain of 10 ifs

minor agate
#

See this example without const vs their bytecode.

void SomeMethod(int fisrtValue, float secondValue)
{
    Print(fisrtValue);
    Print(secondValue);
}

void RunSomeMethodNormally()
{
    int fisrtValue = 1024;
    float secondValue = 0.1;
    SomeMethod(fisrtValue, secondValue);
}

void RunSomeMethodDynamically()
{
    int fisrtValue = 1024;
    float secondValue = 0.1;
    GetGame().GetScriptModule().Call(null, "SomeMethod", false, __void, fisrtValue, secondValue);
}

Bytecode

SomeMethod()
000252:0x00520548:    icall    Print(fisrtValue, _i8):__void
000253:0x00520558:    icall    Print(secondValue, _i8):__void
000253:0x00520568:    rts

RunSomeMethodNormally()
000258:0x00520610:    imove    fisrtValue, 0x000400
000259:0x00520620:    imove    secondValue, 0.10000
000260:0x00520630:    call    SomeMethod(fisrtValue, secondValue)
000260:0x00520640:    rts

RunSomeMethodDynamically()
000265:0x005206c0:    imove    fisrtValue, 0x000400
000266:0x005206d0:    imove    secondValue, 0.10000
000267:0x005206e0:    call    GetGame()
000267:0x005206e8:    icall    GetScriptModule(#return):#return
000267:0x005206f8:    icall    ScriptModule.Call(null, _s'SomeMethod', false, __void, fisrtValue, secondValue, _c00000000, _c00000000, _c00000000, _c00000000, _c00000000, _c00000000, _c00000000):#return
000267:0x00520738:    release    #return
000267:0x00520740:    rts
ocean kernel
#

its cool if I dont need to modify it

fervent cedar
timid citrus
#

Do we have access to create gizmos at all in the editor?

minor agate
fervent cedar
#

Yes sir, pleas sir blobcloseenjoy

#

Imagine how much clearer and easier it is to understand how thigns work

quiet drift
#

Hi, how can I configure the distance of stream in / stream out in for the dedicated server tool ?

#

I'm testing the replication of an animation variable for the weapon

ocean kernel
#

how do I make a class with template that I can pass to other classes as parameters? whats the syntax for this

frosty coral
quiet drift
frosty coral
quiet drift
frosty coral
#

but in workshop he runs it from workbench, so that would be peer tool

quiet drift
#

Oh ok

frosty coral
#

So workbench exe is server, and nwkResolution 10 works. But on proper dedic it never worked for me.

frosty coral
gloomy lynx
#

whats the actual script wizard website?

ocean kernel
#

how do I get the number of callbacks inside scriptinvoker?

ocean kernel
#

lol I have a phantom scriptinvoker

#

it keeps calling itself every frame after I stop calling it

#

idk

#

freezes wb

#

I have no clue what calls it

#

All the print calls in places where I actually call it stop printing but the invoker still runs

#

Nvm not actually invoker, the method that calls the invoker keeps running

#

However the method I use to call the looping method stops printing

#

Ok found it whew

frosty coral
#

Wher do i look for detecting projectile collisions/hits with rigidbody?

desert escarp
#

EOnContact

frosty coral
#

That is for rigidbody against rigidbody, i need projectile hits

#

or will it catch that?

desert escarp
#

Ah you're right that doesn't detect projectiles

frosty coral
#

Only projectile related thing is BaseTriggerComponent, it has EOnContact, but i'm not sure if it's what i'm after

desert escarp
#

Look in SCR_DamageManageComponent

#

Think there's an OnDamage ScriptInvoker

frosty coral
#

but what if rigidbody being hit doesn't have damage setup

fervent cedar
#

ProjectileEffect, because it is what causes the hit effect

#

HitSoundEffect is there

frosty coral
#

Ok, i'll take a look

fervent cedar
#
override event void OnEffect (IEntity pHitEntity, inout vector outMat[3], IEntity damageSource, notnull Instigator instigator, string colliderName, float speed) {

frosty coral
#

looks promising

#

yes, looks like this is what i need, thank you

timid citrus
#

Where did chimera come from anyway was it like a codename for the game or something?

timid citrus
#

Cool thanks. Been curious about it for awhile.

fringe prairie
#

Been looking into cameras, I sense a great despair with this API

#

Like script camera constructor taking a config and a parent (parent is unused)

ocean kernel
#

It's there for emotional support

analog python
#

all the code for this is inside the WCS_SpawnProtection mod along with other stuff like blocking mortars from being fired from main base etc

#

and we just hook into conflict and check if the player is inside a HQ

red cedar
analog python
#

go ahead

red cedar
#

Nice, thanks a lot !

ocean kernel
#

Man I hate that you had to go to such lengths to do this

red cedar
#

I'm facing an issue with the radios :
Because of the way my game mode works I have to spawn in the radio whenever the player select a new class.

The issue is that on the workbench i'm properly using a default channel tho on dedicated the radio seems to not be set properly.

Is there a way to force a default channel ?

inland bronze
#
 WORLD        : NotifyEntitiesInitialized
  SCRIPT       : GetResourceName 'Scripts/Game/CentralEconomy/GameMode/CE_WorldValidationComponent.c,38'
   RESOURCES (E): Wrong GUID/name for resource @"{0000000000000000}$profile:/CentralEconomy/CE_ItemData.conf" in property "m_sDb"

since I'm loading a config from the server's profile folder, is there a way to get rid of this error..?

Doesn't break anything and config loads fine, just annoying to see lol

#

this is what it corresponds to:

protected const string                                     DB_DIR                     = "$profile:/CentralEconomy";        // directory name in the server profile folder
protected const string                                     DB_NAME_CONF             = "CE_ItemData.conf";                // config file name in the server profile folder
string m_sDb = string.Format("%1/%2", DB_DIR, DB_NAME_CONF);
Resource holder = BaseContainerTools.LoadContainer(m_sDb);
fringe prairie
#

This error shows up on clients, or server?

inland bronze
#

yes, can confirm now, just once in server logs

fringe prairie
#

Hm, interesting it tells you that error and loads correctly

inland bronze
#

also getting this warning spammed when opening inventory through a useraction, anyone encountered such? Useraction works fine otherwise

14:56:30.382 SCRIPT    (W): [AnimateWidget.PrepareAnimation] AnimateWidget entity instance is missing ImageWidget<0x000001E044E3F2F8> { Name: 'Saline_icon' }.Saline_icon
14:56:30.382 SCRIPT    (W): [AnimateWidget.PrepareAnimation] AnimateWidget entity instance is missing ImageWidget<0x000001E044E3F500> { Name: 'Morphine_icon' }.Morphine_icon

Code:

override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
{    
    SCR_InventoryStorageManagerComponent userStorageManager = SCR_InventoryStorageManagerComponent.Cast(pUserEntity.FindComponent(SCR_InventoryStorageManagerComponent));
    if (!userStorageManager)
        return;
    
    userStorageManager.SetStorageToOpen(pOwnerEntity);
    userStorageManager.OpenInventory();
    
    if (m_StorageItemAttributes)
        m_StorageItemAttributes.CE_SetVisible(false);
}
#

Seems like it may be a vanilla issue, but doesn't spam when opening inventory regularly in-game

inland bronze
#

Solved: UserAction wasn't inheriting from SCR_InventoryAction and wasn't performing the storage opening within PerformActionInternal()

grave dock
#

Quick question: is it possible to have a script that disables the first sub component of a particular type on an entity, then perform some base user action, then enable the next sub component of the same name, then perform the same user action and so on?

slow acorn
#

How does one force a player to face a certain direction live? SetYawPitchRoll does not seem to be doing the trick alone. Offering 1 cookie for example 🍪

narrow aspen
#

I add a warzone checking in reconfigure relay action CanBePerformedScript. It works fine in workbench but not work in dedicated server.

craggy jolt
#

Are there any tricks to quickly indent group of lines in Script Editor? Getting tired of copying blocks into another text editor to do that.

craggy jolt
#

This explains why tab doesn't replace selected text with tabulation, was going to complain about that lol

#

Shift+Tab also removes indent, nice

#

Damn, I feel like I tried all combinations and was sure this wasn't working

#

Thanks

frosty coral
#

shift+tab for reverse, but only if you select multiple lines

high hawk
#

I also was mind blown for commenting out multiple lines with \ on numpad

craggy jolt
#

Also how do you uncomment it back?

high hawk
#

There is a shortcuts menu somewhere on the titlebar, I'd have to have a look at where exactly to say for sure

craggy jolt
#

Thanks

#

This one is listed in Edit menu, wonder what else is out there

high hawk
#

There are some there that work sometimes but not all the time cough auto complete cough

craggy jolt
#

Having some unicode symbols in the script makes auto indentation on line break stop working

#

Copied some logs and put them into comment in my script, turns out it also compied some invisible unicode characters and it broke auto indentation

#

So if that breaks means you have some invisible unicode crap above somewhere

#

Ticket submitted

inland bronze
#

I'm trying to set a variable within an entity's component through script, and it works fine until the entity is the child of another entity. It finds the component fine, but the variable won't set.
In this instance, my GenericEntity with the component containing the variable is the child of a SCR_DestructibleBuildingEntity. The GenericEntity has a RplComponent and a Hierarchy, I'm not too sure what I could be missing. Has anyone else encountered this?

static vale
torn bane
inland bronze
# torn bane What are you trying to set? Does it involve prefabs?

Trying to set a Enum-based variable in the component with an entity inherited from ScriptedTriggerAreaEntity. Basically, querying entities inside of the trigger area, if entity has the component, set variable in the component. Both the GenericEntity and the trigger area entity are a child of the building.

The GenericEntity with the component is a prefab, and so is the trigger area. And then the building is of course

#

Works perfectly fine when not a child of the building, like if I individually place the trigger area prefab on the ground and the generic entity prefab inside of that area (not as a child), it’ll set it perfectly fine, no issues from what I see

#

I had just hopped off my PC for the night, so can’t paste code directly, but it’s in my GitHub backups. Referencing the CE_UsageTriggerAreaEntity and the CE_ItemSpawningComponent.

Its a little bit of a mess atm because going through a rewrite and was debugging trying to solve this issue

https://github.com/CashewSan/Central-Economy/blob/daily-backups/source/Scripts/GameCode/CentralEconomy/Entities/CE_UsageTriggerAreaEntity.c

GitHub

Central Economy, created for Bohemia Interactive's game "Arma Reforger", allows for dynamic spawning of items around the map with a master config file - CashewSan/Central-Economy

half patio
#

kind of a weird question but is there a way to have a UI Dialog appear when users join the game.

my mod will require a step by step on how said mod works and that they understand everything etc.

it'll only appear once per session

torn bane
valid anchor
half patio
#

I’m not hosting a server, this is for when my mod is published, dw I found the answer I needed :))

ocean kernel
#

I like using SCR_ConfigurableDialogUi for those, but the downside is you cannot really open one on top of another without the bottom one disappearing

narrow aspen
narrow aspen
ocean kernel
#

rplprop on gamemode will be sync

craggy jolt
narrow aspen
# ocean kernel rplprop on gamemode will be sync

Thank you bacon. I think it works fine in seizing/task generation component, because I can disable those bases outside the warzone (compare the value). similar to your linear mod. But it is not working in reconfigure raley action when I run the mod in dedicated server (local workbanch is fine)

ocean kernel
#

Make sure the value itself is only changed on the server, and make sure to call Replication.BumpMe when it changes

#

Just print the value on clients to see if it changed, you can define onRplName function

#

If the value changes but you still dont get expected result then your problem would be somewhere else

#

So at least points you in the right direction

#

Also figure out peertool so you dont have to mess with dedicated

craggy jolt
#

Instead of

    //------------------------------------------------------------------------------------------------
    static SomeSystem GetSomeSystem() {
        World world = GetGame().GetWorld();
        if (!world)
            return null;

        return SomeSystem.Cast(world.FindSystem(SomeSystem));        
    }

Do this

    protected static SomeSystem s_GameWorldInstance;

    //------------------------------------------------------------------------------------------------
    static SomeSystem GetSomeSystem() {
        return s_GameWorldInstance;
    }
    
    //------------------------------------------------------------------------------------------------
    void SomeSystem()
    {
        if(GetWorld() == GetGame().GetWorld()) s_GameWorldInstance = this;
    }
#

So its a singleton for system instance that matters

ocean kernel
#

By the way did you know you can use g_Game instead of GetGame() lol

narrow aspen
ocean kernel
#

Global variable pepedumb

half patio
craggy jolt
#

g_ARGame even

ocean kernel
craggy jolt
#

I'm running a Print on system contruction and it doesn't seem to show twice for you say open an inventory (which should create preview world for items and create all systems again for it?)

minor agate
half patio
minor agate
#

Just get your world from the entity your are working on

#

Or component

#

And do FindSystem on it

ocean kernel
minor agate
#

FindSystem is fast anyway

craggy jolt
minor agate
#

There can be the same system in multiple worlds

half patio
ocean kernel
#

If my system runs in more worlds than just the main one then that's a bug you need to sort out

craggy jolt
#

I mean that specific system implementation, not systems in general

craggy jolt
#

If you design it to be singleton, store singleton instance of the game world's system

minor agate
#

it's intentional

ocean kernel
minor agate
#

You could have an inv system, both present on purpose on the main world vs preview world

#

But they are separate, their own

#

Same class, different instances

#

Hence why the static variable is cause of issues

ocean kernel
# minor agate It's not a bug

It seems you guys seem to believe that more low level and super nuanced = better. It's not. Modders want convenience and things to work. You should not develop modding systems in a way where we have to remember 51 different quirks as if modding was a doug demuro video.

minor agate
#

You can not use it if you want

#

We develop the game partly in scripts

#

IF you want we can make everything CPP and give you nothing

ocean kernel
#

Find me a modding use case where a modder wants their system to be in preview worlds

minor agate
#

Or give you more limited scripts

minor agate