#arma3_scripting
1 messages Β· Page 591 of 1
Is there a way of checking if an entity (like a mortar) is in range of an object?
Going through the clipboard assumes the clipboard won't be cleared by other actions before the next mission is run (outside your control and therefore extremely unreliable). If you want to have stuff persist between missions you would probably want to save stuff to the profile namespace or whatever.
@simple notch This script should automatically dynamically assign players' membership of a custom channel depending on whether they have RTO equipment, allowing the RTO role to be passed along when someone inevitably gets shot in the head.
https://pastebin.com/MjKFu7M6
(give it 10 minutes for someone to point out I've made a huge mistake though)
Is profilenamespace on the server persistent even if server is restarted?
Do i need to use saveprofilenamespace to make it persistent
@hallow mortar Sorry, I worded that badly. I want to check if there is a mortar inbound to a location.
It's persistent with saving. I use it for ghetto player log.
@echo cloud detecting whether a mortar round is going to come to that location is outside my knowledge, but you can detect whether mortar rounds are nearby using https://community.bistudio.com/wiki/nearObjects. Won't tell you if it's inbound, outbound, or throughbound though.
airconvoy1_grp move getMarkerPos "airconvoy_mark_1";
sleep 6;
airconvoy2_grp move getMarkerPos "airconvoy_mark_2";
sleep 6;
airconvoy3_grp move getMarkerPos "airconvoy_mark_3";
waitUntil
{
airconvoy_1 distance getMarkerPos "airconvoy_mark_1" < 400;
};
[airconvoy1_grp, [3926.053, 10283.298, 0], convoyland_1] spawn BIS_fnc_wpland;
sleep 5;
[airconvoy2_grp, [3960.072, 10316.619, 0], convoyland_2] spawn BIS_fnc_wpland;
sleep 5;
[airconvoy3_grp, [3843.103, 10200.769, 0], convoyland_3] spawn BIS_fnc_wpland;
waitUntil {
(visiblePosition airconvoy_1) select 2 < 1
};
airconvoy_1 setFuel 0;
waitUntil {
(visiblePosition airconvoy_2) select 2 < 1
};
airconvoy_2 setFuel 0;
waitUntil {
(visiblePosition airconvoy_3) select 2 < 1
};
airconvoy_3 setFuel 0;
this works fine for getting 3 helicopters to take off, fly across the map, and land
however, it doesn't work if the player does what he's supposed to do, and shoots 1 or 2 down
nested if then statements kill me. How do i make this work if one or more helicopters are missing?
Where does it stop working? And does it give errors?
it gives no errors, but if one of the helicopters is dead, they will just sit hovering by the landing pads and not land
It will fail the waitUntil if the airconvoy_1 helicopter is the one that dies
BTW... A if...else statement for each group/unit is advised, so it doesn't wait on the first group when dead...
waitUntil theyAreClose or theyCantMove
that would still pause the script forever if the unit was dead
why not use addWaypoint etc. to preload them with a set of waypoints rather than doing all this waitUntil stuff?
I've tried alot of different ways, this gets them where they need to go the most reliably so far
wow, the BIS_fnc_wpland wiki page is []fest Oo
gonna fix that
Can i do this with sqf case
?
i don't know much about using it but may fit the bill?
or maybe just run a different script for each helicopter, as clunky as that seems?
I mean, probably, but my hunch is that you'd end up with a ton of repeated code
my preferred method is with a careless pilot and a set of waypoints. Never had much trouble with that and it's very resilient against casualties.
i need help real fast
i need to spawn people instantly that are waiting to respawn
for some reason they have 1 hour to respawn
setPlayerRespawnTime?
setrespawn time isnt working
it is a local command so make sure to execute globally
for some reason they have 1 hour to respawn
well maybe there is another issue to fix first?
Incorrect mission settings, and I believe there's a Zeus module which allows you to change it, although could be Achilles/ZEN only
it sounds like this is a situation that is currently in progress
have you made sure to execute setPLayerRespawnTime globally
i just went with 3 separate scripts...going to keep it going amateur style
there are a number of respawn functions listed on the wiki that could theoretically be useful. Unfortunately, none of them are documented
Another question, why can I createVehicle Bo_GBU12_LGB but I cannot with Sh_82mm_AMOS or mortar_82mm?
What sort of error is being generated?
Isn't the difference that one is in CfgVehicles and the other in CfgAmmo/CfgMagazines?
how do i drop guys out of an airplane with their backpacks?
you push them
I'm trying to make a script that removes all the weapons from a player if they dont join the mission in progress and for some reason it isnt working
Is there an easier way than just pasting my code lol
Lol
Okay so I have my initPlayerLocal, this is saying what to do if it is JiP or not
```sqf please - see pinned message
haha
ugh

_unit = _this select 0;
_isJIP = _this select 1;
if(!_isJIP) then
{
[_unit] call LtP_fnc_playerSpawn;
};
if(_isJIP) then
{
};
Okay so I have my initPlayerLocal, this is saying what to do if it is JiP or not
private ["_player"];
_player = param[0];
removeAllWeapons _player;
fn_playerSpawn ^
class LtP
{
tag = "LtP";
class functions
{
file = "functions";
class playerSpawn {};
};
};
functions.hpp ^^
_player = param[0]; no.
replace it is select 0?
NO
π’

FeelsBad
private ["_player"];
_player = param[0];
removeAllWeapons _player;
```βββ
```sqf
params [
["_player", objNull, [objNull]]
];
removeAllWeapons _player;
wtf is objNull
1/ defaultValue
2/ possible types
// _unit = _this select 0;
// _isJIP = _this select 1;
params ["_unit", "_isJIP"];
if (!_isJIP) then
{
[_unit] call LtP_fnc_playerSpawn;
};
/* NOT NEEDED - or use an "else"
if(_isJIP) then {};
*/
now your code should work⦠unless your function is not well defined.
(it should have worked before)
hmmm it still didnt work
class LtP
{
tag = "LtP";
class functions
{
file = "functions";
class playerSpawn {};
};
};
@simple notch I hope all this is wrapped in a CfgFunctions, and that your file is %ROOT%\functions\fn_playerSpawn.sqf
respawn = "Base";
disabledAI = 1;
class cfgFunctions {
#include "functions\functions.hpp"
};
This is the description.ext ^
CfgFunctions, just in case
And my functions\fn_playerSpawn.sqf if just in my mission folder
like in the mission
and if you call it from the debug console, it works?
Sometimes I wish there was a command like _file = openFile "test.vars";, then it would be possible to
_value = _file getVariable "myVar";
saveFile _file;
closeFile _file;
I mean imagine if file operations could work exactly same way vars.arma3profile works, just you know, do it with a different file instead of same predefined file.
One can dream, right? π€
open door to viruses, yay! I think this is the main reason why this is disabled ^^
how can one open door to viruses with that, if it writes not binary data but data in same format as vars arma3profile file (binarized config as I understand)
at least an exploit (in MP) where you saturate one's HDD
just needs to be ensured that one can't exit the folder with something like ..\ etc
well I can saturate it by writing to your profile namespace too π
hmm, you could crash the game, but not saturate the HDD I think
How do I call it from the debug console?
I can crash your game with GUI commands easily π
IIm doing it through a dedi
yes, but not tank my PC @astral dawn π
@simple notch try in the editor? if you test your mission every time on a dedi, it will take a long time
and if I remoteExecute something like
_thatFileOnLousComputer setVariable ["varname", lotsofstuff];, well, it makes no sense since file handle can't be serialized anyway across network
DayZ has native file IO btw π€·
{} remoteExec call ?
DayZ maybe has better security too :D
but I don't know the exact reason as to why it was not made possible for Arma. Never needed, I guess
Well same reason as other unfinished things, nothing special
if i want to tell an aircraft to move directly OVER a player, not to him... ```sqf
killer0 move (position tester) select 2 = 200;
?
no
π¦
private _testerPos = getPosATL tester;
_testerPos set [2, 200];
killer0 move _testerPos;
aha! okay, so get player pos, then modify it
yup
thanks Lou!
when in doubt, split in smaller steps π
How do I get an object to execVM on a dedicated server? it doesn't seem to be executing when I load the mission onto the server. (I am putting execVM in the init of the object)
The execVM works when I make an MP game in editor, just not on the server
Alrighty. How do I then make it execute for one single object?
as it runs for every player
what I mean by that is that an init field execution is multiplied by the number of players
if (isServer) then { this execVM "myScript.sqf"; };
```should do
what does your script do?
try replacing it with a "_this setDamage 1" script
@echo cloud if your script uses player, think again
It doesn't
_weapons=["Sh_82mm_AMOS","Sh_155mm_AMOS","R_80mm_HE","R_230mm_HE"];
while {0==0} do {
{
if !(position _this nearObjects [_x,1000] isEqualTo []) then {
hint "INCOMING";
speak say3D "incoming";
speak_1 say3D "incoming";
speak_2 say3D "incoming";
speak_3 say3D "incoming";
uiSleep 60;
};
}forEach _weapons;
};```
Yes I know it is a while true loop go away xD
It is a mortar/missile incoming detector
you can just write while{true}
Alrighty
Fixed that
But the script doesn't even start when I did if (isServer) then {this execVM "mortar_detector.sqf";}; in the init of the object I wanted it in
Am I just being dumb?
never used init fields tbh, I'd do it with init.sqf
if (isServer) then {myObject execVM "mortar_detector.sqf";};
myObject veing the object name assigned in editor
much cleaner IMO π€
hint "INCOMING";
for whom will it hint if it's on deidcated server?
hint has local effect, shows message on the screen of computer where hint is executed
Oops
You'd have to removeExec that
RemoteExec global or client ID
although the say3D should broadcast
https://community.bistudio.com/wiki/say3D
also seems to have local effect
although the
say3Dshould broadcast
it says local effect π€ although I've never used it myself
playSound3D is the way to go I guess
say3D is direct and playSound is global (within range)
most proper way is to make desired effect with commands giving the right effect, and remove execute whatever must be remote executed
ideally you'd like to have some function like onMortarIncomingLocal which is then run on clients which plays sounds, shows messages, etc
Alrighty, playSound3D is not working. The path to the audio should just be "SOUND.OGG" as it is in the root dir with init, right?
(I plan on cleaning this up later btw)
nope, see the wiki page - it needs a full path
getMissionPath thanks wiki :p
what can i use to determine if a player is looking at something? trying to pop a trigger with it.
cursorObject
k so I'd have to use some sort of if statement then
for a trigger condition it might (untested) be as simple as cursorObject == yourObjectName in a global trigger
hmmm ill try it
if you want to detect when a specific player is looking at something, that's gonna be a whole other thing
nah just any player in the game
there a better way at show/hiding markers instead of changing the alpha?
not really. options i can think of include changing the alpha, size, position or icon (to empty).
create/remove when needed/unneeded?
i think it might be less code just to change the alpha than creating/removing it
less code doesn't mean it's better π
Changing the alpha is extremely simple. I'm not really sure what a "better way" would consist of.
using a module instead. its okay, the alpha change is fine
Question regarding creating Cameras and creating pip images on screen. I have a script that is going to create and destroy the same UI element which will be a PIP camera view of a unit. Is it better practice to create/destroy the camera and terminate it each use? Or would there be a better alternative to doing so? I was thinking about just (un)hiding the display control/UI element instead of terminating/destroying the camera object.
I don't believe the the camera does anything, other than creating a view point which can be used. So destroying the control (or image on object) should disable the feed and improve client side FPS again.
okay, that was basically what I was getting at. is it better to create/destroy a camera and ui control or would it be better performance to just hide the UI control and leave the camera up. Thanks @exotic flax
I don't believe you need to destroy the camera, just stop relocating it since the position is static, so continues the script even when not used
although when not needed you can easily destroy it as well
how do i properly use an array in an array? I've been trying to avoid this, but I desperately need to know how to do it to optimize my code. I want to use the following code: ```["
_ent = player nearEntities ["Man", 1000];
"] call BIS_fnc_codePerformance; ```
that code should work without problems, so what do you want to do exactly?
it throws the following error: https://imgur.com/a/pJR0aae (missing ])
according to the wiki, this should work. https://community.bistudio.com/wiki/nearEntities
['_ent = player nearEntities ["Man", 1000];'] call BIS_fnc_codePerformance;
should work
problem is quotes in quotes π
so I have to do a remoteexec for showing chats on side channels for all clients? like:
cmdr sideChat "I have a few missions for you.";
I'm not too familiar with using remote exec but I'm guessing the syntax is something like...
cmdr sideChat "I have a few missions for you." remoteExec ["sideChat", 0]
?
If you want to do remoteExec, syntax must transformed from:
A command B
to:
[A,B] remoteExec ["command"]
so...
[cmdr, "I have a few missions for you."] remoteExec ["sideChat", 0]
?
Correct, AFAIK
its so much easier when people explain it like A command B.
That's how we have to think about it
and between messages its probably good to use a sleep 5 or something or the chat will get clogged?
Yes
and I want uiSleep correct? does that one have to be [] spawn as well?
[cmdr, "I have a few missions for you."] remoteExec ["sideChat", 0];
uiSleep 3;
[cmdr, "First, I need you to destroy 3 FIA weapons caches. I have marked the general area on the map for you."] remoteExec ["sideChat, 0"];
uiSleep 3;
[cmdr, "Next, I need you to destroy an NATO supply helicopter that is helping FIA forces between Vigny and Lolisse."] remoteExec ["sideChat, 0"];
uiSleep 3;
[cmdr, "Finally, word of a NATO vehicle factory is finished preparing APCs for the FIA. Destroy those vehicles."] remoteExec ["sideChat, 0"];
uiSleep 3;
[cmdr, "Check your tasks on the map for more info."] remoteExec ["sideChat, 0"];
In Multiplayer (at least I assume) there's no significant difference between sleep and uiSleep AFAIK so would work
run code in scheduled
i was afraid that would be the next thing I have to learn lol
Scheduled = spawn, execVM
Unscheduled = call, Event Handlers
(not really, there's more thing to explain but this is for rough understanding)
And sleep, waitUntil and other βwaitβ commands can only valid inside Scheduled environment
still throwing expression errors with
[] spawn uiSleep 3;
sigh... does it need to be
[] spawn {uiSleep 3};
lets see
the answer is yes, even though there is no mention of it on uiSleep wiki
Your code does work technically, however it only does wait then end itself. You need to include everything include chat commands into one spawn scope
yeah i notice that it only reads the first line, then the sleep, then nothing else
so...
[] spawn {
[cmdr, "I have a few missions for you."] remoteExec ["sideChat", 0];
uiSleep 3;
[cmdr, "First, I need you to destroy 3 FIA weapons caches. I have marked the general area on the map for you."] remoteExec ["sideChat, 0"];
uiSleep 3;
yadayadayada
}
still only reads the first chat line though
Would work though... How'd execute it?
i have it on a trigger that has a condition of triggerActivated of another one. my unit says the first chat line then doesn't continue
im throwing that in the onActivation box of the trigger in the daisy chain
[cmdr, "First, I need you to destroy 3 FIA weapons caches. I have marked the general area on the map for you."] remoteExec ["sideChat, 0"];```
`"sideChat, 0"`
Hey!
whats up
[cmdr, "First, I need you to destroy 3 FIA weapons caches. I have marked the general area on the map for you."] remoteExec ["sideChat", 0];```Should be, I mean
If you want to be very clever, put all your dialogue remoteExecs in one sqf, in a case system organised by each dialogue "event" and with the case selector variable as a param for the script. Then your trigger can just be ["eventcasename"] execVM "dialogue.sqf" for each event. All dialogue in one easily-managed file, easy-to-read triggers, locality is easy because you make it server-only and remoteExec everything, and everything works because it's a scheduled script. Nice and tidy.
I understand most of that, except this case system you are talking about
In Multiplayer (at least I assume) there's no significant difference between
sleepanduiSleepAFAIK so would work
@warm hedgesleepcan be affected by the FPS/ShedulerLoad, so executing (much) later than supposed/expected.
Hmm good to know
how to kill an active splendid camera with sqf?
Maybe closeDialogcloseDisplay?
Lemme test it quick
findDisplay 314 closeDisplay 0```Did work like a charm at least on my environment
yeah but you are stuck in camera view, right?
ok its fine if you are in an unit
but if you do it while in Eden/launching 3d preview without unit, you get stuck
Looks that's an intended behavior
TEST_SplendidCam = missionNamespace getVariable ['BIS_fnc_camera_cam',objNull]; TEST_SplendidCam cameraEffect ['terminate','back']; camDestroy TEST_SplendidCam; (findDisplay 314) closeDisplay 0;
this should work too, but doesnt for me ["Exit",[]] call BIS_fnc_camera
So I can put this into the init of a unit placed in 3den, and it is not targetable by radar. ```sqf
radarTarget = 0;
but i don't know how to alter it via script
vehiclename radarTarget = 0
does not work
what? no.
So I can put this into the init of a unit placed in 3den, and it is not targetable by radar. ```sqf
radarTarget = 0;
@spark rose nope, you can't
all you do here is define a global variable to 0.
aha
well i just decided not to simulate the guy till i need him anyway
cheap tricks π
hideObject exists too
yep. i did hideObjectGlobal and enableSimulationGlobal
how can i send a script in the chat correctly?
see pinned messages
_muerto = _this select 0;
_instigator = _this select 2;
_instigatorName = name _instigator;
_muertoName = name _muerto;
_playerID = getPlayerUID _instigator;
_getTkCount = missionNamespace getVariable format ["tk_count_%1", _playerID];
if (isNil _getTkCount) then {_getTkCount = 0}
if (side _instigator == side _muerto) then {
_newTkCount = _getTkCount + 1;
if (_newTkCount == 3) then {
missionNamespace setVariable [format ["tk_count_%Βͺ", _playerID], 0];
serverCommand format ["#kick %1", _playerID];
parseText format ["%1 ha matado a 3 aliados y ha sido kickeado. <br/><img size='5' image='textures\ghana.paa' />", _instigatorName] remoteExec ["hint"];
"Astronomia" remoteExec ["playMusic"];
};
if (_newTkCount == 2) then {
missionNamespace setVariable [format ["tk_count_%1", _playerID], 2];
_instigator setDamage 1;
hint "Has matado a un aliado. \nEste es tu segundo y ΓΊltimo aviso.";
format ["[FUEGO AMIGO] %1 ha matado a %2, este es su segundo aviso.", _instigatorName, _muertoName] remoteExec ["systemChat"];
};
if (_newTkCount == 1) then {
missionNamespace setVariable [format ["tk_count_%1", _playerID], 1];
_instigator setDamage 1;
hint "Has matado a un aliado. \nEste es tu primer aviso.";
format ["[FUEGO AMIGO] %1 ha matado a %2, este es su primer aviso.", _instigatorName, _muertoName] remoteExec ["systemChat"];
};
};
what im trying to do is to is that everytime someone does a friendly kill, he gets warnings, for example in the first warning is a hint saying to dont do it again, then the second one one he dies and in the last one he gets a song and an image and then he gets kicked out
But i cant make it work, any idea?
(Im not very good at scripting)
How do you call this script?
What isn't working exactly?
What have you already tried?
im calling this script via this command ```sqf
this addEventHandler ["Killed", {_this execVM "tk.sqf"}];
wich is on the init of every unit
any idea?
does it do anything?
when i kill the first one, it doesnt do anything, when i kill the second one it says not defined variable and when i kill the third one doesnt do anything again
"tk_count_%Βͺ" // due to that
still the same
isNil takes a String or Code, not Number
then what should i do?
oh wait, it can't work iirc? side dead = civilian
so if someone dies his side will be civilian?
yes; btw: if someone (accidentally) kills 3 people at the same time (e.g grenade) he will immediately be kicked; is it what you want?
yes!
okido
here you go; should work @haughty fable
params ["_victim", "_instigator"];
private _realVictimSide = _victim call BIS_fnc_objectSide;
if ([side _instigator, _realVictimSide] call BIS_fnc_sideIsEnemy) exitWith {};
private _instigatorName = name _instigator;
private _victimName = name _victim;
if (isNil "YERAY_playerTeamKills") then { YERAY_playerTeamKills = 0; };
YERAY_playerTeamKills = YERAY_playerTeamKills + 1;
switch (YERAY_playerTeamKills) do
{
case 1:
{
_instigator setDamage 1;
hint "Has matado a un aliado. \nEste es tu primer aviso.";
format ["[FUEGO AMIGO] %1 ha matado a %2, este es su primer aviso.", _instigatorName, _victimName] remoteExec ["systemChat"];
};
case 2:
{
_instigator setDamage 1;
hint "Has matado a un aliado. \nEste es tu segundo y ΓΊltimo aviso.";
format ["[FUEGO AMIGO] %1 ha matado a %2, este es su segundo aviso.", _instigatorName, _victimName] remoteExec ["systemChat"];
};
default
{
[format ["#kick %1", getPlayerUID _instigator]] remoteExecCall ["serverCommand", 2];
parseText format ["%1 ha matado a 3 aliados y ha sido kickeado. <br/><img size='5' image='textures\ghana.paa' />", _instigatorName] remoteExec ["hint"];
"Astronomia" remoteExec ["playMusic"];
};
};
it will work even if a west soldier shoots at an independent (friendly) unit
thank you π , let me try it
now, when i kill someone (in the eden editor) it jumps into the third one directly
(the third one is the one that you called as default)
booting the game to debug
try adding if (isNull _instigator) exitWith {}; under params?
last edit:```sqf
parseText format ["%1 ha matado a 3 aliados y ha sido kickeado. <br/><img size='5' image='textures\ghana.paa' />", _instigatorName] remoteExec ["hint"];
// β
[parseText format ["%1 ha matado a 3 aliados y ha sido kickeado. <br/><img size='5' image='textures\ghana.paa' />", _instigatorName]] remoteExec ["hint"];
and ```sqf
private _realVictimSide = _victim call BIS_fnc_objectSide;
private _realInstigatorSide = _instigator call BIS_fnc_objectSide;
if ([_realInstigatorSide, _realVictimSide] call BIS_fnc_sideIsEnemy) exitWith {};
it works now!
and ```sqf
private _realVictimSide = _victim call BIS_fnc_objectSide;
private _realInstigatorSide = _instigator call BIS_fnc_objectSide;
if ([_realInstigatorSide, _realVictimSide] call BIS_fnc_sideIsEnemy) exitWith {};it works now!
@winter rose
where do i add that part?
replace the call BIS_fnc_sideIsEnemy line with that
it's to replace the side checks, because after killing two people you are "renegade", not "west" anymore
params ["_victim", "_instigator"];
if (isNull _instigator) exitWith {};
private _realVictimSide = _victim call BIS_fnc_objectSide;
private _realInstigatorSide = _instigator call BIS_fnc_objectSide;
if ([_realInstigatorSide, _realVictimSide] call BIS_fnc_sideIsEnemy) exitWith {};
private _instigatorName = name _instigator;
private _victimName = name _victim;
if (isNil "YERAY_playerTeamKills") then { YERAY_playerTeamKills = 0; };
YERAY_playerTeamKills = YERAY_playerTeamKills + 1;
switch (YERAY_playerTeamKills) do
{
case 1:
{
_instigator setDamage 1;
hint "Has matado a un aliado. \nEste es tu primer aviso.";
format ["[FUEGO AMIGO] %1 ha matado a %2, este es su primer aviso.", _instigatorName, _victimName] remoteExec ["systemChat"];
};
case 2:
{
_instigator setDamage 1;
hint "Has matado a un aliado. \nEste es tu segundo y ΓΊltimo aviso.";
format ["[FUEGO AMIGO] %1 ha matado a %2, este es su segundo aviso.", _instigatorName, _victimName] remoteExec ["systemChat"];
};
default
{
[format ["#kick %1", getPlayerUID _instigator]] remoteExecCall ["serverCommand", 2];
[parseText format ["%1 ha matado a 3 aliados y ha sido kickeado. <br/><img size='5' image='textures\ghana.paa' />", _instigatorName]] remoteExec ["hint"];
"Astronomia" remoteExec ["playMusic"];
};
};
like that?
perfect! π
AIs will still shoot at the player since he killed two friendlies, if you want to avoid this see addRating)
i killed only one player but i got the first and the second warning?
that is weird? I tested it and it worked just fine. using mods?
Hey there, i tried using Dynamic Simulation for the first time and couldn't use it on playable Units. is it only usable on AI and objects or am i doing smth wrong?
Well, players can't be dynamically simulated because dynamic simulation turns off simulation for things. You don't want to turn off simulation for players - and you couldn't anyway, because it's based on distance from a player (and players are always right on top of a player for some reason)
gotcha thanks
looking for some ideas why this code doesn't run dedicated server, yet in SP and hosted for host it works fine: [_nimitz # 0, "ttt_nimitz_lowerLaunchbar", [_closestCatName, _plane, _nimspots], false] call BIS_fnc_callScriptedEventHandler;
is it because _nimitz # 0 is probably local to each client?
or on the server?
guess I gonna try with missionNamespace instead
most importantly, what is _nimitz?
it's a 'JDG_carrier_Spawner' Nimitz core object:
private _nimitz = player nearEntities ["jdg_carrier_spawner", 150];
seems it works when I hook the scripted eh to missionnamespace
or rather, an array of JDG_carrier_Spawner objects probably
hopefully one π
Hi All, Am after some help with scripting I am trying to stop others players being able to connect to my uav once I release controls. Has anyone done something similar? Thanks
Im thinking most likely u would want to set up a player slot that is designated for one drone but I am unsure on how to do that.
this is for a multiplayer exile server
hmmmmmmm. I wonder if there is an init line or something that can set all spawned UAV terminals are forced to have u directly interact with the UAV so it will only work for you.
something specific for the drone maybe? Like a code to enter to access that drone
can other players connect to a drone if someone else has already connected it?
no
I mean when you've connected to it in the terminal
yes, if you connect but do not use the drone someone else can take it
Say I am using it to locate a player, I mark the player and then "release controls" (back to my player) someone can then "open uav terminal" then connect to my drone and take it.
I wonder why there isn't a UAV passcode option for arma.
at least it would make people have to know the pin to access the drone
but then if there is a large list of drones, it would probably not help as they might just shift in the list if they are all the same drone model name
if someone is already connected you cant see the name in the list and they do have different names like "Alpha 1-1", "Alpha 1-2" ect..
would anyone happen to know how to make a
"if then and then" statement? I want a song to play before another song but I am unsure on how that would work entirely
Why not just have a trigger play the 1st song and another trigger play the 2nd song with a delay?
or just play the song, set a delay, play next song all in one piece of code?
Itβs an adaptive music script. So triggers are kinda not the point. This is the sqf that is in the mod https://pastebin.com/US3FSjbX
Iβm just kinda curious how I can incorporate that into this
It would have to be in the top section where it is calling for combat music
best would be to ask from whoever wrote it
although based on the pastebin I can already tell it won't work at all...
probably removed too much code while making it your "own"
Is there a way to remoteExec to the server and get a response in the debug console, in the way that CBA's target debugging handles the "Target Watch" section? (https://github.com/CBATeam/CBA_A3/wiki/Target-Debugging)
The best I can do so far is just providing a callback and using remoteExecutedOwner to remoteExec that callback to the client, but I'd like to populate the response field in the debug console
like... what is ["fnc_ChopReward", { // code }]; doing, when is it called, how is it called?
if you would have tested it in-game you would know it doesn't work π€
@tough abyss

does anyone have a quick code line to detect altitude?
if (getPosASL player >= x=100) then hint format ["yes"];
wasn't sure if this was correct?
lose the x=
and getposASL player select 2
as the getpos gives you array of 3 values, X,Y,Z out of which Z is height
if (getPosAsl player >= [0,0,100]) then hint format ["yes"]; this correct @young current ?
you probably should try it instead of asking me π
if (getPosASL player select 2 >= 100) then {hint "yay"};```
yep thanks, that fixed the problem @warm hedge
few {} changes on the actual section of the script for it and its working like a charm
In my Co-op mission, when I respawn, I want to only keep my "current" loadout,....that I had when I died. I got that Ok,...
However when I respawn, the weapon I had is still lying on the ground. What script command could I add to "clean it up" or "delete" it?
I've tried a few variation but notta
EH "Respawn" -> deleteVehicle _corpse ?
not sure if it also removes the weapon (which is a weapon container), although I believe it's tied to each other, since if I remove a body in Zeus it also removes the container next to it
removeAllWeapons player;
removeGoggles player;
removeHeadgear player;
removeVest player;
removeUniform player;
removeAllAssignedItems player;
clearAllItemsFromBackpack player;
removeBackpack player;
Is there any reliable way to pass through variables to missionEventHandlers?, such as the Draw3D one, without relying on globals?
oh phooy, I didn't mean to do that
and then,
player setUnitLoadout(player getVariable["Saved_Loadout",[]]);
@normal abyss you could store data in missionVariables and use those inside a mission EH
I may have to look at putting the script in the onplayerkilled instead of in the onplayerrespawn
That's my current idea on the solution, issue with that, for what I'm trying to do is setting up a handler for updating that, if there's no other way I guess that's the pain I must suffer.
any custom handler/trigger/script should be able to update a missionVariable, and since Draw3D is running on each frame, it should also update the moment it changes
That would mean instead of passing data, I'd have to prepare an array and run a foreach since it could be running multiple Draw3DIcon's at once. Where as if I could just pass it through it'd save me some slack.
Draw3D runs local only, so you'll need a way to send it to all clients anyway, and have it up to date the moment it's needed (since the EH won't run when not needed)
and mission EH's don't take parameters at all, so using missionNamespace getVarialbe ["key", "val"]; is probably the only option (which also needs to be broadcasted to all clients)
Ah okay, when updating missionNamespace I imagine it's the same as setVar?
missionNamespace setVariable["varName",'Data',true];
yes
aaare you using mods?
in a for loop, can I use a variable that has already been defined earlier in the script? I have a variable _time which is tracking, you guessed it, time that could be flowing forwards or backwards depending on a condition. would this throw an error?
for "_time" from _time to 0 step -1 do {
//stuff
sleep 1;
};```
and would it affect the _time variable that is outside the scope of the for loop? like if _time was equal to 30 before the above loop, would it equal 0 after the loop?
hey how to hide the list of people at stake when we consult the map?
Do the config commands cache values for quicker subsequent command usage in a mission?
still not figuring out the scripted eventhandler stuff with dedicated server... somehow the scripts added via BIS_fnc_addScriptedEventHandler are not executed when BIS_fnc_callScriptedEventHandler is called. It works in SP though. I changed the namescape to missionnamespace, but no luck
found it, the add scripted eh calls were in a block with isServer, so never added on the clients ...
@slim oyster no
@ionic timber wut?
@tame lion I think you can, but if not, just rename your second _time as _time1 or _countdown
I'm talking about the players menu menu tab @winter rose
Ive got a script on my Exile server that takes how much Respect you have and assigns it a rank. It prompts a text display when you first log in to show your rank and a message saying how much there is to go. Problem is it doesnt display once you reached the next level (respect req).
it only displays when you first load into the server
anyone know a way to set this as a keybind to show and make it automatically pop up once you meet the level requirement and "level up"
@digital crown ```sqf, see pinned messages
This is not how the pinned message taught you, use ```<- this
waituntil {!isnull (finddisplay 46) && {alive player} && {typeOF player != "Exile_Unit_GhostPlayer"}};
if ( alive player ) then {
uiSleep 2;
_Respect = ExileClientPlayerScore;
case (_Respect > 0 && _Respect < 2500):
{
_rank = "Private";
[parseText format["<t size='0.8'font='PuristaMedium'color='#4bbaff'>Your Rank is %1</t><br/><t size='0.4'font='PuristaMedium'>You need to earn 2,500 respect total for the next rank!</t>",_rank],0,0,10,0] spawn bis_fnc_dynamictext;
};
case (_Respect > 2499 && _Respect < 5000):
{
_rank = "Private First Class";
[parseText format["<t size='0.8'font='PuristaMedium'color='#4bbaff'>Your Rank is %1</t><br/><t size='0.4'font='PuristaMedium'>You need to earn 5,000 respect total for the next rank!</t>",_rank],0,0,10,0] spawn bis_fnc_dynamictext;
}; ```
When switching personal weapons, the weapons HUD shows red until the new weapon is read, and obviously firing is disabled while it's red. How could I script disabling weapons in a similar way?
@digital crown only put cases in switch, nothing else Oo
I will redirect you every instance of debugs for that
but the way you are using it.. a if/then/else would be way more sensical and easier to understand
also, you could only use switch cases to define rank and respect points to earn, then display once after the switch
Can someone fix this for me, I can send paypal
I can 4 free
Saweeeet
Basically I need the rank text to show up once they have enough respect for each level, to show them they're leveled up obviously, instead of only when you first log in like it is now
btw is this all your code? becan neither switch nor if are closed
And would be great to be able to put it on a hot key or something so it will be able to be shown when people need to check it,. Or some other idea
No I've adapted it from another guys
Oh you mean the whole thing
No. One sec
you can post on sqfbin.com
https://sqfbin.com/lojecogecudicuqajiti @digital crown
@Lou Montana#8901 so just plug in the other ranks and upload this into the same spot as my old one?
Also is it possible to put it on a hot key as well that will pop up a text saying your rank and then how much respect you have left until the next rank?
@winter rose
just plug in the other ranks and limits
as for the popup, it's another thing
is it possible to turn off the crosshair during a running MP game via console? if yes - how?
see showHUD @signal kite
https://community.bistudio.com/wiki/showHUD
@winter rose it just works as long as the player doesn't switch weapons
the cursors parameter? π€
yes
thanks for confirming π
@winter rose On my last one on the list, Do I delete the " _nextRank = x" bit
since theres not a next rank
so my last two entries are:
{
_rank = "Secretary of Defense";
_nextRank = 2000000;
};
case (_respect > 2000000:
{
_rank = "President of the United States";
};
```
Also @winter rose When i first log into the server, it doesnt say the rank
you can delete yes, it will remain 0 iirc.
as for the execution, IDK how you do it! Β―_(γ)_/Β―
what do you mean
@winter rose This is the whole code after i added in the other ranks, but its not working in game
seems ok - when do you run it? and is ExileClientPlayerScore defined at that moment?
any script errors?
the original one i just put int he customs folder inside the mission PBO and it made the text with rank appear when you first log into the server
problem being, it only showed when you first log in, if you get enough respect to level up, it didnt trigger a text with your new rank
it would only show next time you log in again
wait, I don't get it - the code https://sqfbin.com/linatosucomewizadewi, does it work on login or not?
no
does not do anything
when i get respect, no message, when i first log in, no message saying what rank i am
we did not do anything to get it to display on "getting respect", as you never mentioned that before
do you use the -showScriptErrors Arma parameter?
i just meant, when i get enough respect to trigger the next level, not every time i get a small amount
custom folder inside mission pbo
Where?
exact location plz
Exile.Altis.pbo
unpack that
make new folder named "custom"
place Ranks.sqf inside this folder
repack pbo
place repacked pbo inside mpmissions folder
I don't know Exile structure, so maybe you place ranks.sqf or useThisScript.sqf but this script still has to be called
hmmmm
if it worked before, I guess it was called?
Hi, am working on an EventHandler and I'm struggling with setOwner command. (UAV) AR-2 Darter, when this specific event happens I want the "player" to become the "owner" of the object. I'm not sure what the object (AR-2) class name would be. Any help with this?? Thanks
get the classname: typeOf _myUAV
setOwner does not set ownership of a UAV, it sets an object's network ownership
@craggy wraith β
Im trying to see whats different between your code, and the original code i sent, because the first one loads for some reason
@digital crown the waitUntil part is different
maybe reset it (same location as mine) to what yours was
ohhh god that has totally threw me off now.. π maybe am little out of my depth here. its a steep learning curve.
@craggy wraith ok: what do you want to do here π
its a multiplayer exile server, All the players are the same alliance. When you connect to your uav and then disconnect another player is able to take control of it.. So what am trying to do is when you connect to that UAV you become the owner so another player is unable to take control if that is even possible? I was doing this by an EventHanlder the event trigger would be "connecting to the uav" and so on...
not without some advanced scripting, EH indeed
exactly and that's way above my capability's at this time π but am still trying...
Does anyone know a way to place an IR grenade on the map that never stops blinking?
Or does anyone now after how exactly many seconds they stop blinking?
is it possible to recompile an addon function?
Is there already a way built into the game to track civilian deaths? Or do i need to build it?
buiiild
π
@spark rose if they don't respawn, you can maybe use allDeadMen (not allDedmen) and BIS_fnc_objectSide+isKindOf
but honestly, a Killed EH on each civilian is better
or even better maybe, entityKilled mission EH
is there a doAction for scanning the horizon?
hmmm mk. i'll have to change my idea then.
you can still script it
*allowFunctionsRecompile
@grim coyote Thanks π
Trying to write a script that removes all weapons if you kill someone but I'm not really sure what i'm doing lol. Heres my code.
onPlayerKilled.sqf:
params [
"_oldUnit",
"_killer",
"_respawn",
"_respawnDelay"
];
removeWeapon _killer;
correction I have no idea what i'm doing*
removeAllWeapons* @simple notch
It doesn't work π€
what is virutal arsenal under in scripting command wiki?
Why can't I find that here https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3 ? is their a better link for these?
It's not a script command but function: https://community.bistudio.com/wiki/Category:Arma_3:_Functions
What's the difference?
Commands = Engine-driven, Functions = made of (a lot of ) commands
aha idk why I asked that, I didn't get that at all. Anyway ty for the link
Is there an easy way to return all available weapon attachments into an array? currently trying to use _array = ("true" configClasses (configFile >>"CfgWeapons"); to return everything, but I need to limit the scope to just weapon attachments.
Your code doesn't make sense, but you just can change the condition (the "true" part) to make scope smaller
that's the part I'm confused at, I'm not sure what to add there to slim the scope down.
"getNumber (_x >> 'ItemInfo' >> 'type') in [101,201,301,302] and getNumber (_x >> 'scope') == 2" configClasses (configFile >> "CfgWeapons") apply {configName _x};```
thank you so much @warm hedge β€οΈ
Is there a way of setdate/time on a client machine (specifically headless client) that does not automatically sync with the server time?
i dont think you can have multiple times independent of eachother
that'd definetly π¦ with a lot of scripts
@slim oyster not without (very) periodically overwriting local time, and even that is not guaranteed.
Main question would be: why?
Night AI are terrible and I want a headless client to cheat by giving it a different local time
For time via scripts I always use CBA_missionTime and I would assume engine has gametime internal stuff for sim as setdate globally works fine
One of the ways I've dealt with that in the past is by config patching a special pair of NVGs to not have a model, then auto-equipping them to AI, not sure if that's a solution that would work for you
Could experiment with that
I am just looping setdate and it works well was just wondering if there was a better way for this behaviour
Setdate to dusk/dawn for night missions is yielding some great results
full moon also works good
i know what you mean, but vehicles are living things by your definition
made by createvehicle
flagpoles also created by createvehicle, but are not entities
logics aren't entities, i know that and I sort of get that
ah well, living things and vehicles ^^
but yeah, surprised flagpoles arent
i like nearentites, its very cpu cheap
will try nearobjects, though it can only search for a single class at a time
ugh, nearobjects cpu expensive
ok, workaround time
is "InventoryClosed" EH persistent to unit after respawn ?
Anyone got some good knowledge of EventHandlers?
nope
π
I have an event and the trigger but I'm not sure how to set the outcome when this event happends I want "isUAVConnected" to be true.
Player addEventHandler ["connectTerminalToUAV" ,
{
_person = (_this select 0)
_uav = (_this select 1)
then once the "player" has triggered the event I want "isUAVConnected" to be true
but I'm not sure how to add that/ the code for it.
this connectterminaltouav eventhandler.. i cant find any documentation for it
ohhh π¦
so, back to basics, you want to sense when a player connects a terminal to a uav?
I want to stop another player connecting to a uav once I "release controls" in game, so I thought using "isUAVConnected" keeping it true would stop this
right
and instead of connectterminaltouav would "WeaponAssembled" work?
as you assemble the drone from the bag?
good, call, cant say either way on that
that may work
ok, give me 5, been called afk
okay thanks π
ok, back.. had someyummy cake
so, you want to prevent players using a particular UAV?
i cant' see a command that would reject a terminal, or refuse a connection
ah wait, this might be it
example 2, might be relevent
Once a player is already connected to the uav another player cant connectt
yes
but once player a disconnects, player b might connect and you want to rpevent that
ok, so this isnt real code, but this is how I would go about this
on the UAV itself, crate a variable using setvariable
that has the name of the player who is allowed to connect to it
yes
and then it belongs to them
so the first player would store his name on the uav, so to speak
yes
then using example 3 on the remotecontrol page i linked earlier
you can get who is connected
you'll need to do this in a loop as there is no eventhandler
I can never done a loop before, I will read into them.
sorry I'm not sure what you mean by that?
you're going to write a loop that checks who is connected to the uav, this loop will run around every half second or so
okay am with you
it will check who the player connected to the uav is
if it's not the same as the setvariable we did earlier, it will disconnect him
using example 2 on the remotecontrol wiki page
job done,that'll be Β£50 please
π
because there is no EH
okay thannks π
you'll need a loop that checks who is on the uav
the first player who connects, the loop will write hisname to a variable on the UAV (setvariable)
and that will still keep the remote even when he disconnects ?
ahhhhh
the loop will then check for new connections to the uav
if the new connection name isnt the same as that already stored on the uav, disconnect him
it will mean that the 2nd player will briefly get connected, but will get disconnected almost straight away
thats fine as long as it kicks him off after the "remotecontrol" has noticed its not the set player.
yep
Β£60
charge for luck wishing
π
im much cheaper than @winter rose , but thats because hes good
hahaha I will bare that in mind π
you might want to consider that what you want requires some 'hacky, unorthodox' code
and a bit of mission redesign might enable to use better code
is it that bad..??? π
not necessarily
I hope notπ π€
sometimes we have to write some hacky code like this in order to achieve what we want
we've all done it
exactly as long as it works
yes, lets go with that lol
my point is... if the code we are forced to write because there is no good EH, is so nastly, and I would describe this loop as less than nice
I might rethink the requirements.. ie, think of another way, perhaps change the mission story a little so that the mission doesnt need to ahve a single player only allowed to use a UAV
am I making any sense?
*notices the rest of the room staying very quiet and not backing me up on this lol
Yeah I see what you are saying
cool
Maybe if it's too hard then I will have to leave it but I appreciate the help so far!!!
is there a way to stop the idle animations trying to make blend in mission but sometimes they give it away
where are the animations trying to blend?
no I think he means the idle animations when you sit still - @hollow cloak are these AI?
@finite sail I am not that expensive? :p
No the player usually tilts head or looks around when stood still sometimes
usually when you lower your gun yes
Sometimes for an unarmed civ though
yep
if the civilian lies down, it reduces the risk
a solution could be to manually list the idle animations and to switchMove on animation changed EH
Okay thank you
Hello! I'm trying to find all of the gear classnames from the following mod to add them to a custom KP-Liberation arsenal":
https://steamcommunity.com/sharedfiles/filedetails/?id=1496363537
Is there a way for me to export all classnames for every uniform, vest, backpack, etc. to a clipboard and/or some sort of text file? I found this, but can't get it to work:
https://gist.github.com/Wolfenswan/82eb0019f2f3b0319ead
Any help would be greatly appreciated!
Are there any solutions to finding the location that a bullet has made first contact (Including terrain)
for what kind of purpose?
you can track a bullet with fired eventhandler, but I dont think there is a proper evenhandler to see where it hits something
perhpas handleDamage eventhandler if the bullet is able to take damage
My gut say no though.
I've already tried tracking the bullet, but when using FiredMan/Fired EH, the projectile position is always the unit who had fired position.
you are using it wrong then.
is there a way to prevent/disable the ability for player to assign them selves to a task? i have been search the web and i cant find anything.
iirc you can set it so that only the group leader can assign a group to a task in the mission settings in the editor
yeah i found that. im trying to disable it all together so no one can.
Not sure if thats possible
is there a command to change high command ownership to a different unit?
oh i suppose using hcSetGroup to a different player does the same thing
Currently in the process of making an add action script upon selecting the action it hides an object named A1
this addaction ["Test Drop", {(_this select 0) hideObject A1;}];
Does this seem to be correct?
im not really understanding this line of code that well:
for [{_i=(count _units)-1},{_i>0},{_i=_i-1}]
can someone explain?
same as for (i = units.size() - 1; i > 0; i--)
Remove "on" from EH name, as UIEH article notes
@warm hedge sorry i did that first and it didnt work and i posted my version of trying it back on. my bad. Ill update my snippet.
Ok i have to be doing something wrong!. I have tested 9 possible options out of desperation. none of them work when i double click on my map control. I have confirmed my ids are correct because on my "draw" works on it. Please Help.
Here are all the tests
waituntil {!isnull ((findDisplay 1234) displayCtrl 2200)};
_id = ((findDisplay 1234) displayCtrl 2200) ctrlAddEventHandler ["MouseButtonDblClick","systemchat 'testing 1';"];
_id = ((findDisplay 1234) displayCtrl 2200) ctrlAddEventHandler ["onMouseButtonDblClick","systemchat 'testing 2';"];
_id = ((findDisplay 1234) displayCtrl 2200) ctrlSetEventHandler ["MouseButtonDblClick","systemchat 'testing 3';"];
_id = ((findDisplay 1234) displayCtrl 2200) ctrlSetEventHandler ["onMouseButtonDblClick","systemchat 'testing 4';"];
_id = (findDisplay 1234) displayAddEventHandler ["MouseButtonDblClick","systemchat 'testing 5';"];
_id = (findDisplay 1234) displayAddEventHandler ["onMouseButtonDblClick","systemchat 'testing 6';"];
_id = (findDisplay 1234) displaySetEventHandler ["MouseButtonDblClick","systemchat 'testing 7';"];
_id = (findDisplay 1234) displaySetEventHandler ["onMouseButtonDblClick","systemchat 'testing 8';"];
_id = ((findDisplay 1234) displayCtrl 2200) onDoubleClick "systemchat 'testing 9';";
@still forum mate can you help me out? the internet has nothing to offer regarding custom double clicking on map events. Is this just not a working thing?
I found IT! Larrow For the win!
Best way to init a file on each client from within a PBO? Presuming config.cpp -> CfgVehicles somewhere..
On each client, ideally passing the player entity to the executed script
if it is run on each client, you can use the player command
class CfgVehicles
{
class Land;
class Man : Land
{
class EventHandlers
{
class list_init
{
init = "_this execVM '\test_directory\data\test_file.sqf';";
};
};
};
};```
Given something like this, when would this execute?
Lives in config.cpp
this would run the script for every man (and read from the disk each time)
(why not the A3 version?)
if you want one function to run once (per mission or per game instance), see CfgFunctions @plucky wave
That's the first that came up. Is there an arma 3 one?
ninja'd 
I only see weapon related ehs there
Didn't know they work in CfgVehicle Configs. I've never worked with that stuff
Yeah right, there is the init EH
Follow up question, anyone had issues execVM'ing a script from config.cpp once its binarised?
no, but it is not recommended (performance issues)
Hi , I need help with an script
When the script runs, it makes an animation, what happens is that I want it not to do it in a specific place.
I want to make some like this
if (case isEqualTo "houdini") exitwith {player playMoveNow "";};
But it don't work
help me pls
I don't get it. What do you wanted to make?
for starters thats not how select case works
https://community.bistudio.com/wiki/inArea would be for checking if the player is within the area
something like
if ((getPos player) inArea _AREANAME) then {player switchMove"";};
Would reset a players animation in a given area
@candid cape we will need moarrr details π
although more detail definately needed
if (_param isEqualTo "menu") exitWith {
if (vehicle player != player) exitWith {hint "Venga va, no me seas vago"};
if !((["pop_ganzua"] call ica_fnc_tengo) >= 1) exitWith {hint "Necesitas una ganzΓΊa"};
private "_dificultad";
_dificultad = param [1, 0.9];
if (_dificultad < 0.9) then {_dificultad = 0.9};
if (_dificultad > 0.99) then {_dificultad = 0.99};
player playMoveNow "CL3_anim_lockpick"; ```
The script says that the animation always runs, so I want that when I run a specific "case" the animation doesn't run
Is this "case"
case "houdini":{
_unit = player;
if (vehicle player != player) exitWith {hint "No puedes estar en vehiculo para usar hudini"};
_unit setVariable["restrained",FALSE,TRUE];
_unit setVariable["Escorting",FALSE,TRUE];
_unit setVariable["transporting",FALSE,TRUE];
detach _unit;
titleText["PLAIN","Has conseguido abrir las esposas."];
};```
use tripple ` and sqf suffix (```sqf) for code blocks in discord please
@candid cape look at the pins, should be quite simple to see how to make code blocks
Thats alot more readable, thanks!
is ica_fnc_tengo a custom made function? I tried googling it and it only came up with some old pastebins
The script is in Spanish, this function do not pay attention hahaha
It's for known if you have any object on your inventory
I see, makes sense
I just want to clarify what you mean by "case", is the case of "houdini" a variable a player has? Where is "houdini" assigned to?
if not houdini then play action
What this script does is execute a menu, as if you were forcing a lock, in this case it is the lock of some handcuffs.
So to execute the "case" it would be like this: ["menu", 0.9, "houdini"] spawn ica_fnc_ganzua
if not houdini then play action
@winter rose can you write it well pls ?
if !("houdini") then {switchAction ""};
ouch
I read your words litterally
what would you do?
im also fairly certain I miss understand what he wants
In this script there are several "cases", this script is characterized by forcing locks, be it car, doors ...
And in all of these an animation is executed as if it were forcing something
And I need that in the case of "houdini" it is not executed, because it would not make sense
a script case is different from using the case command
case must be inside a switch, which you do not use at all so forget about this command
simply do a```sqf
if (_myVar != "houdini") then
{
/* do stuff */
};
now I just realsied I forgot to put a variable with "houdini" with my example
need more coffee
then you are using a switch/case, ok
simply do a```sqf
if (_myVar != "houdini") then
{
/* do stuff */
};
this still stands?
I am thinking of doing another function, another exclusive script in which the animation does not appear
switch (condition) do {
if (condition == "test") then {hint "test"};
case test2: {hint "test2"};
}
(ignore me just being funny)
is there a way for an hint to be to the trigger player only?
In an addAction, in this case
oh, hint is local to the player? gotcha
yep
see its wiki page, top-left EL means Effect Local
https://community.bistudio.com/wiki/hint
@peak bridge
so this in the init of the npc:
[this,["Evacuate","evacuate.sqf"]] remoteExec ["addAction"]
plus this:
_civ = _this select 0;
_player = _this select 1;
if(side _player == resistance) then{
hint "This person does not trust non-medic personnel";
}
else{
_civ assignAsCargo (assignedVehicle _player);
[_civ] orderGetIn true;
}
The npc will obey and every player will see it obey, but only if the player who triggered isn't resistance side
got that right?
@peak bridge use ```sqf please (see pinned message)
quick answer?
does anyone know how i can make the decontamination shower activate using a trigger?
so "[this, 5.4, 4,2, true] spawn BIN_fnc_deconShowerAnimLarge;" right?
honestly im still really new to this whole thing
Replace this to your object name but that's it, I think
@peak bridge it will hint where the person executes the action, so player-side yes
Thank you very much π
Oh, and is the remoteExec properly implemented? I'm new to the MP scripting, that's why I'm asking
Actually, you should not use remoteExec - init fields are run for every client
See the red note here
https://community.bistudio.com/wiki/Multiplayer_Scripting#Join_In_Progress
(and keep this article bookmarked π)
@peak bridge
so i got it to turn on when triggered but it refuses to turn off again
wait
nvm
i just added 2 more triggers : ^)
oh wait im retarded
i just had to set it to repeatable
How should I add said addAction then?
But will the other players see the NPC run to the vehicle as the script says so?
https://community.bistudio.com/wiki/assignAsCargo has EG (Effect Global)
https://community.bistudio.com/wiki/orderGetIn has AL EG (the argument (_civ) must be local)
so you should only remoteExec the orderGetIn command
[[_civ], true] remoteExec ["orderGetIn", _civ];
```@peak bridge
So I should only use remoteExec if a command has EL or AL in it, otherwise i can just use the command regularly.
IE: addAction is AG EL, meaning it shows up to everyone, but it's effects (code dependent) are local.
But since in the code I'm using assignAsCargo, which is EG AL, this will be executed everywhere.
And orderGetIn has one Local, meaning that i need to remoteExec it for every player to realize it's effects.
Am I getting close?
for addAction it means that the argument doesn't have to be local: you can add an action to another player for example. but he will not see it
that's effect local
assignAsCargo is argumentGlobal and effectGlobal - so no need to worry about anything here
orderGetIn the argument must be local (the civilian), and when he is told to do so, the effect is global (a.k.a everyone will see him getting in the vehicle)
remoteExec has two functions:
remoteExec ["addAction"] will exec the addAction on every computer on the network - good to have a global effect with an otherwise local effect command
remoteExec ["orderGetIn", _civ] will exec the command only where _civ is local (for an AI, usually the server) - good to have a "global" argument for a command that only takes a local one
(aaand sorry for the wall of text.)
(aaand sorry for the wall of text.)
@winter rose No need to worry, it helped me understand AL/G and EL/G π
perfect! glad to help
And for good measure I copied and pasted on a text note
https://community.bistudio.com/wiki/Multiplayer_Scripting#Locality is the place to be!
How do I filter duplicates in 'group' object again? So for example if there's AI in there that are local to someone
@narrow pollen use case?
I receive a group object from a client on the server, and want to filter out duplicate ID's, put that in array to use with remoteExec later
I had exactly that in my code a while ago, but didn't need it anymore, now I need it again but forgot how to do it :/
Or can I just use that group object, and not care about it?
It's for use in remoteExec with music
Nevermind I found it again π
(units _ximgroup) apply {_groupOwnerIDs pushBackUnique (owner _x)}; //Retrieving ID's for players in group
or```sqf
_arr arrayIntersect _arr;
Hello, I have a request, is there a working script that spawn crew in vehicles, I need for ship cos actual one is not working properly with turrets, do you have an example script or can you help me ? I need to spawn big frigate from mod HAFM with all turret manned, in my old warfare code, I have problem and only partial crew spawn so I need some hints, Thanks!
@slate sapphire createVehicleCrew?
is there option to set the class of the crew using this command or it will read the config?
this one will read the config
my problem is that I need specific crew and I need to count the crew to see if it's not more than the group limit set by mission parameter
Β―_(γ)_/Β―
I know Dr. Gregory H.
personally?
hehe no just by serie hehe
Hello I have a problem regarding my onPauseScript.
I have defined a pausescript in my description.ext file. The main purpose of the script is to delete some custom HUD elements when the player enters the pause menu. The script itself works fine but it breaks the debug console on dedicated servers. For some reason it doesn't appear in the pause screen anymore even when I am logged in as admin. Removing the onpauseScript fixes the problem... Anybody have an idea? I have enableDebugConsole = 1; in my description already
for starters showing the script would help @autumn swift
The PIP driver cam custom info seems to match the fov of the pilotCamera. Is there a way to get the fov by script?
@digital hollow
You can try https://community.bistudio.com/wiki/BIS_fnc_camera_getFOV
Unless you use CBA, which I think have a getFOV function itself.
That's neat. is the pilotCamera its own camera object? or would this fnc only apply to the pip cam being used for the custom info?
on a side note I found a bug in Arma 2 (IDK about OA)
for "_i" from 0 to 2 do { hintSilent str _i; }; // works
for "_myIndex" from 0 to 2 do { hintSilent str _myIndex; }; // doesn't work⦠can you guess why?
Hello, I'm trying to setup a PvP mission more or less like the game Deceit. I'm currently trying to seamlessly select a certain % of random players to become the villain and spawn as villains (OPFOR faction) at different position while the remaining players respawn as the regular civilians (BLUFOR Faction) every 5 minutes during the mission.
At the initial stage when everyone connects and loads up in the mission this is run:
btk_fnc_MPexecVMLocal = {
params ["_villain"];
if (_villian isEqualTo player) then {
[] execVM "villain.sqf";
hint "You are the villain! Hunt everyone!";
};
};
if (isServer) then {
private _playerList = if (isMultiplayer) then { playableUnits; } else { switchableUnits; }; // For testing in editor mostly
private _randomPlayer = selectRandom _allPlayers;
sleep 15;
[[_randomPlayer], "btk_fnc_MPexecVMLocal",true] call BIS_fnc_mp;
};
So ideally for the dead it would be:
btk_fnc_MPexecVMLocal = {
params ["_villain_res"];
if (_villain isEqualTo player) then {
[] execVM "villain_respawn.sqf";
hint "You are now part of the Villains! Hunt everyone!";
};
};
if (isServer) then {
private _playerList = if (isMultiplayer) then { playableUnits; } else { switchableUnits; }; // For testing in editor mostly
private _randomPlayer = selectRandom _allPlayers;
if (_randomPlayer = allUnits select {isPlayer _x && {!alive _x}};) then {
_grp = createGroup East; // become OPFOR
[_randomPlayer] joinSilent _grp;
[[_randomPlayer], "btk_fnc_MPexecVMLocal",true] call BIS_fnc_mp;
}
};
However this does not work. I'd like to know how to make sure that the player stays in the spectator menu until he get auto-respawned by the script (every 5 minutes) and moments before respawn, he/she gets put into the villain unit to hunt other players in the hero unit.
Example: If the mission is played by 10 people, initially there will be 1 villain chosen at random with 9 other heroes. Assume 6 heroes die. Now after 5 minutes, when they respawn, 3 of the dead players are randomly chosen and are assigned to villain unit and are spawned at villain side of the map while the other 3 are spawned as the usual heros at their side of the map.
Is there a way to hide squad logos on vehicles per mission?
E.g. They'd be shown in a COOP mission, but hidden in a TVT mission.
The only way I've found is with a config.cpp, which wouldn't be per mission.
@surreal peak this is the onPause script
params["_pauseMenu"];
_abortButton = _pauseMenu displayCtrl 104;
("rsc_health_bar" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
_pauseMenu displayAddEventHandler [ "Unload", {
//When pause menu exits, close dialog
[] spawn AAD_fnc_healthBar;
}];
_abortButton ctrlAddEventHandler [ "onMouseButtonClick", {
("rsc_health_bar" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
}];
// Disable respawn button if player is not in a match!
if (!(isNull player) && !(player getVariable ["isInMatch", false])) then {
_respawnBtn = _pauseMenu displayCtrl 1010;
_respawnBtn ctrlEnable false;
};
I have no idea why setting this as the onPauseScript prevents the debug console from being displayed....
check description.ext for missing ;
also, try with an empty script see if it still breaks stuff @autumn swift
Hmmm, turns out I was wrong. It was not caused by the pausescript. The solution is to use the alternative syntax: enableDebugConsole[] = { "76561198XXXXXXXXX", "76561198YYYYYYYYY", }; instead of enableDebugConsole = 2; and whitelist per player uid
Why the latter does not work is something I don't understand, but I atleast its solved now
https://i.kym-cdn.com/photos/images/newsfeed/001/130/746/e41.png my work here is done
Forgot this channel doesnt preview images
@surreal peak don't forget to add a description (#rules)
@autumn swift how did you "whitelist per player uid" if not with this array syntax?
I meant that in order to make it work, I have to whitelist by player UID using the enableDebugConsole[] array syntax
enableDebugConsole = 2; seems broken for me, the only way to make it work atm is to use the array version
ok, I did read that wrong then π
http://www.armaholic.com/page.php?id=33195
Is someone familiar with this Script?
I put it into my mission as i should, with the folder and all that, but i just don't get the action to unlock/lock vehicles in the mission.
If someone has a good alternative and could send that to me would be nice
as far as I can see you need to add your steam UID to the whitelist, did you do that?
hey guys, is there a solution for switching the strange motions sensor lights OFF for the buildings of CUP objects. found scripts but they dont worked for the takistan cup objects with the lights
trying to teleport everyone in the server in a position
{{_x setPos(getPos t1)} forEach allPlayers}
this doesn't seem to work
what is that
{} around the outer?
Generic error on getting parts from an array:
_unit = _unitdata select _int select 0; for example.
I can get the first array, systemChat str _unitdata select _int; which shows it fine, getting a parameter like the unit class throws a generic error in expression when using: _unit = _unitdata select _int select 0;
an example of _unitdata would be [["I_AP_Bandit_PKM_01",[945.476,5954.43,57.0832],"STAND","AWARE"],["I_AP_Bandit_PKM_02",[959.018,5945.47,55.8208],"STAND","COMBAT"]];
So i'm left with ["I_AP_Bandit_PKM_01",[945.476,5954.43,57.0832],"STAND","AWARE"], I have no idea why the second select isn't working tho. I know its gonna be something easy but staring at it too long yada yada
Oh I should mention its in a forEach loop of the array and _int in the iteration of the loop so it goes through the entire array
why is _int the iteration, why do you select by index instead of just using _x
Why am I overcomplicating it π€£
exactly
he's curious after all
actually what is _x?
the element currently iterated
{ sleep 1; hint str _x } forEach [1,2,3];
```will "result" in```sqf
sleep 1; hint str 1;
sleep 1; hint str 2;
sleep 1; hint str 3;
Ah nifty
speaking of forEach
was it this to affect all opfor?
{_x setDamage 1} forEach [side == EAST];
nope
private _eastUnitsArray = allUnits select { side _x == east };
{ _x setDamage 1 } forEach _eastUnitsArray;
// or one-lined
{ _x setDamage 1 } forEach (allUnits select { side _x == east });
@smoky verge ^
that was my second guess of course
Need some help with the dreaded convoys. Got 3 vehicles, Strider HMG, Strider, Zamak Transport in a column. The drivers of all 3 vehicles and the 2 in the Strider HMG are in one squad with the lead driver being the squad leader. Assigned a variable name to each vehicle object. Set this in the init.sqf:
w1_2 setConvoySeparation 20;
w1_3 setConvoySeparation 20;```
The lead vehicle just keeps driving off on its own. The 2 followers seem to do an okay job staying together. Why is this happening?
@spice arch all the drivers need to be in the same group
make the convoy lead driver the group leader
if the other vehicles don't drive, add their gunners to the drivers group too
vehicles that won't convoy unless their gunner is in the driver group too...
children of APC_Wheeled_02_base_F, MRAP_02_base_F, Offroad_01_AT_base_F, Offroad_02_unarmed_base_F
its possible vehicles with other base classes will show the same behaviour, but these are good to start with. I think it's related to vehicles that don't have a commanders seat. For these, it seems the gunner has command
Thanks @finite sail I've got all of the drivers and convoy lead driver in the same group as well as the commander and gunner in the HMG strider. I've got some passengers loaded in the other vehicles and will test around with what happens if I remove them or from the unarmed strider.
cool. let me know how you get on.
Convoy Testing Report:
Methodology: totally within basic EDEN editor and using waypoints and minor application of the setConvoySeparation command.
Tested: (HMG Strider lead, Strider 2nd, Zamak Transport 3rd)
-Vehicles with separate groups using the setConvoySeparation command
-Drivers grouped, but crew seats (commander + gunner) separate
-Random seating order of convoy group. I.E.: placement order of drivers didn't matter, 2nd driver in last vehicle, etc.
-Passengers in crew seats
Ok did a few iterative tests and came to these conclusions/best practices:
- All drivers and crew members (commander + gunner) seats must be in the same group.
- Place all vehicles empty first in the order of the convoy (lead to following vehicles)
- Place all the drivers and crew members in the order of the vehicles. (did not confirm if commander/gunner -> driver ordeer matters or not). I.E.: Place all 3 members of the HMG Strider in first. Place the driver and commander of the 2nd Strider next. Place the driver of the Zamak last.
- Set the convoy squad to column formation and safe/aware mode.
- Place multiple move waypoints to control the overall spacing throughout the drive. Observed the convoy elements waiting a bit at each waypoint for straggling vehicles to catch up a little.
- Not sure of the impact of the setConvoySeparation command. Tested with values of 20 and 15 and also wtihout the command (not rigorous and small sample size so keep that in mind). With the command at 15 seemed to perform slightly better in terms of keeping a closer spacing but honestly even without the command the performance was okay. No vehicle actually maintained the exact values and were usually between ~50-100m apart which for the most part works well for a convoy.
- Place the passengers last, DO NOT place passengers in any crew slots. The fire from vehicle positions of the Zamak are okay though.
@finite sail
For the purposes of my scenario, I used a transport unload waypoint with the convoy group; passengers disembarked to move onto their assigned move waypoints to flank a fortified position and engage targets inside the position. One disadvantage was that once the convoy arrived, I didn't have a non-specialized script method for dismounting the secondary strider or zamak to act as additional troops.
I'm sure we can obtain more versatility and precision through scripts controlling the spawning of units and vehicles, group behaviors, and waypointing but using the above practices I was able to get a realistic looking convoy that moved to a dismount position and the passengers move on foot to seize a fortified position using only the basic editor.
@winter rose @queen cargo oy! where is the category:formatters sqf for visual code guys!!!!
Does anyone know of a way to allow launchers to be used on ATV's, I have at current made it so I can fire normally from them but when I try to allow launchers nothing happens.
so far I've been working with forEach in regards to single units in a group. can you do the same with groups as a whole? something like:
~~```sqf
{_x setSpeedMode "FULL"} forEach group [g1,g2,g3]
actually you just do:
```sqf
{_x setSpeedMode "FULL"} forEach [g1,g2,g3]
> private _vObjectsArray = [];
> private _vObjects = [];
> private _vObject = objNull;
> private _dist = 4;
> //if (cameraView isEqualTo "EXTERNAL") then {_dist = 5};
> private _startPos = player modelToWorldVisual [0,1,1];
> _vObjectsArray = nearestObjects [_startPos, ["ALL"], _dist];
> if !(_vObjectsArray isEqualTo []) then {
> private _cameraPosASL = AGLtoASL (positionCameraToWorld [0, 0, 0]);
> private _cameraDir = (AGLtoASL (positionCameraToWorld [0, 0, 1])) vectorDiff cameraPosASL;
> _vObjects = _vObjectsArray select {
> private _lambda = ((getPosASL _x) vectorDiff _cameraPosASL) vectorDotProduct _cameraDir;
> ([player, _x, 0.1] call BIS_fnc_isInFrontOf &&
> (_lambda > -1) &&
> {!isObjectHidden _x});
> };
> };
> if !(_vObjects isEqualTo []) then {
> _vObject = _vObjects select 0;
> systemChat format ["vObject: %1",_vObject];
> [_vObject] spawn {
> params ["_vObject"];
> for "_i" from 1 to 50 do {
> drawLine3D [ASLToAGL eyePos player, ASLToAGL aimPos _vObject, [0.1,0.1,0.1,0.1]];
> sleep 0.1;
> };
> };
> };
> ```
π I am using that code to get nearby objects so I can show a proper menu for each item. The problem is that I keep getting some underground objects and the debug systemchat just says: OBJ 315 <ANY>
And the drawLine3D clearly goes underground so the object is underground
How can I fix that, tried everything I can think of
@wind hedge can you check via if-loop if your objects have getPosATL values >= 0 and discard the ones which do not?
@exotic tinsel β¦wut?
Is someone confortable with ACE scripting and can tell me if I can remove all ace interactions from a single unit?
Hey i`m looking into particleArray,
https://community.bistudio.com/wiki/ParticleArray
Under point 14(animationPhase) are the different numbers depending on the lifetime of the particle?
Oh sorry, shouldve said what I have tried already:
googled the exact same as you, tried this here [OBJECT,0,["ACE_MainActions","ACTION"]] call ace_interact_menu_fnc_removeActionFromObject;
(wich didnt work)
and also looked up the github.
To clearify, i want to remove "external" actions from a unit, so that A cant use B`s interactions
Your object in question is called OBJECT right?
Otherwise ofc it wont work
Same with ACTION
wait, so the unit has to be called OBJECT? Cause it aint an object like ammo crate or smth
what is it then?
[OBJECT,0,["ACE_MainActions","ACTION"]] call ace_interact_menu_fnc_removeActionFromObject;
// ^^^^ how is the game supposed to know the target? :)
No
I mean
OBJECT is in caps so you know you need to chance it
the same with ACTION
like Lou said, the game can't mind read
so like [myUnit,0,["ACE_MainActions","anACtionToRemove"]] call ace_interact_menu_fnc_removeActionFromObject;
then the unit called myUnit will have the action anActionToRemove removed
obvs that isn't a real action but you get my point ( Idon't know any off the top of my head)
Hey i`m looking into particleArray,
https://community.bistudio.com/wiki/ParticleArray
Under point 14(animationPhase) are the different numbers depending on the lifetime of the particle?
@mortal crypt That was true, it is depending on the lifetime.
Just for the curios
Well I did.
I meant like as another person if you get me, instead of just updating yourself on it
so like
[myUnit,0,["ACE_MainActions","anACtionToRemove"]] call ace_interact_menu_fnc_removeActionFromObject;
@brave jungle ikr i have changed that, but how can i remove ACE interaction with that unit in general?
youd have to get a list of actions they have, then, and its probs an array but make sure to check, use a forEach _actionArrayName loop to remove each action.
_someArray = ["some", "ACE", "Actions"];//This is the list of actions, I don't know how you would do this off the top of my head
{
[myUnit,0,["ACE_MainActions",_x]] call ace_interact_menu_fnc_removeActionFromObject;
} forEach _someArray;
Hey, was wondering if anyone could lend me a hand. I am trying to add a scroll option on a ship I am making that allows you to "climb" pretty much teleport out of the water an on board it's deck. Would anyone know how to do so? I wanted to make it so you would swim to the point select it and teleport you to a memory point. I have tried several different ideas all of which have failed.
The carrier is 23m from sealevel if placed normally, use bis_fnc_setHeight. Thats what I did in a mission when I fell off once
when using X disableCollisionWith how can I disable X collisions with everything in the area?
forEach
but is there something to specify "everything"?
nope
welp
sounds like I'll have a fun 2 hours
maybe I can save my youth with layer names
mind the locality, too
oh but I guess bullets would still hit it
or are they children of the units?
remoteExec π
@smoky verge bullets would hit
mhmm thats a problemo
How can I change just the radius of an addAction?
there is a radius parameter
just add the radius while making the action
no.9 if I remb right
You trying to create a aafe zone type thing @smoky verge ?
oh no
a large object that I've used attachto with has weird collision boxes and it obstructs the way
Ah, okay
Yeah, but I have to put in all the other params too π’
they're all optional
so you can just do "","" etc
just have your radius at the right place
an example below has all the default values
@peak bridge can use Nil as well, or just put in place what the default value is
Yeah that ^
Beat me π
@brave jungle you cannot always use nil - this is a command, not a function
wrong tag
God all over the place aren't I haha
"he is a bit confused, but he has the spirit" π
π
I get like that a lot, but i prefer Belgian beer to spirit
Could someone explain how the config format works for https://community.bistudio.com/wiki/BIS_fnc_configPath please? I can get most of what I want if i use the string format but obviously that would work for any config use
What are you trying to do/get? Because that function just returns a path and nothing else (in short; give path, get path)
Here is my code extract:
_groups = [];
_configgroups = "true" configClasses (configfile >> "CfgGroups" >> _side >> _curSelFac >> "Infantry");
{
_groups pushBackUnique ([_x, "", true] call BIS_fnc_configPath);
} forEach _configgroups;
{ lbadd [2102, getText( _x >> "name")]; } forEach _groups;
Im after every group of the selected side and then getting the display name and adding it to a list box
But just as I went to explain I don't actually think i need it anymore as i'm using a forEach loop in a path array already.
second pair of eyes would help here actually
_side = ""; // asume correct value
_curSelFac = ""; // asume correct value
("true" configClasses ((configfile >> "CfgGroups" >> _side >> _curSelFac >> "Infantry")) apply {
lbadd [2102, getText( _x >> "name")];
};
Shorter and should work without storing data in one-use variables
In case you need pushBackUnique:
_side = ""; // asume correct value
_curSelFac = ""; // asume correct value
private _groups = [];
("true" configClasses ((configfile >> "CfgGroups" >> _side >> _curSelFac >> "Infantry")) apply {
_groups pushBackUnique (getText( _x >> "name"));
};
{ lbadd [2102, _x]; } forEach _group;
Awesome i'll merge it in, thanks!
("true" is that supposed to be there? Theres no closing )
Hi , I want to make an script that when you open your Inventory and your press the "ESC" it close the inventory
Can anyone helpme ?
@brave jungle the "true" part should be there, this is the fixed line:
("true" configClasses (configfile >> "CfgGroups" >> _side >> _curSelFac >> "Infantry")) apply {
@candid cape I'm not entirely sure, but I don't think that's possible without breaking the function of the ESC key in Arma itself (opening the menu)
If you do it fast, it becomes a form of duping, because you open the inventory and quickly hit the "ESC", move your objects to a car and go out to the lobby. My idea is to do a "closedialog" or something similar to fix it @exotic flax
if that's the case send a ticket to #arma3_feedback_tracker so it can be fixed π
as far as I can see you need to add your steam UID to the whitelist, did you do that?
@fervent kettle yeah
of course
@neon crane so you made a folder called scripts and added the unlock.sqf into it. You made an init.sqf file and added the whitelisted steam IDs in the array, keeping the " " etc. You've made sure the path exists? You made sure the init.sqf file is a .sqf file and not a renamed .txt file? Make sure file extensions is on via View >> View Filke extensions in windows explorer
If you've done all that
theres no reason why it shouldn't work
Unless like, the script is old/broken or something
Anyone have any info about the evaluation of this line:
count alive units groupname
Been using this to check how many AI are still alive and the evaluation seems delayed by almost a minute sometimes
I.E. AI get killed, the count doesn't change until several seconds later despite multiple checks
groupname is a group?
yep
count alive (units groupname)
oh yeah sorry thats what I meant
{alive _x} count (units groupname) is even better, i think
does that resolve the issue of the alive status being delayed?
probably not, but you need to get the syntax right first
oh the script is working
the issue is just how delayed the updated count is
interestingly enough when I use the zeus interface to delete the units, the count updates correctly and immediately
but say I take a rpg and blow up the vehicle and units inside, it takes like ~20s-1m before the count updates
what is the actual line of code you're using to count them?
the only thing I can think of is it is somehow tied to how the AI don't always know a unit is dead until a status check is performed (5-5)
@finite sail
((((count units w1_inf1) + (count units w1_inf2) + (count units w1_inf3))/18) < 0.3)
I have this in the condition of a trigger
where w1_inf1 and ... is the variable name of a predefined group
hmm maybe i need the alive command
all your doing is counting the number of blokes in the group
{alive _x} count (units groupname)
count ((units groupname) select {alive _x})
if you prefer,
id go with the top one
thanks man! I see what I did wrong.
nope, US
i think the delay in counting dead theory is a red herring
you know what red herring is?
yes definitely, i was counting the group members which is a different thing
the system clears out dead guys on its own time
true, but such a long delay is odd
which was why the zeus deletion of units was working instantly, deletion = 0 units right away
don't get distracted by that, im pretty sure the thing about group leaders being unaware of the death of their mates is not relevent here
yeah, switching out the lines, wrong code = wrong thing being evaluated
the script when working, is getting the actual status of the group members, not their status as perceived by the leader :)_
ok cool
ah i see, zeus was DELETING the units, not killing them
yes, i can see how that would mislead you
yeah π , also when i killed them manually via play testing, the units persist for sometime. you can see the behavior when controlling the zeus interface, like the dead guys persist as being part of the unit for a little while
made me assume that the script was working fine but puzzled me on why it took so long to detect dead guys
i dunno mate. a dead unit is a dead unit according to alive command
yeah i left out the alive part π