#arma3_scripting
1 messages · Page 41 of 1
I assign getPosATL to a variable, I want to check later on and make sure that it isnt [0, 0, 0]. How should I go about that?
I was thinking simple,
if (_getPosVariable isEqualTo [0,0,0]) then {}
anyone know the class name of the UI gps?
the classname?
I want to make that exact same map, i try using RscMapControl but I dont like how it looks...
is it possible to make with ctrlcreate?
I do believe I've seen the config somewhere, let me see...
ty, Ill take a look at RscMiniMap.sqf
No it is a 0KB
damn...
It is probably hardcoded into the engine
Hi guys i have a question has anybody play with BIS_fnc_kbTell function in multiplayer. I tested this on hosted multiplayer and audio cuts off if the host isnt the one who executes it ?
Hello, I have no idea how to script at all but I am trying to configure the bullet damage of a certain set of ammo. What can I do and how can I apply less damage to the given ammo?
In terms of scripting or configuring?
I suppose configuring then
Well if you don't know what those mean, scripting is something a mission can, configuring is a Mod can
There's some difference, some “core” things can only be edited in config
Well I'm guessing I'd have to configure it in using a mod, it already is in a mod does that mean I can just configure it without creating another?
A Mod can be modified by an another Mod - let's proceed in #arma3_config
alright ty
Is it possible to disable rotation of player with mouse?
In my case when player is in unconscious state i need to prevent body rotation.
https://community.bistudio.com/wiki/disableUserInput there's this, but it also disables keyboard input
ESC -> main menu should to work.
how to use script delete mine in trigger section ?
Something like
{
deleteVehicle _x
} forEach (allMines select { _x inAreaArray trigger1 });
inAreaArray pls
but is not working.
how to fix it ??
BOM character from somewhere looks like
(pasted in from somewhere else, invisible character that freaks out the SQF parser)
If you are not using variablename trigger1 on trigger.
Then (change inArea -> inAreaArray and change trigger1 ThisTrigger)
{
deleteVehicle _x
} forEach (allMines select { _x inAreaArray ThisTrigger });
allMines inAreaArray thisTrigger
Does that same?
{
deleteVehicle _x
} forEach (allMines inAreaArray thisTrigger);
this one is with the boms removed
Thought allmines is all mines , my bad
allMines is all mines. allMines inAreaArray thisTrigger is equivalent to allMines select { _x inArea ThisTrigger }, except faster because no looping in SQF
inArea*
thanks
Aa, okey. Good to know. Thank for explaining
@stable dune @copper raven @south swan @granite sky Oh is working, thank you so much.
😮
ahh... I have 1 question.
Now i can spawn trap in area but I can't deactive a trap. how to deactive mine ???
i have toolkit in my backpack but is not working.
Disarming
To disarm an explosive, you have to be an Explosives expert or an Engineer, have a Toolkit and know the location of the explosive.
Crawl [Z] to the explosive.
Select Disarma3 fm ico off.png from the action menu.
WARNING: if you don't approach the explosive carefully in a prone position, it will detonate.
Disarming a mine underwater doesn't require being in a prone position.
https://community.bistudio.com/wiki/Arma_3:_Field_Manual_-_Weapons_Advanced
yeah, now i to be an Engineer, have a toolkit and know the location of the mine, but is not working
is bug ??
Did you just test Put mine -> active Mine , after this check does your menu get updated and give option to deactive mine
Don't you have to spot the mine (T?) before you can disarm it?
Yes
Just to validate, && and || are not lazy eval in of themselves, but require the curly parentheses and such?
yes
good to know, thought || was lazy eval by default and OR wasn't 
next question
if I have a bunch of &&, do I need {} around each of the conditions, or do I need tons of {}? For example
a && {b} && {c}
//versus
a && {{b} && {c}}```
Want it when all conditions are true to be true and such
It only uses two condition example for && so I'm confused as to how the rest of it works
a && {b && {c}} looks like it'd be a bit faster than a && {b} && {c} as it seems it'd drop the {b && {c}} part in one go instead of dropping {b} and then dropping {c}
boolean && code, The code is not evaluated if boolean is false.
Gotcha, so in terms of actual performance versus the headache of trying to do {}ception with 6 conditions is probably not worth it?
🤷♂️ i doubt the impact of having extra && dropping its bit of code would be really noticeable with any non-trivial conditions. On the other hand, running the code seems to create extra scope or something, leading to _x >= 0.35 && {_x <= 0.65} being like 10% slower than non-lazy variant on my machine
long story short: if it's in performance-critical path of your code - just measure different variants and use the one that's proven faster. If it's not performance-critical - go by your own definition of readability (i'd personally prefer a && {b} && {c} for non-trivial amounts of code)
It's just
if ((KJW_Imposters_Setting_MilitaryUniformsEnabled) &&
((_playerUniform != "") && (_playerUniform in (parseSimpleArray KJW_Imposters_Setting_MilitaryUniforms))) &&
((_playerVest != "") && (_playerVest in (parseSimpleArray KJW_Imposters_Setting_MilitaryVests))) &&
((_playerHelmet != "") && (_playerHelmet in (parseSimpleArray KJW_Imposters_Setting_MilitaryHelmets)))
) exitWith {false};``` so `{}` is probably fine in that case rather than trying to stack them shit tons
a && {{b} && {c}} is wrong, you have CODE && CODE here, which is not valid
to answer your question, it's best to nest them, because you evaluate less then
if you have a && {b} && {c} && {d} and a is false, the other two && are still called (the right argument is not evaluated though)
but if you have a && {b && {c && {d}} and a is false, then no other calls to && happen, which is better
the latter is as close to "short circuit" as it gets in SQF
Can you not lazy eval code? What if it's a function call?
huh?
This
Why is it not valid if it returns a bool?
Oh, wiki page on code optimisation said a && {b || {c}} so assumed it applied for && too
b is not code there
Both the bits of code return a bool
a && {{b} && {c}} is what you wrote, not valid, on the wiki page it's
a && {b && {c}} which is fine
no, just always nest
it's the best
unless your cond is cheap, fx., var && var
at that point doing var && {var} on average would be worse, but this is super micro things that don't really matter
If it's just != and small array searches probably fine right?
it depends on the operands
it's good for optimizing bottlenecks
like i said, if it's just a variable, and you have a single logical operator only, then not lazy evaluating is fine
in any other case, use lazy eval
Gotchu, will lazy eval it then
so I'd need
a && {b && {c && {d && {e}}}} etc right?
yes
roger doger thanks
_myBool && _myBool
_myBool && {player distance _blabla > 4}
player distance _blabla > 4 && { player inArea _blah }
etc
and also do cheap conditions first, lazy eval the expensive ones
theyre all moderately cheap just lots of them
like,
_arr findIf { blabla } >= 0 && { some_flag } vs some_flag && {_arr findIf { blabla } >= 0 } (common stuff)
gotchu
is this valid : true && {true} && {true} ?
yes, but it's better to
true && { true && { true } }
I… think? can't think about it now
config viewer
select & count
is that faster?
kinda confused on why my code doesn't get lazy evaluated? 😄
in your case you call every single logical operator in the expression
but the stuff isnt evaluated?
_cond1 && {_cond2} && {_cond3} && {_cond4}
(((_cond1 && {_cond2}) && {_cond3}) && {_cond4})
(_cond1 && {_cond2}) _cond1 is false? kay, return false
((_cond1 && {_cond2}) && {_cond3}) which is (false && {_cond3}) now, left arg is false? kay, return false
(((_cond1 && {_cond2}) && {_cond3}) && {_cond4}) which is (false && {_cond4}) now, left arg is false? kay return false
(((_cond1 && {_cond2}) && {_cond3}) && {_cond4}) > false, but all three && were called
whereas if you did _cond1 && {_cond2 && {_cond3 && {_cond4}}, _cond1 is false? return false, and since there are no more operators in this toplevel expression, nothing else is called
thx for taking time to explain this to me, still trying to figure it out 😄
the right operand is not evaluated in either case if left operand is false, but the call to && still happens (in the first case)
ok
p = { systemchat str _this; };
"start" call p;
true && { 2 call p; false} && { 3 call p; true} // Prints 2
"start" call p;
true && { 2 call p; false && { 3 call p; true} } // Prints 2
i don't see any difference in the output when I test that but I'll take your word on it that the second line is faster 🙂
you can't see the difference in sqf
dump the assembly or idk
true && { 2 call p; false} && { 3 call p; true} will be something like
push true
push { ... }
call &&
push { ... }
call &&
whereas true && { 2 call p; false && { 3 call p; true} } will be
push true
push { ... }
call &&
the first code always calls both &&
😍 oh what a learning moment. Thanks for explaining
Hello folks, is there any way to be able to identify the server is playing, even if there's no identifiable information in it itself? i.e player joins server 1, script gets 1. player joins server 2, script gets 2. does this repeatably with and 2
serverName is able to be changed so don't particularly want to rely on it for data storage
have a global variable in each server (serverside)
client connects and request variable
then client can tell which server he connected
something like that?
How would you guarantee the global variable isn't repeated between servers though?
U personally give it a value
I can't make a value for every single server
mmm so u asking clientside, how would a client identify the server it joined?
I guess I misunderstood the question
maybe use IP+port as a unique identifier?
No, I'm asking how to identify the server the client joined -- without using serverName as you can change it (and have multiple with the same name)
What about mission? Same mission too?
different mission
Set a global variable in the init then
i literally just said i cant make a value for every single server
and theres no way to generate an entirely unique value for each one
But you just said they use different missions?
I don't think this is possible through in game scripting alone. But I'm not entirely sure
I'm having some issues with passing public variables from the server to the client side mod as well as fetching data from the server to the client side mod.
storeConfig.hpp: https://pastebin.com/8WafDjtX
fn_initStores.sqf: https://pastebin.com/kyT4Cssv
diag_log: https://pastebin.com/JYNGLMGf
fn_openStore.sqf: https://pastebin.com/6UZHq48d
well, both are pretty simple
when it tries to do fms, _classname will be nil, I think? see what diag_log _classname gives you
first: you have ```sqf
class SOG_Stores {
stores[] = {
"fms",
"gms"
};
class fms {};
...```in your config. So when code tries to access fms subclass - BIS_fnc_getCfgData returns nil everywhere
second: _store isn't defined anywhere in https://pastebin.com/kyT4Cssv
A little further down in the log it populates the diag_log with the correct values ```c++
13:05:14 "ClassName: Land_CashDesk_F Pos: [4000,4000,0] Dir: 0 StoreName: General Military Surplus"
...
and then it tries to _store setVariable it. And _store isn't defined anywhere
and you get helpful 13:05:14 Error Undefined variable in expression: _store message in log 🤷♂️
I'm updating it now, and will give it a test.
Here's the updated fn_initStores.sqf: https://pastebin.com/kyT4Cssv
diag_log: https://pastebin.com/JYNGLMGf
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Hey! Is there a way of detecting when a player is holding down the LMB? I've got this at the moment, but it doesn't seem to return anything.
_mousePressed = onEachFrame {inputMouse 0};
if ((_mousePressed == 2) then
{
hint "LMB";
};``` If I hold down left click, it doesn't seem to make any hint appear, and I can only assume I'm using it wrong, however
```sqf
onEachFrame {hintSilent str inputMouse 0};``` returns 2, so I'm pretty confused 😄
the code you listed only runs once. And sets inputMouse 0 code to run every frame. And inputMouse 0 doesn't output anything.
Ah, would I need to run the entire code in a loop? and supposedly it returns a number between 0 and 4
https://community.bistudio.com/wiki/inputMouse
Probably late, but props to whoever made debug console working with comments. Saves so much pain 😅
{
if (_x in OT_lowPopHouses) then {_low pushBack (getPos _x); continue};
if (_x in OT_medPopHouses) then {_med pushBack (getPos _x); continue};
if (_x in OT_highPopHouses) then {_hi pushBack (getPos _x); continue};
if (_x in OT_hugePopHouses) then {_huge pushBack (getPos _x); continue};
if (_x in (OT_shops + OT_offices + OT_warehouses + OT_carShops + OT_portBuildings)) then {_allshops pushBack (getPos _x)};
} forEach (nearestTerrainObjects [_pos, ["House"], _mSize, false]);
``` This block of code causes a parse error when compiling it with ArmaScriptCompiler, but I am not seeing a syntax error in here 
is there some class of empty dialog that I can use with createDialog ?
As sharp has explained, lazy eval purpose is to nest expensive computations that return a bool with simpler computations.
code block expressed in curly braces are only executed if left side arg is true, every subsequent nested curly braces is just another operation in the lazy eval "path", as every curly braces set is only executed if its left side arg has evaluated to true.
Performance/speed gains are basically negligible and/or negative if you dont nest every next right sided arguments
Uhm, wut? Not executing the expensive calculation saves times every time, regardless of curlies being nested or not. Having multiple boolean operators loses some time, but if having extra and is critical for performance - i still propose to just test and measure
its really dependent on how you are building you conditional
the position of the curly marks the halts in evaluation of left argument after all, if the purpose of the evaluation is to be streamlined and be efficient, you want to build a nested operation consisting of AND, if you want to compare multiple things being true using OR, you use a switch which the cases are know to deliver false and basically default everything else and so on.
Anyways, the point is not doing unnecessary computations, that includes operands if the left argument is false
the wiki even backs what sharp mentioned:
//Performance
//Using lazy evaluation is not always the best way as it can both speed up and slow down the code, depending on the current condition being evaluated:
["true || { false || {false}}", nil, 100000] call BIS_fnc_codePerformance; // 0.00080 ms
["true || {false} || {false} ", nil, 100000] call BIS_fnc_codePerformance; // 0.00105 ms
["false || false || false ", nil, 100000] call BIS_fnc_codePerformance; // 0.00123 ms
["true || false || false ", nil, 100000] call BIS_fnc_codePerformance; // 0.00128 ms
["false || {false} || {false} ", nil, 100000] call BIS_fnc_codePerformance; // 0.00200 ms
The brackets aren't free, basically.
🤷♂️ and it shows the difference (say, cost of laziness) of microsecond magnitude. So if your computation takes time comparable to that - there's hardly any reason to bother with lazy-ing the conditionals.
(code brackets. Other brackets are free)
so the rules of thumb would be something like:
- put conditions that take more than, say, 0.1 ms into the brackets so they can be lazied out
- put conditions that are more likely to fail earlier (left-er)
yep, its very case use so better save it when you actually have heavy evaluations going constantly that goes accompanied by an arbitraty value being true or something of that style.
also, i'd like to point out that BIS_fnc_codePerformance on my machine gives results that can differ by like 10% between runs. So the ordering of closer results isn't set in stone :3
hardware, environment, builds
I suspect that 0.00123 and 0.00128 are the same speed.
nope, sir. The same code. Same game instance, same everything. Just 5 runs in debug console in a row are almost guaranteed to give different results.
And yeah, if you care about that last 5% then you have to run diag_codePerformance a few times.
[1,2,3,4,5] apply {["false || false || false ", nil, 100000] call BIS_fnc_codePerformance}; // [0.00114,0.00112,0.00112,0.00112,0.00111]```
To make things worse, this code runs with no problems in the debug console, but throws an error when the game starts and in ArmaScriptCompiler 
what error?
RPT
23:00:49 Error in expression <hen {_allshops pushBack (getPos _x)};
} nearestTerrainObjects [_pos, ["House"], >
23:00:49 Error position: <nearestTerrainObjects [_pos, ["House"], >
23:00:49 Error Missing ;
23:00:49 File overthrow_main\functions\economy\fn_initEconomy.sqf..., line 51
23:00:49 Error in expression <hen {_allshops pushBack (getPos _x)};
} nearestTerrainObjects [_pos, ["House"], >
23:00:49 Error position: <nearestTerrainObjects [_pos, ["House"], >
23:00:49 Error Missing ;
ASC
Parse Error: syntax error, unexpected OPERATOR_U, expecting } or ; or ","
Are we getting ghost characters again?
<hen {_allshops pushBack (getPos _x)};
} nearestTerrainObjects [_pos, ["House"], >```fun stuff, `forEach` somehow seems missing?
mmm
But it is not missing 
Question guys. So i have in Init.sqf these lines of code:
[Officer, "STAND_U3", "ASIS"] remoteExecCall ["BIS_fnc_ambientAnim",[0, -2] select isDedicated];
[Officer1, "STAND_U2", "ASIS"] remoteExecCall ["BIS_fnc_ambientAnim",[0, -2] select isDedicated];
But when i start dedicated server and try to test it they are playing animation but on top of each other and not at the place where there should be playing animation. Does anybody know why is that happening and how i could fix this ?
ambientAnim does not need to be remoteExec'd to all clients, and doing so is probably breaking it. Just run it once, on the server.
I plugged the code as posted here into this: https://www.babelstone.co.uk/Unicode/whatisit.html and didn't spot any weird characters.
It would be best for Th0masAngel to try it with the exact code as used though, in case there's a weird character that's being lost somewhere on the way
I am not seeing any weird characters either
can you sqfbin entire file?
} nearestTerrainObjects [_pos, ["House"], > it does seem like you're missing the forEach here
Parse Error: syntax error, unexpected OPERATOR_U
just says unexpected unary operator, which makes sense
Ty very mutch
I was using an old version which was indeed missing the forEach...
I've got a feeling drawEllipse is a per-frame command like drawIcon, hence the use of the ctrlEventHandler in the example
also drawEllipse is not the same as a marker placed in the Editor; for one of those use createMarker
https://community.bistudio.com/wiki/Category:Command_Group:_Markers
_marker = createMarker ["testMarker",player];
_marker setMarkerShape "ELLIPSE";
_marker setMarkerBrush "FDiagonal";
_marker setMarkerSize [50,50];
_marker setMarkerColor "ColorGreen";```
I just tested the code I posted myself and it works
I'm confused about why it's working for me and not for you
That'll do it
I've managed to get most of the issue I was having sorted out, now I have a new issue that's similar though. And it's causing me to be stuck on a black loading screen when I spawn into the server.
log: https://pastebin.com/ujCGRzLQ
fn_initStats.sqf: https://pastebin.com/Fw9DdZMJ
fn_initDBQuery.sqf: https://pastebin.com/ztHjqSB8
fn_extDBAsync.sqf: https://pastebin.com/867nZFN1
fn_loadPlayer.sqf: https://pastebin.com/ZG7A7FvD
You can surround a link with < .. > to suppress Discord preview cards
Will do next time I post, thanks for the info
HC disconnects -> AI moves to Server -> Run setGrpOwnr -> Target Owner HC -> Back to HC
Hi guys i found a script for Zero Gravity on internet script:https://pastebin.com/uEi4W300
but its a older script and now when i try to launch it it throws errors everyframe:
2:09:42 Error in expression <
private _EHPL = addMissionEventHandler ["EachFrame",{
vecupdate = [0,0,0];
if (>
2:09:42 Error position: <["EachFrame",{
vecupdate = [0,0,0];
if (>
2:09:42 Error GIAR pre stack size violation
if ((inputAction "TurnRight" > 0)) th>
2:15:08 Error position: <
if ((inputAction "TurnRight" > 0)) th>
2:15:08 Error Invalid number in expression
When i tried to google what is GIAR on the internet it was just poping out status access vialation error
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
is there any section/tutorial on how to make 3den modules have multiple comboLists?
The one on wiki only covers single option modules.
@fleet sand That pastebin has a lot of invisible chars in it.
U+00a0 apparently.
IIRC those stack size violations are SQF parsing errors.
Here is one of mine for reference
class SHGT_ArsenalTraitGroupCheck: Combo
{
property = "SHGT_ArsenalTraitGroupCheck";
displayName = "Group Assignment";
tooltip = "Should this trait be applied to individual(s), GROUP, or SIDE?";
typeName = "STRING";
defaultValue = """individual""";
class Values
{
class individual
{
name = "individual";
value = "individual";
};
class sideEast
{
name = "GROUP";
value = "group";
};
class sideInd
{
name = "SIDE";
value = "side";
};
};
};
this is a single parameter using a single comboList, do you have any example that I could use for multiple parameters in a single module?
So multiple combolists?
yes
You just copy paste below the first one with a new classname
class combolist1:Combo
{Optioms here }
class combolist2:Combo
{Options here}
can you now?
Thats the first thing I assumed was going to work, but didnt and showed only the last combo
Did you make them different classnames? Sounds like you overwrote it
no, I did made them different classnames
unless the property described in the wiki has to change too
that one I did use the same
Yes it does
Hi yea ty for noticing hidden characters i remove them in this pastebin: https://pastebin.com/aMX0XbYJ
and now i have still couple of errors:
3:13:22 Error in expression <0;
addMissionEventHandler ["EachFrame",{
vecupdate = [0,0,0];
if ((inputAction ">
3:13:22 Error position: <
vecupdate = [0,0,0];
if ((inputAction ">
3:13:22 Error Missing }
3:13:22 File C:\Users\Lenovo\Documents\Arma 3 - Other Profiles\Legion\mpmissions\Developing\ZeroGravity.VR\initPlayerLocal.sqf..., line 6
3:13:22 Error in expression <g.sqf";
vecupdate = [0,0,0];
movez = 0;
addMissionEventHandler ["EachFrame",{
ve>
3:13:22 Error position: <addMissionEventHandler ["EachFrame",{
ve>
3:13:22 Error addmissioneventhandler: Type String, expected Array
3:13:22 File C:\Users\Lenovo\Documents\Arma 3 - Other Profiles\Legion\mpmissions\Developing\ZeroGravity.VR\initPlayerLocal.sqf..., line 6
3:13:22 ➥ Context: [] L6 (C:\Users\Lenovo\Documents\Arma 3 - Other Profiles\Legion\mpmissions\Developing\ZeroGravity.VR\initPlayerLocal.sqf)
3:13:22 Mission id: 07331ca9f74ef4a39094f2de55df23e45dc67d5b
3:13:32 soldier[B_soldier_AR_F]:Some of magazines weren't stored in soldier Vest or Uniform?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
// Arguments shared by specific module type (have to be mentioned in order to be present):
class Units: Units
{
property = "MK_Module_aiBehaviour";
};
so should property be defined as an array and have multiple properties in it? Or how does that goes?
Sorry if this is basic, im completely new to modules
Example:
class myModule1: Combo
{
property = "myModule1";
displayName = "myModule1 display";
tooltip = "myModule1 tooltip";
typeName = "STRING";
defaultValue = """option 1""";
class Values
{
class option1
{
name = "option1";
value = "option1";
};
class option2
{
name = "option2";
value = "option2";
};
class option3
{
name = "option3";
value = "option3";
};
};
};
class myModule2: Combo
{
property = "myModule2";
displayName = "myModule2 display";
tooltip = "myModule2 tooltip";
typeName = "STRING";
defaultValue = """option 1""";
class Values
{
class option1
{
name = "option1";
value = "option1";
};
class option2
{
name = "option2";
value = "option2";
};
class option3
{
name = "option3";
value = "option3";
};
};
};
property is the variable that holds the information. It is defined above as a string. the value is the value of that variable, IE what is selected in the module when mission starts.
to get this value from the module you do
_logic getVariable ["myModule1",defaultValue]; //where defaultValue can be w/e
so having it be defining each property in each class of the module would be enough or would that have to be declared somewhere else?
Example in wiki makes it looks like it has to be predefined before using them inside the classes
nope, how i have it above is all you need
I see, thanks for the clarification
acually ty very mutch i manage to fix it it was just missing the {
Can we have a pinned message that says "don't write code in Word" :U
but the youtube ad says code grammar is important and i can make more $$$ if i use spell check
Kinda late to search for the answer, but didn't get tagged, so forgot about it. Sorry and thank you for your replay, I'll give it a go!
What I am working on is to make Sweet Markers System to allow placing markers into Side Channel only if players has a long range radio from TFAR.
I already have a mod that will be ran by all players for the event, so this will be just a small addition into it. It is mainly composed of these "quality of life changes" (sometimes to the worse, but hey, we play to have fun... oh...)
You can make a MarkerCreated event handler that just eats any marker if the placing player doesn't have the right radio
Ok, this sounds interesting, but I also need to restrict the moving of said marker, deleting it etc.
And to be honest, I am not sure if SWT markers even fire this event. Would require some testing
FSM will probably stop when owner != server
Really quite daft question -- How do I check if a number if a multiple of another? 4 for instance?
my initial thought would be
//_counter is a var that increases by one every second
round _counter/4 == _counter/4``` but pretty sure thats not accurate
found this on google: if(_counter % 4 == 0) then { /* multiple of 4 */ };
not a clue what on earth modulo is but I'll give it a shot
2 mod 3 equals 2, 5 mod 3 equals 2
SWT markers?
sweet markers system i would assume
I'm working on a script to spawn waves of zombies every 45 or so seconds and after a while the zombies stop spawning and it throws out an error saying that the variable is undefined
here's the script
params ["_unit", "_target", ["_classList",nil],["_spawnlocations",nil], "_baseSpawnNum", "_maxSpawnNum", "_delay"];
_unit setvariable ["WaveNumber", 0];
sleep 30;
playSound "horde";
[west, "HQ"] sideChat "Here they come!";
while {true} do {
_wavenum = _unit getVariable "WaveNumber";
for "_i" from 1 to ((_baseSpawnNum+_wavenum)+random(_maxSpawnNum+(_wavenum*2))) do
{
_grp = creategroup opfor;
_wp = _grp addwaypoint [position _unit,10];
_wp setwaypointstatements ["false",""];
_wp setwaypointtype "guard";
_wp waypointattachvehicle _unit;
_class = _classList call bis_fnc_selectrandom;
_spawn = _spawnlocations call bis_fnc_selectrandom;
_pos = _spawn getPos [1 + random 14, 1 + random 359];
_zombie = _grp createunit [_class,_pos,[],1,""];
_zombie allowfleeing 0;
_wp setwaypointposition [position _unit,0];
_zombie addEventHandler ["Killed", {deletevehicle _unit;}];
onEachFrame {_zombie forgetTarget pilot};
onEachFrame {_zombie forgetTarget ac130_gunner};
sleep 0.01;
};
[_unit, "WaveNumber", 1] call BIS_fnc_variableSpaceAdd;
sleep _delay;
};
and the error "Error Undefined variable in expression: _wavenum"
it works at the start of the mission but around 7 or so minutes in the error starts popping up and zombies stop spawning
it's supposed to be for a mission where I sit up in an AC-130 and shoot at the zombies until the NATO guys all get killed and then the mission ends
sorta like Zombie Gunship
WaveNumber becomes nil at some point, do you set that variable anywhere else?
_zombie addEventHandler ["Killed", {deletevehicle _unit;}];
onEachFrame {_zombie forgetTarget pilot};
onEachFrame {_zombie forgetTarget ac130_gunner};
btw those 3, _unit and _zombie are both undefined
It is terminated on the server after the ownership is lost
add a systemChat str [_unit getVariable "WaveNumber"] in the loop somewhere and monitor it
I'm gonna can the eventhandler since it does nothing anyway
right now I have it set to an AI unit on the ground which is where the zombie waypoints are set to
in terms of the eventhandler it said that _unit and whatnot is part of the "Killed" EH
but I probably misunderstood it
and I already have corpse cleanup enabled in the mission settings anyway so it's kinda redundant
but _unit is this guy
that's quite possibly your issue then
[tgt, tgt, ["Zombie_O_Shambler_AAF", "Zombie_O_Shambler_Civ","Zombie_O_Shambler_CSAT","Zombie_O_Shambler_FIA","Zombie_O_Shambler_NATO"],[spawn1,spawn2,spawn3,spawn4], 10, 40, 45] execVM "spawnzombies.sqf";
this is the init
if _unit becomes nil then _unit setvariable ["WaveNumber", 0]; will become nil
fair enough
that'd explain it thankyou
I might change it to idk an invisible helipad at the officer's position
that way it can't be destroyed
Probably a better idea
Alternatively you can use init.sqf or something similar if you're just killing the unit straight away
and then use missionNamespace for variables
yea I was a bit sceptical about missionNamespace for some reason but I'll switch it to that right now
and if all goes well it shouldn't break
with the amount of zombies that may end up spawning the game will probably crash first lmao
if you're just using the object/unit for variable storage you can probably use missionNamespace for your use
missionNamespace setVariable ["StringVariable", "myString"]; // same as: StringVariable = "myString"; wiki
https://community.bistudio.com/wiki/missionNamespace
okay that's kinda worrying
okay I don't think variablespaceadd accepts missionNamespace
I placed a random object and set its name to variable_space and assigned the variable to that instead
everything's working so far
Why are you using BIS_fnc_variableSpaceAdd in that instance? You can just use _unit setVariable ["WaveNumber",_wavenum+1] or something along the lines of that
if object works for you then use object 🤷
it's not like the documentation states otherwise either
https://community.bistudio.com/wiki/BIS_fnc_variableSpaceAdd
no clue how that mod works, you will have to look if it exposes any events that you can hook into etc
I already got it working. Did it the way I was asking about.
It's using compile preprocessfilelines, to create a function, so I just overwrite that function with one I edited and added the functionality.
It is
It has one function in cfgFunctions with preinit, that all it does is call compile on another sqf files 
But there's no other mod that adds this functionality. And we are just way to used to it. In big TvT ops with a plan made beforehand it's a must
On the other hand, I don't think I would be able to mod it as easily as I did if it was done differently 
i mean its great for expanding the mod from the outside 👀
Hi all,
using an addAction on a playable unit to "set rally" however when I die and respawn the addaction disappears and stays on my deceased body. Any ideas?
sl1 addAction ["Set Rally", {
private _pos = sl1 modelToWorld [0,0,0];
"respawn_west_1" setmarkerpos _pos;
tent1 setpos _pos;
}];```
actions don't carry over to respawned units
add a respawned EH, remove it from the corpse and add it to the new unit
https://community.bistudio.com/wiki/setVariable https://community.bistudio.com/wiki/getVariable to store the action id
ah okay thank you
Okay, so I'm trying to make it where the trigger detects if multiple objects are alive. How would I go and do that?
alive object1 && alive object2 && alive object3 && ...```
thank you!
_myDudes findIf { !alive _x } != -1;
Do dead entities get a different base class or something? entities [["Man"], [], false, false] isn't working 
dead dude with
_this isKindOf "Man"
returns true tho
@sullen sigil
while still in his group and also after being moved to "Empty"
i am aware hence why i am asking
works here, just tested
a question for the mass's does any one know if you can define groups with BIS_fnc_dynamicGroups with out assigning a leader to them
you mean player leader? because all groups must have leaders anyway
yes, want to have the patches predefined , so that they are not radom
how do you guys do your eachframe handlers so they don't fire on every frame but skip a few/go on every second instead?
before I was doing a system sort of like CBA but didn't know if anyone came up with a simpler solution yet
whats the point of having something be checked on each frame if you are gonna skip some time between checks?
precision on its firing, independent of the scheduler load
its the point of CBA's wait and execute, and frame handler functions
so you want to check eachFrame but not execute every X seconds?
no, you want to check every x seconds, but in the unscheduled environment
currently we just do
{
_x params ["_function", "_delay", "_delta", "", "_args", "_handle"];
if (diag_tickTime > _delta) then {
_x set [2, _delta + _delay];
[_args, _handle] call _function;
};
} forEach GVAR(perFrameHandlerArray);
with CBA but didn't know if anything was better now that we can throw arguments into the event handlers
I don't think there as better option right now besides CBA for this then. I would do basically what you are doing there, but I'm no sqf coder to the heart yet
make your own counter with either just by counting frames, or diag_deltaTime for each "handler"
depending on which one you want
Use the cba per event frame handler
https://forums.bohemia.net/forums/topic/237644-ombra-random-minefield-scriptfunction/ Can someone help me get this script working?
What does this script do? This script creates a minefield with a random number of mines and IED, positioning them in a random way inside the given area. Does not include APERSTripMine (mines with cable) Does it work in multiplayer? Yes, it works in MultiPlayer and SinglePlayer Parameters _area → ...
this is the error when loading into the mission. I have a marker set and the parameters filled out
You miss then
if (isServer) then { ["MarkerName", 10, 30] execVM "randomMinefield.sqf"; };
didnt change anything
I'm gonna guess that it changes the error...
now its - https://i.imgur.com/RW3MYSD.png
You lost a quote on the marker name.
Heres what I have in the init - if (isServer) { ["Mines", 10, 15] execVM "randomMinefield.sqf"; };
That is not what you have in the init.
you lost the "then" again there.
literally? Because that's not how you spell "field"
that is also not how you spell "server"
Also looks like you didn't disable "hide file extensions", so the last file there is actually called "randomMinefield.sqf.sqf"
Now Im getting both errors... hah I hate scripting so much.
Okay - got it working! Thanks for dealing with my stupidity haha
Anyone know of any scripts that have AI Artillery firing against the player preferably with a Forward observer that uses binoculars (or something to make it obvious that its the FO)
I had some issues with that, too, iirc.
Did you get it working?
I had my issues, but ended up using sth else instead. Never quite figured out why it didn't work.
having it only fire every few seconds defeates the purpose of the frame-EH.
so heres the code to also defeat knowing exactly when it fires, in case you want to go all the way
if (random 100 > 50) exitWith {}.
I believe the idea is "hit every second precisely", not "random on-frame trigger" 😁
Nope, couldn't figure it out -- but worked perfectly fine for alive units etc and didn't look too far into it
they are execution errors, not parsing errors.
If !(Time isequalto round time) exitwith {}
Might work
Use an text editor like notepad++ or vscode, will help you a lot
round time % 2 == 1
Because Monday, bad code day. but at least i tried
Hi guys how would i go about creating a system that shows players names who are not in area. something like this: https://gyazo.com/196f3e8e0531d33eed6359d68588f0c3
- have a list of all the players
- have a list of players in the area
- subtract A with B
- you have all players not in the area
no it doesn't
what happens if you use setTurretLimits on the dev branch while the turret is outside of the new limits?
does it snap to the new limits?
try and thou shalt see!
gotta install the dev branch first
i thought maybe someone had tried already
oh my god it snaps
i am so hyped for the next update
finally there will be a way to force turrets to point somewhere
If you want to force aim at a specific thing it's better to use lockCameraTo
I actually think that sqf turrt setTurretLimits [30,30,0,0];I want this will work to fix the turret at 30,0
damn til that command exists lol
pd: oh, its on dev
lockCameraTo doesn't do anything on tanks as far as i can tell
It does
Ty very much
this addAction ["Control a Hunter", {
params ["_caller"];
"WBK_HunterSynth_1" createUnit [position hunter_pad1, group player, "hunter = this"];
player remoteControl hunter;
hunter switchCamera "Internal";
removeAllActions hunter;
hunter addAction ["Exit the hunter", {
player switchCamera "Internal";
objNull remoteControl hunter;
deleteVehicle hunter;
}];
}];
This script has been causing some crashing on my dedicated server recently, Any idea as to why this might be?
The vehicle must have a gunner but it does work on tanks
also please avoid unrequired empty newlines
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
this addAction ["Control a Hunter", {
"WBK_HunterSynth_1" createUnit [getPosATL hunter_pad1, group player, "hunter = this"];
player remoteControl hunter;
hunter switchCamera "Internal";
removeAllActions hunter;
hunter addAction ["Exit the hunter", {
player switchCamera "Internal";
objNull remoteControl hunter;
deleteVehicle hunter;
}];
}];
if you get crashes, report them on feedback tracker
could it be the hunter = this part? old createUnit syntax
I'll try that
try what
Removing hunter = this
won't work
use the group createUnit [type, position, markers, placement, special] syntax instead, way better
Alright
this addAction ["Control a Hunter", {
params ["_target", "_caller"];
private _hunter = group player createUnit ["WBK_HunterSynth_1", getPosATL hunter_pad1, [], 0, "NONE"];
_target remoteControl _hunter;
_hunter switchCamera "Internal";
_hunter addAction ["Exit the hunter", {
params ["_target"];
player switchCamera "Internal";
objNull remoteControl _target;
deleteVehicle _target;
}];
}];
```_perhaps_
I'll try that really quickly
are you sure you can drive the hunter?
Its a heavily scripted unit afaik and not all units in OB have control compatibility
and can you actually remoteControl them?
This was an issue with the strider too back when it released
yeah, Our unit used to use zeus to control them but the owner wanted a script
i used my very little knowledge to make a script that barely worked half the time
Changine line 4 _target remotecontrol _hunter; to _caller remotecontrol _hunter seems to have worked
No crashing yet so its possible that has fixed it, Thank you
I was about to mention the same, you were gonna be missing the hunter object itself. Lou already handled that
ah yes, I assumed it was in a player's init but it most likely is in an object's
GG!
seems the delete script also broke,
_hunter addAction ["Exit the hunter", {
params ["_target", "_hunter"];
player switchCamera "Internal";
objNull remoteControl _target;
deleteVehicle _hunter;
Changing it to add the hunter to the params and the deletevehicle to said name seems to have fixed that part
pretty sure im not supposed to have private variables out of where there defined but seems to work fine
it's fine, they are defined here - they can't jump these addAction scopes
ah. thanks you lou
https://community.bistudio.com/wiki/addAction
You're not retrieving your custom private variables, you're retrieving the target and caller special variables that exist in the script argument of addAction
got it to work now
i just noticed that doesn't work, it'll constrain the turret between 30 and 0 degrees
i'd love it if that worked
doesn't seem to follow the syntax listed on wiki, though 🤔
vehicle setTurretLimits [turret, minTurn, maxTurn, minElev, maxElev]
yeah, the minimum values have to be negative which is kinda disappointing
Point is the turret path is missing
oh right i didnt notice that
but if you put the turret path in the thing i described will happen
Yes, limits only working "outwards" from center is kinda disappointing
is there better way to get num cargo seats there are in plane, that has not yet been spawned? I have: ```sqf
_v = planeName;
([typeof _v, true] call BIS_fnc_crewCount) - ([typeof _v, false] call BIS_fnc_crewCount)
or you mean the vehicle that isn't created yet by its classname?
then what you have seems to be the way 🤔
yeah only have the config class name
_sfLoadoutData set ["uniforms", ["U_lxWS_ION_Casual3", "U_lxWS_ION_Casual6", "U_lxWS_ION_Casual5", "U_lxWS_ION_Casual2", "U_lxWS_ION_Casual4"]];
private _SFvests = ["V_PlateCarrier2_blk", "V_PlateCarrier1_blk"];
private _SFheavyVests = ["V_CarrierRigBW_CQB_blk_F"];
_sfLoadoutData set ["backpacks", ["B_Kitbag_blk", "B_Kitbag_desert_lxWS", "B_AssaultPack_blk"]];
_sfLoadoutData set ["helmets", ["lxWS_H_bmask_base", "lxWS_H_PASGT_goggles_black_F", "H_HelmetSpecB_light_black", "H_Cap_headphones_ion_lxws","H_Watchcap_khk"]];
_sfLoadoutData set ["binoculars", ["Laserdesignator"]];
if (_hasContact) then {
_SFvests append ["V_CarrierRigKBT_01_light_Black_F"];
};
if (_hasContact) then {
_SFheavyVests = ["V_CarrierRigKBT_01_heavy_Black_F"];
};
_sfLoadoutData set ["vests", _SFvests];
_sfLoadoutData set ["Hvests", _SFheavyVests];```
this is returning the error ```18:11:28 2023-01-16 18:11:28:077 | Antistasi | Info | File: A3A_fnc_compatibilityLoadFaction | Compatibility loading template: '\x\A3A\addons\core\Templates\Templates\Aegis\Aegis_AI_UNA_Arid.sqf' as side WEST | Called By: A3A_fnc_initVarServer
18:11:28 Error in expression <r"]];
if (_hasContact) then {
_SFvests append "V_CarrierRigKBT_01_light_Black_F>
18:11:28 Error position: <append "V_CarrierRigKBT_01_light_Black_F>
18:11:28 Error append: Type String, expected Array
18:11:28 File x\A3A\addons\core\Templates\Templates\Aegis\Aegis_AI_UNA_Arid.sqf..., line 324```
and I'm stumped. I don't see the issue with the syntax?
You have failed to change the code that is running.
The code you pasted doesn't match the error.
im not sure what you mean by this, sorry
_SFvests append "V_CarrierRigKBT_01_light_Black_F> in your error log
_SFvests append ["V_CarrierRigKBT_01_light_Black_F"]; in the code you've pasted
they don't match 🤷♂️
🤔 i see. give me a second
yup, my bad. hadn't re-PBO'd the folders in my mod.
18:32:21 Error in expression < = getArray (configFile >> "CfgWeapons" >> _class >> "Magazines");
if ("CBA_Fake>
18:32:21 Error position: <>> _class >> "Magazines");
if ("CBA_Fake>
18:32:21 Error >>: Type Array, expected String
18:32:21 File x\A3A\addons\core\functions\Templates\Loadouts\fn_loadout_defaultWeaponMag.sqf..., line 16```
getting this now. indicating that I've got bad syntax/classname on a weapon and when it tries to pull a magazine it can't? there's nothing wrong with the file / line 16 mentioned in the debug error
sounds like _class is an array at that point 🤷♂️
too many brackets somewhere :P
too many brackets normally points to a specific line in my template
my guess is an incorrect classname for a magazine
Nah, it's a "magazine" that's an array when it should be a string.
ahh, i see. thanks, ill have a look
is there a way to narrow down where this issue is coming from? like by switching from "Debug" to "Verbose"? i cant find the magazine thats causing the error
No, because there's nothing wrong with the syntax. You're just giving it data that it doesn't like.
If you pastebin the thing I'll probably spot it in 30 seconds.
really appreciate the help, brother
hell of a lot of magazines in there though so no hard feelings if you dont wanna read thru em all lol
Did you write out this entire thing and then test it? :P
i have a stable version of this working with a small amount of lines changed
let me overwrite the old version with the new one on github, to see what exactly i edited
i'm not sure if it is the cause, but can you have an empty magazine array (line 481-484)?
those were working beforehand, because they're GLs i guess they call from that secondary GL magazine array
this lists all the changes i made from it working to now receiving the error
but i still cant spot the odd one out
I misread that anyway, it's breaking on a weapon class rather than a magazine class.
Ok, I have to go. Best way to find this: Switch to using the same builder function for every class (eg. _riflemanTemplate), and then try different weapon types there until it breaks.
ohh, i see. ill go over every weapon classname to check.
not sure how to do this - would just reverting to stable and changing each template one by one until it sheisters works?
how do I rotate a turret for any vehicle in eden editor
For posing screenshots, use POLPOX's Artwork Supporter. This adds options to the right-click menu to convert it to a Simple Object and then edit its animations.
For scenery in ordinary missions, you can use script commands to convert it to a Simple Object and edit its animations, but this is rather tedious.
For a real live vehicle, you can use the lockCameraTo command on it to make its gunner aim the turret where you want.
no. killPlayerFunction is only defined locally as far as I see
it must be defined everywhere for it to work
this would work, as long as call is not blocked:
[{player setDamage 1}] remoteExec ["call", -2]
but it's not really ideal. use a global function instead
It should be noted that circumventing restrictions in order to create a script that instantly kills all players is widely regarded as unsporting
Does anyone have any bright ideas for chopping off the other half of random [min, mid, max]'s distribution? i.e something like this as opposed to a complete gaussian curve
Currently am using random[0,0.1,1] < ( 1/((ACE_Player distance _obj1) + 0.001) min 1) for increasing chance of code running the closer the player is to object but runs into issues with that random distribution when you get further away
Not a bad idea; though would have to use a while loop for that wouldn't I? Trying to avoid unscheduled in this script as it's lightweight atm
Yeah, while _randomNum < max && _randomNum > mid i would assume
Think it's the random distribution curve that's causing issues at longer distances anyways
flip the curve on this one actually needs to be when player is closer rather than further
There's nothing saying the mid number has to actually be in the middle
just put it right next to min or max
Yeah but that still creates a gaussian distribution
Oh wait you mean like
min as 0 and mid as 0.00001?
Then set 1 as whatever?
That's the principle, yes. I mean whatever numbers actually result in the distribution you want, obviously.
so i have a bunch of tanks in a static area shooting at targets. and my little Guy is to run upto them..
is there anyway of making the sounds of 30 tanks firing quieter?
No, not really. You can reduce the effects channel volume, but that will affect everything.
Seeing as player is unlikely to be between 0 and 0.00001 from the object I think it'll be fine
Then it's just a matter of doing the range as the last param I think
The answer is still the same. There is no way to reduce the gunshot sound specifically. You can reduce the effects channel volume, but that will affect everything that uses the effects channel. This will allow you to hear the music, but it will also mean that everything else on the effects channel is quiet as well.
is there no way to use,
0 fadesound 0; // will immediately set the volume to zero
1 fadesound 5; // will fade volume back up to 100% over 5 seconds
What you've written is valid code, so it can be used, yes. But you'll need to predict when the tank is going to fire and reduce the volume first. It will probably also sound bad.
If you do this, you should store the current sound volume first, and then restore to that value rather than to 1. People often play with their effects volume turned down lower than 1, and setting it to 1 would be unwelcome.
1 is unwelcome?? i like the sounds of that
so would say. 0.5 work for the fade in?
you should store the current sound volume first
You don't need to guess a good value. Just use what they had it set to before.
how? lol
😦 i cant read
I can't help you with that
private _plrVol = soundVolume;
0 fadesound 0;
_plrVol fadeSound 5;```
will my custom sound interfer with it?
what custom sound
a sound i made
if its a sound it too will be faded
if its music/speech/radio/environment it will not be
Look at the see also pages
meh ill just do it the hard way and be back in 20 mins to complain
if youre trying to fade all sounds except your sound i would recommend errr
not doing that
try using a different sound type or something
its OGG?
I'm going to scream
type as in the ones in the see also on the wiki page i linked you
the ones i havent scribbled over
it would be great if you could modify sound shaders on the fly, ngl. But alas, lets hope for the better in Reforger/A4
be great if you could do simple shit without having to take a degree in scripting
everything regarding scripting requires a bit of scripting knowledge and basic engine understanding sadly. The easy alternative is modules, but you limit yourself to what the module does
random[0,0.000001,_range+_dropOff+_dustrange] seems to not be giving the distribution desired 
0,0.000001 may be too strong of a distribution perhaps
however I've no idea how to convert it to a normal distribution so I can't check
im making a 2.5 min showcase of a mission, and i dunno why, but im soo hooked on trying to do it
@sullen sigil I think the best way to get the distribution in your graph is just make a normal distribution and reflect the results beyond the midpoint.
and that doesnt even work 😦
oh, unless you actually want mid to have some specific value.
I understand the words you are saying but not what they mean
Yeah, basically
Hang on
rather than being half a normal distribution.
Let me draw a picture
ok I don't know how to
basically I'm trying to make it so that the further the player is from an object they are, the less likely the code is to run with a maximum range that can vary
But with the maximum chance of the code running on top of the object
Is a linear distribution fine?
(For my radiation mod if you've been on the workshop the past day or two -- doesn't work at longer ranges properly)
Unfortunately not for this
Needs to be smoothly up to the maximum
Like this diagram but replace mid with the object itself effectively
Yeah, but what about the shape of the rest of the curve?
Normal distribution or rotationally symmetric or what?
You could use tanh for rotational symmetry for example:
https://mathworld.wolfram.com/HyperbolicTangent.html
By way of analogy with the usual tangent tanz=(sinz)/(cosz), (1) the hyperbolic tangent is defined as tanhz = (sinhz)/(coshz) (2) = (e^z-e^(-z))/(e^z+e^(-z)) (3) = (e^(2z)-1)/(e^(2z)+1), (4) where sinhz is the hyperbolic sine and coshz is the hyperbolic cosine. The notation thz is sometimes also used (Gradshteyn and Ryzhik 2000, p. xxi...
Apparently it's inversely proportional to the square of the distance r.e amount of exposure
oh, radiation, right
Ya, ncbi says A greater distance from the radiation source can reduce radiation exposure. The amount of radiation exposure is not inversely proportional to the distance from the radiation source, but is inversely proportional to the square of the distance [2,4]. This means that double the distance from the radiation source can reduce the radiation exposure not to 1/2 but to 1/4.
You can just do 1/r^2 then?
Mhm, but need to convert that to a probability of code running
oh, blows up at close range too, you'd want to cap that.
So if player is at 50m it's 4x less likely to run than 25m
Yup, already capped at source activity
This is running every time there's a radioactive decay, should clarify
What's the longest range where you want it to have a 100% chance of running?
Got multiple types of radiation but for the sake of it say 2m away
oh, hey, finally a good use for https://community.bistudio.com/wiki/distanceSqr 
(Max range is a variable already)
I hate maths 
1 min (4/r^2)
Don't forget you can use https://community.bistudio.com/wiki/linearConversion to map the distance to a fixed scale. Not sure if that will help, I don't do maths very well, but seems like it might
Where _r is distance from source I would assume?
or is that the range?
Don't know if it's radius or range 😅
There's a difference?
distance here I guess.
How would I alter that for each type of radiation? Change the 4 to an 8 for 4m etc?
Oh, hang on a moment -- this may be wrong
Square of guaranteed range on top. 16 for 4
should probably rewrite as (_minRange/_range)^2
...I think inversely proportional to the square is for xray radiation 
Well, gamma too :P
_minRange^2 is constant as well and distanceSqr is 1 SQF command 😛
It's gonna fall off a lot faster for beta/alpha
Surely by the same inversely proportional to the square right?
Alpha doesn't penetrate air that well
No, because there's an extra range multiplier.
The basic 1/r^2 comes from objects having 4x less cross-sectional area at twice the distance.
They're ignoring actual distance falloff for xray/gamma, because it's pretty small through air.
Ah, in a vacuum that'd be wouldn't it
Versus alpha/beta which I would assume is different?
well, even alpha/beta would be 1/r^2 in a vacuum.
But their air absorption is far higher than gamma.
Ah right -- so I would assume use the basic 1/r^2 and then take the _range into account too?
how realistic are you trying to make this :P
erm
watchlist worthy realistic
you'd need to lookup air falloff rates for alpha/beta
but yeah, you can apply that on top after the cross-section calc.
I've got them and experience of them too
Gotcha
So random 1 < (_minRange/_range)^2 right, with _range being player's distance from object and _minRange being the maximum range 100% will happen?
yes.
Goated, that'll make radioactive dust zones much easier once I come to doing those
And then do the attenuation calculation for the radiation through air if that code doesn't exit after the calc?
you'd probably want to multiply that directly with the cross-section probability.
so before the random compare.
random 1 < (((_minRange/_range)^2)*(_distThruAir-_range)) would probably work, right? If range is greater than distance through air will turn the cross-section prob to negative so will always be less than random 1?
you have a weird random backslash in there. But no. Air attenuation is going to be more complicated than that.
oh backslash was for discord
eyyy, exponentials time
oh wait I can just use the x-ray attenuation equation right
i remember that
no i cant because thats for reflected photons ffs
It'll be something like 2^(_range/K)
where K is the range where the intensity halves.
and _range remaining the player's distance from the source?
yes
Looks about right for this compared to the xray equation
So I'll just change _distThruAir to _distHalvedThruAir or something
random 1 < (((_minRange/_range)^2)*(2^(_range/_distHalvedThruAir))) would be what would end up with?
yes.
mega
and (premature optimisation time) you'd probably want a simple max distance check before all that :3
Already got one hardcoded into the mod of 200m
I just never actually tested gamma properly with range and realised it's not very good
Still need to do dust zones but should be easy as that's just a slight "fade" into the zone and then linear concentration which I can just make a switch statement for
That's working great, thanks so much for the help @granite sky
now time to make my code somewhat organised 
except for the fact gamma does appear to have infinite range 
Think the _distHalvedThruAir variable may not be halving as the lower it is the more radiation I'm getting
You don't need the second part for gamma if you have a hardcoded 200m limit :P
Still want to be able to remove that limit though and just rely on the mod running itself so I can do zones > 200m :p
random 1 < (((_range/(ACE_player distance _obj1)^2)*(2^((ACE_player distance _obj1)/_distHalvedThruAir)))) is what I'm using for gamma where _range is max distance of 100% which is 70m here, but increasing disthalved is counting more often than decreasing it
with a distance halved of 0.05 
Then nothing with 500
Yeah so seems to be inversely proportional r.e disthalved
Doubling halves so inversely proportional yes
no it doesnt halving the disthalved increases activity by a factor of 4 this is so confusing 
_range = 20;
_obj1 = pablito;
_distHalvedThruAir = 1;
(((_range/(ACE_player distance _obj1)^2)*(2^((ACE_player distance _obj1)/_distHalvedThruAir))))``` Returns 240 at 10m, but changing disthalved to 2 returns 6  Similar changes happen regardless of `_range`
squared was in the wrong place, needed to be after i think lol no thats also wrong wtf im so confused
@sullen sigil Oh yeah, the calculation should have been inverted.
1/calc? 
replace the * in the middle with a / :P
I've been running it like that for a short while and still getting odd behaviour
but let me try change in the mod & see
oh
works 😄
thanks 🙂
just had to test in the mod not debug console values
It is however not really working too great for gamma in terms of actual range still -- drops off wayyy to quickly even when I have halved as 2000
What about if you set it to 1 million or so
Ah, think I'm misunderstanding the variables now -- the previous max range one now seems to be max range in total if nothing gets halved etc
Setting range to 2000 with distancehalved as like 5 works
uh
Note that you're not squaring the range there, so that means sqrt(2000) = 44m is the point where the first part evaluates to 1.0
It's confusing as _range was already a variable and was maximum range of the radiation lol
but seems to still be maximum range but it's now relying on distancehalved, which is good
It's not a maximum range, it's just a scale point.
5m for gamma is aphysical and you're just fudging things :P
What I have now works it's just not what I expected to have xD
I'm trying to add magazines into this loot crate with the weapons, any idea on how to do it? I tried some things but only got errors
What is the error?
Not using ammo but basically doing the same thing. I get error on line 2 missing ]
private _randomGun = selectRandom [
"arifle_MX_F",
"arifle_MX_GL_F",
"arifle_AK12_F"
];
crate1 addWeaponCargoGlobal [_randomGun, 1];
Does this work?
yep it does
I fixed the error on mine, I miss " on line 2. But now nothing spawns in the crate but without error
Like this there are no errors but nothing appears in the crate
So don't use that, use the one i gave you.
but that only adds weapons, I need to add weapon with ammo
🤔 yours doesn't add ammo either?
nope just weapons
And what I gave you is a drastically improved version of what you have now.
I appreciate it but I need to find a way to add the weapon with magazines
https://community.bistudio.com/wiki/addWeaponWithAttachmentsCargo
You'll need to set up arrays containing the proper magazines and such for each weapon
these should be arrays with proper ammo and it doesn't work
You're expecting addWeaponCargo to understand a ["weapon", "magazine"] array? It doesn't.
How can I fix it then?
there is one separate command for magazines (addMagazineCargo). A loot system this early might be complex to make, maybe reconsider and try undestanding what each command does and then add to a single box until you wrap around the concept of cargo in a container
I said set up arrays with proper ammo and stuff in relation to this: https://community.bistudio.com/wiki/addWeaponWithAttachmentsCargo
It has its own special syntax, make sure to read it
also use https://community.bistudio.com/wiki/selectRandom instead
was there any way to make AI never leave a vehicle no matter what?
there is allowCrewInImmobile, and setUnloadInCombat - but thats it, right?
like disablAI has no influence
No matter what, like which situation?
{
ger_tank_841 setHitPointDamage [_x,1];
} forEach ["hitFuel","hitRTrack","HitSkirt_Right_1","HitSkirt_Right_2","HitSkirt_Right_4"];
ger_tank_841 setVehicleLock "locked";
ger_tank_841 setFuel 0;
ger_tank_841 allowCrewInImmobile true;```
this works locally, but on a DS it does not
probably its related to dynamic sim / simulation switching on-off for the tank and crew
vehicle allowCrewInImmobile [brokenWheels, upsideDown]
they'll still leave when hull damage is too high tho
lock the vehicle
oh yeah I think that works, it has to be a full vehicle lock though, lockTurret etc I think they don't care about
tried the note from KK? https://community.bistudio.com/wiki/allowCrewInImmobile
ger_tank_841 setVehicleLock "locked";
not equivalent to
ger_tank_841 lock 2;
?
yeah added that, but still need to verify in DS env
it should be the exact same thing
ok. so what does @winter rose mean than???
🤔
Hi!
I'm not a script writer but have an idea - logistics and spare parts for vehicle repairing. From what I know (and believe me- I know, that's my job in the army...) it's one of the things that makes everything a little more complicate. and I think Arma need this logistic challenge as well...
What do you think? is it complicate to make?
Well ACE mod does it with spare wheels or spare tracks for tanks to repair
I have the following script for spawning a heli, its crew, and a squad of soldiers as passengers.
It goes to the correct location and deposits the soldiers before going to waypoint _wp2 as expected, however, it doesn't delete the crew, even though it does put through the hint.
Ideally I'm trying to delete both the heli and it's crew once it arrives at _wp2.
I've tried a variety of other lines but no matter what it seems to do nothing.
Any help is appreciated 🙂
params ["_pos","_side"];
_crew1 = [];
_airframe1 = [];
_mygroup = [];
_crew1 = creategroup EAST;
_airframe1 = [(getMarkerPos "RedSupportCorridor"), 140, "O_Heli_Transport_04_bench_F", _crew1] call BIS_fnc_spawnVehicle;
_wp1 = _crew1 addWaypoint [_pos, 0];
_wp1 setWaypointType "TR UNLOAD";
_wp1 setWaypointSpeed "FULL";
_wp1 setwaypointstatements ["true", "this land 'land'"];
_wp2 = _crew1 addWaypoint [(getMarkerPos "RedSupportCorridor"), 0];
_wp2 setWaypointType "MOVE";
_wp2 setWaypointSpeed "FULL";
_wp2 setWaypointStatements ["true", "deleteVehicleCrew _airframe1; hint 'red del';"];
_mygroup = [(getMarkerPos "RedSupportCorridor"), EAST, ["O_Soldier_SL_F","O_Soldier_F","O_Soldier_LAT_F","O_soldier_M_F","O_Soldier_TL_F","O_Soldier_AR_F","O_Soldier_A_F","O_medic_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
[_mygroup, _pos, 75] call BIS_fnc_taskPatrol;
waitUntil{ waypoints _mygroup findIf { waypointType _x == "CYCLE" } > -1 };
{_x setWaypointSpeed "NORMAL";}forEach waypoints _mygroup;
sleep .5;
_mygroup = _mygroup;
{ _x assignAsCargo (_airframe1 select 0); _x moveIncargo (_airframe1 select 0);} foreach units _mygroup;
_airframe1 isn't likely to be available inside the waypoint statement. It's a separate script that doesn't inherit local/private variables
Within the Condition & Statement code string:
thisrefers to the group leader
thisListrefers to the group's units
https://community.bistudio.com/wiki/setWaypointStatements
ah fair, so perhaps something like this?
_wp2 setWaypointStatements ["true", "deleteVehicle (vehicle this); {deleteVehicle _x} forEach units group this;"];
private _veh = vehicle this; deleteVehicleCrew _veh; deleteVehicle _veh; may also work
worked a treat, thank you so much, been bashing my head against the wall for a while over this one
whats the point of that waitUntil?
it shouldn't be needed
I was running into this issue elsewhere in my scenario and so added it to be safe, likely isn't needed in this context but figured better safe than sorry
Im trying to customize the patrol behaviour of the group.In the group leaders init i have the following: _null = [group this, getPos car, 444, setBehaviour AWARE] spawn BIS_fnc_taskPatrol its returnng errors and im unable to use this line but if i use: _null = [group this, getPos car, 444] spawn...
it doesn't schedule any new scripts in there, it runs from start to finish
so the effect volume seems to be tied with my custom music 😦
and it doesnt appear in the trigger effects music section
You have probably defined your music as a sound rather than as music
Arma does not automatically know whether a sound file is sound or music - it doesn't analyse the contents of the file. You tell it, when you use CfgSounds or CfgMusic to define the sound.
so i just need to rename the important bits to cfgmusic?
You need to look up CfgMusic on the wiki, because the format may be different to CfgSounds
You will also need to use e.g. playMusic rather than playSound to......play the music
Is the best place to ask for help with module making here or should I be trying #arma3_config instead
Got an issue with the config side of it causing a textbox to not show up but think the script also doesn't work
ah fair, good to know
you mean mod/addon making?
no i mean module making
Modules are a part of mod making... just ask
it has been solved now
how do i make it so if the players on my server are dressed up in civillian clothes they wont get shot at straight away unless they pull a gun
i have found a script but its from 2015 and i doubt it still works
Probably have to use setCaptive or change side
i have made a mod for this on the front page of the workshop atm
but if you want it in a script version you can have a trigger with the condition field the condition you want
then activation/deactivation setcaptive true/false
a mod works fine
found it
KJW's Imposters on the workshop then 🙂
ill take a look at it
what makes you hostile
apart from equiping a gun
it wouldnt make much sense if i had full military gear but they dont shoot because i dont have a gun equiped
and does it work with modded items, 3CB, USP, RHS etc etc
CBA settings will let you set exceptions aside from the default ones, but:
gun in your hands, primary weapon equipped, secondary primary weapon equipped (my mod), launcher equipped, helmet with ballistic protection, vest with ballistic protection, backpack that isnt civilian, night vision, uniform and facewear
there is a compat for all of those but only 3cb adds civilian clothing, the others are for face coverings for balaclava system
generally just common sense rules
thats what i meant, i use 3CB for civillians and USP, RHS etc for military gear
Yup, everything is military gear by default until otherwise specified; relying on people properly inheriting from vanilla base classes for civilian wear. Balaclavas are the same, all balaclavas/face coverings should keep you unwanted
i see
where do i find the compat
read mod description
i have to make the compats?
also, i dont think that any of the mods we use have the "KJW_Imposters_Exception = 1" in their config
will they still work
no, the compats are already in the mod.
Does anyone know if you can limit a fuel tanks full amount. For example is it possible to make the fuel tank of a vehicles 50% less but show it as a full tank still?
for this specific example, not unless you want to modify the GUI. The only way to limit how much fuel does a vehicle is able to take it's by modifying its config but assuming you didnt modify the GUI the fuel bar will still show the equivalent progress from 0% to 100%.
Alrighty Ty
If it really matters you could do perframe calculations on rpm and reduce the fuel percentage by the amount that should have been consumed.
HASHMAP keys are case sensitive, i.e. when they are STRING (?)
as compared/contrasted with allVariables _object
https://community.bistudio.com/wiki/get
key: HashMapKey - Case sensitive key
How do I pack a mission into an addon .pbo?
Not with scripting, I'll tell you that
I know RHS did that, but I can't find where they put it
I know, it evolves cfgs
#arma3_scenario or #arma3_config then
nvmd, found it
Yes, but that's it. No broken engine, pipes, electric parts or so. And Arma seperates mechanic problems, but requires only a technician with a screwdriver to fix most of them... No spare parts needed...
Ah, how many people we could send home if that was the case in real life... 😉
you might wsnt to check drongos logistic not sure about damage models but i know it does spares
I've run into an issue trying to add another condition in the conditional statement provided in the BIS_fnc_holdActionAdd function called via remoteExec
armed = _x getVariable "armed";
[
_x,
"Arm Bomb",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"_this distance _target < 3 && _this getVariable 'armed' == 0", //<-------Proper way to do this?
"_caller distance _target < 3",
{},
{},
{ _this call arm_func },
{},
[],
5,
0,
false,
false
] remoteExec ["BIS_fnc_holdActionAdd", 0, _x];
Any ideas?
You have a missing quote around armed
Ah, not the issue sadly, accident when I was formatting for discord
"(_this distance _target < 3 && _this getVariable 'armed' == 0)", // no error, doesn't work
vs
"(_this distance _target < 3 && true)", // works
Verified by action not showing up at all
Maybe _this doesn't point to the object i'm expecting?
from bistudio:
conditionShow: String - (Optional, default "true") condition for the action to be shown.
Special arguments passed to the code: _target (action-attached object), _this (caller/executing unit)
Is caller in this case not the object referenced by _x?
the variable "armed" definitely exists on the object _x in this case
Solved: Caller is the player approaching, target is the object that owns the script. use _target instead of _this
Another question: How to ensure that when an action is added to an object, that players who join after the script is run can see the action?
hello all. writing a .sqf for an enemy aircraft spawn in a mission, and need it to spawn in the air to proceed to the waypoint. where/how do i offset the height?
theres no need to do this per frame tho. evaluating once a second will do instead of 60 a second
Use the JIP parameter on the remoteExec.
What's with HandleDamage triggering on different frames for a single HE GL explosion nearby?
13:51:35 ---------------------------------------------------------
13:51:35 "514333: HandleDamage: B_Soldier_F"
13:51:35 [B Alpha 1-2:1 (Sa-Matra),"head",0.0196149,B Alpha 1-2:1 (Sa-Matra),"G_40mm_HE",2,B Alpha 1-2:1 (Sa-Matra),"hithead"]
13:51:35 ---------------------------------------------------------
13:51:35 "514334: HandleDamage: B_Soldier_F"
13:51:35 [B Alpha 1-2:1 (Sa-Matra),"",0.00365744,B Alpha 1-2:1 (Sa-Matra),"G_40mm_HE",-1,B Alpha 1-2:1 (Sa-Matra),""]
13:51:35 [B Alpha 1-2:1 (Sa-Matra),"neck",0.0193211,B Alpha 1-2:1 (Sa-Matra),"G_40mm_HE",1,B Alpha 1-2:1 (Sa-Matra),"hitneck"]
13:51:35 [B Alpha 1-2:1 (Sa-Matra),"head",0.0196149,B Alpha 1-2:1 (Sa-Matra),"G_40mm_HE",2,B Alpha 1-2:1 (Sa-Matra),"hithead"]
13:51:35 [B Alpha 1-2:1 (Sa-Matra),"spine2",0.025099,B Alpha 1-2:1 (Sa-Matra),"G_40mm_HE",5,B Alpha 1-2:1 (Sa-Matra),"hitdiaphragm"]
13:51:35 [B Alpha 1-2:1 (Sa-Matra),"spine3",0.0253822,B Alpha 1-2:1 (Sa-Matra),"G_40mm_HE",6,B Alpha 1-2:1 (Sa-Matra),"hitchest"]
13:51:35 [B Alpha 1-2:1 (Sa-Matra),"arms",0.0133238,B Alpha 1-2:1 (Sa-Matra),"G_40mm_HE",8,B Alpha 1-2:1 (Sa-Matra),"hitarms"]
13:51:35 [B Alpha 1-2:1 (Sa-Matra),"hands",0.0142088,B Alpha 1-2:1 (Sa-Matra),"G_40mm_HE",9,B Alpha 1-2:1 (Sa-Matra),"hithands"]
13:51:35 [B Alpha 1-2:1 (Sa-Matra),"legs",0.0130037,B Alpha 1-2:1 (Sa-Matra),"G_40mm_HE",10,B Alpha 1-2:1 (Sa-Matra),"hitlegs"]
13:51:35 [B Alpha 1-2:1 (Sa-Matra),"body",3.80734e-005,B Alpha 1-2:1 (Sa-Matra),"G_40mm_HE",11,B Alpha 1-2:1 (Sa-Matra),"incapacitated"]
13:51:35 [B Alpha 1-2:1 (Sa-Matra),"",0.00182872,B Alpha 1-2:1 (Sa-Matra),"",-1,<NULL-object>,""]
I remember it was always wonky like this, but I still wonder why.
In this log EH returns damage divided by 2: (_this select 2) / 2, 514333 is frame number
inb4 first one is direct hit and others are splash
First frame, damage to head arrives, supposed to set it to 0.0196149 / 2.
Next frame, damage to head arrives again, tries to set it to 0.0196149 again, like it was 0 before and that 0.0196149 / 2 didn't apply?
Oddity with overall damage too, second frame it fires EH for 0.00365744 damage, sets to 0.00365744 / 2, then again for overall damage but sets it to result of that / 2 division, 0.00182872, so no damage, also instigator is null
It wasn't a direct hit, single 40mm GL hit&explosion to a nearby vehicle
Oddities summarised again:
- First "head" damage doesn't seem to even apply
- Second overall damage EH fire does 0 damage and has no instigator
No such issue with HandleDamage on an empty vehicle, might be only happening to units.
or maybe it's because head is a separate entity? 🤔
i mean, it behaves the same with a bullet to the knee
Same fires on two different frames?
10:06:11 [25117,[B Alpha 1-2:1,"head",0,B Alpha 1-1:1 (artemoz),"B_65x39_Caseless",2,<NULL-object>,"hithead"]]
10:06:11 [25117,[B Alpha 1-2:1,"",0.394021,B Alpha 1-1:1 (artemoz),"B_65x39_Caseless",-1,B Alpha 1-1:1 (artemoz),""]]
10:06:11 [25118,[B Alpha 1-2:1,"",0.394021,B Alpha 1-1:1 (artemoz),"B_65x39_Caseless",-1,B Alpha 1-1:1 (artemoz),""]]
10:06:11 [25118,[B Alpha 1-2:1,"legs",0.63802,B Alpha 1-1:1 (artemoz),"B_65x39_Caseless",10,B Alpha 1-1:1 (artemoz),"hitlegs"]]
10:06:11 [25118,[B Alpha 1-2:1,"body",1.12145e-006,B Alpha 1-1:1 (artemoz),"B_65x39_Caseless",11,B Alpha 1-1:1 (artemoz),"incapacitated"]]
Interesting, your head has no instigator, double overall happen on different frames (while it was on same in my case), your overalls have instigator properly
See no rhyme so far
productVersion is 3","Arma3",211,150196,"Development",true,"Windows","x64"]. Are you on different build (release/prof)?
["Arma 3","Arma3",210,149954,"Stable",true,"Windows","x64"]
Doubt its about dev build, I remember HandleDamage on units being this messy years ago, just decided to finally have a closer look
lemme check, not like that takes long
14:11:54 ---------------------------------------------------------
14:11:54 "Frame 663154: HandleDamage: B_Soldier_F"
14:11:54 head = 0, EH = [(UNIT),"head",0.0115336,(UNIT),"G_40mm_HE",2,(UNIT),"hithead"], should set head to 0.00576678
14:11:54 ---------------------------------------------------------
14:11:54 "Frame 663155: HandleDamage: B_Soldier_F"
14:11:54 TOTAL = 0, EH = [(UNIT),"",0.00215512,(UNIT),"G_40mm_HE",-1,(UNIT),""], should set TOTAL to 0.00107756
14:11:54 neck = 0, EH = [(UNIT),"neck",0.0113742,(UNIT),"G_40mm_HE",1,(UNIT),"hitneck"], should set neck to 0.00568711
14:11:54 head = 0, EH = [(UNIT),"head",0.0115336,(UNIT),"G_40mm_HE",2,(UNIT),"hithead"], should set head to 0.00576678
14:11:54 spine2 = 0, EH = [(UNIT),"spine2",0.0147681,(UNIT),"G_40mm_HE",5,(UNIT),"hitdiaphragm"], should set spine2 to 0.00738407
14:11:54 spine3 = 0, EH = [(UNIT),"spine3",0.0149461,(UNIT),"G_40mm_HE",6,(UNIT),"hitchest"], should set spine3 to 0.00747304
14:11:54 body = 0, EH = [(UNIT),"body",2.24191e-005,(UNIT),"G_40mm_HE",11,(UNIT),"incapacitated"], should set body to 1.12096e-005
14:11:54 TOTAL = 0.00107756, EH = [(UNIT),"",0.00107756,(UNIT),"",-1,<NULL-object>,""], should set TOTAL to 0.000538779
```added more logging, replaced long unit name with `(UNIT)` for better readability
damage player = 0.000538779 after the fact
So indeed first frame head's damage doesn't even apply
All other though do
player getHit "head" => 0.00576678
it starts showing instigator on the first frame when i change to stable build
behaves differently between a bullet hit, light splash damage and heavy splash damage, it seems 
Yeah, no rhyme to it
Also complete mess with server\client differences
Somehow HandleDamage added to remote (server) unit fires too when client unit shoots
Server player explodes HE GL, damage logs on client:
14:25:20 ---------------------------------------------------------
14:25:20 "Frame 57197: HandleDamage: B_Soldier_F"
14:25:20 TOTAL = 0, EH = [(CLIENT),"",0.0040391,(SERVER),"G_40mm_HE",-1,(SERVER),""], should set TOTAL to 0.00201955
14:25:20 neck = 0, EH = [(CLIENT),"neck",0.0215125,(SERVER),"G_40mm_HE",1,(SERVER),"hitneck"], should set neck to 0.0107563
14:25:20 head = 0, EH = [(CLIENT),"head",0.0218586,(SERVER),"G_40mm_HE",2,(SERVER),"hithead"], should set head to 0.0109293
14:25:20 spine2 = 0, EH = [(CLIENT),"spine2",0.0278808,(SERVER),"G_40mm_HE",5,(SERVER),"hitdiaphragm"], should set spine2 to 0.0139404
14:25:20 spine3 = 0, EH = [(CLIENT),"spine3",0.0282422,(SERVER),"G_40mm_HE",6,(SERVER),"hitchest"], should set spine3 to 0.0141211
14:25:20 arms = 0, EH = [(CLIENT),"arms",0.014843,(SERVER),"G_40mm_HE",8,(SERVER),"hitarms"], should set arms to 0.00742151
14:25:20 hands = 0, EH = [(CLIENT),"hands",0.0158519,(SERVER),"G_40mm_HE",9,(SERVER),"hithands"], should set hands to 0.00792595
14:25:20 legs = 0, EH = [(CLIENT),"legs",0.0144275,(SERVER),"G_40mm_HE",10,(SERVER),"hitlegs"], should set legs to 0.00721375
14:25:20 body = 0, EH = [(CLIENT),"body",4.23633e-005,(SERVER),"G_40mm_HE",11,(SERVER),"incapacitated"], should set body to 2.11817e-005
14:25:20 TOTAL = 0.00201955, EH = [(CLIENT),"",0.00201955,(SERVER),"",-1,<NULL-object>,""], should set TOTAL to 0.00100977
Client player explodes HE GL, damage logs on client:
14:27:22 ---------------------------------------------------------
14:27:22 "Frame 71126: HandleDamage: B_Soldier_F"
14:27:22 head = 0, EH = [(CLIENT),"head",0.0222436,(CLIENT),"G_40mm_HE",2,(CLIENT),"hithead"], should set head to 0.0111218
14:27:22 head = 0.011811, EH = [(SERVER),"head",0.0349303,(CLIENT),"G_40mm_HE",2,(CLIENT),"hithead"], should set head to 0.0174651 // WTF?
14:27:23 ---------------------------------------------------------
14:27:23 "Frame 71127: HandleDamage: B_Soldier_F"
14:27:23 TOTAL = 0, EH = [(CLIENT),"",0.00415877,(CLIENT),"G_40mm_HE",-1,(CLIENT),""], should set TOTAL to 0.00207939
14:27:23 neck = 0, EH = [(CLIENT),"neck",0.0219095,(CLIENT),"G_40mm_HE",1,(CLIENT),"hitneck"], should set neck to 0.0109548
14:27:23 head = 0, EH = [(CLIENT),"head",0.0222436,(CLIENT),"G_40mm_HE",2,(CLIENT),"hithead"], should set head to 0.0111218
14:27:23 spine2 = 0, EH = [(CLIENT),"spine2",0.0284411,(CLIENT),"G_40mm_HE",5,(CLIENT),"hitdiaphragm"], should set spine2 to 0.0142206
14:27:23 spine3 = 0, EH = [(CLIENT),"spine3",0.0287695,(CLIENT),"G_40mm_HE",6,(CLIENT),"hitchest"], should set spine3 to 0.0143847
14:27:23 arms = 0, EH = [(CLIENT),"arms",0.0151249,(CLIENT),"G_40mm_HE",8,(CLIENT),"hitarms"], should set arms to 0.00756244
14:27:23 hands = 0, EH = [(CLIENT),"hands",0.0161677,(CLIENT),"G_40mm_HE",9,(CLIENT),"hithands"], should set hands to 0.00808383
14:27:23 legs = 0, EH = [(CLIENT),"legs",0.0147837,(CLIENT),"G_40mm_HE",10,(CLIENT),"hitlegs"], should set legs to 0.00739185
14:27:23 body = 0, EH = [(CLIENT),"body",4.31542e-005,(CLIENT),"G_40mm_HE",11,(CLIENT),"incapacitated"], should set body to 2.15771e-005
14:27:23 TOTAL = 0.00207939, EH = [(CLIENT),"",0.00207939,(CLIENT),"",-1,<NULL-object>,""], should set TOTAL to 0.00103969
14:27:22 head = 0.011811, EH = [(SERVER),"head",0.0349303,(CLIENT),"G_40mm_HE",2,(CLIENT),"hithead"], should set head to 0.0174651 // WTF?
Client somehow has HandleDamage on remote (server) unit firing
0.0174651 is not applied, server still has their proper head damage value
Complete mess 
yaaay, jank and discovery
Maybe @still forum can shine a bit of light on this?
with a1 setDamage 0.1 added to EH: 10:36:55 [66911,[a1,"head",1.20037,B Alpha 1-1:1 (artemoz),"B_65x39_Caseless",2,<NULL-object>,"hithead"]] 10:36:55 [66911,[a1,"",0.533586,B Alpha 1-1:1 (artemoz),"B_65x39_Caseless",-1,B Alpha 1-1:1 (artemoz),""]] 10:36:55 [66912,[a1,"",0.633586,B Alpha 1-1:1 (artemoz),"B_65x39_Caseless",-1,B Alpha 1-1:1 (artemoz),""]] 10:36:55 [66912,[a1,"face_hub",0.39007,B Alpha 1-1:1 (artemoz),"B_65x39_Caseless",0,B Alpha 1-1:1 (artemoz),"hitface"]] 10:36:55 [66912,[a1,"neck",0.419022,B Alpha 1-1:1 (artemoz),"B_65x39_Caseless",1,B Alpha 1-1:1 (artemoz),"hitneck"]] 10:36:55 [66912,[a1,"head",1.30037,B Alpha 1-1:1 (artemoz),"B_65x39_Caseless",2,B Alpha 1-1:1 (artemoz),"hithead"]] 10:36:55 [66912,[a1,"arms",0.124855,B Alpha 1-1:1 (artemoz),"B_65x39_Caseless",8,B Alpha 1-1:1 (artemoz),"hitarms"]] 10:36:55 [66912,[a1,"body",0.100039,B Alpha 1-1:1 (artemoz),"B_65x39_Caseless",11,B Alpha 1-1:1 (artemoz),"incapacitated"]]
sets to 0.1 at frame 11, uses that in calc on frame 12
How do I get my hitpart work correctly?
Or should I use some another eh.
params ["_bombObj"];
_bombObj addEventHandler ["HitPart", {
(_this #0) params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"];
_data = str _target+str _shooter+str _projectile+str _position+str _velocity+str _selection+str _ammo+str _vector+str _radius+str _surfaceType+ str _isDirect;
copyToClipboard _data;
if (_ammo don't know the check here) then {
[_target] call VRK_IEDDcommon_fnc_bomb;
};
}];
Currenclty check with one type of ammo, (part don't know correct check)
But if I want for let's say 4 big ammo types.
I want my explosive to expose when it get hit from big gun.
Currently my eh triggers if I shoot 20-25 ammos with regular machine gun.
So can I check with something else than typeOf ammo is gun/ ammo in my list.
"HitPart" is fun(_this #0) params wut
HitPart returns array of arrays so its fine
Yeh, asked help to this earlier because I didn't get params out. And some1 told this way to do that
ammo: Array - ammo info: [hit value, indirect hit value, indirect hit range, explosive damage, ammo class name]; Or, in case of a vehicle collision: [impulse value, 0, 0, 0]; hit and damage values are derived from the projectile's CfgAmmo class, and do not match the actual damage inflicted, which is usually lower due to armor and other factors
@stable dune So you want lots of small caliber hits or few high caliber ones to trigger the bomb?
Basically have some kind of HP for the object that reduces based on ammo used?
One big hit
Only the big hit, ignore other?
"big hit" as in "hit from an ammo from big ammo list" or as "hit with high damage". Or some combination of both?
.50 cal bullet has hit = 30 in config
class B_127x99_Ball: BulletBase
{
hit = 30;
you can try checking if _ammo # 0 > 20 for example
or something like sqf _bombObj addEventHandler ["HitPart", { private _bigBombs = ["Bomb_03_F", "Bomb_04_F", "Bo_Mk82"]; private _bigBombHitIndex = _this findIf { _x params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"]; (count _ammo > 4) && {(_ammo#4 in _bigBombs)} }; if (_bigBombHitIndex > -1) then { hint "KABOOM"; }; }];
or switch to "HandleDamage" EH as it seems to fire for static objects in my testing 🤔
if(_isDirect && _ammo # 0 > 20) then {
Omg, 😱.
Nice. These give me alot of variations.
I will test these out.
Thanks guys alot of help.
Can I use same check?
_bombObj addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint", "_directHit"];
private _bigBombs = ["Bomb_03_F", "Bomb_04_F", "Bo_Mk82"];
if (_projectile in _bigBombs) exitWith { // if classname of projectile matches - do something and set full damage
hint "KABOOM";
1
};
0 // else ignore damage totally
}];```something like this may work. Or not.
I will test out. Thanks
How it goes if I want let's say .50 cal shot to explose my object
if you want to check ammo stats or distinguish direct/indirect hits - then "HitPart" seems preferable. If just ammo class matching is enough - "HandleDamage" with listed ammo classes would work.
what are the script entrypoints for an addon? I suppose something like init.sqf wont work
that I am awareoff , is there no other way?
CfgFunctions, or any eventhandler (on a unit or UI or smth)
If you have CBA it also adds some eventhandlers for preInit/preStart n sucho
ok thx
@meager granite have you experimented with blocking damage to player when involved in an "arma" vehicle collision?
i have players doing very cool pit maneuvers and almost invariably dying in the process. will probably look into doing something about it but maybe you've already solved it 😄
Yeah, to some extent. I think it should be easy by checking for damage source and if player is inside a vehicle
im not sure if its a bug, or if doing something wrong.
But if you have a list, and select the first thing, and use lbSelection for some reason [] is returned instaed of [0]
ive selected another values and always the [index] is returned, but when i select the 0, returns []
it has been like that for long, I have always used workaround
lol, so its not a bug its a feature
i think a bug
@winter rose can we have this on the wiki? ❤️
https://community.bistudio.com/wiki/lbSelection
to be fair lbCurSel works fine
lbSelection is for multi selection
yea, i was using lbselection and selecting the first value
seems to work alright in devdiag build 🤔
I would rather have it fixed if this is a bug
i can reproduce in prod build. Seems to be fixed in diag build already 🤷♂️
perfect, less work
Hi guys a question. so i have this code:
playersInMission = {isPlayer _x} count playableUnits;
playerNames = [];
private _headlessClients = entities "HeadlessClient_F";
humanPlayers = allPlayers - _headlessClients;
{
private _playerName = name _x;
playerNames pushBack _playerName;
}foreach humanPlayers;
[] spawn {
while {true} do {
//Players in Area:
playersInArea = humanPlayers select {_x inArea area1};
playersNotInArea = (humanPlayers - playersInArea);
hint format ["Players in Mission: %1 \n PlayerNames: %2 \n Players in Area: %3 \n Players not in Area: %4",playersInMission,playerNames,playersInArea,playersNotInArea];
sleep 2;
};
};
But this code is ugh. Question how can i make so this code is modular. Meaning i can have triggers around map and when player 1 enters in the trigger 1 it activates the code witch basicly counts all the players in the mission, checks the players in the trigger area and displays the players not pressent in the trigger area. Once all the players are in trigger area the code exits. How would i make it so i can just call this via fnc ?
well for one, playersInMission and humanPlayers variables will only be updated once, if a player joins in after mission start, you will not count them
seems to be fixed right after 2.10 release https://forums.bohemia.net/forums/topic/140837-development-branch-changelog/?do=findComment&comment=3465585 
Cleaning that up would be
[] spawn {
while {true} do {
private _playersInMission = {isPlayer _x} count playableUnits;
private _playerNames = humanPlayers apply {name _x};
private _humanPlayers = allPlayers - (entities "HeadlessClient_F");
//Players in Area:
private _playersInArea = _humanPlayers inAreaArray area1;
private _playersNotInArea = (_humanPlayers - _playersInArea);
hint format ["Players in Mission: %1 \n PlayerNames: %2 \n Players in Area: %3 \n Players not in Area: %4",_playersInMission,_playerNames,_playersInArea,_playersNotInArea];
sleep 2;
};
};
area1 is the trigger yes?
Yea
oh also inAreaArray is a thing
private _playersInArea = _humanPlayers select {_x inArea area1};
to
private _playersInArea = _humanPlayers inAreaArray area1;
You could turn it into a func like
L3_TriggerAreaFuncStuff = {
params ["_area"];
while {true} do {
private _playersInMission = {isPlayer _x} count playableUnits;
private _playerNames = humanPlayers apply {name _x};
private _humanPlayers = allPlayers - (entities "HeadlessClient_F");
//Players in Area:
private _playersInArea = _humanPlayers inAreaArray _area;
private _playersNotInArea = (_humanPlayers - _playersInArea);
hint format ["Players in Mission: %1 \n PlayerNames: %2 \n Players in Area: %3 \n Players not in Area: %4",_playersInMission,_playerNames,_playersInArea,_playersNotInArea];
sleep 2;
};
};
and then you can call it like
[area1] spawn L3_TriggerAreaFuncStuff
But you probably also don't want multiple areas to be active at the same time? the hints will overwrite eachother
also the hints make a "bling" sound every 2 seconds, maybe us hintSilent instead of just hint
and if (_playersNotInArea isEqualTo []) exitWith {hint "Everybody home"}; before sleep 2; for the "Once all the players are in trigger" part :3
just put that into condition instead
all the code into condition and just sleep 2; as body? Radical.
i meant the if you wrote
it kinda depends on private variable inside the body. That kinda depends on other private variables inside the body. I'd argue exitWith would be cleaner here than moving a variable outside of while loop 🤷♂️
Yea that is fine i dont plan for players to have 2 triggers active at the same time. Also to exit the code is it like this so i dont have Infinite loops running in buckground ?
```sqf
while {true} do {
private _playersInMission = {isPlayer _x} count playableUnits;
private _playerNames = humanPlayers apply {name _x};
private _humanPlayers = allPlayers - (entities "HeadlessClient_F");
//Players in Area:
private _playersInArea = _humanPlayers inAreaArray area1;
private _playersNotInArea = (_humanPlayers - _playersInArea);
hint format ["Players in Mission: %1 \n PlayerNames: %2 \n Players in Area: %3 \n Players not in Area: %4",_playersInMission,_playerNames,_playersInArea,_playersNotInArea];
if (_playersNotInArea isEqualTo []) exitWith {hint "Everybody home"};
sleep 2;
};
yush
btw instead of just playerNames. You could log names of players in area and not in area.
Yea how would i do that sorry still learning ?
while {true} do {
private _playersInMission = {isPlayer _x} count playableUnits;
private _humanPlayers = allPlayers - (entities "HeadlessClient_F");
//Players in Area:
private _playersInArea = _humanPlayers inAreaArray area1;
private _playersNotInArea = (_humanPlayers - _playersInArea);
hint format ["Players in Mission: %1 \n Players in Area: %3 \n Players not in Area: %4",
_playersInMission,
_playersInArea apply {name _x},
_playersNotInArea apply {name _x}
];
if (_playersNotInArea isEqualTo []) exitWith {hint "Everybody home"};
sleep 2;
};
Thank you very much this was so helpful
I need help I cant change faction config in warlords and when i am changing faction config nothing happening in the game and i have RHSUSAF mod but I dont know how I use that in faction config
Config Browser -> CfgFactionClasses, look there
rhs_faction_usarmy is US Army faction, you can find other there
how can i use this CfgFactionClasses in the gmae ?
Check its child class names in config browser, these will be your faction config names
should i create description.ext in documents?
If you're asking for faction config names, that's how you get them, they're child classes of CfgFactionClasses class, look there.
I understand but I don't know how to use these codes.
use how
what are you trying to do with these?
if you want to create a faction, you will need to create a mod.
create a mod ? what do you mean?
use how
what are you trying to do with these?
as in "what do you want to do?"
Sorry for bothering you but how would i deal whit this. I have 2 clients on dedicated server and when player 1 enters in the trigger area it says "everybody is home". while player 2 is having this message pop out: https://gyazo.com/8c2849d7ad8203b7de4fd09223815cd1
i am executing this script within the trigger like:
[thisTrigger] remoteExec ["L3_fnc_playerInArea",[0,-2] select isDedicated];
I have Mod RHSUSAF and RHSAFRF and I want the store to be US forces, but they are NATO forces, and I don't want to be NATO forces, and I don't know how to change faction config?
in warlords
if you want to override a mod faction, you will need to create a config mod (pbo) - you cannot change that from scripts
I think so becouse allplayers also counts for HC while playable units dont ?
playableUnits = occupied by both AI or players
aka slots
Maybe a variable is typoed
I can't see the error now
But the not in area is empty. That's.. ohhh
can you teach me؟
Oops
It's %1 %3 %4 in that Format
Should be 1 2 3, i forgot that
#arma3_config may, I can't
That's why it displays wrong
Format is fixed but how would i fix then player1 enters in the trigger so it dosnet display everybody is home until all players are in trigger ?
Basicly when player 1 enters in the trigger it displays everybody is home message. and on player 2 is displaying what is in picture.
Remove the "hint" for everybody home
So on first player it will show you what values the variables contain
It is my first time and it is difficult for me
assuming in-engine-functions run faster than sqf functions
edit: nvm i responded to an hours old posting here
I get it, but I do not know.
note that
1/ you will take some time learning this
2/ you will need to upload your mod to Steam Workshop
3/ your mission won't be playable without this mod
now is it worth it
also, #arma3_config is incredibly unsupportive/unhelpful if you dont already know what you are doing
(personal opinion)
Ty very much again it did work. and the last question how would i make it so i can execute some script once all the players are in the area ?
is there a channel for posting things about incorrect wiki places just noticed something and curious
im working on some simple unitplay unitcapture stuff and cant tell if anything is wrong with my syntax i got sqf _unitCaptureData2 = []; [Heli2 , _unitCaptureData2] spawn BIS_fnc_unitPlay
but m not receiving any errors i used this template about half a year ago has it been modified since?
nothing has changed
you are providing no data to the "play" function, so nothing happens
you need to capture first
i removed the data
as it is always massive due to the type of array it is
well there is that if you want one with data but to get to anything useful you might have to home and end key a bit
private _unitCaptureData2 = [/* data */];
```could have been enough 😛 hehehe
ah ok not too used to removing massive arrays but ill remember it
(also _unitCaptureData1 vs _unitCaptureData2, IDK if relevant)
also for context it is in a mission file that is being execvm'd by a condition that i confirm works
nah just 2 helicopters being used
and are you sure the code is called?
NCL_HELI = 1;
if (NCL_HELI == 1) then {
execVM "Heliflight.sqf";
};
code in init.sqf
it's really weird im hardstuck on the issue because nothing shows
is there a chance that the space inbetween heli2 and the comma might cause issues```sqf
[Heli2 , _unitCaptureData2] spawn BIS_fnc_unitPlay
im going to test 1 sec
absolutely not.
yeah i didnt think it could and testing reveals it wont
do you have error display enabled? -showScriptErrors?
1 sec going to restart
NCL_HELI = 1;
if (NCL_HELI == 1) then {
sleep 1;
systemChat "werkz";
execVM "Heliflight.sqf";
systemChat "werkeded";
};
are you testing in multiplayer now
SP and later Mp local host
enabled -showScriptErrors in command line saw nothing in the scripterror aspect and with your modification got both messages
so, what to do with AI objects?
enableDynamicSimulation
Enables or disables Arma 3: Dynamic Simulation for given non AI object.```
can one stop a helo from firing its machine guns but not effect its rockets?
<group> enabledynami…..
remove the machine gun weapon
I can't it's a attack heli
{heli removeweapon _x} foreach (weapons heli)
Oh
{heli removeweapon "mainGun"} foreach (weapons heli);
let me guess. that is wrong?
nvm got it XD
No, they have no animations.
Hi everyone. I have a issue on my mission where blufor has 10 soldiers they can switch between freely with teamswitch. However when they die they lose the wheel scroll menu and cant use arsenal, addactions etc. Any ideas what this could be?
👋 I have a question (I think) about locality for MP.
I have function that adds an EH to some targets that counts when it is hit;
{
_x addMPEventHandler ["Hit",{
params ["_unit", "_source", "_damage", "_instigator"];
private "_hits";
_hits = missionNamespace getVariable "RW_hit";
_hits = _hits + 1;
missionNamespace setVariable ["RW_hit",_hits];
diag_log RW_hit; //debug
_unit animate ["terc",1]; //Making sure it goes down
_unit removeEventHandler [_thisEvent, _thisEventHandler];
}];```
I'm trying to record the hits that players make on the targets (can only ever be `0` or `1` in a place where I can access it to the return it to a player when they look for it is missionNamespace suitable for that?
also respawning is teamswitch only
Yes it is suitable but should use MPHit
Hit isnt an mp eh
arma do be like that
i have mod RHSUSAF and RHSAFRF and How I put the codes inside this?
Can you give me an example of how to write?
go to #arma3_config, here is for scripting
I am working with an inherited code base. code not mine, started from ground zero repo, no commit history.
q: why do enemy AI target empty friendly vehicles, and is there a way to disable this behavior?
possibly something in a the difficulty setting?
also running with ACE, not sure if it is in there as well.
If you use addVehicle then I think vehicles do remain on that side. Most empty-vehicle targeting cases are bugs though, IME.
Is there a command to get the name of a vehicle or I need to get it with using the config?
I mean like return "Cool Tank" from "b_o_tank123"
I'm trying to set up an addAction on a vehicle, but I need it to remoteExec. Basically I just need it to execute a function OPTRE_fnc_PelicanUnLoadValidate on the vehicle. What's the best approach for remoteExec in an addAction?
You need to look up the displayName or displayNameShort from its config
I'm confused about the premise of this question. There's no difference in how remoteExec operates in addAction code compared to how it operates in any other local script. Just do it...the normal way?
So...
this addAction ["message", {[_this] remoteExec ["OPTRE_fnc_PelicanUnLoadValidate"]}]?
The principle of the remoteExec is correct but _this doesn't refer to the object the action is attached to
https://community.bistudio.com/wiki/addAction
_this, in this context, contains a set of variables and you'll need params or select to pull out the right one
so how would I do that?
The addAction page contains a perfectly functional example of using params to extract the contents of _this into separate variables. You can copy that, or look up params or select to figure it out yourself. It's very simple so don't be scared.
Yeah honestly reading the stuff on the wiki isn't helping me at all, I don't understand how I'd implement this alongside a remoteExec within an addAction
this addAction ["message", {
params ["_target", "_caller", "_actionId", "_arguments"];
[_target] remoteExec ["OPTRE_fnc_PelicanUnLoadValidate"];
}];
The script parameter of the addAction is arbitrary code. Can be as long as you like.
In this case you can abbreviate to [_this#0] remoteExec ["whatever"], but this is illustrative.
Thanks a bunch for the script/explanation, will test it out now. Does this implementation work for JIP as well?
No, your remoteExec would need the JIP parameter.
Do you actually want that function to run everywhere, or just the server?
Honestly now I'm unsure, so I'll explain the goal. Basically, OPTRE_fnc_PelicanUnLoadValidate, when executed on a given Pelican vehicle, will detach something attached to the maglift pad on it. Players can get connected to an AI Pelican just fine as the driver is the one who initiates the connection, but for whatever reason it's normally the pilot who hits the scroll action to drop the attached vehicle. I've been told that this function should effectively just detach whatever is on, which works fine. I assume it only needs to execute on the server but I could be wrong here.
Well, detach is global-argument global-effect so you can run it anywhere.
So it depends what else the function does.
I can send the function here if you'd like.
`_vehicles = ((_this select 0) getVariable ["OPTRE_Pelican_AttachedToVehiclesEffect",[]]);
if (
(
{
(_x isKindOf "OPTRE_M808B_base") OR
(_x isKindOf "OPTRE_falcon_base") OR
(_x isKindOf "OPTRE_Wombat_base") OR
(_x isKindOf "optre_hornet_base")
} count _vehicles > 0
)
) then {
if (((getPosATL (_this select 0)) select 2) < 2) then {
titleText ["-------------------------------------------<br/><t color='#ff0000' size='1.5'>UNLOADING FAILED!</t><br/>-------------------------------------------<br/>Your landing gears must be raised to unload larger vehicles! Your landing gears will automatically raise when unloading large vehicles if you're flying above 2m.", "PLAIN DOWN", -1, true, true];
playSound "FD_CP_Not_Clear_F";
} else {
(_this select 0) allowDamage false;
player action ["LandGearUp", (_this select 0)];
sleep 2;
titleText ["-------------------------------------------<br/><t color='#ff0000' size='1.5'>VEHICLE UNLOADED!</t><br/>-------------------------------------------", "PLAIN DOWN", -1, true, true];
playSound "FD_Finish_F";
{
detach _x;
_x setVelocity [0,0,-1];
_x allowDamage false;
} forEach _vehicles;
sleep 0.5;
{_x allowDamage true;} forEach _vehicles;
(_this select 0) allowDamage true;
(_this select 0) setVariable ["OPTRE_Pelican_AttachedToVehiclesEffect", [], true];
};
} else {
0 = (_this select 0) spawn OPTRE_fnc_PelicanLoad_UnloadAllSupplyPods;
}; `
That needs to run local to the vehicle & pilot, which is hopefully the same thing.
It definitely shouldn't be JIP'd.
Or executed on more than one machine.
I'm having some issue getting the idc of a control that is created from a .sqf file, I've tried using ctrlIDC _ctrlName and I get scalar back as both a hint and a log. The idc is generated for each control, and it changes if you don't fully exit the ui before trying to access the ui "page" again from another ui "page"
The pilot is going to be an AI on the server.
You'd need to rewrite the script then, because it's doing player action ["LandGearUp", (_this select 0)];