#arma3_scripting
1 messages Β· Page 755 of 1
Hey ! If you have like a box in the backpack that you can put in on the ground with ace, is it possible to put things in and pick it up back in your backpack and it save the items in ?
Like a backpack in the back pack ?
technically yes, but sometimes the items get too large to fit in things like that. it really depends on the item class
okay it's mostly for medical equipment. Do you have a link where i can look
Anyone know what might be wrong here? Says expected object, type nothing under MoveinDriver
AirDropper = "B_T_VTOL_01_vehicle_F" createVehicle [0,0,0];
AirDropper setPos (getpos Drop_Plane_Spawner);
_grp2 = CreateGroup west;
_grp2 addvehicle AirDropper;
_unit2 = _grp createUnit ["B_CREW_F", [0,0,0], [], 0, "CARGO"];
_unit2 moveInDriver AirDropper;
_unit2 domove Drop_plane_Waypoint;
there is no _grp in ur code but _grp2, that is probably why it is not creating the unit, thus type nothing.
damn, didnt even notice. Thanks
tell me exactly what you are trying to do
So i have a ''bag'' that i can carry in my backpack. with ace i can put it on the ground and it has an inventory. I would like to be able to use this inventory and add things in it and then bring it back in my backpack and i want the inventory to be saved if it's even possible
let me test with ace to see what you are talking about vs vanilla. give me a sec.
saw you writing a lot of things lmao is everything okay ?
this is ACTUALLY apparently a very complicated idea scriptwise using eventhandlers. I had something for you, and its getting deeper, and deeper, and deeper as I keep testing lol
issues with when the take eventhandler is firing
lmao i see well i'm really bad at creating config so it will be even more hardcore for me to understand X)
But yeah i taught it would be a great feature as we play a rp pmc unit we use a shit ton of things and i would like to organise medical stuff and like roles stuff into ''bags'' ready to be taken in the backpack
good puzzle. i will figure it out
so if it's too complicated to be done well i guess we'll just keep putting things randomly in the inventory lmao
well don't burn your brain ^^
But yeah keep me in touch if you find something i would love to hear about that
well we don't use vanilla interaction so it wouldn't be much of an issue technically
yeah but if I'm going to work on it, I'm gonna make it compatible with both. just how it is
Damn i created a work monster lmao.
I would love that you keep me in touch about that ^^
so I got this for you so far...
player addAction [
"Stack Nearest Backpack",
{
params ["_target", "_caller", "_actionID", "_arguments"];
// Find nearest groundholder
private _nearGround = nearestObject [_caller, "GroundWeaponHolder"];
if (isNull _nearGround) exitWith {systemChat "No Nearby Ground Holder"};
// Find nearest backpack
private _nearbp = everyBackpack _nearGround;
if (_nearbp isEqualTo []) exitWith {systemChat "No Nearby Backpacks"};
if (count _nearbp > 1) then {
// Sort by item amount
_nearbp = ([
_nearbp,
[],
{count itemsWithMagazines _x},
"ASCEND"
] call BIS_fnc_sortBy) select 0;
} else {_nearbp = _nearbp select 0};
// Grab player backpack
private _playerbp = backpackContainer _caller;
if (isNull _playerbp) exitWith {systemChat "You Have No Backpack Equipped"};
// Grab items in nearest backpack
private _items = itemsWithMagazines _nearbp;
// Add bp to current bp
_playerbp addBackpackCargo [typeOf _nearbp, 1];
// Add items to stacked bp
_items apply {
backpackContainer _nearbp addItemCargoGlobal [_x, 1];
};
// Delete near bp
clearBackpackCargo _nearGround;
},
nil, 1e-2, false, true, "",
"private _obj = nearestObject [_target, 'GroundWeaponHolder'];
(!isNull _obj) && {(_target distance _obj < 10)}",
-1, false
];
only issue is that it deletes every backpack in that specific ground weapon holder. will mess with it more later, but this is functional for what you need
currently it grabs the most filled backpack in the nearest ground holder (not counting weapons, can add that later)
Bro you worked 3 hours on this π€
Ill have a look tomorrow ( 1am here )
But already thank you so much for the time you took cant wait to try it
yeah the girl I've been seeing cancelled on me tonight so I had some time lol
Bruh..
Happy that it kept you occupied lmao
I'm making a holdAction that has the condition of the player having a Tool Kit, Item_ToolKit isnt working.
From a previous issues I found that to check for an Explosive Charge I need to look for 'DemoCharge_Remote_Mag', what is the best way to find an item's inventory name?
its just "ToolKit"
"'ToolKit' in items _this" for your hold action condition
Item_ToolKit
i've been there
there an up to date list on all the reserved variables?
Every script commands are reserved
oh i see what happened. i missed something and tried to overwrite a script command lol
worked until some version in A2β¦ not anymore π
true = false π
you know what would be cool? an event handler for when a group changes combat behaviour, passing the group and mode.
awwwwwwwwwww yes, no more triggers or loops for detection!!!!
where do you find the upcoming changelog?
precisely what I did π€£ I can tell you that even the start menu did not work well after that π
can someone help me I got a question and i know it should be easy i just dont know how to do it
Okay so i have an arsenal in my mission and it works fine its a whitelisted one, the problem is the scroll menu option pop up even when people arent looking at the arsenal.
#community_wiki . Not documented well (yet) but coming soon
i found this online this addAction ["<t color='#0099FF'>Access Arsenal</t>",{["Open", true] spawn bis_fnc_arsenal},[false],1,false,true,"","(_target distance _this) < 4"]; but that only opens up the regular arsenal i need to find out how i can run an execvm with the target distance
this is what i use currently this addAction["Open Virtual Arsenal", {null = [_this] execVM "whitelisted_arsenal\virtual_arsenal_init.sqf";}];
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
thank you
this addAction ["<t color='#0099FF'>Access Arsenal</t>",{["Open", true] spawn bis_fnc_arsenal},[false],1,false,true,"","(_target distance _this) < 4"];
this addAction["Open Virtual Arsenal", {null = [_this] execVM "whitelisted_arsenal\virtual_arsenal_init.sqf";}]; ```
its because you haven't given addAction a radius argument yet (it defaults at 50m)
(and you should add the action to the box, not the soldier)
I was reading that but Im new to scripting and I don't know how i would type it in the second code
Yes I currently have it on an ammo box.
I just dont know how to type the code to add the target distance to execute the arsenal.
this addAction [
"Open Virtual Arsenal",
{
[_this] execVM "whitelisted_arsenal\virtual_arsenal_init.sqf"
},
nil, 10, true, true, "", "true", 4
];
that "4" is the radius
Im going to test it right now thank you so much
Every programming starts from reading something! π
Thanks! ya i read that and thats where i found out the first code example #2 i just couldn't find anything examples on it with distance
works perfect your the man hypoxic
I really suggest you read
https://community.bistudio.com/wiki/Code_Best_Practices#Code_format
https://community.bistudio.com/wiki/Code_Optimisation#Make_it_readable
so you can make things more readable for you and others
@proven silo
@fair drum i just tested my arsenal and i got this message
What you sent me works to launch a regular .sqf command, but for my whitelisted arsenal Im getting an error l
oh just add [_this] before your execVM.
[_this] execVM "blah"
That fixed it, thank you again π
Have anyone tried spawning units using Createunit, where the unit did not target enemy faction?
instructions unclear, soldiers stuck @ [0,0,0]
what are you trying to do, a "dumb" unit who will not fight?
you could either createAgent (to have a really dumb AI / no AI) and/or use disableAI "all" on it in order to not consider its brain
No, I am trying to create a unit who will attack enemy forces, but for some odd reason, they will not
code plz!
(and: any mods?)
No mods beside 3den enchanted
@cosmic lichen you might want to frame this one ^.^
_Hgrp1 = CreateGroup EAST;
_Hgrp1 addvehicle Helicopter_1;
_HUnit1 = _Hgrp1 createUnit ["O_CREW_F", [0,0,0], [], 0, "NONE"];
well, the code seems right
I suppose you then moveInDriver _hUnit into Helicopter_1
Correct
nothing should be "wrong" here
can you try such script in an empty Eden mission?
also maybe check that OPFOR are set as enemies to INDFOR (if these are your targets)
so what exactly is this "awake" command doing ... compared to "enableSimulation" ?
it pings PhysX itself I believe
as sometimes objects remain "in the air" even if their simulation is enabled
what do you mean, like when dead bodies remain in mid-air even after a building is destroyed/deleted, or something else
or detaching a crate (like with carry scripts) and having it not fall to ground until using setdamage
I did not follow too much nor did I try it, but it might be something like that (the crate, I am not sure about ragdoll)
Works in VR, also have OPFOR and INDFOR as enemies.. Copied the code directly
Ground units will not attack either
so everything works fine in an empty mission, but not in your mission?
Correct. OPFOR and INDFOR attack each other if not created using CreateUnit
maybe @unique sundial can let us know exactly what "awake" command does and is useful for π
wait ^^
in your mission:
- OPFOR and INDFOR are fighting each others: good
- OPFOR and INDFOR are not fighting each others when spawned with
createUnit
in an empty VR mission:
- OPFOR and INDFOR are fighting each others: good
- do OPFOR and INDFOR fight each others when spawned?
Lol, gently reminding the engine like "excuse me but you forgot gravity" π
Yeah, that's whats bugging me
kinda, I believe π
(though I would have chosen another name than awake as it may be multimeaning but hey)
then somewhere in your script you may have a disableAI or something like this
no idea what though π¬ try copying to a test mission and removing bits until it works
Do the created units actually have enemy visible in front of them?
ok, so can someone replicate this issue:
Dedicated multiplayer environment
Command:removeItemFromUniform
Expected behaviour: Removes item/magazine from the unit's uniform. Global effect, global argument
When an item is added to a unit's uniform in themission.sqm,removeItemFromUniformwon't update the result to the client where the unit is local if run on the server-side. This means that requesting a list of items in the player's inventory doesnt include the item on the server-side, but does include it on the client-side.
If the item is NOT added in the mission.sqm, but after the mission has initialized, removeItemFromUniform works as expected
The issue isnt critical, as i can avoid thid by setting the unit loadout after the unit has initialized, but it is slightly inconvenient and took me some time to figure out what was wrong
What if the item is part of a unit's default gear from the config?
This feels like it could be connected to https://feedback.bistudio.com/T126030
haven't tested this yet
Thanks. Also realised that I was using "'Item_ToolKit' in magazines player".
can someone help me understand what I'm doing wrong?
_camera = "camera" camCreate [0,0,0];
_camera camSetFOV _fov;
_camera attachTo [_heli, [2,0,0]];
_camera setDir (getdir _heli) + _dir;
switchCamera _camera;
everything works but FOV
it's always the default fov no matter what I input
oh my bad, didn't read the description for camSetFOV
i see no commit either
is there a way to start a game outside of APEX where isMultiplayerSolo will return true? Playing a hosted mp game by yourself causes a false flag.
yeah I was using switchCamera instead which works for camera postion/direction but not the camera settings themselves
when I call this function
params ["_heli"];
private _cameras = [];
_camera1 = "camera" camCreate [0,0,0];
_camera1 attachTo [_heli, [1.5,-1,-1.5 ]];
_camera1 setDir (getdir _heli) - 150;
_camera1 camsetFOV 0.6;
_camera1 setvectorUp [0,0.4,1];
_camera1 camCommit 0;
_cameras pushBack _camera1;
_camera2 = "camera" camCreate [0,0,0];
_camera2 attachTo [_heli, [-1,2.2,-0.8 ]];
_camera2 setDir (getdir _heli) + 100;
_camera2 camsetFOV 0.85;
_camera2 setvectorUp [-0.2,0,1];
_camera2 camCommit 0;
_cameras pushBack _camera2;
_cameras
there is no return value. Am I going about this wrong?
oh nevermind something is going wrong with the script
sadly I do not see any comments or details regarding networking in that page
see the icons at the top
thatβs what tells you the locality
bear in mind that vehicles are local to the driver
so you would need to remote exec if the script isnβt being run on the driverβs end
got it
Tex_fnc_respawn_HQ =
{
private ["_HQ"];
_tele =_this select 0;
_caller = _this select 1;
if (isnil {
alreadyTeleporting
}) then {
alreadyTeleporting = 0;
};
alreadyTeleporting = 1;
switch (true) do
{
case !((HQ isEqualTo objNull) && (!alive HQ)):
{
_HQ = HQ;
};
case !((HQ2 isEqualTo objNull) && (!alive HQ2)):
{
_HQ = HQ2;
};
case !((HQ3 isEqualTo objNull) && (!alive HQ3)):
{
_HQ = HQ3;
};
case !((HQ4 isEqualTo objNull) && (!alive HQ4)):
{
_HQ = HQ3;
};
case !((HQ5 isEqualTo objNull) && (!alive HQ5)):
{
_HQ = HQ3;
};
default:
{
hint "You cannot Reinsert at this time."
};
};
[0, "BLACK", 10, 1] spawn BIS_fnc_fadeEffect;
sleep 10;
private _spawnPosHQ = _HQ getRelPos [1, random 360];
_caller setPos _spawnPosHQ;
[1, "BLACK", 0, 1] spawn BIS_fnc_fadeEffect;
sleep 100;
alreadyTeleporting = 0;
};```
Hi guys I have made this tp function to tp a player to another players location.
Im pretty sure the code is self explanatory but what I want to do is have 5 player slots named (HQ - HQ5). However, for some reason it only works when the player slots are filled.
When they are not, i get an error message saying theres undefined variables.
Ive been trying to fix for ages, but cant figure it out?
does the error give more info as to what variable is undefined?
sorry yeah, any of the HQ's if they dont have a player in them
I got it working with the error. but ofc, I would like my code to be error free, not just working π
private _HQs = [HQ,HQ1,HQ2,HQ3,HQ4,HQ5];
private _HQ = _HQs select (_HQs findIf {alive _x});
if _HQ == -1 then {
hint "You cannot reinsert at this time."
};
@tough abyss have you considered findIf
oh shit
i did it wrong hold on
ngl, didnt even know that existed π
private _HQs = [HQ,HQ1,HQ2,HQ3,HQ4,HQ5];
private _HQindex = _HQs findIf {alive _x};
private _HQ = objNull;
if (_HQindex < 0) then {
hint "You cannot reinsert at this time."
};
else {
_HQ = _HQs select _HQindex
};
here we go
there's even better ways than that i bet but i dont have the brain power beyond this
amazing, will test. But make sure your ; are in the right place π
_HQindex not _HQ on the first one
am i missing a ;?
except at the end
the missing ; are okay syntax wise but are triggering me, just like the missing () around the if condition 
the missing () is just a brain fart ngl
im not that crazy dude
been jumping between a python bot and arma 3 
This doesnt work at all π¦
leaving out the ; is usually used for indicating return values, like
_fnAdd = {
params ["_a", "_b"];
private _sum = _a+_b;
_sum
};
you see, i'm an absolute madman
how's the most recent edit
just getting undefined variable in expression : hq
alrighty lets take a step back. how are you defining the HQ variables?
Eden.
is it HQ or HQ1
HQ
and with all of them listed, i get a different error, saying type object, expected number, not a number
check the rpt and post the whole error
0:08:52 Starting mission:
0:08:52 Mission file: testing%20TP%20STUFF
0:08:52 Mission world: VR
0:08:52 Mission directory: C:\Users\test\Documents\Arma 3 - Other Profiles\Pte%2e%20M%2e%20Texas\missions\testing%20TP%20STUFF.VR\
0:08:52 EPE manager release (0|1|0)
0:08:54 Mission id: 3d2d15b54f9c9868f10649635811c8121ba0e703
0:08:55 Error in expression < {alive _x};
private _HQ = objNull;
if (count _HQ < 0) then {
hint "You cannot r>
0:08:55 Error position: <count _HQ < 0) then {
hint "You cannot r>
0:08:55 Error count: Type Object, expected Array,String,Config entry,HashMap
0:08:55 File C:\Users\test\Documents\Arma 3 - Other Profiles\Pte%2e%20M%2e%20Texas\missions\testing%20TP%20STUFF.VR\init.sqf..., line 18
0:07:18 Mission world: VR
0:07:18 Mission directory: C:\Users\test\Documents\Arma 3 - Other Profiles\Pte%2e%20M%2e%20Texas\missions\testing%20TP%20STUFF.VR\
0:07:18 EPE manager release (0|1|0)
0:07:21 Mission id: 567b5b4a6f00f2eeb7d08467846d69aea4977819
0:07:22 Error in expression <ive _x};
private _HQ = objNull;
if (_HQ < 0) then {
hint "You cannot reinsert at>
0:07:22 Error position: << 0) then {
hint "You cannot reinsert at>
0:07:22 Error <: Type Object, expected Number,Not a Number
0:07:22 File C:\Users\test\Documents\Arma 3 - Other Profiles\Pte%2e%20M%2e%20Texas\missions\testing%20TP%20STUFF.VR\init.sqf..., line 18```
that's not my most recent edit then
private _HQs = [HQ,HQ2,HQ3,HQ4,HQ5];
private _HQ = _HQs findIf {alive _x};
private _HQ = objNull;
if (_HQ < 0) then {
hint "You cannot reinsert at this time.";
} else {
_HQ = _HQs select _HQ
};
this
you're getting that error because that's the version where I forgot to swap out _HQ for _HQindex in the if check
ohh
0:14:18 Mission file: testing%20TP%20STUFF
0:14:18 Mission world: VR
0:14:18 Mission directory: C:\Users\test\Documents\Arma 3 - Other Profiles\Pte%2e%20M%2e%20Texas\missions\testing%20TP%20STUFF.VR
0:14:18 EPE manager release (0|1|0)
0:14:20 Mission id: 0756d4059452075aa6536dd7d0e91e0f451f6c23
0:14:21 Error in expression <ert at this time.";
} else {
_HQ = _HQs select _HQ
};
0:14:21 Error position: <select _HQ
};
0:14:21 Error select: Type Object, expected Number,Bool,Array,code
0:14:21 File C:\Users\test\Documents\Arma 3 - Other Profiles\Pte%2e%20M%2e%20Texas\missions\testing%20TP%20STUFF.VR\init.sqf..., line 20
um
same thing
the other _HQ
_HQ = _HQs select _HQindex
not
_HQ = _HQs select _HQ
thats on me for makign HQ one thing and then changing my mind
but yeah i think my most recent code block is the ticket
private _HQs = [HQ,HQ2,HQ3,HQ4,HQ5];
private _HQindex = >
0:16:54 Error position: <HQ,HQ2,HQ3,HQ4,HQ5];
private _HQindex = >
0:16:54 Error Undefined variable in expression: hq
0:16:54 File C:\Users\test\Documents\Arma 3 - Other Profiles\Pte%2e%20M%2e%20Texas\missions\testing%20TP%20STUFF.VR\init.sqf..., line 14
^ Happens when the player / AI is not there.
alright we can do this
private _HQs = ["HQ","HQ2","HQ3","HQ4","HQ5"] select {!isNil _x} apply {missionNamespace getVariable _x};
yeah what he said
u killed his entire motivation, u monster. 
Mission name space, that was it
we tortured that poor soul @tough abyss enough (for today)
0:20:44 Error in expression <Effect;
sleep 10;
private _spawnPosHQ = _HQ getRelPos [1, random 360];
_caller s>
0:20:44 Error position: <_HQ getRelPos [1, random 360];
_caller s>
0:20:44 Error Undefined variable in expression: _hq
π’
0:21:36 Error in expression <t;
sleep 10;
private _spawnPosHQ = _HQs getRelPos [1, random 360];
_caller setPo>
0:21:36 Error position: <getRelPos [1, random 360];
_caller setPo>
0:21:36 Error getrelpos: Type Array, expected Object
0:21:36 File C:\Users\test\Documents\Arma 3 - Other Profiles\Pte%2e%20M%2e%20Texas\missions\testing%20TP%20STUFF.VR\init.sqf..., line 56
private _spawnPosHQ = _HQs getRelPos [1, random 360];
getRelPos expects an object. _HQs is an array
I guess... That was the fastest "yeah what he said" I ve ever seen honestly. π
how are you defining _HQ here?
private _HQs = ["HQ","HQ2","HQ3","HQ4","HQ5"] select {!isNil _x} apply {missionNamespace getVariable _x};
private _HQindex = _HQs findIf {alive _x};
private _HQ = objNull;
if (_HQindex < 0) then {
hint "You cannot reinsert at this time."
};
else {
_HQ = _HQs select _HQindex;
};
is this what you have
because _HQ should be defined regardless in this case
except when he is calling the function without returning the value
What i have is:
Rifle_fnc_respawn_HQ =
{
_tele =_this select 0;
_caller = _this select 1;
if (isnil {
alreadyTeleporting
}) then {
alreadyTeleporting = 0;
};
alreadyTeleporting = 1;
private _HQs = ["HQ","HQ2","HQ3","HQ4","HQ5"] select {!isNil _x} apply {missionNamespace getVariable _x};
private _HQindex = _HQs findIf {alive _x};
private _HQ = objNull;
if (_HQindex < 0) then {
hint "You cannot reinsert at this time.";
} else {
_HQ = _HQs select _HQindex
};
hint "You are being Reinserted to the HQ Section... Please Wait...";
[0, "BLACK", 10, 1] spawn BIS_fnc_fadeEffect;
sleep 10;
private _spawnPosHQ = _HQs getRelPos [1, random 360];
_caller setPos _spawnPosHQ;
hint "You Have reinserted to HQ Section";
[1, "BLACK", 0, 1] spawn BIS_fnc_fadeEffect;
alreadyTeleporting = 0;
};
and this is the error π
sleep 10;
private _spawnPosHQ = _HQs getRelPos [1, random 360];
_caller setPo>
0:27:34 Error position: <getRelPos [1, random 360];
_caller setPo>
0:27:34 Error getrelpos: Type Array, expected Object
0:27:34 File C:\Users\test\Documents\Arma 3 - Other Profiles\Pte%2e%20M%2e%20Texas\missions\testing%20TP%20STUFF.VR\init.sqf..., line 58```
if (isnil {
alreadyTeleporting
}) then {
alreadyTeleporting = 0;
};
alreadyTeleporting = 1;
what does this do anyway
private _spawnPosHQ = _HQs getRelPos [1, random 360]; should be private _spawnPosHQ = _HQ getRelPos [1, random 360];
cant it just be
alreadyTeleporting = 1;
its so if the script is called twice, it doesnt run twice.
until its finished.
i don't understand how this does what you describe
if (alreadyTeleporting == 1) exitwith {
hint "You are already Teleporting... Please Wait...";
alreadyTeleporting = 0;
};
I have this in there also.
just removed it to keep the text short
i see
Rifle_fnc_respawn_HQ =
{
_tele =_this select 0;
_caller = _this select 1;
if (isnil {
alreadyTeleporting
}) then {
alreadyTeleporting = 0;
};
if (alreadyTeleporting == 1) exitwith {
hint "You are already Teleporting... Please Wait...";
alreadyTeleporting = 0;
};
alreadyTeleporting = 1;
private _HQs = ["HQ","HQ2","HQ3","HQ4","HQ5"] select {!isNil _x} apply {missionNamespace getVariable _x};
private _HQindex = _HQs findIf {alive _x};
private _HQ = objNull;
if (_HQindex < 0) then {
hint "You cannot reinsert at this time.";
} else {
_HQ = _HQs select _HQindex
};
hint "You are being Reinserted to the HQ Section... Please Wait...";
[0, "BLACK", 10, 1] spawn BIS_fnc_fadeEffect;
sleep 10;
private _spawnPosHQ = _HQ getRelPos [1, random 360];
_caller setPos _spawnPosHQ;
hint "You Have reinserted to HQ Section";
[1, "BLACK", 0, 1] spawn BIS_fnc_fadeEffect;
alreadyTeleporting = 0;
};
thats it in full
ah, works like a dream now. thanks for both fixing my error and making it neater π
wouldn't that make it run twice if it is called 3 times?
both of ya
yw
you could shorten that check to
if (!isNil "areadyTeleporting") exitWith {
hint "You are already teleporting";
};
alredyTeleporting = true;
...
alreadyTeleporing = nil;
yeah,
i just realised
Terra with the π
this no work lul
nvm. me retardo
thanks all π
yw
is there a formal specification of the language written up somewhere?
and every page listed under "scripting topics" at the top of that page
that is hardly a formal spec
Is there a fast way to check if an array of strings are in another string?
do you need pictures or something?
elaborate?
["airport","airstrip","airfield","terminal","airbase","aerodrome"] in (toLower (text _x))
etc.
like
what's your goal
what are you trying to output
if any of them are in the string? which one is in the string?
I'm trying to grab locations from a given map and dump them into arrays, so that the mission is portable
Yeah if any string is in there
I could do it forEach of those strings, but this is already in a forEach of the nearestLocations and nesting like that seems wrong
(["airport","airstrip","airfield","terminal","airbase","aerodrome"] findIf {_x in (toLower (text _testedString))}) > -1
that's much better, it doesn't continue the check if it finds something
why text?
_x is a location from nearestLocations
oh i see syntax 2
IIRC toLowerANSI is faster. I'm not sure how different between two tho

private _HQs = ["HQ","HQ2","HQ3","HQ4","HQ5"] select {!isNil _x} apply {missionNamespace getVariable _x};
private _HQindex = _HQs findIf {alive _x};
3 loops when it could be just one 
Hah a formal spec of sqf? No. What kind of tooling are you planning on creating?
can i stop the player from recovering from ragdoll (i.e. when driven over by a vehicle)?
maybe set unconscious true/false, otherwise switchMove only I'm afraid
switchMove to what?
i cant find a state for ragdoll
use unit setUnconscious true
they will remain in "hurt on the ground" state
Anyway to make a AI gunner fire helicopter miniguns for 4 minutes?
Interesting
yeah, that isnt exactly what i was looking for. I was intending them to not switch away from the ragdoll
From what I know you canβt permanently stay in ragdoll. It seems to only last at Max of 6-8 seconds before you switch to an animation and fall straight to the ground even if you are flying horizontally at Mach 10
no can do "properly" but setUnconscious true, false, true etc every 5s or less
yeah
is there a version of setHit or similar that takes a global argument?
i dont really want to enabled setHit on the client through my BE filters
This script run on client side causes the player to take 60%damage but still be able to run:
allPlayers#0 setDammage 0.6;
allPlayers#0 setHit["legs", 0.4];```
where as if run on the server-side it doesnt allow the player to run
the hit is not set if run on the server
presumably because the player is not local to the server
yep, but wouldnt i have to allow the command through my BE filters in that case?
not sure if i like the idea of allowing the client to set their hit-status
no, it's the server that remote execs it on them I believe
I think they cannot execute the script command itself
so remoteExec allows for bypassing the BE filters if executed by the server?
I do think so yes
don't quote me on that and make some tests, but I believe the server can always run what it wants/needs
i see
Dedmen/KK might know better π
I was staring at this and I'm not 100% sure what it means:
CfgRemoteExec defines rules for the remote execution of functions and commands. These rules only apply to clients. The server is not subject to any limitations, everything is enabled and allowed for it.
But letting the server remoteExec anywhere would make sense assuming that you can't spoof.
i'm talking about BE filters, not cfgRemoteExec
question for you all so was running an op yesterday and made a custom object using attachTO however when i ran the op the objects did not attach to the object and were stationary?
heres an example of the sort of script i ran:
if (isServer) then {
LTr1 attachTO [Chimbody,[0,0,0]];
};
for context in single player eden testing it worked fine
we need context of this code
if you put this in e.g an addAction, the code is run on the client's machine, not the server
im not sure that i follow
I don't know where your code is run
OH
its input from the init line of the object but judging from what you said it sounds like its doing the clientside thing not the server
it may work from the init, unsure why it does not
try delaying it a bit
how would i add a delay whats the code structure for that never used one before
i did read from the Bohemia wiki that sometimes codes using attachTo can be a bit iffy so it might not properly initialise upon server startup or something or when the objects in question are placed into the world
would putting the code twice as like a backup help the issue so if it doesnt read it the first line of code itll read the second line?
never a good idea no.
what are Ltr1 & chimbody?
no idea, this is #arma3_scripting channel π try #server_admins perhaps
Variable names, i was making a tank so the body was labeled Chimbod for body and Ltr1 is Left track 1
non functioning of course just purely for looks
so Eden-placed objects, hmm
but no need to attach them if they are to be static? place them, make them simple objects and save perf?
i will link you a YT link of what im trying to achieve
https://www.youtube.com/watch?v=CYdFMSeM9J4
the body is a vehicle (unarmed) the weapons are all turret emplacements
the rest is props to kind of flesh out the body and look
so yes unfortunately they do need to move which is why im so stumped
is there a method for removing default actions from containers? I would like to remove the intentory-action from a dead body container
lockInventory
cant do that on dead bodies
i tried both locking the individual clothing containers and the unit as a whole
might have to use an inventoryOpened eventhandler
yeah, trying to stay away from that
too many loopholes
are the actions defined engine-side
@ebon citrus How, out of interest?
it's not perfect, but it fits my small area. set the actions in CfgActions for rearm and gear to be shown = 0; and use the init EH of some common vehicle parents to readd them where needed
probably more proofed than eventhandlers
thx
glad to have been of help
@granite skynote, it is going to remove the action, albeit doesnt block just pressing "i" to open the inventory
ok, so removing Rearm and adding this to override with my own inventory works:
player addEventHandler ["InventoryOpened", {
params ["_unit", "_container"];
(_container isKindOf "Man");
}];```
oi fellas. situation: i have weapon X in my hands .... can i somehow via script predict where that weapon will hit if i fire it? :x
maybe some funny math with bullet speed and power of the weapon?
a bit like those grenade-throwing markers that i have seen ages ago, but for generic rifles
yes, you can. I dont personally have the calculations arma 3 uses to simulate bullet flight path
Ace probably has them
Depends how accurate you want it, and also whether you're running ACE ballistics. Because targets can change direction during the flight time you can't be sure either.
ask around or rummage in their source: https://github.com/acemod/ACE3
the bullet wont change direction
targets do.
Oh, air vs ground stuff?
no, just continuously calculated impact
oi fellas. situation: i have weapon X in my hands .... can i somehow via script predict where that weapon will hit if i fire it? :x
where the bullet will hit has nothing to do with your target
I'm not following. It certainly affects it if it hits your target.
I figured he was talking about some sort of target lead / range / wind adjustment trainer.
No, he wants to predict the impact point. It's not "where do I aim to hit point x", it's "where do I hit if I fire now". I think it was pretty clear.
You certainly could use this to assist with drop and wind training, but not target leading.
exactly
the idea is to script a hit / impact indicator on the players hud
currently we can add ballisticsComputer = BallisticsTargetLead + BallisticsCCIP; to a weapon config to enable it. but i need it more ... general, and outside of config
@west grove since you dont ha e real terrain-data, you'd need to calculate the arc, then sample the terrain height along said arc at reasonable intervals until the height of the terrain matches/exceeds the arc point Z value
infinite samples only acceptable
I can't find a reference for how often Arma samples or what integrator they use. I guess you could check the projectile position per-frame and reverse-engineer it :P
ACE advanced ballistics & wind are per-frame but Arma's still simulating behind that.
Hello! Can i ask for a help? I would like to create a warning for pilots to warn them about possible collision with terrain. For testing purpose i made it with just a hint. But it's giving me some error about boolean. Here's the script: ```sqf
private _ahead1 = createVehicle ["Sign_Sphere200cm_F", [0,0]];
_ahead1 attachTo [_vehicle, [0, 500, 0]];
private _ahead2 = createVehicle ["Sign_Sphere200cm_F", [0,0]];
_ahead2 attachTo [_vehicle, [0, 600, 0]];
while {alive _vehicle} do {
if terrainIntersectASL [getPosASL _ahead1, getPosASL _ahead2] == true then hint "Terrain ahead, pull up!";
sleep 5;
};
if ( ) then { };
will try it, but wiki said that ( ) is optional
not for if, also no code brackets {} for then
tried this ```sqf
if (terrainIntersectASL [getPosASL _ahead1, getPosASL _ahead2] == true) then {hint "Terrain ahead, pull up!"};
thank you @winter rose
== true, useless, the expression will behave the same way without that part
that's a good point, i thought about like like i was math - if something = something else is correct then it's true for the if, but i didn't realise that the terrainintersect becomes true on it's own
The () in an if are technically optional if the contents don't run into precedence issues, so you can do if isServer then { code here } for example, but not if _var == 2 then { code here }. Really not worth saving the two characters though.
allright, so i did what you all suggested and that works but now i have a new problem, the script is following: ```sqf
private _ahead1 = createVehicle ["Sign_Sphere10cm_F", [0,0]];
_ahead1 attachTo [_vehicle, [0, 500, 0]];
_ahead1 hideObjectGlobal true;
private _ahead2 = createVehicle ["Sign_Sphere10cm_F", [0,0]];
_ahead2 attachTo [_vehicle, [0, 700, 0]];
_ahead2 hideObjectGlobal true;
private _ahead3 = createVehicle ["Sign_Sphere10cm_F", [0,0]];
_ahead3 attachTo [_vehicle, [0, 900, 0]];
_ahead3 hideObjectGlobal true;
while {alive _vehicle} do {
if (terrainIntersectASL [getPosASL _vehicle, getPosASL _ahead1]) then {hint "whoop whoop - pull up!"};
if (terrainIntersectASL [getPosASL _ahead1, getPosASL _ahead2]) then {hint "Terrain pull up"};
if (terrainIntersectASL [getPosASL _ahead2, getPosASL _ahead3]) then {hint "Caution terrain"};
sleep 1;
};
yes but new hint should replace an old hint
but it doesn't
For testing purposes, try it with systemChat instead of hint and see what happens
how to do that? (currently i use the hint for testing, later i'll replace hints with sounds)
There's also a structural problem which is that multiple of your conditions can be true at the same time
Terrain is big. There can be an intersection between _ahead1/_ahead2 and an intersection between _ahead2/_ahead3. And since _ahead3 is the last in the sequence, that hint gets created last so that's the one it always shows
well this can be easily fixed by changing the order, putting the closest with most urgent warning as the last one but i found another problem - the system chat showed that as i get closer, second warning gets activated but first remains active and then third gets activated but first and second are still active
That's the same problem
how do i set it, so that only 1 of them is active at a time? (let's count a case with just 1 terrain intersection)
is there a way to deliver false into if condition when another if has true condition?
never mind i got an idea
Someone can probably make a more compressed version but here's how to adapt what you already have:
// Initialise our variables
private _warning = "";
// First make the lowest-priority check and set the warning state for that
if (terrainIntersectASL [getPosASL _ahead2, getPosASL _ahead3]) then {
_warning = "far";
};
// If a higher-priority warning is also true, replace the warning state with the higher one
if (terrainIntersectASL [getPosASL _ahead1, getPosASL _ahead2]) then {
_warning = "close";
};
// etc
if (terrainIntersectASL [getPosASL _vehicle, getPosASL _ahead1]) then {
_warning = "TOO CLOSE";
};
// If any warning state has been set, display the warning
if (_warning != "") then {
hint _warning;
};```
interesting idea, what do you think about putting && into the condition?
For what purpose?
nothing, i just realised my own mistake
but this setup will display only 1 universal warning for all three situations
am i right?
No
so where do i put them? i'm sort of lost in it
oh i think i got it now
The variable _warning contains the content of the hint (or the string of the sound file in your final version). Each condition changes the content to the appropriate text for the level it's checking, with the closest condition last so that the closest true condition is the final text passed to hint/playSound.
If I thought one universal warning was fine I'd have left you with what you originally had, since that's all it did :U
sorry, it takes me a while to see connections between used parameters
so with the play sound, it's done this way? ```sqf
// Initialise our variables
private _warning = "";
// First make the lowest-priority check and set the warning state for that
if (terrainIntersectASL [getPosASL _ahead2, getPosASL _ahead3]) then {
_warning = [getMissionPath "sound\far.ogg", _vehicle];
};
// If a higher-priority warning is also true, replace the warning state with the higher one
if (terrainIntersectASL [getPosASL _ahead1, getPosASL _ahead2]) then {
_warning = [getMissionPath "sound\close.ogg", _vehicle];
};
// etc
if (terrainIntersectASL [getPosASL _vehicle, getPosASL _ahead1]) then {
_warning = [getMissionPath "sound\too_close.ogg", _vehicle];
};
// If any warning state has been set, display the warning
if (_warning != "") then {
playSound3D _warning;
};
Yes, or if you really wanted to save on characters like some kind of nerd, _warning would be only the string and the final output would be playSound3D [getMissionPath _warning, _vehicle]; (same effect, just slightly shorter overall)
That being said, playSound3D is not necessarily the best way to have a "cockpit alert" sound. playSound3D sounds don't follow moving objects, they remain at the position the object was at when the sound started. They will also be audible from outside the vehicle, for other players.
You should probably use playSound, just make sure it's only executed where the pilot is local.
good point, what do you suggest instead?
thanks for the tip, i'll definitely give it a try, by the way how do i change locality of the play sound depending on who's the pilot? alternatively what about say3D ? does that have the same issue as playsound3D ?
say3D doesn't have the same issue, but it has certain other peculiarities that make it less good for this case than playSound
as for locality...where is this script being executed? Server, all clients, etc.?
here you go (it has the old warning script, didn't replace it yet)
https://www.sqfbin.com/afihejuquyihixanipef
what do you mean by clean up? delete them?
nah shorten it
understood, it would be a waste of your time right now, tomorrow i'll finish the final script so i can ping you if you like and you can clean the final version
Okay, so this is already being executed locally to whoever uses the action. If you're certain this person will always be the pilot, locality is fine. If the plane could change pilots, then you would just remoteExec the playSound, using driver _vehicle as the locality parameter
Also, because hideObjectGlobal is server exec, you need to remoteExec it using 2 as the locality parameter or it won't work in multiplayer
private _aheads = [];
for "_i" from 0 to 3 do {
private _sphere = createVehicle ["Sign_Sphere10cm_F", [0,0]];
_sphere attachTo [_vehicle, [0, 500 + (_i * 200), 0]];
_sphere hideObjectGlobal true;
_aheads pushBack _sphere;
};
_aheads params ["_ahead1","_ahead2","_ahead3"];
numbers are wrong hold on
there
you mean those ```sqf
_ahead1 hideObjectGlobal true;
I can't see what else I could mean
my bad, you're right, i'm having more scripting projects in my mind at the same time, that's a good idea, i can handle this issue
allright, tomorrow i'll try my best to get that working, thank you for your help @hallow mortar have a good night
is it possible to interfere with the vanilla data link? basically looking for a way to add EW to a mission.
in short, jam the datalink, do not allow sharing of information or targeting even using the rooikat
should be possible to disable datalink via script, no? in which case you would just need to cycle through all vehicles in the area and run it
yeah that is basically the only one i found and if i want to enable them receiving or sending.
was really hophing that you can fiddle around with accuracy and such of the data being sent
_movementdata = <mdata> ; _firingdata = <fdata> ; _sequence = [VehicleName, _movementdata] spawn BIS_fnc_UnitPlay; [VehicleName, _firingdata] spawn BIS_fnc_UnitPlayFiring;
I've been told that Unitplayfiring doesn't work anymore. Does anyone know if this is true
it's not
Ah ok
Hello Everyone, im new here and i have few questions
is it possible to modify Health, Stamina and shield ?
Health and stamina yes... but what is shield?
resistance, damage taken
Isn't that health aka?
hmm kinda but not really π
aka stronger armor
Maybe in Arma its the same, but in other games its not
Only with configs
True
I dont think you can change armor values in script
You can intercept incoming damage with eventhandlers
But i advice against that if youre worried about cheating
π
Guess HandleDamage can handle both health and shield, you call?
what if i wanted to hire someone to develop scripts / mods ? does it work this way here ?
Yep, handleDamage is real handy
#creators_recruiting would work
But also gives me the creeps of allowing clients to dictate how much damage they take
i am working on a project / platform, this platform allows you to connect any health devices such as fitbit, apple watch, etc ..
the platform will take your daily sports activities ,and reward you in video games by enhancing your character attributes . like enhancing speed, stamina, health etc
I honestly don't think using Arma 3 is a good idea for this ambitious idea
thats why im asking as im trying to add as much games as i can ..
its going to be free, trying to help people adapt to a healthier lifestyle and help fighting gaming addiction and disorder by using games itself
however, its a new technology i am developing and trying
Feels like you'd need either the C or Python extension for that
And those arent really super mp compatible
i have other games onboarded , trying to expand the options
The problem is that each server would have to run your script
For it to take effect
Otherwise you'd have servers that dont and servers that do
And i'd say that most dont
for now i will run it on my own servers if i find the right developers, later on these scripts will be available for anyone to use
And what is stopping people from spoofing their physical activity for ingame gains
thats part of the test π
however we use a combination of metrics in the devices that makes it harder to spoof.
Where do you source the data from?
From wearables manufacturer themselves, like from Apple's and Fitbit cloud.
From their clouds, not the device itself?
i'd really appreciate any suggestion to make my search for a dev easier
Look in the pinned messages for a template
the device sends data to user profile on the cloud ,, the data is processed on the cloud, then we import it and re-structure the data
thank you Nica ! π
Dont thank me, Polpox already told you
Well thank you anyway
Received
how do i find out what the correct prefix is for a qvar?
QGVAR(openLogistikMenu)
dont know how that works
For ACE this is done automatically through the usage of the GVAR macro family.```
so i need the addon + the component, is this the component then?
```#define COMPONENT ace```
(this also applies for ace)
yeah, it's not vanilla behaviour
i want to define a list of "whitelisted" player(slots), that will on JIP get added an ace action for an arsenal
but i cant figure out how to properly do that, the player objects dont exist until they have joined.
if i save an array of whitelisted playerobjects to a variable, its saved as [any,any,..].
how are you "saving" it?
give the units a variable name, and then in the crates init call [player1,player2] call makeMyArsenal;
what does makeMyArsenal do?
missionNamespace setVariable ["whitelist",_whitelist];
im literally just saving the [player1, player2] array to global, but it turns into [any,any] if the players havent joined
and it doesnt turn back on join either
i set the variable for the player now instead, this setVariable ["isWhitelisted",true], that seems to work
Adjust your script to call it from the player-object init field.
make the script exit if the player-object (this) isn't local and add the action is it is.
Working with object references to objects that you don't know are going to spawn is bound to get frustrating quickly
Sorry, didn't see this. glad you found a fix
still very annoying honestly.
you could store strings in array and use missionNamespace getVariable ["playerN", objNull] and fetch the object when you're checking if the player is one of those.
Can you not get the AI gunners to just fire missles ect when you tell em too without having to use a code
I'm not able to get that to work 
what exactly are you trying to use it with?
what is the format of frameTime in unitCapture?
hello, can i ask if i wrote it correctly? ```sqf
[_warning] remoteExec ["playSound", driver _vehicle];
yes, you can π
but it seems correct, yeah
i have a feeling that i might be missing some " " in there
No, it's correct as it is
but i'm not sure
great, thank you @hallow mortar and @winter rose π
to our previous conversation, something came to my mind
we were discussing warnings for pilots as they fly the aircraft but what if they land and leave the plane?
in case the plane is landed near terrain ahead, it might trigger the warning, will it keep sounding for the pilot even when he leaves the plane untill someone else gets in as a new pilot or will it silence the alarm when he gets out?
i'll send the script again
i hope i made the rest of the code correctly
i was wondering about the condition in the while because it returns true as long as the plane is alive
but what if the pilot leaves? will the pilot still hear the warning?
Wrap your warnings with isTouchingGround condition.
https://community.bistudio.com/wiki/isTouchingGround
that's a good idea, i can put it into those if conditions so it won't break the loop and therefore i don't have to care about reinitializing the loop when pilot gets back in but there's one little problem - isTouchingGround returns true when on the ground but i need it to return true when in the air and false when on the ground
Just put it outside, you dont need rest of if conditions to be evaluated if it is touching anyways.
You can get the opposite of the condition simply by applying a "not" or "!" in the beginning.
you mean put all ifs into one big if with condition if istouchingground _vehicle == false then ... ?
yes... and you do not need to == false or == true at all..
if (!(isTouchingGround _vehicle)) then {check warnings};
if it is NOT touching to ground, check warnings.
looks nice, please stand by
yep looks fine.
ok thank you, i'll test it in arma π
_index1 = player addEventHandler ["Hit", {
player setDamage 0;
systemChat "I'm hiiiiit!!!";
}];
_index2 = player addEventHandler ["Killed", {
playerPos = getPos player;
player_className = str typeOf player;
systemChat playerPos;
systemChat player_className;
newUnit = group player createUnit [player_className,playerPos,[],0,"FORM"];
addSwitchableUnit newUnit;
SelectPlayer newUnit;
systemChat "YAY! new life!";
}];```
I'm writing this code ,which tries to make player invulnerable, as a practice. the first EH works fine but the second one doesn't work at all. I dunno what im doing wrong. :(((
Just typeOf player, as it is already a string
also, if you are in singleplayer it will trigger the "you are dead" screen unless you add a file in your mission dir
I wrote all these lines in a sqf file in mission directory. I'm gonna remove str and see if it works
nope, still won't trigger :'((
systemChat playerPos needs to be systemChat str playerPos
Still won't work but at least it prints :P
Ohh I see, it was an array. Silly me. Thanks π
When you're scripting you should tick "show script errors" in the launcher parameters. That one will show up then.
How does fire at target ment to look like for a AI gunner? Do I need the missle name config
Hey guys! Does anybody know how to attach the Offroad Police Lightbar to other vehicles?
you can't but you can script your own or you can use a mod
https://steamcommunity.com/sharedfiles/filedetails/?id=2661398142&searchtext=tts+lights
Thanks anyways! :D
np
Can i ask for a help? the script doesn't work - i can not hear those warning sounds (playSound) but the hint shows up fine π any idea what could have gone wrong? (i did place those sounds in mission file and i did define them in cfg sounds) https://www.sqfbin.com/lajurulitizaloludico
_vehicle is undefined in this code scope
also, why remoteExec if it is a local script?
but yeah your indentation is all over the place π¬ can't read where is what
so yeah the var may be defined, but idk how where what
it's meant for multiplayer game
how come? i tried my best to make it like a tree according to scripts inside another scripts
how can i define it?
can i help you get oriented in it?
also if it's caused by undefined variable, why i don't see any error?
If I wanted to make something sway gently and/or rotate slowly, because it's a heavy item attached by a cable, where would I start?
setVelocity
what does -1#IND mean? I got that result from a math expression.
It's a NaN. Something like 0/0 or sqrt(-1)
!Alive t1;
why wont this trigger me frigging escape task, when i blow the object t1 up
ive put it into the conditions
Β―\_(γ)_/Β―
Wrong box?
whats t1?
A empty object that blows up
It's some big AA missle thing in SOG
I may or may not have forgot to select. All playable units 
With problems like that you need to log or systemchat every step in the procedure to see where it is going wrong.
Yep
I forgot to set the tasks to all playable units
I'd be a terrible game designer

Everyone does that. You just need good error detection procedure.
Hmm how to get a dude to join your squad when you reach a trigger?
make sure you have brackets around the unit since join takes an array
[_unit] join (group player);
π©
?
I probably done it wrong
it should work as long as the trigger is firing and _unit is the variable for the unit you want to join the player's squad
OK me play. I gave SQ1. I gave the guy Who I wanna join SQ2
Think it works actually
.
Holy shit. It worked
I done a thing with minimal help.
so satisfying getting back into extDB3
ty do you know if this works for multiplayer?
all the ai in my group seem to be stuck, they wont move or change pose regardless of what i command them to do, they will just rotate around. can i somehow "reset" their ai?
Read the page in full
@bitter jewel That sounds like disableAI "PATH".
Unless your entire group is somehow in a building that they don't know how to path through.
I've seen that problem in user maps and randomly in I&A.
nvm i managed to find a BI_FNC that did the job π
[cargo1 addAction ["<t color='#FF0000'>Standard Issue</t>"]];
Might be bad at reading documentation, or could just be a moron
basically just making it so that cargo1 (variable name for cargo container) will have a simple addAction to identify it.
Where'd I go wrong?
Figured it out, apparently you have to have the final element included 
The document says (optional) next to the argument if it can be omitted
Ah, yes, reading
Helps if I do that more
Thanks!
why did you put it in brackets?
cargo1 addAction ["<t color='#FF0000'>Standard Issue</t>",{}];
the [] brackets have a specific use in sqf
Cause I was being dumb and kept testing various things. Now that I've learned exactly what it's supposed to do I've fixed it on my end
Alright, so now my next task is with event handlers which, I'll be honest, I've never messed with.
Using HandleScore
I should be able to run a small script each time a player's score increases correct?
yeah. only on the server though
Now that I look around a bit more, I'm starting to think I should use EntityKilled
Also that's fine, I run missions on a dedicated box.
dedicated box
that's not relevant, server is the machine hosting the mission regardless of whether it's dedicated or not
When you're scripting for multiplayer executing on the server just means the script is running on the host/dedicated server's end
Ah, right, I forget that with locality and whatnot
So I have text fields a player has to fill out, how can I convert those text fields into something like:
CAS, this is <player name>, standby for 6-line.
My position <player grid>.
Direction to target <bearing>.
Distance to target from my position <distance>.
Target description <description>
Mark type <mark type>.
Additional info <remarks>
What do you mean by this?
I have text fields player types in. I want to turn those inputs into a generated global hint
So would i replace this
format ["Player:%1, player's side:%2", player, side player];
With this"
format ["CAS, this is %1, standby for 6-line. My position %2.", player_name, player_grid];
?
for the
player, side player
im not sure what to replace that with
how are you doing the inputs?
With your string inputs
Actually, it seems format takes anything as input
So go wild

Where are the text fields? Dialog?
If theyre controls in a dialog, this should suffice for retrieving the text
https://community.bistudio.com/wiki/ctrlText
I'd just make a local function to create a structured text (for line breaks, maybe color coding as well) string with format and then remotexec hint
that seems like it'd be the least fuss
oh looks like you can just use \n for line breaks without structured text
even better
hintSilent
Hate that bing sound
I will
Sorry for the delay. testing now
That sound is a violation of the Article 35 of Protocol I Additional to the Geneva Conventions
More accurately
"the use of weapons (...) of such a nature as to cause superfluous injury or unnecessary suffering is prohibited"```
SO:
format ["CAS, this is %1, standby for 6-line. My position %2.", ctrlText idc#, ctrlText idc#];
?
Not even close
Read the docs

Dont jsut paste code wherever
Am confused
Answer this question
Theyre in a dialog, yes.
then that was right
And make sure this script executes when the dialog is still active
If you locse the dialog and then run the script, you will cause a big booboo
Can you show me an example, because i'm not understanding
Not with the idc# it wasnt
No
I am in bed, it is 6am and i am tired
Just bind it as an action to a button or something
So i'm trying to do this with onButtonClick = so what am I using after that to display it in a hint?
The idc is the idc you define the controls with
Assign the return from the format to a variable and feed it to a hint-command as the argument
ok, so how to I make the format to assign the variables?
That's where i'm stuck
_myVariable = format [...];
and this is after onButtonClick?


how are you making the dialog
in a dialog.hpp file
idk i havent used sqf in 4 years
still confused- if not more
Notice that if you assign your events in script, the "on" part of the EH name is left out
Sucks to be you
The biki is the bible
It goves youa full example
Study it
π
For keystrokes, yeah
Monkey it
Read the docs
The event property value (string) is executed as a line of code.
An example line (this would be put within a control or dialog class):
onMouseDown = "hint str _this";
Try it
You can only fail so hard
Modding Arma is like a roquelite
Limited time.
You hit your head against the wall until one or the other breaks
What, are you speedrunning Arma modding?
so it would be
onButtonClick = "TEXT _dialogClass TEXT _dialogClass2"
```?

i'm fucking trying ok lol
100-106
100 101
onButtonClick =
"
private _txt = format ["CAS, this is %1, standby for 6-line. My position %2.", ctrlText 100, ctrlText 101];
hintSilent _txt;
";
Have fun
._. I was close though
Lead is close to gold, yet they are nothing alike
_ encountered instead of =
It needs to be one-line
No linefeeds
Im not doing that on the phone
Fix it yourself
I put it on one line and same error
onButtonClick = "private _txt = format ["CAS, this is %1, standby for 6-line. My position %2.", ctrlText 100, ctrlText 101]; hintSilent _txt;";
Oh yeah
Double quotes
onButtonClick =
"
private _txt = format ['CAS, this is %1, standby for 6-line. My position %2.', ctrlText 100, ctrlText 101];
hintSilent _txt;
";
String in string must be done by different quotation mark
Shouldn't we call double double quotes? 
But i prefer inverted comma or whatever you call it
Quotdruples?
We were all there one day
So a question concerning manipulating a curator module. My aim is to have a curator who cannot place down any units but is free to move curator camera around the map. Should be simple enough enough with the following commands (omitting other restrictions for the sake of brevity):
_module addCuratorEditingArea [4,[0,0,0],0];
_module addCuratorCameraArea [11,[worldSize/2, worldSize/2,0],worldSize];
My current problem is that while this allows 'flying around' with the curator camera in 3d world without any restrictions, (using middle mouse click) setting curator camera position via the map screen seems to be governed by the editing area.
Is this WAD, am I missing something and/or has anyone tried any workarounds?
Hi guys, i have a string from a config file which has parentheses in it, how can i get rid of them?
the string looks like _str = '"test"'
Have you tried https://community.bistudio.com/wiki/str ?
you can also use https://community.bistudio.com/wiki/select if you know the exact lengths
Just checked this.
That can only happen if a player goes back to role selection, and then joins back into the game. He will rejoin with the same ID
But he will also stay the same player
will get back to this later
quadruple quotes
- if you don't want them to interact why not use Virtual Spectator instead of Zeus?
- if you want an unrestricted camera, just don't use addCuratorCameraArea, instead of faffing around setting it to be the entire map
I found the following in my logs a couple of time but everything is seemingly still working just fine. Does anyone have an idea what this log-entry could mean and how I could avoid whatever is causing it?
2022/03/30, 17:29:03 β₯ Context: Trigger "OnActivate" name "1707947: <no shape>" at [12700.000000,8.379982,3300.000000]
Thanks in advance.
You need the lines before that. That's just the context, not the actual error.
hey is it possible to make something like deep snow or something? what i mean is lowering lower body parts animation speed an, maybe, lowering player model a bit into ground? but thats not possible i think
nop
if one wants to go very hacky, it might be possible to read current surface texture and then replace animations. but i doubt this is going to look nice
i mean i was thinking about setAnimSpeedCoef if player is not on the road or building
not perfect solution but should work
how would one get the player unit based on remoteExecutedOwner, if even possible ?
might be easier to just supply that with the RE ?
might be easier to just supply that with the RE ?
if you can do that, then yes
otherwise, yes it is possible, but only on the server machine, or well, on clients too, but it would add overhead etc
this will execute on server, yes, and not a big issue supplying the calling unit ....
but for prosperity, how would you translate machineId to a the player unit that made the call ?
allPlayers + clientOwner, search
Is there a way to set what a curator (zeus) has selected? We have curatorSelected to retrieve the current selection but is there a way to select something?
There's an event handler, curatorSelectedChanged.
err, curatorGroupSelectionChanged and curatorObjectSelectionChanged
Ah never mind, need more sleep.
Holy phuck, does anyone know extdb3 here?
ok, so i have an sql command which WORKS as an sql command if i query it directly, but extdb3 just tells me it's invalid
So if i'm trying to get a players grid number and bearing, how would i get it to display in a text field? I currently have:
onButtonClick = "ctrlSetText [101, PlayerGridNumber player];";
quotes
mapGridPosition player
What about bearing?
getDir player
Awesome thank youuu
no worries
why is regexReplace weird?
'"' regexReplace ['"', '""'];```
returns
```""""""```
makes no sense
'1' regexReplace ['1', '11'];```
returns
```"11"```

so like this
'"' regexReplace ['."', '""'];```
no, not like this
ok, so i run sqf '"strong"' regexReplace ['"', '""'];
and i expect
""strong""
but i get """""strong"""""
heh
so the solution is
'"strong"' regexReplace ['"', '"'];```
that makes no sense what so ever... but ok
never mind, it's Advanced developer tools
that's causing the weird results
@little raptor shots fired!

How can remote Exec and teleport all players to a specific object that has a variable name? "LocationOne'? How is that formated?
you don't necessarily have to remote execute anything, you can do it all on the server
if (isServer) then {
allPlayers apply {
_x setPosATL getPosATL locationOne
};
};
TY
!code
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
wasnt directed at anyone just trying something
hi all, i've been struggling with this for a bit now, but how do I execute a code that works in MP when you put a pistol in a crate?
i'd like to have an effect that detects the one desired pistol and then executes the code
can someone help me to create a lock vehicle script to stop a west player from entering an east vehicle, so far the folowing works in the editor but is unreliable when on a dedicated server.
this addEventHandler ["GetIn", { _unit = _this select 2; if (side _unit != west) then { _veh = _this select 0; _fuel = fuel _veh; _veh setFuel 0; _unit action ["eject", _veh]; [_unit,_veh,_fuel] spawn { waitUntil {sleep 1; vehicle (_this select 0) == (_this select 0)}; (_this select 1) setFuel (_this select 2); }; }; };];
I have placed this in the vehicle init and its unreliable
Wat? What does it have to do with my mod? 
Not related to my mod
That is correct.
You are stringifying the result string so blep
'"' stringified is '""'
ive asked this before but had a hard disk failure with my script folder on it what is the command to find positions on a normal infantry person like eyepos etc?
selectionPosition
thanks and also thank you for making invade and annex
So I'm trying to add an action to a supply box created by the SupportProvider_Virtual_Drop module to open ACE Arsenal for a mission that is running on a dedicated server. The support modules all seem to be working, I can call in a supply drop and have it land where I call it etc. However, when trying to implement the code provided below in the Crate init: field, the supply drop doesn't have the added action.
{_this addAction["<t color='#FFFFFF'>Open Ace Arsenal</t>"} [arsenalBase, player] call ace_arsenal_fnc_openBox},nil,10,true,false];} remoteExec ["call", -2];
I have a supply box with the ACE arsenal items I want to be made available called arsenalBase which is being accessed by the action put onto other items using the above code. I'm confident the code should work as intended as I have a second supply box called testBase, and using advanced developer tools (linked below) whilst in the mission on the server, I can run the above code with testBase instead of _this and it adds the action which allows the player to open ACE arsenal with the items present in arsenalBase available to them. However, putting the code into the Crate init: field with _this instead, the supply drop doesn't have the action.
https://steamcommunity.com/sharedfiles/filedetails/?id=2369477168&searchtext=advanced+developer
Additionally, to ensure that the Crate init: field is being called, I have tried using the below code instead which worked fine and as intended, removing all items from the crate.
clearWeaponCargoGlobal _this;
clearMagazineCargoGlobal _this;
clearItemCargoGlobal _this;
clearBackpackCargoGlobal _this;
I know that the addAction command is usually ignored on dedicated servers, however I'm attempting to use remoteExec to execute the code, the -2 flag indicating that it should be run on all client machines but not the server. And again, this works fine on testBase when using the advanced developer tools on the dedicated server with other people also being able to see and use the action.
Any advice is appreciated. π
_this is not defined
don't remoteExec "call". Just remoteExec "addAction"
Or if you want to remoteExec call, you must use the binary syntax and pass the box as argument (_this)
But that's slow and not recommended
I may be misunderstanding your meaning but in the editor, the tooltip for the Crate init: field states Code executed upon crate spawn (affected crate: _this). and again the codes to clear the inventory which also reference _this all work.
When you remoteExec it _this is no longer defined
oh shit that actually kinda makes sense
You've put it in a code
It's not "processed" anymore
Except where the code is executed, which is not "there"
that's fair, sorry I'm kinda new to this and at this point have spent over 20 hours trying to feel my way through the dark debugging this aha
It's ok. Like I said just remoteExec addAction instead
See the pinned messages for examples
There's one for addAction
so would I be able to just get rid of the _this, or do I need to somehow assign the crate a variable name when it's created, which I then use to refer to it in the script being remotely executed?
If you write it like I said _this is already defined
I would show you but I'm currently on mobile so...
[_this, ["<t color='#FFFFFF'>Open Ace Arsenal</t>", { [arsenalBase, player] call ace_arsenal_fnc_openBox},nil,10,true,false]] remoteExec ["addAction", -2];
Took me forever to type... 
Also your brackets were wrong as I just noticed...
absolute king shit thank you aha
holy shit it worked, thank you so much π I appreciate it, and the time you took, thanks!
Hi guys so i am messing with a wind a bit in arma 3 with Ace mod on and this is the script that i have for just showing the direction of the wind.
[] spawn {
_arrow = createVehicle["Sign_Arrow_Direction_F", position player];
while {true} do {
_arrow setDir windDir;
sleep 0.01;
};
};``` But as soon i try to change direction of a wind with SetWindDir the wind just resets to initial position. Also when i am trying to change wind direction in zeus also resets to initial position is there any reason why is this happening ?
https://community.bistudio.com/wiki/setWindDir is server only command
Is there a code to get Aircraft to fly at a fixed altitude for a low flying flypast?
Thank you kindly
Yea i am executing setwindDir server side the arrow changes position for a second and then it returns back imidietly also when i am trying to change direction of a wind in zeus i am unable to change it just resets to initial direction that was at mission start.
Use setWind instead
Also afaik you also need forceWeather or whatever it was called
forceWeatherChange
setwind[100,10,false];
forceWeatherChange; i am executing this arrow changes direction for a second and returns back to initail position again.
See the wiki page on forceWeatherChange
It explains why
That's interesting because Advanced developer tools and the actual output are different on this one
To prevent the engine from overwriting custom weather settings, enable the Manual Control settings in Eden Editor's intel section. This is what says in wiki and manual settings are enabled in Eden and wind is still reseting to inital direction when mission started.
Do you use mods?
Mods such as ace change the weather themselves
Yes i do. Ace CBA and Zeus Enhanced but ace_weather_enabled and ace_weather_windSimulations are disabled in addonOptions.
Is this problem specific to running with a DS or could you also replicate in localhost and/or SP?
How do you get the "actual output"?
Diag_log
That prints the actual string
I show the stringified string
That's why there are more quotes
It's going to be missing the outer msot quotes
Explain this
How is that "stringified"
That's inconsistent behaviour
Str any text having "" and you'll see
Right, so it clnverts the single quotes to double quotes to escape the single quotes
I'd rather it didnt, but that makes it fair
My opinion doesnt matter
same between hint "test", will display test
but "test" in debug console will output "test" π
That's the vanilla behavior. Test in vanilla debug console
If it's different from mine I'll fix it
Otherwise it's not related to my mod
It probably is, i dont use the vanilla debug console because Advanced developer tools is arquably better
I wish it didnt stringify strings, is all im saying
But only for this very minor small thing
You can use the text command
Maybe a tick box to enable/disable stringify the tesult
It removes the outer ""
Give me a sec, i'll take a look at this
Yeah, youre right
Looks reasonable for the task
I'll need to test it in-game but it looks fine
Wait... how come it needs to escape double double quotes when stringifying?
Shouldnt """strong""" be correct already?
Like display that instead?
If my string is ""strong""
Then shouodnt it be fine to just clap quotes around that?
nah, because that would print as "strong" if you put quotes around it.
I'm probably having a small brain moment here, but i dont see how that's in any way relevant
It shouldnt matter what it prints as
The data structure should be retained if possible
And it should be possible
I dont get it
Well, it is what it is
It's a reversible conversion, right. Stringify: Escape everything that needs escaping, then add double quotes. De-stringify: Remove double quotes and then de-escape.
The string
"test"
is printed as
"""test"""
if you print it as string type, because it converts it to a string in order to display it correctly
if you write _var = """test"""
Then _var will contain the string "test"
Ok, but why do existing double quotes need to be escaped again?
so they are correctly turned back when you do _var = """test"""
Like I said, I str the result, regardless of what it is (object, array, number, string, etc.)
If it's a string it'll be converted to string again, so " should be escaped
Im not critizising ADT, im just wondering why they need to be escaped agaim
Despite being already escaped
I know. I'm trying to explain the escaping
If you don't escape them, the string will become "unclosed". You can write it out in a text editor that supports syntax highlighting and see what happens
Consider that someone might actually want to have a double quote inside a string for some goddamned reason :P
extDB3
And you want stringify + de-stringify to preserve that.
Regularly need it for the nightmare that is the loadout array
Nah, i wanted to edit all the single double wuotes to double double quotes
And i got confused by the results given by the debug console
Since they dont match what i was getting as output from the extdb3 log and diag log
I mean if someone wanted to preserve a double double quote.
Then it would become a triple double quote
It you stringify it
I dont understand whya double double quote becomes a quadrupple double quote
because escaping is per-character.

I dont get it
From both software standpoint and infirmational value, this seems like a load of unnecessary bs to me. But it is what it is. I dont need to dwell into it further
Quick question for anyone
If I:
[localize "STR_DT_Group_Disbanded"] remoteExecCall ["hint",_group];
Thats gonna localize it to whoever is sending the message, not to the person receiving?
Most likely π
nope
the localize will happen on the sender's machine
Surely then its yes to the question, but answers it either way π
So I have to make a function just to localise a hint on a receivers machine, yey
yep
DOM_fnc_hint
params [["_string", "", [""]]];
hint (_string call BIS_fnc_localize);
Just woke up. Still need help with this?
still need help with this?
Is there a way to attach stuff to a heli with the AI still being able to fly it?
should still be able to use Attachto, no?
or does that break the AI's ability to see pathing
Anyone an idea for making street names? Like you drive through the city and get an info "you are now on road ..."
LOL
AttachTo. They will ignore what every you attach.
That's the thing they just fly up and up and up.
They think that the attached objects are the new ground level but they can't out climb it.
Ah. I assumed you were attaching a small object or something. What are you trying to attach?
hideObject might work but not necessarily useful.
disableSimulation maybe worth trying
but they're probably doing a raycast at the ground and I don't think that'd care about disableSimulation.
an update: I need a method to get all roads connected to each other but it should end when there is an intersection
hey umm
[bomber, BLU-1/B 750lb Napalm, 6] call VN_ms_fnc_dropOrdnance
any tips on fixing?
I figured it out, thanks :)
classnames are always gonna be strings
well no
but it works

tested it works great
do you have a link to the docs for that function
no someone gave me it
I donβt understand how that works without quotes
[]?
no Iβm confused why the second argument works
turns out it doesnt drop the bombs from the jet. they just appear in a nice line lol
Oh well there it is
Put quotes around the second argument
still need a jet tho
Wait it drops the right bomb?
yea napalm
6 of them
the jet poops them out, but looks like it doesnt use its own bombs
thatβs probably what the function is for
you donβt need a SOGPF function to have a jet drop its own bombs
well its easy so im happy lol
Function probably has a default, so it does the same thing as [bomber, nil, 6]
Although I'm a bit surprised SQF gets past the / without dying :P
Well I tried it with 100 bombs and it worked aswell lol
heβs saying itβs probably not seeing what youβre inputting for the bomb and instead defaulting to what might be the same bomb
which is the only thing that makes sense here in my mind
if you donβt put quotes around the classname itβs an undefined variable
Na I tried napalm and a jet with daisy cutters aswell
like this
Iβll bet itβll still be napalm
Default is snake eyes or napalm, randomly selected.
Just looked like bombs. But haven't used snake eyes so dunno what it looks like
And yeah, no way BLU-1/B750lbNapalm works as expected.
It's basicaly variable BLU minus 1 divided by variable B750lbNapalm
so... nil
Must have got lucky with it selecting napalm my 1st try lol
[bomber, ["vn_bomb_500_blu1b_fb_ammo"], 6] call vn_ms_fnc_dropOrdnance;
should work
yea me copied wrong name for it lol
You also haven't passed it as a string, actually the function expects an array of strings.
hmmm do missles work for that aswell
Not really, it spawns the ammo with downwards velocity.
I guess it will work but it's kinda not expected for missiles to shoot straight down.
ah well
That function was quick and lazy attempt to have some sort of reliable bombing. But it does not look very good. 
i think its fine for bombs
There's also vn_ms_fnc_casAirstrike
now i dont have to use Unitcapture for all me stuff
which uses that function to bomb stuff but it spawns the plane for you.
Somewhere where you trigger the bombing run. 
Depends on how you script your missions, could be trigger, FSM, some scheduled script waiting for something...
oh i just put that code in the jets Move waypoint lol
Thanks for the Help AF, you have saved me 900 hours of unit capture lol
AF is just my clan tag, lol. You're welcome.
How big does Movedata in Unit capture need to be before it could cause problems?
π€
the first limt that comes to mind is the 10,000,000 elements limit
for an arma array
I think you'll only have issues if you try to call the function globally
I think the largest unitcapture array I've had was 500 KB but that worked just fine
what are you doing to require that much data?
also, are you 100% certain you are only calling the function server-side?
A long ass helicopter ride
is there anything special happening beyond take-off and landing?
because you can, for example, have the ai fly itself for a while and then have unitplay take over
not that it's strictly necessary, it'll just save you some time getting the unitcapture right
and cut down on the file size
Hmm I don't trust the AI
Can anyone give me tips on how to find the paths for playing sounds? I want to play a built in sound from Arma from here:
C:\Program Files (x86)\Steam\steamapps\common\Arma 3\Addons\sounds_f_characters.pbo\human-sfx\P02\Breath_Aiming_1.wss
I'm calling it with:
playSound3D ["A3\sounds_f_characters\human-sfx\P02\Breath_Aiming_1.wss", player]
I get the error that it cannot find the sound file. I've tried the examples from the wiki and they fail the same way.
have you tried removing .pbo
oh my bad
you did
no wait
you did not
Typo on my part, yes I did it without .pbo and without .wss
Well I tried it with and without to be honest
I also tried @A3 for the start
I've tried the examples from the wiki and they fail the same way.
do you have an example
Sure, I can get a screen capture of my test trigger and the error
\a3\sounds_f\characters\human-sfx\P02\Breath_Aiming_1.wss
the PBOPREFIX determines the path of the addon
just slapped that in the console and that works for me