#arma3_scripting
1 messages ยท Page 767 of 1
oh yea, since yours turns it local.
It doesn't turn it into anything
That's why I said be careful
Well no I didn't say it for that reason 
But yeah you should be careful so you don't overwrite the original array by reference
well, it copies it to a variable local to this specific script, right? thus not working with the original.
(Advice is heeded nonetheless.)
No it doesn't copy it
It copies the reference (pointer)
Ah.
What I wrote is correct because operator - makes a new array
But if you use deleteAt you'll end up modifying the global array
_localThing = originalThing; Still the original, just easier to reference.
I see
there is some extdb setting that adds quotes properly, don't remember what exactly
I guess indices do matter don't they?
My method is based on a mission I made previously (with quite a bit of assistance from you lads), where indicies did matter. This time they don't. The main requirement is that each point has one group spawn at it. Outside of that, I just have to keep the original array intact (all points are available per spawn wave).
if so:
_point1 = floor random count pointPool;
_point2 = floor random (count pointPool - 1);
_point3 = floor random (count pointPool - 2);
if (_point3 >= _point2) then {
if (_point3 >= _point1) then {_point3 = _point3 + 1;};
_point3 = _point3 + 1;
};
if (_point2 >= _point1) then {_point2 = _point2 + 1;};
Wouldn't that be an out of index situation if point 1 or 2 are the last one in pointPool?
I'm removing one item by reducing the count
idk what you mean
the algorithm itself is correct
as far as I see
I'm probably mis-reading it then.
random is exclusive, and you're flooring it so it's correct
When I get around to working on it again, I'll still probably be sure to test that. But yea, the logic is sound 
So this is probably a stupid question but what's the purpose for putting an underscore at the beginning of your variables?
not stupid! maybe basic, but if you don't ask, you'll never know ๐
Yeah I'm not in the area of building functions yet so I haven't had to deal too much with it. I know the local/global relation in regular programming but I wasn't sure of the context in Arma or if it was the same.
That page could use some clarification maybe and update. private is now able to do same-line assignment, now making it merely as good as normal variable creation in any other programming language ๐
the abovementioned Variables page has a lot of good information, take a look at it and tell us if something needs clarification, the channel is here for you
see Local Variables Scope - it mentions it
it's not ๐
use #community_wiki
no bulli
the underscore only denotes that the variable is a local variable, normally this would mean that a variable is only available in the current scope, but in sqf it is the current scope and any subsequent scope. In contrast to a global variable, which is available in any scope once defined, even "separate" scopes such as a spawn or isNil, addAction condition, etc
So is the general idea that if you're creating a variable for use in a single function you make it local and presumably declare it in the function itself and if you're using it for multiple functions you make it global and define it in something like the init.sqf?
somewhat yes to your first point, and no to the second that would generally be bad design necessitating that
sounds like it yes! think of it as SCOPES ๐
global scope should be used scarcely, the least possible (it's less performant, also it always risks conflict of variable names if not properly prefixed)
you can use return values to pass them to other functions, depending on what you do
So best practice is to handle variables locally at the function level?
basically use local variables as much as possible; and you might as well make them private too since you can now do same-line assignment it literally takes no extra lines, unless you realyl know what you're doing
it literally takes no extra lines,
- no performance cost, unlike
private "_var"
yes, the closest to their scope
see also https://community.bistudio.com/wiki/Code_Best_Practices ๐
Gotcha.
Is there a way to fire off a trigger when a unit's animation changes? I'm trying to set off an ambush after a hostage is freed. Right now I have a janky area trigger set up but I think a trigger once the hostage animation ends would be more elegant.
what makes the hostage be free should trigger the rest; not the animation itself ๐
(add a delay if needed though)
otherwise, there is the animation event handler that could do
Hope someone can help.
I am using nearentities to get an list of objects within my range, checking its side with an foreach loop and would love to dump every civilian entitie in an list / array. But i cannot append and object to an array.
Any ideas?
code?
_entities = player nearEntities ["Man",_range];
{
if (side _x == civilian) then {
//somehow add object _x to list or array _output
};
} foreach _entities;
i haven't done anything in arma 3 since ages and forgot it... prolly to dump to google
pushBack
thank you very much
you can just one line the whole thing:
_output = player nearEntities ["Man",_range] select {side _x == civilian}
Later for optimisation.
Why does !local _obj not work in a waitUntil?
Example:
waitUntil {!local _obj || time > _setOwner_time + 1.5};
How can I solve it?
local works everywhere
the problem is elsewhere
is your waitUntil scheduled?
also is that for Arma 3? or 2?
huh? this is Arma 3 discord
Yes, you are right again. ๐
I think the problem is waitUntil in an EventHandler with InventoryOpened.
I need the spawn command to solve it, or are there other possibilities?
no. it's Arma discord ๐
I've seen people ask A2 questions here too
you have to spawn. but I don't see why you're waiting for something to not become local 
The simulation is switched off for the crates so that they cannot move when they are slightly in the air or when they protrude into another base object (wasteland base building system). But when the simulation is turned off, some objects cannot be moved into the player inventory. So i want to make the crate local to the server and then turn on the simulation local. so that the crate doesn't move but the inventory works fine. Or do you have another idea, but according to my first test, this works quite well. thank you
it does, but for the love of god i cannot create a Text datatype as sql changes this to TEXT on its own
TEXT = Wraps Text Datatypes (not TEXT) with "<insert result>" ```
Text is the main class over all Text-type datatypes
but if i make my data-type Text -> TEXT, it wont add quotes
no matter what i do
have this in my init and it wont do:
"extDB3" callExtension "9:ADD_DATABASE_PROTOCOL:Database:SQL:SQL:TEXT";```
in my extdb3 log it says
extDB3: SQL: Initialized: Add Quotes around TEXT Datatypes mode: 1
but it wont wrap them
my text datatypes are naked
same for TEXT2
just changes mode to 2
Yeah, it wont add quotes to my TEXT datatypes
does anyone have the script to hide hulls on vehicles by any chance?
(ping me as im a stupid person and will forget to look here)
setting the hull texture to "" will make it invisible
Could someone show me a script that guarantees the creation and control of subordinate high command units on a dedicated server with the high commander being a remote client? I need something that works to dissect and reverse engineer.
Locality seems to have wrecked me.
this setObjectTextureGlobal [0,""];
the number is the index of the part of the vehicle being textured
usually for vehicles the options would be 0 through 4
so just try different numbers until you get the part you want
if you want to do it quick you can open the console in-game, look at the vehicle, and use cursorObject to get the vehicle you're pointing at instead of this in the init
setGroupOwner didnt work I assume
Yeah, no. No matter how much
"extDB3" callExtension "9:ADD_DATABASE_PROTOCOL:Database:SQL:SQL:TEXT";```
i do, it wont add quotes around text
Haha, no, it did not. Not on its own, anyway.
I set up an empty test environment on a dedicated server and just shit into the debug console from a remote client and nothing worked, nothing worked, nothing workedโฆ. And then something did, but I didnโt take a note, and by the time I got my real environment up, Iโd completely forgotten what I did. Unreal.
Also there may be something on the main branch interfering with what I did.
I may just have to try and try again and take more immediate notes.
i need quick help, should be quick fix
i have trigger saying !alive civ
hint "Enemy Down"; marker = createMarker ["death",getpos civ];marker setmarkertype "mil_triangle";marker setmarkersize [1, 1]; marker setMarkerColor "ColorRed"; marker setMarkerText "Enemy Down";
made where marker put on map after their death
how can i reuse this over and over
i tried renaming variable name but it only shows 1 marker not both
Thereโs not really a way to fire a trigger via script command, but there are workarounds to achieve a similar effect. And for the other part of it check out https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#AnimDone
Although I kinda have to agree with lou here that there are simpler ways of going about this
just quote twice when inserting then
I'm trying to put objects that have the same prefix in an array that I can reference later.
I was able to find an old line on a forum for the marks and that works
pointPool = allMapMarkers select {toUpper _x find "INF_" >= 0};```
But my attempt at something similar for objects doesn't seem to hold true.
```sqf
reconStuff = allMissionObjects select {toUpper _x find "REC_" >= 0};```
I assume this is just due to differences between markers and objects and if so, how should I go about fixing this so that it works for objects?
markers are strings so you can do string operations on them.
I'm not sure what you're trying to do with the objects here, maybe name _x?
if you're trying to filter by classname, you can use typeOf
also use in and not find, you don't need the index
markers have to be unique, createMarker ["death" you can't reuse same "death" everytime (unless you delete the previous one)
Right I thought phalanx was a group with players in it. The problem you were having with remote execute was that your not telling it the target
Sadly, I don't think I can reliably use typeOf as all things that have REC_ either aren't all the same classname or too similar to things that I don't want to be included for that array.
im guessing you have them editor placed and each have their own varname?
or what
Yes.
https://community.bistudio.com/wiki/vehicleVarName should work then
I may still be misinterpreting your help.
reconStuff = allMissionObjects select {toUpper vehicleVarName _x in "REC_" >= 0};```
The above gives an error at `... select |#|{toUpper vehicleVarName ...`, says that I'm missing a `;`
That code doesn't seem to make sense
Well, it's based on something I did for markers. With changes put in at sharp.'s recommendation.
You can't just replace different commands in-place. They have different syntax and work in different ways.
toUpper vehicleVarName _x is valid. in "REC_" means you're trying to find whether the result of that toUpper is contained in the string "REC_", which I doubt is what you're trying to do. The >= 0 just isn't doing anything except confusing the game.
I got it figured out, but thanks.
I'm pretty sure what you want is "REC_" in (toUpper vehicleVarName _x).
If you find a sequence of commands you don't understand but want to use, go through the wiki pages of each command in order and try to figure out what they're doing. And if you want to change it, look up the commands you want to put in as well. This will help you use commands properly.
So, I have now looked at the wiki to make sure that I'm using each part right. It is still saying that I'm missing ; just after the select but before it evaluates the expression.
This is what I have right now.
reconStuff = allMissionObjects select {"REC_" in (toUpper vehicleVarName _x)};```
because allMissionObjects is unary
not nular
Yes, the type parameter for allMissionObjects is not optional
How do I set the speed of a jet I spawn and then move to flight altitude.
Help where do I put the "true" thing, ingame it says error and it should be indicated true or false, can someone help me on what part of this script should the "true" thing be putted in? Thanks in advance
waitUntil {goggles _player in CBRN_AVAIL_GASMASK}
do you actually have said CBRN_AVAIL_GASMASK array defined at that point?
I think so I just need to define the true of false thing, its a mod that is outdated I think
_smth in [array] already returns true or false. If you actually have thing on the left and array on the right.
also, do you actually have _player variable defines, or did you mean goggles player?
Because this works exactly as intended: waits for me to put on the respirator and fires the hint: sqf [] spawn { waitUntil {goggles player in ["G_AirPurifyingRespirator_01_F"]}; hint "It's on"; };
flyInHeight command
setVelocity for giving it some initial speed
Got it thanks!
_player or CBRN_AVAIL_GASMASK is undefined
Maybe it only works for AI
Control vehicles
yea ofc, that command will do nothing to players ๐
Blah dang jets too fast lol oh well
Dose any one know why setting the mass of a heli to somthing lower then when it starts makes it less responsive & adding make it more?
@coarse dragon
private _newAltitude = 500;
private _pos2D = (getPosASL _plane) select [0,2];
_plane setPosASL (_pos2D + [_newAltitude]);
๐
private _newAltitude = 500;
private _posASL = getPosASL _plane;
_posASL set [2, _newAltitude];
_plane setPosASL _posASL;
[] spawn {
private _newAltitude = 500;
private _posASL = getPosASL _plane;
while {(_posASL # 2) < _newAltitude} do {
_posASL = _posASL vectorAdd [0,0,1];
_plane setPosASL _posASL;
};
};
GNIIIIIIIII
yeah, that
I just changed to a A-10
if im not wrong, ```sqf
vectorMagnitude velocityModelSpace player
but the number is way too small
and it doesnt match with speed player when moving forwards
speed is in km/h
iirc speed doesn't take into account lateral and vertical velocity
still doesnt match
im running on a flat surface
running straight?
what about simply abs (velocityModelSpace player # 1) * 3.6?
well actually no abs
i redid the test by multiplying by the difference
since speed can also be negative
and found out the difference is 3.6
so it's accurate
so i returned to multiply by 3.6
and now it works
strange
give me a second
3,6 * vectorMagnitude velocityModelSpace player```
is not
```sqf
3.6 * vectorMagnitude velocityModelSpace player```
๐จ
anyone got a idea of how i could possibly have a magazine that was added with addturretmagazine already loaded?
wasn't addMagazineTurret broken? 
no it was something else 
i was about to be very confused lmao
well there's at least this note:
Note: you may create invalid combinations by using this function, for example by adding 20 grenades. When doing so, application behaviour is undefined
i created a cruise missle shooting rhea anti air and it works fine lmao
just the reload time is ass
idk know if there's a way
tried that unfortunatly only does it once its been reloaded once
Setammo?
Uhhh
Works for me

Try a combo of laodmagazine and setammo
If i remember correctly, you could loadMagazine, setAmmo to 0, then setAmmo where you want it to skip reload
And have the magazine be selected in the vehicle weapon
Need to check what i did in my script tomorrow
I had a script for doing this
LoadMagazine starts the reload timer
SetAmmo to 0 should stop it
SetAmmo to 1 should skip it
Though need to see what i did
I had a trick for this and i dont remember if it was this
Ill get back to it tomorrow
ill try it out ill let you know if it doesnt work
sadly dont work
so i shall wait till tomorow just ping me if you find it please ^^
hey! So, this is going to be an easy question (I assume), but I'm trying to write a lil script for triggers; basically, if 6/8 infantry units in a group are dead, the trigger is activated and another QRF squad starts moving. So far, I've done alive checks on each individual infantry unit, then if all are dead, trigger activates.
How exactly would I go about saying, basically, If at least 6 dead in group, then activate, in scripting language? ๐
{alive _x} count (units someUnit) < 3 or you can reverse it to count dead {!alive _x} count (units someUnit) > 5
deceptively, that is not what this command does. Read the yellow box in https://community.bistudio.com/wiki/setWeaponReloadingTime#Description
Counting dead doesn't tend to work because dead units get kicked out of groups after a short time.
So you'd want the live < 3 check instead.
Good catch, I always forget about dead going to civ side
You can just give the weapon magazine near infinite ammo with setammo
Hi guys i have a question dose this : https://community.bistudio.com/wiki/BIS_fnc_strategicMapOpen work in multiplayer on dedicated server ?
I did run it on MP server
it showed the map when executed locally on every client
I used the example code
I'm trying to get the waypoints I have assigned to the groups I have placed in Eden editor using:
_Groups = get3DENSelected "group";
_WPs = [];
{
_SelectedGroupWaypoints = waypoints _x;
_WPs pushback _SelectedGroupWaypoints;
} forEach _Groups;
//return:
_WPs;
but I'm getting
[[],[],[],[],[],[],[],[],[]]
basically each group is giving me an empty array of waypoints despite me already assigning waypoints to them, why is that?
i guess that's because they're not actual waypoints at this point. get3DENConnections _group select {_x isEqualType []} seems to produce the list of connected waypoints, though
well I found out you can just use get3DENSelected "waypoint";
but I'm wondering how to find the position of a waypoint now
because neither waypointPosition or getWPPos give a positions, they just return [0,0,0] for all waypoints
(get3DENSelected "waypoint" select 0) get3DENAttribute "position"?
yep I was confused a bit about get3DENAttribute , thanks it worked
and I ran into another problem,
(get3DENSelected "waypoint" select 0) get3DENAttribute "Type" returns [<null>]
Are you sure its type?
thats what it says in the interface
what route do I need to go?
Or you check the biki
(get3DENSelected "waypoint" select 0) get3DENAttribute "ItemClass"
works
๐
Is this the correct way to filter groups in vehicles from other groups that are selected in eden editor?
_Groups = get3DENSelected "group";
_Vehicles = [];
{
_index = _foreachindex;
{
if (_x != vehicle _x) then {
_Vehicles pushback (vehicle _x);
_Groups deleteAt _index;
break;
};
} forEach units _x;
} forEach _Groups;
Good day. I'm trying to remote exec say3d. An error pops up tho. What did I do wrong?
[m1, ["Turn speakers on", {]] remoteExec ['addAction', 0, m1];
[m1, ["sound",300,1]] remoteExec ['say3D', 0, m1];
}];
[m1, ["Turn speakers off", {]] remoteExec ['addAction', 0, m1];
m1 setDamage [1,false];
}];
[m1, ["Refresh", {]] remoteExec ['setDamage', 0, m1];
m1 setDAmage 0;
}];
umm what is that ...?
you have so many misplaced {s and I have no idea what you're trying to do here
no
Oh smokes. So basically I have this loudspeaker placed down on the map. I want it to play something. I accomplished it with this and it works
m1 addAction ["Turn speakers on", {
m1 say3D ["sound",300,1];
}];
m1 addAction ["Turn speakers off", {
m1 setDamage [1,false];
}];
m1 addAction["Refresh", {
m1 setDAmage 0;
}];
To stop the music I add in set damage 1 and to fix the thing I use set damage 0
So now I have "Turn speakers on" | "Turn speakers off" | "Refresh"
m1 (loudspeaker)
sound (is what I named my sound file)
Now I'm trying to add in remote exec
you have to remoteExec each command with their args
e.g.
[m1, ["Turn speakers on", {[m1, ["sound",300,1]] remoteExec ['say3D', 0, m1];}]] remoteExec ['addAction', 0, m1];
see the pinned messages
Ahh! Thanks a lot Leopard20
better to just make a function and remoteExec only that, instead of 3 seperate REs
Anyone knows the correct way?
Is there a way to check in an IF clause if AUTOTARGET AI is enabled or disabled?
something like this, maybe ๐คทโโ๏ธ sqf _groups = get3DENSelected "group"; _onFoot = _groups select {count units _x == count (units _x select {isNull objectParent _x})}; _inVehicle = _groups - _onFoot; _vehicles = _inVehicle apply {units _x apply {objectParent _x}}; _vehicles = flatten _vehicles; _vehicles = _vehicles arrayIntersect _vehicles; [_onFoot, _inVehicle, _vehicles]
Performance seems adequate in my limited testing of 5 groups and 1 truck
Ignore the performance, just need something working because I will just use this outside of the mission
well, _onFoot = groups that are 100% on foot, _inVehicle = every other group, _vehicles = all the vehicles used by _inVehicle ๐คทโโ๏ธ
get3DENSelected "group" select { units _x findIf { !isNull objectParent _x } == -1 } isn't this all you need?
I will be honest, I never knew you could pass code into select
Thanks everyone
checkAIFeature
Perfect, thank you Leopard
Why switch statement evaluates all the fall-through cases even if the first one completes the comparison? It's not an expected behaviour
Example: try this in console
_test = [];
switch (true) do {
case ((_test pushBack "1") > -1);
case ((_test pushBack "2") > -1);
case ((_test pushBack "3") > -1):
{_test pushBack "ended"};
};
_test
Expected result: ["1","ended"];
Actual result: ["1","2","3","ended"];
because that's how switch works
Only in sqf maybe >_<
switch (1) do
{
case 1:
case 2:
case 3:
{
Print("works");
};
};
Nope, it expects ';' for case 1 and 2
"Print"
what I mean is that it's going through all, SQF does that, don't do operations in case values then
switch will fall through when there's no code block for a case
no lou, close but not on it ๐
: is a binary operator taking code on right, so yours is syntax error :bobcat:
oh it needs to be ;
cookiedough, we need cookiedough
look at example 2 lou
THIS CODE IS NOT SQF DANGDAMMITOLOGY
*ahem*
in SQF switch, the : operator does alot of work
If its left side condition is true (or one of the previous conditions was), it executes right side code and jumps out of switch
You don't have : operator, so the jumping out check never happens
And ; operator works as OR ?
; is a line terminator
it does literally nothing besides ending the line
In switch statement I mean
switch statement is just a SQF code block
switch (true) do {
call my_fnc_doStuff;
};
Ok, sorry, I can not explain what my problem is.
Can someone tell me what I did wrong? It only enables AUTOTARGET but I am not sure why?
if (_x checkAIFeature "AUTOTARGET") then
{
_x disableAI "AUTOTARGET";
hint "AutoTarget OFF";
}
else
{
_x enableAI "AUTOTARGET";
hint "AutoTarget ON";
}
} forEach (units player select { !isPlayer _x });```
Actually, not that it can be resolved, I was asking just in case I 'm missing something. Thank you.
switch statement only exits when a piece of code was executed after a condition matched.
You are not executing any code, thus it doesn't exit
switch fall through because you don't have code block
oh
yeah what dedmen said
specifically executing code via the : operator that is
_test = [];
switch (true) do {
case ((_test pushBack "1") > -1): {};
case ((_test pushBack "2") > -1): {};
case ((_test pushBack "3") > -1): {};
{_test pushBack "ended"}; //???
}; //????
_test
missing semicolon after {}
thanks lol
What I was asking is WHY it pushes '2' and '3' into array when I was expecting it to push only '1' as it is already returning true for '> -1' and should be falling right to code-block
because fall through........................
it executes every case statement. It's effectively a not-lazy OR,
yes! this.
_test = [];
switch (true) do {
case ((_test pushBack "1") > -1);
case ((_test pushBack "2") > -1);
case ((_test pushBack "3") > -1):
{_test pushBack "ended"};
};
_test
is essentially the same as
_test = [];
call {
if ((_test pushBack "1") > -1);
if ((_test pushBack "2") > -1);
if ((_test pushBack "3") > -1):
{_test pushBack "ended"};
};
_test
And now you can see why it executes the pushBacks
Got it, thank you
and
_test = [];
switch (true) do {
case ((_test pushBack "1") > -1):{};
case ((_test pushBack "2") > -1):{};
case ((_test pushBack "3") > -1):{}:
{_test pushBack "ended"};
};
_test
would be
_test = [];
call {
if ((_test pushBack "1") > -1) exitWith {};
if ((_test pushBack "2") > -1) exitWith {};
if ((_test pushBack "3") > -1) exitWith {}:
{_test pushBack "ended"};
};
_test
And is there an option to make it lazy-evaluation like we do in
if (condition1 || {condition2}) then
but still, don't do side effects in case statements ๐
Just add the :{} code to every case statement
straight copy-paste from your message works as intended on my machine though ๐ค
there's nothing wrong
if you're judging from the hints, maybe you should consider using a more descriptive systemChat instead
systemChat gang shout out
and it does on my machine. Switching on-off
restart 
forget what i said. seems there is a conflict with another addon
will remove it and restart
thanks guys
if i want to preloadTitleRsc many "ResourceTitles", would this be correct?
_preloadAllResourceTitles = ["all_ResourceTitles_are_here"];
{preloadTitleRsc [_x,"PLAIN"]}forEach _preloadAllResourceTitles;
Does this help if you want to show multiple GUI tiles at once without having to load them as they are showing?
I do not understand what you mean by "show them without loading them"
If you load a complex tile it won't appear as low quality then gets loaded completely as the player is seeing it
tile?
anyway, it preloads them
so most likely preloads titles for them to be ready yeah
it can prevent them from flickering the first time you load them, afaik
Is there such a similar command for cameras?
Preload the scene in front of a camera
yes
https://community.bistudio.com/wiki/Category:Command_Group:_Camera_Control > Ctrl+F > preload
Thank you, sorry for any trouble I have caused lol
Quick amateur question. Do I have to use setComabtMode to order an AI unit to hold fire or is there another command I can use?
You can use some of the disableAI command features, but for normal use it's better to use combat mode.
single AI -> setUnitCombatMode
group -> setCombatMode
Thanks guys
Question regarding ```_x disableAI "RADIOPROTOCOL";
It seems that all the messages which haven't been issued while being "muted" are being played as soon as I enable the radio protocol again
It's basically a playback of all the messages which have been occurred while the Radioprotocol was disabled
Is there a way to avoid this?
Trying to create a "tactical" mode where units are using their laser (eg. being in combat mode) but not screaming all the time. For that purpose I am disabling the Radioprotocol.
you can remove radios from bots but I'm sure that will affect their coordination
If you're only worried about the voice, not the text messages, you can use _x setSpeaker "NoVoice" (note: local effect)
is there a way to look for animations for the vanilla dogs?
animation viewer
any specific subsection?
select the dog first... 
๐คฆโโ๏ธ thats a facepalm on my end
I will try this. Thanks
Tried this one but same problem
I'm trying to find a link between get3DENSelected "waypoint" and the group that the waypoint is synchronised to, but synchronizedObjects is not helping in this case, any ideas?
get3DENConnections?
Waypoints and synchronizations are 2 separate things. Waypoints are not synced to groups... Waypoints contain to which group it belongs to in themselves as waypoint data is structured as [<group>, <index>]
how did I not remember such a command exists? thanks
well, we are speaking inside the eden editor here
So do I. It does not matter, waypoint data is waypoint data, it has a common structure.
nomral waypoint commands don't work with eden waypoints
I never said anything about normal waypoint command
You want to find to which group the selected waypoint belongs to right?
yep
you check get3DENSelected "waypoint" select X select 0 --> Returns group
X being any, if you want 0th waypoint , put 0
that also works, but I find get3DENConnections easier to use, thanks for the method it will help in another script I will have to make
Does not work with laser as far as I am aware
So here is mu code so far:
if (_x checkAIFeature "AUTOTARGET") then
{
_x disableAI "AUTOTARGET";
_x disableAI "AUTOCOMBAT";
_x setSpeaker "NoVoice";
_x disableAI "COVER";
_x setBehaviour "STEALTH";
_x setUnitCombatMode "YELLOW";
hint "Going Tactical";
}
else
{
_x enableAI "AUTOTARGET";
_x setSpeaker "Voice";
_x setUnitCombatMode "GREEN";
_x setBehaviour "AWARE";
hint "Going Green";
}
} forEach (units player select { !isPlayer _x });```
has drawIcon3D GlobalEffect or does it need remoteExec?
My aim are three things
- Show Laser on AI units
2 They are quite
3 Thy only shoot at designated targets
It's fine to engage to get in position
Beside the problem with the voice message the AI is also only attacking the first enemy I assign to them. Afterwards they are just stuck. Not sure why though
you need to add the Eventhandler to every player
Hey, im trying to get into coding/scripting in Arma 3. I got problems on how to check if a static object is out of place/moved. I tried to use the getPos and position command (didnt work obviously). Does anyone know how to do that?๐ค
can't i just do something like this:
["draw3D.sqf"] remoteExec ["execVM", 0];
draw3D.sqf (example):
addMissionEventHandler ["Draw3D", {
drawIcon3D ["targetIcon.paa", [1,1,1,1], ASLToAGL getPosASLVisual enemy1, 1, 1, 45, "Target", 1, 0.05, "TahomaB"];
}];
In description.ext:
class CfgCommunicationMenu
{
class takeCommandAlpha
{
text = "Take Command"; // Text displayed in the menu and in a notification
submenu = ""; // Submenu opened upon activation (expression is ignored when submenu is not empty.)
expression = "execVM 'takeCommandAlpha.sqf'"; // Code executed upon activation
icon = "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\call_ca.paa"; // Icon displayed permanently next to the command menu
cursor = "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"; // Custom cursor displayed when the item is selected
enable = "1"; // Simple expression condition for enabling the item
removeAfterExpressionCall = 0; // 1 to remove the item after calling
};
};```
In `initplayerlocal.sqf`:
```SQF
[player,"takeCommandAlpha"] call BIS_fnc_addCommMenuItem;```
In `takeCommandAlpha.sqf`:
```SQF
LogicSide = createGroup sideLogic;
//TakeCommand Function
BHCCA = LogicSide createUnit ["HighCommand",[0,0,0],[],0,"NONE"];
BHCSA = LogicSide createUnit ["HighCommandSubordinate",[0,0,0],[],0,"NONE"];
BHCSA SynchronizeObjectsAdd [BHCCA];
BHCCA SynchronizeObjectsAdd [_caller];
BA11 = [getPos Spawner, WEST, ["B_soldier_F","B_soldier_F","B_soldier_F","B_soldier_F"],[],[],[],[],[],0] call BIS_fnc_spawnGroup;
_caller HCSetGroup [BA11];```
How do I define the "caller" parameter for the comm menu actions?
This one does though https://community.bistudio.com/wiki/enableIRLasers
you can
caller is always the player.
well I suppose it can be remote controlled unit as well... 
So I did more testing. Given that I disable COVER in my script it seems that the AI is repeating all skipped steps when the AI is enabled again. It almost feels like some actions are temporarily stored and then executed. Is there a way to reset the AI in some way so that this backlog is not being executed?
doStop and doFollow
Thanks
Actually i think the error was that i did not enable the AI to take cover again
Thanks!
What do you mean by static object?
no
it can't be remote controlled unit
is there a way to detect if a unit is stuck in an object/building ?
Usually best to use a timeout.
can you elaborate further?
If a unit hasn't managed to travel 5m in 30 seconds it's probably stuck :P
but I don't want to add that to 200 units
also they are stuck at the start of the map only
so its not like they can get stuck at any point, only at the map start
or at the time when they are spawned
Like you're spawning them randomly and they can't path out of some buildings?
I spawn them next to the building
some spawn inside the slab
now a player comes in
this bot kills the player
and the bot emerges from the slab
the player rage quits
Apparently they haven't played a lot of Arma :P
lol
agents for some reason don't noclip
agents have the same collision as players
but in our scope we are speaking about createUnit
There are various ways to improve spawning but it's difficult to make it perfect.
damn
Using lineIntersects to check for nearby walls & ceilings can help
Also there are some building types that AIs specifically do not know how to path through, so you could maybe avoid those.
oh don't worry about that
because I'm using LAMBS
it adds building path finding
I thought it used what's already there.
Trouble is that some buildings just don't have paths, as far as I can tell.
There's a common one-room building on Altis that they can't leave.
it also allows path finding for editor placed buildings
I remember Lou mentioned using https://community.bistudio.com/wiki/boundingBox for checking if an object is clipping or not
but I don't really know how to use this
Basically you make a box of lines and check each line with lineIntersectsXXX
More lines, more accuracy. Never perfect though.
so when I used lineIntersects
how can I be sure its not intersecting with say
a rock
next to the unit?
It's begPos to endPos, right
yes?
you only check a short distance.
10cm?
Obviously it's not perfect. You get false positives and false negatives.
uh can't be asked really, I will just space out the AI units and their AI group leader should ask them to regroup
too much effort and performance just for something not perfect lol
thank you for the elaboration though, now I understand https://community.bistudio.com/wiki/boundingBox
On what machine are you running this code?
Local hosted server.
It will be dedicated as soon as the various obstacles are overcome.
Yeah, but client or server?
I don't know. Eventually on the server, I think.
There is something odd happening with the AI as soon as I put them in tactical mode. After issuing a move command they show much faster animation with their heads. Almost like being on speed ๐ I don't know if the diasbleAI commands are triggering it. Here's the script:
if (_x checkAIFeature "AUTOTARGET") then
{
doStop _x;
_x disableAI "AUTOTARGET";
_x disableAI "AUTOCOMBAT";
//_x setSpeaker "NoVoice";
_x disableAI "COVER";
_x setBehaviour "AWARE";
_x setUnitCombatMode "RED";
hint "Going Tactical";
}
else
{
_x enableAI "AUTOTARGET";
_x enableAI "COVER";
doStop _x;
//_x setSpeaker "Voice";
_x setUnitCombatMode "GREEN";
_x setBehaviour "AWARE";
hint "Going Green";
}
} forEach (units player select { !isPlayer _x });```
Theres no ";" at the end of the else statement, idk if that maybe is causing issues?
Nah, you don't need a semicolon if the next character is a close bracket.
got a vid of the animation issue?
Tested it
_x disableAI "COVER";
is causing the issue
without this command it works fine
Seems that during a move this command is causing some issue
So as soon as thy stop i mean
But it's triggered by the move command
Could be just an animation issue
Not sure
This is exactly the issue I am experiencing
Thought I do something wrong
But seems to be a bug
Thanks NikoJT
For some reason _selectedGroup is not retaining its value outside of the area it was created. This systemchat is returning "any" but if I put the systemchat inside the if statement then it returns correctly... Anyone know what im doing wrong?
onEachFrame
{
_selectedIndex = lbCurSel 1500;
//systemChat (format ["Index: %1",_selectedIndex]);
if (_selectedIndex != -1) then {
_selectedGroup = RobotGroups select _selectedIndex;
};
systemChat (format ["Group: %1",_selectedGroup]);
};
Is there a way to show a hint persistent on screen until it gets disabled?
A while {<condition>} do { hintSilent "text"; sleep 3} would do it, although the hint would do its usual wait-then-fade on its last cycle rather than disappearing immediately
try declaring _selectedGroup outside of the then {} scope
then it will be modified
Unfortunately I need it to check for it more than on initialization, I suppose I could call a class but then I wouldnt be able to bring it back to the main scope
Oh wait I misunderstood you, sorry
onEachFrame
{
_selectedIndex = lbCurSel 1500;
//systemChat (format ["Index: %1",_selectedIndex]);
private "_selectedGroup";
if (_selectedIndex != -1) then {
_selectedGroup = RobotGroups select _selectedIndex;
};
systemChat (format ["Group: %1",_selectedGroup]);
};
private _selectedGroup = grpNull;
``` is probably faster
or maybe not
ยฏ_(ใ)_/ยฏ
Variables created inside an if scope are destroyed after the if scope is exited. This is normal behaviour, although it is a regular tripping point for people. However, if you're modifying an existing variable, the change persists. Doing what R.A.F. suggests will solve it.
yup it did indeed solve it, thankyou so much the both of you!
You can also try using ctrlCreate to make an RscStructuredText and then waitUntil the right time to delete it. This is more complex but it does mean instant deletion rather than waiting for the hint to expire.
while { _x checkAIFeature "AUTOTARGET" } do { hintsilent "Tactical Mode"};
so this checks if the condition is TRUE
can I also check if the condition is FALSE?
put ! infront of _x in the while check
looks something like this
while { !(_x checkAIFeature "AUTOTARGET" )} do { hintsilent "Tactical Mode"};
! or not means the inverse of the result
somehow this does not work
something is wrong with the syntax
not sure what though
actually the syntax seems to be okay
but it seems that it always returns TRUE
i probably have it wrong
if (_x checkAIFeature "AUTOTARGET") then
{
doStop _x;
_x disableAI "AUTOTARGET";
_x disableAI "AUTOCOMBAT";
_x setBehaviour "AWARE";
_x setUnitCombatMode "RED";
// hint "Going Tactical";
}
else
{
doStop _x;
_x enableAI "AUTOTARGET";
_x setUnitCombatMode "GREEN";
_x setBehaviour "AWARE";
hint "Going Green";
}
} forEach (units player select { !isPlayer _x });
while { !(_x checkAIFeature "AUTOTARGET" )} do { hintsilent "Tactical Mode"};
Well, you've used _x outside of the forEach, so it's not pointing to anything
the _x is probably causing it
yea
what would i need to use to check for the whole group excluding the player?
(units player) - [player]
tk u
any ideas on why using BIS_fnc_fadeEffect is muting audio?
you are passing an array to checkAIFeature
you're looking for findIf
if you're evaluating a whole array to see if anything/nothing meets the condition
but if they're all going to have the same autotarget setting then just select one?
Tyvm!
i meant to say 5
edit: what am i smoking it's 3
Not quite sure that this is the right channel, but I'm new to mission making and Ive spent the better part of today trying to figure this out.
I'm trying to make opfor tanks in a composition fire upon a fuel container with their main guns. The closest I've come is doSuppresiveFire but they just fire the coax. I've tried a Destroy waypoint (they dont think its a valid target) an invisible dummy tank (I guess they don't think its a valid target either), and lookAt + fire (I can't figure out how to get the string of the main muzzle on the turret). Any help would be appreciated
allTurrets and weaponsTurret should give you vehicle weapons.
Automatically distinguishing the "main" weapon might be problematic so I hope you don't need to do that :P
It's probably gonna be the first weapon on turret [0].
Could someone explain to me or show me a template of parameters being applied in an addaction or command menu call?
Example 5 on the addAction wiki page (https://community.bistudio.com/wiki/addAction):
this addAction
[
"title", // title
{
params ["_target", "_caller", "_actionId", "_arguments"]; // script
},
nil, // arguments
1.5, // priority
true, // showWindow
true, // hideOnUse
"", // shortcut
"true", // condition
50, // radius
false, // unconscious
"", // selection
"" // memoryPoint
];```
This includes a use of the `params` command to define the available variables in the script (on activation) parameter. Those variables can then be used in the script that runs when the action is used.
Well, the good news is that I found the string of the main gun! (Its only a specific type of tank)
Bad news is it doesnt wait till lookAt finishes before firing. But its a start, thank you so much
aimedAtTarget
I have seen the example, but I donโt understand it at all.
Your line โincludes a use of the params commandโ is sort of helping me understand, though. I may experiment with this.
Well, I'm not completely sure which parts you don't understand. Do you not understand the parameters used to set up the addAction (e.g. the title, condition, radius)? Or is it that you don't understand how to use the parameters (arguments) passed to the script that runs when the action is used?
For the second case, the params command (look up its wiki page too) takes any arguments passed to the current script - such as the special arguments available in this case, or the arguments used in a function call - and assigns them to the given private variables. For example, if I call a function like this: ["aeiou",2] call njt_fnc_exampleFunction then inside the function I can do this select 0 to retrieve "aeiou" - or I can do params ["_textArgument","_numberArgument"], which automatically sets up a private variable referring to that argument, with a readable name and without me having to do a bunch of select commands if I have multiple arguments. It's the same for an addAction, except it comes with some special arguments that are automatically generated when the action is used.
whats the # command we can do to to detect steam ids again?
I have a general question, on a server if I have a script that contains a global variable but I execute it from/on the client will that global variable still carry over to other clients who are running the same script?
Hmm that link tells me how to broadcast a variable to other clients, that doesnt answer my question though
I think I found my answer on another page, that answer being that no, global variables values are not shared amongst machines if they were called on the individual machines
if they are running the same script and activate the same code paths then yes, otherwise, possibly not
ugh
when you set a global variable it's tied to missionNamespace, which is local to every client https://community.bistudio.com/wiki/Namespace
yeah global variable in that context refers to being accessible regardless of scope, not that it is broadcast
Let me clarify what I meant by global, I need the variable's value to carry over between seperate sqf files but remain unique to the machine that it was called on
Then yes
ok, while we are here and talking about it, whats the best way to call the code on every clients machine
remote exec with -2
remoteExec generally
if the code will be used repeatedly create a CfgFunctions entry for it
keep in mind that the best possible practice would be to define the code locally on each client, by saving it in a global variable, or using functions library and just use remoteExec to execute it
Does that work even if the variables in the code are changing often?
remoteExec will broadcast input during the time it was supplied
you can also pass arguments through remoteExec
if you dont want to update global variables
Hmm ok, ill have to do some digging into the functions library and stuff later down the line then. Thanks for the help again!
set it up once and you're laughing
End goal is to have the script run with a keybind on the clients machine, as performative as possible and allowing for changes in variables while the code is running
such as distances, etc
variables and stuff will work normally with remoteExec, it's just like running a script locally, all it does is tell another pc to run a script
if you use global variables within a loop it'll update on every iteration
does "setWaypointCompletionRadius" work with -1? Like to make it never complete?
If there was a way to ensure it never completed then that would be a much cleaner way to go about what im doing then using a global variable
A Hold waypoint will never complete, IIRC
Hmm Ill give that one a shot as well, thanks!
They don't do a lot of holding there either, but that's Arma AI for you.
Hold seems to work as you described, thanks!
Hi guys. I am not an expert on WHILE loops. Is it correct to assume that the while loop would not keep running if I execute the code once form the debug console?
while { !((units player) select 2 checkAIFeature "AUTOTARGET" )} do { hintsilent "Tactical Mode"};
if (_x checkAIFeature "AUTOTARGET") then
{
doStop _x;
_x disableAI "AUTOTARGET";
_x disableAI "AUTOCOMBAT";
_x setBehaviour "AWARE";
_x setUnitCombatMode "RED";
}
else
{
doStop _x;
_x enableAI "AUTOTARGET";
_x setUnitCombatMode "GREEN";
_x setBehaviour "AWARE";
hint "Going Green";
}
} forEach (units player select { !isPlayer _x });
I am looking to find a way to show the hint as long as the units are in "Tactical Mode".
this code is weird and broken
you only have a closing bracket for your forEach loop
what your code does is execute a hint on almost every frame until the ai exits combat mode, at which point it will set every unit to green and then
nothing?
I hear you
How would you recommend to fix it. I am not sure how to progress from here.
my bad, the while loop checks for autotarget not combat mode
but uh
that while loop is strange
i don't quite understand what you're trying to do
wait a goddamn second
i found the {
and I wish I didn't
@modern meteor if you want to create a loop that runs without interrupting your current script you use spawn
because in sqf nothing will be executed until after the loop is complete
so you run another script concurrently
as a general rule you want to avoid while loops unless you absolutely need them, and if you do add sleep so that the engine isn't repeatedly checking the condition as fast as it can
I don't know how long hints are displayed but lets say a solid 15 seconds
there is no reason to put up the same hint many times a second
So basically my aim with this script is to switch the AI between two modes - "Tactical Mode" and "Green". Both modes enable/disable certain AI functions. This part of the script is fine. When switching between modes a hint is shown. For Green it is fine if the hint fades after some time but for Tactical Mode I would like to keep the hint on screen until I switch mode back to Green.
I am now struggling to find a solution to keep the hint "Tactical Mode" on screen
Not sure what the right approach is to implement this
[] spawn {
itx_tacticalMode = true;
while {itx_tacticalMode} do {
hintSilent "Tactical Mode"; sleep 15;
}
};
this will run a concurrent script to keep the hint up until itx_tacticalMode is set to false, at which point the loop will end and the script will terminate
right, thank you
and where would i need to place it in my code?
i also need to set the variable when switching to Tactical Mode, correct?
it's already set in the expression i wrote
when you switch off of tactical mode you set it to false
however if you want to keep things neat and prevent it from being recycled once the variable is set to true again you may want to set a variable for the script so you can terminate it
itx_tacticalHint = [] spawn {
while {true} do {
hintSilent "Tactical Mode"; sleep 15;
}
};
then
terminate itx_tacticalHint;
to stop it
You can put the sleep 15 inside the while condition
okay, this is very helpful. Thank you. Just trying to understand now where to fit his into my code.
put the first block where you would normally put the hint and the terminate where tactical mode is switched off
just make sure you aren't spawning the code inside a loop
I'm currently experiencing schrodinger's particle effect
It appears in some tests but not in others, I've controlled for wind but I don't know what else could cause this
Is it normal for there to be issues with particles appearing when they're being generated in front of a camera that's across the map from the player?
Still trying to figure this out
For my understanding
itx_tacticalHint is a Global Varaible?
Yes
PIP behaves differently and in mysterious ways
thank god i thought i was losing it
just post your whole code then, maybe someone can point you in the right direction
I tried this but I guess I am doing it wrong with the variable:
while {true} do {
hintSilent "Tactical Mode"; sleep 15;
}
};
{
if (_x checkAIFeature "AUTOTARGET") then
{
doStop _x;
_x disableAI "AUTOTARGET";
_x disableAI "AUTOCOMBAT";
_x setBehaviour "AWARE";
_x setUnitCombatMode "RED";
hint "Tactical Mode";
}
else
{
doStop _x;
_x enableAI "AUTOTARGET";
_x setUnitCombatMode "GREEN";
_x setBehaviour "AWARE";
setVariable [itx_tacticalHint, "False"];
terminate itx_tacticalHint;
hint "Going Green";
}
} forEach (units player select { !isPlayer _x });
is there a workaround for getting the particles to show up?
If you want to try, attach a camera to your players head at eye position, PIP it to a screen size contorl and wlak around
I'll have to experiment with it tomorrow
thank you for saving me potentially hours of staring at my particle effect code
PIP in generla is very meh
Dont rely on it to be visually 1:1
As this would be incredibly taxing on the system
i wonder if i can just teleport the players themselves, freeze them in place, and have them stare at the cool particles lmao
i think it must be if (_x checkAIFeature "AUTOTARGET" == true) then {
You can or jsut use camera
@open fractal one stop shop for camera:
https://community.bistudio.com/wiki/Category:Command_Group:_Camera_Control
oh shit
private _camera = "camera" camCreate [2831.61,13137.5,21.7714];
_camera setDir 103;
private _pitch = 6.5;
_camera setVectorUp [cos (getDir _camera), sin (getDir _camera), 1 / (tan _pitch)];
_camera camPrepareFov 0.2;
_camera camCommit 0;
_camera cameraEffect ["internal", "BACK"];
this is what i have though
That part of the code is working fine
why?
I thought it checks automatically for TRUE, ne?
Does not need camCommit.
it does, true == true is redundant.
try this idk if it works
{
if (_x checkAIFeature "AUTOTARGET") then {
doStop _x;
_x disableAI "AUTOTARGET";
_x disableAI "AUTOCOMBAT";
_x setBehaviour "AWARE";
_x setUnitCombatMode "RED";
itx_tacticalHint = [] spawn {
while {true} do {
hintSilent "Tactical Mode";sleep 15;
};
};
}
else
{
doStop _x;
_x enableAI "AUTOTARGET";
_x setUnitCombatMode "GREEN";
_x setBehaviour "AWARE";
terminate itx_tacticalHint;
hint "Going Green";
};
} forEach (units player select { !isPlayer _x });
This code keeps Tactical Mode hint on the screen as intended. But when I switch back to "Green", it initially shows "Going Green" and then changes to "Tactical Mode" after some time
So I guess it doesn't stop the WHILE loop when switching to "Green"?
you can put isNull itx_tacticalHint in the console to check
if it returns true the script is not active
either that or the variable was overwritten
_x setUnitCombatMode "RED";
terminate itx_tacticalHint;
itx_tacticalHint = [] spawn {
if you throw this in it'll prevent multiple scripts from spawning
not sure about how efficient your script is overall but this will be a quick fix
trying this. 1 sec
No, this does not work
Overwrites "Going Green" with "Tactical Mode" after a few seconds
Even quicker than before
can you please check isNull itx_tacticalHint
sorry, checking
It returns TRUE
While in Green Mode
And false while in Tactical Mode
diag_activeSQFScripts will return active scripts that are running
if the hint is in there then you aren't terminating it
It does not show up in either mode
What is the command to change itx_tacticalHint to FALSE?
I think the problem is that "sleep 15" in the while loop is still pending although i already switched already back to Green.
Stopping the loop probably does not stop it to overwrite hint one more time
Although removig sleep 15 does not solve the problem
So maybe I am wrong
This is the code I am using:
if (_x checkAIFeature "AUTOTARGET") then {
doStop _x;
_x disableAI "AUTOTARGET";
_x disableAI "AUTOCOMBAT";
_x setBehaviour "AWARE";
_x setUnitCombatMode "RED";
terminate itx_tacticalHint;
itx_tacticalHint = [] spawn {
while {true} do {
hintSilent "Tactical Mode";sleep 15;
};
};
}
else
{
doStop _x;
_x enableAI "AUTOTARGET";
_x setUnitCombatMode "GREEN";
_x setBehaviour "AWARE";
terminate itx_tacticalHint;
hint "Going Green";
};
} forEach (units player select { !isPlayer _x });```
that will not work
you're potentially spawning for every unit, so your script handle will be overriden everytime
i didnt notice it was all in a loop
you betrayed me
only spawn once
like this:
if (_x checkAIFeature "AUTOTARGET") then {
doStop _x;
_x disableAI "AUTOTARGET";
_x disableAI "AUTOCOMBAT";
_x setBehaviour "AWARE";
_x setUnitCombatMode "RED";
}
else
{
doStop _x;
_x enableAI "AUTOTARGET";
_x setUnitCombatMode "GREEN";
_x setBehaviour "AWARE";
terminate itx_tacticalHint;
hint "Going Green";
};
} forEach (units player select { !isPlayer _x });
itx_tacticalHint = [] spawn {
while {true} do {
hintSilent "Tactical Mode";sleep 15;
};
};```?
@ sharp: Sorry, I don't know how to do this. My code is still not working.
The code above is still overwriting the hint when going Green
So same problem as before
Maybe I am doing something wrong but it does not solve the issue
Here is the code i am using:
while {true} do {
hintSilent "Tactical Mode";sleep 15;
};
};
};
{
if (_x checkAIFeature "AUTOTARGET") then {
doStop _x;
_x disableAI "AUTOTARGET";
_x disableAI "AUTOCOMBAT";
_x setBehaviour "AWARE";
_x setUnitCombatMode "RED";
}
else
{
doStop _x;
_x enableAI "AUTOTARGET";
_x setUnitCombatMode "GREEN";
_x setBehaviour "AWARE";
terminate itx_tacticalHint;
hint "Going Green";
};
} forEach (units player select { !isPlayer _x });
do you need this to be per-unit, or should the entire team switch their behaviour?
The whole AI team is switching between Tactical and Green
(eg. enabling/disabling AI)
then maybe switch from checking every unit to only checking one and then setting the state for all? Something like sqf private _nonPlayer = units player select { !isPlayer _x}; if (_nonPlayer isEqualTo []) exitWith {}; if ((_nonPlayer select 0) checkAIFeature "AUTOTARGET") then { { doStop _x; _x disableAI "AUTOTARGET"; _x disableAI "AUTOCOMBAT"; _x setBehaviour "AWARE"; _x setUnitCombatMode "RED"; } forEach _nonPlayer; hintSilent "Tactical Mode"; } else { { doStop _x; _x enableAI "AUTOTARGET"; _x setUnitCombatMode "GREEN"; _x setBehaviour "AWARE"; } forEach _nonPlayer; hintSilent "Going Green"; };
also, setUnitCombatMode "RED" ("RED" : Fire at will, engage at will/loose formation) with disableAI "AUTOTARGET" sounds fun ๐
Thanks but this is not working. The Tactical hint is fading after 15s
The problem is not the different modes
My initial version is fine
Only thing which is not working is to keep the hint on screen while in Tactical mode. And fade it in Green mode.
ah, sorry, looks like i'm mixing stuff up
This is my latest version:
while {true} do {
hintSilent "Tactical Mode";sleep 15;
};
};
};
{
if (_x checkAIFeature "AUTOTARGET") then {
doStop _x;
_x disableAI "AUTOTARGET";
_x disableAI "AUTOCOMBAT";
_x setBehaviour "AWARE";
_x setUnitCombatMode "RED";
}
else
{
doStop _x;
_x enableAI "AUTOTARGET";
_x setUnitCombatMode "GREEN";
_x setBehaviour "AWARE";
terminate itx_tacticalHint;
hint "Going Green";
};
} forEach (units player select { !isPlayer _x });
It keeps the Tactical hint on screen but some the Going Green hint gets overwritten by the Tactical Mode hint
I don't know how to fix it
{itx_tacticalHint = [] spawn { while {true} do { hintSilent "Tactical Mode";sleep 15; }; }; };
this will do literally nothing though?
it will just get cleaned off the stack afterwards
(group player) setCombatMode "RED" and loop like sqf while {combatMode group player isEqualTo "RED"} do { hintSilent "Tactical Mode"; sleep 15; };?
also what sharp says ๐คทโโ๏ธ
This would conflict with normal Combat Mode I guess?
make it your own variable then ๐คทโโ๏ธ
In case it is not obvious yet, I am by no means an expert on scripting ๐
How would i do this?
Understood, thank you sharp. Any idea how to solve it?
It keeps the Tactical hint on screen
with the way you have right now, there should be no "Tactical Mode" hint showing at all
so either you're executing some other code elsewhere, or what you sent is not what you actually are using
sorry
Had a bracket wrong
This is what i am using:
while {true} do {
hintSilent "Tactical Mode";sleep 15;
};
};
{
if (_x checkAIFeature "AUTOTARGET") then {
doStop _x;
_x disableAI "AUTOTARGET";
_x disableAI "AUTOCOMBAT";
_x setBehaviour "AWARE";
_x setUnitCombatMode "RED";
}
else
{
doStop _x;
_x enableAI "AUTOTARGET";
_x setUnitCombatMode "GREEN";
_x setBehaviour "AWARE";
terminate itx_tacticalHint;
hint "Going Green";
};
} forEach (units player select { !isPlayer _x });
Works except from Green hint gets overwritten by Tactical mode after a few seconds
are you running this code only once?
have you restarted the mission from previous executions?
because it will overwrite the script handle like i said, the code should work otherwise as is
yes
yes, restarted the mission
same error
so you don't run it once ๐
sounds like you spawn two while loops and only kill the second one afte that. Something like this may be a fix then ```sqf
if (isNil "itx_tacticalHint" || {isNull itx_tacticalHint}) then {
itx_tacticalHint = [] spawn {
while {true} do {
hintSilent "Tactical Mode";sleep 15;
};
};
};
{
if (_x checkAIFeature "AUTOTARGET") then {
... and so on```
run once for each switch between Tactical and Green
trying this
This seems to work perfect
Have to admit this was much more complex than I thought
Could not have solved this myself
Thank you both for your help!
Smth like a table; im using a bomb trolly
3den placed?
position and getPosATL should definately work for those
yep
^^
is there a way to limit regexReplace to only the first hit?
thank yoiu
that would be #arma3_config I believe ๐
I'll post it there and leave it here too if it's ok. As I feel like it's both scripting and config
Or just tell me to delete it
as per the no-crosspost, it will be there only
it is not scripting as there is no scripting to debug here ๐
I have a mission with custom music that plays from an object (radio), but I only want that music to start once they get close to that object. anyone know of a script (prob in relation to a trigger) that can make that happen?
So I have a script for spawning 3 groups at 3 unique points out of pointPool. While this does work, all of the points in that array of markers are scattered throughout Fallujah. I didn't really give much thought of how long it would take an AI squad on foot to traverse that distance if they spawn at one of the further markers.
Instead, I would like to have those 3 groups spawn at the 3 closest markers instead. I figure I should be able to do this with some combination of distance and selectMin, but I'm not sure what to start with or how to reference back to the marker as.
Perhaps get the distance to the marker relative to leader reconTeam and then just use a math comparison to find what marker I'm trying to spawn units at?
I'm assuming the music plays through a 3Dsound module? if so, just sync the module to a trigger. The module will then only play when the trigger gets activated.
If you mean scripting, still use a trigger, just remoteExec along with playSound or playSound3D with the music that you want played. This does require you to use CfgSounds for that song rather than CfgMusic like you usually would for music.
playSound3D uses a file path, not CfgSounds, and shouldn't be remoteExeced because it has global effect
^Listen to them, they know more than I do. I've only seen those pop up in autofill, haven't used them myself.
*and you should definitely use playSound3D or say3D because playSound is not positional
I'm very unfamiliar with this stuff, and someone just gave it to me:
in description.ext:
class CfgSounds
{
tracks[]={};
class Track01
{
name = "Trackname";
sound[] = {"\Trackname.wav", 100, 1.0};
titles[] = {};
};
};
and on the object:
this say3D ["Trackname",0,1];
So im not overly sure ๐
playSound is the direct equivalent to playMusic and does use CfgSounds. However, also like playMusic, it's a "2D" sound - it simply comes from "the game" rather than a position in 3D space.
Noted.
Well, obviously you should replace "Trackname" with whatever the actual name of the file is, to start with.
Secondly, that say3D is largely correct except for some reason the maximum distance is set to 0 metres.
What you would want to do is place a trigger on the area that you want (e.g. a 10 metre circle around the radio) and set its activation type to ANY PLAYER. Then place this in the trigger's On Activation code field:
obj_yourRadio say3D ["Trackname"];```
Then on your radio, remove the code from its init field, and set its variable name to `obj_yourRadio` (or whatever name you want but remember to change it in the trigger too).
What this does is, when the trigger is activated by any player entering it, it causes all clients to run that `say3D` command, which makes the radio play the sound. You can see I've removed the extra 2 parameters from `say3D` - this means that instead of being audible only at a range of 0 metres or less, the default value is used, so it can be heard at up to 100 metres once it starts playing.
Thank you! apparently it gave me an error so I made it so its: obj_yourRadio say3D ["Trackname",30,1]; and it works.
That's a little weird since those are supposed to be optional ๐ค however, in the future you can definitely skip all optional parameters by omitting the [] (object say3D "trackname")
sounds good, for a next time, I do still need those line of code as mentioned for in description.ext correct?
Yes, for say3D the sound must be defined in CfgSounds
Cool, thanks a lot!
greetings. I am trying to make players have a loadout at mission start which is randomly taken from an array. Which is done like this: playerLoadout = selectRandom playerLoadoutArray; player setUnitLoadout = _playerLoadout; which is the initPlayerLocal.sqf and in my init.sqf i have all the loadouts:```// all the different player spawn loadouts:
_playerLoadout01 = [[],[],[],["U_C_IDAP_Man_Jeans_F",[["ACE_EarPlugs",1]]],[],[],"H_Cap_blk","",[],["ItemMap","","","ItemCompass","ItemWatch",""]];
_playerLoadout02 = [[],[],[],["U_C_ArtTShirt_01_v5_F",[["ACE_EarPlugs",1]]],[],[],"H_Hat_brown","",[],["ItemMap","","","ItemCompass","ItemWatch",""]];
_playerLoadout03 = [[],[],[],["U_C_Poloshirt_salmon",[["ACE_EarPlugs",1]]],[],[],"H_MilCap_gry","",[],["ItemMap","","","ItemCompass","ItemWatch",""]];
playerLoadoutArray = [_playerLoadout01, _playerLoadout02, _playerLoadout03];``` However when i try to set it i get an error stating: Error Invalid number in expression. I am not quite sure as to what is going wrong.
oh hold up found a typo
still causes the same error. Does anyone have any tips on how to set the loadout of a player on startup?
In multiplayer, init.sqf is executed after initPlayerLocal.sqf, so you have a structural problem there. You may as well have the loadouts in initPlayerLocal.sqf as well.
In playerLoadout = selectRandom playerLoadoutArray, it should be _playerLoadout, but I'm guessing that's the typo you fixed.
ahh i didnt know that
yea that was the typo i saw and fixed
even after putting it all into the initPlayerLocal.sqf i still get the same errors
it's getting a bad result back from this bit: _playerLoadout = selectRandom playerLoadoutArray;
Make sure that all the loadouts and the definition of playerLoadoutArray come before the selectRandom line in the file.
Also, this line is wrong: player setUnitLoadout = _playerLoadout - it should be player setUnitLoadout _playerLoadout.
changing the player setunitloadout line to what you mentioned was the thing that fixed it. Thank you !
that was the typo error i had
How would you shuffle an array and then output the results as new variables? I'm trying to set a set a schedule for a hostage transport to appear at three random places throughout the day. I've got the way to shuffle the array with BIS_fnc_arrayShuffle but how do you output the result into new variables?
I haven't had to use that but based on my experience with populating arrays:
_yourNewArray = [1,2,3] call BIS_fnc_arrayShuffle;```
Note: I may be wrong, but should probably be enough to test this on your own.
_wp represents a waypoint, once I delete said waypoint shouldnt this if statement no longer trigger?
if (!isnil "_wp") then {
no. you delete what the variable represents
not the variable
the var (and its value) still exists
so it's not nil
hmm ok, I tried
_wp != [];
but that didnt work either. Is there a consistent way to check if a variable has no assigned value?
giving count a shot, maybe that'll work
_
count didnt work either, maybe there is something wrong with my statement script that deletes the waypoint?
_wp setWaypointStatements ["true", "deleteWaypoint [group this, currentWaypoint (group this)]"];
Figured out what I needed. Turns out BIS_fnc_sortBy exists.

@opal zephyr Your problem there is that deleteWaypoint doesn't touch _wp.
_wp is just a [group, index] array that's left untouched by waypoint commands.
Hell, because waypoints get reindexed when removed (and sometimes when added), it doesn't even necessarily refer to the same waypoint, or a valid waypoint. It just remains as [group, index].
@granite sky Alright, so am I missing something major or is there really no good way to detect when a waypoint is completed apart from just checking the number of active waypoints?
There is no good way to do anything with waypoints. Everything is terrible.
I'm just gonna point out again that setWaypointStatements runs globally so you can cause disasters with it if you're not careful.
If you have control over the waypoints then probably best to use currentWaypoint to figure where it's got to.
No this is a good solution already
_distances = _pointPool apply { START_POS distance (getMarkerPos _x) }
//then you can use selectMin to find the lowest element and then search again for that to get the index
lol but yeah
unfortunately this is the best we have for determining if a waypoint is complete with no ambiguity
https://community.bistudio.com/wiki/setWaypointStatements
This command is like setting the 'Condition' and 'OnActivation' boxes in the editor
otherwise you're either just doing a check to the number of waypoints a group has
or if you need to know more about a waypoint you'll end up writing a helper script that basically just deserializes it using all the waypoint commands
and checking against that
would be nice to get a waypoint type
private _startPos = ASLToAGL getPosASL leader reconTeam;
private _distances = _pointPool apply { [_startPos distance getMarkerPos [_x, true], _x] };
_distances sort true;
private _closest = _distances select 0 select 1;
@tranquil jasper @copper raven
Why not just do this?
_spawnPointDistance = [pointPool, [],{ (leader reconTeam) distance (getMarkerPos _x) },"ASCEND"] call BIS_fnc_sortBy;
if (((leader reconTeam) distance (getMarkerPos (_spawnPointDistance select 0))) < 100) then {
_offset = 1;
};
_sp1 = _spawnPointDistance select (_offset);
_sp2 = _spawnPointDistance select (_offset + 1);
_sp3 = _spawnPointDistance select (_offset + 2);```
It would even allow me to shift down the array if they are too close to the first if needed.
If you can be patient for 2.10 release, there will be waypointCompleted EH released.
There are surely other ways but if you want like the easiest easiest way... :)
Thanks for letting me know!
2.10's most recent officially estimated (estimated, not confirmed) release date is "late summer"
Ill be forced to use something else then, maybe some combination of move will work. I only used waypoints originally because of things like set formation
When I did it originally I think my brain skipped over the fact that I could still modify formation and speeds even outside of a waypoint
is there a way to sync an editor module to a trigger created by script?
is it normal that fadeSound only works for a second on dedicated?
i run 0 fadeSound 0 locally and it goes silent for about a second and then undoes itself
odd, it keeps resetting to 1
anyone got any suggestions on how to remove respawn positions when a player is downed/unconscious?
essentially I am asking how BIS_fnc_showRespawnMenuDisableItem works
ok well I've figured that out, now I'm curious how to run something when the respawn menu has opened
If I run a generic execVM, itโs executed globally, right?
do you mean a generic remoteExec
No, I am trying to figure out where execVM is firing. I couldnโt get remoteExec to work as far as I can tell.
execVM doesn't execute remotely no
Itโs not global at all? So if I *execute it from initplayerlocal, it only runs on that player?
That makes sense.
If I wanted to run [] execVM โTakeCommand.sqfโ from a remoteexec, whatโs the easiest way to do that for now to help me understand that locality.
does remote have the same file?
The same file? The sqf Iโm trying to run is in the mission file that the dedicated server is running, if Iโm understanding the question.
is it in the mission
yeah it's in the mission
uhhhh
I believe you want [[], "TakeCommand.sqf"] remoteExec ["execVM", <number>];
then
[[], "TakeCommand.sqf"] remoteExec ["execVM", <whoever remote is>];
I guess...
Okay! Thanks!
Iโll define it as a function and all to do it right once I get it working.
Actually even "TakeCommand.sqf" remoteExec ["execVM", <target>]; is enough I believe but u probably got some args...
Thanks! Both of those versions worked well!
Is terrain damage local?
I'm looking at a radio tower that has both the alive and dead model
how do you select the effective group leader?
what is that lol
like, when a player is downed, someone takes command right?
how do I get that person?
that doesn't work because that returns the dead unit that is technically the group leader
even though someone else has taken command
can you post some of your script
does _player have player?
I'm willing to bet yes given that my test was successful
when player becomes unconscious, player is kicked from current group and put in a new group by itself
so do this instead:
[group _player] spawn {
params ["_group"];
you need reference to the past group, not player current group
np
and not sure why you have alternate syntax for for since you're not doing anything that the regular syntax doesn't do, but since you do you should put private _i because it's not scope safe
@tranquil jasper are you sure about this?
I am testing this rn and group player (incapacitated) is R Alpha 1-1
and group bis_o2_17 (friend who is dead) is.. R Alpha 1-1
I tested it with a group I named in the editor
actually yknow what. let's actually ask the real question I'm trying to answer
how do you make the vanilla respawn system not let you respawn on an incapacitated squadmate?
because right now it'll let you and that sucks
This method of creating high command for units spawned during a mission works. I'll define this as a function eventually to do it the right way. This (apparently) allows players to join a server and be assigned command of subordinates when they are spawned via their script. A ton of time sank into figure out this problem. Now my supports aren't working. They can't be run in this script for some reason.
All of this works.
InitPlayerLocal.sqf:
If ((!isNil "BHA66") and {player == BHA66}) then { //Ensure unit exists and player is unit.
"TakeCommandBA.sqf" remoteExec ["execVM", 2]; //Execute only on server.
};```
TakeCommand.sqf:
```SQF
WaitUntil {!isNil "BA4R"}; //Wait until support radio unit exists.
If (!isNil "BHA66HC") then {deleteVehicle BHA66HC}; //Fight redundancy.
If (!isNil "BHA66HCS") then {deleteVehicle BHA66HCS}; //Fight redundancy.
//High command block.
BHA66HC = LogicSide createUnit ["HighCommand",[0,0,0],[],0,"NONE"]; //Create commander module.
BHA66HS = LogicSide createUnit ["HighCommandSubordinate",[0,0,0],[],0,"NONE"]; //Create subordinate module.
BHA66HS SynchronizeObjectsAdd [BHA66HC]; //Synchronize subordinate to commander module.
BHA66HC SynchronizeObjectsAdd [BHA66]; //Synchronize commander module to commander.
{BHA66 HCSetGroup [_x];} foreach [BA11, BA12, BA13, BA21, BA22, BA23, BA31, BA32, BA41, BA42]; //Assign commander to subordinate groups.
Meanwhile this block, if within the same script does not work:
BA4R = LogicSide createUnit ["SupportProvider_Artillery",[0,0,0],[],0,"NONE"]; //Create provider module.
BA4R setVariable ['BIS_fnc_initModules_disableAutoActivation', false]; //Enable manipulation of module initialization.
BA6R = LogicSide createUnit ["SupportRequester",[0,0,0],[],0,"NONE"]; //Create requester module.
BA6R setVariable ['BIS_fnc_initModules_disableAutoActivation', false]; //Enable manipulation of module initialization.
[BA6R, "Artillery", -1] call BIS_fnc_limitSupport; //Define support module traits. Throws error if omitted.
[BA6R, "CAS_Bombing", -1] call BIS_fnc_limitSupport;
[BA6R, "CAS_Heli", -1] call BIS_fnc_limitSupport;
[BA6R, "Drop", -1] call BIS_fnc_limitSupport;
[BA6R, "Transport", -1] call BIS_fnc_limitSupport;
[BA6R, "UAV", -1] call BIS_fnc_limitSupport;
[BA4R, BA6R] call BIS_fnc_initModules; //Initialize module. Not required on local host. Doesn't fix dedicated host.
BA42MA synchronizeObjectsAdd [BA4R]; //Synchronize mortar to support (artillery/mortar)provider module.
BA4R synchronizeObjectsAdd [BA6R]; //Synchronize provider to requester.
BA6R synchronizeObjectsAdd [BHA66]; //Synchronize requester to caller.
[BHA66, BA6R, BA4R] call BIS_fnc_addSupportLink; //Assign commander fire support.```
I have not been able to solve why this doesn't work. This block works in nearly any context when hosted locally, but doesn't work in nearly any context when on a dedicated server.
anyone know how to remove grass server side on DayZ?
this is the Arma Discord Server
With waypoints no
With some other stuff that have a dedicated data type yes
E.g. when you delete an object, the value points to objNull
Or for groups, grpNull
etc.
any eventhandler to do the same thing as "onPlayerKilled.sqf"?
Killed, MPKilled, mission EH EntityKilled
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers
Ok, so nothing player specific?
You can pretty easily choose to only add the EH to players, or check whether the unit is a player when it fires
could anyone be able to explain me why it returns the following? https://cdn.discordapp.com/attachments/735132698603159562/974661501975687198/unknown.png
relevant code : ```sqf
[
establishmentShot,
"BLUFOR and OPFOR firefight",
25,
20,
30,
1,
[
//["\A3\ui_f\data\map\markers\nato\b_inf.paa",[0,0.3,0.6,1],group_1,1,1,0,"BLUFOR"],
//["\A3\ui_f\data\map\markers\nato\o_inf.paa",[0.5,0,0,1],group_2,1,1,0,"OPFOR"]
],
0,
true,
15
] spawn BIS_fnc_establishingShot;
There doesn't appear to be anything wrong with that function call in itself. My suspicion is that it's trying to compete with another function that's also trying to do fade-in or fade-out. I do not know what other function you might be calling that's conflicting.
i doubt that it's conflicting since i literally have no code but init.sqf
which runs the code snippet i've sent
I suspect there are bugs with that, but I haven't pinned down a replication case.
The Edit Terrain Object module is well-known to be fairly unreliable in multiplayer
e.g. setting door states doesn't work
There is no apparent problem with the code you've sent and the displayed error message indicates a conflict. This is all the evidence I have access to.
I removed everything I had to check whether there was some kind of hidden scripts but in vain
Is it possible to create a hud that shows the player's VON volume,
like a bar going up and down in the range from 0 to 1?
is the getPlayerVoNVolume command the correct command in this case?
here a whole bunch of screenshots https://cdn.discordapp.com/attachments/735132698603159562/974666106843324456/unknown.png https://cdn.discordapp.com/attachments/735132698603159562/974666147452559360/unknown.png https://cdn.discordapp.com/attachments/735132698603159562/974666184433750056/unknown.png https://cdn.discordapp.com/attachments/735132698603159562/974666209796718662/unknown.png https://cdn.discordapp.com/attachments/735132698603159562/974666285134778438/unknown.png
so you can further investigate
execVM "init.sqf" wat
You're running init.sqf twice. Once from the object init field and once automatically.
I'm trying to recompile a single RHS pbo - I have it extracted successfully, modified successfully (?), and it builds successfully. All of the normal ArmA 3 functionality provided by the modified pbo file, except for the scripts in the scripts directory.
In the config.cpp file, it contains these lines:
class turretBlow
{
file = "\rhsafrf\addons\rhs_c_t72\scripts\rhs_turretBlow.sqf";
description = "T Tanks turret blowoff";
};
I did not modify this at all.
When loading the unmodified pbo file, the turretBlow class in Functions Viewer is populated by the contents of the above referenced script.
However, using the modified pbo, the turretBlow class is referenced but it contains no data.
Any thoughts on this?
What if you recompile the PBO without modifying anything?
i tried that as well - class contains no data
im assuming its some sort of path issue, maybe when creating the pbo with addon builder
Well, you need the right -prefix
i played around with the directories, i wonder if i need to specify the addon path
hrm
let me give that a shot
prefix for that one should be "rhsafrf\addons\rhs_c_t72"
just tried with "rhsafrf\addons\rhs_c_t72" and same - no data, hrmmmm
shrugs
config viewer is really unreliable for me with mods loaded anyway
Like you click on something a few levels deep and it kicks you to something empty in the root.
@rose osprey halt
But config commands are fine.
ya let me try one more thing
This is not correct way to do stuff
indeed
RHS will burn you if you publish this kind of things
i have no interest in publishing anything
patching is fine too :P
If one wants to do a patch, one does it as separate addon, not repack of existing addon
indeed
Better to do things right from the beginning instead of climbing ass front to a tree
i like trees
in case this went down
also, like, #arma3_config pliz? ๐
Hello there, again me.
I need to fire an event the moment player joins the game and loads into the briefing/game.
I need to have all his info available, name, uid, group, roleDescription and side.
Any ideas which event should I hook?
so far I tried OnUserSelectedPlayer, but the UID and roleDescription is null.
I need it to be run on the server, not on the player
The only idea I got rn is to remote exec an exec remoting back to server with the info
But that feels so wrong
I am aware that this exists, sadly I am writing an addon (only addon) and I don't think I can "hook" into this one, or can I?
(We are trying to keep the mission framework itself independent from any mods and the mod from any mission frameworks)
That might help me, I'll look into it, thank you
is it possible to get any return values when using remoteExecCall ?
Do you want to return ID of who made the remoteExecCall?
I've a server side function which needs to be called via the client, but the client should have the return values of the calculation of the server side function
Hi guys. I was messing around in Editor and i found this fnc:
[cursorObject,4,3,1,false] call BIN_fnc_deconShowerAnimLarge
i am executeing it via console in Singleplayer while looking at Large decon shower. But everytime i try to execute it my arma just crash and it says application hang. Is this like a bug or is it just crashing on my laptop ?
spawn it instead. Your game does not crash, it is taking its time and it takes too long time to return error because it has to be spawned.
i did it the proper way and it still didnt work
then i looked at the addon builder options and it only had the default files included - added sqf to the list and it works now
proper way meaning separate new addon that does not repack RHS files, only contains your new files and configs that make config alterations?
correct
๐
asking again, how should I use BIS_fnc_showRespawnMenuDisableItem? if I pass it things it never seems to disable the correct position.
if I edit BIS_RscRespawnControls_positionDisabled directly it works but only after i click on a different respawn pos first
oh I see, it's because this expects the target object to be a string
๐คฆโโ๏ธ
DayZ is arma related
any idea how to make the map disabled in the respawn screen first time through?
respawnOnStart = -1; in Description.ext
cool ty
also, can you disable tactical ping via script?
disableMapIndicators nvm
You can disable those with difficulty settings.
yes but i want to do it by script
Why?
because I don't want to change global difficulty settings for one mission?
You can try this in InitPlayerLocal.sqf
(findDisplay 46) displayAddEventHandler
[
"KeyDown",
{
_handled = false;
if (_this select 1 == 20) then
{
_handled = true;
};
_handled;
}
];``` Credit to GEORGE FLOROS GR
or do you mean I can set the difficulty for the mission specifically
You can always set difficulty for mission...
Just need to specify the difficulty in description.ext if I remember correctly
i dont believe that's possible with custom difficulty settings
basically i want to disable 3d markers but only in this mission
this is messy because it blocks the key rather than the ping
if someone has something else bound to that key it'll block that too
and if i'm reading it right it keeps you from using the T key altogether?
yeah that would
can you not set difficulty settings per mission?
https://community.bistudio.com/wiki/disableMapIndicators like, does this actually do anything?
these are the only commands available for difficulty
otherwise if it's not in description.ext then you have to edit the server settings
why do folders don't work in paths? https://cdn.discordapp.com/attachments/735132698603159562/974719554448146432/unknown.png
i thought there was a force difficuly in description.ext but i might be thinking of server config. regardless if you want custom settings you need to edit the profile
author = "Test";
onLoadName = "Test";
onLoadMission = "Test";
loadScreen = "images/loadingscreen.paa";
I remember having came across this problem but i don't know how to fix it anymore
like so ? "\images/loadingscreen.paa";
ยฏ_(ใ)_/ยฏ
loadScreen = "images\loadingscreen.paa"; yea like a so
thanks
i saw it but i thought \ and / were fundamentally the same
another "nitpick" of arma
In SQF its / and in C language is \ for formating directories and so.
yeah not an arma thing, it's an inconsistency between .sqf and cpp files
arma takes c++ for config and sqf for scripts
right
So what I'm trying to do is take an array of three locations, shuffle them, and then use that random order to determine the schedule that a hostage will be at during the day, so I'd be looking to take _zoneA, _zoneB, and _zoneC, shuffle them, and output _siteMorning, _siteAfternoon, and _siteEvening.
private _shuffled = [_zoneA,_zoneB,_zoneC] call BIS_fnc_arrayShuffle;
_shuffled params ["_siteMorning","_siteAfternoon","_siteEvening"];
then you can just use the variables
Brilliant. Thanks.
yw
Does anyone know that little block of code that can be run in debug to dump a function to your clipboard? I lost it and it was amazing and my favorite.
https://community.bistudio.com/wiki/copyToClipboard you mean this ?
Itโs like โBIS_FNC_Whateverโ Magic command that unpacks and sticks in clipboard to examine.
Possibly, but thatโs not looking familiar. This didnโt just copy some input, it unpacked whole functions for you to pick through line by line. Iโll try this, though!
oh you mean the function export function?
