#enfusion_scripting

1 messages · Page 17 of 1

coarse bane
#

dont think so

pearl sun
#

Guys, I need help, do you know how to make increased bleeding when hit, for example, so that the blood flows faster than usual or deducts the blood from the blood by 30%
?

red cedar
random oracle
#

This is going to be an extra dumb question, but when I turn on logging in the diag menu (as an example "Log inventory changes") where does that log go?

pearl sun
random oracle
red cedar
red cedar
random oracle
random oracle
red cedar
pearl sun
pearl sun
# random oracle

I tried to put it on display because of this, but it turned out that it doesn't work that way.

random oracle
#

I haven't ever done a dive into damage systems yet, but there is the dayz reforged mod that handles bleeding pretty well if you want to get some ideas

#

They have a little hud icon that shows how much blood you lost and what not

pine badge
#

Hello, I'm trying to write a script that spawns AI patrols following a set of waypoints for mission making convenience. I've got it fully functional so the AI spawn and follow the route, but I can't find the information on how to correctly apply settings to these waypoints for a column formation and walk speed. Can anyone help me out? Thanks.

#

The waypoints are also dynamically generated.

candid skiff
#

A funny question: has anyone even tried to change the radio station range? I've even written custom scripts and configs, but the engine just doesn't care – it just uses its 2000 meter range no matter what. The script's description, "Don't change anything, it's automatically generated," is especially amusing. LOL – so why are the parameters editable if they don't affect anything?

candid skiff
#

Please correct me, I might be missing something, as I'm not a programmer. I have a prefab composition for a radio antenna for conflict mode, as an example. My problem is that I want to change the radius of connections between points, thereby affecting their capture order. This can be done through the base radio component, but I think it's more optional to do it through the radio component of the radio station.

The crux of the problem is that no matter how I copy the prefab, I create an e_ prefab from it (which, in theory, won't help at all). The main problem is that I can't isolate the prefab/composition from the logic of base classes such as the base radio component and base transceiver.

Any of my prefabs will still reference these classes. In this case, the screenshot shows the e_ prefab I created using the plugin from a copied vanilla prefab.

The arrows show the inheritance of the mother components and classes. The trick is that I can enter the desired distance (1350) meters into each one, and it will even work until I restart the tool. However, after that, the default mother components will be rewritten by the engine/script to the standard 2000 meters.

Neither scripts nor any other settings help. The script's API is severely limited, and no matter what I do, everything resets to vanilla (even scripts with frame interception don't help).

Am I correct in assuming this is some kind of bug or oversight? Perhaps my use of the RHS Status mod somehow interferes with this issue? (But I doubt it; on empty maps without third-party mods, everything worked just fine with the vanilla rewrite.)

Perhaps I should contact support about this, or is everyone generally aware that this module doesn't allow changing these settings due to a limited API? Perhaps this functionality will be available in the future?

Currently, there's simply no way to influence connections between points (only within 2 km).

#

To summarize, am I correct in understanding that until there's an API that provides access to changing the radius functionality in the radio component or receiver component, essentially all changes are meaningless, since any of my settings will be overwritten by the parent one?

random oracle
#

Have you made a new component that references the base component?

#

for example class NewRadioComponentClass : BaseRadioComponenetClass

pliant ingot
candid skiff
#

Btw all issues will be non-result if im right about the basic script re-writte any inh-class cuz duplicate and other typological path is take a inh frome base and try to change they selfs, but if base is core - nothing help

ionic pewter
candid skiff
#

The list of entity in screen - is UI seens of inh-classes, do it like i try in screept path - that just do mirrored inh-classes (with any changes) & will be non result

candid skiff
#

If yes - just drag&drop entity to wanted parent entity

#

If u want to do a pattern-prefab - need to do local and better check video in youtube about pref creation - will see a basick algo

ionic pewter
candid skiff
candid skiff
candid skiff
ionic pewter
candid skiff
river imp
desert escarp
#

Is there any way to allocate static arrays from dynamic arrays?
Like

array<vector> m_aPoints = {etc..};
vector points[] = m_aPoints;
desert escarp
#

CreateLines only takes a static array

#

Right now I just have one allocated to 500, it's not that big of a deal just would be cleaner if there was a way to scale static arrays in a method when they are created

desert escarp
#

¯_(ツ)_/¯

#

It's not too big of a deal

#

Even with 1000 bullets the memory allocation for that is like ~6mbs or so if I did my math right

shrewd nova
#

So is base game persistence going to break epf/edf?

river imp
amber knot
#

is there a persistent setting like arma 3 server ? i keep having problem with GM mode that i build bunch of scenery, left server and everything lost.
oh and the save and load function crash every time

restive island
restive island
river imp
scarlet iris
ocean kernel
#
  1. OnPlayerConnected
  2. OnPlayerAuditSuccess
  3. OnPlayerRegistered

Is this correct order of those methods?

shrewd nova
scarlet iris
#

Can anyone DM me? I need help setting up a mod with replication. I’ve gone through the bootcamp video and the documentation, but I’m still confused.

ocean kernel
#

Turns out

scarlet iris
#

How do I replicate sounds and hint messages to players in a way that will work on dedicated server as well as offline single player?

river imp
#

What is error code 16 for RestCallback?

teal vapor
scarlet iris
fervent cedar
# teal vapor I know some bohemia folks said they wanted to set up a https://github.com/Bohemi...

BI needs to implement the diff tool into the workbench.
Especially considering arma 4 is probably gonna have 5-10 years of updates.
Every update even more and more modders will have this issue

The earlier BI start developing and adding diff to workbench, the more benefit it yields.
Show diff related to the project we have currently open, (as well as whole diff between previous version etc)
if I use SCR_ChimeraCharacter in my project.
I should be alerted to the diff related to this class every update that changes it.
If a class I'm modding or inheriting changes, show diff related too etc.

teal vapor
sleek dove
neon elbow
#

What is this? A comunnity driven script library?

sleek dove
#

No this is official bohemia account putting script folder to github, this helps to see exact changes since a changelog is not enough, you will be able to just go there and see which exact line was changed to, so it should help everyone

timid citrus
#

Looks like it. Cool.

west prism
#

Hi everyone,
I’m working on a modded server for Arma Reforger / Enfusion, and I’m encountering a bug: when a player clicks Exit Game while connected to the server, the screen freezes (nothing happens) and the client doesn’t fully exit.

I suspect it’s something in my scripts/mods blocking the shutdown flow. I’m looking for which function, script, or engine hook is responsible for handling the “exit game / disconnect” flow in Reforger mods, and how to properly “clean up” so the client can exit cleanly.

If anyone knows which EnforceScript API handles exit / client disconnect, or has seen similar “freeze on exit” mod issues, any pointers or sample code would be super helpful.

Thanks in advance!

torn bane
west prism
undone patrol
#

What API can I use in 1.6 instead of the blocked Physics API? For manual Projectile control

west prism
torn bane
west prism
#

now u can use it on modded server with epf system and other mods for exit game button

abstract crescent
#

Can i add component to entity runtime in game, or CreateComponent works with world editor only?

storm bobcat
#

Base topic:
#enfusion_configuration message

I discovered that when the HAB is spawned from the construction truck, the spawn object (E_SpawnPoint_US_Supplies) is not registered to the US. I checked all the spots for a faction value and they are all US.

So in order for the spawn point to be registered to the US, it needs to be set after it is spawned.... Can anyone explain why this breaks and what I can do about it?

errant wren
spark otter
#

Also will it be working this week? I'm actually debating opening workbench 1.4 and copying old save system for when server crashes happen and delete all progress in 1.6. it's very unmotivating and depressing currently trying to get through a conflict match. I think most of my community is opting to play stable instead because of this major issue.

torn bane
spark otter
#

Ok thanks for the update! I'll probably give it a go tomorrow night after work and see if I can get it working for the meantime.

analog python
#

why not just wait for the new system? Experimental builds are experimental for a reason if someone can’t handle that they’re probably better off sticking with stable shrug

potent vault
#

Hello, i am currently writing a script so players can load one of the predefined loadouts ingame, via using an Action on a crate. Is there an accessible method to set a players entire loadout, or do i have to modify each storage component?

torn bane
torn bane
undone patrol
#

Should we expect an update with documentation on the changed API and some new components this week?
Or is it more likely not?

undone patrol
river imp
undone patrol
# river imp Who needs documentation?

I was referring to the new components, how they work, and the new or alternative API mechanics.
I'm still not entirely clear on this, but I'm trying to understand it.
I have two mods that use the Physics API to control the projectile.
MarioE responded to me a couple of weeks ago, saying that access to this API will be restricted and it will be moved to a separate sim component.
In fact, I'm looking for this component.I can't find it in any way
🥲

spark otter
rocky ingot
#

quick one, is there any way at all to limit how many attack choppers in the skies

dire sinew
ocean kernel
#

If crashes and bad state are important then why was loadSessionSave a thing in the first place?

craggy locust
#

Would anyone be please willing to help me make a script? It would enable "sights skip switch" on sights component, when player inspects the weapon, there would be option to do that.

wet trench
#

Hello, I've been following the 6th bootcamp and I would like to script my own entity. So it needs to have a RplComponent to work in multiplayer. I've currently got the Create_an_Entity wiki page open and I'm following the format like:

[EntityEditorProps(category: "Tutorial/Entities", description: "Prints player's position regularly")]
class TAG_PrintPlayerPositionEntityClass : GenericEntityClass
{
}

class TAG_PrintPlayerPositionEntity : GenericEntity
{
}

And it appears in the create tab and it works. I can add a RplComponent once it's placed into the world and save it as a prefab.
But, do I need to add the RplComponent somehow in the original script file? Because I'm currently wanting to use the RplComponent like:

auto rplComponent = BaseRplComponent.Cast(GenericEntity.Cast(this).FindComponent(RplComponent));

But I can't get it to findthe component

ocean needle
# wet trench Hello, I've been following the 6th bootcamp and I would like to script my own en...

you need to use a spawned instance of your entity with FindComponent, you could set your event mask to allow init and fetch it there:

// inside TAG_PrintPlayerPositionEntity
protected RplComponent m_RplComp;

override void EOnInit(IEntity owner)
{
  m_RplComp = RplComponent.Cast(owner.FindComponent(RplComponent));
  if (!m_RplComp)
    Print("uh oh...");
}

void TAG_PrintPlayerPositionEntity(IEntitySource src, IEntity parent)
{
  SetEventMask(EntityEvent.INIT);
}
wet trench
#

hmm okay I'll do that thank you

ocean needle
#

would recommend messing with other stuff before getting into replication though

#

not easy on the noggin

wet trench
#

hmm yeah it seems like it can cause lots of problems

#

I do have a menu and manager entity which works in singleplayer, but I didn't wanna post it because it's alittle messy

#

I'll see how I go

ocean needle
#

if you explain what youre actually going for someone might be able to help you better
you could also potentially get away with simple stuff by just using RplProp() and Replication.BumpMe() but i would go read the replication page before doing even that

spark otter
#

Anyone happen to know where the players MSAR is stored, or how it's updated?

spark otter
#

I think I found it under SCR_PlayerSupplyAllocationComponent

random oracle
#

is the timeslice in the game variable or fixed?

ocean needle
#

if only there was some easy way to Print that

ocean kernel
#

Print makes the game slower so don't use it

wet trench
#

oh oops my message is too long

wet trench
#

wait sry for spamming the chat. I might start with sending a simple custom class back and fourth then adding all the parts I need

hoary steeple
#

Not sure if workbench or scripting but.. I can't figure out how to create a new version of the SCR_BaseGameMode entity. I'd like to extend it but I can't find a way to create/duplicate the prefab. I've got a script for it created extending the SCR_BaseGameMode class but I can't select it with "Change Class" on the existing game mode entity so... IDK.
Edit: I think I figured it out. I don't think SCR_BaseGameMode is an "entity" to override, but I found the GameMode_Base.et that I can use. So I was looking for the wrong thing.

midnight talon
hoary steeple
#

new class, unique name.

midnight talon
#

Does it show up in the create panel?

hoary steeple
#

No

#
class CNR_BaseGameMode : SCR_BaseGameMode {
    override void OnPlayerConnected(int playerId) {
        super.OnPlayerConnected(playerId);

        Faction faction = GetPlayerFaction(playerId);
        PrintFormat("Player %1 connected. Assigned faction: %2", playerId, faction.GetFactionKey());
    }

    override void OnPlayerSpawned(IEntity playerEntity, int playerId) {
        vector pos = playerEntity.GetOrigin();
        PrintFormat("Player %1 spawned at position: %2", playerId, pos.ToString());

        Faction faction = GetPlayerFaction(playerId);
        PrintFormat("Spawned entity faction: %1", faction.GetFactionKey());

        PrintFormat("Entity prefab: %1", playerEntity.GetPrefab().ToString());
    }

    override void OnGameStart() {
        super.OnGameStart();
        Print("✅ My modded GameMode is active!");
    }
}
midnight talon
#

