#arma3_scripting
1 messages ยท Page 223 of 1
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
actually it's not even an action. it's an action group
so you can't play it at all
Then why do they even list it in the Wiki if you can't even use it?
exactly, why even post it if it's unusable
you can only play States
it's usable. you're just not using it right. it's an action group which is useful for creating animations
these are what you can play
how do you set the default key mappings properly for multi key press? Im trying ```
TestKeyBind2[] = { DIK_B + DIK_RCONTROL };
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?
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.
On my phone so can't look through EVHs but a hacky method of doing it is doing a
waitUntil {
isNull (findDisplay 46)
};
Although I woild advise NikkoJT's method first as it'll be more reliable
can the server profile also save data like the player profile so that I can recover it even if the server gets reset for example?
Yes
If you mean reset like restart yes 
Still profileNamespace, just on server
That file(profileNamespace) must grow large over time on server
You can use missionProfileNamespace to make it a bit more contained
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
move I recommend
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
maybe you have multiple ctrls with the same IDC (if that's how you find them)
I've never had this issue
I spawn them all like so private _ctrl = _display ctrlCreate ["iarts_passive_sonar_spectrum1", -1]; Is it a bad idea to use -1 ?
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
that's the objective, i don't need the idc for these controls, i store the controls in a list in uiNamespace to delete them later
The problem is some of them don't get deleted
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)
I usually also spawn multiple of them without problems but this time i can't understand what's wrong
Here is the problematic piece of code https://pastebin.com/iJC7hn4T
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
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"
Ohhhhhhh yes now i see
Thank you very much i spent hours on it i didn't see it ^^
actually we also have deleteRange
so use that instead
_ctrlList deleteRange [0,9]
oh nice
Whats a script I can use to make a body excluded from being deleted by garbage collection etc?
in theory, not sure if it works 
@sharp grotto where do you put this in the Description.ext ?
seems like it gos in the Description.ext but im not sure
it's a script command, so no. you need to execute it after unit was created (most likely)
ah ok so in my enemy spawn script
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.
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 ๐
more objects always have an impact, even with the best optimization the game still needs to render them if they are in your viewpoint.
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 ๐
Is there currently a command or a particular way to determine which player is logged in as administrator (in multiplayer missions - on dedicated servers)
WooHoo i got it hell yeah: i just needed to wake up ๐
What does the script go in? A trigger or a Unit ini?
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
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];
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.
Also, I did find references to Corpse and Wreck Management in Description.ext documentation. I'm not familiar with the system at all, but might be worthwhile taking a look at if you're intending to use those commands as looks like there may be some crossover ๐
https://community.bistudio.com/wiki/Description.ext#Corpse_and_Wreck_Management
https://steamcommunity.com/sharedfiles/filedetails/?id=3570530150 Can read what the scenario focuses on in the description if ya want. It can support 8 players but was built with 1 player first.
Looks neat :)
its a single player mission
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
so of corse you would have to host it
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
well i would make the triggers server only yes
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 ๐
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.
nice lol
And a reinforcement system is set up to replenish the team if you lose too many
lol if we lose to many in my missions it a mission failure ๐
Oh yeah you get a failure on mine too if you lose the reinforcements lol
nice
Each of these triggers and task is associated with all team members lol, I call it the graveyard lol
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
holy shit that trigger is way big wow
It would make sense to add first, but I'm unfamiliar too
Yeah needs to be so it still triggers no matter where they are on the map
well i would make a checking loop script: rether then have a trigger that big
There is killed EH and that's correct solution
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
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
i ment for your team members killed EH
It is not using any detection or activation constraints here, so I think (hope) the game engine doesn't to any actual checks using the area.
Oh yeah ill do that at some point
These two triggers govern the visibility of the NPCS and their sim. One controls visible, when controls invisible.
if any
I use them because I can understand visual representations more
yeah do it like that too i set the mission up then i fix all the stuff up to be better and better
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.
Oh yeah everything static on my map is not simulated
or spawn them in when needed
What are these yellow line on ground?
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
oh my mods too oh my
So they dont get stuck or lost
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.
thats a roger milo i agree
Yee let me show you what my visibility bubble system does
Might be better to hide and unsimulate instead of despawning if its an entire outpost for example - createVehicle is an expensive command
Which i think hes already doing
That's fair. We have more than 22,000 objects in our mission so that's why we era to that over hiding. Honestly though with the usage of a small uiSleep, we don't notice much of a performance impact when creating those objects.
True if you stretch the calls over time its less noticeable
In any case though I'd recommend createSimpleObject first over createVehicle if possible.
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.
22000 units and the group limit is the least of your concern lmao
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.
But im sure all 22000 is objects
Hahaha yeah no worries nothing like that. We are a life server so we actually don't really use any AI ever
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
Yeah im currently setting all the triggers
i remember i used to cover the map with triggers too: but as i learned i had less and less triggers
This is one of muh big bases when the player is in the area vs outside of it.
Its ultimately down to preference, and if theyre mostly server triggers then youre fine
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.
Well it depends on your server hardware but in most cases even with ai heavy missions the server will chill, and you can always just add a headless client or two for ai
milo is your missions all player base missions
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.
in other words PVP
I only really ever work on a few different missions but our primary is a multiplayer mission with players and no AI
i find it way easyer to make PVP missions
so ofcorse i dont make PVP missions ๐
well sometimes i do
so is that 2 teams or 3 teams
Tbh I don't doubt it. As I've said to John Jordan before, so much of everything AI seems like wizardry haha.
We will generally peak at 130 players so a lot of our struggles in anti-cheat and server and network performance.
Well
i see nice
Just like an llm - the hardest part is making it do what you want lmao
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.
roger that
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
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 ๐
where should I ask about "printing" my base objects on the 2D map of my scenario?
Printing?
Like ive made a base on a existing map but having visually represented on the 2D map
I guess you should use markers? They appear on the map
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
or bake it in the actual map control itself. not sure if thats possible
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?
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
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...
I think you need to use advanced flight model
Otherwise I dont know of anything that would return rotor RPM etc
What are you trying to do?
I think he wants to know when rotor stops rotating
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
It's a resupply feature. Helicopters get resupplied after landing, but only when it's "safe" for engineers to approach. Just an aesthetic thing...
...and, thanks. That's a good find, but, alas, the difficulty setting might not be "on" everywhere the script runs.
Maybe just wait a few seconds after isEngineOn == false.
Yeah, that's maybe what's left for me to do. I can hear the sticklers, already, though. ๐
In theory I guess there's an animation phase for it somewhere? Might not be the same for every heli though.
Easiest solution would be just be capturing the engine turning off and using sleep for 10 ish seconds maybe
Well, those typically oscillate between 0 and 1 depending on where the rotor is rotated. I'd have to monitor that for a time and look if it's on a stand-still after a while... All that for aesthetics. Hmm...
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.
btw โจalive _vehicleโฉ also covers the isNull case.
nice
Try these, I think they are the wind sounds from the game.
"a3\data_f_curator\sound\cfgsounds\wind1.wss"
"a3\data_f_curator\sound\cfgsounds\wind2.wss"
"a3\data_f_curator\sound\cfgsounds\wind3.wss"
"a3\data_f_curator\sound\cfgsounds\wind4.wss"
"a3\data_f_curator\sound\cfgsounds\wind5.wss"
You could play them using playSound3D.
playSound3D ["a3\data_f_curator\sound\cfgsounds\wind5.wss", player];
Your trigger can have a size of 0 and would still work. Your condition doesn't need an area at all
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
an easier way than what? ^^
we have the Conversations system https://community.bistudio.com/wiki/Conversations
if you only want to have one by one message, you can use the old say method https://community.bistudio.com/wiki/say
this is what ive been looking for
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
so it's removeAction that has an issue ๐
oh i forgot to tell im using the action condition to hide it and get same result (as if it were deleted)
Do trigger sizes really have that much impact on performance?
I don't think trigger area size matters, but rather, if it has area or not
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
thisandthisList. - 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.
Probably not but it clutters the editor interface
It doesn't matter if there is no condition that uses it
The larget triggers I have are ones tried to individuals, so if they die anywhere on the map etc
That's killed EH id for
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.
So whats an example of how to use that? I need to know how to before I start messing with things haha
Local means it fires only where killed unit is local
Global will fire regardless of object locality
How would I write that in this trigger?
I wouldn't use trigger at all for this
This means I would have to add the EH to the server and headless clients? And of course Zeus because this is thing I have to count in as well.
You need to add where unit is local
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
Maybe there is global version of killed EH? Don't know
You can also look into mission event handler instead https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#EntityKilled
Is this for MP or SP?
Singleplayer and optional coop
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.
we lost-a our medic!" ๐ค ๐ฎ๐น ๐
Add to medic's init:
this addMPEventHandler ["MPKilled", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
hint "He died";
}];
Whoops
You may want it as a string. Because the way you do it, will store it as a float, and precision loss will mess it up
Note a string with '' so the macros are still resolved
I need to be careful though because its only a part of a wider system
If you just want to print something when unit dies...
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?
If this is not present in condition, then it won't use area or any other stuff set in trigger
Yeah but where are the tasks gonna be linked? Dont they need a trigger to be created
You have something linked to the trigger?
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?
You would have to create the task from EH too
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
You would have to create task by script then
this addMPEventHandler ["MPKilled", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
hint "He died";
if(isServer) then {
[
blufor,
"KIATEAM1",
[ "medic died text", "MILLER IS KIA!" ]
] call BIS_fnc_taskCreate;
};
}];
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
You try one and see
@young mist , if your triggers don't check for presence of objects in their area, then there is no point in specifying their size.
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;
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
I guess they get removed by some other script
Yeah, allDeadMen
Can I add something in there to make sure it excludes them?
So they are hidden not removed?
allDeadMen - [DEADPILOT11]
Ill give this a go
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.
Ill try schatten's solution first and see if that works
Just to make sure ive typed it correctly
lol happy birthday
It's OK, you can even remove parentheses before allDeadMen and "]".
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"....
all gets it I can easily understand how might be implemented.
You'd think lol
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
- 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)
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
Event adding behavior is same for all 3 MP events?
I will push for description fixes for #community_wiki then.
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
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'
I thought EHs get created only on machine when you manually added them
Add a return statement (it basically already tells you that). If its a mod, tell the author to fix it.
Also this is Arma 3 channel
If you are referring to my convo with Dedmen that is about addMPEventhandlers.
The so-called "Multiplayer Event Handlers" : https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Multiplayer_Event_Handlers
Global object event handler, executed on every connected machine.
oh i did see it was arma 3 my bad
Had no idea that existed 
That runs locally for the machine that adds them.
Happy birthday ๐๐!!!
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
If you have any questions regarding the video, please reply to this topic here
if you have any arma questions in general please post here
https://forums.bohemia.net/forums/forum/154-arma-3-mission-editing-scripting/
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 
I rather stick to triggers in my case because of time and so on.
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.
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
Firstly, your artwork is absolutely sick. Secondly- you gotta just throw me a bone- watch the first two videos! Best case you have revelations which hella improve your mission and cut down on time it takes to do things. Worst case you're out 23 minutes of your life. Humor me!!!
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
Unless your GP or doctor has said "you only have enough time left to add triggers. Not event handlers." Then I'd say there's plenty of time.
This to me is more of a willingness to learn. Grab a coffee. Invest a bit of time every day or every few days and you'll be able to achieve much much more
I invest that all in art at the moment lol
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
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
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
Here is a super simple example mission :)
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...
Anybody that says they don't remember OFP oughta be shamed publicly and banned
Think that vid came out when BAF dlc came out for arma 2 in 2011 or 10
-# I'm young and only played a little bit of Arma 2 and Arma 2 OA haha
OFP is from 2001
It would run fine even on shit PC these days
I still have my campign saves back from 2010

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?
Vs vanilla, that completely depends on how many mods, and how many of them are poorly written.
I see, so whats it like for modded vs unmodded for you?
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.
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
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
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.
HAH! That's where you're wrong kiddo :p
Big view distance / terrain details = still performance tank
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.
That is zeus wind sound, not normal wind sound
Issue with that, is that once I play it, it starts playing it at the location where player currently is, if player movies, the sound gets left behind
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 ๐
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.
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"
And always you can create a new sound that uses the xx sound path and add more volume, distance etc.
Yes, that is what I mean by use playSound, and create a description.ext file.
allGroups is not properly MP sync'ed
Why am I not surprised
@tough abyss I did a group cleanup on server and clients too
Is there any possibility to get the weapon attachments of a weaponholder?
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.
Ok, got it. WeaponsItems works for it.
Yeah sure, there can be multiple weapons in it. I'm iterating threw the result.
WeaponsItems
This returns attachments on weapons too?
Got this result: [["arifle_MX_ACO_pointer_F","","acc_pointer_IR","optic_Aco",["30Rnd_65x39_caseless_mag",30],""]]
cool
Works since 1.21 if I can trust BIKI
But this is for soldiers / vehicles and not weapon holders according to the doc
Since Arma 3 v1.21.124406 it is possible to query weapon holders and ammo crates with this command.
Oh. roger. neat
Really good to know. Never thought this could be possible one day.
So what would happen if you put weapons inside a vehicle?
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
],
""
]
Yes, but what if I put an MX inside?
inside the cargo. This isn't really thought through.
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
_unit getHitPointDamage "hitHead" > 0.9
The unit might die from a big explosion or setDamage 1, in which case it will incorectly report true
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
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
No
https://community.bistudio.com/wiki/setVehicleTIPars You can set how active a vehicle is
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.
SOG does some setAperture or setApertureNew trickery to make your screen darker, but this won't have any effect on AI
https://community.bistudio.com/wiki/setAperture
https://community.bistudio.com/wiki/setApertureNew
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
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 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".
Last time I used a rope (like two days ago) it looked normal.
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
https://youtu.be/G7EH9zfxvaI
looks normal to me. Ropes bounce around when they're laying on vehicles.
Trying to hide an IED until the player enters a zone
It's just hideObject (or hideObjectGlobal executed on server, if you want to hide it for everyone).
Same as units.
Yeah ive tried it but for some reason its not applying their vehicles
I have to keep them visible and simulated
Then your code is wrong :P
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?
You hid the units, but not the vehicles.
@granite sky
"looks normal to me. Ropes bounce around when they're laying on vehicles."
Of course, but it flies to the roof automatically ๐
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?
Not necessary, yes.
It's a separate object so it needs to be hidden separately :/
Ah alrighty
Slightly weirder one is that hiding the object doesn't hide the occupants, but hey, Arma.
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)
No.
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.
Okie dokes ill give it a goes
you might want to disable simulation on it too. objectName enableSimulation false then make it true when unhiding it.
Glad I could help
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
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...
dang, ohwell
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?
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
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
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
Does anyone know if โจCfgCloudletsโฉ can be overridden by missionConfigFile?
Ex. I want to override a parameter of โจSmokeShellWhiteโฉ inside โจCfgCloudletsโฉ with the missionConfigFile
No
no, im just looking for a way to coordinate my units... using time seems like a logical value for that
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
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
fireAtTarget doesn't have a magazine parameter though?
You could check for simulation instead of class
Also cache result in hashmap
Sort of, but its plenty of work, you'll need to go through magazines and decide which ones are HE, then load needed magazines (if its not loaded), and only then do fireAtTarget
- Complex: Check
hitandindirectHitof the warhead (if its submunition then check that) - Easier:
warheadNamefor beingHEin the CfgAmmo
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
yup, that's pretty close to what i wrote:
https://github.com/thegamecracks/420th-Stats-Tracker/blob/f640a66/addons/main/Functions/Stats/fn_statsInit.sqf#L31-L42
didn't account for all the non-x variants tho, or uavpilot
are there many vehicles that use those?
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
Probably none, not sure if these function right in A3 at all
uavpilot is better left ignored as you have it now, so you don't get extra kills for invisible UAV crews
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
does anyone know if there is a way to toggle combat pace via script?
like, change from walking to jogging?
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)
you can forceSpeed iirc for jogging
for weapon up, set behaviour combat and set unit pos up
(for AI)
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?
if action doesnt work you can try forcing the animation action - unit playActionNow "Combat"
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)
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
Hmm... the engine must be overriding it then with the user key i guess
You asked in ace discord and I answered there too, but they only work on cars
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?
it's meant to be working on tanks too but yeah i guess needs perf branch
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.
see if they fire with EH fire ?
@fleet sand Nope, it doesn't "fire", it turns on with the L key, as a common flashlight.
This dosent work ?
player isFlashlightOn (currentWeapon player);
No
Recall it is one of action
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?
For flashlight? I think "headlightsโ is for car headlights
It is the same action
I meant the event itself, where the flashlight could be turned off.
Switching weapon doesn't necessary turn off flashlight
If you have flashlight on both primary and secondary weapons, flashlight can stay on when switching
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.
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
@covert oak If you need to do it fast, then you can turn the unit to target and doTarget + fire.
behaviour also matters for some reason from my experience
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.
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" ๐
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
@covert oak Try this: _unit reveal [_target,4]; With knowledge 1 AI will not attack most of the time.
Nope, just stares at it.
Try COMBAT or some behaviour
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. :\
Of course it won't, use setUnitPos and forceWeaponFire
He knows it won't shoot back ๐
In this case you better to create an invisible soldier
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.
What about using unit, which is invisible and can't take any damage as target?
That's what MaxP suggested
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.
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.
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.
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 ๐
I read somewhere today it can be used for UGL's. Could be wrong.
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);
๐
Dead are removed from groups anyway
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 ๐
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
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
// 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
remember, [player] ๐
cant say how many times i've made that mistake too lmao, joinSilent really should have an alt syntax of just object
@hushed turtle
Dead are removed from groups anyway
Usually ๐
There are some cases they are not.
Why would a mod crash on stable but not crash on profiling?
a bug that's been fixed ๐คท
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
config-wise yeah there's bouyancy settings, scripting-wise i think your best bet is just keeping it above water by disabling simulation and optionally making it bob up and down based position Z of ASLW
surprised setMass didnt work tho
Kinda found a solution. I will attach it to a balloon
Setmass made it sink slower
is it possible an ai group to stalk many groups (the closest one) ?
any alternative of unitcapture im tired of tweaking models ??
I will go sleep, you can send it if you want
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
ooo thanks I will try
I think there might already be a mod for that too.
If you find it drop link pls. I will check the workshop
Found it. https://steamcommunity.com/sharedfiles/filedetails/?id=1631723641&searchtext=connect+UAV
Thanks
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
Can someone tel me the spefici usage of moveObject?
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
"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.ย "
You are not able to extend related ui slices for whatever it is?
Console from Advanced Developer Tools mod
or Arma Dirt Track, one hell of a mix tape
Even has its own mixing console apparently too ๐
No its not ui related i have some event handlers and whatnot added in preinit that do things based on the weapon you have
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 
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
};
How do I do that?
diag_log your_fnc_functionName;
Is it supposed to only show the first 13.5 ish lines?
Seems like it exists then.
There's a character limit on diag_log, like 512 characters I think?
Alright, makes sense
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
remoteExec
Right I just dont understand the flow
let server check the players getPlayerUID then remoteExec to target client and let that client remoteExec back to the server or your PC
Ahh okay, im server admin so just run it from server side then
maybe too complicated 
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
Run Global code to have each player setVariable own settings
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
You could just get all the players and wait until [array of players] findIf side group _x == west and alive _x != -1
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?
You can have a vehicle with laser. And script aim and turn on the laser. Or you can do a lot of stuff to fake it.
Like what?
drawLaser I suppose, and create the laserTarget object for the correct side
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
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.
Ahhh so if I put _vest = ""; at the beginning of the second one, it would work?
For what you want to do, just declare those four vars before the switch. Doesn't matter what you set them to.
Thanks, that helps a lot!
Fastest method is private ["_vest", "_helmet", "_facewear", "_uniform"];
Aha, that's money
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
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.
Are you saying it might work if I include an output (nil, as you suggest) at the end?
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
Which mode are you using for the Execute Code module? Global, Local, Server...?
Global and Local both have the same effect
Local is the one to use for this, the other modes could have unforeseen consequences
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?
That's what I'm confused about. Unless there's a better way to debug variables than diag_log, if the _kit output is coming out perfectly and the log that lists all of the individual items is right then I don't know where else to check. I did also verify that _unit remains the same all the way to the end in a different test.
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
I'm pretty convinced something is nil and it's running in scheduled context. To me seems the only explanation why your diag_log would run but a command like setUnitLoadout wouldn't run with the proper arguments. Unless you've got the command disabled on the machine you're debugging on or something which I highly doubt.
Yeah setUnitLoadout works just fine when I use it on its own
If setUnitLoadout was disabled then it would simply do nothing, rather than stripping the unit
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?
Ah yep, forgot it was stripping.
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?
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
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
Ok you might be onto something. When I switch the last diag_log to hint, it shows empty "" instead of my values
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
๐๏ธ ๐๏ธ
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
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?
I'll try it
Should ideally just be getPlayerUID _unit no need for getUserInfo or any like command
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
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
Just wanted to say respect on the toString- man of culture too I see 
It's easier to maintain
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 
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
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.
Does this fire even when _unit is not local?
https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#EntityKilled
lol after losing arsenal kits, missions, and more.. I back up my whole profile every week or so ๐
Is the a benifit to using setVariable / getVariable instead of publicVariable? Where would one be more ideal than the other?
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.
in local host when I use briefing modules the text is shown twice, any solution to this? ๐
Very unlikely. Technically, you can find the exact control that shows the UH-80 Ghost Hawk in this context via some script commands, but I do believe you cannot just ctrlSetText over it
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
What is "other" in this context?
OH some guerilla forces, its for a test run
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
whats the first one???
i can hide units?
Yes
Alrighty, ty 
how do i do that? ๐ญ
There is a guy on youtube called Gunther Severloh and he has some very good in depth tutorials on how to do stuff like this. Its a perfect place to start.
ay thanks man lol
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
hideObjectGlobal command can both hide and show
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?
There is no much options to do that
https://community.bistudio.com/wiki/soundVolume
Unless I don't understand the point you want to achieve
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
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
There is no native way to detect sounds' volume, nor sound volumes you hear around
Does anyone know how to add loacations to the EG Spectator?
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?
``` - will it work, or requires me to use ```{_x addEventHandler ["LeaderChanged".{params ["_group","_newLeader"];};]} foreach allGroups;```
First snipped don't work :{
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
Why do you have AI in your squad if you want them to stay put super far away from you?
๐คจ
Mounted on AA, holding positions.... and anything else lol
When you die the AI take the lead and they all dismount
Why are they in your squad?
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
Are you talking about Warlords specifically?
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.
If they're 10 km away and you want them to stay in a mounted weapon, why not just have them as their own squad?
You buy a weapon ( AA for example ) > buy an AI > Mount the AI in your weapon etc.
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
They just join your group when you buy them
Yes done technically via a "recruitment script"
It's still not clear what kind of scope you want your solution to be.
If you want a mod that always alleviates the issue, a change to the mission, or a way around the issue without modifying things.
Yeah I was hoping I could use some leader change capture and just make them stay put
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
Ill take a video
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
At this point it's not quite sure what exactly causes it. Warlords or some Mod or some other script or Engine
Can't test right now, but player being "out of command" when they eventually notice it will lead to some other ai taking command
I had found this a while back
but its antistasi so maybe its got the same type of code
Same exact issue
If its directly related to only warlords and these types of mission, then I apologize for my confusion
Does it occur in any other missions?
? Well the general case of AI taking over incapacitated (certainly dead) player is base behavior of the game
No? One soldier took the command in my test
Did you die?
No
Ah, I just checked in Warlords. They actually try to form their formations and left the statics
What about a basic mission with the vanilla revive system?
Okay just repro'd the issue with just an Eden mission
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.
nah they stay put, i just tried with normal mission in MP editor
I didnt realize it wasnt a base game issue
It is an "issue" from base game, yes
I wonder if adjusting their rank will change anything
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
If the vehicle is locked they stay put, maybe I could incorporate something to lock all owned vehicles when the player goes down
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
I actually checked assignedVehicle. When they sit all statics are assigned, assignedVehicles doesn't seem to matter
Does assignedVehicleRole differ ?
units group player apply {assignedVehicleRole _x}
->
[[],["turret",[0]],["turret",[0]],["turret",[0]]]
So no
Yeah this is interesting. Just repro'd as well
Confirms i am not crazy. Lol
Something feels off
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
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.
Granted if they are in a vehicle they do drive to you. So maybe thats what the goal was
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.
I mean this functionality is totally intended, but Editor-placed static or ordered to getin'd static make it differ is totally strange
Yeah I am not sure why. I was hoping it was the assigned state because then at least that would be a useful "toggle".
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"
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
Hmm yeah
there's unfortunately no unconscious state EH
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
Right, I was thinking AnimChanged would be close enough
eh yeah kind of? theres multiple uncon animations though so it wouldnt really work reliably
just check lifestate each frame and accept the sacrifice of 0.001ms ๐
very true lol
params ["_unit", "_anim"];
if (_anim isEqualTo "amovpercmstpsnonwnondnon") then {
do something....
};
}];```
Maybe I could just list every single one here
Or just monitor every half second and store the AI positions every time is awake
- lifeState / incapacitatedState
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
Down or dead, and do you have an outstanding group way point?
Negative, just put them in the Static vehicles etc, and do "stop"
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
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
Sometimes you will see in the chat box "taking command" spoken by a random AI in your group
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.
will mess around and test some things, particularly waypoints and see what the result is
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.
No they never attack they just all flock to your position, of course they will engage enemies within line of sight, like if an enemy is directly in their path of travel, but they dont get set to any engage command for example. I suspect its just a single move waypoint tbh
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
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.
Im just in editor with no mods or mission, just 1 player and 3 subordinates. Mission starts, no waypoint, command the AI to get in a vehicle, go incap, they jump out and run to your loaction
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.
Set editor move waypoint > go incap > group stops in place, any AI in a static just jumps out and stand guard at their position
Hmm interesting, so does seem incapacitated is different in this regard.
Im going to sift through functions viewer and see if I find anything
Do they do that if you just setUnconscious directly, or is this some revive system?
vanilla a3 revive
If you take a hit (bullet, explosion's etc) you go incapacitated with visual effects, the AI will get out of the static.
However, if you use setUnconscious - - there are no visual effects, and the AI still hops out.
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.
It's a command, not a function
Yeah I see everything about revive etc. So a command is hidden in the engine then? We dont have access to that?
https://community.bistudio.com/wiki/setUnconscious
What access? We can use it
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
If that's what you mean, no, commands are always engine driven
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.
Is there any leader switch just from setUnconscious?
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
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
Should have a damn player check in the least. This makes playing with single player lead squads a nightmare
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
yeah I don't see why they put that sort of behaviour into setUnconscious.
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.
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.
You think diagnostic branch would show whats going on?
I imagine the new leader just has his own idea about where units should be.
Yeah. Totally weird to me how the AI will get out of the static, walk a few meters, and walk back and remount the static if he's the only one alive in the group.
Add another AI to the group, repeat, he just gets out and walks away
I find that to be very strange lol
I can't replicate them getting back on the static.
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.
It's not incap specifically. If you joinSilent yourself to another group they do the same things.
So when he "takes command" - he's just rejoining the group?
(the player after respawning)
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
Its MP editor session idk if it make any difference
It might. I don't know BI revive very well.
In Antistasi it would, because we just use the engine respawn in MP.
Strangely the outcome is the same with and without revive system on
It's probably engine respawn then.
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
Check this out
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.
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.
Yeah its definitely beyond my knowledge lol
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.
So just assign this EH to each vehicle upon purchase?
params ["_vehicle", "_role", "_unit", "_turret"];
if (!isPlayer _unit) then {
_unit moveInAny _vehicle;
};
}];```
maybe. Not sure exactly how GE moveInAny is.
OH!
I see now
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.
How can I check if SOG DLC is loaded? Ideally by preprocessor commands
it should be in https://community.bistudio.com/wiki/getLoadedModsInfo
With ACE I was checking it by __has_include, but ACE is open source, so I can see their file structure.
preprocesor is hard for this because the configs arent loaded yet, at that point
At mission runtime?
I was checking for configs files themself ๐
kinda curious my self on how to check configfile in preprocessor, if possible
I'm not talking about checking what's inside
Just if file exists, meaning addon is loaded
yea i hear you, just stuck in the configs my self ๐
could be better solution for you as well
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
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
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 []
iirc there is few commands that work on server side scripting, for more, use addMissionEventhandler
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.
How do I edit to make where AI CSAT drop IFAKs when killed?
Can assign EntityKilled event to the units, and check their inventory for ifaks upon death, count them, delete em, and spawn equal amount on their pos of dead body.
no, I need exactly this https://community.bistudio.com/wiki/Arma_3:_Server_Side_Scripting
the wiki says it should work
Remove the slashes.
Why does it need to be that exactly? This should be near exact- should work with whatever your use case is
https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#OnUserConnected
I need the script to work even before the mission loads
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
Does .cfg really support preprocessor?
Learned something new if so
wow i'm glad i don't Dedicated Server: oh my: all that stuff looks hard to get right ๐
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 
none of it make sense to me unfortuantly haha
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
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
no i've tried that same methodology already
You can use triggerAmmo on the thing to make it explode
excellent
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
https://community.bistudio.com/wiki/Arma_3:_Server_Side_Scripting#Shared_Commands
Supported list is shown here.
It is supported.
And you are getting back a empty array, so its working too (and returning data).
Either you're passing the wrong.....
Yes you're passing the wrong argument.
onUserConnected passes a playerID, not the "DirectPlay ID" that getUserInfo want as argument.
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)
I tried that too, the ai does not care and will switch back
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
๐ซ

