#arma3_scripting

1 messages ยท Page 223 of 1

little raptor
#

no. action is not an animation.

#

it's a "group" of animations

#

and it can only be played with switchAction

spiral canyon
#

OK, so thats the answer I was looking for, switchAction is what I use then

#

If you want to get techincal, the Act_Accessing_Computer is the animation, the cut up versions are just that, cut up parts of the full animation

little raptor
#

actually it's not even an action. it's an action group

#

so you can't play it at all

spiral canyon
#

Then why do they even list it in the Wiki if you can't even use it?

little raptor
#

the wiki never said you can use it at all

spiral canyon
#

exactly, why even post it if it's unusable

little raptor
#

you can only play States

little raptor
#

these are what you can play

proven charm
#

how do you set the default key mappings properly for multi key press? Im trying ```
TestKeyBind2[] = { DIK_B + DIK_RCONTROL };

quaint ivy
#

Hey guys, is there an event that fires off on the client's machine when they disconnect? I want to save a mission variable to a player's profile right before they disconnect so that it can be recovered when they reconnect. Is there an event handler for this?

hallow mortar
#

Players can disconnect for a lot of reasons that don't give them an opportunity to do anything after that (e.g. game crashes). It might be safer to handle this on the server.

old owl
quaint ivy
old owl
tulip ridge
#

Still profileNamespace, just on server

quaint ivy
#

awesome, that makes things a lot simpler

#

thanks for the help

hushed turtle
#

That file(profileNamespace) must grow large over time on server

hallow mortar
#

You can use missionProfileNamespace to make it a bit more contained

old owl
#

Also not sure how necessary this is for server since we use SQL and rarely write to server profile- but I know every once in a while my client profiles will corrupt. Setting up a github repo to back up profile data is a bigbrain move I recommend

exotic flame
#

Is there a reason a control created with ctrlCreate cannot be deleted ?

#
        {
            type = 0;
            idc = 1;
            x = safeZoneX + safeZoneW * 0;
            y = safeZoneY + safeZoneH * 0;
            w = safeZoneW * 0.001;
            h = safeZoneH * 0.001;
            style = 0;
            text = "";
            colorBackground[] = {1,0,0,1};
            colorText[] = {1,1,1,1};
            font = "PuristaMedium";
            sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1);
            
        };```
#

Sometimes i can delete them and sometimes i cannot but i don't understand why

little raptor
exotic flame
little raptor
#

idk but I think it overrides the idc if you do that

#

you can try printing ctrlIDC _ctrl to check

#

so if you provide 0 the game uses the idc from the class, otherwise overrides it

exotic flame
#

The problem is some of them don't get deleted

little raptor
#

hmm no clue. try using 0 instead

#

