#arma3_scripting
1 messages · Page 577 of 1
I have a 2 part question regarding ACE Framework. Part 1 - Can I execute a FNC within a condition statement? Part 2 - If so, how can I get an answer from the FNC to show the action.
@blissful snow ```sqf
// server-side
{ _x setVariable ["tf_receivingDistanceMultiplicator", 10, true] } forEach (call BIS_fnc_listPlayers);
wow thanks! Do I understand right, that I can put this code snippet into "onUserConnected" in my server.cfg?
no
but you can put it into a mod
Just get TFAR 1.0, set the global range coefficient in the server settings. and done
Thanks for that suggestion! I found your mod in the Workshop - I'll give it a try!
didn't even knew a V1.0 existed - may I suggest to include this on the official website?
it is on the official website
ah the beta link I apologize
Hi, is there any command I can give that will tell armor to face a certain direction (other than setDir)?
@ebon ridge try with
this lookAt _target;
setFormDir @ebon ridge
I'd trust the blue guy
Also related to formation actually, is there a way to make a custom formation? I would like standard parade pattern like leader at the front and then a grid behind them.
Blue means trust yes. But Lou means distrust. So.. what do
I think maybe I can use subgroups and doFollow commands ?
But ideally just set relative formation positions for a single formation would be ideal
well i see it, there is cfgFormations
appears to be completely undocumented? :/
@Dedmen Can you tell me how i can script an eventhandler for an "targeted sector changed" or "fast travel requested" event? Also is it possible to get a list of all sectors and just go though all of them one by one to check whether they are targeted or not?
is there a fnc to get the real world lat/long of a terrain just for reference to where its at sworn it was stored with them....
it must be in the config yes, given the terrain location is shown before entering Eden
ah... was hoping for a fnc to pull it up still avoiding cfg stuff like the plague for now
need that now?
private _worldsCfg = configFile >> "CfgWorlds";
private _stratisCfg = _worldsCfg >> "Stratis";
private _latitude = getNumber (_stratisCfg >> "latitude");
private _longitude = getNumber (_stratisCfg >> "longitude");
```@bright flume
This is mainly out of my curiosity, are the lat/long the coordinates which are returned by getPos?
nothing besides displaying the terrain location on a world map, as is done in Eden on new scenario terrain selection interface
ahhh I see
language
you can check in which hemisphere you are though; can be useful for seasons and stuffz
thats pretty cool
Thanks Lou!
That was a totally why I was looking for it wanna look up where it is based on RL and check sunrise vs if but it's actually legit re #livonia_feedback
indubilately
this is exactly why I say the square root of a negative is not (x)i sorry in polar coords I can root a negative still gonna be negative... stop making up imaginary numbers.. 😛
In a script how can you check if an value is input by an end user? I have a check if a user puts in a number less than 0 but if they put in a positive like 10 it keeps it. Some smart kid put in "10-10", then takes away the first 10 and it lets them keep it
I just want to get it to remove any - as soon as it appears
This is A2 so can't just use IN
@halcyon hornet not clear; which use case are we talking about here?
We have a shop a user can use resources to create other items to sell at profit.
We have a check if the value is <0, but if they put something >0 in first then remove it after so the data is say -1 it doesn't realise
The result is they can make free money
oooh here is a hard question is there a fnc to run like cursor target that will give the info on the position and part of a object itself not the whole object but referenced to the objects center point for like 'attachTo' or a means to do such.
@halcyon hornet then either save the first input and don't deal the next ones, or check on each input, or block the field once it is filled
@bright flume I… didn't get any of that
hello fellow armaholics,today i have a question regarding marker creation.i call this here ```sqf
params ["_text","_markerPos"];
_marker = createMarker [_text,_markerPos];
_marker setMarkerShape "ELLIPSE";
_marker setMarkerSize [80,80];
_marker setMarkerColor "ColorGreen";
_marker setMarkerAlpha 0.5;
_marker setMarkerBrush "Solid";
_StringText = (format ["%1 ",_text]);
_marker setMarkerText _StringText;
diag_log format ["created marker,name : (%1), position (%2), with string text (%3)",_text,_markerPos,_StringText];```with params ["text(string)",[po,si,tion]]call that_fnc_function.but it doesnt print the markertest when looking at the map,any ideas?
@winter rose I'm not great with SQF, this is what my friend has put together so far: https://pastebin.com/psgPCsd2
Lines 28-35 have some checks, what is the easiest way to build on that with a check for a - anywhere in the values input?
lemme look up the fnc Im refering to
@sturdy cape The script works fine, but marker text is not supported when type ELLIPSE is used.
cursorTarget, while looking at something get the objects 'refernce' of a position on it. like if Im looking at the wingtip get the 'attachTo' point for where my cursor is looking.
@cosmic lichen thanks.who wouldve thought that^^
so this basically solves my problem```sqf
params ["_text","_markerPos"];
_marker = createMarker [_text,_markerPos];
_marker setMarkerShape "ELLIPSE";
_marker setMarkerSize [80,80];
_marker setMarkerColor "ColorGreen";
_marker setMarkerAlpha 0.5;
_marker setMarkerBrush "Solid";
_marker2 = createMarker [_text,_markerPos];
_marker2 setMarkerShape "ICON";
_marker2 setMarkerSize [80,80];
_marker2 setMarkerColor "ColorBlack";
_marker2 setMarkerAlpha 0.8;
_StringText = (format ["%1 ",_text]);
_marker2 setMarkerText _StringText;
diag_log format ["created marker,name : (%1), position (%2), with string text (%3)",_text,_markerPos,_StringText];```
How does one keep modules synchronized through a respawn or a join in progress?
I've got both high command and support modules that need to remain synchronized, or be resynchronized after a respawn.
@halcyon hornet these checks, while redundants, seem ok
but I don't know what parse_number is ¯_(ツ)_/¯
Lou did you understand what I meant now? think its maybe the 'offset' for attachTo? not sure..
not an easy way (you could do a center screen /selection distance check but…)
what are you trying to do?
know simply exactly where to attach 'anything' by maybe running small console script so can then code like an init/addaction attachTo
like eg look at the top of a plane wing and know exactly what data I need to attach at that spot Im looking at..
hmmmm maybe take object, then use surfacenormal... for the offset 🤔
surfaceNormal - a normal to the intersected surface
is detecting # of frames spent to perform a scheduled function with diag_frameNo a reasonable way to performance-test scheduled code?
Are the results from that more accurate or is there some other reason?
Looks like diag_codePerformance is unscheduled, and I want to test scheduled code in-game
I basically want to know how much I'm actually saturating the scheduler
Hi guys , i'm probably just over tired , but I am getting this error and I do not know why
_wp1 = _groupAlpha1 |*|addwaypoint ["marker_2",-1];
Error 0 elements provided, 3 expected
_arrAlpha = [eA1_0,eA1_1,eA1_2,eA1_3,eA1_4,eA1_5,eA1_6,eA1_7];
_arrBravo = [eB1_0,eB1_1,eB1_2,eB1_3,eB1_4,eB1_5,eB1_6,eB1_7];
_arrCharlie = [eC1_0,eC1_1,eC1_2,eC1_3,eC1_4,eC1_5,eC1_6,eC1_7];
_groupAlpha1 = createGroup east;
_groupBravo1 = createGroup east;
_groupCharlie1 = createGroup east;
{_groupAlpha1 createUnit ["O_SoldierU_F",_x, [], 0, "FORM"]} forEach _arrAlpha;
{_groupBravo1 createUnit ["O_Soldier_F",_x, [], 0, "FORM"]} forEach _arrBravo;
{_groupCharlie1 createUnit ["O_SoldierU_F",_x, [], 0, "FORM"]} forEach _arrCharlie;
_wp1 = _groupAlpha1 addwaypoint ["marker_2",-1];
_wp2 = _groupBravo1 addwaypoint ["wpBravo",-1];
_wp3 = _groupCharlie1 addwaypoint ["wpCharlie",-1];
_wp1 setwaypointtype "MOVE";
_wp1 setWaypointCompletionRadius 10;
_wp1 setWaypointSpeed "FULL";
_wp1 setWaypointBehaviour "AWARE";
_wp2 setwaypointtype "MOVE";
_wp2 setWaypointCompletionRadius 10;
_wp2 setWaypointSpeed "FULL";
_wp2 setWaypointBehaviour "AWARE";
_wp3 setwaypointtype "MOVE";
_wp3 setWaypointCompletionRadius 10;
_wp3 setWaypointSpeed "FULL";
_wp3 setWaypointBehaviour "AWARE";
and this is the full script , can anyone please help
If you're using markers, use the getMarkerPos command to retrieve marker position.
Hi, I'm looking to have a marker move over the map directly to it's given destination, I've been looking into using Bresenhams line algorithm however haven't been able to properly implement it, I currently am using this setup but whilst updating my framework to allow markers to be generated it's broken. I was wondering if anyone could take a look at it, possibly suggest a solution or alternative?
Assume _targetpos is [100,100,0] and _unit to be the name of the marker.
_targetY = round (_targetpos select 1);
_currentX = [getMarkerPos _unit] select 0;
_currentX = round (_currentX select 0);
_currentY = [getMarkerPos _unit] select 0;
_currentY = round (_currenty select 1);
_tX = ( _targetX - _currentX );
_tY = ( _targetY -_currentY );
_dist = sqrt (_tX*_tx+_ty*_ty);
if (_dist >= 1) then {
_velX = (_tX/_dist)*_speed;
_velY = (_tY/_dist)*_speed;
_unit setMarkerPos [_currentX+_velX,_currentY+_velY];
uisleep (0.3/timescale);};```
@normal abyss please use
```sqf
code
```
for code, for one your snippet is hard to read, second colored highlighting can show syntax errors, third your code doesn't even display correctly and some characters disappeared
@vague geode
Can you tell my how i can script an eventhandler for an "targeted sector changed" or "fast travel requested" event?
I would expect warlords itself to already have such a eventhandler. But I don't know its name, and I don't have time to look either.
@winter rose
use https://community.bistudio.com/wiki/BIS_fnc_codePerformance instead
Doesn't work with scheduled, its unscheduled.
@mortal wigeon
is detecting # of frames spent to perform a scheduled function with diag_frameNo a reasonable way to performance-test scheduled code?
There is no reasonable way at all to performance test scheduled code. The execution speed of your code literally depends on everything else thats going on.
@gilded rover
_groupAlpha1 addwaypoint ["marker_2",-1];
That syntax doesn't exist, addWaypoint doesn't take a marker name as argument.
See
https://community.bistudio.com/wiki/addWaypoint
@still forum (double post)
Discord double post :U
no u
😢
(I noticed this issue happen mostly on mobile with bad network… but I suppose you use desktop here)
Discord just had a API outage
Derp a La Net Burp'n
@winter rose the checks are not redundant, because people used to exploit by putting in a value less than 0 e.g. -1 which would give them money for free. We fixed with a <0 check but they still can work around it
If they type in "10-10" then before pressing ok take out the first 10 so it just reads as "-10" ArmA doesn't detect this as a negative number if it's actively listening
Arma*
then your "parse_number" function is wrong
you can also remove "-" from _amount_str by string operation
or use abs
@Dedmen Can you tell me where I can look up whether or not warlords already has such an eventhandler?
inside the warlords scripts
@still forum fixed the syntax , but still get the _wp1 = _groupAlpha1 |*|addWaypoint ["wpAlpha",-1]; Error 0 elements provided, 3 expected
wpAlpha is a gameLogic
no you didn't fix the syntax
okay? how must I write it then?🙈
if its a game logic then I assume you want
_groupAlpha1 addWaypoint [getPos wpAlpha, -1]
🤦 right , I should probably go back to bed , thank you kind sir
@winter rose is there some way to check what effect (Local / Global) have BIS function in wiki ?
Hi.
How do I add a weapon with an item without skipping the animation?
_unit addWeaponItem ["rhs_weap_hk416d10", ["rhs_mag_30Rnd_556x45_M855A1_Stanag", 1, "RH_cmore"]];
This command does not add weapons. I can't understand how it works.
you can read the code inside the function and assume if its local or global
This command does not add weapons. I can't understand how it works.
correct, it adds attachments to the weapon
add the weapon with addWeapon first, then add the attachments
@real tartan ^
check locality of function-used commands
I couldn't do it.
_unit addWeaponItem ["rhs_weap_hk416d10", ["rhs_mag_30Rnd_556x45_M855A1_Stanag", 1, "RH_cmore"]];```
The weapon adds, but the item does not.
"RH_cmore" that doesn't look like a muzzle
that looks like a scope, thats not correct
Yes, it's scope
just use the addWeaponItem main syntax, and add the mag and scope seperately
Heyyy all. I found these scripts written for an 'energy shield' thing online. They're all declaring "Player" as the variable to build the script around. I'm really not great at scripting at all. I actually got some sounds and particle effects to work in the script if I want, but I think that the logic isn't really salvageable to run it on an object that isn't the player. It was that person's very first script, but the hunger I have to get this working is real af.
Especially since I built some great VSTs for the soundFXs
There's another script that works on vehs I found that puts up some alright particle effects as well. I would just need to implement a timer into that one to recharge. I'm just outta step in parsing arma syntax
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
http://killzonekid.com/category/tutorials/
These may come in handy for you on your journey to learn SQF scripting.
yaaaa the scripting commands in the wiki is bookmarked right now
i'm going between learning dotnet and arma scripting right now XD
and ya i'll deff run some tutorials
those helped me to come in terms with the basic stuff
_unit addWeaponItem "RH_cmore";```
Right?
shield: http://snippi.com/s/m7d1c3precharge
recharge: http://snippi.com/s/f9580kztimer
timer: http://snippi.com/s/bvhhrj3
Are the scripts I was working on
links dont work
but in general you have to understand quite a lot in order to use/modify scripts made by others
ya it seems so. I have a lot of syntax work to do with Arma before I'll get there. Too many grammars i don't know
I turned them to text files. Just to share what I was talkin about. I'm gonna just build my own tho either way.
also someone made a script here that was more flexible without the recharge, incl some particle effects. This one seems interesting to me
https://forums.bohemia.net/forums/topic/223440-mbg-aliens-ground-forces/
It is possible have script conversion mission when I play in mission.sqm and after I edit this?
explain?
I play maybe Zeus and I wish save this, and export in editor.
You mean like, place stuff in Zeus and turn that into a mission?
Ah you want to save a zeus mission as actual mission
thats somewhat possible, you can save it as a sqf script
Ares or mcc sandbox (don't remember which one) have an export to sqm function. You can copy it over to a notepad, import it later when your out of the mission
thats somewhat possible, you can save it as a sqf script yes I wish this
Ares or mcc sandbox (don't remember which one) have an export to sqm function. You can copy it over to a notepad, import it later when your out of the mission it i not wish use Ares or mcc it is possible do in script?
Afaik Arma itself has a script function to do it
You mean copyToClipboard? yes
I only know of BIS_fnc_3DENExportSQF, but that works in 3den only
https://community.bistudio.com/wiki/copyToClipboard
⚠
In MP available only on the client that is server
one (very) raw implementation:
private _data = (allMissionObjects "All") apply { [typeOf _x, getPosATL _x, [vectorDir _x, vectorUp _x]] };
copyToClipboard str _data;
or just use diag_log and have it in the .rpt?
even better!
Yeah, no hustle with the clipboard needed
restoration:
{
params ["_type", "_posATL", "_vectors"];
private _object = createVehicle [_type, _posATL];
_object setPosATL _posATL;
_object setVectorDirAndUp _vectors;
} forEach _data;
Okey if it hard. If I use Ares, it is possible activation modules zeus in script if I not zeus?
@winter rose restoration i can edit this after in 3DEN?
no
as I said, it is a very raw implementation, and would grab all items in the game, including dropped weapons, tyre tracks etc
it is not a working code
I'm trying to create a RWR like interface for the F-18 backseater which shall allow jamming of AA radars at first. The placement of the AA however fails, I would like to place it where it is in relation to the plane. I tried to get the vector from jammer(F-18) to AA via: (getPos _jammer) vectorFromTo (getPos _x); and then use that to place a text for the AA on a dialog. Code for the function is here: https://pastebin.ubuntu.com/p/Nmqj47GhTj/
while the AA text moves around the screen, it is not in relation to the heading of the plane
something I seem to miss with grabbing the vector and applying it to the text position
@round scroll you are grabbing the vector from plane to AA in a world reference, you also have to "subtract" the current plane vector
maybe vectorDiff but I am not good in 3D calculations, I try'n'error
something like ((getPos _jammer) vectorFromTo (getPos _x)) vectorDiff (getPos _jammer) I guess
thanks, I try that
I'm trying to detect if a grenade of a certain type is near an object, but the problem is that when the grenade is thrown, it has a different set of numbers before it (2900272: ka_m814_ammo.p3d, for example). I'm using this code to check for it in the debug console at the moment: doubletap nearObjects ["GrenadeHand", 5], but I'm struggling to execute code when it detects it. Here's what i've come up with ```sqf
checkDoubletap == "true";
while {checkDoubletap == "true"} do {
{
if (_x == "ka_m814_ammo.p3d") then
{
[doubletap, false] remoteExec ["hideObjectGlobal", 2];
checkDoubletap = "false";
};
} forEach doubletap nearObjects ["GrenadeHand", 5];
};
if anyone knows how to fix this or has any suggestions please let me know
"false" do you know that we have real booleans true and false too?
yea, my mistake
_x == nearObjects returns objects, not strings. Comparing an object with a string always returns false as they are different types
I think you'd want to check the classname typeOf of the object _x
typeOf 2900234: ka_m814_ammo.p3d this is getting a "missing ;" i presume it's the : causing the problem?
2900234: ka_m814_ammo.p3d This is a reference to an object. Did you store that as string?
oh yeah, you did.
here's the code I have now
checkDoubletap == "true";
while {checkDoubletap == "true"} do {
{checkType = typeOf _x;
if (checkType == "ka_m814_ammo.p3d") then
{
[doubletap, false] remoteExec ["hideObjectGlobal", 2];
checkDoubletap = "false";
};
} forEach doubletap nearObjects ["GrenadeHand", 5];
};
First line is wrong
TAG_checkDoubletap = true;
while {TAG_checkDoubletap} do
{
{
TAG_checkType = typeOf _x;
if (TAG_checkType == SOMECLASSNAME) then
{
[TAG_doubletap, false] remoteExec ["hideObjectGlobal", 2];
TAG_checkDoubletap = false;
};
} forEach (TAG_doubletap nearObjects ["GrenadeHand", 5]);
sleep 0.01;//Might want to add some sleep here, depending on what you wanna do
};```
replace the SOMECLASSNAME with an actual vehicle class.
and replace TAG with a unique tag like BFTTG
so how would i find the classname of this 2900272: ka_m814_ammo.p3d, as typeOf wasn't working
What does typeOf return?
typeOf 2900234: ka_m814_ammo.p3d returns a missing ;
Was does TAG_checkType return?
Are you sure that TAG_doubletap nearObjects ["GrenadeHand", 5]; actually returns stuff?
Would have been my next question.
says there's a generic error in expression there
changed it to just doubletap for the object name
doubletap nearObjects ["GrenadeHand", 5]; this however in the debug console returns the grenade
Yeah
Put that in brackets
forEach (doubletap nearObjects ["GrenadeHand", 5]);```
no errors, but the code isn't doing what it's supposed to (reveal the object)
i cant find the classname of the grenade though. Would it be in the CfgVehicles file?
more of a CfgAmmo
ok, i'll have a look
Is hideObjectGlobal supposed to show TAG_doubletap ?
I guess it should show what's stored in _x
Ic
this is the current code:
BEN_checkDoubletap = true;
while {BEN_checkDoubletap} do
{
{
BEN_checkType = typeOf _x;
if (BEN_checkType == "KA_M814") then
{
[doubletap, false] remoteExec ["hideObjectGlobal", 2];
BEN_checkDoubletap = false;
};
} forEach (doubletap nearObjects ["GrenadeHand", 5]);
};
the object is not appearing
Missing quotes in line 6
still not appearing
Guess nearObjects is not returning the right thing, or typeOf doesn't return the class name.
BEN_checkType is not returning anything
What does sqf doubletap nearObjects ["GrenadeHand", 5]return?
nearObects returns this 2900272: ka_m814_ammo.p3d the numbers at the start are always different
So it returns the right object, but typeOf can't find the class name.
according to the wiki, the things after forEach shouldn't be in brackets?
should the while loop be inside the forEach? i dunno, just gonna throw things out there
So I just tested your code and it returns the grenades fine
I guess something is wrong with that modded grenade.
what code did you use, as in classnames and grenades
"mini_Grenade"
i just tested with replacing the classname with yours, and doesn't appear for me
What would be the best solution to combine these array numbers in the following way: SQF _array = [["string",5],["another",1],["another",2],["string",2]] ---> [["string",7],["another",3]]
iterate through all and add them up @tough abyss
isn't there a BIS fnc that does that though?
What would be the FASTEST way?
depends on how many of those you have
do not optimize premature btw.
no need to make things complicated for no reason
I guess sort them first and check if next string is the the next in order
It could be over 100 elements
There is this: https://community.bistudio.com/wiki/BIS_fnc_consolidateArray
Will not help him much
YES that was what I was also searching for but couldnt remember the name of 😆
@distant oyster I went through the Array Functions group after you posted yours, so thanks ^^
Thanks!
@cosmic lichen any ideas of the problem?
@ornate marsh sqf BEN_checkDoubletap = true; [] spawn { while {BEN_checkDoubletap} do { hintSilent "Loop Started"; { systemChat format ["Detected Grenade: %1",typeOf _x]; if (typeOf _x == "mini_Grenade") exitWith { [BEN_doubletap, false] remoteExec ["hideObjectGlobal", 2]; BEN_checkDoubletap = false; hintSilent "Loop exited. Object is visible now."; }; } forEach (BEN_doubletap nearObjects ["GrenadeHand", 50]); }; };
Works now
Not sure what the issue was.
i'll test it with the modded grenade
Sure
works, thank you for your help
So lookAt doesn't work to make a tracked vehicle face a certain direction, any other ideas?
I can't even find a way to give turn left/right command to driver
…
Looks like I can't execute input actions on AI like driver cursorObject action ["CommandLeft", cursorObject]
it doesn't recognize enum for any of the turn input actions
oh when I say face a certain direction I mean turn the vehicle not the turret
setFormDir does not work.
Oh I forgot about it, are you saying it doesn't, or asking if I tried it?
anyway i will try it
parse_number = { private ["_number"]; _number = _this select 0; if (isNil "_number") exitWith {0}; if (typeName _number == "SCALAR") exitWith {_number}; if (typeName _number != "STRING") exitWith {0}; _number = parseNumber(_number); if (isNil "_number") exitWith {0}; if (typeName _number != "SCALAR") exitWith {0}; _number };
What would I need to add to this to check for a - in the input?
@ebon ridge tried, it does not
ah damn thanks for checking it
@halcyon hornet just parseNumber
also,
```sqf
/* your code */
```
@halcyon hornet
parseNumber "10-10" // returns 10
so what is your issue with it?
@ebon ridge is setDir + setFormDir out of question?
nah not out of the question just not preferred
i will use it if i can't find another way
@halcyon hornet
- don't use private array, use the private keyword like
private _number = - use params to get values from _this
- use isEqualType instead of typeName
- use
into check if string contains -?
it seems something pretty damn important to not be scriptable via standard commands, armor difference on vehicle is very big on different sides
private _originalDir = getDir _tank;
for "_i" from 0 to 44 do {
sleep 0.1;
_tank setDir (_originalDir + _i);
};
``` 😋 😅
Is there an bis/CBA function of getDir, which works similar to getPos from CBA and works with (almost) all types of input?
"getPos from CBA" 🤔
@distant egret what do you need?
Something that works for markers and objects at the same time mainly.
Like getPos
From CBA
I don't know "getPos from CBA"
you can cook something yourself that covers getMarkerDir/getDir
Oh getPos from CBA basically does all types of getPos in one function.
So marker, location, object ect.
@still forum how does in work? Would this work?
if ( "-" in _number) exitWith {0};
_getStuffDir = {
params [["_stuff", "", ["", objNull]]];
if (_stuff == "") exitWith {};
if (_stuff isEqualType "") exitWith { markerDir _stuff; };
getDir _stuff;
};
``` @distant egret
Was only checking if CBA made one before reinventing the wheel.
Looks like I need to invent the wheel here. 😅
if (_stuff == "") exitWith {}; doesn't that give type mismatch error if _stuff isn't a string?
should be isEqualTo instead
hello beautiful people >_>
how do i clear all the pylons on a plane and replace it with something?
this removeWeaponGlobal "weapon_AGM_65Launcher";
this removeWeaponGlobal "missiles_ASRAAM";
this removeWeaponGlobal "GBU12BombLauncher";
this removeWeaponGlobal "GBU12BombLauncher";
this removeWeaponGlobal "Bomb_04_Plane_CAS_01_F";
this removeWeaponGlobal "missiles_SCALPEL";
doesnt seem to do much
So what about scan horizon? Is there an sqf command for that? Seems like there isn't...
all good, glad to help
Using playSound3D in a script, if I'm using a sound file located in an addon file (pbo) do I need to set up any configs or sound files in description.ext?
if the sound doesn't already have a CfgSounds entry, you need to create one in description.ext
Banging my head against the wall here - subtasks do not appear in the right order, no matter what task ID i give them
any advice?
got you, and I'm curious, when I set the sound volume in description.ext, will using playsound3d still allow me to change the volume?
@spark rose iirc, they appear in the order they are created
and task id doesn't have anything with order, it is only used as an identifier.
@old adder yes
ty @still forum @winter rose
they appear in the order they're created...i have them all created at mission start so...i'm not sure how to fix that
how do you create them? scripting or modules?
modules
So I'm getting this error in A2 at the moment
is_prone = {
private ["_unit", "_return", "_check"];
_unit = _this select 0;
_return = false;
_check = (_unit selectionPosition "neck" select 2);
if (_check <= 0.5) then { _return = true; } else { _return = false; };
_return;
};
is_facing = {
private ["_unit1", "_unit2", "_return"];
_unit1 = _this select 0;
_unit2 = _this select 1;
_return = [getpos _unit1, getdir _unit1, 45, getpos _unit2] call BIS_fnc_inAngleSector;
_return;
};
is_frontback = {
private ["_unit1", "_unit2", "_return", "_check"];
_unit1 = _this select 0;
_unit2 = _this select 1;
_return = "";
_check = [getpos _unit2, getdir _unit2, 180, getpos _unit1] call BIS_fnc_inAngleSector;
if (_check) then {
_return = "front";
} else {
_return = "back";
};
_return;
};
Can't see where it's giving up?
@halcyon hornet can u show code where you are calling is_frontback
@halcyon hornet I don't know too much but is BIS_fnc_inAngleSector not an arma 3 function? I didn't see it on the arma 2 bis functions list
Oh that's a RIP
So I have respawn on custom positions enabled , and respawn menu (to choose where to spawn) , but when i spawn in (just chose my unit and clicked continue on the briefing) MP I get dropped in the bottom left corner of the map.
any ideas?
myRespawn1 = [west,"res1"] call BIS_fnc_addRespawnPosition;
squadRespawnGroup = [west,"grp_lead"] call BIS_fnc_addRespawnPosition;
squadRespawnMedic = [west,"grpMedic"] call BIS_fnc_addRespawnPosition;
Thanks 🤦♂️
np, gl
also is this missionNamespace just a fancy name for global variable?
Is there an A2 equivalent for the function?
@spark rose theeen maybe the order of module insertion in Eden, I don't know 😐
?
@halcyon hornet BIS_fnc_sceneGetPositionByAngle could work if you make your own check to compare to the returned coordinates from the function
Check around on https://community.bistudio.com/wiki/Category:Arma_2:_Functions
Hey, I'm currently working on a script to create some flashing lightpoints, the current method I'm using is setting the brightness to 0, using uiSleep, then setting brightness back up. Anyone know if theres a more resourceful method?
`private _flashes = 20;
while {_flashes > 0} do
{
_light setLightBrightness 0;
uiSleep 0.5;
_light setLightBrightness 0.8;
uiSleep 0.5;
_flashes = _flashes - 1;
};
`
There are several flashlights in 3rd party mods, like ACE/6PDP etc, which made as handguns, and can be turned on by hitting "L". Is there any way to switch it via a script, and check if it is on? I tried stock commands like isFlashlightOn, but it didn't work.
@old adder one thing would be using a for loop https://community.bistudio.com/wiki/for
@surreal peak ohh did not realize you could use increment/decrement steps in for loops in arma. That'll probably make the script a bit better. Thanks
@spark rose I second what Lou says. The last created Diary module entry is added as the first briefing entry. You can fudge it by setting the module to "synchronized units only" and then synchronizing them in the desired order to the player units. But that might cause a repetitive strain injury.. I recommend you look up a guide on writing out a briefing script and starting it from init.sqf or initplayerlocal.sqf . Physiotherapists are hard to come by (!)
How do I get a named object's ownerID?
I have a headless client named HC1. Is there a way to just page it using that variable name and get its ownerID?
I am sure you have been asked this before, but how simple would it be to use this setObjectTexture [1, "\pboname\texture2.paa"];
To turn a static object completely silver
Specifically the tanoa castle towers
Using this setObjectTextureGlobal [1, "#(rgb,192,192,192)color(1,1,1,1)"]; didnt really do anything
about never
the tanoa castle towers have no hiddenselections which is a way to mark textures that can be edited and retextured either by a mod or the code above
thats what that first 1 means, its the number for the object selection based on the amount it has (starting from 0)
but to put it shortly
no you can't do that with the tanoa castle
I will go ahead and guess that same applies to most static objects? like rock formations
yes
correct
to know which object has an hiddenselecion open it in config viewer and search for the hiddenselection
if it has something like camo1, camo2 etc it means it has them
but for rocks I wouldn't bother to look
Alright, thank you for the help
hopefully one day BI will release samples
hello folks i'm back with dumb questions
so uh
i'd like to make a prop that when you walk up to it, will give you action to spawn a jet of your choice in the air and automatically put you in the pilot seat
preferably with pylon loadouts that i can config before hand
how should i go about this?
Is there a way via script to detect a string in a chat channel? e.g. if a player types "ELEV 84.5" in chat, I could elevate a gun to 84.5
is there a reverse function to BIS_fnc_colorRGBtoHTML ? Or maybe some convertor color to RGB values for color of particles ? Searching for common colors of BIS smoke grenades.
last i looked there was not a BIS function for html to rgb, this is how I did it
_params = ["AA","RR","GG","BB"] or ["RR","GG","BB"]
https://github.com/ConnorAU/A3ColorPicker/blob/master/addon/system.sqf#L304-L315
let's say i want to delete a bullet so if someone shoot it will not hit or kill anyone/anything, what is the best path?
ok i figured this out but this will only tell me he shot, how do i prevent the bullet to do any damage?
just assign nil to the projectile object?
_projectile is the bullet object, so you can either change its velocity or delete it outright to stop it dealing damage.
deletevehicle _projectile;
mmh i see, the "vehicle" part of the command is misleading
as it deletes objects in general, not just vehicles
Is it possible to use the real time in a mission's init.sgf to set the mission start time to the real time?
@gilded rover remove the quotation marks ""
@robust hollow if it's not in the CBA i'd suggest to make a push request to add it as it seems both useful and generic enough for the project consideration
@gilded rover remove the quotation marks ""
@harsh vine was more complex than that , quotation marks need to stay , but this idiot (me) forgot respawn delay , and that's why it didn't work. but thanks for replying
hehe sometimes we forget the most basic stuff ...
@flat elbow Vehicles for game engine is not equalto vehicles in common sense. I.e., in BF2 a ladder is the vehicle, etc. So often it's all that can move, but not a player 🙂
@vague geode only in MP with missionStart (I think)
I know that you can change the mission start time but is it possible to somehow get the real time to set the mission start time to said realtime?
see my message above
only in MP with
missionStart(I think)
uh... so I'm pretty sure there was a neat way to get the parent class of some object and I can't remember how
say I have typeOf cursorTarget and that's some quadbike or something
all I can find is inheritsFrom, but that wants an actual config class, not just the class name
oh, true
I'm 99% sure there was some command to do this with just the class name
without having to do configFile >> "cfgVehicles" >> (typeOf ...)
which is a pain to type
doesn't ring a bell, unfortunately
@vague geode figured it out?
Hey friends. Working on scripting a task using MPEventHandler and a global variable. Running into some issues.
InitServer: deadassets = 0; publicVariable "deadassets"; Object init:this addMPEventHandler ["MPKilled", {if (isServer) exitwith{deadassets = deadassets + 1; publicVariable "deadassets"};}]; Trigger (server only) condition:deadassets >= 6 I have found that the eventhandler is triggering multiple times on dedicated, adding 1 for each client. What am i missing?
Event handler is added for every client joining the mission because object init is executed for every client joining the mission
So on A2 I have the following code:
check_supporter_items = {
private["_pWeps", "_supWepArray", "_vipWepArray"];
_vipWepArray = ["AKS_74_GOSHAWK", "BAF_L85A2_RIS_CWS", "FN_FAL_ANPVS4", "m107", "m8_tws", "m8_tws_sd", "MetisLauncher", "STRELA", "Javelin"];
_supWepArray = ["Pecheneg","MG36","MG36_camo","ksvk","SVD_NSPU_EP1", "M110_NVG_EP1", "BAF_AS50_scoped", "AKS_74_NSPU","bizon_silenced", "Igla", "Stinger"];
_pWeps = currentWeapon player;
if(!isVip) then {
if(_x == _pWeps) then {
[player, 10] call jail_player_punish;
}; count _vipWepArray;
};
if(!isSup) then {
{
if(_x == _pWeps) then {
[player, 5] call jail_player_punish;
};
} count _supWepArray;
};
};
With output error it's saying undefined variable in there
But unless I'm blind there isnt?
which line is it complaining about?
where are you defining isVIP and isSup
From database
if (_uid in supportersVIP_list) then {
supportersVIP = true;
["SERVER",[player,player,"supportersVIP",true],"s_whitelist_add",false,false]call network_MPExec;
player sideChat "WhiteList Set VIP";
};
isSup = (supporters1 || supporters2 || supporters3 || supporters4 || supportersVIP);
isVip = supportersVIP;
how can I know if an object is going to collide to another object?
are the databases full Caster?
it goes "bump" @flat elbow
bump?
@flat elbow you gonna have to elaborate on that one
ok so basically i have a training field, AIs will shoot at people that must move inside a pathway
i want the shots to land near them to scare them but not to kill them so i will attach an event handler and i have the projectile object
@winter rose Yeah, I think I misunderstood you at first. Thanks for the help.
i want to delete the projectile object if it's going to hit the player, otherwise not
why? you can use handleDamage EH to avoid player damage from specific units?
and if you dont wana do that, you will have to do math
(and I don't like math)
Also Lou do you have a solution for casper? I cant think what the problem is
(well, math doesn't like me)
wait handleDamage will only tell me if the person was damaged right?
@halcyon hornet are the databases full? if none of them have anything the variable wont be a thing IIRC
@unique sundial ah idk how I missed that. Fixxed it with a simple server check wrapped around the init. Ty
@halcyon hornet
if (_uid in supportersVIP_list) then {
supportersVIP = true; // <- not set to false anywhere!
(...)
}
@winter rose just saw that a min ago 🤦♂️ , adding an else check now 🙂
oh i can return the damage amount
yes, set to "same amount" if shooter is x or y, or let it process for normal damage
mmh sounds like a good solution, but now i want to know about the other way to personal knowledge, how do you get the bullet vector?
velocity _bullet from Fired EH
oh so velocity is actually a vector returning
yup, in world coordinates
So i've updated the whitelist to this:
if (_uid in supportersVIP_list) then {
supportersVIP = true;
["SERVER",[player,player,"supportersVIP",true],"s_whitelist_add",false,false]call network_MPExec;
player sideChat "WhiteList Set VIP";
else{
supportersVIP = false;
};
};
But it's still giving the same error
if (_uid in supportersVIP_list) then {
supportersVIP = true;
["SERVER",[player,player,"supportersVIP",true],"s_whitelist_add",false,false]call network_MPExec;
player sideChat "WhiteList Set VIP";
} else{
supportersVIP = false;
};
you saw nothing
try that
missing } yep
if () then
{
//something
} else {
//something else
};
🤦♂️
Use editor with highllighting parentheses :)@surreal peak
@Caseter*?
@unreal scroll I was correcting him 😄
yet you had one } too much too :3
Yes, but there is an extra } at the end
Still giving the same error
@unreal scroll Visual Studio Code does, I'm just blind apparently
visual studio works with sqf?
There is an extension for it
ah nice, ty
In your case it highlights it ok, there is a just syntax error.
Armitxes made the extension for Visual Studio, it's quite nice
So I'm still getting this: https://i.gyazo.com/9e43bbc9b7c85458c487fe9c0cde307d.png
what does your whole code look like?
if (_uid in supportersVIP_list) then {
supportersVIP = true;
["SERVER",[player,player,"supportersVIP",true],"s_whitelist_add",false,false]call network_MPExec;
player sideChat "WhiteList Set VIP";
} else {
supportersVIP = false;
};
isSup = (supporters1 || supporters2 || supporters3 || supporters4 || supportersVIP);
if (supporterVIP = true) then {
isVIP = true;
} else {
isVIP = false;
};
That's the whitelist check
This is the supporter check with the issue:
check_supporter_items = {
private["_pWeps", "_supWepArray", "_vipWepArray"];
_vipWepArray = ["AKS_74_GOSHAWK", "BAF_L85A2_RIS_CWS", "FN_FAL_ANPVS4", "m107", "m8_tws", "m8_tws_sd", "MetisLauncher", "STRELA", "Javelin"];
_supWepArray = ["Pecheneg","MG36","MG36_camo","ksvk","SVD_NSPU_EP1", "M110_NVG_EP1", "BAF_AS50_scoped", "AKS_74_NSPU","bizon_silenced", "Igla", "Stinger"];
_pWeps = currentWeapon player;
if(!isVip) then {
if(["_TWS", _pWeps] call KK_fnc_inString) then {
[player, 10] call jail_player_punish;
}
else{
{
if(_x == _pWeps) then {
[player, 10] call jail_player_punish;
};
} count _vipWepArray;
};
};
if(!isSup) then {
{
if(_x == _pWeps) then {
[player, 5] call jail_player_punish;
};
} count _supWepArray;
};
};
Did you published the isVip global variable?
if(["_TWS", _pWeps] call KK_fnc_inString) then {
[player, 10] call jail_player_punish;
}
else{```
What is that syntax? Bring it to the readable view.
Which syntax?
if (["_TWS", _pWeps] call KK_fnc_inString) then {
[player, 10] call jail_player_punish;
} else {
{
if (_x isEqualTo _pWeps) then {
[player, 10] call jail_player_punish;
};
} count _vipWepArray;
};
};
if (!isSup) then {
{
if (_x isEqualTo _pWeps) then {
[player, 5] call jail_player_punish;
};
} count _supWepArray;
};
What are you counting that values for? What your function should return?
Or the return value for check_supporter_items should be boolean?
Also I don't see defining _TWS variable.
That is using KK's script, it's checking _pWeps for any guns that are TWS. It's futher up in code but is there
If the _TWS variable not defined, then you should get an error, of course. It is the local variable.
Then, define the isVip veriable, and publish it.
Then, what the jail_player_punish function returns? My intuition says that it should do something, and not count anything - but in else you count the array elements. Then, you count another array elements again.
So, your check_supporter_items functions will return something that jail_player_punish returns in the last part, or int (array count).
The TWS part is exactly how it should be based off KK's blog
How to use:
_found = ["needle", "Needle in Haystack"] call KK_fnc_inString;
*/
We're searching for "_TWS" in a gun class
And isVIP is defined:
if (_uid in supportersVIP_list) then {
supportersVIP = true;
["SERVER",[player,player,"supportersVIP",true],"s_whitelist_add",false,false]call network_MPExec;
player sideChat "WhiteList Set VIP";
} else {
supportersVIP = false;
};
Ah, ok, it is just a parameter.
network_MPExec - is this a standard A2 library function?
nope
This is my trying to fix loads of bugs on an old A2 mission, so lots of stuff wrong in it
Any ideas why the AI driving almost always takes a weird route when first starting driving? They never just go in a straight line but swerve around invisible objects before setting off straight. I can provide video but hopefully this is common knowledge.
they need to find a "connection" to normal road driving I suppose.
ah yeah okay makes sense
Also I noticed they seems to serve to hit objects more often than avoid them, not sure if its confirmation bias, but really some cases are ridiculous. Pedestrian standing still on side walk, car drives by and swerves off the road to hit them, then carries on. Its extra hilarious when they hit them, drive forward, and then reverse back and forward a few times to really make sure they are dead 😄
if you placed civilians on both sides, they try to take extra distance from one and go hit the other
any way, they are confused when there are (some) obstacles near the road
(but maybe they hated that guy, too)
Need abit of help, im trying to make an intro where the player has cinematic bars and cannot have an input until the bars have gone does anyone have a know how?
yes
check https://community.bistudio.com/wiki/Camera_Tutorial
@silver mauve 😉
_camera = "camera" camCreate [0, 0, 0];
_camera camPrepareTarget player;
_camera camPrepareRelPos [0, -5, 10];
_camera cameraEffect ["internal", "back"];
_camera camCommitPrepared 0;
waitUntil { camCommitted _camera };
_camera camPrepareRelPos [90, 25, 8];
_camera camCommitPrepared 5;
waitUntil { camCommitted _camera };
_camera camPrepareRelPos [-90, -5, 5];
_camera camCommitPrepared 3;
waitUntil { camCommitted _camera };
sleep 3;
_camera cameraEffect ["terminate", "back"];
camDestroy _camera;
so i would just put this in a trigger? @winter rose
I was gonna forget about the no input and just have black bars and make the unit have no ammo. Like this
[1, 2, true, true ] call BIS_fnc_cinemaBorder;
but i want the border to not fade out and to fade out at a different trigger
Hello Im trying to add an action where you hold enter or some other button and it makes an ai move ive got this but an error message comes up can anyone help me out?
@hollow cloak i suggest downloading https://code.visualstudio.com/ it will help you visually see your code and makes the job alot easier on the eyes
Ok will do now 🙂
What is the SQF extension @silver mauve
Oh I think ive found it @silver mauve
Does anyone know what I have done wrong
no comma at [] // Arguments passed to the script
exactly as the error says...
"error at line 12" so it's either there or in front of it
Oh thank you my bad Did miss that thanks 🙂
Is their any way to make a mission script compatible with Zeus ? Like when the mission spawn the ia i can interact with them ? Or if it's not possible to make an existing one compatible, how can I make it myself or if they are existing one
Ty 😁
https://community.bistudio.com/wiki/isDLCAvailable
Available does it mean that the player owns it?
test it, compare it against getDLCs << does tell ya could just use that...
@astral tendon https://community.bistudio.com/wiki/getDLCs
there a list of all valid class names for https://community.bistudio.com/wiki/ctrlCreate 's first arguement? R3vo just repo'd that ticket so is ctrlEdit a valid name or is it invalid and being allowed?
@bright flume You are right, not all of them are supported. I need my coffee first 😄 I delete the ticket from #arma3_feedback_tracker
nah it is broken and def freezes your arma up. if its not valid then its broken in that sense its even allowing it
the wiki page for ctrlCreate only has a partial list why I was asking if there a complete one somewhere.
@silver mauve no
@bright flume I believe that list is complete. KK updated it a while ago IIRC
well not sure... cuz Some of the common controls defined in main config that can be used with this command:
just to quote the wiki itself... kinda implies its not. that class is valid its referenced in... https://community.bistudio.com/wiki/Eden_Editor:_Configuring_User_Interface but not sure if that is the only place... I sure aint no A3 scripting guru to know any better 🙂 re: ctrlEdit class
I just think the ticket valid because it seems like a bug either way you look at it. which is basically what I commented saying on it. I think you were right to bring it up. #wiki could even maybe be needing some touchup on that too depending...
if anything something to easily and intentionally crash arma is bad.. 😦
is there a way to see which vehicles have a radar that can be turned on and off via setVehicleRadar?
or do I best create a 'radar' module and sync the units that have one against it manually or via script?
which would probably not work for Zeus
believe there something in the cfgvehicle if it has a radar or not.
Components->SensorsManagerComponent->Components->ActiveRadarSensorComponent->AirTarget?
but isn't the class naming a bit arbitrary
awesome! there's even isVehicleRadarOn, which I looked for already and couldn't find
yes, the reason for that is the radars were introduced in 1.70, I jumped to 1.72 to see additional commands added after patch
@winter rose thanks for your help with the vectors the other day, but I could not get it to work. In the end I used: ```sqf
// need a -90 degree offset due to orientation of screen coordinates
private _dir = ((_jammer getRelDir _x) - 90) % 360;
private _xcoord = 0.5 + _dist * ( cos _dir );
private _ycoord = 0.5 + _dist * ( sin _dir );
_txt ctrlSetPosition [_xcoord, _ycoord];
(This is worth a Category:Radar btw, I might do that)
if you only needed direction, that's the best way then ^^
yeah, the distance is determined by the state of the radar soon
if you don't mind the upside down plane not reporting "relative" direction 🙃
if you do silly things during your jamming mission, your fail 😄
oh I love doing inverted lockon shots
something I never got a good hold off, how bad is it to check with nearEntities every 5 seconds or so to detect potential radars in the area of my plane? ```sqf
private _listPossibleRadarObjects = _jammer nearEntities [["Air", "Land", "Ship"], js_jc_fa18_jammingDistance];
or do I better add a stacked init event handler on Air, Land, Ship and add the vehicle to some array I later consume?
for the Nimitz I converted the former to the latter, and it works mostly
if there are no spawns/respawns, grab them all once and use a distance check on said array
the stacked init eh should take care of spawns, or?
in the init eh, I'd check for listVehicleSensors and ActiveRadarSensorComponent and only add those
works unless the vehicle is modded and overwrites the whole init eh's
...was I a fool for thinking anything in the altis life codebase could maybe possibly be even remotely transactional?
yes.
I thought so
How am I getting this error @winter rose? "File RealRecoil\config.cpp, line 35: /cfgRecoils/:'.' encountered instead of '{'".
class CfgPatches
{
class RealRecoil
{
// Meta information for editor
name = "Real Recoil";
author = "Isaacdevil";
url = "";
// Minimum compatible version. When the game's version is lower, pop-up warning will appear when launching the game.
requiredVersion = 1.60;
// Required addons, used for setting load order.
// When any of the addons is missing, pop-up warning will appear when launching the game.
requiredAddons[] = { "A3_Functions_F", };
// List of objects (CfgVehicles classes) contained in the addon. Important also for Zeus content (units and groups) unlocking.
units[] = {};
// List of weapons (CfgWeapons classes) contained in the addon.
weapons[] = {};
};
};
class cfgRecoils
{
///PARAMETERS SYNTAX
// muzzleOuter[] = { Rightwards recoil limit, upwards recoil limit, horizontal recoil spread, vertical recoil spread };
// kickback[] = { Minimum backwards recoil, maximum backwards recoil };
// temporary = Amount of recoil being random ;
// permanent = Amount of recoil being permanent ;
/// NOTES
// 1) Multiply muzzleOuter values by 16 except for upwards recoil limit, multiply that by 32.
// 2) Replace temporary with permanent and then multiply it by 16.
// 3) For a version of a firearm with a different barrel length of its derivative, divide its velocity with the original gun's velocity and then multiply it by the new permanent value and the kickback values.
// 4) Determine permanent recoil for folded firearms by doubling permanent recoil compared to non-folded derivatives along with multiplying kickback values by 1 1/2
// THIS IS LINE 35
class 7.62x39MM AKM/74M FAMILY;
{
muzzleOuter[] = {4.8, 38.4, 4.8, 4.8};
kickBack[] = {0.03, 0.06};
permanent = 0.24;
}
Line 35 is on the bottom of this.
I should mention that the CfgPatches nor CfgRecoils classes have end brackets, its that my code is too long to be posted.
class 7.62x39MM AKM/74M FAMILY; there is the error
Is the semicolon the error? If it is, I found a couple of other mistakes for the {} brackets being mismatched and I think I fixed that too. I'll try it again @cosmic lichen.
Also, is it safe to overwrite a PBO with the same thing to replace it for fixing mistakes?
Talking about addon builder also.
I'm not sure if its better to delete the PBO and BIKEY to replace the config in it or not.
Actually @cosmic lichen, its not the error still. Not sure why.
Oh okay.
However, can I privately send you all the code because of it being too big on here (its not super big)?
Before I do that though, I'll proof-read it again.
You can use pastebin.com to paste the full code
Also, move this over to #arma3_config since it's not scripting related
hastebin.com FTW
Oh okay, and sorry. All good.
I only suggest hastebin because it dont need any form of info/data on ya and is as plaintext pasting as one can get.
Ah okay.
site dont even got ads.. lol I mean its plain jane.
am I the official SQF script support now 😅
gratz?
You are what ? 😄
IDK, everyone pings me for "hey @ Lou Montana do you have an idea for xx_otherguy_xx's problem?" or "yo @ Lou Montana, will this work?"
you are just our dad
Because Dedboomer isn't available anymore.
I want the SQFDad role!!
Yeah sorry Lou lol, I remembered you helping me and saw that you recently helped another lol
And that I didn't realise that the C++ language for configs was different to scripting in Arma haha
not that I mind helping, just that getting directly pinged is a recent trend apparently 😄
@everyone
Oh no xD
Should be disabled so far I know
I don't think it is xD
If not I am screwed
Oof
Actually never mind, yeah it should be since I didn't get pinned lol
I thought it worked because the tag was blue.
! purge ban 60y @cosmic lichen spam
How i can prevent players from accessing action menu?
hey , i try running this getArray (configfile >> "CfgMagazines" >> "30Rnd_556x45_Stanag") and somehow it returns me []. it used to work for me but now it doesn't, why is that?
no.
getText (configFile >> "CfgMagazines" >> "30Rnd_556x45_Stanag" >> "displayName");
How do I change the icon that a high command subordinate displays to the high command module user?
I don't understand either addGroupIcon or MARTA.
didn't you ask that earlier? I thought this was solved
Did I? Let me search. Sorry.
thank you
I have that page open already, I just don't understand it. It seems overly complex.
I'm not finding when I asked that question in the search history.
I liked it, too.
what don't you understand; setVariable?
How it all fits together. I have lots of trouble with syntax.
Which parts are essential, which can be ignored, where I put the code, etc.
the module and setGroupIconsVisible should be enough?
AH! Okay, so I place the module and put the code inside the module?
Makes perfect sense.
@winter rose i've already add inGameUISetEventHandler but some players can use action of scroll bar.
disable the keys then
There is no way to close it with a loop?
Will try to disalbe key thanks for ur help.
Is there any way to 100% safely create or move vehicles without them sometimes blowing up? In the past I have attached to the physics collision handler, and doing this I can at least save the object that is being moved, but it can't save the object it collides with.
_veh = createVehicle ["2S6M_Tunguska", [0,0,0], [], 0, "NONE"];
Especially the last parameter "NONE":
will look for suitable empty position near given position (subject to other placement params) before placing vehicle there.
Sorry I should specify I want to tell it where to spawn exactly, and if it can't then be notified rather than having it blow up
basically I want to do the collision query for its exact spawn position without having to spawn it
in that case you might want to take a look at findEmptyPosition with radius set to 0
This command ignores moving objects present within search area.
well... if you want to spawn a vehicle on locations where moving objects are, then you're doing something wrong 😛
i could do some check for this myself with the result though
no i am spawning lots of stuff at the same time
that stuff will start moving
its annoying, there is lineIntersectsSurfaces but no bbox equivalent :/
You could spawn a vehicle at a "safe" location (eg. outside of map), turn simulation off, then check if the preferred location is safe, use setPos to move the vehicle and then turn simulation on again.
anyone knows how to damage nearby buildings without the module?
considering the module is just a packed quick script
whenever I try to damage the terminal on altis it crashes my game
how do you try to damage it?
with the edit building module
hmm well i can do setDamage 1 on a building
hi, im new to arma scripting and im trying to allow players open veichle inventory only once. if they want to open it again they have to get out and get in again. i put this:
_inventoryOpened = false;
_insideVeichle = false;
this addEventHandler ["GetIn", {
_insideVeichle = true;
}];
this addEventHandler ["GetOut", {
_insideVeichle = false;
if (_inventoryOpened == true) then { _inventoryOpened = false; };
}];
this addEventHandler ["InventoryOpened", {
if (_inventoryOpened == true && _insideVeichle == true) then {
hint "You already opened the inventory. Get out and get in again";
player removeAllEventHandlers "InventoryOpened";
} else {
_inventoryOpened = true
}
}];
this addEventHandler ["InventoryClosed", {
if (_inventoryOpened == true && _insideVeichle == true) then { _inventoryOpened = false; };
}];``` into init.sqf but i got this error: `Error undefined variable in expression this`. I probably got it all wrong but im just testing stuff
it plays explode or collapsed behavior tho
@ebon ridge what was the way to select nearby terrain objects?
i just used cursorObject, but you can use terrainObjects i think
however the destruction anim causes damage, it killed me from range when i destroyed a hanger
I just need enough damage to break the window glass
So A2 is having a minor meltdown....
I'm getting this error: https://i.gyazo.com/75d2ca696b4dd4c5a1d47b1fdee61248.png
But the script works fine and does exactly what it is supposed to...
on my quest on jamming for the F/A-18, I intend to use the following eventhandler and code, not tested yet, but wonder if the approach is ok: ```sqf
js_jc_fa18_fnc_ewInit = {
params [["_veh", ObjNull]];
if (isNull _veh) exitWith { diag_log "FA18 EW: _veh is Null in ewInit"; };
if (!local _veh) exitWith { diag_log "FA18 EW: _veh is not local"; };
private _sensors = listVehicleSensors _veh;
if (["ActiveRadarSensorComponent","ActiveRadarSensorComponent"] in _sensors) then {
private _radars = missionNamespace getVariable ["js_jc_fa18_ew_radars", []];
_radars pushBackUnique _veh;
missionNamespace setVariable ["js_jc_fa18_ew_radars", _radars];
};
_veh;
};
class AllVehicles: All {
class EventHandlers
{
class js_jc_ew_init
{
init = "(_this # 0) spawn js_jc_fa18_fnc_ewInit;";
};
};
};
@round scroll I strongly recommend you declare a CfgFunctions for that and not a global variable though
@winter rose thanks, very good idea and I intended to do so 😄
good :p you got me worried here for a second
for testing and development I'm used to declare it as global variable, easier to adjust
can somebody tell me what's wrong with this? //make a marker at the crash site// waitUntil {visiblePosition fishy = 0}; createMarker ["Crash Site", getPos fishy]; "Crash Site" setMarkerType "mil_triangle"; "Crash Site" setMarkerText "Crash Site"; "Crash Site" setMarkerColor "ColorOrange";
trying to mark the location of a crashed aircraft
but not until it's crashed of course
waitUntil {visiblePosition fishy = 0}; this looks "fishy"
because you now retrieve the position of a variable (which should be an object) and set it to 0...
that alone should already show errors
i want to wait until the visiblePosition is equal to zero, ie the aircraft is on the ground
the variable "fishy" is indeed the aircraft 🙂
==
use the show script errors launcher option 😉
but visiblePosition returns an array with the full position (including X and Y)
wiki says:
Return Value:
Array - format PositionAGLS
you can use (visiblePosition select 2) though to only get Z value
okay so {visiblePosition select 2 fishy = 0}
((visiblePosition fishy) select 2) == 0
hmm. no errors now but no marker is created
try
_markerName = createMarker ["markername", player];
_markerName setMarkerType "hd_dot";
and make sure the marker name doesn't contain spaces
isTouchingGround, nah?
^^ I was looking for that command 🤔
or```sqf
(visiblePosition fishy) select 2 < 1
sometimes altitude when touching ground is 0.084531 stuff
haha. Lou, that's the command i was looking for! didn't know it existed, lol
be sure to read the wiki page for "limitations"
Lou, i think the second is better, sometimes it hits a building. <1 for visiblePosition works
considering <5 as sometimes it gets hung up
but this is working. Thanks Grez, thanks Lou
Grez thanks for showing me "select"
I learn something new every day
https://community.bistudio.com/wiki/isTouchingGround
"Be aware: it's not reliable on remote objects."
"If you are using this command as a validation method, it should not be the sole thing you are checking for, as the result is often inaccurate."
mmh it looks like you'd have to check the posAGL
as you are looking for the crash site i'd check if the engine torque is 0 and the velocity is 0 too, as the helicopter can crash also on buildings
(note you need to enable the advanced flight mode)
or use canMove.
and you will have the position of the helicopter that was destroyed 10.000 meters high instead of the crash site i guess
i think that returns true as soon as it's destroyed
yes, which is why he checks the altitude
is it possible that a helicopter crash but is still able to move?
like, if you destroy the back engine (i don't know the name in english) it can still technically move
Hey. How do I call a function? There is no error, but a unit without inventory.
init:
this addeventhandler ["respawn", { [this,"Opfor","opfor_squadleader"] call SerP_unitprocessor; }];```
At the start of the mission, inventory is issued, but after respawn there is no.
because this doesn't exist in the event handler. check the wiki for respawn EH arguments
So I can’t call the function after the death of the player?
I use a platform, this platform issues an inventory using a command, and it works.
[this,"Opfor","opfor_squadleader"] call SerP_unitprocessor;
yes.
But I want him to perform the same action when the character respawns.
yes.
But I don’t understand how to do it right.
Yes, I looked. Thanks.
It's right?
this addeventhandler ["respawn", { [_this,"Opfor","opfor_squadleader"] call SerP_unitprocessor; }];
no.
did you see the following code?
this addEventHandler ["Respawn", {
params ["_unit", "_corpse"];
}];
Yes, but I probably don't quite understand.
params takes the _this argument provided to the EH and "splits" it into the two arguments.
_unit is the new unit, _corpse is the "old" unit
replace this with _unit and you should be good to go
this addEventHandler ["Respawn", {
params ["_unit", "_corpse"];
[_unit, "Opfor", "opfor_squadleader"] call SerP_unitprocessor;
}];
i think this do what you think your code will do
Thank you so much, I get it. I did not quite understand what _corpse is, I have very bad English ...
a corpse is a dead body
Now I realized, I was trying to call a function not on a new unit.
@flat elbow https://community.bistudio.com/wiki/canMove updated
yep i was supposing some weirdness like that
the example should also use a more code-like syntax
if (!canMove _tank) then
{
player sideChat "He's nailed on the ground! Now hurry!";
};
what do you mean, ! instead of not?
yep
both work
yes but one is more "code-like" than the other
I don't know what to say ¯_(ツ)_/¯
the not feels more 80's
mines don't, as it sometimes is more readable than ! with parenthesis all around it
programmer's eyes are trained to find ! anywhere
I actually changed the previous example from ! to not so people get it on first glance (and don't miss it)
you made that example?
I updated it, the example was already there
Arma automatically adds waypoints such that its impossible to have 0 waypoints. This is constantly annoying because I am trying to add my own, and it isn't at all clear when it will do it. What is the minimal robust recipe to programmatically specify a set of waypoints? Or clear all waypoints?
Perhaps try and thy shall see, I don't know.
I know that one waypoint gets created on start, that's it
I have been adding and deleting waypoints for months now, I have tried plenty of hacking to try and get consistent behavior
Thats why I started my question with the conclusion of this which is that Arma automatically adds a waypoint at some point after you try and delete them all.
You can't have 0 waypoints
how did you come to this conclusion? try ```sqf
hint str waypoints player
Of course I have tried this
well I didn't try exactly this because I don't care about player, I am trying to control AI
name your waypoints with something consistent then delete everything else?
like _wpX and then subtract the array with those from the array with the "waypoints unit" and run a foreach delete on every of them?
an example exists on the deleteWaypoint page…
so
{_x deleteWaypoint} foreach (waypoints unit - myWaypointsArray);
nope
waypoints get re-indexed on the deletion of one, so you would miss one every two waypoints
huh?
waypoint format is [group, index] and if you delete index n all >n are decremented
i guess as long as the unit have one waypoint the engine will not add its owns?
read the page please, it explains it
private _group = group _unit;
for "_i" from count waypoints _group - 1 to 0 step -1 do
{
deleteWaypoint [_group, _i];
};
I have read it
I meant @flat elbow ^^
kk
uhm i am failing to grasp what it means, why are you not using a simple foreach? also that code deletes all waypoints i guess?
again, no
as soon as you delete waypoint 1, waypoint 2 becomes waypoint 1
so you will ask to delete waypoint 2 which was waypoint 3, and waypoint 1 (old 2) remains
waypoints are not "objects", they are arrays of [group, number]
and i guess you can't just set a custom array with the waypoints?
nope, no can do. delete from last to first so they don't get re-indexed
so there's no [[x,y], [z,w], [a,b]] setWaypoints unit ?
Anyway sorry I think I have a bug in my code. I read the documentation comments about non-deleteable waypoints and thought that I was experiencing this. I think its a bug though as I can delete to 0 waypoints if I do it on units added via zeus
keep in mind that arma creates one waypoint for the group when it comes into existance - on the initial position of the group leader I believe
Ah that must be it.
But it won't do it later on in the group life time?
Hmm that is annoying though, why not just not do that :/
i think it relates to currentWaypoint but not sure
I suppose it is (or at least was) some AI initialisation, but I can only guess
i think it probably adds a hold waypoints when there's no waypoints left?
when a group has no waypoint (meaning only that one 'initial waypoint) the group returns a currentWaypoint of 1 - if you then add a waypoint, the currentwaypoint will still return 1
it does
ah yeah okay that makes sense, I added unit from zeus and it had one waypoint, I was able to delete waypoint 0 and then i had 0 waypoints
but you can most likely disregard the first entry, allthough you technically can delete all waypoints
i didn't test what currentWaypoint returns hto
why do you want to delete all waypoints exactly?
well I tried ignoring first entry in waypoint list and it led to groups getting stuck, where setting their current waypoint to 0 would free them again
i jsut want 100% control over what is specified not having to fight with arma
so i can remove doubt
using currentWaypoint and the waypoints _group array you can get it done for sure
wait wait wait ... so that was the reason my whole bloody gigantic group in my insurgency mode tended to run around?
some magical waypoint? .... arma 🤷♂️
i don't think so
well it sounds like the extra waypoint would be a hold one at groups initial position
it's just the first waypoint in the array it does not really do anythng
it's a "MOVE" waypoint
(other than complicate all code that has to reason about waypoints)
but i guess it doesn't auto complete?
so weird
should test my insugency with latest patch anyways ... last time i fired it up was 4 years ago
though .. nobody is using it afaik
soooo ...
throwing a wild question out there - i guess it's not possible to return what code is currently being held in the onMapSingleClick command?
I think nope, why?
Kind of a specific problem - I have an AI mod that uses map planning and there's two cases where I'd like to avoid the default mapclick behavior: 1. Clicking on certain dialog controls and 2. preventing the movement order for drivers when you are the effectiveCommander of a vehicle. I can not find a different way to do this than onmapsingleclick , but that might interfere with any mission etc using that code as well
onMapSingleClick {true} would fix all my problems but then again, it broke a lot of missions. So I'm trying to find a workaround
also, note that it might be an eventhandler
but I am afraid there is no way to get the code.
"Since Arma 3 v1.57 a stackable MissionEventHandler is available and should be used instead: MapSingleClick.
Before that, the functions BIS_fnc_addStackedEventHandler and BIS_fnc_removeStackedEventHandler should be used instead in order to keep compatibility between official and community content."
okay - I had that hunch but thought I'd give it a shot 🙂
perhaps that's why it broke your mission?
Exactly - if everybody would use stacked EH's, that would be fine
but people use onMapSingleClick all over the place and you can not use a stacked EH to prevent the default Arma behaviours like markers etc
i guess I'll have to brutally take charge of that EH and refer complaints to that official statement 😉
still would be so cool if you could add and remove code to that initial game EH so that multiple addons could have their conditions to prevent markers etc
Need help again.. How do i make the AI text appear in vehicleChat e.g Pilot: Check the fuel? co-pilot: We are good. I also want the player text to appear here. All using triggers, can anyone help?
vehicleChat @silver mauve
i tried that but it didnt appear?
then maybe you are using a server-only trigger, and vehicleChat has a local effect only
you could use remoteExec to solve this.
pilot vehicleChat "Check the fuel";
thats what i did and its for a single player mission
can you give me an example this is baffling my head
give your vehicle a variable name, then use it with vehicleChat
or use ```sqf
vehicle pilot vehicleChat "Check the fuel";
helo1 pilot vehicleChat "Check the fuel";
are you in the vehicle?
yes it's for the fly in before the mission
i fly in and as im flying there talking about the helicopter and other stuff
hmm then Lou's example is the one - working fine here
im not sure whats going wrong
if the helicopter's name is helo1, of course
Miss spelt the helo 🤦♂️
Ahhh still doesn't work
finally got it to work for some reason i had to make the trigger wider so that the whole helicopter passes through and not part of it. Never knew this was the case. Thank you for your help @winter rose
it should not be the case, but maybe the helicopter centre did not go through the trigger
the whole heli went through just not as a whole so the front went through and left before the tail rotor
i was testing my mission and the vehicleChat works but now only displays the Pilot callsign?
vehicle pilot vehicleChat "How is the fuel?"
vehicle co_pilot vehicleChat "Readings are fine sir."
but for some reason it only displays Pilot and im not sure why
The text will be visible only on the PC where command was executed. If you need the message to show on all computers, you have to execute it globally (see remoteExec)
i believe the effectivecommander of the vehicle will 'say' the line
so you will need to use vehicleChat on each unit which should receive it
vehicle pilot and vehicle copilot is the same thing
^^ and that
you can not create a 'in the vehicle conversation' with vehicleChat - imagine it as the channel where the commander of the vehicle speaks
you'd need to use groupChat, sideChat or a kb-conversation for that
ahh okay it's just the pilots are not in the group of the player
is there a way i make them part of the group and then when i land the player leaves the group
@silver mauve no, it's not the reason
the fact is that you cannot get "driver <vehicle> says:", "gunner <vehicle> says:" or "commander <vehicle> says:"
this command does not do as you think (and I think) it should behave, e.g unit using the vehicle chat.
it is actually a "message in the vehicle said by the vehicle leader", and nothing more.
I'd like to get into scripting, I don't suppose anyone could help me?
Reccomend software and things.
Ty.
But that page doesn't recommend VSCode with SQF extensions 😢
and of course, we can help here.
this page does not link to "unofficial tools", this is true @still forum !
That doesn't necessarily give the key points.
🤣
I just read over it, I took it in.
https://community.bistudio.com/wiki/Code_Best_Practices can be a good read too.
but the "best" way to learn is to have a small project and code/error on it 🙂
Too bad the VS Code SQF plugin is not up to date.
Can we DM for a sec?
I don't mind, but "only" if it doesn't fit here? shoot
Theres a question I'd like to ask without seeming like a noob even though I have 2k hours in Arma.
No one's going to laugh at you
there are no stupid questions (only stupid people)
and better ask and look dumb 5 minutes than not asking and being dumb for the rest of one's life 😉
Remember the Debug console? I am aware quite a few people have been banned for scripting within the PUB Zeus community are scripts such a Jwolf and others allowed to be used?
I played a 9 hour PUB Zeus mission which was scripted.
And, I'd like to help more players out.
(but more seriously, even if it is a "naive" question, if you want to know and learn it is not going to be mocked. we try to encourage knowledge sharing here)
Give them the opportunity.
The debut console was removed.
And now people find open source injectors.
(The mission was amazing, it made me cry at one point and then also made me laugh and it was also really emotional.)
Billw's script debugger is missing on the "Code Edition" (shouldn't that be Code Editing?) thing 🙃
add it
😿
I asked my question.
public ZEUS are not "allowed" to be modified by debug console or injection.
Well if it custom then it isn't public in that sense
public more means the official servers
You can do whatever you want on your own servers, though you might not get as many people playing.
Armitxes is still alive tho (atleast on github), maybe he'll update his extension someday
One could always fork it.
Anyhow, question, is there any way to get all script handles currently running?
no
diag?
with a diag_ you can not get the handles, but the count of them
yep
@still forum what/where is billw script debugger?
So once a script is executed, it cannot be terminated unless you've saved the handle as a variable?
yep
wonderful
for safety reasons, so you don't terminate someone else's code
terminating your code with terminate is not a good practice anyway. what is your use case @random loom ?
Trying to make a mission using the Vanguard modules
Want to disable the script creating map markers
The alternative would be to somehow find the "draw" eventhandler it creates, and delete it
But I guess the situation is similar when it comes to identifying eventhandlers?
Here's the script I'm trying to kill https://pastebin.com/XftQssu3
you can remoteAllEventHandlers
I tried that but it would appear it just breaks everything when it comes to the map
correct
So, do you happen to have any ideas how to get around this?
[
{diag_activeSQFScripts findIf {"a3\Missions_F_Tank\MPTypes\Vanguard\scripts\drawMapIcons.sqf" in _x} != -1},
{
[
{findDisplay 12 displayCtrl 51 ctrlRemoveEventHandler ["Draw",6]},
[],
15
] call CBA_fnc_waitAndExecute;
},
[]
] call CBA_fnc_waitUntilAndExecute;
that will have to do
Hi guys, trying to have a GUI combo box update when another is changed. When the side changes, it adds all factions of that side into the listbox. However i'm not getting an error reported and checked my .rpt too. I don't think my event is firing.
_fnc_factionChanged = {
_indx = lbCurSel 2100;
_curselected = lbText [2100, _indx];
systemChat _curselected;
_selectindex = _sidesstr find _curselected;
_curSelFac = [(_sides select 0)] call BIS_fnc_getFactions;
{ lbadd [2101, str _x]; } forEach _curSelFac;
_groups = [];
_configgroups = "true" configClasses (configfile >> "CfgGroups" >> str _curSelFac >> lbText [2101, lbCurSel 2101] >> "Infantry");
{
_groups pushBackUnique ([_x, "", true] call BIS_fnc_configPath);
} forEach _configgroups;
{ lbadd [2102, _x] } forEach _groups;
};
((findDisplay 348567) displayCtrl 2102) ctrlSetEventHandler ["LBSelChanged","['ListChange', _this] call _fnc_factionChanged"];
Is the section of the code not working. https://imgur.com/a/oWsxPlv is the gui - Been away from arma development for a while so bare with me if i've done a simple error ha 😄
https://github.com/56curious/VKN_Official_Mod/blob/master/VKN_Functions/Functions/fn_missionTemplateTool.sqf#L67 is my entire function, with context if required
Anyone have a scrollwheel menu item for full ace advanced heal?
Sort've a "Walk-up-to-medic-scroll-and-heal" thing
_agent moveTo _position; will start agent running to position. Is there a way to force agent to walk instead of running to destination ?
Guess you tried forceWalk?
@cosmic lichen seems to be working also for agents
I have a mission (which works nicely), but would like to structure the directory a bit nicer. Files like init.sqf, onPlayerRespawn.sqf and description.ext are in the mission root. Is it possible move these files to subfolder?
nope, they are used by the engine
Thanks, that was fast.
yep, https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#IncomingMissile
does not work for unguided missiles shot by players though
does it work for unguided shot by AI?
oh
reads
perfect
second question, is it possible to intercept this, i.e destroy the missile
the function doesnt return some kind of object for the missile itself
i.e the one inflight
unless "ammo" is unique? that sounds like just the class of weapon fired not the actual projectile in flight
strangely enough, it does not return the missile itself so you would have to do a nearestObject something…
nearest to the instigator, though
it is a CfgAmmo
i cannot for the life of me remember what the system was called, but in MW2 the IFV's had this RPG shield
i'm trying to recreate that
with some kind of recharge and failure rate ofc
you can check triggerAmmo then 😉
*boom*
the EH description states that unguided missiles shot by players are indeed considered 🤔 great…!
another event i've just found going through the wonderful rabbit hole that is the "also consider" box of the wiki: "FiredNear"
Triggered when a weapon is fired somewhere near the unit or vehicle
"max 50m"
(max. distance ~69m)
my bad.
..i hope there is some strange coincidence for that and the engine devs arn't just trolling
…we may never know
IFV addEventHandler ["IncomingMissile", {
params ["_target", "_ammo", "_vehicle", "_instigator"];
hint _ammo;
[_ammo] spawn {params ["_a"]; sleep 0.5; _rpg = nearestObject[IFV, _a]; hint str _rpg;};
}];
so I've tried putting it into a spawn and adding a sleep, maybe nearest object was happening too soon, but i get null object
the event handler is working, ammo is "R_PG7_F"
is nearestObject the wrong call here? I see a function called nearestEntity
half a second may be too big, as it is using its hardcoded limit of 50m
try only 0.01 to be sure it doesn't happen
https://community.bistudio.com/wiki/nearestObject
Hardcoded radius is 50 meters
nope, alive or dead bodies (depending on nearEntities or nearestEntities)
not vehicles, ammo, etc
ahh
the vr map grid squares are 16m x 16m right?
in that case my rpg dude is 32m away, i've got delay at 0.01, and still null object
I will give a try in 10 min
oh cool, TY
im gonna try messing with the Fired event
which actually gives me the projectile object
works for me
oooh I get it
nearestObject[IFV, _a]; // nope
```You should check around the shooter, not the target ^^
@fair lava ^
this addEventHandler ["IncomingMissile", {
params ["_target", "_ammo", "_vehicle", "_instigator"];
private _missile = nearestObject [_vehicle, _ammo];
_missile spawn { sleep 3; triggerAmmo _this; };
}];
//player setVariable ["attackHeli", false]; //for hosted (single) player.
I want to set every connected client player to have a variable, like:
[player, ["attackHeli", false]] remoteExec ["setVariable"];
but it doesn't work. how to fix it?
player is different for every player
You could remoteExec call. But I don't understand why you need to store the variable on player? Why not just use a global variable?
Each player has to different variable value: 'true' or 'false' on "attackHeli" variable.
you can set it from the server?
remoteExec "call" it is then
it is called from the dedi-server. you mean use remoteExecCall?
why not setVariable ["varName", value, true] to publicVar it?
Because it's set on player object
Sorry, I mean, Every connected player could have a different value: false or true on "attackHeli" during operation, but after the operation I want to reset every player have "false" value on "attackHeli" variable.
{
_x setVariable ["attackHeli", false, true];
} forEach allPlayers;
thx, I'll give it a try.
@hollow thistle it works! thx again.