It compiles fine?

hoary steeple
#

yes

midnight talon
#

Also have you tried restarting WB since creating it? Weird but sometimes fixes new classes and stuff not appearing

hoary steeple
#

Just tried again. Not there.

#

It's just a script i created in the resource browser. I haven't been able to get an entity to use the class.

midnight talon
# hoary steeple It's just a script i created in the resource browser. I haven't been able to get...

You created the file manually? I'm not 100% sure but IIRC for some kinds of scripts the path can be important, if it's not already in a path that mirrors where vanilla game mode scripts live that might prevent it being registered properly or something.

If you duplicate a vanilla game mode script, rename it and paste your code over the contents it should automatically be in the right place which should rule out anything like the above

wet trench
#

hmm you could try changing class CNR_BaseGameMode : SCR_BaseGameMode {} to

modded class SCR_BaseGameMode
{ ... // code in here
}

and I think the path is project-name/scripts/Game/Gamemode

#

sry if that doesn't work

open pier
hoary steeple
#

Yeah it can't find it. The script compiled fine, but once I duplicated the existing script and edited the one in Scripts/Game/GameMode it's throwing another error when I try to compile.
scripts/Game/GameMode/CNR_BaseGameMode.c(1): error: Missing Entity Class for 'CNR_BaseGameModeClass' for Entity 'CNR_BaseGameMode'

#

IDK What CNR_BaseGameModeClass is or where it came from. I don't see references to that.

open pier
#
class CNR_BaseGameModeClass : SCR_BaseGameModeClass {}

put that at the top of your gamemode class

hoary steeple
#

Dog..

#

👏

#

It worked, compiled, and I can update the entity's class.

#

Thank you!

open pier
hoary steeple
wet trench
#

oh cool good

thorny bronze
#

Hello! Friends, is it possible to set up a trigger so that the mission ends when the required amount of resources is brought to the task by supplies?

abstract charm
#

Hi there, how do I send a message in chat from server?

west prism
#

Hi everyone, I have a question. I saw in the script that an item has a component called InventoryItemComponent, and inside it there is a field Stackable. When I have an item in my inventory and it already has over 100 stacked items, is there a way to move the whole stack, or is there some option for transferring it? Or can this be added with scripts? Does anyone with experience in this matter know how to help?

hollow gazelle
#

hey guys ive searched the web but couldnt find an answer to this question: what are the recommended IDE and plugins for scripting enfusion/reforger stuff?

ocean kernel
#

None

#

Open script editor

#

Write code

desert escarp
#

Is there a way to get a prefabs item name without having to spawn it in?

sweet badger
#

Resource.Load(rn).GetResource().ToBaseContainer().Get("name", name); would work I think
you may have to get the components obv

fervent cedar
#

the built-in script editor is for exploring vanilla code and for Ctlr+f7 to update a functions during runtime in workbenhc

fringe prairie
#

@minor agate very random question, what delay on a callqueue, past which, should it be considered imploded/detrimental? I created a simple mod which measures the time OnUpdate takes in ArmaReforgerScripted - which invariably is influenced by how many functions are executing when the ScriptedCallqueue ticks. 2ms? More? Going forward my goal is to avoid CallLater at all costs, but it would be good for profiling other mods which utilize it to see where the stalling is coming from.

left pendant
#

Hey I was wondering if anyone has experience with scripting in custom actions to a prefab could reach out to me to see if you could help me get this mod over the finish line?
Little info, took an auto-cannon where the toggles are in GM Mode, made it a child prefab to a vehicle, made a script to allow the parent vehicle to see it, now I just need to script in the toggleable actions.

teal vapor
#

you don't get code completion or other nice ide features

tawny lotus
#

I'm trying to get the right size of the playable map area. GetGame().GetWorld().GetBoundBox() gives you the information in most cases, but for example on Kunar map the bounding box is much larger than the actual land mass. GenericTerrainEntity is the land mass, but I don't know how to get it's size. How to access it's bounding box or the coordinates?

vast flower
#

Is EOnInit no longer being called in workbench edit mode in 1.6 exp? If it's intended behaviour, so SCR_Global.IsEditMode() calls could be removed, right?

vast flower
#

probably have something to do with the entity itself, or SetEventMask(INIT) was removed

pliant ingot
vast flower
minor agate
#

Whatever time it takes to process, it's time taken away from replication threads

#

In other words more latency added

#

Not only it slows framerate, it also slows down that even if they are separate threads because the rpl threads are subject to the main thread script mutex

minor agate
#

But people misused it even internally for feature development, adding expensive calls to it

fervent cedar
#

I have a solution for this problem.
Server only calculates networking.
Headless client runs code.

#

It works so great in arma 33

minor agate
#

rip rpl calculations that are supposed to be fast then

#

We have headless clients in AR

#

we don't use them because that option does not realyl solve the problem

#

just moves it elsewhere

#

You will still get the stall

#

There is solution that is better for it, but we are not using it for AR as AR does not have that tech

#

We have world systems with special update points for things 😛

undone patrol
#

Have you added a new sim-component for Projectile yet?

west prism
#

when i press TAB near vehicle i can see Trunk Is there a way to forbid this?

pliant ingot
minor agate
#

We prefer to have the performance even if it means more work

#

For A4 we are providing more shortcuts for those not technically good

pliant ingot
minor agate
#

As I said before, on A4 you won't find it

polar patrol
#

Guys, can you tell me how to enable the bullet trajectory display with Win + Alt?

undone patrol
#

GameCode-Projectiles-Show Shell True

polar patrol
vast flower
#

