#arma3_scripting
1 messages ยท Page 209 of 1
if the windows shortcut is getting too long, you might want to write it inside a .bat file instead, though this is a question better suited for #server_windows
(FYI putting mod folders on your desktop means you have to write the absolute path to each mod, which will make your command even longer than if they were inside your server install)
Ok ill go that section and see how to make a bat file for them
Hm, parseSimpleArray removes all the parts that can't be parsed if at least one element can, so it doesn't show like ['string1', 'str as an error in my gui
What is the difference between game master and game moderator when choosing virtual entity at the lobby screen?
You could
count str parseSimpleArray _input >= count _input
so if the str'ed parsed array is much shorter than input, something was probably cut off?
You can also use script error eventhandler to detect the error itself. But for that you probably need to wrap t he parsing in a isNil
Depends entirely on how the mission has those entities set up.
The Game Master usually means Zeus, but there are a lot of different ways you can configure a Zeus entity, so there's not really any guarantee of it behaving in any specific way, beyond "has access to the Zeus interface in some way".
Game Moderator is not an engine concept so it could mean literally anything. It is completely at the discretion of the missionmaker as to what that slot does. It might mean a player who gets certain administrative powers to deal with players behaving badly, but that's just a guess.
I am trying to setup a zeus slot in the lobby. Currently I have added a virtual entity Zeus from the editor logic entity tab. However when I play test that slot it does not have the zeus interface and instead the camera position is on the floor.
The Zeus entity is just a fake body for the player to inhabit. What actually gives them powers is the Game Master module, with the Zeus entity set as its owner.
(You can actually also do this with script commands, the module just runs those commands on the owner object, but unless you want to create a Zeus on-the-fly, the module is easier)
Ah okay so I should place a Game Master module and the Zeus entity. I think I tried this already by right clicking and syncing them. But I havent tried giving the entity a variable name and writing that in Gamer Master owner field.
If you know your Zeus's , i usually use playeruid, so when user joins he has zeus (without even selecting zeus object/unit from lobby)
I assume that the different zeus here only allow editing of that side?
If players elect to not use a zeus, it apparently will be an AI. Will this cause issues?
Will isPlayer return true for Zeus virtual entity?
I don't know exactly what the purpose of those is. You could be right, but maybe you should test it.
AI as Zeus doesn't do anything.
Remember, AI in slots can be turned off in the lobby by clicking the icon to the right of that slot.
If it's a player, yes.
Oh boy, then I need to redo a lot of conditions...
Don't overthink stuff too much xD
I want so hoping that virtual would return false, even if a player was in that slot.
only a player is going to use zeus, so why need to check that?
Like I have a condition that returns true if all players are in a boat. If someone chooses the Zeus slot with a forced interface then they can never enter the boat.
So then I need to exclude Zeus in the condition for that somehow right?
but what about forced interface ticked in the module?
as I understand, it's forced for a reason
Just filter by side
Most use cases are pretty short arrays. It's just slow even on those. I think my conclusion was that the problem is with the comparison. 95% of the time you're just sorting number + stuff, but it goes back to some crazy gamedata decision tree every time it compares two values.
If a virtual entity with forced interface is occupied by a player, then isPlayer will return true for them, correct?
sorting array that's already in order is the same speed as one that's unsorted.
did you test playing it on that slot?
to see what happens
Like adding a BLUFOR check will exclude the Zeus?
I play tested but did not do an isPlayer check. I'll try that now.
if (isPlayer zeus) then {hint "yes"};
There is some information about Virtual Entities and their player status on https://community.bistudio.com/wiki/allPlayers
before that, I must ask what are you trying to achieve with that? For me it's just overthinking, but maybe I misunderstood
Virtual entity are players and the side returns logic, so I will do as Nikko suggested and make that check.
Look above for my comment about the boat. I have some conditions like that, that will hard lock players from progress if I add the Zeus as a virtual entity with forced interface.
So if a player enters the zeus slots, you want to "stop" the mission progress at that moment
I'm say that situation will happen now. If I don't add the zeus then I'm fine.
what about making a whitelist? that forces the player to the lobby if they enter the zeus slot
I'm not sure how to explain this any other way, and sorry for the confusion. Basically I have some conditions in some triggers. Those conditions will no longer activate if a player chooses the Zeus slot. I want them to have the option, unless I have to rewrite 100 triggers. So now I must go see how much effort this will take and make a decision if I really want to add this Zeus slot.
yeah I don't understand your mission design
They have a boat. They have a trigger that checks if all players are in this boat. Currently, that "all players" check would count virtual players who cannot get into the boat, so the trigger would never complete.
The solution is simply to exclude players on sideLogic from any checks of that sort.
Correct.
ah okay makes sense
Thank you everything is working now, I have a question, how would I implement in your script to make Blufor units invulnerable to damage in the safe zone from enemy fire?
I think a simple _player allowDamage false; does the trick, and don't forget to put _player allowDamage true; in the removal file
gonna give it a try
Do I have the right idea here?
isNil "skipToInfil" && ((allPlayers select { side _x != sideLogic } - crew ptboat) isEqualTo [])
That's one way to approach it. There are others but that probably works.
I'm open to cleaner/easier options.
Got some errors and refined it to:
isNil "skipToInfil" &&
(((allPlayers select { !(side _x isEqualTo sideLogic) }) - (crew ptboat)) isEqualTo [])
Whats wrong with this:
private _handleDamageEH = _player addEventHandler ["HandleDamage", {
params ["_unit","_selection","_damage","_source","_projectile","_index"];
_damage = 0;
false
}];
localNamespace setVariable ["PIG_safeZoneHandleDamage", _handleDamageEH];```
replace false with _damage
or just do _player addEventHandler ["HandleDamage", {0}];
Note that returning 0 will not only nullify incoming damage, but also heal any existing damage. The last value you return in a handleDamage EH should be the desired final total damage, not the damage to add.
That might be fine for your usecase, but just so you're aware.
For that case I would just prefer to use allowDamage instead
this is your original script along with the EH I'm trying to add but I still took damage,
private _action = _player addAction ["Zona Segura",
{
params["_player"];
if ((!weaponLowered _player) || {((currentMuzzle _player) isNotEqualTo '')}) then {
cutText ["Zona Segura",'PLAIN',0.2];
};
},
nil,
-99,
false,
true,
'defaultAction',
toString {focusOn isEqualTo _originalTarget}
];
localNamespace setVariable ["PIG_safeZoneWeaponAction", _action];
private _firedEH = _player addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
if (isClass(configFile >> "cfgMagazines" >> _magazine)) then {
cutText ["Zona Segura",'PLAIN',0.2];
deleteVehicle _projectile;
[_unit, _magazine, 1] call CBA_fnc_addMagazine;
}
}];
localNamespace setVariable ["PIG_firedSafeZoneHandle", _firedEH];
localNamespace setVariable ["PIG_firedSafeZoneHandle", _firedEH];
private _handleDamageEH = _player addEventHandler ["HandleDamage", {
params ["_unit","_selection","_damage","_source","_projectile","_index"];
_damage = 0;
_damage
}];
localNamespace setVariable ["PIG_safeZoneHandleDamage", _handleDamageEH];```
Anyone know if there is a way to either have a script or mod that will alter the color of the base game fog? I'd like to have it be a brown haze instead of blue. Sa'Hatra does it, as does WS with their fog module, but that's all I have been able to find.
try allowDamage instead, before using that EH, it's a simple command and I think it's just enough for what you're trying to achieve
so just replace the entire EH with _player allowDamage false;
It appears that Zeus Logic Entity will not satisfy editor-placed triggers with the condition Any Player Present. I wonder why?
It's great news for me but just curious.
๐คท
Keep in mind that the Zeus entity is not attached to the Zeus camera and will usually stay where it was originally placed
Ah, I was assuming the camera is the entity. Retested by placing the logic entity in the trigger area and it did fire this way.
So I noticed that I take damage while in a vehicle but i dont while on foot, would _vehicle player allowDamage false; do the trick
well you can add that I think, just do some if check to add this to player inside a vehicle as well
I dont know how to do any of that I'll do some research and see if I understand
try if !(isNull objectParent _player) then {<put the code here>};
I'm not home so it's just a guess
I know that I can use the eventHandler โTaskSetAsCurrentโ to intercept when a task is set to ASSIGNED for the player, but is there also a way to intercept when a new task is generated or when a task is marked as completed?
Having a hard time with my helicopter scripts and maybe someone can help me out. For Dynamic Horror Ops, the helicopter in base has a system to get an INFIL location and then is activated to go to that location via an addAction. Everything works properly for those functions. The issue is that after heading back and landing at base (_wp2), the helicopter refuses to spool back up for any more waypoints unless they are manually created in zeus as LAND waypoints. This really ruins the scenario flow, as most players INFIL via this helicopter and then use that same helicopter to EXFIL via the transport support module.
I've tried applying various doStop's and resetting the helicopter's land command with another waypoint (_wp3), but literally nothing seems to work. This is extra frustrating because when I released this scenario a few years ago, everything functioned correctly. I'm not sure if an update has changed something (perhaps this is a multi-threading issue?), but I cannot get it to work correctly again. Please help lol
For context, you can check the GitHub repository for this scenario: github. com/UselessFodder/FS-DynamicHorrorOp/tree/v0.3
fn_selectHeliLZ.sqf:
//Credit goes to Erwin23p on BIS forums for the source of this code: https://forums.bohemia.net/forums/topic/237559-open-map-and-set-waypoint/?do=findComment&comment=3454296
//must be run only on MissionCommander client
openMap true;
hint "Select helicopter landing zone on map.";
onMapSingleClick
{ //Inside here code to execute when clicked on the map
_heloWaypoint = createMarker ["LandingPosition", _pos];
_heloWaypoint setMarkerText "Heli LZ";
_heloWaypoint setMarkerShape "ICON";
_heloWaypoint setMarkerType "hd_pickup";
"LandingPosition" setMarkerPos _pos;
onMapSingleClick "";
hint "New LZ selected!";
};
//FOR SAVE ***
/*
this addAction ["Select LZ", "functions\Base\selectHeliLZ.sqf", nil, 1.5, true, true, "", "_this == MissionCommander", 10, false];
this addAction ["** Begin Insertion", "functions\Base\heliInsert.sqf", nil, 1.5, true, true, "", "_this == MissionCommander", 10, false];
*/```
fn_heliInsert.sqf:
```//send helicopter to insertion location defined by param marker name, then wait until players unload to take off and RTB
//***TODO un-hard define this marker
//params["_marker"];
private _marker = "LandingPosition";
//check to ensure marker is already set
if(getMarkerPos "LandingPosition" isEqualTo [0,0,0]) then {
"You must select an LZ first!" remoteExec["hint",MissionCommander];
} else {
//send to lz
_wp1 = heliGroup addWaypoint [getMarkerPos _marker, -1];
//set to transport unload and safe
_wp1 setWaypointType "TR UNLOAD";
_wp1 setWaypointBehaviour "CARELESS";
//ensure heli waits until its unloaded with DEBUG***
_wp1 setWaypointStatements ["count (crew transportHeli) < 3", "diag_log 'Players dropped off by heli'; MissionCommander synchronizeObjectsAdd [supportRequester];"];
//create move waypoint back to base
_wp2 = heliGroup addWaypoint [getMarkerPos "mainBase", -1];
_wp2 setWaypointStatements ["true", "doStop transportHeli; transportHeli land 'LAND';"];
//clear previous land command
_wp3 = heliGroup addWaypoint [getMarkerPos "mainBase", -1];
_wp3 setWaypointStatements ["true", "doStop transportHeli; transportHeli land 'NONE';"];
_wp3 setWaypointTimeout [60, 60, 60];
};```
use https://community.bistudio.com/wiki/landAt syntax 3
WILCO, trying now. This has been making me tear what little hair I have left out because this script worked fine last year lol
Damn, no go. I've been suspecting there is a locality issue, but even when remoteExecCall-ing on the server, this issue persists.
I don't know what's going wrong because there are no errors or anything. The pilot simply refuses to do anything other than another manually placed LAND waypoint in Zeus. Even more land or landAt commands are ignored
Test the command isolated, then apply it later to your code
it's little tricky to get it right
So, it's worth mentioning that I have no issue getting the helicopter to land where I want it. The issue is that after landing and cutting the engines, the helicopter crew refuses to take any other action. Even when running these commands in the console on a fresh scenario, this issue persists
However, If I take the crew out and put a new crew in, then I am able to force them to move successfully until another land or landAt is given, then they will also be stuck in the same way
Now that I've done some more testing in a fresh scenario, however, I think I'm seeing why the unit will not do any other action: after giving any sort of land or landAt command, the unit is forever returning unitReady = false
I'll figure it out. Thanks for the help anyways PiG
Can be end screen text changed using SQF? Right now it's defined in Description.ext. I want to display number of remaining enemies when all players die and both chat and hints get hidden when end screen appears.
Section(third page on end screen) can be added with global structured text variable. That will do
Does anyone know if its possible to lock some doors of the USS Liberty? I want to lock players inside the ship, at the moment im using invisible walls to prevent players from opening the door, it works if ur looking at the door but if you turn to the side or turn ur back to the door its still possible to open them
Are there more NPC animations we can choose from besides:
https://community.bistudio.com/wiki/BIS_fnc_ambientAnim
I was looking for a salute animaiton.
use switchMove/playMoveNow instead
you can find all animations in animation viewer
or if you can get the player to perform the anim, use animationState and copy the anim name and use it with those commands
Awsome thanks! I haven't messed with the animation viewer before. How do I access it? Do I need to load a mod or from the editor somehow?
what is the diff in / does anyone Know ?```sqf
switchMove / playMoveNow
I highly recommend Polpox's Artwork Supporter for its Animation viewer as well
ahhhh i see now woohoo It is a good practice to always use playMoveNow after switchMove to make sure the animation plays correctly when using the first syntax:
in vanilla, if you pause the game with debug console active you can find it at the bottom of the console, next to config viewer and gui editor and other stuff
in ADT it's under tools.
dunno about other mods
but yeah Polpox's Artwork supporter is better than vanilla anim viewer
yes, or use the new syntax for switchMove (the one with []) which does this automatically
What is playAction used for? Seems similar to playMove.
ive been hitting my head against a wall trying to write a paradrop script thatll:
Teleport multiple specified vehicles to another specified vehicle
Detach said vehicles
Add a parachute to said vehicle
can someone help me out?
Also i barely understand coding
I've noticed while messing around in zeus, that some vehicles have parachutes already applied somehow. I know this because if you move them from the ground to up high they auto deploy. Might be worth testing in your use case.
i dont think that works in the eden editor
do you want me to write it for you, or do you want me to help you get there?
help me get there
id rather learn that and then expand that knowledge further
i know that you should specify given units you want to tp and that the tp funciton itself is (unit) attachTo(x) and detach(unit)
its worded awfully but
basically i know how to paradroop regular infantry regardless of loadout
Teleport multiple specified vehicles to another specified vehicle
- Know what an array is. You'll need an array of vehicles
- Iterate over that array with
forEachorapply - Get the position of the target vehicle with
getPosATLorgetPosASL(do you want height above ground, or height above water?) - Set the position of the teleporting vehicles with the corrisponding
setPosATLorsetPosASL - This position probably should be a couple of meters below the target vehicle due collision (you can do this with
vectorAdd)
Detach said vehicles
- Not needed
Add a parachute to said vehicle
- Create a vehicle based parachute which is
B_Barachute_02_FusingcreateVehicle - Set that parachute position to the same position as the moving vehicles target location
- Attach the parachute to vehicle using the correct attachment point
Additional:
- Use a waitUntil and check the z index of
getPosATLand see if the vehicle is nearing the ground - Detatch parachute from vehicle
@little raptor do you mean this one ```sqf
[_player, "AmovPsitMstpSlowWrflDnon"] remoteExec ["switchMove"];
thanks, ill note it down and mess around in the editor
and here's a spoiler for you if you get stuck. You might not understand it all, because it uses pretty in depth CBA stuff, but it can give you an idea. You can also just use my mod Modules Enhanced that has a module to do this for you. This code is from that:
double thanks
some of the animations work with the various move commands due to transitions and stuff. If your specific animation doesn't work with your current command, just find one it does work with.
playAction plays actions, which are context defined animations. for example, you can have an action called MoveF which plays a move forward anim based on your stance, weapon, and weapon mode
playMove plays anim states. these are pure animations (e.g player playMove "AmovPercMrunSrasWrflDf" plays "move, standing, running, weapon rifle, raised, forward" anim)
not every anim is mapped to an action. so playMove is more versatile but you need exact animation names
@thin fox I got this script to work and I want to thank you for your help
while{true} do {
{
if(side _x == WEST && _x distance (getMarkerPos "safeZoneMarker") < 20000) then {_x allowDamage false} else {_x allowDamage true};
} forEach allUnits + vehicles;
sleep 1;
};
};```
no
that's a remoteExec for the first syntax
I mean the alt syntax which is like player switchMove [""]
ahhh ok m8 thx
good thing i w8ed for your reply i would off had the all messed up ๐
I want to use this animation player playMove "HubBriefing_loop", but for some reason it wont play it. I can get some to work like AmovPercMstpSnonWnonDnon_SaluteIn. But none of the hubBriefing ones seem to play.
good ๐ but I don't recommend using that kind of scheduler with infinite loop, my script works just like that, if you want to put all WEST units, you just need to change the activation of the trigger and its condition
@fair drum ive tried to write my own, now eden says that im missing a ; somewhere
[] spawn { _vehicle = [vic1, vic2]; setpos [heli1, [0, 0, -5]]; sleep 1; _chute = createVehicle ["B_Barachute_02_F", position _vehicle]; _vehicle attachTo [_chute, [0, 0, 0]]; waitUntil(getPosATL _vehicle) <2; detach _vehicle; deleteVehicle _chute; }forEach _vehicle;
waitUntil goes with a { }
Try switchMove https://community.bistudio.com/wiki/switchMove. It should switch the animation without transitioning or waiting for the queue to finish.
also, wrong syntax on setPos, please read the biki https://community.bistudio.com/wiki/setPos
changed it to
_vehicle setpos (getPosASL heli1 vectorAdd [0, 0, -5]);
it definitely is a skill issue on my end
Interesting, switchMove applies the animation immediately. Which made me think the current animation just needs to finish. So I tried playMove and did 4x speed and waited a couple of minutes. It never played it. ๐คทโโ๏ธ
nah it's just a matter of checking syntax, always have biki page open when you're coding
its weird because as any self respecting developer i then ripped someones code took inspiration from another dev
We all still do this even guys with experience
I don't understand the animation graph mechanisms properly, but I think there might not be a way to transition to that looped animation from a normal idle anim state. And thus, you can do it only with the switch command.
said guys code also isnt workingn
respect
now get to work
in that code in particular, just the setPos and waitUntil were wrong
ah, no
the spawn code
you've putted a forEach in the last line, why?
because i want to drop multiple vehicles
ok, but that's not how it works
try to make a working code with just one vehicle
get rid of that forEach, also read the biki for this command, it's used basically to iterate arrays
and fix the rest of the syntax and it should work for one veh
now i just need to format vectoradd right
use setPosATL
as you're using getPosATL
_aslPos = getPosASL heli1; _vehicle setposASL (_aslPos vectorAdd [0, 0, -5];
also for a good practice, make sure to isolate commands with ( ), like (getPosASL heli1) vectorAdd [0, 0, -5]
right, getPosASL **
i need get the coord array of the helicopter
but i eventually want to make the vehicle teleport 5 meters under the transport, wherever said transport might be
thats why i wanted to use the get and setpos
yeah I've imagined that
and did you manage to get it working?
ive managed to make the syntax clean enough to spawn in
not clean enough to actually teleport vehicle to the helicopter
Please use !sqf from now on (!enforcescript soonโข)
!sqf
```sqf
// your code here
hint "good!";
```
โ turns into โ
// your code here
hint "good!";
[] spawn {
_vehicle = [vic1];
_vehicle setVehiclePosition [heli1] vectorAdd [0, 0, -5];
sleep 1;
_chute = createVehicle ["B_Barachute_02_F", position _vehicle];
_vehicle attachTo [_chute, [0, 0, 0]];
waitUntil {
(getPosATL _vehicle) <2
};
detach _vehicle;
deleteVehicle _chute;
};
what i need now is the setvehicleposition
i dont care anymore if im gonna cheat that
I don't think you gonna need setVehiclePosition and check its syntax on biki pls
also, remove [ ] on vic1
_vehicle = vic1;
i chose setvehicleposition as it allows me to place an object in relation to another
thats where the ripping someone elses code comes in, i eventually want to expand that for multiple vehicles and thats what i ripped from said guy found out by myself
with setPosASL and getPosASL it works too
Ik, but try to make this code works and then you expand it later, do it by steps, for your own sanity
those commands requires object
that's why you should remove [ ], at least for now
private _vehicles = [veh1, veh2, veh3];
{
private _currVehicle = _x;
// Do something with _currVehicle
} forEach _vehicles;
if you manage to make the code working for one object, then you just do what Hypoxic sent
saved that
but setVehiclePosition, attachTo requires object, and in the code there, _vehicle is an array, but if you expand like the Hypoxic's example, yeah you will need that array
private _originalPos = getPosATL _target;
private _newPos = _originalPos vectorAdd [0,0,-5]; // decrease position by 5 meters
_curretVehicle setPosATL _newPos;
or
getPosATL _target params ["_xx", "_yy", "_zz"];
_zz = _zz - 5;
_currentVehicle setPosATL [_xx, _yy, _zz];
lots of ways you can do it
i see
You're close
if (!isServer) exitWith {};
[] spawn {
private _vehicles = [veh1, veh2, veh3];
private _targetVeh = heli1;
{
private _vehicle = _x;
private _pos = (getPosATL _targetVeh) vectorAdd [0, 0, -5];
// Make the chute at map origin, then move it (better for this)
private _chute = createVehicle ["B_Parachute_02_F", [0,0,0]];
_chute setPosATL _pos;
// Move vehicle to that position
_vehicle setPosATL _pos;
_vehicle attachTo [_chute, [0,0,0]];
// Create a new scheduled thread that waits for this specific vehicle
// This is a new scope, so we have to pass our variables to it
[_vehicle, _chute] spawn {
params ["_vehicle", "_chute"];
private _currPos = getPosATL _vehicle;
waitUntil { _currPos # 2 <= 2 }; // if this is over water, it won't work how you want. This is a more advanced topic so don't do it yet
detach _vehicle;
deleteVehicle _chute;
};
sleep 1; // whatever sleep before working on next vehicle
} forEach _vehicles // Do it for all vehicles in _vehicles
};
ripped your first one
thanks a tonne
at least i got somewhere close
๐
you both are arma wizards
also i managed to TP the selected vehicle to the selected helo with that code so B- for result but A for effort i spose
unless you absolutely know what you are doing, stay away from the generic position commands. stick with the explicit ones:
setPosATL
setPosASL
getPosATL
getPosASL
// and converters
ASLtoAGL
AGLtoASL
ATLtoASL
ASLtoATL
ASLtoAGL
chute borked but hey
some commands like createVehicle take ATL some take ASL some take AGL so pay attention on the wiki. That's why I prefer origin creation, then move it when you are first learning.
well
thanks anyhow
i'm experiencing happyness: cuz every thing is working prefect WooHoo: thx All you great Guys WooHoo Arma 3: ๐

i just can't thank you guys enough ๐
playMove pushes a move to the move queue. and the animation must be connected to the current animation in the animation graph. if playMove fails it means they're not connected and you have to switch to it
as for looping, you should use animStateChanged event handler and switch back again
btw the new switchMove syntax allows you to switch smoothly instead of an instant jump
That new syntax seems to have done the trick! Thank you!
Apparently with Arma networking, it is possible for the server to see the created position of this object during the remoteExec, if this is run in unscheduled on a client:
_veh = createVehicle ["someStaticType", [0,0,0]];
_veh setPosATL getPosATL player;
[_veh] remoteExecCall ["someServerFunction", 2];
Not consistent though. Could only replicate on a loaded server.
What is the alternative of scriptDone for remoteExec functions? I have a remoteExec function being run on the server and I want my current code to wait until the function is complete and returns an array/object to the variable
private _playerObject = [_machineID] remoteExec ["Root_fnc_getPlayerFromId", 2];
// wait until _playerObject is initialized
Don' think there is one, you need to "ping pong" call it.
There isn't a direct mechanism for that. Remember that in theory, a remoteExec could be sent to a machine that isn't even in the game yet.
What you can do is having the receiving machine send another remoteExec back that triggers the next phase, or does a setVariable that completes a waitUntil. remoteExecutedOwner is available to help with this.
Ideally something like
[1, "cheeseburger"] remoteExec ["TAG_fnc_sandwhichShop", 2];
private _timeout = serverTime + 5;
waitUntil {
uiSleep 0.01;
(!isNil "sandwhichShopData" || serverTime > _timeout)
};
if (isNil "sandwhichShopData") exitWith {
hint "The server did not respond with the sandwhich shop menu.";
};
-# Now I am hungry 

also, sandwich
A fresh variant each time; never know what you're going to get ๐
You could also do a cba server event that makes the server sent a target event to open the menu
Which means the menu won't open until the data is there
(and no need to schedule anything or wuae)
How would I go about achieving this; have an AI unit exit a vehicle, walk to another close by vehicle, and enter that vehicle.
I'd like to try to keep default animations instead of just teleporting the unit.
I can't use editor waypoints because the player controls the AI up until this event.
Could probably just assign them to the vehicle and give them a getIn order
Hello there. Guys, how do I add an action to the players context menu? I have sqf function, that i need to call that needs to be called when this action is activated
How do I have a script identify a private variable as "whatever vehicle activated the trigger that activates this script"
you don't, but you can obtain the list of currently "valid" entities in the trigger โ using thisList or list _trigger
K, I may need to get more help with this than I thought. I'm trying to do a cinematic MASH script.
Anyone know how to use this animation tester in the editor?
I get an error when trying the player like this.
If you mean Animation Player not animation tester, it is a part of POLPOX's Artwork Supporter. Read the guide of it
hah, what do you know about it
I can put these dudes in the chairs to a convincing effect within the editor, but as soon as I start the mission, they move away from where I put them and as a result, look out of place. Is there a way to keep them in the stop I chose in the editor?
They're being pushed out by collision with the chair. Attach them to an object (ideally the chair, but some other dummy will do)
This works perfectly for land vehicles, not allowing someone who doesn't have the needed gear to be driver, gunner or commander. The problem are jets and helis ... its not working for them ... is the pilot a driver technically?
_veh addEventHandler
[
"GetIn",
{
params ["_vehicle", "_role", "_unit", "_turret"];
if (_unit == driver _vehicle || _unit == gunner _vehicle || _unit == commander _vehicle) then
{
if ( headgear _unit != "H_PilotHelmetFighter_B" ) exitwith
{ _unit action ["Eject", vehicle _unit];
systemChat "You are not Pilot!";
};
} else {};
}];
UI for this timer: [60] call BIS_fnc_countDown; is only visible after switching to/from Zeus, can't find the UI control either, how could it be enabled for all clients possibly?
Seems like some other function just picks up the global var to display the UI, a pointer at what that might be would also be handy, thanks.
Is that this one? I tried giving the chair a variable name but got an error saying I can't use an object. Then I tried to log the 3D positions of the unit but got an error because it doesn't want an array.
https://community.bistudio.com/wiki/attachObject
What does the description of that command say?
Attaches a location to the specified object. I would expect to attach a 3d position to an object, then on mission start it moves the object to the coordinates.
First of all, a Location is not a 3D position, it is a Location.
Secondly, do you really want to attach a 3D position to an object? Or is it maybe that you want to do it the other way around?
Ah I see, it's the reverse of what I was thinking. I thought my 3d position would work cause the wiki for location says they have a name, a side, a 3D position, a 2D area, and an orientation.
Yes, a Location has all of those things, but that doesn't mean you can just provide a position and try to convince the game it's actually a Location
I have same feature in one of my missions, check the conditions
["Air", "GetIn", {
params ["_vehicle", "_role", "_unit", "_turret"];
// Allow pilot class only
if (local _unit && !(_unit isKindOf PIG_unitPilotClass) && {(_role == "driver") || {_role == "gunner"}}) then {
moveout _unit;
hintSilent "Vocรช nรฃo รฉ o Hamilton"
}
}] call CBA_fnc_addClassEventHandler;
Oh I see. A location has a 3D position, but that doesn't necessarily mean a 3D position is a location.
...Did you just read that one line that says have a name, a side, a 3D position, a 2D area, and an orientation and skip all the rest of the page describing what a Location is?
@thin fox no mods in the scenario, even CBA ... ๐
and I want the gear, not the classname of the unit
More like I read some stuff I didn't really comprehend and then got to that line and thought... hmm maybe worth a try.
you don't need CBA, just check the condition
it's the same event handler
I just used the CBA function to add the same EH in all Air units
I made that some years ago, for players to be able to sit, didn't use attachTo, maybe didnt have that problem because i used different chairs ๐คทโโ๏ธ
private _chair = _this;
private _unit = player;
if((_chair distance _unit) > 2) exitwith {["ErrorTitleAndText", ["You are too far away!", ""]] call ExileClient_gui_toaster_addTemplateToast;};
if(ExileClientIsSitting) exitwith {["ErrorTitleAndText", ["You are already sitting!", ""]] call ExileClient_gui_toaster_addTemplateToast;};
private _occupied = (count (_chair nearEntities [["Exile_Unit_Player"], 1.2]) > 1);
if (typeof _chair == "Land_RattanChair_01_F") then {_chairPos = _chair modelToWorldWorld [0,-0.15,-1]};
if (typeof _chair == "Land_CampingChair_V1_F") then { _chairPos = _chair modelToWorldWorld [0,-0.10,-1]};
if (typeof _chair == "Land_CampingChair_V2_F") then { _chairPos = _chair modelToWorldWorld [0,-0.15,-0.5]};
if (typeof _chair == "Land_OfficeChair_01_F") then { _chairPos = _chair modelToWorldWorld [0,-0.05,-0.7]};
if!(_occupied) then
{
private _Moves = [["RW_Sitting","RW_Sitting02","RW_Sitting03","RW_Sitting04","RW_Sitting05","RW_Sitting06"],30] call KK_fnc_arrayShufflePlus;
private _Move = selectRandom _Moves;
_unit setPosWorld _chairPos;
_unit setDir ((getDir _chair) + 180);
_unit switchMove _Move;
_unit addAction ["<img image='RW_assets\hud\chair_hud_icon.paa' size='1' shadow='false' /> [Stand up]", {call ExileClient_util_ChairStandUp;}];
ExileClientIsSitting = true;
[60, ExileClient_system_SitAnimation_thread, [], true] call ExileClient_system_thread_addtask;
}
else
{
["ErrorTitleAndText", ["This chair is occupied!", ""]] call ExileClient_gui_toaster_addTemplateToast;
};
Hey folks, anyone know what a GIAS pre stack size violation is when using unit capture?
@thin fox thank you so much ! it was
moveout _unit;
//instead of
_unit action ["Eject", vehicle _unit];
that made it, probably because eject system of the jet itself
if you're using ace, you can [_chair, _unit] call ace_sitting_fnc_sit; if the chair is compatible with it
Not specific to unit capture. Generally means that you have a syntax error that broke the SQF parser.
Cheers!
Think something was up with me running the UnitCapture from an objects init; Sticking it in a radio trigger fixed it
How many triggers can you put in a mission until it negatively affects performance? I have roughly 95 and I ran a test with and without them and seemed to get the same FPS.
Nothing about a trigger's existence itself negatively affects performance, it's related to the conditions you're running, how slow it is, and how often you're running the check
The conditions themselves seem fairly benign but I'm not sure. Most of them are missionNameSpace getVariable with the default editor-placed trigger evaluation of .5 seconds
For some reason, I have to spam setCurrentWaypoint like this or else the group will skip to waypont index 3.
extractHeliGroup addWaypoint [[7050.49,4301.54,0], -1, 1];
extractHeliGroup addWaypoint [[7103.78,4238.36,0], -1, 2];
extractHeliGroup addWaypoint [[7075.68,4182.71,0], -1, 3]; //group skips to this
extractHeliGroup setCurrentWaypoint [extractHeliGroup, 1];
sleep 3;
extractHeliGroup setCurrentWaypoint [extractHeliGroup, 1];
sleep 3;
extractHeliGroup setCurrentWaypoint [extractHeliGroup, 1];
sleep 3;
extractHeliGroup setCurrentWaypoint [extractHeliGroup, 1];
sleep 3;
extractHeliGroup setCurrentWaypoint [extractHeliGroup, 1];
sleep 3;
extractHeliGroup setCurrentWaypoint [extractHeliGroup, 1];
sleep 3;
extractHeliGroup setCurrentWaypoint [extractHeliGroup, 1];
sleep 3;
extractHeliGroup setCurrentWaypoint [extractHeliGroup, 1];
sleep 3;
extractHeliGroup setCurrentWaypoint [extractHeliGroup, 1];
sleep 3;
extractHeliGroup setCurrentWaypoint [extractHeliGroup, 1];
I noticed that If the waypoints are close by and are the same type, air units tend to "skip" them
This is after the group exits the heli and is walking around base.
does ANYONE know what the attribute for DISABLING AI IN LOBBY is called?
I cannot find it in the wiki ANYWHERE :(
There is a command (forgot what it's called) that will return their current waypoint. So I checked it periodically and it kept switching from 1 to 3. So if I brute force it like this it works and they hit 1, 2, and 3. But it's odd because setCurrentWaypoint seems straightforward on the wiki.
disabledAI = 1; on description.ext
tHANK YOU
is this for loitering around the base?
its probably time to condense. i bet you have a ton of things that are waiting for something that you already know exactly when they are going to happen -> see observer/subscriber pattern (aka scriptedEventHandlers).
entities "CAManBase" select {!alive _x}; is faster than allDeadMen. Not sure whether to praise simpleVM or damn the command.
So I'm kinda new to this scripting stuff and wanted to get "away" from chatgpt... cause ew and want to actually learn. Anyway I'm trying to make a "loop" damage to any engines within a 200 meter radius of _fgt, trying to make a emp type thing. The script has no problem firing the "while {alive _fgt} do {" and the part where it talks about finding all the vehicles within a radius... its the part after that.
but the problem is that the script afterward in the later doesn't fire.
All the "private variable" stuff
private _radius = 200; // Effect radius in meters private _damagePerSec = 0.05; // 5% engine damage per second private _fgt = fgt; //Ref Tower private _twinPos = getPosASL _fgt; // Towers Pos
`while {alive _fgt} do {
// Finds all vehicles within a radius
private _veh = getPos _fgt nearEntities [["Car", "Motorcycle", "Tank", "Helicopter", "Jets"], 200];
hint format ["There are %1 around", count _veh];
{
private _veh = _x;
private _engineHP = _veh getHitPointDamage ["hitengine"];
hint "howdy do";
if (_engineHP < 1) then {
_veh setHitPointDamage[hitengine, _engineHP + _damagePerSec];
hint "Engine Damaged";
};
};
sleep 1 // waits 30โ50 seconds before next play
};`
nearEntities returns an array of vehicles, which you then want to loop over with forEach (or apply).
like this:
private _vehArray = getPosATL _fgt nearEntities [["Car", "Motorcycle", "Tank", "Helicopter", "Jets"], 200];
{
private _veh = _x;
// your other stuff here
} forEach _vehArray;
I think your set & get hitpointdamage calls are also wrong.
gotcha; also how do you do that block code? cause that looks so much better lol
its possible, im just kinda looking at the wiki and might be misunderstanding but im slowly getting there lol
Yeah I don't know how to write that in discord without mangling it.
triple backticks at the start and end of the block. If you add sqf immediately after the first set it highlights as SQF.
You missed the quotes on "hitengine" for setHitpointDamage. While getHitPointDamage shouldn't have array brackets around "hitengine".
yeah I did figure that part out, I havent fixed that yet. ok so its like this?
private _veh = _x;
private _engineHP = _veh getHitPointDamage ["hitengine"];
hint "howdy do";
if (_engineHP < 1) then {
_veh setHitPointDamage[hitengine, _engineHP + _damagePerSec];
hint "Engine Damaged";
} forEach _vehArray;```
!code
Please use !sqf from now on (!enforcescript soonโข)
!sqf
```sqf
// your code here
hint "good!";
```
โ turns into โ
// your code here
hint "good!";
awesome thank you
!enforcescript soonโข, lol. Nice
private _vehArray = getPosATL _fgt nearEntities [["Car", "Motorcycle", "Tank", "Helicopter", "Jets"], 200];
{
private _veh = _x;
private _engineHP = _veh getHitPointDamage "hitengine";
hint "howdy do";
if (_engineHP < 1) then {
_veh setHitPointDamage ["hitengine", _engineHP + _damagePerSec];
hint "Engine Damaged";
};
} forEach _vehArray;
I think that's correct.
Oh, "Jets" sounds wrong. "Plane" maybe
Not sure about "Motorcycle" either.
"Motorcycle" is correct
yeah I was looking for the technical names of it, but I thought thats what they would've been so I took the wild guess lol
"Air" is on wiki
They're CfgVehicles entries anyway. You can check inheritance of various vehicles in config.
alright; I'm gonna try this out real quick and I'll be right back.
Honestly; didnt even realize it lists that there. thank you!
If those classnames are wrong then it won't complain. It just won't find everything.
It works! thats so freaking awesome thank you!
additionally; would this script work neccessarily in Multiplayer or is there something else I need to look into? (I'm fine doing a lot of research on it) as this is for a op im hosting lol
How often does it run?
For MP, I would wrap the entire code in a function. You can take "_fgt" and 200 as parameter if you want. To be 100% sure I would wrap the body after _veh = x in if if (local _veh) then { DAMAGE HERE.. }. Then if the time runs is say larger than 10s I would remoteExec it from the server, otherwise if the time is lower I would let all machines have their loop that triggers it repeatedly.
for damage (as of rn) its every second; but may raise it to 5 seconds. I have no idea how to "wrap" stuff in a function thats something new to me lol
Damage on global objects is global, so the easiest option is to just run the code on the server.
setHitPointDamage explicitly list the argument is local though.
oh, it does? Curious.
I just loaded a server, all the vehicles within the 200 radius is being damaged so Idk?
Well, they're probably all server-local if you just started it.
So at this point the easiest thing would just be to launch this from init.sqf, and only let the machine who the vehicle is local to actuall update the damage. This would work even for JIP players who then get into a vehicle in the zone if they managed to do so before the engine was dead, or after repairs.
Get into one and see if it's still taking damage.
yeah nah it still takes damage, vehicle smokin and all that
On a dedicated server? In the "driver seat". If so, well that simplifies it. Guess the biki would need updating.
Oh yeah, it'll only switch locality if you use the driver seat.
I dont own a dedicated; its all on my computer which I host the op on
ah, in that case you're local anyway.
summoned
well the vehicles which has no body in it also take damage
(which is what I want anyway lol)
localhost without clients is a lot like solo.
I can see if I can drag a buddy on and make him a puppet real quick XD
Getting it to work on vehicles without players or but with AI inside (or not) is easy. The problem is getting it to work with human players in the driver seatss.
arrives in a puff of smoke
Reverse Ninja?
Iโฆ wasn't listening well in school
wazzup?
Guess you were summoned by PiG13BR because of this maybe #arma3_scripting message . But it is premature.
so am I, perfect casting!
it's not me, everytime someone says biki here, Lou gets summoned
Wait for real?
Didn't he arrive in a puff of smoke? just proves the point
regarding this; I'll have to check in later and update y'all, I got no one atm willin to get on Arma lol
Well depending on how you run it, it will work for others too. If you just launch the script from init.sqf it will work for all too.
If you launch it inside like if (isServer) then { DO_THE_THING; } my odds are 98 to 2 it won't work during the duration a non-hosting-player is inside the (driver position of) vehicle.
*grapples away*
gotcha; well I'll try that if thats the case; I dont wanna go changing stuff it aint broke y'know? if it aint broke dont fix it lol
I bet Lou is sitting on rooftops waiting until the moment Gotham discord channel needs him.
this, but for lame jokes here and there
Will ask this though; when it comes to
[] execVM "insert.sqf" I remember hearing something about a "server" version of this script that makes it play on all players... is that something I need to get worked out and find?
- The basics of locality here is that every vehicle belongs to a machine. Like a dedicated server or your player machine.
- Commands like setHitPointGlobal have local argument requires that it is run on the machine that the vehicle belongs to (is local) to.
- The other side of this is that running the command on a vehicle that is not local will likely not have any effect.
- So in this case, by running the code on all machines (say started from init.sqf), every machine will go through every applicable vehicle. But only one of the machines "owns" the vehicle, so only one machines "request to damage the vehicle" will work.
- For vehicle they are owned by the server if the driver seat is empty, or by the machine (player) in the driver's seat.
- Some scripting can become way more complicated than this locality-wise. It depends a lot on the commands. Other commands have global argument which means if many machines ran the same code the effect would happen multiple times. In your case that would have been the vehicles becoming damaged faster if more players were on the server! Fortunately that is not an issue here.
but if its started from the init.sqf, the code would already be running which it shouldn't be running at all until the players destroy the objective they are tasked of destroying
because the _fgt is not seen or anything the said obj is destroyed
It's just 3 waypoints for a group of 4 soldiers. All I need them to do is walk down the road. But instead of hitting wp1, then wp2, they skip to wp3. Unless I spam the code the way I do.
I'm about to boot up and play around with it some more. Maybe try some new commands.
did you test with loiter waypoint?
Okay, then you can put it in a script file. Then when the thing is destroyed you can do something like [[fgt, 0.05, 200], "myEmpEngineDamager.sqf"] remoteExec["execVM", 0, "JIP_EMP_TAG"]; .. Then the script will run start for all current players and any future.
yeah so my script is currently in a .sqf file all that I've been doing has been inside of a .sqf... so I would need to just toss that execvm into the trigger which activates the said script?
-# if I understood correctly lol
remoteExec you mean?
yes, by bad will edit
No, just with addWaypoint and setCurrentWaypoint. I also have an idea to try a scripted waypoint. Instead of giving the group all three waypoints at once, I can run code when then get to the first one, to give them the second one, etc.
or you can just add the LOITER waypoint, if it's for a waiting purpose
once the conditions meets, delete this waypoint (required) and continue with the rest
Oh, I see. I will put that on the list as well, thanks!
Yes. And if you remoteExec like I suggest then you would want to put that remoteExec inside if (isServer) then { REMOTE_EXEC_HERE;}
You don't have to pass args, if you hardcode them in your scripts.
So I guess it would look like this as your trigger on act:
if (isServer) then {
[[], "myEmpScript.sqf"] remoteExec ["execVM", 0, "EMP_SCRIPT_TAG"];
}
If arguments like tgt are hardcoded in your script.
Oh, this is where I've gone wrong maybe. I assumed that addWaypoint defaults to a move waypoint. I'll try the setWaypointType with move and if that doesn't work, then loiter.
well afaik it defaults to move waypoint
but at the same time I've always added that command just to make sure
Move or Loiter didn't work. I wonder if they don't like that there is already another patrol on the road and are trying to bypass them. I will test this in an open space now.
Yes foot troops, they are placed roughly 40 meters apart. I specified in the command exact waypoint placement like so:
extractHeliGroup addWaypoint [[7050.49,4301.54,0], -1, 1, "FirstRoad"];
[extractHeliGroup, 1] setWaypointType "LOITER";
extractHeliGroup addWaypoint [[7103.78,4238.36,0], -1, 2, "MiddleRoad"];
[extractHeliGroup, 2] setWaypointType "MOVE";
extractHeliGroup addWaypoint [[7075.68,4182.71,0], -1, 3, "LastRoad"];
[extractHeliGroup, 3] setWaypointType "MOVE";
I don't need the loiter. Just trying to mess around and see if I can get them to move to wp1 without spamming setCurrentWaypoint [extractHeliGroup, 1]
I was also hoping that by naming the waypoints the name would be returned with the waypoints command to make it easier to tell which is which. Keeping track of the index numbers and where they are in the world is confusing to me.
hmm, can't replicate. They get three waypoints here.
gotcha; I'll give that a shot
what if you did a 4th waypoint and put "Cycle" and keep 1-3 a "Move"? thats what I tend to do for waypoints
Yeah, I just created a new group and used the same code and it worked fine... Something about my heli crew or the position of the heli next to the road maybe?
In the same code block I use this. That and the position of the heli on the ground are the only differences I can think of.
extractHeliGroup leaveVehicle extractHeli;
extractHeliGroup setBehaviourStrong "CARELESS";
extractHeliGroup setSpeedMode "LIMITED";
```,
Did you give them the waypoints when they were in the heli or not?
It all runs in the same code block. So I guess they are still in the heli even though leaveVehicle runs before the waypoint code. I will try it with them out of the heli now.
As pilot/crew or as cargo?
just put the cycle close to the 1st move point so it syncs it (again Idk if its different between in game way points and coded waypoints) im novice when it comes to the actual scripting side XD
It works with them starting from outside the heli!
So maybe I need a check to waitUntil they are outside then run the code.
But I did omit the leaveVehicle stuff for this test.
why do you need 3 waypoints?
just add the loiter waypoint in a "center" pos
and when a certain condition meets
delete that waypoint
and proceed with your stuff
According to the loiter documentation that doesn't work anyway:
If the group is on foot or inside a ground vehicle, then group will just stand around and the LOITER waypoint will act as a MOVE waypoint.
I technically don't need 3. But I need one to get them on the road else they shortcut through the forest.
AH wait
I thought it was an air unit
In testing they did indead keep moving down the road with LOITER.
just forget what I've said
So did Arma apparently :P
Hey I said foot soldiers a bunch! ๐
But John is on to something with them being out of the heli. Gonna try something now.
I'm guessing what's happening is that it's using the heli completion radius until the pilot exits the vehicle. Which is a bit odd if they're immediately unassigned, but whatever.
IME it won't complete multiple waypoints at once. It completes one, and then waits until the next periodic waypoint update.
so wait I just realized; the "JIP_EMP_TAG" what does that do? (sorry to intrude just reading over scripts n' stuff lol)
remoteExec is pretty complex. You can register remoteExecs to run on clients that join in progress (JIP), and that needs to be registered with a unique tag.
Easier but slightly slower way to do what you're trying to do is run the code on init, but have it check whether your condition has been fulfilled.
the script isnt in a init?
what script :/
Your explanation makes sense to me. I used this to fix it. Works great now!
waitUntil {(crew extractHeli) isEqualTo []};
Thanks for the help everyone.
In that example there's a separate script file (myEmpEngineDamager.sqf) that's being executed.
So there wouldn't be any code in init.
execVM is a command to execute an external script file, while the remoteExec is doing this on every machine (including the JIP clients).
I kinda know what the first part does roughly the
ok, so in my trigger I'd do this (this is the full execution script that would be in the trigger)
if (isServer) then {
[[], "FGTEMP.sqf"] remoteExec ["execVM", 0, "EMP_SCRIPT_TAG"];
}
But the part the confuses me a bit is the
[[], "FGTEMP.sqf"] remoteExec ["execVM", 0, "EMP_SCRIPT_TAG"];
Specifically the whole "Tag" part im not understand what that does exactly
You don't need it, if the emp effect never need to stop again. You can use true instead.
The label is useful to remove the command from the JIP queue which is run for all joining players.
ok, so it would simply just be this then? because the script itself (FGTEMP.sqf) is in a constant loop.
if (isServer) then {
[[], "FGTEMP.sqf"] remoteExec ["execVM", 0,];
}
, true]; at the end
heard, thank you
So that script I got working in SP doesn't work when I test it from local host + client. I see on the wiki that setCurrentWaypoint is LA. When I test group with local command from local host it returns true.
The code itself runs in the Activation field of a Server Only trigger.
I'm guessing this will work if I remoteExec``setCurrentWaypoint? But I dont get why. The code runs inside a server only trigger. I tested the object is owned by the server. So I'm confused.
Well maybe I should test this first before I make that assumption.
I tested the object is owned by the server.
What object? I thought this was an infantry group.
Sorry, yes, it is a group. The wiki says I can do local group as a test. Which I did from the local host since it has ADT mod. It returned true.
when working with waypoints, I personally delete every waypoint possible first (also you have to delete them in reverse order)
Cool, I'll try that after messing with remoteExec, then.
What does "doesn't work" mean here anyway?
The helicrew exited the heli but did not proceed to their next waypoints. They just stood around doing nothing. When I checked their waypoints they didn't have the ones in queue that should have been added.
But I tested it a second time and it worked, meaning they received their additional waypoints and off they went.
So ๐คทโโ๏ธ . Ima test it again, maybe it was a one time thing.
Ugh, its cause I had this. I was watching them in zeus from inside the helicopter. ๐คฆ
waitUntil {(crew extractHeli) isEqualTo []};
They don't get the waypoints until after it resolves. I might want to change this to look to see if the group specifically is out of the helicopter.
hello all: you know when you get in a heli: It shows that little heli icon on the map: you know like that little chopper icon: with the chopper blades kinda looks like a gosthawk: where can i find this icon: i want to create it in a chopper script.
its not in the regulare icons
Run this script in the debug console, it will open a menu and you can get any icons of the game (their path)
theres also the texture viewer with I think Eden Enhanced, but it also might be 7erra's
oh nice really cool m8 thx @thin fox
@fair drum yeah i don't have Eden Enhanced
im old school ๐
Woohoo found it thx so much @thin fox
Can I plot more than one ilsTaxiIn & ilsTaxioff on this airfield.
Does anyone have any experience with Dynamic Airport Configuration, please let me know if it can be done or if i need to explain it better
the positions for which the taxi on or off location is
here's a better example with the dots on the map
So what is the question
can i have more that one taxi
{
simulation = "airport";
ilsPosition[] = { -270, 0 };
ilsDirection[] = { -1, 0.08, 0 };
ilsTaxiIn[] = { 40, -38, -212, -38, -218, -32, -218, -10, -200, 0 };
ilsTaxiOff[] = { 20, 0, 240, 0, 250, -10, 250, -30, 245, -35, 240, -38, 40, -38 };
};```
the example on the wiki only shows one
No
ok thank you
Question, so I looked at a code of a mod thats "suppose to" dig holes in the ground. However it doesnt seem to work in dedicated servers (I think, didnt work yesterday).
private _pos = position player;
private _pos2 = _pos select [0,2];
private _h = getTerrainHeightASL _pos2;
private _h2 = _h - 0.7;
private _list = [ (_pos2 select 0), (_pos2 select 1), _h2 ];
setTerrainHeight [ [_list], false ];
This seems to be entirety of the code. My question is, does "setTerrainHeight" needs to be executed globally? Because from wiki, it seems like its always Global JIP. Unless I missunderstand smth
It needs to be executed on the server specifically.
So yeah, that looks completely broken on dedis.
[[_list, false]] remoteExec ["setTerrainHeight", 2] I would guess.
Thx, I will check it
I would n'tset JIP arg to true for a server-effect only command - it "shouldn't have any effect" for JIPs. I would expect the server to sync it anyway.
any way to add more radio triggers? ๐ค
nope! if you mean 0-0-1 Alpha..Juliet
however
you can use a commanding menu โ see:
wow Awsome Woohoo
OMG: Arma 3 is So Much Fun: Woohoo: i love it
Hmmm, Error type Number, excepted Array
try [_list]
I use events in my stuff, so never fully bothered to get the hang of remoteExec and commands.
I thought that: X command Y became [X, Y] remoteExec ["command", ..] so I just translated that from setTerrainHeight [_list, false] into [[_list, false]] remoteExec ["setTerrainHeight", ...]. Someone else probably know the right syntax then.
The biki even gives the example:
hint "Hello";
// becomes
["Hello"] remoteExec ["hint"];
...
that's the spirit yes
just an issue of array imbrication
setTerrainHeight [ [_list], false ]; โ [[_list], false] remoteExec ["setTerrainHeight", 2];
I see. Though I find that confusing and inconsistent with how the hint example then works. So for X command Y make array [X, Y] for remoteExec. For command Y just use Y for remoteExec.. Except hint you can use [Y]..
It is not an exception
because it is a unary command yes
X command Y = [X,Y] remoteExec ["command"]
commmand X = X remoteExec ["command"]
// you could go
["Hello"] remoteExec ["hint"];
// or even
"Hello" remoteExec ["hint"]; // iirc
there is nothing preceding hint, so IDK if you could even do
[[nil, "Hello"]] remoteExec ["hint"];
```^^
For single-argument commands it's sometimes safe to pass the argument as an array, if there's no chance of confusion. In this case, the single argument is already an array, so trying to put it in another array just confuses it. This is wrong, see below
I get your argument. Now look honestly at example #1 on Biki. Notice how it says you can do both for hint. But then for cutRsc you must wrap.
So cutRsc X should be X remoteExec ["cutRsc"] but example is [X].
yes as it's an array, same as params
they don't know if it's an array of params or if the array is the param
if in doubt, wrap in array :)
Anyway, that is why I use events. Then I only send one message to potentially execute multiple commands, and don't have to guess the parameter passing ๐
Well I've just tested it and half of what we've just been saying was wrong
you do need extra brackets, the issue was that the false was in the wrong place
[[[_list], false]] remoteExec ["setTerrainHeight", 2]; // correct
[[[_list, false]]] remoteExec ["setTerrainHeight", 2]; // wrong
[[_list], false] remoteExec ["setTerrainHeight", 2]; // wrong
[[_list, false]] remoteExec ["setTerrainHeight", 2]; // wrong```
Ah, yeah, I see. The first argument is itself an array of position (another array). Well at least that seems consistent to me.
@cobalt path See NikkoJT's post just above. #arma3_scripting message
anyone got an idea on how to do the below?
Let says i have Object "A" at x=0, y=0.
I want it to move only up to 10 meter to the closest player (lets say at x= 13, y=19). If player distance is within 10 meter, the return position would be the closes player position.
How can i return a coordinate that is the closest to player from object A?
For context, i am trying to create something similar to scp 173. I will use setPos to move it. but the coordinate is what i struggle with. If you can add the Z coordinate into it. it would be even better.
Trigger + https://community.bistudio.com/wiki/nearEntities, then get the positon of the player then and just https://community.bistudio.com/wiki/vectorAdd i guess.
oh i didnt know vectoradd existed. perfect i will check it out
vectorFromTo might help you as well
wait but vector add would only work if it is 2 dimention. In a 3d, vector add would be hard to implement not? given i need 10M closer in radius. using vector add would only work if X or Y is fixed
It's hard to get what you mean exactly, i googled scp173 real quick.
For the position 10m near the player something like that should be fine (if not inside buildings etc (then it will get more tricky anyway)).
private _Distance = 10;
private _randomposCount = random [5,10,20];
for "_i" from 1 to _randomposCount do
{
private _veh = createVehicle ["Sign_Sphere25cm_Geometry_F", (getPosWorld Trigger_Object), [], 0, "CAN_COLLIDE"];
private _pos = (getPosWorld player) vectorAdd (vectorNormalized [(random 2)-1,(random 2)-1,0] vectorMultiply _Distance);
_veh setposATL [_pos #0,_pos #1,0];
};
ok let me try this
it has an error. it says createvehicle error 0 element provided, expected 3
on your sign
just example code
oh haha
either define the Trigger_Object
or change it from (getPosWorld Trigger_Object) to (getPosWorld player) or better [0,0,0] for the future
yea it get me the template that i want. thanks a lot!
I need to find a random solitary house on Altis using
nearestTerrainObjects [player, ["House"], 200];
it has to be at least 100 m away for other buildings ...
too dumb to think how the script should be ... ๐
anywhere on the map?
yeah
do you want to include placed buildings? or just terrain buildings. if just terrain, you use [worldSize / 2, worldSize / 2] for the position, then sqrt 2 / 2 * worldSize for the radius. Gather all the buildings, then iterate through them individually doing basically the same thing as above, but using the index instead of player.
no just the terrain ones
doing basically the same thing as above, but using the index instead of player.
I didn't understand this part
private _allBuildings = nearestTerrainObjects [[worldSize / 2, worldSize / 2], ["House"], sqrt 2 / 2 * worldSize];
private _validBuildingPositions = [];
{
private _nearBuildings = nearestTerrainObjects [_x, ["House"], 100];
_nearBuildings = _nearBuildings - [_x];
if (_nearBuildings isEqualTo []) then { _validBuildingPositions pushBack (getPosATL _x) };
} forEach _allBuildings;
copyToClipboard str _validBuildingPositions;
something along the lines of this. not able to test it right now but that's the idea.
i will test inmediately
instead of copying the positions, you could also create a marker on each of the spots in the editor as well
@fair drum I tried this on a fist place and man there are a lot of houses to mark (or positions to take) ๐ your script is working, you are a hero ๐ป
change the inner to
if (_nearBuildings isEqualTo []) then {
private _markerName = format["%1_marker", _x];
private _marker = createMarker [_markerName, getPosATL _x];
_marker setMarkerColor "ColorRed";
_marker setMarkerType "mil_dot";
_marker setMarkerShape "ICON";
};
anyone can help with the below?
the hint always become Any or Scalar NaN. Cant seems to figure out how to fix it
// Initialize health and other variables
private _health = 2000;
_scp173 setVariable ["health", _health]; // Initialize health
// Add event handler for health damage
_scp173 addEventHandler ["Hitpart", {
(_this select 0) params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect", "_instigator"];
_damageAmount = _ammo select 0; // Based on arma's damage value system
// Apply the calculated damage
_scp173 setVariable ["health", (_scp173 getVariable ["health", 2000]) - _damageAmount];
// Display updated health
hint format ["SCP-173 Health: %1", _scp173 getVariable ["health", 2000]];
}];
```sqf
// your code here
hint "good!";
```
โ turns into โ
// your code here
hint "good!";
// Initialize health and other variables
private _scp173View = false;
private _health = 2000;
_scp173 setVariable ["health", _health]; // Initialize health
// Add event handler for health damage
_scp173 addEventHandler ["Hitpart", {
(_this select 0) params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect", "_instigator"];
_damageAmount = _ammo select 0; // Based on arma's damage value system
// Apply the calculated damage
_scp173 setVariable ["health", (_scp173 getVariable ["health", 2000]) - _damageAmount];
// Display updated health
hint format ["SCP-173 Health: %1", _scp173 getVariable ["health", 2000]];
// If health reaches zero, make SCP-173 fall
if (_scp173 getVariable ["health", 2000] <= 0) then {
private _pos = getPosATL _scp173;
_scp173 setPos [getPosATL _scp173 select 0, getPosATL _scp173 select 1, -10]; // Make it fall to the ground
};
}];
_scp173 doesn't exist in the EH scope.
(ouh yeah, time to sleep)
i can try this, but i think i did it in my tries and still didnt work
(this select 0) params [whatever] at the top is also wrong.
or any one has the script that i wannt
i understand what you mean but like shoudlnt be scoped in automatically?
that was part of the basic BIS template
the what
the select 0 comes from the template in BIS
this addEventHandler ["HitPart", {
(_this select 0) params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect", "_instigator"];
}];
is that wrong? am kinda lost now lmao
nah that might be a weird one. Not used it.
That is correct, although pretty much only for that specific EH, because it has an array of sub-events on each firing
You need private private _scp173 = _target; in the EH though.
or just use _target instead.
The code that's executed when the EH fires is a new scope on each firing, separate from the parent scope where you're creating the EH. Remember the EH could fire hours after being added, so it wouldn't be practical to keep the original scope and keep them connected.
the script that i want is found on most invade and annex servers. its a custom role selecter with buttons to arsenal
ahh make sense. let me try this
this is the only EH to use _this select 0, I will fix that โ I don't like that it makes people believe "that's all there is"
I will throw a forEach in there
done
works. Thanks a lot everyone! ๐
last question for the day ๐
so i made my script and it will be using the "spawn" and the script will be tied to the object (through nearestobject and using player as the center of it).
No sqf script as i am trying to create it for publiz zeus.
the issues, is that "player" cannot be used in multiplayer/publiz zeus.
I thought perhabs placing the specific object i want into the map and using entities or allobjects, but for some reason, neither of them return the object i put for the script.
Any alternative?
I cant do _scp173 = this at the beginning as it wont be defined.. so kinda loss what other method there are. Cant seems to see a command based on curator/zeus, mouse position neither.
nice 
re: new createObject function - would this be suitable as a substitute for createVehicle'ing 100s of weaponHolders?
How is the object created? Placed with zeus?
or would it not work? no simulation = can't pick things up from the weaponHolder?
no, 1st it has no simulation so you cant interact with it. 2nd its less performant then createVehicle (no idea how that happend)
yes (would be me)
nice one, thanks @fallen locust
nvm, i ended up solving it but it is just not efficient haha. all good
saves me installing dev branch to test ๐
anyone got an alternative to worldtoscreen if i want to check if a unit is within the vision of another?
The script work but i didnt know that if i am viewing from zeus, it screw up with the worldtoscreen.
private _viewers = _menInRange select {
!(worldToScreen ASLToAGL getPosASL _test1 isEqualTo [])
};
I want to create transport heli script and Im stuck at deleting and creating it from different users.
for example:
user 1 creates heli
user 2 deletes the heli to create new heli
old heli doesnt get deleted
I used the missionNamespace to share the object heli between the users.
Is there another way to share vehicle objects?
Heff_heli = "yourHeli" createVehicle _pos;
PublicVariable "Heff_heli"
And on 2nd use
if (!isNil "Heff_heli") then {
deleteVehicle Heff_heli
};
...//create new same way
thank you Ill try that
So, I barely understand scripting, and I'm trying to struggle through something. I'm trying to make a soldier have the VR flash/disappear effect when they die, and using this works...
[this, true, 5] spawn BIS_fnc_VREffectKilled;
Unfortunately, it also deletes everything else still alive with the same effect. What am I doing wrong?
where are you exec-ing this at ```sqf
[this, true, 5] spawn BIS_fnc_VREffectKilled;
In the Init field of the unit I want to have the effect
(Been trying to mess around with various things to get it to work, the pictured line just doesn't at all)
Testing it by shooting one of the soldiers with the script in the face
so its in the init of the player or is that a Ai: oh yeah thats Ai i see
It's the AI
That was me changing things to what the wiki suggested as an example just to try it out (it didn't work)
Lemme try that
the word this means that object where you have the code in
Unfortunately, it doesn't seem to have worked. Tested a few times.
I tried it without the dash just to double-check, and it did the thing where it 'works' but deletes everyone
really lets read the wiki more times lets see what we can come up with
Thing I'm looking at is here
https://community.bohemia.net/wiki/BIS_fnc_VREffectKilled
yeah it says this is correct hmmm
(If the solution is shockingly simple and I didn't notice because I'm a dummy, that is entirely possible)
well we all are learning at some stage
[object, instant, delay] call BIS_fnc_VREffectKilled
so you only have this in 1 Ai and thats it: right
so w8 a sec you want this to happen to your team ?
is the a way to test a mod in game without building it / restarting the game for every change?
For clarify:
I want the players on the ground to shoot the AI units, and for said AI units to have the effect and disappear like the VR units in the tutorials. This is essentially going to be a 'simulated exercise transitioning to something more serious'. I'd implement something mission-wide, but I want to implement something on a per-unit basis so I can transition to the not exercise portion mid-mission with no delay by just using my pre-existing units.
[this, false, 5] spawn BIS_fnc_VREffectKilled;```
It's not only for config's, it's also for sqf in the mod itself. will it work?
It worked perfectly! Thank you so much.
Same principle. Just assign local SQF file
@warm kestrel so your saying that ```sqf
[this, false, 5] spawn BIS_fnc_VREffectKilled;
It ended up working.
Hopefully it works in live multplayer
ok ๐ cool m8 Awsome
Thanks for your help as well, though!
well i didn't do much POLPOX did it all
All that really matters is that you were helping me bash my head against it
cool thx m8 i try my best as i can to help
i like to help if i can: it makes me happy
when i load the config everything works great, my config as an init to trigger an sqf, but when i spawn the unit the sqf isn't found
and when i try to trigger the sqf it'sef it doesn't work
sqf file:
/*
File: initLauncher.sqf
Description: Initializes Iron Dome launcher, adds a manual fire action using its own ammo,
and selects the fired missile for tracking or further scripts.
*/
_launcher = _this select 0;
// --- Server-side message ---
if (isServer) then {
systemChat "Iron Dome system online";
};
// --- Client-side/manual actions ---
if (hasInterface && {alive _launcher}) then {
hint "Iron Dome Online";
// Add manual scroll-wheel action to fire missile
_launcher addAction [
":boom: Fire Missile from Ammo", // Action title
{
params ["_target", "_caller", "_actionId", "_arguments"];
if (!alive _target) exitWith {};
// Fire the first missile from the launcher's ammo
_target fire ["Missile_AA_04_F", _target];
// Wait a short moment for the missile to spawn
waitUntil {sleep 0.1; ({alive _x} count nearestObjects [_target, ["MissileBase"], 50]) > 0};
// Select the missile just fired
private _missile = (nearestObjects [_target, ["MissileBase"], 50]) select 0;
systemChat format ["Missile fired and selected: %1", typeOf _missile];
},
nil, // arguments
1.5, // priority
true, // showWindow
true, // hideOnUse
"", // condition (always available)
"(_this distance _target) < 10" // only near launcher
];
systemChat "Iron Dome ready for manual launch.";
};
What error
now there is no error but the sqf is not triggering
code i use in console:
diag_mergeConfigFile ["\IronDomeMorji\addons\config.cpp"];
diag_mergeConfigFile ["\IronDomeMorji\addons\scripts\initLauncher.sqf"];
private _playerPos = getPos player;
private _launcher = "IronDome_Launcher" createVehicle [_playerPos select 0, _playerPos select 1, (_playerPos select 2) + 0.5];
if (isNull _launcher) then {
systemChat "Error: Launcher spawn failed!";
} else {
systemChat "Launcher spawned at player position test!";
};
how do i assign a local sqf file than?
What are you trying to achieve
i am trying for an sqf to trigger when the unit is
cfg:
class CfgPatches {
class IronDome {
units[] = {"IronDome_Launcher"};
weapons[] = {};
requiredVersion = 1.0;
requiredAddons[] = {"A3_Static_F_Sams"};
author = "YourName";
};
};
class CfgVehicles {
class B_SAM_System_01_F; // Base NATO SAM launcher
class IronDome_Launcher: B_SAM_System_01_F {
displayName = "IronDome_Launcher";
scope = 2;
side = 1;
faction = "BLU_F";
crew = "B_UAV_AI";
typicalCargo[] = {"B_UAV_AI"};
vehicleClass = "Static";
editorSubcategory = "EdSubcat_Turrets";
class EventHandlers {
init = "_this execVM 'scripts\initLauncher.sqf';";
};
};
};
but it's not finding the sqf
And where is scripts\initLauncher.sqf?
C:\Program Files (x86)\Steam\steamapps\common\Arma 3@IronDomeMorji\addons\scripts\initLauncher.sqf
C:\Program Files (x86)\Steam\steamapps\common\Arma 3@IronDomeMorji\addons\config.cpp
Do you mean you packed the SQF into a PBO or not?
No, do i need to?
Always. I have no idea why you want it in local folder if you are not debugging
????
I am debugging, i want to know if the code works and make changes to it without restarting the game. What i asked you before
Will the cfg pick it up?
Pick what up?
the sqf...
Do you mean will init = "_this execVM 'scripts\initLauncher.sqf';"; recognize it properly? Yes
Because init = "some code"; is just an SQF, it does nothing different than how you run SQF in a mission
So how you test how mods usually?
Depends on the Mod I make
If the Mod is just about config, I'll just use diag_mergeConfigFile to try whatever I want
If the Mod is about a function, I usually make the function in a mission until it meet the requirement, then I implement into the Mod
You could also do filepaching to test your scripts for a mod.
https://www.youtube.com/watch?v=zRJ1Lp6cJNk
how can I create units and add them to a remote group safely?
its seems to do not work with just create the units direct to the group...
I have to filter buildings with building positions, this finds ruins, etc
private _allBuildings = nearestTerrainObjects [[worldSize / 2, worldSize / 2], ["House"], sqrt 2 / 2 * worldSize];
private _validBuildingPositions = [];
{
private _nearBuildings = nearestTerrainObjects [_x, ["House"], 100];
_nearBuildings = _nearBuildings - [_x];
if (_nearBuildings isEqualTo []) then { _validBuildingPositions pushBack (getPosATL _x) };
} forEach _allBuildings;
nvm I just spawn needed house LOL ๐
is it suppose to work on bots too? (units)
bots = units ๐ซฃ
wdym?
the bots aren't getting deleted ๐
what are you trying to do?
creating transport heli with crew in it that I could recreate from other players, when I set or create new its works perfectly, but when a friend trying to overwrite my heli + its crew, its deletes the heli but the crew stays
BTW if you guys didn't see: https://www.reddit.com/r/arma/comments/43emrh/intercept_percentage_completed_660/
maybe you just need to add the deleteVehicleCrew command in some place of your script
well you'd need to learn a real language... ๐
What can get more real than speaking English ๐
yeah you delete the crew first, then the heli if your reference is the heli
Hey I'm having some issues with subtitles going away to fast
["Vasily", "Where is everyone? I thought there was supposed to be unit blocking any travel into Garmanda", 0],
["Aleskander", "Your guess is as good as mine Vasily, the Sargent said they saw blood in the guard shack. If that's true I don't know if I want to stay here for too long.", 10]
] spawn BIS_fnc_EXP_camp_playSubtitles;```
This is what I am using to play the subtitles. But for whatever reason they only stay on screen for maybe 1 second 2 if I'm lucky
Nothing on the wiki suggests it should be doing that, unless you are showing an empty subtitle every 1-2 seconds, which would replace the subtitle with text in
My only other idea would be their length? Maybe try using smaller subtitles, could be a formatting issue
Also, hey folks! Bit of an odd one, is there any way to get AI Units to attack a prop (And possibly attack players if they get in their way?)
Specifically AI with Melee weapons
I was going to say doSuppressiveFire until you said "melee".
Melee weapons aren't a real thing in Arma 3. Every implementation of them is some kind of hack or fake, using scripting or secret bullets, and getting the AI to use them depends massively on which specific system you're using.
I believe it uses IMS, it's the skelebobs from Empires of Old
I've tried doTarget and doFire, I'll keep at it. May be I just need just stick an invisible dude down next to the prop and have them target him, then destroy the prop on his death
Sweet, for any future searches; Grab a dude, make him invisible, stick him next to the prop and disable his ai. Use doTarget on the AI you wish to attack him (Or stick a 'Destroy' waypoint down). Works a charm
Was having the same issue even when the text was only 1 to 3 words long.
private _meters = player distance2D TECH_1;
if (((alive SLDR_1) && (alive TECH_1)) && (_meters < 101)) then {titleText ["<t align = 'center' shadow = '2' color='#860111' size'2' font='RobotoCondensedBold' > Soldier 1: </t><t color='#ffffff' size='1.5' font='RobotoCondensed' > We're freezing our asses out here cause of some fuck head who keeps messing with the tower.</t>", "PLAIN DOWN", 0.7, true, true];};
sleep 7;
private _meters = player distance2D TECH_1;
if (((alive SLDR_1) && (alive TECH_1)) && (_meters < 101)) then {titleText ["<t align = 'center' shadow = '2' color='#860111' size'2' font='RobotoCondensedBold' > Soldier 2: </t><t color='#ffffff' size='1.5' font='RobotoCondensed' > Think it's the Canadians?</t>", "PLAIN DOWN", 0.5, true, true];};
sleep 5;
private _meters = player distance2D TECH_1;
if (((alive SLDR_1) && (alive TECH_1)) && (_meters < 101)) then {titleText ["<t align = 'center' shadow = '2' color='#860111' size'2' font='RobotoCondensedBold' > Soldier 1: </t><t color='#ffffff' size='1.5' font='RobotoCondensed' > I wish... haven't seen any of their forces since the radar base battle.</t>", "PLAIN DOWN", 0.5, true, true];};
};```
This was what I was originally using, borrowed from another member in my event community. But even this was giving me the same issue where the dialogue would disappear far faster than it was set to.
I'm by no means an expert, so take other user's suggestions before my own;
- Make a new project and test if it works in there. If so, something in the settings is buggered and you're going to have to go looking
- Use a different subtitles system. I tend to use the subtitles you include with CFGSounds, works grand for me. If you need an example I'll provide happily
An example would be great
Two tics
{
sounds[] = {}; // OFP required it filled, now it can be empty or absent depending on the game's version
class voiceline1
{
name = "voiceline1"; // display name
sound[] = { "voiceline1.ogg", 2d, 1, 100 }; // file, volume, pitch, maxDistance
titles[] = { 0, "This is a voiceline",
4, "This is another voiceline,",
7, "You won't guess what",
12, "This is also a voiceline" }; // subtitles
//titlesFont = "LCD14"; // OFP:R - titles font family
titlesSize = 0.2; // OFP:R - titles font size
forceTitles = 1; // Arma 3 - display titles even if global show titles option is off (1) or not (0)
titlesStructured = 1; // Arma 3 - treat titles as Structured Text (1) or not (0)
};
};```
You can define voicelines to show (and the time they are shown) in your description.ext. You can also adjust the font, the size and more. See description.ext on the Wiki and scroll down to CfgSounds for a full breakdown
Thank you very much. I give this a try
Doesn't work, they don't like to attack invisible dudes. Respect tbh, the invisible community is attacked enough as it is
Is there any way how to generate a random floating point number from 0 to x (included) with uniform distribution? Thanks
That's what random is for, but x is excluded
Does random [x,y,z] works on your usecase, if not, why?
Don't see that as issue though, you can use number larger than x, to get x included
Also a random X included is very very very very unlikely to be X
They said they wanted uniform distribution. That syntax's distribution is not uniform, it's biased towards the mid value.
I must be misremembered what uniform is then
"All the same". Equal distribution across the whole range.
English is hard
"uni" + "form", "one" + "shape". A soldier's uniform is called that because they're all the same.
Yeah figured. Then uhh, why not just random X and forget about include X?
What kind of probability you need to have for the x to hit the maximum (included) value?
0,01 %, 1 %, 10 %? At least the magnitude would be good to know
i agree wjth you @warm hedge and English is my lang. ๐
really English is kinda stupid cuz there is like 50 words that have the same meaning
not 50 but you know what i mean ๐
like "Uniform" can mean what you are waring: and also can mean "even" as in "Uniform" or the same on both sides: or symmetrical can mean the same all over
You probably mean to discretize the range into finite number of uniform steps, right? At least, this is the only way I think it is possible to solve it.
It's an option yeah, or just extend the RNG range to reach needed probability: if (x > threshold) then { do stuff }
does createVehicle add the vehicles to garbage collection? like, spawn a car with createVehicle and it gets deleted even if it's still alive?
E.g. let's say you want to have 1 % probability: You can do random 100 and check if x > 99
So no need to use discrete values necessarily
Thanks. That is the same as extending the range _rn = random 101 and then _rn min 100. But I will probably use the discrete step, since i need it evenly distributed.
The random command has uniform distribution with the normal syntax, the Gaussian distribution stuff etc. are active only with the alt syntaxes
Is there a way to force 'doMove' on units? ๐ค I noticed that they may refuse to follow that order if there is an enemy nearby target position. That can be solved by
_group setBehaviourStrong "CARELESS";
_group setCombatBehaviour "CARELESS";
But that, of course, is sub-optimal. My goal is for enemy units to close the distance to target.
i dont get it. if i spawn my vehicle via script, it gets removed by remains collection. if i place it in 3den, it doesn't
no
i can only replicate that on our rc40 drone
but i dont understand why. it's a normal drone like any other
i spawn any vehical via script and it still remains unless its get destroyed
yes, if it wouldn't, a lot of scenarios would be broken
which makes this issue even worse
oh no
if i manually remove it from remains collection after spawning, nothing happens. if i add it again, it gets deleted
i never had to use that: i just set it all in the garbage collection and then if it gets destroyed then it get deleted
@west grove mayby you should name the UAV's: and do ```sqf
removeFromRemainsCollector [unit1, unit2, vehicle1];
whys is there alot of UAV,s
there can be, yes
oh shit lol ok
doing this would mean i have to add a kill EH to clean them up
which also means that it can be an issue if someone does not want them cleaned up
need to get rid of wrecks at some point
i can't do that :p
this not for a single mission, but general
oh i see
manual cleaning by an addaction?
can be an option
not an option
why?
this is about the rc40 drone in reaction forces. i can't do stuff like that
is reaction forces a DLC ?
yes
I don't understand the issue
the drone gets deleted by garbage collector even though it's still alive
his UAV get deleted and he's not sure why
yeah thasts really funny tho cuz i never had that happen
from my experience, it's just better to do your own cleanup script
and try to exclude the drone from it
i use both in conjuntion with each other
better to figure out why it gets deleted in the first place
true that
you're dealing with engine cleanup, so wait devs answers it then
where's Lou when we need him ๐
but doing your own cleanup is just easier as waiting for them to come back with an answer lol
well i like his idea of fixing or figuring out whats going on its like a test ๐
and then leaning lots from it
ok, fixed it
showWeaponCargo = true; was in config for some reason. probably old copy&paste fail. i'm blindly assuming the engine thinks the drone is a weapon holder - since it has no actual weapon, it gets deleted
noice
still, though, why does it not delete 3den placed objects
Is there a way to change via script the magazines and/or ammo of static weapon backpacks, i.e. a disassembled static weapon such as a mortar or static mg?
Is my syntax okay for this condition? I can't get it to return true:
(crew extractHeli findIf { _x in units extractHeliGroup }) == -1
It should return true if all units from extractHeliGroup are outside of the helicopter.
I would go the other way around, check if extractHeliGroup members are in helicopter (rather than "are none of helicopter peeps in group")
units extractHeliGroup findIf { _x in extractHeli } == -1
(less characters, I win!)
Thanks! I just tried your version and it won't return true. This is placed in a waitUntil condition. Is that an issue?
waitUntil {units extractHeliGroup findIf { _x in extractHeli } == -1};
nope, it should be fine actually
Oh I think I know why. The variable name is different for the heli because I made a new one for testing purposes.
I don't know of any direct way for foot troops. Maybe one of the setDestination options would work.
Well, there's direct animation movement if you're trying to script a particular scene.
This is what it looks like when attached. The wiki says I can use setVectorDirAndUp to adjust the attached object. But the issue I have is that after I use attachObject it seems that the object is frozen in place and cannot be adjusted.
So then I tried setting the Dir first and got it pretty much how I want it, but at soon as I attachObject it goes back to the way it looks in the pic.
Well you should be using attachTo, not attachObject, so start with that
Copy that. I'll go read that wiki now.
Okay I miss spoke. I am using attachTo.
situnit4 attachTo [chair4];
situnit4 setVectorDirAndUp [[0,1,-0.10], [0,0.10,1]];
Any orientation changes must be done after attaching, and their vectors will be interpreted as relative to the parent object
Once attached, the attached object inherits the simulation state and rate of the parent object. If the parent object is a terrain object, has its simulation disabled, or is a very-low-simulation object like a building, then that could seriously affect the attached object
Bingo. I have the sim disabled on the chair.
Maybe that's why it's frozen and commands to change the dir don't have an effect?
If you can't avoid problems with attaching to the actual relevant object, you can use a dummy object with better simulation characteristics instead. Attaching doesn't require real contact or even proximity.
As I said, the attached object inherits the parent's sim state. If the parent object is sim disabled, then so is the attached object, and its position and orientation won't be updated.
What is a dummy object? I see a check box in the attributes for a "simple object".
It's not a game mechanic. It's just an object you're using as a dummy, a stand-in. Like a clothes dummy.
I'm not understanding what that means. If I can't get it to work with the chair for whatever reason, are you saying this "dummy object" is a solution?
If you had to have the chair sim-disabled for some other reason, or it turned out the chair object had a very low simulation rate in itself, then you could use some other object which is sim-enabled or has a higher sim rate to attach the unit to. This other object would be a "dummy"; it would have no purpose or function in itself, it would just be there as a stand-in to stick this unit to, instead of the chair. It would probably be invisible or hidden somewhere.
Ohhh, very clever. I may actually use this!
or you can check sit function from ace and see what it does
It's to bad there isn't a log function in the editor to grab the position and vector of an object. Because having to adjust the coordinates with trial and error is slow.
Use BIS_fnc_attachToRelative, or do it in-game with the debug console so you can just keep doing attachTo until you have the right coordinates
Thanks for the reply. This whole thing seems strange enough, if position is occupied by armed enemy soldier - units refuse to move. But if it's a vehicle - no problem ๐ค
ACE modifies the seat object config to contain position data about where to sit. If you're not using ACE it may not be too helpful.
hey i was thinking of making a bombing range for my training map anyone know of a way to clear and resetup target vics by a trigger or way way to make it a scoll menu thing?
Okay, I think I have an actual workflow now that doesn't take forever.
- Use Polpox Artwork Mod; so you don't have to do trial and error positioning from the debug console.
- Copy the sit animation from the animation viewer and play the animation in the editor.
- Now you can position the unit precisely over the chair as you like.
- Start the game, open the debug console, and grab some coordinates:
getPos sitUnit4; // get the unit's position in the world
[situnit4, beachTable] call BIS_fnc_vectorDirAndUpRelative; // get the object rotation axis values.
- Go back to the editor. In
init.sqf, place your commands and values:
sitUnit4 switchMove "HubSittingChairUA_idle2"; // play the idle sitting animation
sitUnit4 setPos [7105.6,4265.25,-0.125195]; // positions the unit over the chair
situnit4 attachTo [beachTable]; // attach to chair so that engine doesn't move it away (collision issue)
situnit4 setVectorDirAndUp [[0.895294,-0.12485,0.427622],[-0.418435,0.0936603,0.903405]]; // rotates the unit on the chosen axis values
- Tested in SP and MP, and so far so good.
I haven't tested this but have you tried seeing if setDamage can restore health from a destroyed object? If that works, then you could put it in an addAction. Or maybe a Killed EH that creates the same object on death.
the most ive found on google is a repair trigger on a area like a heli pad idk how to make it set to a group here is what ive found so far
vehicle (thislist select 0) setDamage 0; vehicle (thislist select 0) setFuel 1; vehicle (thislist select 0) setVehicleAmmo 1;
Can you please use some punctuation? I'm a little confused about what you are saying.
What code can I use to attach a camera to the underside of a players vehicle, so the player can drive while watching the suspension move? Single player, Eden Editor.
deleteWaypoint [ alphagroup , 0 ] ;
does this command work?
My bots still keep moving.
I specified this in the activation trigger.
IIRC deleting a waypoint does not necessarily stop units from moving.
alphagroup move getPosATL leader alphagroup; will probably do it.
0 means the initial WP, where they are initially placed
How do I stop them then? I want them to delete the waypoint and start moving to a specific object when they spot an enemy.
well, polpox's point is valid as well. 0 is not necessarily the active waypoint.
We usually delete that one because vehicles often get created elsewhere and then placed, and then they're trying to drive to [0,0,0] or wherever.
If you want them to move elsewhere then just create a new waypoint and set that as the active waypoint.
private _wp = alphagroup addWaypoint [_newpos, 0];
alphagroup setCurrentWaypoint _wp;
German ๐
I'll get to this tomorrow if someone doesn't answer you
attachTo actually can work. If that is laggy, you can setPos'ing every frame
Yes please!
Thanks, although I already looked at the info on attachTo but have no idea how to implement it, hence asking for a working code snippet.
I'll write a snippet after I get home
Appreciate it, thanks ๐
lol
cam = "camera" camCreate [0,0,0];
cam cameraEffect ["Internal","Back"];
showCinemaBorder false;
onEachFrame {
cam setPosWorld (veh modelToWorldVisualWorld [-5,0,-1]);
cam setVectorDirAndUp [vectorSideVisual veh, vectorUpVisual veh];
};```Probably not for player anyways
Thank-you.
After spawning myself in a vehicle, I entered that code into the debug console, and get this output error
veh is the vehicle variable name
Could I replace it with "vehicle player"?
Ja
It creates a camera looking at the side of the vehicle, but I'm not able to drive the vehicle any more. In fact it's locked up any input and I think I'll have to task manager kill Arma to get out?
Ah ok - yes ESC worked to recover out of it.
I need to be able to drive as I want to observe the suspension close up in action.
I don't think there is a simple solution to that other than let AI drive it
Technically you can have some scripted way
https://community.bistudio.com/wiki/sendSimpleCommand
That surprises me. I just want the external camera which we can control to be positioned at a different place.
Why you could still be suprised by Arma 3
Lol, true ๐
I think I previously tried extCameraPosition[] = { }; in config and it didn't really work for low down close views, perhaps I'll try it again.
You can have a scripted camera that still gives you control of your original unit
IIRC it depends on the cameraEffect used to switch to it, but I don't remember which one
https://community.bistudio.com/wiki/switchCamera
There's a working example below
It is not for vehicles AFAIK
Just use vehicle player
Hm, I have never bothered to mess with switchCamera then, my bad
Hi folks. I've run into a problem where I'm trying to create a queue that clients can write to simultaneously. Is there anyway to implement this that would prevent the case where simultaneous writes from different clients will overwrite the changes of the other?
I don't see any code at that link that would do what I want? I'm not a scripter so need just a code snippet that I can throw into the debug console.
I didn't post a link or say that I had a premade solution for you
oh my mistake, the link below your post was from someone else
Edit: Solved!
Thanks, this works great for looping so far. But what if I don't want to loop on a unit? I am trying to make a unit walk to a spot and sit. I can get it to work with:
testUnit playmove "AmovPsitMstpSnonWnonDnon_ground";
But in this case, I don't want him to stand back up. Is there a way to keep him sitting?
You're saying they loop between standing and sitting, or just that they stand up afterwards?
The latter. I'm assuming the EH loop trick won't work here because it would look silly for the unit to sit and stand repeatedly.
So, I just want them to stay sitting after they sit down.
disableAI "ANIM" should work if you don't want them to do anything except sit there.
i don't see no loop in that line where's the loop
Well, they wouldn't be able to do anything on their own.
I still like the idle animation is what I'm getting at. I don't want it to look like the simulation is disabled or something. I'll give it a try and see how it looks.
You could manually play suitable idle animations. I wouldn't know what those are for sitting characters.
Yeah, it's weird I looked in the animation viewer and the one I chose appears to be a sitting idle animation. In the viewer it isn't a transition from standing to sitting animation. But that's exactly what happens when you playMove it.
playMove will add in the transition animation if there is one.
That makes sense. So why does the unit stand back up though?
Because the AI wants to stand back up.
Fair.
how about trying ```sqf
"switchMove"
Tried it.
ok
This works great, thanks. And it doesn't make the AI look like a statue, they still have head movement so it's not immersion breaking!
Difference with switchMove should be that it skips the transition, so they'd jump straight to the sitting animation.
how about ```sqf
"doStop this";
I tried that out of interest. Doesn't work.
They don't need to be moving anywhere for them to want to be in the standing animation apparently.
copy that
What does "target" mean in this context?
https://community.bistudio.com/wiki/lookAt
Is an object a "target"? Or do I have to use some specific syntax to make an object a target?
No, object and target are equivalent in the context.
Is there a way to "un-lookAt", or remove the command?
I like the command because it makes a unit look at the player but I also want that unit to go back to it's regular behavior.
Description doesn't say it, but _unit lookAt objNull is worth a try
is anyone familiar with the mi-6t mod in the workshop?
Specify which Mod and specify your question
i was just wondering if anyone knows what script this runs so it can open cargo doors because i can't find it in the comments anywhere
it's something to do with animate command, you can find exactly how it opens on the UserActions under its configs (vehicle config)
it will be like _this animate ["action_name", 1];
I think
"[this,1] remoteExec ['HWK_fnc_MI6_cargodoors',0, true]"; something like this?
don't need that remoteExec
and read about remoteExec and how its syntax works
try this on the unit's init field:
this animate ['HWK_fnc_MI6_cargodoors', 0];
Read that again
That's not an animation name, it's a function
i was wondering too
If they got that from the vehicle's config, the mod probably has its own function for managing the doors
i couldnt find it
Where did this come from?
useractions
In the vehicle's config?
Okay then just use that exactly
its not on the action menu in game
It might be seat-specific
oh so you're just trying to open it in the midgame?
ah okay
If it's in the init field you don't need to remoteExec it; init fields are executed on all machines. In other cases it may need to be a remoteExec - it's done like that in userActions config because action code is only executed on the machine that did the action
still doesnt want to work both for init and exec
So, how does one get this EH to trigger?
testUnit addEventHandler ["AnimChanged", {
params ["_unit", "_anim"];
systemChat "fired!";
[testUnit, "HubSittingChairA_idle3"] remoteExec ["switchMove", 0];
[testUnit, "HubSittingChairA_idle3"] remoteExec ["playMoveNow", 0];
}];
I've tried these lines individually without success of getting it to trigger.
[testUnit, "HubSittingChairA_idle3"] remoteExec ["switchMove", 0];
testUnit switchMove "HubSittingChairA_idle3";
testUnit playMove "HubSittingChairA_idle3";
testUnit playMoveNow "HubSittingChairA_idle3";
testUnit switchMove ["HubBriefing_loop", 0, 0];
I'm trying to achieve an animation looping effect that Leopard suggested (AnimStateChanged). It only fires once but then never again.
So next, I tried AnimDone, which works but it fires a ton of times and makes the begining of the animation look glitchy.
So now I'm trying AnimChanged but can't get it to fire at all.
did you try any other seat to see if the actions appers?
yeah
weird
it is
do you have all its dependencies?
yeah
can you check in the functions viewer if that function really exists?
also, did you try with 0 instead of 1? just to make sure
yes both values dont work
im starting to think that it probably doesnt exist
but i'll check
oh it is here
๐ค
forgive me for the eyesore
but
if (!isServer) exitWith {};
//[heli, _value] spawn HWK_fnc_MI6_cargodoors
private _heli = param [0, objNull];
private _open = param [1, 1];
_rampendpoint = "ramp_end";
_rampanim = "ramp_move";
_rampdooranim = "door_ramp";
//open ramp
if (_open == 1) then {
if ((_heli getHitPointDamage "Hitdoor_ramp_L" < 1) && (_heli getHitPointDamage "Hitdoor_ramp_R" < 1)) then {_heli animatesource [_rampdooranim,1,0.25];};
waituntil {sleep 1; ((_heli animationsourcePhase _rampdooranim) == 1) || !(alive _heli)};
if !(alive _heli) exitwith {
_heli animatesource [_rampdooranim,(_heli animationsourcePhase _rampdooranim),true];
};
if ((_heli getHitPointDamage "hitdoor_ramp_b" < 1) && (_heli getHitPointDamage "hitramp" < 1)) then {_heli animatesource [_rampanim,1,1];};
waituntil {sleep 0.1; ((_heli animationsourcePhase _rampanim) == 1) || !(alive _heli) || ((_heli modelToWorld (_heli selectionPosition _rampendpoint))#2 <= 0.05) || ((_heli animationsourcephase 'altRadar' > 1) && ((_heli animationsourcePhase _rampanim) >= 0.5))};
_heli animatesource [_rampanim,(_heli animationsourcePhase _rampanim),true];
}else {
if (_heli getHitPointDamage "hitramp" < 1) then {_heli animatesource [_rampanim,0,1.2];};
waituntil {sleep 1; ((_heli animationsourcePhase _rampanim) == 0) || !(alive _heli)};
if !(alive _heli) exitwith {
_heli animatesource [_rampanim,(_heli animationsourcePhase _rampanim),true];
};
if ((_heli getHitPointDamage "Hitdoor_ramp_L" < 1) && (_heli getHitPointDamage "Hitdoor_ramp_R" < 1) && (_heli getHitPointDamage "hitdoor_ramp_b" < 1)) then {_heli animatesource [_rampdooranim,0,1];};
};
try:
[this, 1] spawn HWK_fnc_MI6_cargodoors
init or exec?
try both (if exec you mean on the console), this is for init field
didnt work :/
ill keep looking into it
the author of the mod did say something about it atleast
though these are the side doors of the helo
Am I the only one still execing scripts via execVM? Should i update all my stuff to cfgFunctions?
depends
I use execVM to test stuff without needing to restart scenarios
but if your script is called only once in your scenario, don't need to worry about it
but if you want that script to return some value, maybe it's time to convert to a function
Other than creating cfgfunctions, is there anything ele needed to convert sqf files to functions?
or if you script is called multiple times
compile
What about loops? As I understand it, you cant use call with loops but you can ise spawn?
functions are just variable names for the script
as I understand
and it gets compiled in the mission start
Im really only interested because functions can preinit and scripts cant (from what I know)
generally, spawn instead of call in that case, but it depends where you call it
Does compile produce an output?
afaik yeah, if you want that
also there are CBA stuff
Forgot about cba
wdym?
Does it do anything to the actual sqf file? Thats more of what Im asking - i have a lot of sqf files organized into folders. Wanna know what, if anything, is needed to convert them to functions other than cfgfunctions
for good practice, convert them using cfgFunctions
It does not change the sqf file per se, but it can change the execution of it, I mean, on how you execute them
but if you "need", well it's up to you, do you exec those scripts a lot in your scenario? it's better to convert them into functions
I basically just exec some cleanup loops and some scripts which exec when a group is spawned by a spawn ai module (minimum 15 second timer)
that spawn script it's better convert it to a function
the clean up, you just execute it once right? at mission start
don't need to worry about it
Yes at mission start
How do you work with actionKeys when modifiers are involved in a display event handler? Does anyone have a script/snippet for that?
(addUserActionEventHandler does not work for this case)
// if my keybinds are:
// networkStats: P
// networkPlayers: R Ctrl+P
// this will trigger even if networkPlayers is pressed because P is part of Ctrl+P
addUserActionEventHandler ["networkStats", "Activate", {
0 spawn WL2_fnc_scoreboard;
}];
// functionally the same as above in my default keybinds case
_display displayAddEventHandler ["KeyDown", {
params ["_display", "_key"];
if (_key in actionKeys "networkStats") then {
0 spawn WL2_fnc_scoreboard;
};
}];
// this works for my default case, but not if someone rebinds networkStats to something with a modifier
_display displayAddEventHandler ["KeyDown", {
params ["_display", "_key", "_shift", "_ctrl", "_alt"];
if (_shift || _ctrl || _alt) exitWith {};
if (_key in actionKeys "networkStats") then {
0 spawn WL2_fnc_scoreboard;
};
}];
Can you preinit a function that takes input parameters? Or can you only preinit functions that dont take input?
You can use params, but there won't be anything passed to it
So it would still work with preinit = 1 when there are no arguments listed in the cfgFunctions call?
Depends on what the function is set up to require
Some functions require no arguments. Some functions require arguments.
Note that for preInit and postInit functions, they are automatically passed certain arguments indicating that status. See https://community.bistudio.com/wiki/Arma_3:_Functions_Library#Attributes_3
What if the function takes a group or group leader for instance?
There won't be a magic group passed to it
You can have the params default to groupNull and try to handle something that way
If a function requires a specific argument, and you give it a wrong argument or no argument, it will behave incorrectly or cause a script error. That applies to any function in any context.
Gotcha. That makes preinit pretty useless for me. Most of my stuff takes arguments
How do people get around unit init startup order? Ie the unit is calling a function thats not yet defined due to init order?
CfgFunctions should be processed before any code is executed.
Yes but I cant pass arguments there which will cause erro
preinit = 1 is just for executing that function in preinit. The function will be compiled regardless.
So preinit execs the function? All functions are compiled pre unit init?
Yes
the preInit attribute (formerly known as "forced") can be set to 1 to call the function upon mission start, before objects are initialized.
https://community.bistudio.com/wiki/Arma_3:_Functions_Library
Gotcha, that makes more sense, thanks
I generally use preinit just to define variables etc
I assume those have to be global variables?
generally, yes
also don't forget about CBA, XEH is cool
You can also do call compile preprocessFileLineNumbers "script.sqf" instead of execVM, that will make it run under same thread and return values. @delicate tangle
yeah well this โ is the 2nd or 3rd best way after using Functions (please)
Functions all the way
they get compiled
they get final'ed
they are global
they love you
go for them
lol @ Lou: we love you to Lou ๐
I'm not fan of creating function for something I use just for once to be honest. Can always turn any code into function when needed.
And recently I started compiling only scripts I need, based on whatever player selects in dialog. I could of course compile everything and only run parts I need using something like switch, but why to bother.
because then compiling happens on the spot and takes time
if you only execute it once, compiling and execVM is the exact same
True, compiling on time may hurt performance when you need it. But I doesn't really matter in this use case. It's not like I'm compiling huge script in a middle of battle
On topic of performance. Does having dozens of functions or variables defined hurt performance?
As far as I know when it comes to the functions library, no. All of those files just turn into compileFinal variables afaik and it doesn't make a difference for performance outside of initial compile time which is negligible.
Only cases I can think of with variables is in writing insane excess to the profileNamespace or broadcasting too many public variables clogging the JIP queue.
Someone can correct me if I am wrong on either of those though 
i agree on the all
if i only knew what negligible means ๐
just kidding m8 ๐
lol
Haha I mean I was gonna say that's fair. Honestly not sure I've ever tried to benchmark or measure compile performance so honestly couldn't tell you what negligible means there
Could totally be waffling but as far my understanding goes I've never seen an issue and we've got thousands of files
negligible means: so small or unimportant as to be not worth considering
yeah i heard you have 1000's of files in your mission wow
the most i think i ever had was like 100 or so
but then i only make 10 player missions
The code base been around 10 years so very little of it is actually mine. It's very unorganized and there's a lot of really old code that makes me sigh from time to time but I have fun.
A lot of you guys do really cool stuff with AI and a lot of that is stuff I've never ever really even explored before since I don't commit much outside of that code base. I haven't even ever made my own workshop mod before. Just different stuff ๐
oh shit i counted all the files in one of my missions and its like 200 oh shit lol i never counted before ๐
cool we do whatever we can do with the help we get in discord: right m8 : ๐
and its great help
i'll tell you one thing my chopper command never would of came to be with out the help i got in Discord: from Dart and other great guys
i kept telling myself some day this will be Awsome: ๐
Does someone know what the diffrence between "Dammaged" and "Hit" EventHandler ist?
Is it possible to force an AI's laser on even during daytime? I've got a function running in scheduled environment that periodically synchronizes focusOn isIRLaserOn _weapon and focusOn isFlashlightOn _weapon to the entire group with enableIRLasers and enableGunLights respectively.
However, while flashlights are forced on correctly (i.e. cursorObject isFlashlightOn currentWeapon cursorObject reports true), they don't do the same with lasers, despite being in combat mode and having called _group enableIRLasers true. I've confirmed with another player that he can see my green lasers in daytime normally, and that the recruits are using the same laser attachment (CBA attachment modes) as the player, and isIRLaserOn returns true on the player while false on AI.
Once the time turns dusk, the AI all turn on their lasers at the same time as desired, but since these are visible lasers, I want them to use it in daylight too.
from the docs, it seems like both handlers take different arguments and Hit is less reliable, but in practice i'm not exactly how often they would fire
(HandleDamage is what i normally use)
I tried to use it on an AR-2 now, when I crashed it, it didnt trigger, so I wont use it anyway (I gave it hit and killed EH too, those triggerd)
But thanks for the help
you might be interested in HandleDamage, it provides the same details as Dammaged + more, and fires more reliably than Hit:
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage
(possibly too much, if you systemChat it)