but I also use duplicate negative IDCs in my ctrls and I have no issues (I also don't use the IDC)

exotic flame
#

I usually also spawn multiple of them without problems but this time i can't understand what's wrong

sharp grotto
#

If you use ctrDelete

#

"The control has to be created either by script with ctrlCreate or to have deletable property in config set to 1"

little raptor
#

the issue is this:

#

you should delete 0 8 times

exotic flame
#

Thank you very much i spent hours on it i didn't see it ^^

little raptor
#

actually we also have deleteRange

#

so use that instead

#

_ctrlList deleteRange [0,9]

exotic flame
#

oh nice

young mist
#

Whats a script I can use to make a body excluded from being deleted by garbage collection etc?

pallid palm
#

@sharp grotto where do you put this in the Description.ext ?

#

seems like it gos in the Description.ext but im not sure

sharp grotto
#

it's a script command, so no. you need to execute it after unit was created (most likely)

pallid palm
#

ah ok so in my enemy spawn script

sharp grotto
#

When looking at the description, one could think it might only be for units you added manually via addToRemainsCollector https://community.bistudio.com/wiki/addToRemainsCollector.
Description: Removes vehicles/units from the garbage collector, so they do not get deleted automatically; added earlier with addToRemainsCollector.

So you have to see if it works.

pallid palm
#

i see: so if i want to use this: i may just name a few soldiers and the kill them: so they remain there dead for it to seem real like ๐Ÿ™‚

#

but i will work on it to see what is working and all my options ๐Ÿ™‚

#

thx again m8

#
removeFromRemainsCollector [e1_1, e1_2, e1_3, helo2];
```  ๐Ÿ™‚
#

but most of the time i get rid of all dead enemy when the players are like 50m away form any dead enemy

#

but im kinda wondering: if i remove: all weapons and inventory from dead enemy: will the dead enemy still have a effect on fps

#

oh shit it does dam

#

cuz the game tracks the pos of the dead enemy ahh man ๐Ÿ™‚

sharp grotto
#

more objects always have an impact, even with the best optimization the game still needs to render them if they are in your viewpoint.

pallid palm
#

ahh i see

#

cool thx m8

#

most times i never go back to any objectives after they get cleared: so i guess ill just keep doing what iv been doing ๐Ÿ™‚

#

is deleting them after we leave

#

yeah i cant remember ever feeling any lag at all: and sometimes my friends in GER host my missions: and i'm in USA:

#

so i must be doing something right ๐Ÿ™‚

#

of couse im still learning all i can: woohoo Arma 3 hell yeah ๐Ÿ™‚

tulip karma
#

Is there currently a command or a particular way to determine which player is logged in as administrator (in multiplayer missions - on dedicated servers)

tulip karma
pallid palm
#

WooHoo i got it hell yeah: i just needed to wake up ๐Ÿ™‚

young mist
hushed turtle
#

You could use unit init field, but in that case I would do isServer check, since it's global command, no need to run it everywhere

young mist
#

Like this?

old owl
# young mist Like this?

I'm not familiar with that particular command but the wiki cites it as an array of objects
https://community.bistudio.com/wiki/removeFromRemainsCollector

So it should be:

removeFromRemainsCollector [DEADPILOT12];

Keep in mind though if you only intend to use the init field, you don't need to necessarily define a variable name for the pilot and you can just use this instead. For example:

removeFromRemainsCollector [this];
young mist
#

Okie dokes

#

Should I set all my triggers to server only by the way?

old owl
#

That kind of depends on what you're doing. Arma 3 is heavily client authoritative and in most cases there is a lot of performance benefit to doing things on the client. Without knowing more, I'd say you're generally better off running things on the client but also just sorta depends on what you're doing.

young mist
old owl
#

Looks neat :)

pallid palm
#

its a single player mission

young mist
#

Yeah primarily, but you can play it with 7 other people if you so choose since there are 8 slots for the 8 man section

#

Otherwise they are just AI controlled teammates

pallid palm
#

so of corse you would have to host it

young mist
#

So I should make the triggers server only then

#

Just the 7 other members of the 8 man team you lead who are controlled by AI if no live player occupies their slot

pallid palm
#

well i would make the triggers server only yes

young mist
#

Okie dokes

#

Better get busy haha

pallid palm
#

ofcorse like milo said it depends on lots of things: but i always make the triggers i need to run on the server: server only of corse

#

wow thats alot of stuff on the map wow

#

holy moly ๐Ÿ™‚

young mist
#

Yeah its a complex web of missions and functions.

#

I created a causalities mechanic where in you get a task added if a team member dies, you actually have to recover their body and bring it back to base.

pallid palm
#

nice lol

young mist
#

And a reinforcement system is set up to replenish the team if you lose too many

pallid palm
#

lol if we lose to many in my missions it a mission failure ๐Ÿ™‚

young mist
#

Oh yeah you get a failure on mine too if you lose the reinforcements lol

pallid palm
#

nice

young mist
#

Each of these triggers and task is associated with all team members lol, I call it the graveyard lol

pallid palm
#

i see

#

what kind of fps do you get in that mission

young mist
#

Simple trigger with a message, and the task is created upon activation.

#

Well im trying to improve it all the time. The adverage is 60, 50, or at worse 30

pallid palm
#

holy shit that trigger is way big wow

hushed turtle
young mist
#

Yeah needs to be so it still triggers no matter where they are on the map

pallid palm
#

well i would make a checking loop script: rether then have a trigger that big

hushed turtle
#

There is killed EH and that's correct solution

young mist
#

When I was first making the mission the FPS was horrendous. Then I started doing some optimisation trickery

#

I just did it that way because I had no idea about other methods lol

pallid palm
#

yes or like Jouklik said a Killed EH

#

man triggers that big are wow bad imho

young mist
#

I set up a bubble system to have big bases like this have ambient NPCS only active and visible when you are close enough to em

pallid palm
#

i ment for your team members killed EH

errant jasper
young mist
young mist
pallid palm
#

roger

#

lol i think i have like maybe 4 triggers on my maps

young mist
#

These two triggers govern the visibility of the NPCS and their sim. One controls visible, when controls invisible.

pallid palm
#

if any

young mist
#

I use them because I can understand visual representations more

pallid palm
#

yeah do it like that too i set the mission up then i fix all the stuff up to be better and better

old owl
# young mist Simple trigger with a message, and the task is created upon activation.

I will say too, generally less triggers you have the better. Each trigger:

  • Creates an object
  • Runs a condition it checks on an interval

Lots of little bits of code running all the time plus lots of objects being spawned at one time will heavily impact performance.

Mission Optimization:
https://community.bistudio.com/wiki/Mission_Optimisation

Object Performance:
https://community.bistudio.com/wiki/Arma_3:_Simple_Objects#Performance

If you're looking to increase client FPS your largest thing you're gonna wanna attack is the amount of objects created at a given time on a client, and how they are created. Anything that doesn't need simulation, physics or whatever; should be a simple object.

young mist
#

Oh yeah everything static on my map is not simulated

pallid palm
#

or spawn them in when needed

hushed turtle
young mist
#

Thats what my little system I described is for. Ill show you what it does just a sec

#

Thats a great mod called AI paths

#

Uses simple shapes to help AI navigate complex environments

pallid palm
#

oh my mods too oh my

young mist
#

So they dont get stuck or lost

old owl
#

Another thing you can do is only create objects when necessary. For example if there is a ton of objects you have created across the map that the player can't even see yet, that wouldn't be a bad use for an existing trigger in the area to handle. Handling the creating and deleting of the objects based on player location will allow you to control how many are created at a given time.

pallid palm
#

thats a roger milo i agree

young mist
#

Yee let me show you what my visibility bubble system does

mortal folio
#

Which i think hes already doing

old owl
mortal folio
#

True if you stretch the calls over time its less noticeable

old owl
#

In any case though I'd recommend createSimpleObject first over createVehicle if possible.

mortal folio
#

Also make it local

#

As much as plausible

errant jasper
#

Hopefully those 22000 are not mostly units of the same side. Gonna have weird group "autojoining" behavior if you hit the 144 group limit per side.

mortal folio
#

22000 units and the group limit is the least of your concern lmao

young mist
#

Only when the player is in the visibility bubble of this base are when the NPCS are visible and simulating. I do this for all locations and enemies zones so they are not always running if you are outside of their areas.

mortal folio
#

But im sure all 22000 is objects

old owl
#

Hahaha yeah no worries nothing like that. We are a life server so we actually don't really use any AI ever

mortal folio
#

Also @young mist remember to just use the server... if something can be done on the server and doesnt require local commands - run on server, you always wanna minimize sqf on clients

young mist
#

Yeah im currently setting all the triggers

pallid palm
#

i remember i used to cover the map with triggers too: but as i learned i had less and less triggers

young mist
#

This is one of muh big bases when the player is in the area vs outside of it.

mortal folio
#

Its ultimately down to preference, and if theyre mostly server triggers then youre fine

old owl
#

I would actually era towards setting stuff on the client first. I could be mistaken since like I said earlier we don't use any AI in mission but afaik AI that is not local to the player is processes handled on server:

https://community.bistudio.com/wiki/Multiplayer_Scripting#Locality_changes

I think it would be better to leave anything that can be on the client to the client so server can be used to handle network and AI overhead. Again though I could be mistaken as we don't use AI in our mission.

mortal folio
pallid palm
#

milo is your missions all player base missions

mortal folio
#

Like i had to crank ai counts up to 400+ (all fighting simultaneously and with a dozen or so players) before my server went slightly below the default 47 fps, granted im running a 13900kf for a server so its not a fair comparison to some hosting, but if youre not doing excessive things youre fine

It was a minimal modset and in an open field in my case tho so you have to account for... a lot of things with ai.

pallid palm
#

in other words PVP

old owl
pallid palm
#

i find it way easyer to make PVP missions

#

so ofcorse i dont make PVP missions ๐Ÿ™‚

#

well sometimes i do

pallid palm
old owl
#

We will generally peak at 130 players so a lot of our struggles in anti-cheat and server and network performance.

#

Well

pallid palm
#

i see nice

mortal folio
old owl
#

Honestly a lot of what we are doing is actually really just making new content. When it comes to PITA problems though, usually it's the previous.

pallid palm
#

roger that

young mist
#

I found a cool script I uses in my missions that ties trigger volumes to moving objects or people.

#

Use it for missions where ya have to chase peeps and stuff

pallid palm
#

i love shooting Ai on expert settings with my enemy Ai skill ajustment ๐Ÿ™‚

#

them Ai do some Amazing stuff lol ๐Ÿ™‚

#

i disableFatigue on all my enemy Ai as well so they run fast as hell lol

#

and they have unlimited reloads too ๐Ÿ™‚

#

so thay never run out of ammo ๐Ÿ™‚

#

talk about a fire fight ๐Ÿ™‚

young mist
#

where should I ask about "printing" my base objects on the 2D map of my scenario?

drowsy geyser
#

Printing?

young mist
#

Like ive made a base on a existing map but having visually represented on the 2D map

drowsy geyser
#

I guess you should use markers? They appear on the map

pallid palm
#

i think he may mean putting a pic on a white board maybe

#

but im not sure

drowsy geyser
#

I think he wants to make a base he created in editor visible in game on the map and that possible if you use markers

proven charm
#

or bake it in the actual map control itself. not sure if thats possible

cobalt path
#

Is it possible to play wind sounds on repeat? I am trying to simulate a snowstorm, and default wind seems to be a bit silent.
I found wind audio files ingame (Even tho they sounds more like static).
Is it possible to do PlaySound with file path instead of classname? And also adjust PlaySound volume?

hallow mortar
#

playSound can only use CfgSounds classnames, not file paths. But you can just define a CfgSounds class for this file (in description.ext if you're making a mission) and use that.
You can't adjust the volume in playSound itself, but the CfgSounds class includes a volume parameter.

#

Also check the existing CfgSounds in game to see if BI already did that part

grave belfry
#

Hey guys. How do I read out if a vehicle (specifically: a helicopter) is spinning up/down its engine? isEngineOn immediately gives off false while the thing is still noisy and rotors are spinning...

silent cargo
#

Otherwise I dont know of anything that would return rotor RPM etc

#

What are you trying to do?

hushed turtle
#

I think he wants to know when rotor stops rotating

silent cargo
#

Well yeah, but what's the end goal, like.. what is he trying to incorporate that with aside from just checking rotor speed

#

Could be alternative methods depending on the outcome he seeks

grave belfry
#

It's a resupply feature. Helicopters get resupplied after landing, but only when it's "safe" for engineers to approach. Just an aesthetic thing...

grave belfry
sly cape
grave belfry
#

Yeah, that's maybe what's left for me to do. I can hear the sticklers, already, though. ๐Ÿ˜„

granite sky
#

In theory I guess there's an animation phase for it somewhere? Might not be the same for every heli though.

silent cargo
grave belfry
grave belfry
# granite sky In theory I guess there's an animation phase for it somewhere? Might not be the ...

Welp, it looks like this now. Thanks for the suggestion.

private _animationNames = ["rotor_1","hrotor","vrotor","mainrotor1"];
private _animationIndex = _animationNames findIf { _x in animationNames _vehicle };
private _ready = if (_animationIndex isEqualTo -1) then {
    WARNING_1("No suitable animation source found, skipping animation check for %1.",typeOf _vehicle);
    true;
} else {
    private _animationPhase = _animationNames select _animationIndex;
    TRACE_1(QFUNC(doAirVehicleResupply),_animationPhase);

    _to = diag_tickTime + 120;

    waitUntil {
        private _state = _vehicle animationPhase _animationPhase;
        sleep 1;
        (isNull _vehicle) || { !alive _vehicle } || { diag_tickTime > _to } ||
        { _state isEqualTo (_vehicle animationPhase _animationPhase) };
    };

    !((isNull _vehicle) || { !alive _vehicle } || { diag_tickTime > _to });
};

Check which direction rotor is, well, rotated. Wait a second. Check again. If numbers are equal, we're either extremely lucky, or no more movement happened in that second.

That'll have to do.

granite sky
#

btw โจalive _vehicleโฉ also covers the isNull case.

grave belfry
#

nice

iron flax
#

You could play them using playSound3D.

playSound3D ["a3\data_f_curator\sound\cfgsounds\wind5.wss", player];

cosmic lichen
limpid cape
#

Is there a easier way to script dialogs for units/players and include the .ogg file? I'm looking for ways of doing text dialogue but also having it play a pre-recorded audio that says the line in-sync with the text on screen. I've been having issues with the guides out there as they aren't what im looking for. Im hoping for help to make this easier as well as make it a repeatable script that allows me to use it over and over for in depth and long conversations. I'm hoping to find a way

winter rose
limpid cape
proven charm
#

addAction has bug when you have one action and add another and then remove the first one the whole action menu closes even it still has one item

winter rose
#

so it's removeAction that has an issue ๐Ÿ˜„

proven charm
#

oh i forgot to tell im using the action condition to hide it and get same result (as if it were deleted)

young mist
hushed turtle
#

I don't think trigger area size matters, but rather, if it has area or not

errant jasper
#

I would assume trigger area size matters if the configured conditions depend on it. My assumption would be that if you have say:

  • OPFOR PRESENT: then the engine would have to query the area to populate this and thisList.
  • But if the type is NONE: then I would hope it does not matter.
#

So I think the "area" itself is low cost, but a larger area is bound to have more entities to filter and that has a cost.

cosmic lichen
#

It doesn't matter if there is no condition that uses it

young mist
#

The larget triggers I have are ones tried to individuals, so if they die anywhere on the map etc

hushed turtle
#

That's killed EH id for

remote cobalt
#

Hey folks, maybe someone can help me with the locality of Event Handlers. I don't have a problem, just want to understand how they work.

There seem to be some Event Handlers that are triggered globally (in my example Fired Near). This seems to work globally. For my understanding, I would only need to add this on the server to an AI Unit and it would fire once on the server.

The question is, what is with local event handlers like "killed". In the description on the wiki it says that its local. Would this mean I would have to add the Event Handler on every machine in Multiplayer? Or is adding it on the server enough?

For what I want to do, it would be enough if the Event Handler would be triggered on the Server if the unit is killed, but I am confused if it would be triggered anyhow when a player in a Multiplayer game on a server would kill the unit.

young mist
hushed turtle
#

Local means it fires only where killed unit is local

#

Global will fire regardless of object locality

young mist
#

How would I write that in this trigger?

hushed turtle
#

I wouldn't use trigger at all for this

remote cobalt
hushed turtle
#

You need to add where unit is local

young mist
#

I have no idea how to do this without a trigger though and I dont wanna have to rebuild the entire system I set up lol

hushed turtle
#

Maybe there is global version of killed EH? Don't know

hushed turtle
young mist
#

Singleplayer and optional coop

errant jasper
#

Well you marked the screenshot above server only, so that hint will at most be seen by one player, possibly zero on a dedicated host.

winter rose
#

we lost-a our medic!" ๐ŸคŒ ๐Ÿ‡ฎ๐Ÿ‡น ๐Ÿ˜„

hushed turtle
still forum
#

Note a string with '' so the macros are still resolved

young mist
hushed turtle
#

If you just want to print something when unit dies...

young mist
#

Its not just for a hint

#

Its also tied to a tasking setup

errant jasper
#

Can someone explain to me how MP event handler's "safeguard" avoid duplicate handlers? Would seem to me the only way to handle that internally would be to serialize the entire handler code and compare?

hushed turtle
#

If this is not present in condition, then it won't use area or any other stuff set in trigger

young mist
#

Yeah but where are the tasks gonna be linked? Dont they need a trigger to be created

hushed turtle
#

You have something linked to the trigger?

young mist
#

Yeah again I have to show you first

#

@hushed turtle Every man in the team has a trigger that is responsible for detecting their death. If the trigger is activated by said death a task synced to the trigger will activate.

#

So all I wanna know is how to make the changes ya suggesting without breaking the system ive built lol

#

Otherwise im gonna be confused lol

#

Okay so what do you want me to do to them?

hushed turtle
#

You would have to create the task from EH too

young mist
#

So all their triggers 0 in size and height, thats it?

#

And its still gonna work like this?

#

Okay thats fine then lol

#

I was just afraid of breaking things lol

#

So any trigger with the !Alive checker should be like this?

#

Alright

#

Even these? Or is this so small it wont matter in this case?

#

Yeah sorry its hard for me to keep track of everyone talking sometimes lol

hushed turtle
young mist
#

Ill consider doing this at some point, it will take a lot of work so ill leave it for now.

#

Will have to start unsyncing and rebuilding things and gahhhhhhhhh

hushed turtle
#

You try one and see

young mist
#

I will at some point haha

#

Still trying to get some of my bodies not to dissapear lol

faint burrow
#

@young mist , if your triggers don't check for presence of objects in their area, then there is no point in specifying their size.

errant jasper
#

See @hushed turtle already posted something similar while I was cooking.

Next time I would handle this more central instead of tons of triggers, but that is my preference. Something like:


// In some mission helper file
MIS_fnc_BodyRecover = {
    params ["_unit", "_missionId", "_unitDesc", "_recoverDescription"];
    private _name = name _unit,
    waitUntil {sleep 20; not alive _unit};

    // Message (todo: MP)
    hint format ["%1 is dead. We've lost our %2", _name, _unitDesc];

    // Create mission
    // todo (for all players)
    private _task = player createSimpleTask ["_missionId"];
    _task setSimpleTaskDestination (getPos _unit);
    private _longDesc = _recoverDescription;
    private _shortDesc = format ["Recover %1", _name];
    private _hudDesc = _shortDesc;

    _task setSimpleTaskDescription [_longDesc, _shortDesc, _hudDesc];

    waitUntil {sleep 20; isNull _unit or _unit inArea RECOVERY_ZONE};

    if (isNull _unit) {
        _task setTaskState "Failed";
    } else {
        _task setTaskState "Succeeded";
        player addScore 500;
    };
};

// In some mission-specific initialization file
[
    MILLER,"KIATEAM1", "section medic", 'Your section medic, "Miller", has been killed in action!... Recover his body and return it to FOB endurance'
] spawn MIS_fnc_BodyRecover;

[
    SPONGEBOG, "KIASPONGEBOB", "spongey bob", 'Your underwater Bob has been killed in action. Recover his body and return to FOB endurance'
] spawn MIS_fnc_BodyRecover;
young mist
#

They need to be present at all times since they are ambient dead or task related.

#

So I have these two dead pilots that need to be removed from an area for a task. I put in a script that is supposed to stop them being deleted but they are still being deleted lol

#

When I say need to be removed (The task requires them needing to be dragged away from my little crashsite here)

#

So I need them not to be deleted lol

hushed turtle
#

I guess they get removed by some other script

young mist
#

How can I make sure this does not happen?

#

Geuss its something to do with this?

hushed turtle
#

Yeah, allDeadMen

young mist
#

Can I add something in there to make sure it excludes them?

hushed turtle
#

So they are hidden not removed?

young mist
#

Yeah to make sure they are not deleted outright

#

Which is the issue im having

faint burrow
#

allDeadMen - [DEADPILOT11]

young mist
#

Ill give this a go

errant jasper
#

Well above would always prune dead pilots?

#

*in 10 minutes.

#

Sure, but a low value they will not get to them in time. A high value means it is as if it was not used at all.

young mist
#

Ill try schatten's solution first and see if that works

#

Just to make sure ive typed it correctly

#

lol happy birthday

faint burrow
young mist
#

okie dokes

#

thanks

#

Yeah quite a few to set

#

Oh alrighty ill do that in future then

still forum
errant jasper
# still forum I cannot see that such a safeguard even exists.

Damn. The BIKI even seems confident. MPKilled:

EH can be added on any machine and EH code will trigger globally on every connected client and server. This EH has a safeguard measure so that even if it's added on all clients or a single client that is then disconnected, EH will still trigger globally only once per client
Do we need to update it?

#

The first part, propagation where only a single machine adds it but all gets it I can easily understand how might be implemented. But the "deduplication safeguard"....

still forum
#

How it works.

The EH is added locally to the array.
Then the whole array of all handlers (for that event type) is sent over network to all clients.
And the clients completely delete their array, and overwrite it with the one that came from network

#

If all clients add the EH at the same time, you'll get a race condition where they overwrite eachother and only one add remains

#

Maybe thats the "safeguard"

#

I cannot see anything else.
The script command doesn't have any duplicate checks, it just appends and sends a whole copy over network.
The network receiver also doesn't have any checks, it just applies the whole array it got

#

Serverside only does battleye filter check.
JIP queue also just applies the whole array it gets

errant jasper
#
  • Okay, so if client A adds it twice there will be two instances for all machines?
  • If client A adds it, then client B joins later and also adds it there will also end up being two for alll machines (or possibly only one for B) ?
#

Because the BIKI description implies neither of above (race conditions exempt)

still forum
#

Yes.
It depends on whether B adds it, before he receives JIP queue, or after. But scripts should generally only run after, so you'll end up with B receiving the current list, adding their's on top, and sending that to everyone else. So two handlers.

#

Wait what the hell am I seeing rn

#

Ah respawn

#

On respawn, all arrays are sent out again. Which I guess is fine

errant jasper
#

Event adding behavior is same for all 3 MP events?

still forum
#

Executing the handlers doesn't have any checks either.
Yes same for all

#

Might be worth investigating where that comment came from.
Maybe its valid for some older game? But I don't know why that would be removed from newer ones

valid dust
#

do anyone know how i can fix this it keeps braking
Scripts/Game/Whitelist System/TD_WhiteListedComponet.c(47): No return statement in function returning non-void 'RoleWhitelistManager.HasRole'

hushed turtle
#

I thought EHs get created only on machine when you manually added them

still forum
errant jasper
#

If you are referring to my convo with Dedmen that is about addMPEventhandlers.

#

Global object event handler, executed on every connected machine.

valid dust
hushed turtle
#

Had no idea that existed meowsweats

errant jasper
#

That runs locally for the machine that adds them.

old owl
#

Happy birthday ๐Ÿ™‚๐ŸŽ‚!!!

old owl
# young mist And its still gonna work like this?

This is in no way me taking a bite out of you but would like to say something bluntly. You will have a much easier time accomplishing tasks you want to perform if you era towards using better systems like event handlers for tasks like !alive MILLER. You'll also be significantly increasing performance of your mission as every new trick you'll learn will be a method you can cut down on triggers, which are also objects and constantly running condition code running on the client (or server). I know that was something you cited you wanted to improve, which is a good mindset to have ๐Ÿ™‚

Although there are plenty of resources available, here is a playlist which should give you bearings on scripting in a mission which I've also heard positive things about: https://www.youtube.com/watch?v=nY13PX-nUP0&list=PLnHeglBaPYu_uYy_VAov71-Y3_Aonff0i&index=1

#

Event handlers appears to be the second video in that playlist, and will arm you with a pretty large method of reducing your overall trigger use which will contribute to optimizing your mission catnod

young mist
#

I rather stick to triggers in my case because of time and so on.

old owl
#

I do understand what you're saying, but performance aside, what I am also trying to say is you're probably creating more time for yourself by not taking the time to learn. Adding code to a pre-existing killed event handler for your units would likely be much quicker than creating triggers with duplicate code for each of your units. Plus you're also inherently learning how to do more which otherwise might not be super feasible to run from a trigger.

Again not trying to take a bite out of you. Your workshop content you sent the other day looked cool. Just trying to help, as I think if you give it a shot, you'll really appreciate the difference. The learning is an investment.

young mist
#

Yeah I get it I just dont have the time, and its a lot of information to take in

#

I gotta study art lol this is something I like to do but art requires a lot from me.

#

Again it's just the time and focus

#

It's overwhelming lol so I try to limit myself to simple scripts I can easily remember and put in a volume.

#

My mind is visual

#

Yeah definitely don't have the time to do all of that haha

#

Yeebus

old owl
young mist
#

I mean a good way for me to learn is by interactive examples. If you have a mission you made and I can study it in a editor myself I'll be a lot easier for me.

#

I can actually see how it works in realtime

#

Yeah that would be cool

#

If you want I can also give you my mission file and ya can fiddle with it too and I can see what ya changed.

#

Alrighty, later today.

#

Got people installing a heat pump in my house lol

#

Pffff

short anchor
young mist
#

I invest that all in art at the moment lol

errant jasper
#

Guys telling him 15 times to learn at his own pace is not letting him learn at his own pace. I think he gets it

short anchor
#

As long as there's learning, it doesn't matter what the pace is. I don't think anybody's suggesting compressing the learning to any particular pace. It could be days, weeks or months

young mist
#

I'm been on and off my missions for 2 or 3 years haha

#

They started off pretty terrible

#

I started with arma 2 in 2020, migrated to 3 in 2021-2 being learning on and off the whole time

young mist
#

Thanks I'll give this a good look

#

https://youtu.be/W2Af6e0n7fQ?si=HRaQSr8RGh77PWpR I started off learning the editor with this short vid lol

Download the mission script at http://www.arma2.com/latest-news/editor-tutorial-video-released_en.html

Learn more at http://arma2.com/
Buy now http://sprocketidea.com/

Next up in the series of video updates introducing the unique features of the Arma 2 franchise, we present a two-part tutorial demonstrating Arma 2's powerful and easy to u...

โ–ถ Play video
short anchor
#

Anybody that says they don't remember OFP oughta be shamed publicly and banned

young mist
#

Think that vid came out when BAF dlc came out for arma 2 in 2011 or 10

young mist
#

I could not even run a arma game till 2020 lol

#

Because my computer was shiiiit

hushed turtle
#

OFP is from 2001

#

It would run fine even on shit PC these days

#

I still have my campign saves back from 2010

young mist
#

Have not played that one yet, did play the codemasters developed Operation Flashpoint Dragon rising

#

Curious what are all your average Arma 3 framerates when the game is at it's most busy?

fair drum
#

Vs vanilla, that completely depends on how many mods, and how many of them are poorly written.

young mist
#

I see, so whats it like for modded vs unmodded for you?

fair drum
#

There's too many variables. It also depends on how many objects are in the mission, how many groups exist, how many AI ray casts there are, view distance etc. You really can "customize" the amount of fps you can get.

errant jasper
#

Yeah 10 AIs in combat takes more than 30 idle takes way more than empty mission.

Then there is also whether it is MP or not. Easier to get good render fps if another machine (the server) is doing most of the work

young mist
#

I mission I made has about 6 helicopters, and 8 tanks and about 20 infantry. When things get really explosive and busy its 30 or 40 I think for me

#

I finding more trickery to increase it though bit by bit

rapid vortex
#

I'm in search of a scripted solution for friendly fire on unoccupied vehicles. This is for a PVE noob friendly server with a lot of CAS who often forget to confirm targets before firing.

I'm wondering if it's possible to use the confirmSensorTarget function to make unoccupied vehicles appear friendly on sensors. Based on the wiki page I assume no, but if someone could confirm that for me I would appreciate it.

winter rose
hushed turtle
#

True

#

Need to be modest with view distance, just like A3 Lou

errant jasper
#

I mean original Everon was what 9km on the diagonal? Nowadays I might run with 5+km view range as infantry.

#

*in Arma 3

#

Of course if server runs with 2km I might not get proper updates on movement in the distance but the terrain is still rendered.

cobalt path
cobalt path
full swan
#

Hi all, so I've made a tool for my game streaming sessions, so my streams get more visual content (especially when I die and wait for medic).. I'll be releasing it soon to workshop, but I would like to hear some thoughts and ideas I could add into it. I still feel like it's just a niche thing, usable only by me, so I would like to open it up with features so more people would find it interesting ๐Ÿ™‚

https://youtu.be/1l6BwK5uCvo?si=zhsAr03Cf6kmnJET

FF_SPECT is an advanced, production-grade spectator camera system that replaces Arma 3's default spectator with a feature-rich cinematic experience. It's designed for mission makers, streamers, admins, and event organizers who need professional-quality camera control during gameplay and replays.

โ–ถ Play video
iron flax
# cobalt path Issue with that, is that once I play it, it starts playing it at the location wh...

You could also try playSound, I think you would have to create a description file for it, but I assume it would work.

As far as the wind sounds, you can check here for the ingame wind sounds.

https://community.bistudio.com/wiki/Arma_3:_Sound_Files

Here are just a few that I found with a quick search.

"a3\sounds_f_enoch\assets\environment\backgrounds\wind\wind_filler_heavy_01.wss"
"a3\sounds_f_enoch\assets\environment\backgrounds\wind\wind_filler_heavy_02.wss"
"a3\sounds_f_enoch\assets\environment\backgrounds\wind\wind_forest_heavy.wss"
"a3\sounds_f_enoch\assets\environment\backgrounds\wind\wind_meadows_heavy.wss"
"a3\sounds_f_enoch\assets\environment\backgrounds\wind\wind_meadows_light.wss"
"a3\sounds_f_enoch\assets\environment\backgrounds\wind\wind_meadows_medium.wss"
"a3\sounds_f_enoch\assets\environment\backgrounds\wind\wind_silence_day_01.wss"
"a3\sounds_f_enoch\assets\environment\backgrounds\wind\wind_silence_night_01.wss"

stable dune
#

And always you can create a new sound that uses the xx sound path and add more volume, distance etc.

iron flax
little eagle
#

allGroups is not properly MP sync'ed
Why am I not surprised

shut flower
#

@tough abyss I did a group cleanup on server and clients too

#

Is there any possibility to get the weapon attachments of a weaponholder?

little eagle
#

no
also: a weapon holder can have multiple weapons

#

There is a undocumented weaponAccessoriesCargo command that probably would do that. At least in dev. It requires some more undocumented ids as input though.

shut flower
#

Ok, got it. WeaponsItems works for it.

#

Yeah sure, there can be multiple weapons in it. I'm iterating threw the result.

little eagle
#

WeaponsItems
This returns attachments on weapons too?

shut flower
#

Got this result: [["arifle_MX_ACO_pointer_F","","acc_pointer_IR","optic_Aco",["30Rnd_65x39_caseless_mag",30],""]]

little eagle
#

cool

shut flower
#

Works since 1.21 if I can trust BIKI

little eagle
#

But this is for soldiers / vehicles and not weapon holders according to the doc

shut flower
#

Since Arma 3 v1.21.124406 it is possible to query weapon holders and ammo crates with this command.

little eagle
#

Oh. roger. neat

shut flower
#

Really good to know. Never thought this could be possible one day.

little eagle
#

So what would happen if you put weapons inside a vehicle?

shut flower
#

You would get such a result: ```[
[
"gatling_30mm",
"",
"",
"",
[
"250Rnd_30mm_HE_shells",
250
],
""
],
[
"missiles_SCALPEL",
"",
"",
"",
[
"8Rnd_LG_scalpel",
8
],
""
],
[
"rockets_Skyfire",
"",
"",
"",
[
"38Rnd_80mm_rockets",
38
],
""
]

little eagle
#

Yes, but what if I put an MX inside?

#

inside the cargo. This isn't really thought through.

shut flower
#

Wait, I will test it

#

Put my mx into a spawned hunter:
[["arifle_MX_F","","","",[],""],["arifle_MX_F","","","",[],""],["arifle_MX_ACO_pointer_F","","acc_pointer_IR","optic_Aco",["30Rnd_65x39_caseless_mag",30],""]]

#

You will have to use weaponItemsCargo for this

little eagle
#

_unit getHitPointDamage "hitHead" > 0.9

#

The unit might die from a big explosion or setDamage 1, in which case it will incorectly report true

silent cargo
# rapid vortex I'm in search of a scripted solution for friendly fire on unoccupied vehicles. T...

You could try scripting a neon green X or similar to appear over your cursor and make the script get the current cursor object and check if its friendly. Sometimes empty vehicles sides may vary so you could just set a specific variable to the "friendly" vehicles when they spawn, and have your code check the vehicles variable before deciding whether or not to make the X appear or not when you look at it while controlling a drone or turret. I wrote something similar a while back I just never finished it

tropic nimbus
#

For CfgModels theres a few entries for temp in thermals, mainly these

htMax = 1800;        // Maximum half-cooling time (in seconds)
afMax = 30;          // Maximum temperature in case the model is alive (in celsius)
mfMax = 0;           // Maximum temperature when the model is moving (in celsius)
mFact = 1;           // Metabolism factor - number from interval <0, 1> (0 - metabolism has no influence, 1 - metabolism has full influence (no other temperature source will be considered)).
tBody = 37;        // Metabolism temperature of the model (in celsius)```
is there anyway i can set these dynamically? im guessing no
still forum
#

No

fickle lava
#

Making a tunnel comp and does anyone know of a way to make the tunnel area dark when the rest of the map is in daytime.

hushed turtle
spiral canyon
# fickle lava Ah okay. Thanks

You could set the AI skill settings in that area to limit their detection distance to kinda match the setAperture if you want to make it fair for players

unreal scroll
#

What's happened with the rope physics? The created rope acts like it has a negative weight and wobbling like crazy. As I understand, it is supposed ropes should be used only for vertical cargo lifting? And how about towing?

granite sky
#

"happened"?

#

Are you implying that it changed at some point?

unreal scroll
#

@granite sky Yes. It is used in Advanced Towing and in ACE (towing system), both are used in my mod. Last time I checked it the ropes worked well - at least it wasn't "falling up".

granite sky
#

Last time I used a rope (like two days ago) it looked normal.

young mist
#

Whats the script for hiding objects and or Vehicles? I know Units but not how to hide and show Objects,Vehicles at will. They seem to require a different line

granite sky
#

looks normal to me. Ropes bounce around when they're laying on vehicles.

young mist
#

Trying to hide an IED until the player enters a zone

granite sky
#

It's just hideObject (or hideObjectGlobal executed on server, if you want to hide it for everyone).

#

Same as units.

young mist
#

Yeah ive tried it but for some reason its not applying their vehicles

#

I have to keep them visible and simulated

granite sky
#

Then your code is wrong :P

young mist
#

Just a sec

#

MILITIABMPUNIT is the one im having an issue with. While I can hide the occupants, the Vehicle itself I cant, unless im missing another line to the string

#

Does the Vehicle need its own variable etc?

faint burrow
#

You hid the units, but not the vehicles.

unreal scroll
#

@granite sky
"looks normal to me. Ropes bounce around when they're laying on vehicles."
Of course, but it flies to the roof automatically ๐Ÿ™‚

granite sky
#

yeah that too

#

Like if you carry a crate around, the rope jumps on top of it.

young mist
#

Yeah I can hide the units driving them, but the Vehicle is not hidden even though they own it which is what im trying to figure out

#

Does the Vehicle need to be given a variable and hidden separately from the men inside?

faint burrow
#

Not necessary, yes.

granite sky
#

It's a separate object so it needs to be hidden separately :/

young mist
#

Ah alrighty

granite sky
#

Slightly weirder one is that hiding the object doesn't hide the occupants, but hey, Arma.

young mist
#

Funny thing

#

Ill give the BMP its own variable name and add it to the script

#

Though will it still need "Units" at the beginning? Or something else.

#

Like (Units BMP1)

faint burrow
#

No.

spiral canyon
# young mist Funny thing

if the vic is occupied at start, then just name the vic (apc_1) and just add this hideObjectGlobal true; in the init box of the vic. Setup your trigger and set it to apc_1 hideObjectGlobal false. The fact the units are in the vic make them hidden.

young mist
#

Okie dokes ill give it a goes

spiral canyon
#

you might want to disable simulation on it too. objectName enableSimulation false then make it true when unhiding it.

young mist
#

Yeee already part of muh script

#

Seems to be working, just a few more tweaks

young mist
#

To be or not to be triggers hehe

spiral canyon
#

Glad I could help

errant iron
#

Is there some any documentation on how the in-engine scoreboard records kills? I'm loosely trying to mimic it in a stat tracker that persists to a database, and this is approximately what I have as a server-side handler: ```sqf
addMissionEventHandler ["EntityKilled", {
params ["_entity", "_source", "_instigator"];
if (isNull _source) exitWith {};
if (!isPlayer _instigator) exitWith {};
private _stat = switch (true) do {
case (_entity isKindOf "CAManBase"): {"kills"};
case (_entity isKindOf "Car"): {"kills_cars"};
case (_entity isKindOf "Tank"): {"kills_tanks"};
case (_entity isKindOf "Air"): {"kills_air"};
default {""};
};
private _friendly = side group _entity isEqualTo side group _instigator;
private _amount = [1, -1] select _friendly;
// Increment _stat for _instigator by _amount...
}];

I noticed the stats hasn't matched up with the scoreboard by a significant margin for at least one player. They sent a screenshot that showed 1334/78/63/11 kills in the scoreboard, but my database only recorded 1085/38/28/3. I don't mind it deviating a bit from the engine scoreboard, hence the simplified side check above\*, but my handler's missing out on ~250 infantry kills so I suspect *something* might be wrong.

There are other variables at play which I haven't ruled out yet (e.g. stats failing to submit), but for now, I'm just looking for any potential mistakes I did in this event handler. FWIW, majority of units killed are AI local to the server, and the player used a combination of artillery, UAVs, AI gunners, vehicles/aircraft, and small arms.
\*double checked BIS_fnc_sideIsFriendly's performance, actually isn't too bad at 0.004ms so i'll swap that in
errant iron
#

ooh found at least one potential cause for the inaccuracy, i forgot to add the road kill checks shown in the wiki example:
https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#EntityKilled sqf if (isNull _instigator) then { _instigator = UAVControl vehicle _killer select 0 }; // UAV/UGV player operated road kill if (isNull _instigator) then { _instigator = _killer }; // player driven vehicle road kill turns out that doesn't only cover roadkill as it seems other forms of indirect kills can leave the instigator null too, like dying to an exploding vehicle or from a collapsing building, and the latter does happen semi-frequently for my garrisoned units...

cursive tundra
#

hey i have a question regarding using time as a control measure for when units are supposed to be doing things in my script - say i want two squads to move to two positions, and when a certain amount of time has passed, they begin to move onto an objective
what would i best use here? time? serverTime? time seems to be client based and may or may not be in sync with serverTime, so i should prob use server time - but will this continue to tick up if i paused the game in SP?

#

i do want the mission to be playable in MP, but also in SP, where one might want to be able to pause the game too

#

server time seems to increase when paused however - so how do i solve this?

#

date would be an option maybe, if i accounted for sped up time factor in my calculation, as long as noone messes with time in zeus?

granite sky
#

Just use โจtimeโฉ. It doesn't matter whether it's the same as serverTime.

#

as long as it goes up at the right speed.

#

CBA_missionTime is an attempt to deal with this for neurotic people and causes that bug where ACE progress bars go at half speed when your server's been up for a couple of days :P

cursive tundra
#

okay i shall use time and note down for myself that any and all issues arising from this decision are the fault of John Jordan from Arma3s server

#

thank u tho

granite sky
#

Just don't send time values between machines and you're good.

#

If you think you need to do that then you're probably doing it wrong :P

dusk gust
#

Does anyone know if โจCfgCloudletsโฉ can be overridden by missionConfigFile?
Ex. I want to override a parameter of โจSmokeShellWhiteโฉ inside โจCfgCloudletsโฉ with the missionConfigFile

warm hedge
#

No

cursive tundra
#

also far easier than syncing 10.000 waypoints or something

#

so basically im just wanting the script to get time, add value x to it and when time is time + x, execute another script

#

or the next part of the script or whatever else

cursive tundra
#

btw is there a way to reliably select a certain ammo type from a tanks magazines? like if i want to fire an HE round from a modded tank, say from RHS, is there a way to filter out HE rounds automatically or do i have to figure them out using the cfg and then feed into "fireAtTarget" for example

sly cape
meager granite
#

Also cache result in hashmap

meager granite
#
  1. Complex: Check hit and indirectHit of the warhead (if its submunition then check that)
  2. Easier: warheadName for being HE in the CfgAmmo
errant iron
meager granite
# errant iron good ideas, thanks! :D
entityKilledStatCache = createHashMap;

addMissionEventHandler ["EntityKilled", {
    params ["_entity", "_source", "_instigator"];
    private _stat = entityKilledStatCache getOrDefaultCall [typeOf _entity, {
        private _sim = toLowerANSI(configOf _entity >> "simulation");
        switch(true) do {
            case (_sim == "car");
            case (_sim == "carx"): {"kills_cars"};
            case (_sim == "helicopter");
            case (_sim == "helicopterrtd"): {"kills_helis"};
            //etc...
            default {""};
        };
    }, true];
}];
#

switch(true) instead of switch(_sim) so you can add more complex conditions later in case you'll need them

#
     "ship"
    ,"shipx"
    ,"car"
    ,"carx"
    ,"tank"
    ,"tankx"
    ,"helicopter"
    ,"helicopterrtd"
    ,"airplane"
    ,"airplanex"
    ,"submarinex"
    ,"motorcycle"
    ,"soldier"
    ,"uavpilot"
#

Main simulations

#

You can say ignore uavpilot so you don't get kills for fake soldiers driving UAVs

errant iron
#

didn't account for all the non-x variants tho, or uavpilot

#

are there many vehicles that use those?

meager granite
#

Not sure if there are any non-x simulations in the game tbh, but I have them in my scripts just in case

#

motorcycle is used for ejection seats

meager granite
#

uavpilot is better left ignored as you have it now, so you don't get extra kills for invisible UAV crews

errant iron
#

ahh right, when you said to ignore uavpilot i was imagining the uavpilot string inherited from soldier and i had to add a case above it lol

west grove
#

does anyone know if there is a way to toggle combat pace via script?

mortal folio
west grove
#

it's a side effect of that, i guess. i'm more interested in enabling the weapon-up

#

right now you can do _player action ["WeaponInHand", _player]; for the player to lift up the rifle. but it will go down again after a few seconds (if you do it while walking)

winter rose
#

you can forceSpeed iirc for jogging
for weapon up, set behaviour combat and set unit pos up

#

(for AI)

grave belfry
#

I need to dynamically add a car horn to vehicles that don't have one.

As comically absurd as it sounds, the Merkava (Slammer) is my test subject.

If I:

_slammer addWeaponTurret["SportCarHorn", [-1]];

...it shows up at the top right as a selectable "weapon" just like with other vehicles that natively have a horn. When "firing" the weapon, however, nothing happens. BIS_fnc_fire also won't help.

Repeating the same on a Fennek (Strider), which already has TruckHorn installed, I can even switch between both horns and honk them with the desired effect.

Albeit the goal being a dynamic horn, I tried adding

weapons[] = {"SportCarHorn"};

to the Slammer config; also to no avail. The horn shows up, but won't horn.

Anybody got an idea what I'm missing here?

mortal folio
#

the ability to fire weapons is dictated by animations so internally you're doing practically the same thing (since this'll just switch the animation to the current stance equivalent of weapon-raised)

west grove
#

hm. sadly it has the same effect. the weapon goes up, but after a second or two, you go back to the normal pacing where the weapon is lowered

#

while walking

mortal folio
#

Hmm... the engine must be overriding it then with the user key i guess

tulip ridge
cursive tundra
#

is there any more documentation on the subjective cost in nearTargets?
Im thinking of making a script that sorts targets by their subjective costs and then makes a tank fire an HE round in its proximity - but ofc i dont want the tank to blast a single rifleman with an HE round.. now i could think of checks like if the target has AT, is a tank etc. and then decide if to fire at them or not, but maybe there is a simpler way?

#

so ideally the target would have to clear a certain subjective cost threshhold for it to be selected as a valid target, but as i dont know how the value calculated, im unsure on how to implement...
i know it depends on type of target, distance, etc. but maybe someone already tested a few parameters that influence the cost?

ivory lake
#

it's meant to be working on tanks too but yeah i guess needs perf branch

unreal scroll
#

Some mods have flashlights as a separate weapon, like ACE_Flashlight_Maglite_ML300L in ACE mod.
How can I determine the flashlight is on?
isFlashlightOn and isLightOn commands don't work for it.

unreal scroll
#

@fleet sand Nope, it doesn't "fire", it turns on with the L key, as a common flashlight.

fleet sand
unreal scroll
#

No

warm hedge
#

Recall it is one of action

unreal scroll
#
OT_FL = false;

addUserActionEventHandler ["headlights", "Activate", { 
    if (isNull objectparent player) then {
        OT_FL = !OT_FL;
    };
}];

player addEventHandler ["WeaponChanged", {
    OT_FL = false;
}];

player addEventHandler ["GetInMan", {
    OT_FL = false;
}];

Is there anything that I forgot? To catch unconscious status?

hushed turtle
#

For flashlight? I think "headlightsโ€œ is for car headlights

unreal scroll
#

It is the same action

hushed turtle
#

Ok

#

Ace has unconscious EH

unreal scroll
#

I meant the event itself, where the flashlight could be turned off.

hushed turtle
#

Switching weapon doesn't necessary turn off flashlight

#

If you have flashlight on both primary and secondary weapons, flashlight can stay on when switching

covert oak
#

Okay, after several hours of searching, is it possible to have a script make an AI unit shoot at an arbitrary object/point with their individual small arms other than
_unit reveal _target;
_unit doTarget _target;
_unit doWatch _target;
wait an arbitrarily long time for them to aim, then
forceWeaponFire?

What i'd really like is to give them a scripted command to shoot at an object and have them aim and fire as soon as they're on target
I tried aimedAtTarget, but that only works for vehicles, not including vehicle _unit,
I tried getting their muzzle vector and comparing it to the eyePos/target line (less said about that the better)
I tried null = this spawn {_this dotarget t6; sleep 0.5; while {alive t6 and alive _this} do {sleep 4; gl action ["useweapon",vehicle _this,_this,0]; }}; as I've seen posted here but that's essentially the same as forceWeaponFire (immediate)

I swear to all thing holy I did this for a script a few years back by spawning a Sign_Sphere10cm_F or Sign_Sphere10cm_Geometry_F, but it seems they won't accept it as a target.

warm hedge
#

AFAIK, no

#

There is no command to make an AI aim somewhere anyways

#

Maybe using a Logic or something. I recall I did some stupid workaround for Reaction Forces

unreal scroll
#

@covert oak If you need to do it fast, then you can turn the unit to target and doTarget + fire.

warm hedge
#

behaviour also matters for some reason from my experience

covert oak
#

I don't want to force them to do it fast per se, I just don't want to wait some chosen amount of time.
I spent way too much time setting up everything else to only now find out it won't work lol.
I set up pistol racks (6 targets in a line) with the idea I could tell an AI to fire at the first with an EH when they fire, call the next target in the sequence.
one, for ambiance on a gun range scenario, and secondly to compete against the AI if it doesn't end up superhuman fast.

unreal scroll
#

I don't want to force them to do it fast per se, I just don't want to wait some chosen amount of time.
"If you want to do something well, do it yourself" ๐Ÿ™‚

covert oak
#

Well, the idea was specifically to let the AI do the timing. For eample, the pistol rack is one drill, but they could have targets set up at 45 degrees.
so either they're gonna shoot in between the further spaced targets or go really slow on the rack

unreal scroll
#

@covert oak Try this: _unit reveal [_target,4]; With knowledge 1 AI will not attack most of the time.

covert oak
#

Nope, just stares at it.

warm hedge
#

Try COMBAT or some behaviour

covert oak
#

The targets are either Land_Target_Oval_Wall_Bottom_F or Land_Target_Oval_Wall_Bottom_F.
With COMBAT behavior now he just lays down and doesn't shoot at it. :\

warm hedge
#

Of course it won't, use setUnitPos and forceWeaponFire

unreal scroll
#

He knows it won't shoot back ๐Ÿ™‚
In this case you better to create an invisible soldier

covert oak
#

I tried that as well, the trouble is the AI goes HAM and starts mag dumping and/or throwing grenades. I removed teh grenades from his loadout, but still.
I also can't then get him to shoot at a 6" plate target, because he's aiming for the 1.8m tall invisible guy.

hushed turtle
#

What about using unit, which is invisible and can't take any damage as target?

warm hedge
#

That's what MaxP suggested

covert oak
#

forceWeaponFire fires immediatley, i.e. whatever random-ass direction his muzzle happens to be pointed when the call comes in.
I tried various methods to "check" if he's aiming at the target, all of which have thus far failed. And further, sometimes he'' stay in low-ready so I could make him shoot at... the dirt I guess.

unreal scroll
#

the trouble is the AI goes HAM and starts mag dumping and/or throwing grenades.
Increase the distance and disable PATH for the soldier, to make sure it won't come close.

all of which have thus far failed
Of course. To override it, you need to correct the projectile path too, to make it hit the relative small target.

For my goals (to fire flares) it was enough

waituntil {(ASLToAGL eyePos _unit vectorAdd ((_unit weaponDirection currentWeapon _unit) vectorMultiply (_unit distance _dummy))) distance getposATL _dummy < 5 or {time > _timeout}};

But it won't be precise for bullets.

#

You want to see it as a showcase, or you want to test the AI?
Sorry, I'm a bit out of the previous conversation.

covert oak
#

I'd also like to keep PATH so I can have them walk around for ambient behaviors. Essentially what I'm after is this:
https://www.youtube.com/watch?v=BVp1DfJVvgA

Which is an idea I had when I first started playing A3 like 12 years ago and never got around to hating myself enough to really attempt.

#

The really annoying this is, I had the key part here working at some point, but lost the script. I had an action menu item that would spawn one of those spheres and have an AI hit it with their UGL. I don't think it used doArtilleryFire.

unreal scroll
#

The firing process can be scripted, and you can still have normal behavior beside it. I would try to record soldier moves and script bullet projectiles.
I understand that you want to see "normal" AI behavior, and if it IS the real goal, then good luck ๐Ÿ™‚
But, as for me, in the most of the cases mission makers do not need such complex behavior, only to have a need of constant checking AI to make sure it acts as he needs.

I don't think it used doArtilleryFire.
Obviously it wasn't ๐Ÿ™‚

covert oak
#

I read somewhere today it can be used for UGL's. Could be wrong.

mortal folio
#

joinSIlent accepts an array, just do [p2,p3,p4,p5,p6,p7,p8,p9,p10] joinSilent (group p1)

#

(that's also why it's not working, joinsilent only accepts an array, you could do [_x] if you really need to check alive tho)

#

here: @pallid palm

([p2,p3,p4,p5,p6,p7,p8,p9,p10] select {alive _x}) joinSilent (group p1);

#

๐Ÿ‘

hushed turtle
#

Dead are removed from groups anyway

mortal folio
#

why not just do allPlayers and/or all ai of p1's side instead of manually adding the variable names per player?

#
USMC = group p1;
(allUnits select {(side (group _x)) isEqualTo (side USMC)}) joinSilent USMC;
doStop (units USMC);
USMC selectLeader p1;

I doubt you need the sleep 1's there (unless you encountered issues)

#

probably dont need the selectLeader either since naturaly the leader will be the first person in the group but yeah again, unless you had issues, i dont play around with groups that often

#

all good ๐Ÿ˜„

hushed turtle
#

I thought respawned players stay in group... whatever

#

In that case you can just the leader

#

Naturally. If respawned player joins his original group, then you can make him leader after the respawn

#

Still no need to rejoin every one on leader respawn

#

Join respawned player to the group and if he is p1, then make him leader

mortal folio
#

he's saying if p1 is no longer part of the group after respawn, just join him into the old group instead of joining everyone else into his new group, and make him leader

hushed turtle
#
// init.sqf
USMC = group p1;
// onPlayerRespawn.sqf
[player] joinSilent USMC;
if (player == p1) then {
  USMC selectLeader p1;
};

Does this help?

#

Assuming it's coop mission

mortal folio
#

cant say how many times i've made that mistake too lmao, joinSilent really should have an alt syntax of just object

hushed turtle
#

No

#

They all join p1 group on respawn

unreal scroll
#

@hushed turtle

Dead are removed from groups anyway
Usually ๐Ÿ™‚
There are some cases they are not.

radiant lark
#

Why would a mod crash on stable but not crash on profiling?

little raptor
#

a bug that's been fixed ๐Ÿคท

cobalt path
#

Is it possible to make something float in arma? I want to place some drone cargo boxes in the water that players might need to collect.
Setting mass to 0 didnt work

mortal folio
#

surprised setMass didnt work tho

cobalt path
cobalt path
split ruin
#

is it possible an ai group to stalk many groups (the closest one) ?

stark spade
#

any alternative of unitcapture im tired of tweaking models ??

split ruin
#

I will go sleep, you can send it if you want

silent cargo
#

Anyone know what the command is to "take controls" of a UAV? I want to add a keybind so people can just simply press a key instead of scroll wheel

#

I just cant seem to figure it out

silent cargo
sly cape
silent cargo
blazing zodiac
#

How would I go about editing MaxCost of cfgAmbient from a custom addon? Can I just override it from the addon config.bin?

#

My goal is to remove the ambient life on all the maps for the template I'm making

agile pumice
#

Can someone tel me the spefici usage of moveObject?

mortal folio
#

so because it seems like preInit/postInit/XEH-equivalents are not ran in the virutal arsenal that you can access from the main menu; what exactly is the solution? I have some preinit scripts i'd like to actually execute even if you're in the virtual arsenal

#

even the ADT console doesnt activate in it lol

indigo snow
#

"The intention of moveobject is that you should be able to extract ANY of these file types from one addon, and place it in another addon without fuss.ย "

high marsh
hushed turtle
#

Console from Advanced Developer Tools mod

winter rose
#

or Arma Dirt Track, one hell of a mix tape

high marsh
mortal folio
old owl
#

ADT is pretty great. I had to make some small tweaks to the mod to be compatible with my missions CfgDisabledCommands but outside of that initial hurdle- super convenient and easy to use and don't run my local without it PartyCat

hushed turtle
#

If no player is alive, then there is no reason to run the script

#

It errors at selectRandom?

#

You can do check if there is at least one player

#

If not just don't continue

#

This runs in loop?

#
if (count _Player > 0) then {
    // _randomWestUnit and whatever you do with it
};
primal trench
#

How do I do that?

digital hollow
primal trench
#

Thanks a million

#

That's way easier than I expected it to be ๐Ÿ˜…

primal trench
digital hollow
#

Seems like it exists then.

silent cargo
#

How do I get a specific players viewDistance to return on my machine

#

using UID

tulip ridge
primal trench
#

Alright, makes sense

old owl
#

Also logic wise might wanna be careful of units west- the units command has a note that it doesn't update when team members die in MP

silent cargo
#

Right I just dont understand the flow

proven charm
#

let server check the players getPlayerUID then remoteExec to target client and let that client remoteExec back to the server or your PC

silent cargo
#

Ahh okay, im server admin so just run it from server side then

proven charm
#

maybe too complicated meowsweats

silent cargo
#

Haha I was trying to figure it out for like 30 min now lol

#

Im gonna just run on all clients and system chat hint so they can all see their viewdistances

digital hollow
#

Run Global code to have each player setVariable own settings

silent cargo
#

Yeah I just did

systemChat format ["My viewDistance: %1", viewDistance];

Ezpz

#

Of course they could just pause the game, but ACE view distance settings seem to confuse people

stable dune
#

You could just get all the players and wait until [array of players] findIf side group _x == west and alive _x != -1

hexed sundial
#

is it possible to create the laser designation through scripting? when in ir you can see a laser coming out of something and pointing on a locaiton?

digital hollow
digital hollow
#

drawLaser I suppose, and create the laserTarget object for the correct side

primal trench
#

Is there a reason that switch doesn't work on dedicated servers unless you use it inside a variable? ie this works,

diag_log "_vest = switch";
_vest = switch (_num) do {
   case 1: {
      "V_PlateCarrierGL_rgr";   
   };
   default {"V_PlateCarrier1_rgr";};
}; 

private _loadout = getUnitLoadout player; 
_loadout#4 set [0, _vest]; 
player setUnitLoadout _loadout;```
 
but this doesn't:
```private _num = 1;
diag_log "_vest with switch";
switch (_num) do {
   case 1: {
      _vest = "V_PlateCarrierGL_rgr";   
   };
   default {_vest = "V_PlateCarrier1_rgr";};
}; 

private _loadout = getUnitLoadout player; 
_loadout#4 set [0, _vest]; 
player setUnitLoadout _loadout;```
#

The reason it's problematic is that I'm actually trying to declare four variables (_vest, _helmet, _facewear, and _uniform) inside the switch clause, this is just a test script to see what was causing the issue

granite sky
#

Unless a variable already exists in the outer scope then it's created in the current scope and then discarded.

#

So whether the second example works depends what code runs before it.

primal trench
#

Ahhh so if I put _vest = ""; at the beginning of the second one, it would work?

granite sky
#

For what you want to do, just declare those four vars before the switch. Doesn't matter what you set them to.

primal trench
#

Thanks, that helps a lot!

granite sky
#

Fastest method is private ["_vest", "_helmet", "_facewear", "_uniform"];

primal trench
#

Aha, that's money

primal trench
#

Ok now this is a real head scratcher. I have this script that's supposed to spit out a cosmetic loadout based on a player's UID (now that I've gotten the switch to work; thanks John Jordan. I'm testing this through the Zeus "Execute Code" module on my dedicated server.

 
_uid = ((getPlayerID _unit) getUserInfo 2); 
diag_log format ["[BC] Processing setArmor for UID: %1", _uid]; 

_vest = "";
_helmet = "";
_uniform = ""; 
_facewear = "";
_patch = [_unit] call BIS_fnc_getUnitInsignia; 
 
switch (_uid) do { 
 case "76561198027052136": {  
  _vest = "V_PlateCarrierGL_rgr";  
  _helmet = "H_HelmetB_Enh_tna_F";  
  _uniform = "U_B_CTRG_Soldier_urb_1_F";  
  _facewear = "VSM_Shemagh_Balaclava_OD";   
  _patch = "eodBadge"; 
 };
 default { _skip = true; diag_log format ["[BC] UID not listed for player %1 (UID: %2)",((getPlayerID _unit) getUserInfo 3),_uid]; }; 
}; 
 
if (_skip) exitWith {}; 
 
diag_log format ["[BC] Player: %1, Vest: %2, Helmet: %3, Uniform: %4, Facewear: %5, Patch: %6",_uid,_vest,_helmet,_uniform,_facewear,_patch]; 
 
private _kit = getUnitLoadout _unit; 
_kit#3 set [0, (_uniform)];  
_kit#4 set [0, (_vest)];  
_kit set [6, _helmet];  
_kit set [7, _facewear];  

diag_log _kit; // <-- threw this in on a whim

_unit setUnitLoadout _kit; ```

The code doesn't work. Instead, it makes my unit completely naked. On a whim, I threw in a `diag_log` right before the line that's supposed to set the unit loadout that reports exactly what it's supposed to set it to to verify that the loadout array wasn't messed up. Not only is it not messed up, but if I take the *exact output* of `_kit` from my server's .rpt and plug it into `_unit setUnitLoadout`, it works perfectly fine. What could be going wrong between the last two lines that's making the code not work?
#

To compound it, when I use the exact same code in multiplayer 3den, it works just fine

old owl
# primal trench Ok now this is a real head scratcher. I have this script that's supposed to spit...

For _uid = it can just be getPlayerUID _unit. On to your actual issue though. I don't have syntax highlighting on my phone so take with a grain of salt but have you verified a value in your script isn't nil/undefined? Spawned scripts with nil may end without a script error depending on where that nil sits. I believe diag_log is one of the only commands exempt to that which may be why it's still showing.

primal trench
#

Are you saying it might work if I include an output (nil, as you suggest) at the end?

old owl
#

No more suggesting you debug all your variables values along the way to see if any are nil. Alternatively may be able to call the script instead of spawn/execVM to give you immediate details on where it may be getting hung up

hallow mortar
primal trench
#

Global and Local both have the same effect

hallow mortar
#

Local is the one to use for this, the other modes could have unforeseen consequences

old owl
# old owl No more suggesting you debug all your variables values along the way to see if a...

I guess I should rephrase this a little. If you're running the script in a parent scheduled script, running it with call wouldn't give you any extra info. It needs to be ran in an environment where it's unscheduled to get extra deets. Although you've said you've ran it in debug without issue which is unscheduled context. So perhaps the difference is a parameter you take in the file where this is all running or something?

primal trench
#

Everything is being run via Zeus. This was originally an .sqf that was compiled into a function and executed via call, but I was getting the same result (works on multiplayer 3den, doesn't work on dedicated), which is what brought me to Zeus to do some real-time testing

old owl
primal trench
#

Yeah setUnitLoadout works just fine when I use it on its own

hallow mortar
#

If setUnitLoadout was disabled then it would simply do nothing, rather than stripping the unit

scarlet igloo
#

hey guys, im trying to add a squad-esque prop bunch into my rally system. The issue is that whenever i put down a rally the props arent visible, but the marker and respawn get put into the right position. why? am i using BIS_fnc_createSimpleObject wrong?

old owl
#

Which kinda makes me a little hesitant then on my theory of something being nil in scheduled context. If that was the case, the setUnitLoadout command shouldn't be running at all?

primal trench
#

Lemme see

#

Yeah using nil as an argument in setUnitLoadout just keeps whatever was there before

#

forgot that I was trying it that way before

old owl
#

My best advice at this point would be to just diag_log everything and see if there's anything nil prior to where you setUnitLoadout. Or if you wanna save yourself the time- try to hint "something" around when you run setUnitLoadout. If the hint doesn't run then you know you've got an issue with something being nil early

primal trench
#

Ok you might be onto something. When I switch the last diag_log to hint, it shows empty "" instead of my values

old owl
#

Is that ran right around setUnitLoadout?

#

Also outside of debug?

primal trench
#

Yes that one was the line before.
Same thing with that other diag_log... when I switch it to hint, it outputs a bunch of null and empty space instead of the perfectly-good values my diag_log is outputting

#

I have a sneaking suspicion it has something to do with that switch for some reason

old owl
#

Wait

#

Do you define _skip outside of your switch scope?

primal trench
#

๐Ÿ‘๏ธ ๐Ÿ‘๏ธ

primal trench
#

Defining _skip early (_skip = false;) with the other pre-declarations doesn't fix it

#

However, removing the switch code entirely does

#

so that it's just the variable declarations within that case

old owl
#

Your syntax usage of getUserInfo doesn't appear correct in your switch case but also don't have highlighting since on my phone but maybe perhaps that's the difference? Have you changed that to getPlayerUID yet?

primal trench
#

I'll try it

old owl
#

Should ideally just be getPlayerUID _unit no need for getUserInfo or any like command

primal trench
#

Har har har

#

I think that worked lbwHaha

primal trench
#

For some reason when I first wrote this script months ago that function didn't show up as an option and I was trying getPlayerID. More recently, when I found getPlayerUID, I think I assumed it was the same one I'd tried already

#

Thank you for your tireless assistance

#

That workaround that I was using must only work on local

tulip ridge
#

Pretty sure it's handled in-engine, and can't be changed

#

You'd need to make your own action that shows at the damage ranges the vanilla one doesn't show at

#

You could just make your own action

#

I don't know what you mean by the SelfHeal way

#

Well that's basically what I said, just a custom action that lets you heal, also that doesn't check if you have a first aid kit as well

#

I was just gonna say something like:

player addAction [
    "Heal", {
        params ["_target", "_caller", "_actionId", "_arguments"];
        _caller removeItem "FirstAidKit";
        _caller setDamage 0;
    },
    nil,
    1.5,
    true,
    true,
    "",
    toString { 
        private _damage = damage _this;
        _this == _target && "FirstAidKit" in items _this && (_damage < 0.2550 && _damage > 0) },
    50,
    false,
    "",
    ""
];

If unit has taken less than 0.2550 damage and has a first aid kit, remove the first aid kit and heal fully

#

Can use a hold action like you have there as well, it's basically the same thing. I just didn't bother to check the wiki

old owl
old owl
#

Heck yeah. I fixed a bug in our repo in October related to an addAction condition. Found out a few months ago I never actually fixed it because I placed the condition in the shortcut string and it didn't error. I suppose I was lazy and didn't test but tweaking_cat

tulip ridge
#

Isn't that what you were asking for?

i think this should be changed to: if the player gets any damage at all the action should appear

#

Oh you mean for an AI medic to heal you to full
In that case no, it's all handled in-engine and most likely can't be changed

#

You could probably have like a "Request Medic" action which would grab a medic in your squad, have them to move to you, and then run the _medic action ["HealSoldier", player] action

#

No clue if they'd actually heal you if you're not below that threshold though

versed belfry
#

Heyo quick question,

Is it possible in anyway to change what the display name of a locked in vehicle on radar is?

Specifically where it says UH-80 Ghost Hawk or other names.

hushed turtle
silent cargo
#

lol after losing arsenal kits, missions, and more.. I back up my whole profile every week or so ๐Ÿ˜‚

wispy kestrel
#

Is the a benifit to using setVariable / getVariable instead of publicVariable? Where would one be more ideal than the other?

blazing zodiac
#

I'm not sure but I think Grim showed a while back that setVariable/getVariable was much faster. It was quite a while ago though it could be the other way around. Hopefully one of them will weigh in.

split ruin
#

in local host when I use briefing modules the text is shown twice, any solution to this? ๐Ÿ˜”

warm hedge
indigo sierra
#

since im not much of a scripter, ive gotten an IED Ambush setup and I was wondering how I could even have other reinforcements pop up?

#

unless im actually tripping and gotta go to bed

warm hedge
#

What is "other" in this context?

indigo sierra
#

OH some guerilla forces, its for a test run

warm hedge
#

Well, I can't tell what it does mean, but you can pick one of dozens of options

  • hide units you prepare in Eden, and pop whenever you want
  • create groups and units, make waypoints
  • prepare units somewhere very far from your Area of Operation and setPos etc to pop
indigo sierra
#

i can hide units?

warm hedge
#

Yes

indigo sierra
silent cargo
silent cargo
#

Np you will find tons of cool tricks related to what youre talking about

#

If you dont know the lingo people will get confused what youre asking about. Just do a little digging to get started

warm hedge
wise frigate
#

How is it going?

Any way to get a Volume Value for in game sounds?
Like to actually see decibels of certain sounds in game depending on distance etc?

warm hedge
wise frigate
#

I want to essentially have a loop which returnsd the value of the sound Volume of all soundsx in game. So for example when no gunshots are going off etc, the value would be low, when there is lots of explosions etc the value would be high

wise frigate
#

Itโ€™s not about changing volume

#

Itโ€™s about recognizing the volume in game as too loud

#

Over a specific value that I designate

#

Then running a script based on that value

warm hedge
#

There is no native way to detect sounds' volume, nor sound volumes you hear around

hushed turtle
#

What is the command to get if unit is medic, engineer and so on?

wispy kestrel
#

Does anyone know how to add loacations to the EG Spectator?

proud dome
#

What func tells me if a vehicle killed is of type Soft, Armored or Air? Expecting the result to match what goes into scoreboard information

#

Surely isnt a IsKindOf "Car","Tank","Air" right?

sharp torrent
#
 ``` - will it work, or requires me to use ```{_x addEventHandler ["LeaderChanged".{params ["_group","_newLeader"];};]} foreach allGroups;```
silent cargo
#

When you become incapitated your AI take over your squad, and its incredibly annoying when you have them all mounted on weapons in various parts of the map and they suddenly dismount and start walking 10's of kilometers to your position.

Is there a way to stop this from happening. Ive looked into the high command thing, just dont understand it at all

sly cape
silent cargo
#

๐Ÿคจ

#

Mounted on AA, holding positions.... and anything else lol

#

When you die the AI take the lead and they all dismount

sly cape
silent cargo
#

Because they are in my squad

#

And im playing arma and using AI

#

IDK if you ever played warlords before, you get AI and use them

#

You can buy them in asset menu, put them in vehicles etc to assist

#

Player led squads compete and fight

sly cape
silent cargo
#

Generally speaking, in arma 3, when you have AI in your squad and you get shot and you are down - the AI take control of your squad.

I play warlords yeah but its not an issue isolated only to warlords.

#

And its not caused by warlords functions, its something in the arma 3 engine

#

Ive read in the past that setting their rank lower fixes it but it doesnt change anything

#

This likely also effects any other mission or scenario in which you have AI subordinates and revive on.

sly cape
silent cargo
errant jasper
#

The AI in arma was designed to have some base independence.
He is playing with a recruitment script in the MP game mode, he cannot easily give away and retake control. The units directly under might also have a capacity cost. So the game mode controls is in tension with the ai independence

silent cargo
errant jasper
#

Yes done technically via a "recruitment script"

sly cape
silent cargo
warm hedge
#

I cannot really confirm the point. I placed me, a leader, a static launcher with soldier, placed a bit far, setUnconsicous to knock myself out. They hold their statics

silent cargo
#

Ill take a video

errant jasper
#

Not even sure it can be solved.
Might be possible to quickly transition the respawned player as leader but they probably already abandoned the static weapons. And commanding the AiI to retake their weapons from the command list is quite a hassle

warm hedge
#

At this point it's not quite sure what exactly causes it. Warlords or some Mod or some other script or Engine

errant jasper
#

Can't test right now, but player being "out of command" when they eventually notice it will lead to some other ai taking command

silent cargo
#

Same exact issue

#

If its directly related to only warlords and these types of mission, then I apologize for my confusion

sly cape
#

Does it occur in any other missions?

errant jasper
#

? Well the general case of AI taking over incapacitated (certainly dead) player is base behavior of the game

warm hedge
#

No? One soldier took the command in my test

errant jasper
#

Did you die?

warm hedge
#

No

#

Ah, I just checked in Warlords. They actually try to form their formations and left the statics

sly cape
#

What about a basic mission with the vanilla revive system?

warm hedge
#

Okay just repro'd the issue with just an Eden mission

errant jasper
#

I never played with BIS systems. But IME base behavior is the AI will continue the groups waypoint, and a AI SL will always send a few of its members out to hunt known targets. When those members go down it will allocate again some from the remaining.

silent cargo
#

I didnt realize it wasnt a base game issue

warm hedge
#

It is an "issue" from base game, yes

silent cargo
#

I wonder if adjusting their rank will change anything

warm hedge
#

Left one is editor-placed static. Middle and right are editor-placed static but empty, units are ordered to get into while the mission is running

#

player setUnconscious true results this. Middle and Right left the static

#

Not sure what kind of solution should be applied into this low-level engine feature

silent cargo
errant jasper
#

Left probably has some "assigned to" state whereas the rest was just told to get in but not "assigned" to the weapons... just a hunch

warm hedge
#

I actually checked assignedVehicle. When they sit all statics are assigned, assignedVehicles doesn't seem to matter

errant jasper
#

Does assignedVehicleRole differ ?

warm hedge
#

units group player apply {assignedVehicleRole _x}
->
[[],["turret",[0]],["turret",[0]],["turret",[0]]]
So no

silent cargo
#

Confirms i am not crazy. Lol

warm hedge
#

Something feels off

silent cargo
#

This doesnt seem like intended effect IMO, it effects any mission where you direct AI. And that in itself is incredibly annoying

#

Like if I am playing on a large map, and I have AI holding an airfield position with AA and manning radar etc, there is absolutely no reason they should eject from the vehicles and begin walking 20 km to the downed leader. Thats just ridiculous

errant jasper
#

No that is clearly intended effect. The fact that the "generic adaptation" behavior messes with some desire for "author control" is a consequence of that.

silent cargo
#

Granted if they are in a vehicle they do drive to you. So maybe thats what the goal was

errant jasper
#

We have the same tension with getting AI to use windows. Normal behavior and they would move around as if they were in light forest. The only way to make the stay is to basically disableAI "MOVE", which somewhat works of they don't turn prone instead of crouching the wrong way after taking fire. But this solution also makes them fully tactically inept since they are forever locked in place and too easily flanked etc.

warm hedge
#

I mean this functionality is totally intended, but Editor-placed static or ordered to getin'd static make it differ is totally strange

errant jasper
silent cargo
#

Yeah I was (hoping) a hacky fix could be AnimChanged event handler to capture the "incapacitated" animation, and then just have the group receive a command to stay put. But it might not happen fast enough to prevent them from jumping out. Alternatively I could use the "warlords owned vehicles" array, and just lock them. But even at that its still probably not the proper solution

#

I spent a lot of time researching this in the past

#

Some articles / forums pointed towards high command, but I think that was just "maybes"

errant jasper
#

Scripting wise it could probably be handled ugly by,

Detect on killed / unconscious state EH and store whether the player owned subjects was in vehicle position and then have the ai retake them after reelecting player leader of the group

silent cargo
#

Hmm yeah

mortal folio
#

there's unfortunately no unconscious state EH

silent cargo
#

Antistasi had a workaround, but its really weird. You basically remote control one of the AI from your squad. Which is not something I am going to do

silent cargo
mortal folio
#

just check lifestate each frame and accept the sacrifice of 0.001ms ๐Ÿ˜›

silent cargo
#
    params ["_unit", "_anim"];
    if (_anim isEqualTo "amovpercmstpsnonwnondnon") then {
        do something....
    };
}];```
#

Maybe I could just list every single one here

errant jasper
#

Or just monitor every half second and store the AI positions every time is awake

#
  • lifeState / incapacitatedState
silent cargo
#

What is AUTOCOMBAT? You think its related?

#

When alive the AI seem to need direction, but when down im not sure if its just a waypoint being set, or if theyre just taking commands from a new leader whom is just doing random stuff. But they do indeed always come straight to the downed player. Although there is no attempt to revive them. So it seems redundant IMO

#

Unless of course im missing something, and there is a setting somewhere to have AI revive you.

#

If not, what is the point of sending them to the down player?

#

Sometimes when you come back to life they just spam "report position" over and over. Doesnt happen every time. But it does happen

errant jasper
#

Down or dead, and do you have an outstanding group way point?

silent cargo
#

Down. When you die you never lose command

#

They stay put etc

silent cargo
#

So like if you have a tracked AA placed somewhere on the map, no waypoint, they dont move. You go down, they start driving to you

errant jasper
#

Well I can't test the rest right now, but it may be that in the absence of a group way point the "group target position" is where you the SL was.

#

But that usually only matter if AI takes over which I guess they don't if you only are incapacitated

#

I never used the BI incapacitated system so I don't know how it affects

silent cargo
errant jasper
#

Well if they are taking command the SL will try to make it to group destination, and if no group waypoint that would probably be where the group is, which is where you fell.

silent cargo
#

will mess around and test some things, particularly waypoints and see what the result is

errant jasper
#

So the ai taking over is trying to accomplish the mission.

Yeah try that. If the group has a MOVE way point far away my guess is they will try to go there instead. At least the SL will, he might send other ai to attack enemies.

silent cargo
#

That makes sense though theyre sent to assist, just seems useless if they dont revive you because the mission wont succeed in any case because the player is just gonna bleed out and die

#

Is there a getwaypoint command? (or similar) I dont see anything hmmyes

errant jasper
#

But that is current in warlords right? Not sure about ordering a move ingame, but if you an editor placed waypoint I think they would head to that if you went down. Then again maybe the incapacitated system is different.

silent cargo
#

To avoid other variables in warlords etc im going to just test it in editor. There are AI fsm scripts in warlords, but they are only for the independent (mutual enemy) between the 2 player led factions (opf/blufor)

#

Doesnt appear to be anything related to player groups asside from options to delete the subordinates, and them being deleted when the player leader leaves the game.

#

I have no idea what the behavior would be if a player was in the group too. I wonder if the same thing happens, and the alive player is given the role of leader if the other player leader goes incap first.

#

The missions are dynamic too. Which is why I dont just plop ungrouped AI down in weapons in editor. You capture zones, take control, and set up defenses to prevent the other player led enemy groups from taking control of zones when they decide to attack.

silent cargo
errant jasper
#

Hmm interesting, so does seem incapacitated is different in this regard.

silent cargo
#

Im going to sift through functions viewer and see if I find anything

granite sky
#

Do they do that if you just setUnconscious directly, or is this some revive system?

silent cargo
#

What the f... now the AI is suddenly just getting out when I go incap, and running back to the static and getting back in

#

So it seems that if you have more than 1 AI in your group (1 player, x2 AI) - the AI will get out of the static, and never get back in.

However, when you have only one AI in your group (1 player, x1 AI) - the AI is getting out of the static, running a few meters, turning around, and getting back into the static.

#

Alright so it seems its got nothing to do with the "revive system" but instead setUnconscious. If I disable revive sytem, and set myself unconscious the AI behavior is still exactly the same. They just immediately jump out of the static.

#

setUnconscious doesnt appear to be a function, or its just not listed in the functions viewer.

warm hedge
#

It's a command, not a function

silent cargo
#

Yeah I see everything about revive etc. So a command is hidden in the engine then? We dont have access to that?

warm hedge
silent cargo
#

Right but a command has intended outcome, the intended outcome of said command is written somewhere in the engine, of which we can not view

warm hedge
#

If that's what you mean, no, commands are always engine driven

silent cargo
#

Because it seems this behavior is being triggered by the command itself.

#

Incapacitation by damage with revive system

#

And here it is when you use the command, with revive system off.

#

Same AI behavior. However you can not be revived etc.

#

Not sure where this group leader change effect is being handled.

#

Also interesting how the outcome varies depending on how many AI are in your squad.

granite sky
#

Is there any leader switch just from setUnconscious?

silent cargo
#

Yes. The same issue persists as it does with the revive system. AI jump out of the static, and you no longer are the leader

#

I looked through all the revive related functions and saw nothing about group handling or leader changing

#

So that led me to test with the system off entirely

#

So it doesnt appear to be some intended effect in unison with revive system for example. But I guess it was coded in the command, or outcome of said command for whatever reason but I really dont understand why

#

And there is nothing you can do to stop it from happening.

#

It would make complete sense if it was bound to a revive related function where the AI try to come save you for example, but it appears that is not the case at all.

#

Mind you, if you die, this doesnt happen. Everything stays the same. Only happens when you go unconscious with or without revive enabled in your mission

hallow mortar
#

In multiplayer, this allows another player to continue giving orders to the AI and otherwise controlling the team, rather than everything being locked out while the "real" leader is downed

silent cargo
#

Granted if you have revive off its not an issue at all. It only effects those of us who dont want to instantly die in our missions

#

And the issue is that even if you write your own revive system, its still going to happen. Unless you create your own script to force them onto the ground and not move.

#

Which seems like it might be the only solution at this point.

#

But even at that, if revive is disabled, you will just die when you take too much damage, so it would be a total mess to script.

#

Every system ive seen, mods, scripts etc, they all use setUnconscious

#

So whether youre using Vanilla system, project injury reaction, or others.. youre going to face this same issue

granite sky
#

yeah I don't see why they put that sort of behaviour into setUnconscious.

silent cargo
#

Well im glad I at least figured it out sort of.

#

I really dont think this was done on purpose, personally.

#

If the case is to have a player in your squad thats mixed with AI for whatever reason, have ability to take control. Then I would really like to see a group check to see if theres an alive player, before making all the AI jump out. But even at that, why are the AI jumping out?

#

They only jump out of statics. Vehicles they stay inside. No change at all.

#

I suppose I could submit a ticket about it, that might be the only option. But if they see no urgency or purpose then it'll probably just stay like this.

granite sky
#

Oh right, forgot about the leader switch. I guess they're unhappy about their group center being five yards away when they're in a vehicle that can't move.

#

If it's not the leader in the static then they give an actual disembark order.

#

They also ordered the third guy out of both driver and gunner slots of a Hunter HMG though.

silent cargo
granite sky
#

I imagine the new leader just has his own idea about where units should be.

silent cargo
#

I find that to be very strange lol

granite sky
#

I can't replicate them getting back on the static.

silent cargo
#

And look at this, without any explanation, the issue didnt exist. But when I restarted the mission, they kept getting out again.

#

Notice he stays put.

#

So I think that after you respawn from incap, the behavior is normal.

granite sky
#

It's not incap specifically. If you joinSilent yourself to another group they do the same things.

silent cargo
#

(the player after respawning)

granite sky
#

Respawning in SP is usually faked.

#

You just bring the unit back alive.

silent cargo
#

go in the editor, place an empty static next to you.

Put x2 AI down and link them to your group.

Start the mission and direct the AI to mount the static

Hurt yourself / set yourself unconscious

Respawn

Repeat process

the outcome is different than the first

silent cargo
granite sky
#

It might. I don't know BI revive very well.

#

In Antistasi it would, because we just use the engine respawn in MP.

silent cargo
#

Strangely the outcome is the same with and without revive system on

granite sky
#

It's probably engine respawn then.

silent cargo
#

Yeah I keep trying to think of hacky ways to fix it, and I just cant find a common ground

#

Let me see if I took a clip of when its just one AI in your squad

#

Instantly dismounts, wanders away, walks back and remounts.

#

The fact its instant makes it next to impossible to stop it

#

Group waypoint doesnt appear to change either. The one I set via editor remains the same before and after respawning

#

With my specific case, I could utilize the existing variable that are set upon your owned vehicles that you purchase using BIS_WL_purchased, and maybe just lock them under certain conditions - because the AI will not exit a locked vehicle.

I/e Check who gets in it, if its an AI member of your own group, then have it check the type and if its a static then lock it.

granite sky
#

There are some cases where player orders are apparently registered differently from AI orders. A notable one is player stop orders: You can't reverse those by script.

silent cargo
#

Yeah its definitely beyond my knowledge lol

granite sky
#

yeah so on that basis I found a workaround for you :P

#

If you order the AIs in with moveInAny then they don't get out when you leave the group. assign + orderGetIn probably works as well.

#

moveInAny works even if they're already in the vehicle.

#

So you can just call that in a GetInMan EH.

silent cargo
granite sky
#

maybe. Not sure exactly how GE moveInAny is.

silent cargo
#

Doesnt seem to work

#

I will try with getInMan

silent cargo
#
    params ["_unit", "_role", "_vehicle", "_turret"];
    if (_role == "gunner") then {
        _unit assignAsGunner _vehicle;
        [_unit] orderGetIn true;
    };
}];```
#

Thank you so much!!!!!!!

#

gotta refine it a bit for statics only etc but this will work, really appreciate it.

hushed turtle
#

How can I check if SOG DLC is loaded? Ideally by preprocessor commands

proven charm
hushed turtle
#

With ACE I was checking it by __has_include, but ACE is open source, so I can see their file structure.

proven charm
#

preprocesor is hard for this because the configs arent loaded yet, at that point

hushed turtle
#

At mission runtime?

proven charm
#

maybe it should work

#

you can try configfile >> "CfgPatches" >> _mod

hushed turtle
#

I was checking for configs files themself ๐Ÿ˜€

proven charm
#

ic

#

ya in mission load configs can be read but not so much in arma start

proven charm
#

kinda curious my self on how to check configfile in preprocessor, if possible

hushed turtle
#

I'm not talking about checking what's inside

#

Just if file exists, meaning addon is loaded

proven charm
#

yea i hear you, just stuck in the configs my self ๐Ÿ˜‰

#

could be better solution for you as well

hushed turtle
#

I'm good. I've found some file I can check if exists

#

I've found some version file, which was included in their init function. This should be reasonable.

#if __has_include("\vn\vn_build_number\scripts\vn_version.inc")
    // SOG loaded, do stuff with it.
#endif
hallow mortar
#

It doesn't matter now, but in principle you could check against some texture or model file; those are usually quite easy to find in config

#

The Functions Viewer also shows the file path of the function you're viewing

remote narwhal
#

getUserInfo doesn't work in server side scripting?
in server.cfg:

onUserConnected = " \
_userInfo = getUserInfo str (_this select 0); \
diag_log _userInfo; \
";

in rpt:

2026/02/23, 23:56:05 []
open hollow
silent cargo
#

Question regarding screenshot

theres a mod which uses this in a "camera" addon, but im wondering if it would be possible to take a selfie, like flip the view around. I assume its not possible. But the camera is just a binocular using a phone/camera model.

dark hornet
#

How do I edit to make where AI CSAT drop IFAKs when killed?

silent cargo
faint burrow
#

Remove the slashes.

old owl
remote narwhal
remote narwhal
# faint burrow Remove the slashes.
onUserConnected = " \
_userInfo = getUserInfo str (_this select 0); \
diag_log _userInfo; \
";

and

onUserConnected = "_userInfo = getUserInfo str (_this select 0); diag_log _userInfo;";

same

#

for server config parser

old owl
#

Learned something new if so

pallid palm
#

wow i'm glad i don't Dedicated Server: oh my: all that stuff looks hard to get right ๐Ÿ™‚

old owl
#

Dedicated server is pretty much no different from a player hosted multiplayer mission outside of lack of interface, player host also being the server and initial setup. Whatever he's intending to do is just a little unorthodox but probably necessary pepekek

dark hornet
#

none of it make sense to me unfortuantly haha

mortal folio
#

does anyone have a script that can make AI properly holster their weapon or, failing that, switch to the launcher?

#

i tried selectweapon, action "switchweapon", both, nothing works unless i disableAI "ALL" (or take away the AI's primary weapon outright, which is not an option)

#

not sure i follow

#

that only works on players

drifting girder
#

anyone know if i can use createMine to get an IED to explode? It's labelled as remote detonation charge rather than mine, so won't explode when a player is near

mortal folio
#

no i've tried that same methodology already

hallow mortar
drifting girder
#

excellent

silent cargo
# mortal folio that only works on players

Use that script in the vid above as player, when you have your weapon holstered as player, run animationState player;, copy the animation, then whenever you want your AI to holster their gun just run person playMove moveName (the name that was returned to you as player) on the unit

#

Just use the script to get the animation name

still forum
#

It seems all the old eventhandlers use this "playerId".
Only the two new ones pass the DirectPlay ID

#

Ah the thing they are passing is the second result of getUserInfo, the "owner".
So the old server side events, get the "ownerId" of the player.

#

You can iterate allUsers, to find the user with matching one.
(Also this difference should be listed on the wiki)

mortal folio
#

So far the only actual solutions have been either A: remove their primary, or B: make a copy of the unit with no weapon, make it invisible, attach the original to it, and have the original unit copy animations and vectors from the fake that moves around

#

I do not like either

#

Of all the things in arma that are incredibly easy to modify or work around, im genuinely surprised AI control is so rigid

#

speaking of jank solutions; just found another one - i could replicate the entire action state of civilstandactions with upDegree set to rifle - that way animations can change and AI will still think it's in the rifle stance, then just disableWeapons set to true on all new class instances of the animations

#

๐Ÿซ 

radiant lark
#

Is there any way to make a script that makes a mission on your arma 3 documents folder?

#

The idea is to make a sort of replay system, it will export the mission there and (if possible) autoplay it

errant jasper
#

Are you asking about replay or generating mission externally?

#

A mission is just a somewhat convoluted "cpp" style config, but usually binarized, file