could anyone ELI5 on what each RplComponent property practically means? I read community wiki article about it and honestly, haven't gathered much knowledge from tech mumbojumbo speak there. 🐸
I only understood that streamable property affects network streaming for clients (so entity outside of "player bubble" will no longer exist for such client and/or it's state will not be synchronized until such entity reaches "player bubble" again), but others, especially spatial relevancy, auto hierarchy and rpl state override, are mysterious in what they actually affect

serene fox
#

Hi, does anyone know how ti Fire a weapon (BaseWeaponComponent/BaseMuzzleComponent) by Script?

vast flower
# serene fox Hi, does anyone know how ti Fire a weapon (BaseWeaponComponent/BaseMuzzleCompone...

I was looking for an answer to this question too for my heli rocket strike feature and came to the conclusion that it is not yet possible and there are two ways to "fire a weapon":

  1. spawn rockets as projectiles in the general direction of target - essentially mimicking weapon fire
  2. use AI behaviour trees (Fire.bt, Fire_Ballistic.bt, Fire_Single.bt and Fire_Burst.bt) and force pilot/gunner to fire his weapons by sending a highest priority "Fire" AI message in his message queue
vast flower
vast flower
# serene fox Hi, does anyone know how ti Fire a weapon (BaseWeaponComponent/BaseMuzzleCompone...

btw, if you're interested in AI behaviour tree way, you may start to look at SCR_AIGroupUtilityComponent as an example of this way, see for a EvaluateFlareUsage() function - it checks right conditions to fire a illumination flare and forces guy with an underbarrel GL in the group to take cover, aim and fire a flare at the target position and direction

so, the call stack is (roughly)
SCR_AIGroupUtilityComponent.EvaluateActivity() (check s the state of the group and forces various behaviours)->EvaluateFlareUsage() (checks if there is a necessity to launch the flare)->SCR_AIActivityIllumFlareFeature.Execute() (checks if group has the alive and available soldier with GL and flares, picks particular soldier from the group and sends him an AI message that he needs to fire the flare)->SCR_AIFireIllumFlareBehavior and FireIllumFlareAt.bt (actual illumination flare firing behaviour)

OR

you can just spawn projectiles and launch them via ProjectileMoveComponent (see SCR_AirstrikePrototype as an example) 🫠
(I ended up doing it this way, but it has some accuracy problems - you need to manually compensate speed and distance to make it really hit something at all, and there are no generated AI ballistic tables for heli rockets so you can't use BI ballistic helpers either)

open pier
serene fox
#

i think "ProjectileMoveComponent " is the way i go, so i do not need to mess around with AI stuff

scarlet iris
pliant ingot
boreal swan
scarlet iris
pliant ingot
minor agate
#

Do not read the biki for rpl docs

#

Read the multiple doxygen docs instead

#

or the rpl bootcamps

#

Hierarchies for RPL and all that are explained there too

minor agate
#

Also for you @vast flower

desert escarp
#

Trying to get the custom attributes here from the entity source

#

Currently doing

IEntitySource entitySource = SCR_BaseContainerTools.FindEntitySource(Resource.Load(sight));
            if (entitySource)
            {
                for(int nComponent, componentCount = entitySource.GetComponentCount(); nComponent < componentCount; nComponent++)
                {
                    IEntityComponentSource componentSource = entitySource.GetComponent(nComponent);
                    Print(componentSource);
                    if(componentSource.GetClassName().ToType().IsInherited(InventoryItemComponent))
                    {
                        BaseContainer attributesContainer = componentSource.GetObject("Attributes");
                        if (attributesContainer)
                        {
                            auto itemAttributes = componentSource.GetObjectArray("CustomAttributes");
                            Print(itemAttributes);
                        }
                    }
                }
            }
#

itemAttributes is returning a nullptr, what am I doing wrong here

#

Nvm just had to change
componentSource.GetObjectArray("CustomAttributes");
to
attributesContainer.GetObjectArray("CustomAttributes");

#

🤦‍♂️

open pier
pliant ingot
#

or it's just about if you move something, then it will be out-of-sync until players come close?

frosty coral
desert escarp
#

Is there a way to get nested components with the IEntitySource

#

For example

        IEntitySource entitySource = SCR_BaseContainerTools.FindEntitySource(Resource.Load(prefab));
        if (entitySource)
        {
            for(int nComponent, componentCount = entitySource.GetComponentCount(); nComponent < componentCount; nComponent++)
            {
                IEntityComponentSource componentSource = entitySource.GetComponent(nComponent);
                Print(componentSource.GetClassName().ToType());
            }
         }

This prints all these non nesteed components in a weapon

past swallow
#

hello all, so i have been experimenting with loads of different gamemodes for a survival dayz roleplay server on reforger, on my understanding a life roleplay server has a lot of custom script built in, so I'm using the everon life mod and the enfusion data/persistence frameworks mods as my foundation build on worthy islands map.
I have messed with GM mode and SF mode to which i find has components i dont need.
Looking at everon life prefabs for MP it has a roleplay gamemode and as prefab, and spawnpoint...
My question is... would it be best to use? that prefab and duplicate it to my mod or should i set up a SCR_BaseGameMode and add the components from the everon life prefab as i noticed it only has the EPF components needed for persistence.

What is my best option...
Set up scr_basegamemode and add the epf components or
Set up the everonlife prefab roleplay gamemode and add the componets needed manully ?

ocean needle
ocean needle
desert escarp
#

🫡

desert escarp
#
SCRIPT    (E): Usage of released BaseResourceObject 0x000002799CCF6940 in:
SCRIPT    (E):    -- Stack trace --
SCRIPT    (E):    GetPrefabsDefaultSight() scripts/Game/Systems/UI/Menus/CRF_SightArsenal.c : 247
SCRIPT    (E):    GetDefaultAttachments() scripts/Game/Systems/UI/Menus/CRF_SightArsenal.c : 90
SCRIPT    (E):    PopulateSights() scripts/Game/Systems/UI/Menus/CRF_SightArsenal.c : 49
SCRIPT    (E):    OnUpdate() scripts/Game/game.c : 922
SCRIPT    (E):    OnUpdate() scripts/Game/ACE_Medical_Circulation/Diag/ArmaReforgerScripted.c : 15
SCRIPT    (E):    OnUpdate() scripts/Game/ACE_Medical_Medication/Diag/ArmaReforgerScripted.c : 15

Getting this error currently but all that is at 247 is

for(int nComponent, componentCount = entitySource.GetComponentCount(); nComponent < componentCount; nComponent++)
#
ResourceName GetPrefabsDefaultSight(ResourceName prefab)
    {
        IEntitySource entitySource = SCR_BaseContainerTools.FindEntitySource(Resource.Load(prefab));
        if (entitySource)
        {
            for(int nComponent, componentCount = entitySource.GetComponentCount(); nComponent < componentCount; nComponent++)
            {
                IEntityComponentSource componentSource = entitySource.GetComponent(nComponent);
                if(componentSource.GetClassName().ToType().IsInherited(WeaponComponent))
                {
                    BaseContainerList attachmentComponents = componentSource.GetObjectArray("components");
                    for (int i = 0; i < attachmentComponents.Count(); i++)
                    {
                        IEntityComponentSource attachmentComponent = attachmentComponents.Get(i);
                        if (attachmentComponent)
                        {
                            BaseAttachmentType type;
                            attachmentComponent.Get("AttachmentType", type);
                            if (!type)
                                continue;
                            if (type.Type().IsInherited(AttachmentOptics))
                            {
                                 BaseContainer attachmentSlot = attachmentComponent.GetObject("AttachmentSlot");
                                if (attachmentSlot)
                                {
                                    ResourceName attachment;
                                    attachmentSlot.Get("Prefab", attachment);
                                    if (attachment)
                                        return attachment;
                                    else
                                        return "";
                                }    
                            }
                        }
                    }
                }
            }
        }
        return "";
    }
#

That's the full method

#

Everything still works fine, it just barks that error for some reason

desert escarp
#

@minor agate Maybe you could throw more insight but it seems that some duplicated weapons cause this to happen. Everything works fine still but it barks that error, it seems to inconsistently happen as well only on certain duplicated weapons.

coarse dragon
#

Hi everyone,
I’m looking for a way to disable the component that handles target locking on RHS tanks, since it’s way too strong. Does anyone know how to do this without disabling the stabilization system?

minor agate
#

Load it separately into a var with Resource type

#

then use it

#

Do not use it without storing it, only valid case is in cases like the spawn methods

desert escarp
#

🙏

#

Ah bet appreciate it

minor agate
#

The resource gets cleared later on if not hold somewhere

stiff drift
#

Hey im currently working on a drive by mod for my server. Ive copied the s150 prefab and am trying to edit it but it wont let me attach my script onto it. can anyone help with that

dire sinew
stiff drift
#

how do i do that😅

scarlet iris
stiff drift
#

ive made this

#

class VehicleShootComponentClass : ScriptComponentClass
{
};

class VehicleShootComponent : ScriptComponent
{
override void OnPostInit(IEntity owner)
{
super.OnPostInit(owner);
Print("VehicleShootComponent initialized for: " + owner);
}
};

#

but its not showing up in the add component

neon elbow
#

have you validated and reloaded your script?

stiff drift
#

i figured it out

#

my class name was VehicleShootComponent but the file name was VehicleShootingComponent

#

lol

stiff drift
#

charController.SetBlockedState(ECharacterControllerState.FIRING, !allowFire);
Print("[DriveBy] Shooting" + (allowFire , "ENABLED" : "BLOCKED") + " | Leaning=" + m_bIsLeaningOut + " | Weapon=" + itemName);

#

this is saying unmatched brackets detected

#

anyone know how to help

ocean kernel
#

What in the chatgpt is that

stiff drift
#

exactly that

#

im completly redoing it

#

i thought it would help but...

spark otter
#

Don't use chat gpt for reforger, that looks horrid

scarlet iris
stiff drift
#

i keep getting the error: Broken expression (missing ';'?)

desert escarp
#

Don't use ChatGPT to help you in enfusion, it has little to no idea on the proper syntax of enforce. Your best bet is to just look at what the base game does and go from there.

Most enforce syntax is relatively close to C# anyway.

stiff drift
#

ik C# but idk something with enforce throws me off

desert escarp
#

Well it's not strictly C#, it's definitely an almogamation of the C based languages

#

But imo it's closest to C#

spark otter
high hawk
scarlet iris
#

Can anyone explain to me how or where to access Enfusion Doxygen?

#

Nevermind I think I figured it out

open pier
scarlet iris
open pier
#

ahh its already generated from doxygen i see, thought these were 2 different things

scarlet iris
boreal swan
#

How would you make the Doxygen docs look like in the MarioE's message? #enfusion_scripting message When I open those files it looks quite different

zenith kayak
#

Hey all! New to modding in the enfusion engine (not new to programming though). One thing that I am really struggling with is just finding the correct configs for what I want.

For example, I'm trying to add a new task to the Game Masters faction tasks bar, but I don't know where this config is. I am assuming it is in a config somewhere much like how I would add a new item to the spawnable prefabs?

Edit: to clarify, I'm not looking for how to find that specific config, more just how to trace things back to a config in general (if there is an 'easy' way?)

torn bane
scarlet iris
boreal swan
#

Also ran the unzipped folder through Doxygen executable via it's GUI wizard, but I think I'm doing something wrong because the end result wasn't correct

boreal swan
#

Apparently there's no need to use Doxygen executable as the files have been formatted by it already, but that doesn't explain why it's looking completely different and missing stuff

ocean needle
#

more than likely a dev build

quiet drift
#

Hey, is there a shortcut or something to disable all breakpoints quickly ?

quiet drift
tawny lotus
#

How can I find the GenericTerrainEntity from the map? I've had no success with querying with a sphere. Finding GenericWorldEntity has specific getter GetWorldEntity() but such is not available for GenericTerrainEntity.

tawny lotus
#

I'm trying to find the size/bounding box of the GenericTerrainEntity to determine the size of the playable area. I can see bouding box in WB, but have no idea on how to get that information. (GetGame().GetWorld().GetBoundBox() is not reliable on all maps).

vast flower
#

Has anyone figured how to use new (1.6 exp) task system?
I want to assign newly created task for all players in the faction, but not sure how to do it, as there is no SCR_TaskExecutor.FromFaction (only player, group and entity support) thing in TaskSystem.AssignTask() function.
I already assign task to faction:

m_TaskSystem.SetTaskOwnership(task, SCR_ETaskOwnership.FACTION);
m_TaskSystem.SetTaskVisibility(task, SCR_ETaskVisibility.FACTION);
m_TaskSystem.AddTaskFaction(task, playerFaction.GetFactionKey());

but it seems to be not enough to assign task to all players in faction and show notification to them too.

abstract crescent
#

Hello. How can i get terrain material type at specific coords? I want to restrict item placement on roads.

ocean kernel
#

Well you will be delighted to know roads are not terrain materials

abstract crescent
ocean kernel
#

Lol

abstract crescent
#

it was my fail with flags.
With "Flags = TraceFlags.WORLD | TraceFlags.ENTS;" works fine.

#

hmmm. it works with roads only, but ignores concrete surface, because its part of terrain

ocean kernel
#

any chance roads have a physmat?

#

maybe could do a physics material check

river imp
#

As in why is GetGame().GetWorld().GetBoundBox() not reliable on all maps?

abstract crescent
ocean kernel
#

get terrain height at x,y then trace down from like 0.5 meter above with terrain flags only

#

I vaguely remember there being a helper function for that

abstract crescent
ocean kernel
#

yeah is that not physics material?

abstract crescent
#

ye. I see "SurfaceProperties SurfaceProps;"

minor agate
abstract crescent
#

I can get PhysicsMaterial of surface but i dont known what do next notlikemeow
PhysicsMaterial doesnt have any functions or documentations or examples. How to work with it?

ocean kernel
#

idk I just thought roads might have a different one than anything else

minor agate
#

Why do you think you need the PhysicsMaterial?

toxic spoke
#

Guys i need some help, ive added 2 new vehicle mods to my server and wanted to make them lockable, im on wcs based server, so i added the wcs-lockable component in the prefab, but still cannot lock or unlock it, any idea why?

abstract crescent
#

i can get roads and buildings by TraceMove, but i cant get concrete, because concrete is just terrain with own material.

amber breach
#

Anyone know how to bypass faction selection ?

scarlet iris
# amber breach

No scripting is needed for this, this is the spawn menu logic from the game mode manager. you need to find the SCR_RespawnSystemComponent and change the spawn logic to SCR_AutoSpawnLogic

unless you need something else

amber breach
#

Or is that even a thing haha

rapid ferry
#

Should OnPostInit run for proxies? I have a component on a vehicle and currently the init code does not run on peer tool client. Is there a replication event I can hook into to run it on ownership change?

#

For example this component is placed onto a M151A1:

[EntityEditorProps(category: "GameScripted/Physics")]
class PhysicsTestClass: ScriptComponentClass
{
}

class PhysicsTest : ScriptComponent
{
    protected RplComponent m_Rpl;
    
    override void OnPostInit(IEntity owner)
    {
        m_Rpl = RplComponent.Cast(owner.GetRootParent().FindComponent(RplComponent));
        
        Print("PhysicsTest::OnPostInit");
        SetEventMask(owner, EntityEvent.SIMULATE | EntityEvent.FRAME);
    }
    
    override event protected void EOnSimulate(IEntity owner, float timeSlice)
    {
        if (!m_Rpl || !m_Rpl.IsOwner())
            return;
        
        Print("PhysicsTest::Simulate");
    }
    
    override event protected void EOnFrame(IEntity owner, float timeSlice)
    {
        if (!m_Rpl || !m_Rpl.IsOwner())
            return;
        
        Print("PhysicsTest::Frame");
    }
}```

1. In workbench, Frame & Simulate debug prints work fine. [expected]
2. Once peertool client enters the vehicle the print stops in workbench console as ownership has been transferred to the peertool client. [expected]
3. But OnPostInit was never called on the peertool client so it does not have the correct event mask's enabled so it never runs frame & simulate events so no prints to peertool log file. [what do??]
#

Essentially an OnOwnershipChanged function would be great in RplComponent, but that only exists on PlayerController.

torn bane
#

Post init is called on proxies too. If you did not see it, the entity did not stream in. Add print to constructor

torn bane
pliant ingot
tawny lotus
# river imp As in why is GetGame().GetWorld().GetBoundBox() not reliable on all maps?

This example in Kunar. The GenericWorldEntity size is ~7k. Inside it there is the playable area GenericTerrainEntity which is of size 4k x 4k. Outside of the terrain there are nice mountain walls. Terrain is centered in the world (in 0,0,0) which leaves a lot empty space outside of it. This empty space is not play area as it has no land mass on it. The ...GetBoundBox() for world returns the size of 7k.

boreal swan
#

Do ExecuteBefore and ExecuteAfter have deadlock detection? Like if system A depends on system B results and system B is also set to depend on system A

kind widget
tawny lotus
kind widget
tawny lotus
#

GetGame().GetWorld().GetTerrainBoundBox() or GetGame().GetWorld().GetTerrainSize() would be nice. 🙂

amber breach
minor agate
# rapid ferry Essentially an `OnOwnershipChanged` function would be great in `RplComponent`, b...

There is. You just need to define either of these rpl callbacks similarly to RplLoad/RplSave

// Authority event, called on ownership change. You can use the writer to send aditional data.
protected bool RplGive(ScriptBitWriter writer)
{
    // Do something here
    return true;
}

// Owner event, called on ownership change. You can use the reader to send aditional data.
// This is called only on the client receiving the ownership.
protected bool RplGiven(ScriptBitReader reader)
{
    // Do something here
    return true;
}

This is before, for after the change. Do RplTake/RplTaken

zenith kayak
ocean needle
zenith kayak
#

This is getting me closer! Let me see how I go from here thanks!

minor agate
#

So usually better luck from getting someone from our side to answer things there regarding UI

zenith kayak
#

Copy that! thanks 🙂

pliant ingot
minor agate
minor agate
#

return false means the callback has failed

#

usually it causes crash as it most of the time means something bad happened

#

or a stall iirc

#

I will need to check, but it can cause some bad things.

craggy locust
#

#enfusion_scripting message

So i figured out that i cannot change sights skip switch in the runtime, so there have to be some workaround T_T Why is coding so hard? Would anyone be willing to help me out with that? My knowledge about scripting/coding is almost non existent. Im slowly learning, but its not easy

late locust
#

So how do I fake keyboard / controller input to make my VR Controllers work? thonk

rapid ferry
# late locust So how do I fake keyboard / controller input to make my VR Controllers work? <:t...

I've done this to override car inputs on every frame:

        InputManager inputManager = GetGame().GetInputManager();
        if (inputManager)
        {
            // Attempt to ignore car inputs
            inputManager.ResetContext("CarContext");
            
            // Apply custom car inputs (steering, brakes)
            UpdateSteering(timeSlice);
            inputManager.SetActionValue("CarSteering", m_fSteeringAngle);
            inputManager.SetActionValue("CarBrake", m_fWheelBrakeInput);
            inputManager.SetActionValue("CarHandBrake", m_fHandBrakeInput);
        }```
rapid ferry
stiff drift
#

since two days ago I've started to learn how to code in enforce script by fixing AIs mistakes (actually kinda helpful) and looking through arma code. But I'm getting stuck on this and i don't know how to fix it (the console is screaming at me saying Incompatible parameter 'prefabPath')

#

im still really new to modding so please dont be to harsh if it looks like a monkey bashed a stick on a keyboard to make this

open pier
stiff drift
#

ok ill try that

open pier
#

And ResourceName can be parsed like a string iirc

weaponPrefab.Contains("m9");

Something like that, writing this off memory

stiff drift
#

OMG IT WORKS

#

MY MONKEYS LEVELD UP TO A POINTED STICK

open pier
stiff drift
#

I'm getting errors again this time its saying Broken expression (missing ';'?) I've checked over it and nothing should be missing a semicolon but if anyone could point me in the right direction that would be awesome

open pier
scarlet iris
stiff drift
#

what can i use instead?

scarlet iris
stiff drift
#

ok thanks

scarlet iris
#

Example

This is wrong:

float blendRate = m_IsFiring ? 0.30 : 0.15;

This compiles:

float blendRate;
if (m_IsFiring)
blendRate = 0.30;
else
blendRate = 0.15;

stiff drift
#

for a weapon allow list do i only need the WhatEverTheWeaponIs_base.et GUID or do i need ever other variant's as well (i can get screenshots if needed)

pliant ingot
stiff drift
#

ik

#

ive only been using it to learn off its mistakes and that was not one of them im making this part

#

and i figured it out i just needed the prefab IDs

river imp
high hawk
#

Is it possible for a manualcamera feed or PiP to be displayed on a rendertarget?

rigid fog
#

is it possible to script in my own text editors like vscode?

ocean needle
rigid fog
#

where's a good place to get started for just the scripting?

#

im trying to find some sort of documentation of the API

boreal swan
high hawk
restive island
# ocean needle

Is this only for layout widgets? I'd like to see what scripts are called when a player does xyz in the world testbed. Kinda like print debugging/tracing, but done automatically to see what config/script is getting called

ocean needle
#

the diag menu might be useful for you then

#

i forget what bind it is, maybe tilde

#

if not should be searchable in here or on the wiki somewhere

#

at work right now so cant check

river imp
high hawk
stiff drift
#

so in my Letmedriveby mod i have a list of unallowed weapons while in the vehicle, so i had to make this list to tell tell the program what weapon is what. my question is how do i get the names or IDs to actuly make it work. (the sceen shots are from me testing last night)

#

and also what is the player prefab im supposed to put scripts on, ive been using a copy of Character_Base.et

stiff drift
#

i did end up haveing to change it from a bunch or ORs to if statements

river imp
stiff drift
#

i dont want players to use primary weapons inside of the car

river imp
#

Then check the weapon component

stiff drift
#

{599A1E833BEF3A43}Prefabs/Weapons/MachineGuns/M249/MG_M249_base.et like these things?

river imp
#

No

#

That's the ResourceName of that prefab

river imp
#

Oh I see, I assume the last one is returning true.

#

Regardless, how would the mod work with other mods if you're hardcoding the prefabs?

stiff drift
#

how else can i do it?

#

i assumed people could make their own version of the mod or something. idk this is my first mod.

#

also this is more of how it looks now

stiff drift
river imp
#

There is 0 reason to hardcode values when you can read that data.

#
protected bool IsPrimaryWeapon(notnull IEntity Weapon)
{
    WeaponComponent WeaponComp = WeaponComponent.Cast(Weapon.FindComponent(WeaponComponent));
    if(!WeaponComp)
        return false;
        
    return WeaponComp.GetWeaponSlotType() == "primary";
}
#

This should work for your use case.

late kite
#

is there a way to disable screen effects when switching from a player to game master or arma vision? I want my custom damage screen effect to go away when i'm not longer controlling my player

desert escarp
#

Is there anyway on our side to pass function pointers around? I see there's the func variable but we cannot use it on our side as it just barks errors in the IDE

#

Trying to create a game system that will let me pass around function pointers as a way to by pass using CallLaters, we have a lot of systems we need to do this for and it seems tire some to create multiple systems to do one thing in each. Or make a really complicated system that can do it all. Function pointers would make this much cleaner.

ocean needle
#

is it disabled just for security reasons?

midnight talon
random oracle
#

anyone know if it is possible to either have a dynamic prefab that changes after a certain amount of time or a dynamic texture that changes with time? We would want to script it to start after we do a certain action.

random oracle
random oracle
#

Thanks, should help me and saber get a bit further with that

desert escarp
#

Is there any way to hold paramter values as voids like you could in the C++ side?

#
class CRF_QueryObject
{
    float m_fLastUpdatedTime = 0;
    void CRF_QueryObject()
    {
        m_fLastUpdatedTime = GetGame().GetWorld().GetWorldTime()
    }
    
    CRF_EQueryType m_eQueryType;
    float m_fDelay;
    ScriptComponent m_Component;
    void m_Param1;
    void m_Param2;
    void m_Param3;
    void m_Param4;
    void m_Param5;
    void m_Param6;
    void m_Param7;
    void m_Param8;
    void m_Param9;
}
#

Example, but this gives errors in the IDE, is there anything on our side like void in C++?

#

I see things like Format and CallLater use void like this so I am just assuming this usecase is just locked from our side.

#

:/

abstract crescent
#

u can try to use own class as fake void if need:

class MyFakeVoid
{
    int m_i;
    float m_f;
    string m_s;
    
    void Set(int i) {}
    void Set(float f) {}
    void Set(string s) {}
    
    void Get(out int i) {}
    void Get(out float f) {}
    void Get(out string s) {}
}
class CRF_QueryObject
{
    float m_fLastUpdatedTime = 0;
    void CRF_QueryObject()
    {
        m_fLastUpdatedTime = GetGame().GetWorld().GetWorldTime()
    }
    
    CRF_EQueryType m_eQueryType;
    float m_fDelay;
    ScriptComponent m_Component;
    MyFakeVoid m_Param1;
    MyFakeVoid m_Param2;
    MyFakeVoid m_Param3;
    MyFakeVoid m_Param4;
    MyFakeVoid m_Param5;
    MyFakeVoid m_Param6;
    MyFakeVoid m_Param7;
    MyFakeVoid m_Param8;
    MyFakeVoid m_Param9;
}
midnight talon
#

By "inactive and not fully finished" does that mean there's something functional there and it's just disabled? Is there any way to enable this for testing?
I'm not too worried about any bugs or the system's APIs/behaviour changing, if just character persistence is working then that's probably enough for me to start testing with it and planning migration from EPF.

I have a fresh experimental Eden HQC world and am not sure how to enable the new save system, I can see SCR_PersistenceSystem enabled in ConflictSystems.conf but it doesn't seem to save/load anything, do I have to add a manager entity to world or something?

torn bane
midnight talon
minor agate
torn bane
desert escarp
minor agate
#

many modders already struggle with the primitive memory management we have with Managed classes, using void and possibly ignoring that will make it worse

ocean kernel
#

Lol you are approaching this completely backwards. I would have better luck fixing memory leaks if you bothered to give me tools to find memory leaks.

#

I can't profile my mod

#

I dont see why I should take any of that memory stuff seriously if the tools given to me dont take me and my time seriously

#

Thanks for coming to my ted talk

minor agate
#

Also you can't track leaks with profile tools

#

You need the game source code

ocean kernel
#

To be fair I dont think memory management has any place in video game modding

#

In retrospect

minor agate
#

You just asked for more as well

#

😅

ocean kernel
#

Yea the whole 5 modders

minor agate
#

But scripts are not for modders

#

We use it internally

#

And the way we do things, is that we provide you as much of the tools we use to modding

#

where legally allowed and safe

ocean kernel
#

I would actually prefer not having to do any of it. I want to define a data structure and use it anywhere I want and the game engine should deal with the heavy lifting for me.

minor agate
#

but depends on what one does

#

those modders wanting to do low level stuff would suffer

#

While the high level ones would like it

ocean kernel
#

In general realistically modding is in some ways a waste of time, so if I have to troubleshoot some missing ref crashing my entire game that's even more waste of time

minor agate
#

but at any point if you do not care, just slap ref anywhere and enjoy the strong reference issues you will face

#

same that you can face in JS and such

ocean kernel
#

Yeah but with JS I get a stack trace that points me in the right direction, whereas here when I try to unpack a json with some ref issue it wipes out the entire thing with nothing presented to me that is even remotely helpful

#

Then again, the whole software stack crashes when I ctrl+c ctrl+v in behavior editor, so I should lower my expectations

minor agate
#

Logging could be made better yeah

#

I will see what we can do in there

ocean kernel
#

One I believe objectively valid point regarding not respecting modders' time is asking them to do 50 null checks instead of giving them try/catch

minor agate
#

Do you have example of the kind of logging you would like to see?

ocean kernel
#

In my json example I would expect some kind of null pointer or json decode failure instead of wb popping like a balloon

#

Not sure if that's different in experimental or not

ocean needle
ocean kernel
#

But in general that is I would say lower priority than stability issues

#

I believe stability issues are the biggest contributor to discouraging me from making mods

fervent cedar
# minor agate many modders already struggle with the primitive memory management we have with ...

Wouldn't mind knowing how much memory etc my mod uses.
How much impact x/y/z has.

Even some basic way to overview how much ms do scripts in my mod take and how much data, how much network traffic when testing in workbenhc.
I know there is the debug menu thing that shows,
but having some graph that is made from the data there for clarity would be nice and probably easier to understand for a variety of modders.

#

And then maybe getting some notification from the graph when issues happen.
Such as scripts taking too loing or what not warnings for modders.
But having a new window/menu in workbench to consolidate this clearly.

quiet drift
#

Hey, when creating a custom logic in a modded SCR_CommandHandlerComponent,

override event bool HandleWeaponReloading(CharacterInputContext pInputCtx, float pDt, int pCurrentCommandID)
{
super.HandleWeaponReloading(pInputCtx, pDt, pCurrentCommandID);

The good way is to make to set up the animation events with flag in a custom WeaponAnimationComponent, and use these flags to drive the reload logic in the handler ?
This sounds good to me but I'm not sure that's the good way

maiden goblet
fervent cedar
#

I'd like a vanilla workbench implementation as it's quite a common concern.
I don't think I can accecss the data in the debug menu with a script, so I can't really graph it in-game.
I don't know how big my data is etc.

maiden goblet
fervent cedar
#

For example in arma 3 I wrote a script that generated loot for every building position in the game.
Tanoa/Altis were a lot of data etc.
or caching/spawning system with couple of thousand AI units.
Hard to grasp which methods of writing the data are better or slower etc

#

But in general profiling window for modders is a great thing to have in the long run.

pliant ingot
# maiden goblet Struggling to envision situation where 1) you don't know size of your data 2) th...

don't known size of your data
You can't do this, because you can't access to internals (you don't known how looks layout for your string/array/map, you don't known rules for padding and alignment of your classes, you don't known how many levels of indirection they have, you don't known how much additional info VM allocates for your data (type checking, inheritance and etc)
Just ask you - how much memory will be allocated for single component with single variable, and after that look at what your world editor will say
that size is important
But it can be important because you can use it for thousands entities

red cedar
desert escarp
stiff drift
#

anyone know how to get the position of the seat a player is sitting in (like if a player is sitting in the front passenger seat)

torn bane
#

Compartment access component on the character. On it you can get the compartment. It should hold a point info getter somewhere

stiff drift
#

thank you so much

undone patrol
#

Can someone tell me how to do it correctly?
And in general, did I do it correctly?

When implementing my BlastComponent for the RocketEjectorMuzzleComponent, I encountered a problem.
When I use the Action Refound Rocket (SCR_RefundVehicleAmmoSupportStationAction), the BlastComponent constantly triggers.
How can I forcefully block it? I only want it to work from the turret's shooter position.

midnight talon
amber breach
#

how to change player loadout when they first join ?

teal vapor
#

A long ways to go, but it's a start

pliant ingot
late locust
#

How do I import vec[3] from json? This only seems to import the first element. Not sure if this is even possible, or im doing it wrong thonk

class RotationTestJson : JsonApiStruct
{
    vector rotation[3];    
    void RotationTestJson()
    {
        RegV("rotation");
    }
}
...
vector mat[3];
Math3D.MatrixIdentity3(mat);
SCR_JsonSaveContext context = new SCR_JsonSaveContext();
context.WriteValue("rotation", mat);
string myJson = context.ExportToString();
//-> string myJson = '{"rotation":[[1.0,0.0,0.0],[0.0,1.0,0.0],[0.0,0.0,1.0]]}'
RotationTestJson rotTest = new RotationTestJson();
rotTest.ExpandFromRAW(myJson);
Print(rotTest.rotation);
//-> {<1.000000,0.000000,0.000000>,<0.000000,0.000000,0.000000>,<0.000000,0.000000,0.000000>}
ocean kernel
#

your rotation in myJson is not a vector

late locust
#

but if I export to string should it not be able to import it correctly again?

ocean kernel
#

Oh wait I am a dummy

#

Your first mistake is using JsonApiStruct instead of JsonLoadContext

#

JsonApiStruct does not parse JSON correctly

late locust
#

Right, LoadContext just works. The one time I try to use the fancy struct like the wiki says, everything breaks notlikemeow

SCR_JsonLoadContext loadContext = new SCR_JsonLoadContext();
loadContext.ImportFromString(myJson);        
vector rotation[3];                
loadContext.ReadValue("rotation", rotation);
//-> {<1.000000,0.000000,0.000000>,<0.000000,1.000000,0.000000>,<0.000000,0.000000,1.000000>}
amber breach
#

Anyone have videos or community to learn OOP ?

#

That you recommend?

teal vapor
# pliant ingot It's communicating with WB (so it can search for most resent and modded scripts)...

It’s not communicating with WB at all. It’s leveraging my own library for getting data out of pak files then using https://github.com/simonvic/tree-sitter-enforce to parse scripts. No intermediate formats, dumping data to disk, or manual steps needed other than configuring the game directory.

My LSP implementation is quite jank atm, I’m just building a list of classes and returning that for completion results as a PoC, but using tree-sitter allows for real-time editing and analysis.

This approach would allow you to do dev on any platform so long as you have Arma installed somewhere.

GitHub

Enforce script grammar for treesitter. Contribute to simonvic/tree-sitter-enforce development by creating an account on GitHub.

desert escarp
#

Is there anyway to reconnect with the same playerId to my hosted dedicated server in the WB

#

Ive tried direct join with localhost and my ip but nothing works

#

And if I just relaunch the diag exe it connects me to the server with a seperate playerId

torn bane
#

It works only with diag version of the game and only on 1.6 onwards. There it should match the old connection and you get your Id back. But only if the client did not voluntarily disconnect. Only on killing the process or rpl timeout etc

desert escarp
#

Rip alright bet

dire sinew
#

Why the hell is this illegal?

void MyTestFunction(array<LocalizedString> formatParams = null)
{
    if (!formatParams)
        formatParams = {};
}
restive island
# minor agate But scripts are not for modders

I don't know how other modder's work their mods, but scripts are where I'm focusing my efforts to make two mods that change/add logic and use existing assets. It'd be nice to have better documentation and examples, the mod bootcamp was a good start.

teal vapor
narrow walrus
narrow walrus
# teal vapor A long ways to go, but it's a start

I'd suggest you to get the hang of "queries" https://tree-sitter.github.io/tree-sitter/using-parsers/queries/1-syntax.html

idk about rust bindings, but in Java I could quickly query for all decl_class with something like this

var queryDeclClass = new Query(language, """
  (decl_class
    typename: (_) @_identifier) @_root
  """);

or I could find all syntax errors with (ERROR) @error (and eventually report it as diagnostics from the language server)

And it's so stupidly fast that you could run it on every keystroke 😄

minor agate
#

Also, rare to see you here @narrow walrus worry

narrow walrus
teal vapor
#

he's been a great maintainer too helping fix some of the grammar issues that have arisen from applying it to Reforger

narrow walrus
#

but no worries, we'll soon get all the improvements backported to DayZ e.e right? @ Mario

teal vapor
#

dayz mods will surely get function pointers before arma reforger

narrow walrus
#

we had/have them (?)

teal vapor
#

modders can't use them in Reforger scripts. first-party scripts can tho

narrow walrus
#

yeah same, now they're only allowed in native functions

minor agate
#

Its the same in dz

minor agate
#

AR enforce script has more things

teal vapor
#

btw mario is it worth filing bug reports for errors that are encountered when parsing scripts? e.g. some scripts contain non-utf8 chars or are very obviously missing semicolons here and there. I don't want to add noise if the scripts or functionality aren't used though

minor agate
#

@queen silo

#

Just let him know, or @brazen sphinx

elder smelt
#

Question for you gents i made a XM7 magwell script and the Validator refuses to run i know its correct because its the exact same one i use on my other Mod but still not getting any Validation attempts

queen silo
narrow walrus
#

I've just noticed that we can omit the generic type (e.g. ScriptInvoker<>); will it be Class by default?

queen silo
#

No, it is to be avoided entirely as it is a "free pass"
See Script Invoker Usage on the wiki

stiff drift
#

anyone able to help im having trouble with finding the specific seat a player is in

stiff drift
#

it probably is

neon elbow
#

lol

stiff drift
#

i cant access the reforger API stuff so im learning pretty much on my own

teal vapor
#

I'm sorry that I can't provide a helpful response -- I have never had to deal with vehicles like this.

teal vapor
stiff drift
#

just the tutorials and how certain things are worded

neon elbow
#

Does your vehicle entity have a SCR_BaseCompartmentManagerComponent component?

stiff drift
#

this is going to be placed on the player prefab. why is that bad lol

#

its for my driveby mod

neon elbow
#

oh, that's a little trickier. If you can access the SCR_BaseCompartmentManagerComponent there's a method that can grab which seats are filled.

stiff drift
#

yea thats what someone told me and i assumed i could call it there but figured out pretty fast that i couldnt

#

unless i did something wrong which is a really big probably

neon elbow
#

you'll need to determine if the player is inside a vehicle, and if they are, find out which vehicle. I think when the player gets in they're set as a child of the vehicle entity?

#

I've looked into the SCR_ChimeraCharacter class and there's a method that determines if an entity is driving. I think you can repurpose it to get you the specific vehicle and then you can get the occupant status.

bool IsDriving(float minSpeedSq = -1)
{
    if (!IsInVehicle())
        return false;

    CompartmentAccessComponent access = GetCompartmentAccessComponent();
    if (!access)
        return false;

    PilotCompartmentSlot pilotSlot = PilotCompartmentSlot.Cast(access.GetCompartment());
    if (!pilotSlot)
        return false;

    Vehicle vehicle = Vehicle.Cast(pilotSlot.GetOwner());
    if (!vehicle)
        return false;

    if (vehicle.GetPilotCompartmentSlot() != pilotSlot)
        return false;

    if (minSpeedSq <= 0)
        return true;

    Physics physics = vehicle.GetPhysics();
    if (!physics)
        return false;

    return physics.GetVelocity().LengthSq() >= minSpeedSq;
    }
midnight talon
# stiff drift just the tutorials and how certain things are worded

look at the relevant prefabs (vehicle, player controller) and you can right-click on relevant components e.g. SCR_BaseCompartmentManagerComponent and "Jump to script definition" to see the class(es) underlying that component is usually a good way to get an idea of what properties and methods you want to target

#

If you search the whole codebase (ctrl+shift+F in script editor) for "compartment" and then filter those results by "controller" will give you a ton of usage examples e.g.
From SCR_CharacterControllerComponent::OnPrepareControls

CompartmentAccessComponent compAccess = character.GetCompartmentAccessComponent();
        
BaseCompartmentSlot compartment = compAccess.GetCompartment();
if (compartment)
ivory cobalt
#

Hey guys I'm posting here as it seems most relevant, anyone abke to help point to some guidance on getting turrets or the heli base turret working, trying to get it to use the flame thrower nl prefabs

minor agate
#

I would avoid reporting based on 3rd party parsers

#

; is not needed in many places

#

For example if you already have {} then its not needed at the end

#

But if the issues you found are not those, then yes. Report

#

Like the ones you did

#

But i am myself more interested on why in this case there was no error PepeHmmm

mossy spade
#

Hello, I'm having a crash in 1.6 exp with following logic within a component when the world is being destroyed. This works fine on stable. Is this considered an illegal op during world unload, or is that an issue with 1.6?

override void OnDelete(IEntity owner)
{
    super.OnDelete(owner);
    IEntity ent = GetGame().GetWorld().FindEntityByID(m_SomeID);
    if (ent) {
        JWK_SomeComponent foo = JWK_SomeComponent.Cast(ent.FindComponent(JWK_SomeComponent)); // this crashes with access violation
        foo.Unlink(this);
    }
}

Crash GUID: 96d3ce02-5201-4819-b965-4f633f990d5b

#

...or could it be some special case such as m_SomeID pointing to a children/ancestor in the hierarchy of the owner, or even being the owner, which previously worked only incidentally?

torn bane
mossy spade
torn bane
#

Well if you can repro it, have a look at what ent printed, but i assume it looks like it is not null. in that case you habe no way known to me to be sure that the entity pointer you got back is still valid. it is the responsiblity of our code to only give you valid ones. that this supposely changed between 1.4 and 1.6 is interesting. if you can make a minimal example mod setup to reproduce it with, this may help us investigate. For the latter please submit a feedback ticket then

mossy spade
torn bane
#

One important piece of infor for you would be that we might actually be clearing the id table on world destruction already, so you will never find it there. it would probably be best to not even store the id and try to find later. just keep an entity reference. its the same size in memory

mossy spade
#

But if it were due to ID lookup being cleared, shouldn't that crash on any access attempt on IEntity (including the string cast), not only FindComponent?

torn bane
#

It means you should already only get null back and not even enter component find block. and the crashing depends. the memory might still be there where it was so some operations can still succeed on accident. anyway, i need a solid repro to investigate. but you may change you approach entirely too if you don't want to bother

mossy spade
torn bane
#

Well I would need a setup in which this happens and see how you got the id, what kind of entities they are, what their hierarchy is etc. just this alone does not allow me to repro.
Yes you can send me mod id and instructions if it happens reliably with whats on workshop right now. but ideally we do not want to download 50 gb of mod dependencies to try it out. so if you can isolate the issue into a small test mod and just share the source as zip on the ticket that is usually preferred.

mossy spade
torn bane
ocean kernel
#

Hope by arma 4 the engine is less fragile

desert escarp
# minor agate But i am myself more interested on why in this case there was no error <:PepeHmm...

Had this happen the other day

                                if (entitySource)
                                {
                                    for(int nComponent, componentCount = entitySource.GetComponentCount(); nComponent < componentCount; nComponent++)
                                    {
                                        IEntityComponentSource componentSource = entitySource.GetComponent(nComponent);
                                        if(componentSource.GetClassName().ToType().IsInherited(InventoryItemComponent))
                                        {
                                            BaseContainer attributesContainer = componentSource.GetObject("Attributes");
                                            if (attributesContainer)
                                            {
                                                BaseContainer itemDisplayNameContainer = attributesContainer.GetObject("ItemDisplayName");
                                                if (itemDisplayNameContainer)
                                                {
                                                    string name
                                                    itemDisplayNameContainer.Get("Name", name);

                                                    TextWidget.Cast(item.FindWidget("ArsenalItemText")).SetText(name);
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                }
#

String name didn't have a semi colon

#

IDE didn't have any errors and it worked just fine

#

Only reason I found it was a copilot review in our github

#

There should've been an error here right?

ocean kernel
#

huh

kind widget
desert escarp
#

It worked completely fine too which baffled me a little

torn bane
#

Because of new line, some of the code cases simply do not even look for the closing ; and just continue to read fine.

minor agate
#

From when ; was not a thing and it was bit more like C (As in language type).

#

WIll report. Probably some forgotten corner case

pliant ingot
bronze zinc
#

hey, am software developer but total reforger scripting noob here, trying to make a mod to do something on the server, but struggling to even get my mod to initialize/do anything.
From watching one of the bootcamp vids and from looking at how some other mods do things, It seems like the following should work, simplified to a hello world here for the sake of the example.
I can't for the life of me get this print statement to run though, am I missing something super obvious?

modded class SCR_BaseGameMode
{
    override void OnGameStart()
    {
        super.OnGameStart();
        Print("hello world");
    }
}

alternatively is there a better way for me to make the entrypoint to initialize my stuff?

pliant ingot
bronze zinc
# pliant ingot Did you compile it? And what world you start? > alternatively is there a better ...

Did you compile it?
got to the point where i even published it and loaded the mod on a dedicated server, console output on the server seems to indicate the mod was loaded. Tested with the default everon campaign and a custom wcs-based conflict mission on of the boys is working on.
Tried changing it to inherit ArmaReforgerScripted too, assuming that would make it mission agnostic, no luck there either

pliant ingot
bronze zinc
pliant ingot
#

then it's not compiled at all

#

scripts should be in scripts/<ModuleName> folders (modules you can find in project options, but for 99% cases its Game)

bronze zinc
#

thanks

#

been smacking my head against the table on this one for a solid hour kekw

sour marten
#

is class classname : classname the same as class classname extends classname ?

sour marten
#

thanks vlad

neon elbow
#

I've been wondering why the script creater makes both TAG_ExampleClass and TAG_Example. What's the difference between the two? And do we need both?

sleek moat
#

can you not have an IEntity array as an [Attribute()]? I have a very small amount (6) of map entities that I want to have in an array but didn't really want to have to "find" them every startup

pliant ingot
neon elbow
#

thanks

tawny lotus
#

Uh, this might be a dumb question but how to duplicate class variable/instance easily?

//I want another instance y where I copy the information from x
MapItem y = new MapItem();
y = x;
y.SetInfoText(...); //This will change (also) x```
torn bane
tawny lotus
desert escarp
#

Would a call later repeating on the client cause client sided replication stalling?

#

Or is that strictly an issue with the server

#

Having issues with mass disconnects mid session with stalling being the issue, happens like once or twice every 5 hour session and I'm pretty stumped. The only Call Laters we have left is on the client in a scripted widget.

sonic forum
#

Could the long delay be because I'm testing in Workbench?

Because, after exiting the trigger, OnDeactivate is called with quite a delay.

quiet drift
#

Hey, I noticed that if I use this:

override event bool HandleWeaponFire(CharacterInputContext pInputCtx, float pDt, int pCurrentCommandID)
{
super.HandleWeaponFire(pInputCtx, pDt, pCurrentCommandID);

it returns true as long as the character has a weapon in hand. I'm trying to find a vanilla event or method that I could use to update shared variables while the character is holding a weapon. Is HandleWeaponFire appropriate for this, or is there a more suitable method I should use?

quiet drift
#

I don't need to update the variables all the time anymore, but would still be good to know if in the future I can make use of HandleWeaponFire

unborn swan
#

does anyone know how i can edit the ability of the AI to see through disguised status? trying to help a friend run a server and cant seem to get the variables correct for one mission we want to do.

midnight talon
unborn swan
#

Would this be through the Game Master or through editing the server?

desert escarp
#

Is there any event that I can use to track how many times Replication.BumpMe() is called?

#

Or at least some server parameter to log replication stats

errant fog
#

How can i from IEntity find the faction of the entity? and how can i find the relation between two factions?

I have to se if the hit is friendly, im hooking into SCR_CharacterDamageManagerComponent.OnDamage

desert escarp
#

The entities have a FactionAffiliationComponent on them

#

Or something similar

#

Place a character down and look through the components on him to get the exact name of it

river imp
errant fog
river imp
#

Ohh nvm. You're specifically wanting "if hit"

errant fog
#

Yeah, i am trying to log when entity is hit, by what, who and if its a team hit.
I think it was just me using the FactionAffiliationComponent wrong.

midnight talon
#

Yeah for finding faction associated with an entity it'll be on the affiliation component, sometimes on prefabs with a hierarchy of entities the component will only be on the root entity of the prefab so you might have to traverse up some parents for some entities

#

For getting the relationship between factions check the faction manager, it has the config on which factions a faction considers friendly and IIRC had some kind of "is faction friendly?" check method which is probably what you're after

river imp
#

The faction manager doesn't have that information.

#

The faction it does

#

Get the "shooter" and check his faction against the owner of the components faction.

#
InstigatorFaction.IsFactionFriendly(OwnerFaction)
#

The faction manager doesn't even need to be touched

errant fog
river imp
errant fog
#

I guess that will just result in the weaponComponent from the instigator entity is null? I got that handled

#

So what i did is i used the UIInfo get name, but i think there is something off about the name.

river imp
#

The instigator isn't the weapon

#

It's the character using it.

errant fog
#

Yeah thats what i mean, i am looking at the instigator entity weaponcomponent

river imp
#

Characters don't have a WeaponComponent

errant fog
#

Okay, then to be exact i am looking at the CharacterWeaponManagerComponent on the instigator entity.
Then i use GetCurrentWeapon to get the BaseWeaponComponent.

What i am asking is where do i find the weapon name, if it is not in the UIInfo

river imp
#

from the weapons uinfo in its item attribute collection

errant fog
#

From the UIInfo.GetName() i get this: "#AR-Weapon_M16A2_Name"

But i think that seems weird?
I am looking for something like "M16A2", like it would be displayed in the arsenal.

midnight talon
river imp
river imp
midnight talon
#

Should usually probably be an arg passed direct to the method in most cases but I've had to get a faction from faction manager by its key in a few occasions

errant fog
river imp
#

You don't

pliant ingot
midnight talon
#

If you're just displaying it in UI the client should automatically substitute the #-prefixed strings with their translation for whatever language the player selected

river imp
midnight talon
#

Shouldn't need to statically translate yourself unless you're trying to format it for logs or some other output aside from the game client

river imp
#

I just hope he's not wanting to do a string comparison

midnight talon
#

If displaying it ingame you probably specifically don't want to statically translate it yourself as that will prevent it translating correctly for players of other languages

pliant ingot
errant fog
#

Well, i am using it for logging, 😉

errant fog
torpid sand
#

Hi guys I was making a custom component that controls lights and that's it more specifically lights for vehicles

I created a simple script that I want attach to my object but now I want redrences to the light entities and blink them via update call

I want si.iliar structure to baselightmanagwr

lime dew
#

Where can I find the magazine reload script ?

I want to make a script that keeps the empty magazines and puts them back into inventory or drop on the ground instead of deleting them.

torn bane
timid citrus
#

Probably on the weapon component or muzzle component

#

Or possibly on an animation event, but don't think so

ocean kernel
#

Animation event makes empty mag disappear

lime dew
#

So it is beyond my skill set.

Damn... oh well not a train smash.

timid citrus
tawny lotus
#

I have multiple mods open in WB. One of them defines #define MODNAME_IS_LOADED. Is this global? Should other mods see it?

tawny lotus
#

I have a setup where the SDRC_define.c defines #define MODNAME_IS_LOADED.
In the other mod (..DefNoDep), I have simple check #ifdef MODNAME_IS_LOADED.

Why does the ..DefNoDep mod (upper) not see the define from ..DefOneDep (lower)?

dire sinew
grim acorn
#

anyone know how to Add Garrison to an Interactive Entity via scripts or in the Workbench somehow?

tawny lotus
torpid sand
#

Guys if I have a variable in my script
Bool switch
In ADM_CustomClass

I want it to be switched on using in game ActionContext like open close behaviour

#

How to bind them together??

open pier
cerulean stag
#

Hello everyone, I’m reaching out because I’m looking for the script that manages the maximum number of constructions on a base. I would like to reduce the maximum number of constructions allowed on each base. Thank you.

fervent cedar
ocean needle
#

why would my extended tasks be failing to parent due to no task data? even though i do in fact, have the data

#

i in-fact did not haha

junior gazelle
#

Hey everyone! I am new to arma reforger and enfusion and am trying to get my bearings. I wanted to make a simple script mod that would reduce the weapon sway, but I have not had any luck. When I search the ArmaReforger scripts, I see a generated script that uses BaseWeaponAimModifier() and GetCharacterWeaponSway(). Does anyone have any advice on how I can create a script to modify the returned value from GetCharacterWeaponSway() when its invoked?

desert escarp
#

Trying to get a JSON from our web api but I can't quiet seem to make it work

CRF_APICallback cb = new CRF_APICallback;
RestContext ctx = g_Game.GetRestApi().GetContext("https://api.coalitiongroup.net/");        
ctx.GET(cb, "api/events/groups/eventname");
#

Is there anything I am doing wring?

#

OnSuccess does not fire neither does OnError

viscid fiber
#

Is there anyone in here who would like to do me about a script I want written and if its possible willing to pay fair price

viscid fiber
#

@coarse bane im not offering my work

midnight talon
#

You can pay for static assets like models, textures, sounds etc but not for stuff like scripting or workbench integration

viscid fiber
#

It wouldnt be work inside the workshop i can put in the workshop myself i just need the script written

coarse bane
#

scripts written in enfusion script language

#

🤔

viscid fiber
#

Show me where In Tos it says that then

#

Doubt anyone will help me for nothing lol

ocean needle
viscid fiber
#

Whats the best way to learn the script language then if im not able to get anyone to help

midnight talon
viscid fiber
#

Just the script language really cause im trying make a prospector mod, I can make 3d models as thats what im good at

hoary steeple
#

I've entered recursive land and I can't find a way to update an SCR_EditBoxComponent's text without triggering the OnConfirm event handler twice.

#

The menu opens and adds an onConfirm event handler.
The onConfirm event handler fires and then clears the text box. This is triggering the same event handler.

#

I tried finding the actual edit box and updating it directly but it still fires recursively..

hoary steeple
#

I also tried ConfirmValue("") to clear the text and it ran the onConfirm event handler, which makes sense.

#

Maybe SetValue("") isn't supposed to trigger onConfirm, but it is rn 😬

pliant ingot
abstract crescent
#

Hello. Any one known how to block clothes on player (do not allow change it)? Any ideas where search it in code or mods with similar mechanics?

abstract crescent
hoary steeple
#

Yeah there's a few mods in it. I'm using the wlib_EditBox but Idk if other mods are affecting it.

desert escarp
#

Trying to parse a JSON right now and I am stumped

This is returning false everytime from this line.

  SCR_JsonLoadContext ctx = new SCR_JsonLoadContext();
  if (!ctx.ImportFromString(jsonStr))
      return false;  

    m_Response = new CRF_Response();

    if (!ctx.ReadValue("", m_Response))
    {
        Print("JSON parse failed: ");
        return false;
    }
#

This is the JSON I am trying to parse

{"success":true,"missionName":"CCO #21 - Northern Flight","eventId":"b6086bd7-86c8-4df7-ac09-8016911fc84e","groups":[],"dateTime":"2025-11-08T18:00:00.000Z","message":"Groups retrieved successfully"}
#

class CRF_Response
{
    bool success;
    string missionName;
    string eventId;
    ref array<ref CRF_Faction> groups = {};
}
#

jsonStr is the right JSON

torn bane
torn bane
#

If you encounter issues, you can always turn on error logging for it in the diag menu under "Serialization". That will print you every detailed step and where it fails.

desert escarp
torn bane
#

In experimental it works fine. do not use json api struct, its not meant for your use cases

#

I would recommend you develop you mod on experimental, we changed a lot there for serialization

desert escarp
#

Will do, and it was actually the array in the struct causing it to fail to read for some reason

#

On 1.4

#

The minute I commented out the array it read just fine

torn bane
hoary steeple
# hoary steeple I've entered recursive land and I can't find a way to update an `SCR_EditBoxComp...

@abstract crescent Tried it out with a vanilla project. Still trying to recursively call the OnConfirm event handler..

OnMenuOpened where i add the event handler. i've confirmed the event handler insert is only called once

SCR_EditBoxComponent editBox = SCR_EditBoxComponent.GetEditBoxComponent(EDIT_BOX_COMPONENT, rootWidget);
if (editBox)
  editBox.m_OnConfirm.Insert(Confirm);
else
  Print("Edit Box not found", LogLevel.WARNING);



... and the event handler ...

protected void Confirm()
{
  Widget rootWidget = GetRootWidget();
  if (!rootWidget)
    return;

  SCR_EditBoxComponent editBox = SCR_EditBoxComponent.GetEditBoxComponent(EDIT_BOX_COMPONENT, rootWidget);
  if (!editBox) {
    Print("Edit Box not found", LogLevel.ERROR);
    return;
  }

  string msg = editBox.GetValue();
  PrintFormat("Edit Box: %1", msg);
        
  // clear the value after sending
  editBox.SetValue("");
}
abstract crescent
#

can u check callstack?

#

who makes Invoke for m_OnConfirm?

hoary steeple
#
SCRIPT       : Edit Box: hi
SCRIPT    (E): Virtual Machine Exception

Reason: ScriptInvoker: Recursive call of Invoke!

Class:      'SCR_EventHandlerComponent'
Function: 'Invoke'
Stack trace:
Scripts/Game/UI/Components/WidgetLibrary/SCR_EventHandlerComponent.c:52 Function OnChange
Scripts/Game/UI/Components/WidgetLibrary/SCR_EditBox/SCR_EditBoxComponent.c:353 Function SetEditBoxText
Scripts/Game/UI/Components/WidgetLibrary/SCR_EditBox/SCR_EditBoxComponent.c:512 Function SetValue
Scripts/Game/TAG_LayoutTutorialUI.c:92 Function Confirm
Scripts/Game/UI/Components/WidgetLibrary/SCR_EditBox/SCR_EditBoxComponent.c:318 Function OnConfirm
Scripts/Game/UI/Components/WidgetLibrary/SCR_EventHandlerComponent.c:52 Function OnChange
SCRIPT       : Edit Box: 
abstract crescent
#

hmm. its srange, line 52 is m_OnChangeFinal, but its OnChange in trace

hoary steeple
#

That's just the function name which is still OnChange

abstract crescent
#

can u try to use m_OnChangeFinal if u need cleanup test in end of texting. OnChange calls every time u change text, m_OnChangeFinal calls in end of text print, i think

hoary steeple
#

IDK how I would do that. Right now use m_OnConfirm to check when the enter key is pressed, and within that I use SetValue().

#

hah. i tried removing the m_onChanged event handlers and adding them back after setting the value. nope

abstract crescent
#

what do u have in line 92 ?
Scripts/Game/TAG_LayoutTutorialUI.c:92 Function Confirm

hoary steeple
#

I changed it since, but I'm pretty sure it's referring to this:

editBox.SetValue("");
#

If I don't set the value, it doesn't try to call the OnConfirm event handler recursively. But I'd like to clear the value at the end of the OnConfirm event handler..

pliant ingot
hoary steeple
#

It's a text entry box. Press enter -> send message -> clear for the next message.

pliant ingot
#

then just listen for confirm action, I think it will not be intercepted by edit

hoary steeple
#

I don't know what you mean by that.

#

As in don't add a OnConfirm event handler and listen for the confirm event some other way?

pliant ingot
#

each menu have action context assigned with it where you can specify actions, keys and etc

#

i don't remember how exactly it called

hoary steeple
#

Like where this adds the "MenuOpen" listeners etc. ?

inputManager.AddActionListener("MenuOpen", EActionTrigger.DOWN, Close);
pliant ingot
#

yes

hoary steeple
#

Do do you know what the confirm action is called or where i can find it?

pliant ingot
#

you can find it in actions list

hoary steeple
#

ooo thank you, i'll try that

pliant ingot
#

where you setup context for menu

#

also you can use chatcontext as example

#

it defines chatconfirm action same as dialogconfirm

hoary steeple
#

I setup the action by just adding it to a radio's actionmanagercomponent's additional actions property

#

i don't see anything about dialogconfirm

hoary steeple
#

Oh. I added it to chimeraMenus.conf. That part?

pliant ingot
#

yes, close to it is chimereInput or something similar conf

#

there are two sections - actions itself and contexts, which you can assign to menu in first config

hoary steeple
#

Adding ChatContext disables interaction with the menu

#

Oh it probably uses MenuContext

#

Eh, thought I was getting somewhere. Setting it to "DialogContext" enabled interaction again and it shows the DialogConfirm action but the event isn't firing when I added a listener for it..

hoary steeple
#

@pliant ingot by gosh I've gotten somewhere.. I have to press enter twice. It seems like it has to cycle focus from the text box to the menu itself before the second enter/confirm then triggers my "Confirm" event.

#

If only I could attach the action listener to the editbox itself..

pliant ingot
#

So you need to properly adjust your context

late locust
#

How does one convert a local rotation matrix to world? thonk

hoary steeple
tardy cipher
#

Trying to get Squad Leader markers on the map to work for my custom faction. I can see it works for vanilla factions, and I have tried to look into MapMarkerConfig and MapMarkerEntrySquadLeader, but I haven't managed to figure out just what I need to do - to make the squad leader markers appear for my custom faction. Anyone have a step guide or would be willing to guide me in the right direction? 🙂

restive island
tardy cipher
restive island
#

all based on potato-quality theory of course, I just got into modding so I may be off track

tardy cipher
#

I tried wrestling with ChatGPT about it cause I am at a loss for what causes it, but only made me more confused. The thing is, this happens for a total of 3 custom factions that are playing together. Meanwhile Vanilla and RHS factions work as intended. So I am assuming there is a silly and likely simple reason/fix for why it is not working for our factions at all.

#

We do use Predefined groups only, and then a set amount of predefined groups with our desired callsigns etc. Might that be the reason squad leader markers don't show up?

restive island
#

Do the other squad members get a marker, if so does it show on them?

tardy cipher
#

No, we do not have any mods that enable markers for squad members otherwise.

#

But squads in vanilla factions do.

torpid sand
#

i created a config class and it has a PointInfo m_pointInfo and Resource prefab2Spawn

i have another SystemClass which takes in Array of this config file to spawn prefab at specific posiiton my Array is not null but it says m_pointInfo is null even though i assigned it in ediotr with vector values ???

restive island
torpid sand
#

im trying to create something like BaseLightManager

so my config file has light prefab and point info
my LightManager will flicker lights

#

im only stuck on 1 place which is adding the light prefab
i dont want to spawn and child it i want somethign similiar to BaseLightManager as i said

river imp
#

What are you trying to do exactly? Make light bars for vehicles?

#

"I don't want to spawn and child it". If you're not wanting static lights then that's what you have to do.

#

I.E. if it a light for a vehicle, it has to be a child of the vehicle otherwise when the vehicle moves the light will be stationary

torpid sand
#

the reason for childing was to keep the hiearchy clean i thought maybe enfusion has some sort of slot systems to do this
as i mentioned the BaseLightManagerComponent just ask for SCR_LightSlots which is a config file and light spanws automatically and ther is no subchild

if its not possible to do it that way just let me know how to spawn it i have the resource path and PointInfo
in my LightManager onPostInit i want to spawn thats it for now

#

if you dont mind may i dm you so i can give you more detailed info

river imp
#

Why are you trying to spawn lights at runtime though?

#

Why aren't you using the slot manage and attaching your lights to the vehicle like base game?

#

Manager*

torpid sand
#

studying the mi8 prefab theres not slot for lights in SlotManagerComp

but Rather in BaseLightManagerComp
whihc takes A list of SCR_LightSlot and they store point info and prefab of light

But it doesent have the functionality i need

#

so i Made my own lightManager

river imp
#

Oof, did they switch wheeled vehicles to that set up too?

torpid sand
#

yea

#

i just want to know when we assign prefab over there in basemanagerslot the light is there
so i decided instead of ADM_LightSlot i use SCR_LightSlot but light not coming for me

i think theres some sort of Logic in the BaselihgtmManager to do this

river imp
#

Why's the "functionality that you need?"

#

Just blinking lights?

torpid sand
#

yea but in sequence
red wait white wait
repeat

#

im also plannign to release it as a core Airraft System so that other can use it as well

#

i mean not physics liek these small utilities for realsim based projects

#

and yea i can do the blinkign part but as i said how to get teh lights to show up idk

river imp
#

Use their light manager component and add your light to it. In a custom component get your light entity and handle the blinking

torpid sand
river imp
#

You're not

torpid sand
#

and secondly their functions are not very clear

#

and kind of limited

#

most of them are portected or private

#

it was my plan b btw but i was just hoping for a cleaner approach

river imp
#

The cleanest approach is use preexisting functionality

#

You can literally do what you're trying to do with a custom component and user action

torpid sand
#

ok ill try that if i cant figure out because i was really tryign to dig in and find out their implementation

river imp
torpid sand
#

the only issue is my workbench sometimes stop for long period of times while compilign scripts

restive island
#

This looks like Reforger 1.1 documentation, I'd check to see if there are any differences in Tools 1.6 Exp

midnight talon
#

Are there any plans to make PerceptionComponent scriptable? I want to change friend-enemy detection to be based on something other than faction so wanna override GetTargetsList or similar

crude trout
#

Whats the best way for me to get heightmap data from the currently loaded world? SCR_MapEntity.GetMapInstance().ElevationAt(Vector(6000, 0, 6000)) doesn't seem to work (always returns 0). I see that I can pull from GetGame().GetWorld().GetSurfaceY(6000, 6000) which works but there is no way to get X / Y size (either in meters or grids and cells). Apologies if there's some documentation out there that explains this but I'm just starting to transition to enfusion.

tawny lotus
tardy cipher
torpid sand
crude trout
tawny lotus
cerulean stag
#

Hello everyone, I’m reaching out because I’m looking for the script that manages the maximum number of constructions on a base. I would like to reduce the maximum number of constructions allowed on each base. Thank you.

torpid sand
#

guys how to reduce wokrbench graphics its killign my gpu

pliant ingot
desert escarp
#

If the server crashes do destructors still get called on it?

dire sinew
restive island
#

Is there a way for my mod to see if any of my other mods are running? Thinking of way to make my mods so modular that they enable more menu items only if modXYZ is installed, essentially so they can all be controlled from one menu

desert escarp
#

My current method was on the gamemode destructor writing all our data wed need to restart it

dire sinew
#

You should probably make backups from time to time.

dire sinew
restive island
#

Thanks, that makes my planning much easier that way

sinful oasis
#

Hi! Apologies for pinging you on this again. I've added your bandaid, and had a similar issue again, but no error logs this time: when selecting a faction, I can't create or select a group, and when I force myself in as a character, the group string is empty and broken. I've tried reloading scripts and even restarting my computer, but it just doesn't seem to refresh. Any clues? This randomly occured after adding a component to my SCR_Gamemode script, and even after removing it, the issue is not removed.

(attached screenshots of how it looks like atm)

sinful oasis
#

Did manage to get one line of error code, when I tried creating a new group.


Reason: NULL pointer to instance. Variable 'm_iGroupID'

Class:      'SCR_GroupSubMenuPlayerlist'
Function: 'UpdateGroups'
Stack trace:
scripts/Game/Groups/SCR_GroupSubMenuBase.c:91 Function UpdateGroups
scripts/Game/Groups/SCR_GroupSubMenuBase.c:91 Function OnUpdate```
#

**Looks like the above was the culprit after all! **For all those running into similar problems in the future, I fixed with with the following code snippet.

modded class SCR_GroupsManagerComponent
{
    //---
    override void OnPostInit(IEntity owner)
    {
        // Refresh singleton to avoid stale instance across Workbench play sessions
        s_Instance = this;
#ifdef WORKBENCH
        Print("[NCM][Groups] Refreshed SCR_GroupsManagerComponent.s_Instance", LogLevel.DEBUG);
#endif
        super.OnPostInit(owner);
    }


...```

That fixed the entire issue, without tears :'D thanks again JohnnyKerner though, since you provided the first solution it helped me find this one. Hopefully, that'll be the end of it...
random oracle
torn bane
sinful oasis
random oracle
# west prism Nope still no info

Im surprised to see no one talking about it or making a mod for it so I am wondering if it's impossible or the use case is so small no one has cared.

spark otter
#

and maybe middle mouse button to split a stack

vast flower
#

is there any way to check if helicopter rotor is intact? I guess I need somehow to get the bone and and check it's state?

random oracle
spark otter
open pier
#

Might have to look through the scripts a bit more but this seems like its the one that deals with moving stacks of items @west prism

random oracle
#

Im on my phone, but it looks like that is exactly what we need

polar patrol
undone patrol
midnight talon
# random oracle Im surprised to see no one talking about it or making a mod for it so I am wonde...

Tbh I have been surprised the Reforger inventory has sucked so bad and nobody has done anything about it yet either 😂

When (if) I get time for it I was planning on making an improved inventory mod that maintains a state of the "target" inventory and add ctrl/shift/alt click modifiers to transfer all/half/X quantity of a stack to the target inventory like how it usually works in MMOs and survival games, but if someone wants to beat me to it I'll be very happy 😂

#

Also if we could actually see the max capacity of containers in inventory instead of guessing which backpack is bigger would be super cool 😎

quiet drift
#

Hello
I spawn a magazine prefab and parent it to a slot info,
I tried with AddChild, also tried to spawn it directly parented using EntitySpawnParams, both works perfectly in SP but in MP it spawn at the good spot, but it stay there, not parented.
Is there a vanilla example of a replicated dynamic hierarchy ?

polar patrol
river imp
#

Oh, I personally don't care but, the moderators might.

polar patrol
polar patrol
river imp
#

No worries but, it's probably better to use english if you can.

#

I'd just rather not see you get "yelled at" for using your native language.

polar patrol
#

I understand that everything here is done to ensure that everyone understands each other

versed remnant
# polar patrol just make some interesting

Looking really nice !
What about adding a sound for every new letters to give a type writer machine effect ?
As for the #AR-Campaign string, translate the string first and then process it

#

WidgetManager.Translate

#

If you need examples for both, we made something similar (way more basic) for the mini campaign mission introductions

worldly pier
#

Do anyone know why my component won’t show inside world edit for my delivery script

torpid sand
#

why does it say my action getin is obstructed???

pliant ingot
midnight talon
midnight talon
# worldly pier What do you mean by that

look at the source code of any vanilla component. there will be another class with the same name but suffixed with Class and extending ScriptComponentClass or similar, I'm pretty sure you will need a matching one for your component for WB to register it as an available component

#

you can right-click any component in world editor and jump to its script definiton

#

If you still can't get it working, a pretty reliable way to do it is duplicate an existing vanilla script of a component attached to the same entity, delete/replace the contents of it and rename the classes. Doing it that way makes sure the file is in a correct location to be compiled (2. Vlad mentioned) and ensures you don't forget the "editor" component class at the top

worldly pier
#

So grab a arma script and just replace it with mine right

restive island
#

According to the Modding bootcamp video #2 on youtube you have to override it, like (non-correct example off my memory)-
modding myclassname : thingy { # Allows access to everything in the parent class "thingy"
override parent.thingy { # Overriding parent class "thingy"
super.thingy() # Inherit all of the parent class "thingy", else it'll overwrite the entire class
ThingToOverride { ... # What to override in the class "thingy"

open pier
# restive island According to the Modding bootcamp video #2 on youtube you have to override it, l...

Slight correction for your memory
You override methods/functions, not classes. Inherit or mod classes
and modding a class you have to use the name of what you're modding

modded class SCR_BaseGameMode : BaseGameMode
{
    override void OnPlayerConnected(int playerId)
    {
     super.OnPlayerConnected(playerId)

     Your code here
    }
}

or with your own class, inherit SCR_BaseGameMode

class GSE_BaseGameMode : SCR_BaseGameMode 
{
    override void OnPlayerConnected(int playerId)
    {
     super.OnPlayerConnected(playerId)

     Your code here
    }
}
sour marten
#

hej modders

i want to make an automatic door system

how can a do it

i found out that the normal doors only work with a generated script (DoorComponent.c)

how do i get the proto external vector GetDoorPivotPointWS(); pivot from my object ?

open pier
# sour marten hej modders i want to make an automatic door system how can a do it i found ...

On a door, look for the ActionsManagerComponent, then find SCR_DoorUserAction(pretty sure thats the name of it) under Additional Actions. That handles happens opening/closing a door, should be able to do something with that information to make a ScriptComponent that does something like a QueryEntitiesBySphere and check for anything that IsInherited(SCR_ChimeraCharacter). Which if there is a character in range, open the door., if no character is in range, close door if it is open

wooden cape
#

Has anyone managed to get the SCR_FactionDominanceTriggerEntity to configure correctly? I can never get OnActivate to fire correctly. I'm assuming it's config.

quiet drift
# minor agate The biggest issue is that it is there mostly for UI. For small calculations and ...

Hello, regarding the Callqueue(), all from a custom animations component like in bootcamp 10,
I'm ejecting an ammo rounds entity from the chamber of a weapon during the rack bolt event, It has physics and then when it hit the ground I would like to delete it, I should not use CallQueue to delete the entity after it hit the ground ? Do you have any solutions or I should use a particle effect and give up on the meshes coherence ? (different type of ammo)
Actually I already use CallQueue for an another weapon but I saw your conversations here so I try to fix my potential mistakes

#

I'm quite simple lol I should just delete it once the animation is finished 🤣

quiet drift
#

I just found out about garbage system, that's what I should use in my case right ?

sinful oasis
#

Hi all! Does anyone here know a bit more on drawing on the map using scripts? i.e, creating a circle size of X meters, depending on whatever the script wants? I've created a mobile assembly exclusion zone around military bases in Conflict, and wanted to add a circle representing the size of this. I've been able to leverage OnIconHovered to detect if the player is looking at the icon, but can't find any good way to draw a circle. Thoughts?

hoary steeple
#

I'm trying to configure a new chat channel but the name isn't showing in the chat panel. I added the ScriptedChatEntity, added a new channel, set the class of the channel to a newly created inherited class from BaseChatChannel , configured the new class to appear in the chat list for the player and send to players, but it still says "Send to <name>" instead of something like "Send to Special channel".

I tried to find a .conf or something with extra configurations but I couldn't find anything. When I check the GetName() method of the chat channel it is correctly showing "Special".

#

Does anyone have experience creating a new chat channel?

#

Oh snap, I found some .conf files in Configs/Chat

#

Hmm, I must still need to tell it to use the newly created chat channel .conf

hoary steeple
#

Well I found it. It's configured within the SCR_ChatPanel but requires a few overrides and I couldn't get it to use the .conf file but I was able to manually configure the same options within the component's settings. Progress!

river imp
hoary steeple
river imp
#
modded class SCR_ChatPanel : ScriptedWidgetComponent
{
    [Attribute()]
    ref SCR_ChatMessageStyle m_CustomChannelStyle;    
}
#

Then override VerifyChannelStyles and GetChannelStyle adding your style to the array and switch

elder wigeon
#

Good evening gents! I'm looking for any information on how I can make vanilla and modded armed vehicles spawn without ammo/rockets/missiles. If you know anything about it, please tag/ping/mention/dm me. Thank you in advance!

hoary steeple
river imp
hoary steeple
#

not having those click boxes on the side to choose it threw me off

restive island
#

Does enfusion maintain a public array of items built at bases (whether it was destroyed or still standing), or is that something I'd need to script out?

hallow moss
#

Hey, so im just trying to make a little script to change the stamina drain if you have an item attached on you, now i made the script but how do i attache it to the prefab

hearty oracle
#

Hey! I have a question: how do I actually run Unit Tests?

I'm new to this and wanted to learn the scripting ropes by writing a few unit tests, and also because my idea of a mod will require me to rewrite an algorithm implementation from C to Enfusion, so I'd have a good starting point to see if my idea is feasible.
But anyway, I found the documentation for writing tests here: https://community.bistudio.com/wikidata/external-data/arma-reforger/EnfusionScriptAPIPublic/group__ScriptTestingFramework.html but I cannot, for the life of me, find anywhere where it says how I am supposed to run them 🙁
And also, whenever I'm doing Ctrl+Shift+F and look for TestBase, the only files that are found are AutotestGrid, which seems to be something completely different and... TestingFramework.c

Am I doing something wrong or are there truly no unit tests anywhere?

ocean kernel
#

Just write code without bugs

hearty oracle
#

My code has always been without bugs, no need for testing there. I just want to test for the algorithm correctness, obviously!

restive island
#

username checks out 😄

static vale
#

What's the best way to get all buildings on the map without adding a register component to them?

midnight talon
static vale
midnight talon
#

if your concern is just always registering them would hog RAM, I think if you're just storing a pointer to entity or a string (rplid or something) it shouldn't be that bad. The game is already holding the data for every world building in memory, a few more bytes per building to register them shouldn't hurt too bad

pliant ingot
torn bane
remote oar
#

Does someone have some insight on how the faction enemies work in reforger? Does it work the same as arma 3 where if you are the same faction but your rating is >9,000 you are set as an enemy?

#

I’m assuming it’s not as straight shooting as addRating or joining a unit to a enemy to / friendly for group

#

I’m trying to replicate a FFA style where I can reliably track one’s score without having to hackily inverse the score. There’s definitely a similar behavior in reforger as attacking a certain number of friendlies has them shooting at you. Kinda like how your rating would drop for each blue on blue accident

#

And one last paragraph length question: since we’ve moved away from the client/server locality for the network replication would I need to communicate “rating” changes to all players or would a component allow for “automatic” replication? Not entirely sure how all that works or how it behaves yet

pliant ingot
remote oar
#

Hopefully there is a programmatic way of doing that no way im gonna hand that out

pliant ingot
remote oar
#

The workbench is extensible right I guess I could just make something to manage it for me. But wtf D:

#

Are there really no emitter based methods that I can use for event hooks?

#

I can’t complain about the docs compared to a2/a3 because those have had YEARS of maturing but I definitely gonna have to do some reading on all this.

remote oar
#

*Also a GH actions compatible bundler/compiler for scenarios would be pretty neat if possible 👍

abstract crescent
#

Hello. I have some question: how to properly delete entity? I try to use SCR_EntityHelper.DeleteEntityAndChildren, but entity is back after relogin and for new conections.

abstract crescent
pliant ingot
#

So for world editor - save info for new connections and delete on it

hearty oracle
# torn bane In 1.6 this should be all possible in workbench, we had it in an internal addon ...

Cool, thanks! I'll check it out. I understand that it's on Experimental, right?
Quick question: are these ( https://github.com/BohemiaInteractive/Arma-Reforger-Script-Diff-Experimental/blob/3a80862f88c8301d08a0f7edfc888650e0af7e33/scripts/Game/Tests/TestFramework/SCR_AutotestCaseBase.c#L11 ) set in stone already or is there still a chance to give some input about these methods before they are released from experimental? (because I understand that then changing the way these work will be unlikely)

torn bane
#

You can send us feedback via tracker with improvement ideas and we will have a look. for 1.6 this will not change, it will take many weeks to arrive even if we decided to change it today

hearty oracle
#

Because I've seen that jUnit was mentioned somewhere as basis for what you have. Don't know where, but I've seen it somewhere.
I come from a Python background where unittest and pytest are based on jUnit, so that's where I'm getting my testing knowlegde from, mostly.

What pains me with the current tests is that you have to do the assertion yourself, set the result yourself AND stop the test yourself (which is a lot of code for each separate assertion). The AssertTrue helper function linked above helps with that already, but I'd love it to be consistent with other testing frameworks, where failing an assertion automatically fails the test, so that you don't have to have an if and a return.

It would make much more sense for assert<Whatever> to internally throw a custom exception on failure and the harness to catch it, instead of relying on the test return value. Once the first assertion fails, there is little point in carrying on with the test anyway, and this would make the tests much simpler to write.

#

Is there a point in suggesting such a change via the tracker or does that look like too late for that?

torn bane
#

We do not have exceptions and return true false on the tests has a different meaning with async waiting for integration testing over multiple frames. but some ultility to set false if not matched can surely be added

#

Sadly we can not abort easily so you still need the if (!assert(x)) return; lines

scarlet iris
#

Is there any way to change how fast/slow a character walks or runs?

I was hoping I could find a script for it with some sort of speed multiplier but I can't find anything

hearty oracle
#

some ultility to set false if not matched can surely be added
I mean, that's precisely what assertTrue in SCR_AutotestCaseBase linked above is already doing (which is great 🙂 ).

We do not have exceptions and return true false on the tests has a different meaning with async waiting for integration testing over multiple frames
I'll take a peak at the code later, since all I can do while at work is look at what's on github.
The question is whether you have tests that actually do anything meaningful after failing the assertion. Because if you want to test a different thing after the first assertion has failed, then AFAIK you're supposed to create a different tests for that (especially since you're already failing the current test anyway).

As such, the runner could check for a true/false return value from those tests over multiple frames, but also run them in a try/catch TestAssertionFailed block that would assume a true was returned (because the test failed and the code raising the exception already set the test result)

#

Anyway, good to see that the unit test framework is being worked on 🙂

torn bane
#

As i said we have no exception handling in the language, and the return values are already used to determine if a test should continue to be checked next frame or not, so it is not possible to change it to return true/false early means success and stops the test. we would need to change behavior to stop attempting once a result has been set, that is perhaps a possiblity. either way you probably will never get the same behavior, names and flow as in other testing frameworks. we took inspiration but nothing is following any "standard", not that there would be one for testing. to many opinions, it starts with the naming pattern of them already

scarlet iris
hearty oracle
#

As i said we have no exception handling in the language
Oh I'm sorry, I completely missed that 🤦‍♂️

ocean kernel
#

Yet, hopefully

quiet drift
#

Hey, is it possible to retreive de reload animation tag id from the weapon animation component ? Without having to bind it ?
proto external bool IsAnimationTag(AnimationTagID animTagID); ~~I'm having a hard time understanding if the ID could just be the raw name of the tag "TagWeaponReload" ~~

coarse pine
#

But in script there is something dynamicspeed etc. that is used in damage manager for example to limit speed when leg is injured. Maybe check that one out

scarlet iris
hearty oracle
# ocean kernel Yet, hopefully

While I would love that feature to be added, I wouldn't hold my breath for that, since adding exceptions would be exceptionally 😏 hard, with all the winding and unwinding of the stack that's required, and all the time it already took to stabilize the current language (from what I've read 2 years ago).
However SQF had try/catch functionality 🤔 🤔 🤔 . Okay, crossing my fingers for that and hoping for the best.

Porting C/C++ code is sure going to be challenging, for now. C++ has exceptions so the control flow would have to be completely rewritten to account for that. C does not have exceptions... but sometimes heavily relies on gotos for memory management (if(failure) goto DeallocateAllAndExit;), and those we do not want here 😅

ocean kernel
#

You just cant use it yourself

#

The VM knows when it's going to throw an exception, so I don't see how it would be a lot of work

#

Similarly it could know when it enters a try catch, the same way it knows when it enters an if statement

#

Then an exception happens, and it knows it's inside a try catch

#

Extremely simplified lol

hearty oracle
#

Hmm... I dunno. What you're saying makes sense, but I seem to recall reading about exception handling somewhere and the article was making it look extremely complicated.

#

It was focusing on the DWARF format, though, so maybe it was not the exception handling mechanism that was hard but the format itself? (which would not be applicable here). The article was by Gynvael and was for the Programista magazine, so I don't know if it's available for free

quiet drift
#

Is this safe to use OnProcessAnimOutput to delete an entity once an animation tag is false ? OnProcessAnimOutput tick every frame as long as the weapon is in the hands of a character. I would need to do something like this

override protected bool OnProcessAnimOutput(IEntity owner, float ts)
{
if (m_SpawnedAmmoEntity)
{
if (!IsAnimationTag(m_iTagWeaponReload))
{
Cleanup();
}
}
return false;
}

indigo spruce
#

quick question about enforce script, is the syntax closer to C# or C++ in similarity?

neat valley
#

What's the statement if I want to get the player count of the faction for the in-game notification and active AI count in the different faction?

gloomy lynx
#

is there a vanilla radio that isnt a handheld that you can speak through?

#

like a entity i can place somewhere

midnight talon
spark otter
#

Conflict HQ tents have a static radio prefab. Im sure you could override it to add actual functionality to it. I used that to add an action for the character identity selection mod. Shows up in every cap point's hq tent.

rancid dove
#

hi, i get an error about "Missing Entity Class" when validating?

static vale
#

What's the way to get the actual map size on dedicated server. I want a way to dynamically get the map size. some maps have nothing at their cutoff edge but have skybox objects that increase world bounds

This returns is bigger then the actual map. Everon returns 14443.8 x 12900

GetGame().GetWorldEntity().GetWorldBounds(min, max);

This doesn't work on a dedicated server

SCR_MapEntity mapEntity = SCR_MapEntity.GetMapInstance();
Print("X: " + mapEntity.GetMapSizeX());
Print("Y: " + mapEntity.GetMapSizeY());

I see few searches say to do traces but, theres gotta be a better way? Reading config or somthing

fringe prairie
#

A lot of the map tools are only available on workbench, probably because of dangerous methods. Now map entity should work which is strange why it might not be

static vale
fringe prairie
torpid sand
#

why d oes workbench freezez sometimes?? hangs my whole computer i have to power it off by switch

static vale