#arma3_scripting
1 messages · Page 658 of 1
😅
I mean _marker = mrkNull;, instead of ""
makes zero sense
yes
yes
@wind hedge #arma3_scripting message
why is wrong to use name _x for the marker name? I want just one marker per contact... that way if the old marker hasn't been deleted yet the new one won't be created...
_marker is the marker's name
I don't mean in _marker but here:
_contactName = name _x;
_marker = createMarkerLocal [_contactName, getPosWorld _x];
Ok what is the best way to give the marker a random name?
I thought _x was the marker
_x is a unit or an agent for the script
yeah
in fact it must be an object
also it might be a good idea to remove the vehicleVarName 
then set it back
anyone got a good class for a CAS bomb to spawn and explode?
{
private _target = leader _x;
if (expectedDestination _target # 1 != "DoNotPlan" && alive _target) then
{
_target spawn
{
scriptName 'ENH_Attribute_DebugPath';
private _arrow = objNull;
private _arrowColour = format ['#(rgb,8,8,3)color(%1,%2,%3,1)', random(1), random(1), random(1)];
private _path = [];
private _marker = createMarker [format ['ENH_DebugPath_%1', str _this], _this];
_marker setMarkerShape "polyline";
_marker setMarkerColor configName selectRandom ("true" configClasses (configFile >> "CfgMarkerColors"));
private _posOld = getPos _this;
while {alive _this} do
{
if ((_this distance _posOld) > 20) then
{
if (GETVALUE("DebugPath") > 1) then
{
_arrow = createVehicle ['Sign_Arrow_Direction_Blue_F', position _this, [], 0, 'CAN_COLLIDE'];
_arrow setObjectTexture [0, _arrowColour];
sleep 0.2;
_arrow setDir (_arrow getDir _this);
};
_path append [getPos _this # 0, getPos _this # 1];
_posOld = getPos _this;
if (count _path > 3) then {_marker setMarkerPolyline _path};
if (count _path == 500) then {_path deleteRange [0, 2]};
sleep 0.2;
};
};
};
};
} forEach allGroups;```
I am looking for suggestions to make this a bit faster. Any ideas?
@wind hedge you can review this for another method to set marker name
#arma3_scripting message
don't understand.
You want it to be faster, but you are running it in scheduled, with sleeps inside?
("true" configClasses (configFile >> "CfgMarkerColors")); don't do that for every group, do it once before the loop
Faster was not the right word I guess. Less performance heavy? 😬
They don't have to
Oh I thought you were replying to @spark turret 😅
well my bombs just wont spawn:
"Bo_Mk82 " createVehicle ((getPos _plane) vectorAdd [0,0,-10]);
positions are all correct and debugged
that was just for debugging, i have an array of positions
they have the correct ASL height
you have a space there

it returns null object as my bomb
uh space
oh ffs
okay now they are spawned, says 6270932Bombs_01_fls.p3d. but the bomb doesnt show up on my zeus and has no impact.
{
[_x,str _forEachIndex] call _createDBMarker;
systemChat str ["bombpos: ",str _x];
_bomb = "Bo_GBU12_LGB" createVehicle (_x vectorAdd [0,0,10]);
{
_x addCuratorEditableObjects [[_bomb], true];
} forEach allCurators;
sleep random 0.5;
systemChat str _bomb;
} forEach _bombPosArr;

didn't you say the pos were ASL?
doesnt show up on my zeus
you can't edit bombs
(afaik)
yeah positions are ASL
then use setPosASL
on the bombs?
yes
well i tried spawning quadbikes instead, and that worked
then try giving the bombs some velocity
OH YEAH
setPos asl worked!
oh thats sick. gonna commit a whole lot of warcrimes punitive expeditions now
Read the examples
yes, but the last "," has to be removed
yes
You can also try https://www.armaholic.com/page.php?id=31300
Armaholic - Covering the Arma series - Arma 3 | Arma 2: Operation Arrowhead | Arma 2 | Arma 2: British Armed Forces | Arma 2: Private Military Company | Armed Assault
Which I wrote years ago
Exactly
The answer to the original problem with sideChat is to set the characters' group callsigns with setGroupID, since the cause of the problem is sideChat displaying only the group callsign when used on AI
And don't forget to properly broadcast commands if this is a multiplayer mission, otherwise only the server will see the messages, have the right callsigns etc.
The above example will show the subtitles for whichever client the script is run on, so you need to either run the script on all clients (carefully) or remoteExec the function call (carefully)
This use of setGroupID is one of the few cases where you can safely use the unit's init field, but don't make a habit of it
speaker_1 setGroupId ["Cpt. Miller"];
speaker_1 sideChat "Hello ladies!"
speaker_1 is the variable name of an object (some unit)
Reading back through, it looks like this is all going in a script activated by a trigger. That's good.
For best locality control, put all of this in that script file, make the trigger Server Only, and have the trigger broadcast the script to all clients e.g.
[[],"talk2.sqf"] remoteExec ["execVM"]```
then anything in the script will be run for every client without worrying about further remoteExecs
(do not do this if your script contains other commands that already have Global effects; their effects will be duplicated by the number of connected clients)
Am i blind or is there no way to access a backpack inventory that is not on a unit?
double-click on it when browsing the crate/trunk
…scripting-wise, sorry 😅
Yeah, i need it via a script. I can get a weapons loadout with weaponsItemsCargo but on a backpack i can only get its classname and not what it has inside
I did find this function calld everyBackpack but it returns a single object or something i dont know and not an array. Ex: [237add26080# 1781190: backpack_bergen_f.p3d]
https://community.bistudio.com/wiki/everyBackpack
@little raptor @cosmic lichen The motion Scanner script is working like a champ! Thank you guys! The markers even have pseudo animation like I wanted, looks quite like the one from aliens... https://i.ibb.co/X2Pms92/Motion-Scanner1.jpg
Nvm i think i figured it out.
vShowAllyOnMap = {
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", {
_display = _this#0;
if ((visibleMap OR visibleGPS) && diag_fps > 15) then {
{
_icon = getText (configfile >> 'CfgVehicles' >> typeof _x >> 'icon');
_display drawIcon [
_icon,
[0,0,1,1],
getPosVisual _x,
24,
24,
getDirVisual _x,
name _x,
1,
0.03,
'PuristaMedium',
'right'
];
} forEach (units (side player) select {isFormationLeader _x OR group player isEqualTo group _x});
};
}];
};
👆 Any Idea why this shows icons correctly on the map but not on the GPS mini map
I am guessing it has to do with findDisplay 12 displayCtrl 51 ctrlAddEventHandler
the map and the gps are different displays and therefore different controls as well
@wind hedge Also don't use getPosVisual 
Hi, i making mission with enemy AI, and have problem with them.
When player enter AI base - they don't see player before being attacked.
Is possible to somehow scan radius and mark player as target for them?
reveal
@little raptor ty
Probably a long shot but is it possible stop the ai from taking a certain stance, lets say prone, but still allow them to switch between the other 2, crouch/standing
Make them change stance yourself?
nah im talking enemy ai? like i want them to be standing around guarding some where but if they go in combat mode there not locked to a single stance
while avoiding prone
tired of ai going prone behind sand bags when they could be crouched and watching the door way
but at the same time it is posible for the player to get there undetected so it dosnt make sense for them to be crouching already
maybe a tweak between setUnitPos and setUnitPosWeak, but there is (unfortunately in that case) no "minUnitPos"
is getDirVisual ok or should I just use getDir (same script posted previously)
that's fine
But getPosVisual is slow
use another visual variant
like getPosASLVisual or getPosWorldVisual
here's some (really bad) workaround:
_unit addEventHandler ["AnimStateChanged", {
params ["_unit"];
if (stance _unit == "prone") then {
_unit setUnitPos "MIDDLE";
_unit spawn {sleep 10; _this setUnitPos "AUTO"};
}
}]
hmmm i suppose il just have to work around it then and have the guards be static and disable their move animations and have a trigger that switches them to the appropriate alerted stance
just use what I wrote
vPreventAiProne = {
params ["_aiUnit"];
_aiUnit addEventHandler ["AnimStateChanged", {
if (isNil "AiAnimStateChangedTimeOut") then {AiAnimStateChangedTimeOut = time;}; //Prevents EH Spam
if (time < AiAnimStateChangedTimeOut) exitWith {}; //Prevents EH Spam
AiAnimStateChangedTimeOut = time + 5; //Prevents EH Spam
params ["_unit", "_anim"];
private _onFoot = isNull (objectParent _unit); // check for vehicle
if (!_onFoot) exitWith {}; // no further action if unit in vehicle
if (stance _unit isEqualTo "PRONE" && !(isPlayer (leader group _unit))) then {_unit disableAi "WEAPONAIM";} else {_unit enableAi "WEAPONAIM";};
if (canStand _unit && !(isPlayer (leader group _unit))) then {
if ((behaviour _unit in ["AWARE","COMBAT"]) && stance _unit isEqualTo "PRONE" && speed _unit < 1) then {
[_unit, "MIDDLE"] remoteExec ["setUnitPos", _unit];
} else {
[_unit, "UP"] remoteExec ["setUnitPos", _unit];
if (speed _unit > 1) then {[_unit, "UP"] remoteExec ["setUnitPos", _unit]; [{params ["_unit"]; [_unit, "AUTO"] remoteExec ["setUnitPos", _unit];},_unit,4] call CBA_fnc_waitAndExecute;};
};
};
}];
}; ```
What I use, Leopards' probably better thou
getPosWorld _x worked just fine... I believe that one is the fastests
yes
will assign turret make the unit its assigning to the turret move to get on a turret
vShowAllyOnGPS = {
waitUntil {!isNull (uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull])};
private _display = uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull];
// Controls
private _miniMapControlGroup = _display displayCtrl 13301;
private _miniMap = _miniMapControlGroup controlsGroupCtrl 101;
_miniMap ctrlAddEventHandler ["Draw", {
_display = _this#0;
if ((visibleGPS) && diag_fps > 15) then {
{
_icon = getText (configfile >> 'CfgVehicles' >> typeof _x >> 'icon');
_display drawIcon [
_icon,
[0,0,1,1],
getPosWorld _x,
24,
24,
getDirVisual _x,
name _x,
1,
0.03,
'PuristaMedium',
'right'
];
} forEach (units (group player));
};
}];
};
👆 Not working, no errors... don't know why, the map version works perfect but this one for the GPS mini map does not...
👆 It seems you can draw icons on the GPS mini map
@wind hedge how are you execing your code?
initPlayerLocal.sqf
[{[] call vShowAllyOnGPS;},[],(10 + random 10)] call CBA_fnc_waitAndExecute;
sorry to intrude im extreamly new to arma but do to my situation im gonna have to do alot of self scripting i was wondering if anyone had advice for a beginner
Don't overuse CBA_fnc_waitAndExecute. It's unscheduled
I can't overuse spawn and can't overuse CBA_fnc_waitAndExecute 😦
It's a matter of choosing between bad and worse 🤷
In this case, CBA_fnc_waitAndExecute is worse
please and thanks
hi there, yes we have 😉
see https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting and all the links in it; if you need more help, feel free to ask here!
thank you
Hi, any one who knows why this creates:
1 "B_helipilot_F" driver
1 "B_helicrew_F" commander and
2 "B_helicrew_F" gunners?
(and two "B_helicrew_F" passengers..)
_veh = "B_CTRG_Heli_Transport_01_tropic_F"createVehicle(player modelToWorld [8,0,0]);
[_veh, ["B_helicrew_F", 2,3,4,5,6], false, true, false] call BIS_fnc_initVehicleCrew;
What I am trying to figure out is how to make the driver not apperar.
https://community.bistudio.com/wiki/BIS_fnc_initVehicleCrew
Well your BIS_fnc_initVehicleCrew parameters are wrong.
anyone got any good videos on doing an animated opening with bis_fnc_animatedOpening?
Is this also wrong then?
AI ends up in the driver seat..
Not in the gunner seat which I request.
_veh = "B_CTRG_Heli_Transport_01_tropic_F"createVehicle(player modelToWorld [8,0,0]);
[_veh, ["B_helicrew_F", "gunner"], true, true, false] call BIS_fnc_initVehicleCrew;
so, if I add this to description.ext it does draw on the GPS mini map (requires CBA)
class Extended_DisplayLoad_EventHandlers {
class RscCustomInfoMiniMap {
VAL_DrawGPS = "\
params ['_display'];\
private _control = _display displayCtrl 101;\
_control ctrlAddEventHandler ['Draw', {systemChat str diag_frameNo}];\
";
};
}; ```
I just don't know how to run my custom fnc instead of {systemChat str diag_frameNo}
how can I rotate an object with a set amount of force akin to setVelocity?
wonder is some kind person could help me with a mission param i am trying to make
_pos = getMarkerPos "mrk1";
for "_i" from 0 to PARAMS_SquadsPatrol do
{
_randomPos = [[[getMarkerPos "mrk1", 50]],["water"]] call BIS_fnc_randomPos;
_spawnGroup = [_randomPos, EAST, (configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad")] call BIS_fnc_spawnGroup;
[_spawnGroup, _pos, 50] call Bis_fnc_taskPatrol;
};
the error i am getting
_randomPos = [[[getMarkerPos "mrk1", 50]],["water"]] call BIS_fnc_randomP>
21:40:11 Error position: <]],["water"]] call BIS_fnc_randomP>
21:40:11 Error Missing ]
21:40:11 File C:\Users\gaffe\Documents\Arma 3 - Other Profiles\Gaffey\missions\SAS OP VIROLAHTI\TEST.Stratis\sidemissions\side2.sqf..., line 39
[[getMarkerPos "mrk1", 50]] why is that double bracketed?
_randomPosAroundPlayer = [[[position player, 50]],[]] call BIS_fnc_randomPos;
i was gong off BIS wiki and and i use to use a simple thing
For the Dynamic Simulation, when a player is near vehicle for example, does it activate the simulation only for him or for all players on the server ?
_control ctrlAddEventHandler ['Draw', {call VAL_fnc_customFnc}];
```Don't you think?
I don't see "gunner" on the list of available values though.
everyone
addForce or more likely addTorque if you can figure those out.
The problem is that VAL_fnc_customFnc is loaded later... will try anyway
thanks I'll try
@winter rose ty
No matter weather I use be it "driver", "turret" or "cargo" the AI always ends up in the driver seat.
[B_helicrew_F, "cargo", #]
doesn't help as well. # being any number.
Adding different numbers fills up the slots in the order of first driver, commander, gunner x2 then passengers.
Is there perhaps a way to delete driver AI via a script?
Yes, veh deleteVehicleCrew driver veh
anyone ever had issues with addTorque?
it seems to not apply sometimes
Thanks it worked. 🙂
I'm at extremely low values, it seems that after 0,09 it doesn't apply
Well it does some PhysX thing 🤷♂️
So I suppose if the game engine or PhysX decide that the applied force is not sufficient, no movement happens
Is there a way to block the AI from leaving the vehicle which it always tend to do?
allowCrewInImmobile should do
if we are talking about broken vehicles
I see, in the situation above the crew see that they lack a pilot and the same gunner always jump out to take pilot seat.
that might be an AI mod thing
what is the smartest way to do this: forEach ((units group player)-player);
selecting all units part of a group without the player calling the fnc
forEach (units player - [player])
Thanks!`
but its also more efficient than spawn or most others.
how so?
you can have thousands of waitAndExecute and they won't need any more performance than just having one
except if their wait is over of course
wheras sleep will check everytime as often as it can if the sleep is over
then optimize it 
you're a dev now 😅
"I would like a crate of optimisation, please!"
hello! Can someone help? In editor i unchecked receiving damage in vehicle atributes but the vehicle still gets damage - flat tires, demaged engine etc. Is there a script that would prevent a vehicle from taking damage?
you may be using mods, such as ACE
that's right
so... there's no way to prevent a specific vehicle from taking damage?
myVeh allowDamage false
should do, but I can't guarantee a mod won't interfere as well
same difference
missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", player]```
is this a local or global command?
i.e. can this script pickup a player who remote controls a unit on the server
no
can i put it into init of the vehicle with "this" ? like this allowDamage false; ((by the way how do you make it so that a script looks like a script in the chat?))
that's what the tickbox does, so you might have to delay it
as for the SQF highlight, see the pinned message about it 😉
i don't get it, never mind, also may i ask how to set game difficulty on a dedicted server?
/users/arma3 -> arma3.Arma3Profile ?
Is this what you mean?
{
if (_x select 0 > CBA_missionTime) exitWith {};
(_x select 2) call (_x select 1);
// Mark the element for deletion so it's not executed ever again
GVAR(waitAndExecArray) set [_forEachIndex, objNull];
_delete = true;
} forEach GVAR(waitAndExecArray);
it sorts the array and exits once it matches a script that hasn't reached it's time
then optimize it
I guess you can't optimize it after all 😛
Is there a specific discord for ACE scripting?
There is an ace slack
Alright, I'll look into it
I'm having a bit of trouble with the whole worldtomodel thing, I'm getting the position using this:
player worldToModel ASLToAGL getPosASL (vehicle player)``` but the position renders in a different place from where I expect it to be
For example,
addMissionEventHandler ["Draw3D", {
_posDriver = [0.0151367,0.603027,-0.756775]; //player worldToModel ASLToAGL getPosASL (vehicle player)
_posCargo = [0.00183105,0.731201,-0.841608]; //player worldToModel ASLToAGL getPosASL (vehicle player)
_color = [1,1,1,1];
_worldPosDriver = atv modelToWorld _posDriver;
_worldPosCargo = atv modelToWorld _posCargo;
drawIcon3D ["a3\ui_f\data\igui\rscingameui\rscunitinfo\role_driver_ca.paa", _color, _worldPosDriver, 1, 1, 0, "Sit Here (driver)", 1, 0.05, "TahomaB"];
drawIcon3D ["a3\ui_f\data\igui\rscingameui\rscunitinfo\role_cargo_ca.paa", _color, _worldPosCargo, 1, 1, 0, "Sit Here (passenger)", 1, 0.05, "TahomaB"];
}];
``` the passenger position shows in front of the driver position for the quad bike
vehicle player worldToModel ASLToAGL getPosASL player
_posDriver = [0.0151367,0.603027,-0.756775]; //player worldToModel ASLToAGL getPosASL (vehicle player)
_posCargo = [0.00183105,0.731201,-0.841608]; //player worldToModel ASLToAGL getPosASL (vehicle player)
both are in front of the model
what'd you expect?
I just figured it out before I checked your reply, I should have defined the position using (vehicle player) worldToModel (position player)
Can someone help me with my script? After the side addAction the rest of the code doesn't run. https://pastebin.com/ApLu6WXq
because you're using exitWith
and it doesn't resort every frame, like scheduler does
How do you override an eventhandler with a boolean again? say I want to write my own exit function for the getout event handler and cancel the default event?
ah, okay thanks
Is anyone else having the issue
When using setUnitCombatMode "BLUE";
on a group, when under fire the group leader is giving the open fire command taking them out of BLUE
I believe it happens on blue green and white
Gonna make a repo mission and open a ticket :)
would it be under AI Issues or Scripting (when making bug report)
also trying Also trying
disableAI "WEAPONAIM" and or
"AUTOTARGET" and or
"AUTOCOMBAT"
Does nothing as well
It seems when I define a cfgSounds class in my mission file, I have to link the sound path also from the mission file, is there a way around this?
hm can i change the vehicle texture style based on the defined TextureSources or do i have to setObjectTexture everything myself?
nice, exactly what i need. thanks
Tried googling my ass off, could only find older mods/scripts. Anyone knows of a decent lootspawner script that has different lootspawns for Military/Civillian/Industrial etc?
wat? The scheduler does sorting? Isn't that pointless?
Or maybe you could write it like CBA 
(sort only if new scripts added)
Do you have any mods?
thats rather easy to build yourself
i assume you want crates with different stuff in it?
What I want is a loot spawner that spawns loose loot inside buildings. Military buildings with a higher chance of military loot, Civillian items inside Civillian buildings etc. I've seen a few ready scripts, but they're so old. Do you know if scripts get "out of Date". Or could I possibly use an old one?
Imagine dayz kind of loot. I'd love to try and make one myself, but really don't know how to, and I cant seem to find a good tutorial on building a lootspawner script
scripts dont really outdate. arma has 100% backwards compatibilty
Ahh, Allright. I guess I'll just try a few different ones then and see if they work
idk about positions in houses but bis_fnc_findSafePos is great for finding a position free of objects to place a lootcrate at. only works outside of houses tho
but houses have positions for the AI to stand at, maybe you could use that.
other than that its just building an array template for what kind of loot to but in a crate, and then randomly select from that.
Sounds reasonable, I'll have to look up a few tutorials first tho, I've done some simple scripting, but I think I'd have to practice and learn more before I venture deeper. Thanks for the help! I'll start by downloading some made scripts and then I'll try to edit them to my liking. I highly appreciate your help
np
i built a weighted lootspawner for another game, so if you need help with that, just ping me
Will do, appreciate it 😁
if you want to make the entire squad hold fire, use setCombatMode, not setUnitCombatMode
the locality of a vehicle changes if you get in as a driver only, or also if you get in as a passenger?
I think passenger too. But not 100% sure
Well really we want specific units to hold fire not the entire group because when AI in danger mode their movement is awful so when they are on hold fire they tend to move a lot better
iirc, in arma 2 you could order an airstrike or similar, it would wait for you to click on the map and then use that position. any idea how thats done?
is there a "playerclicked on map EH" or similar?
oh boy, two new things. thats gonna take a bit to figure out
i mean the easy way out would be to tell the player to create a marker called "target" and then use that 🤔
Yeah. There's a module for airstrike I think
i wanna use my own airstrike, im only interested in the calling action
Re: the setunitcombatmode thing
I did try it on 2 out of the 4 units in a group but the leader still over rites the never fire command in BLUE
that shouldnt happen afaik
are you sure your script command is effective? did you make sure the untis combatmode is actually changed?
also, combatmode is effective for the whole group, not single units
oh what
#arma3_feedback_tracker reported it with a repo mission :)
Anyone who knows how to ad a squad of B_CTRG_Soldier_JTAC_tna_F to the cargo seats of the helicopter?
Using BIS_fnc_initVehicleCrew to place "cargo" seems to remove the already placed crew and instead add the B_CTRG_Soldier_JTAC_tna_F to the pilot seat.
_veh = "B_CTRG_Heli_Transport_01_tropic_F"createVehicle (player modelToWorld [8,0,0]);
createVehicleCrew _veh;
_veh deleteVehicleCrew driver _veh;
[_veh, ["B_CTRG_Soldier_JTAC_tna_F", "cargo"], true, true, false] call BIS_fnc_initVehicleCrew;
_veh setUnloadInCombat [true, false];
_dirP = getDir player;
_veh setDir _dirP
create the soldiers then use moveInCargo
Where do I go wrong? I don't get the B_CTRG_Soldier_JTAC_tna_F to enter the vehicle.
_veh = "B_CTRG_Heli_Transport_01_tropic_F"createVehicle (player modelToWorld [8,0,0]);
createVehicleCrew _veh;
_veh deleteVehicleCrew driver _veh;
_cargo = "B_CTRG_Soldier_JTAC_tna_F" createVehicle (player modelToWorld [8,0,0]);
_cargo moveInCargo [_veh, 5];
_veh setUnloadInCombat [true, false];
_dirP = getDir player;
_veh setDir _dirP
I've also tied with:
_cargo = "B_CTRG_Soldier_JTAC_tna_F"
_cargo moveInCargo _veh;
soldiers are created with createUnit
not createVehicle
_cargo = "B_CTRG_Soldier_JTAC_tna_F"
_cargo moveInCargo _veh;
wat?
Also I don't think moveInCargo takes indices
it's moveInCargoIndex afaicr
Yes, there seems to be an index for that https://forums.bohemia.net/forums/topic/103404-vehicle-moveincargo-position-indexes/
It also seems like to make the "moveInCargo" work that I need to access en edit in the created Units init. Do you know how to do that?
Q: re: hashmap, new with recent A3 updates... it kinda wants to behave like an associative array, correct, but it is not an "ARRAY" per se, rather a "HASHMAP". can I "test" whether I "have" one? i.e. isNull?
also, once I have createHashMap is there a way to dispose of it, if necessary? i.e. deleteHashMap, or it is a memory hole at that point, use a singleton, etc, wisely?
Hi, anyone who know how to make the unit actually spawn in the cargo of the helicopter an not spawn running around outside?
_veh = "B_CTRG_Heli_Transport_01_tropic_F"createVehicle (player modelToWorld [8,0,0]);
_unit = "B_CTRG_Soldier_JTAC_tna_F" createUnit [getPos _veh, group player];
_unit moveInCargo [_veh];
If the helicopter belongs to the player's group, there is a parameter for createUnit that creates the unit in its group's vehicle's cargo
I don't see any reason why moveInCargo wouldn't work. Just to be safe, try remoteExec'ing it using _unit as the locality argument
[_unit,_veh] remoteExec ["moveInCargo",_unit]```
And moveInCargo does accept indexes according to its wiki page
Is there any difference if the helicopter does not at present moment got the player in it?
If it doesn't have any members of the group in it, it probably won't be considered to be "the group's vehicle", so the parameter for createUnit won't work
shouldn't make any difference for moveInCargo
How can I know when the Arsenal display has been closed?
Got error |x|remoteExec .
What kind of error?
Hashmaps have a create... because adding in syntax support for them is hard, not because you need to dispose of them 😉
testing wether you have one can be done, like with many things, using typeName or isEqualType
What did the error actually say? Undefined variable, unexpected type, generic error........?
@queen cargo appreciate the response. I guess I'll get creative using the usual tricks, because hash maps do not respond in quite the same way I am finding. but that's fine, for what it is.
mhh?
hashmaps are essentially normal objects in a lighter way
allowing custom namespaces without creating (and later then destroying) location objects eg.
'... os _veh, group player];
[unit,_veh] |#|remoteExec ["moveInCargo",_unit]'
Error Type Any, expected Number, Side, Object, Group, String
You're missing an underscore in front of unit
In relation to my question I've found: sqf _display closedisplay 2; How would I check if this is closed?
Sorry, typo in chat. Not in game though.
_veh = "B_CTRG_Heli_Transport_01_tropic_F"createVehicle (player modelToWorld [8,0,0]);
_unit = "B_CTRG_Soldier_JTAC_tna_F" createUnit [getPos _veh, group player];
[_unit,_veh] remoteExec ["moveInCargo",_unit]
; at the end?
it is there in game. Get same error.
Refer to "Alternate Syntax" here: https://community.bistudio.com/wiki/createUnit
createUnit is not returning a unit reference, which breaks moveInCargo.
Format like this:
"B_CTRG_Soldier_JTAC_tna_F" createUnit [_veh, group player,"this moveInCargo (nearestObject [this,""B_CTRG_Heli_Transport_01_tropic_F""])"]; ```
or use the first syntax of `createUnit` to return a valid unit reference:
```sqf
_unit = (group player) createUnit ["B_CTRG_Soldier_JTAC_tna_F",_veh];
_unit moveInCargo _veh;```
Wow! Nice first format worked! 🙂
(second did not..)
there are scripted event handlers for ArsenalOpened and ArsenalClosed: https://community.bistudio.com/wiki/BIS_fnc_addScriptedEventHandler
ooo thanks
how to diag_log long string ?
I have a string var with more than 255 chars
I would like to diag_log its value
but it prints only part of value in log file
using BIS_fnc_objectsGrabber to generate long string
Guess you have to split it up
copyToClipboard is the answer
Oh you want to copy it. Why didn't you say so
There is also a Uig in Eden Editor you can use.
display3DenCopy
The script that wasn't executed for the longest time, runs first.
Hi all, is there a eventhandler or a decent way to detect when a waypoint has been completed?
the waypoint statement itself, no? or is it more global?
I was looking at: https://community.bistudio.com/wiki/setWaypointStatements
But was wondering if there's any better way
what is the use case?
Wanting some ambient civs to go around, once the waypoint is done gonna delete and give it a new one depending on where the players now are
waitUntil { speed _myCivilian == 0 }; 😄
or waitUntil { unitReady _myCivilian };
or set WP statement to generate a new WP, directly
unlimited poweeer waypoooints!
speed could be a false positive tho 😛 If speed is 0 the AI might've used its big brain and crashed into a rock and got stuck
true, it was a joke 😁
Fairs ;P
add waypoint once
set trigger statement that
- on execution: add waypoint with a statement that creates another waypoint with waypoint creation, etc
Triggers 😢
you can link triggers to waypoints via script
_waypoint setWaypointStatements ["TRUE", _onComplete]; CBA seems to do this
So maybe thats the best way
how do you correctly define an array using #define? Do I need to wrap the array in parenthesis?
#define USAF_C130J_CARGOPOS1 [-1.50635,8.58154,1.83895]```
store the waypoint position and waitUntil the distance between the unit and that pos is less than, say, 15 metres?
Not an ideal solution, I was hoping for event based as I'm planning on having a decent amount of civs out at one
where is the code of an ace action run when called by a player?
only on the client that activates the action?
You do not "define" an array
you can define text replacements, the preprocessor will emplace prior to the actual compilation
as in:
#define FOO BAR
FOO```
will be (after the preprocessing stage)
.
BAR```
(ignore the . tho)
BAR
Super noob question, how would I exclude the group leader from this? grpblue=group this;{dostop _x} foreach units grpblue;
oops wrong one.
wrong what?
I pasted the wrong script, it's been fixed.
so forEach (units grpblue - [leader grpblue]); 😉
how do i post uhm, script format? here
black magic
see the pinned message, ```sqf 🙂
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
weeeh, it werkz!
So, I'm trying to add "infinite seats" to a vehicle, perse, with the attachTo, issue i'm having is that the second "exit vehicle" addAction isn't really working here is the code sqf if (isServer) then { [vehicle1, ["Get in moron", {remoteExec [player attachTo [vehicle1, [0, 0, 0]],0];remoteExec[player setDir 180,0];remoteExec[player switchMove "InBaseMoves_SittingRifle2",0]; [vehicle1, ["Hop outa dah truck", {remoteExec [player attachTo [vehicle1, [0, -3, 0]],0];remoteExec[player switchMove "",0]}, [], 1.5, false, false, "", "true", 5, false, "", "" ]] remoteExec ["addAction",0];}, [], 1.5, false, false, "", "true", 5, false, "", "" ]] remoteExec ["addAction",0]; };
remoteExec [player attachTo [vehicle1, [0, 0, 0]],0];
not how remoteExec works 
autonomous/drone turrets seem to have this weird extra fake recoil
like it fires a shot then moves up in the air slightly as if it's pretending to have recoil
then wobbles back down again and misses
remoteExec [attachTo [vehicle1, [0, 0, 0]],player,0];?
and there's zero recoil when actually controlling the turret
Thank you!
Do turrets like the mk30a have recoil that isn't applied when a player is controlling them?
is there a way to get a full "loadout" array of a cargo container?
i dont see how i could get a full backpack inside the container
stated in the doc, can take number, object, string, side, group
but remoteExec on player will execute where it is called, as player is local
i wanna clone the crate.
aha, mabye this:
Ok I understand the function parameters, but like, where would I put the [vehicle1, [0, 0, 0]] I'm assuming not inside the quotation marks
like for example
[remoteExec ["attachTo [vehicle1, [0, 0, 0]]",player,true]
is there no way to add a loaded backpack into a container?
params go in front of the remoteexec
I understand it needs to be in this format - ```sqf
remoteExec ["attachTo",player,true]
[myparams] remoteExec ["myfunction",target,fajtfah]
params remoteExec [functionName, targets, JIP]```
so just like ```sqf
[[vehicle1, [0, 0, 0]]remoteExec ["attachTo",player,true]
well, on a mp server, I want everyone to be able to see that player attached to the vehicle
i'm combining it with addAction
I thought everything is local until I use remoteExec
nope, some commands have global effect (see eG icon on the wiki)
Man sqf hurts my head
just imagine setDamage
it has a global argument (you can setDamage to an AI managed by the server)
and the effect is global (everyone of course will see the unit dead)
can you link me the wiki so I can learn all this
if there even is a specific wiki on locality, I haven't found one .
Thank you.
in the docu there is stated what command is local and what is global. the small icons on the top of the page
ah. thanks!
okay, so i was able to clone backpacks inside crates. everyBackpack gives you a reference to the loaded backpacks, so i get an array of all backpacks in the original, add empty backpacks into the clone crate, get a reference to them and then fill them with the same items the original backpack has. freaking recursion!
but only backpacks are noticed as containers, vests and uniforms are not.
if I do
fnc_blah_blah = {code here}; publicVariable "fnc_blah_blah";
can I
[] remoteExec ["fnc_blah_blah",0];
dedmen gets really angry if you start sending functions over network
just declare them as functions in description ext
don't anger our Dedmen - we only have one
so I am almost done. However I was wondering If I could make a similar script and make a possibilty to randomise say for example, between A G3A3 with attachments, AKMS with attachments etc. Is this possible? To be simple, randomise weapons with attachments. ```sqf
// Check to see if we randomize Weapon
private _weaponProbability = getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "randomWeaponProbability");
if (random 100 < _weaponProbability) then {
{_unit removeMagazines _x} forEach ((magazines _unit apply {toLowerANSI _x}) arrayIntersect ([primaryWeapon _unit] call BIS_fnc_compatibleMagazines));
private _weaponClass = primaryWeapon _unit; _unit removeWeapon _weaponClass;
{
private _cat = format ["%1List",_x];
if (count (getArray(configFile >> "CfgVehicles" >> typeOf _unit >> _cat))>0) then {
[_unit, _x] call FUNC(randomizeWeapon);
};
} foreach WEAPON_CATEGORIES;
};
};
is there any function that detects zeus pings?
onZeusPinged {[getPos _pinger] call bis_fnc_zeuslightning;}
🙏
for https://community.bistudio.com/wiki/BIS_fnc_curatorPinged, is it local to who pinged?
Does this show who pinged, or does it do the actual pinging?
like same as th ekeybind?
@pseudo shadow I am sorry but I think you need this one https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#CuratorPinged as IRONSIGHT mentioned
oh oh yes yes yes this is what i'm looking for
🙏
bless you
totally unrelated, what would be the best way to find if someone did x eventhandler in y seconds? maybe (totally unrelated) 5 zeus pings in 2 seconds.
I was thinking some sort of simultaneous calls, and if it's less than 5 pings, it'll just exitwith{}
i remember there was a biki page about performance listing how many objects of different types you could spawn with reasonable fps. anyone got the link? cant find it.
lol
Oh great. You turned Zeus ping into a suicide button 😆
Hi, I am looking for the name of a action command, specifly the autopilot landing one. My goal is once a airplane reaches a waypoint it autmaticly starts the horizontal landing, its the blackfish. What is the name for said action?
@winter karma You might find it here https://community.bistudio.com/wiki/Arma_3:_Actions
anyone 😦 #arma3_scripting message
Not sure if I understand the realtion between that code and your question
Me too 
You have me 😛
yeah but we have other Leopard20s, it's ok 😄
Is it possible to use the moduleordnance and it's variants without the random radio callout, just to simplify scenic artillery?
You could take the source code of BIS_fnc_moduleProjectile and modify it according to your needs.
I think I got it working, just kept the targets far enough away that the radio callout doesn't proc.
looking for improvements or alternatives. constructive criticism welcomed
BIS_fnc_taskParentExists = {
params ["_taskID"];
if (count _taskID > 1) exitWith
{
private _parent = _taskID call BIS_fnc_taskParent;
_parent call BIS_fnc_taskExists
};
true
};
what's there to improve?!
anyway:
BIS_fnc_taskParentExists = {
params ["_taskID"];
count _taskID <= 1 ||
{
(_taskID call BIS_fnc_taskParent) call BIS_fnc_taskExists
}
};
and it's only marginally faster
(also not sure if your code is valid at all; why do you count taskID?)
taskId can be ["task_4"] (parent) or ["task_4_1", "task_4"] (child)
Why BIS tag for a non-BIS function? 😋
example, in real code there is custom tag
Some way to optimize performance on this one?
_1 = Tochka_1 spawn {
_ZAPUSK1 = _this;
sleep 8100;
_ZAPUSK1 lockTurret [[0],false];
};
_2 = Tochka_2 spawn {
_ZAPUSK2 = _this;
sleep 8100;
_ZAPUSK2 lockTurret [[0],false];
};
_3 = Tochka_3 spawn {
_ZAPUSK3 = _this;
sleep 8100;
_ZAPUSK3 lockTurret [[0],false];
};
_4 = Tochka_4 spawn {
_ZAPUSK4 = _this;
sleep 8100;
_ZAPUSK4 lockTurret [[0],false];
};
_5 = Tochka_5 spawn {
_ZAPUSK5 = _this;
sleep 8100;
_ZAPUSK5 lockTurret [[0],false];
};
_6 = Tochka_6 spawn {
_ZAPUSK6 = _this;
sleep 8100;
_ZAPUSK6 lockTurret [[0],false];
};
hell yeah
[] spawn {
sleep 8100;
{ _x lockTurret [[0], false] } forEach [Tochka_1, Tochka_2, Tochka_3, Tochka_4, Tochka_5, Tochka_6];
};
@quasi sedge ↑
if some Tochka is killed it doesn't matter i guess?
sleep 8100;
command should fail silently
yep PvP for 240 players..
aka 2h15 minutes
PvP for 240 players? GL
we running 220 each week on 7700k
10900k on the way
Holy sh*t, you actually manage to get 240 people on at once?
Christ live, in FNF (Friday Night Fights) They had some issues with having 140 people and had to limit at 124. You have some insane servers and internet speeds for it
answer is zero Ai, max optimized scripts and mods
just so everyone can see!
Yeah FNF had the zero AI, just had some netcode issues. Likely to be server/ mods not being 100% optimised
That is completly insane
also dedicated host must be ddos protected 
If you dont mind me asking, what are the server costs like?
200 usd/m for upcoming 10900k, half of that for 7700k
Well all I can do is tip my hat to you because that is amazing
Might even run better with recent bandwidth changes 😛
Big thanks, wonder if 240 will work flawlessly on 6 more cores
Also we tried linux server, 80 players and server fps was like 10(On 7700k 3 weeks ago~)
Does anyone know if **setGroupIdGlobal **or **setGroupId **need to be executed on each player respawn in a MP game ?
Answer is no.
setGroupID has local effect, setGroupIDGlobal has global effect
as stated in the docu
any ideas about how to access rain occlusion data via script? I was about to use line intersect to determine if player is "inside" but it seems to me this information should be available already (in rain occlusion)?
But the question was whether it persists after respawn 
That's the only way at the moment
You can make a feature request on FT
Sorry for the delay, global exec of playSound3D [getMissionPath "sound\SuspiciousMinds.ogg", radio1, false, getPOSASL Radio1, 2, 1, 25]; works on dedi
Trying to delete units after a UnitPlay function completes. Tried making it activate on a trigger that I timed manually with how long it takes to complete the action. Only thing is, the trigger is deleting the units upon activation rather than waiting for the countdown.
your trigger is probably set up wrong
also thats a very janky approach to a complex thing, so should probably not over use it.
if you want a delayed action after a trigger activates, you can spawn code with a sleep command in the tirggers onActivation
[yourParamstheSpawnedCodeNeeds] spawn {
sleep 10; //sleeps 10 seconds
doSomeCoolStuff();
};
! triggers dont like comments, delete them before use
i know nothing about animations, but have you made sure theres no eventhandler/similar which runs code after the animation completed?
all that's in the UnitPlay script is just the flight path. i don't have anything to say when the animation is completed.
aaaaaaah youre talking about unitCapture, not animations
ye
well i dont know anything about that either 😂 but the trigger delayed code holds up
so would I spawn this code with an execVM?
the delete code for onTriggerActivation?
ye, or would it be in the trigger itself?
cuz at the moment the way my trigger is set, is radio alpha with a 5 minute timer to then delete the crew and vehicle once the time is met.
it can go in the trigger itself. spawn is like a script, without a file
so what is "yourParams..."?
the trigger gives you a reference to what triggered it, "thisList". if you spawn code, it doesnt have any variables it knows, so you have to give them to the spawned code.
so if you want to delete all units known to the trigger you do:
onActivation:
[thisList] spawn {
params ["_unitsToKill"]; //parses the magic _this Variable into the usable _unitsToKill var
{
deleteVehicle _x;
} forEach _unitsToKill;
};
sleep 10;
{v1 deleteVehicleCrew _x} forEach crew v1; deleteVehicle v1;
{v2 deleteVehicleCrew _x} forEach crew v2; deleteVehicle v2;
{v3 deleteVehicleCrew _x} forEach crew v3; deleteVehicle v3;
{v4 deleteVehicleCrew _x} forEach crew v4; deleteVehicle v4;
};```
ah yeah, if you got global varialbes, you dont need to pass anything.
this is what i have in the onActivation
yeah that should work. maybe it wants an empty array as input params, probably not:
[] spawn {
sleep 10;
{v1 deleteVehicleCrew _x} forEach crew v1; deleteVehicle v1;
{v2 deleteVehicleCrew _x} forEach crew v2; deleteVehicle v2;
{v3 deleteVehicleCrew _x} forEach crew v3; deleteVehicle v3;
{v4 deleteVehicleCrew _x} forEach crew v4; deleteVehicle v4;
};
also just outta curiosity, how do you get the text to use colors like that?
three ` + sqf
gotcha, alright, gonna quickly test that code.
alright, looks like it works with the 10 seconds. now to see if it works on the full time or if it's gonna go poopy mode
btw: prettier:
[] spawn {
sleep 10;
{
_vx = _x;
{_vs deleteVehicleCrew _x} forEach crew _vx;
deleteVehicle _vx;
} foreach [v1,v2,v3,v4]
};
nested forloop
ah nice. i'm not that experienced with coding
does this run better or does it just look nicer
pfew well i dont know how the compiler reduces it, but i would assume its also faster. dont quote me tho
anyway, thanks for the help my guy. i was growing insane thinking i'd have to do some really cheap workaround.
lol np
possible to limit the charge selection in artillery? say I want to limit it to charge 0 so it limits range you can fire
Probably easier to make a breakout condition.
If (_target distance2d _arty > 5000) exitWith {nope}
Thats a N-ary vector though
sorry?
I forgive you, son.
i finally managed to clone every item in my crate, including nested containers with items themselves. now onto figuring out how ace stores cargo, so i can clone that as well
theres was an invite link pinned somewhere to the ace discord?
#channel_invites_list somewhere yes - they have a Slack
it's a web/chat like Discord, bit more "professional"
no animated pepe emojiis?
What does the "Hack UAV" interaction do specifically to convert the UAV to the side of the hacker?
maybe join the UAV's AI to a new (friendly) group, but I don't know for sure
Ok, thanks. I'm wanting to try and replicate the drone hacking feature seen with the EMSPEC device in the Contact campaign.
using setAccTime and setAnimSpeedCoef can result in some pretty interesting sudo bullet time / light speed running effect
how do I get the weapons of a vehicle from the classname alone? Say I want to get the weapon(s) of "B_GMG_01_high_F", according to the config its weapon is fakeweapon
I want some way to get "GMG_20mm" which is the actual weapon of that vehicle
how can I get a command to return "GMG_20mm" or whatever weapons a vehicle has, I tried
getArray(configFile >> "cfgVehicles" >> "B_GMG_01_high_F" >> 'Weapons'); which returns ["FakeWeapon"]
you want to search the turrets
getArray(configFile >> "cfgVehicles" >> "B_GMG_01_high_F" >> "Turrets" >> "MainTurret" >> "Weapons")
but isnt there a turrets function?
thanks!
I tried some of the other scripting commands but they all seemed to take actual vehicles, not the config names
Oh cool, thanks again!
Some time ago, I have done a script to check, whether a position is inside of a building.
||```sqf
/*
File: fn_insideBuilding.sqf
Author: Nicoman35
Date: 2020-11-19
Last Update: 2020-11-19
License: MIT License - http://www.opensource.org/licenses/MIT
Description:
Checks, wether given reference position is inside of a building.
Parameter(s):
_refPos - Given reference position [ARRAY, defaults to []]
Returns:
Building, if the reference position lies inside a buildig. ObjNull, if reference position does not lie inside a building. [OBJECT]
*/
params [
["_refPos", []]
];
if (count _refPos == 0) exitWith {false};
lineIntersectsSurfaces [_refPos, _refPos vectorAdd [0, 0, 50], objNull, objNull, false, 1, "GEOM", "FIRE"] select 0 params ["","","","_building"];
if (isNil {_building}) exitWith {objNull};
if (_building isKindOf "House") exitWith {_building};
private _wallScore = 0;
private _directionsToCheck = [[2,0,1],[0,2,1],[-2,0,1],[0,-2,1],[2,2,1],[-2,2,1],[-2,-2,1],[-2,2,1]];
{
lineIntersectsSurfaces [_refPos, _refPos vectorAdd _x, objNull, objNull, false, 1, "GEOM", "FIRE"] select 0 params ["","","","_building"];
if (!isNil {_building} && _building isKindOf "House") then {
_wallScore = _wallScore + 1;
}
} foreach _directionsToCheck;
if (_wallScore > 7) exitWith {_building}; // found at least 4 walls nearby
objNull
Lots of animated pepe emojis 😄
Also slack is old people discord
50m height check for ceiling?
Arent the intersect commands dependent on distance for performance, or does it not matter much since it will return the object once it detects it?
its abig house
If its for use in vanilla, there aren't actually that many building models, so you could check them manually
saving fps
like Altis i think has only 6 base models
One of the a2 industrial buildings maybe? But I'm not sure i would want to consider a unit "inside" a building based on being 40metres under an industrial pipe
I would start with the other direction, the floor
As a copy and paste noob, I take what works. And that approach worked for me. But improvement proposals very welcome. Floor checks give me false positives on dock structures and alike.
But I could surely reduce the 50 m to 20 m
Hm buildings have a boundingbox ("bbr;"), you could maybe try to check if the position is inside this building
I've recently got into arma 3 scripting and I am facing an issue. How do I pass an argument to a function? Might sound like a stupid question but I don't understand what to do by looking at the wiki.
tgtCounter = {
params["_tgt"];
_tgtHits=0;
_animStatus= _tgt animationPhase "Terc";
if (_animStatus==0) then {
_tgtHits=_tgtHits+1;
};
hint format ["Line 1.1 Hits: %1",_tgtHits]; //just for debugging
};
tgt11 addEventHandler["hitPart",{[]spawn tgtCounter}]; <-- right here what am I supposed to do?
Also to check if its a real building, how about a raycast fron the player upwards to detect a roof?
@languid oyster i mean floor first in order to stop a 50m check when they arent in a building
[Myparam1,myparam2] call irn_fnc_someFunction;
Ah, ok.
_ship = [
"Land_Destroyer_01_hull_01_F",
"Land_Destroyer_01_hull_02_F",
"Land_Destroyer_01_hull_03_F",
"Land_Destroyer_01_hull_04_F",
"Land_Destroyer_01_interior_01_F",
"Land_Destroyer_01_interior_02_F",
"Land_Destroyer_01_interior_03_F"
];
{
_capS = ShipCap;
{setVectorUp 0,0,-1} forEach _capS;
} forEach _ship;```
apparently im missing a ; here
cant tell where :/
this is just simply trying to turn a ship (with variableName ShipCap) upside down
https://community.bistudio.com/wiki/setVectorUp
missing argument
but you cannot forEach over a single thing? forEach iterates over arrays of things
The problem is, the ship is made of multiple parts. Im not sure if im selecting them right
Ive just realised this method probably wont work. Where's Lou when you need him 🤣
You have to find the ship parts in the area
using nearestObjects
ive only ever used nearObjects, this one should be fun 😄
I'm saying nearestObjects because it supports multiple types
@true frigate your missing _x inside foreach
{_x setVectorUp 0,0,-1} forEach _capS;
In the outer for each also

meowsweats?
good
doesn't the pos update function or whatever apply it properly to every other part?
But i dont know what you mean by in the outer foreach?
(after you setVectorUp the center ship obj)
"Land_Destroyer_01_hull_01_F",
"Land_Destroyer_01_hull_02_F",
"Land_Destroyer_01_hull_03_F",
"Land_Destroyer_01_hull_04_F",
"Land_Destroyer_01_interior_01_F",
"Land_Destroyer_01_interior_02_F",
"Land_Destroyer_01_interior_03_F"
];
{
_cap = ShipCap;
{_x setVectorUp 0,0,-1} forEach _cap;
} forEach _ship;```

This is what ive gotten now. added one _x but i dont know what you mean by the outer
yes, and what is with forEach _ship? This is the outer forEach
you got two nested forEach
_x setVectorUp [0,0,-1] @languid oyster @true frigate
everything in the stated list above. I thought it would look at those, and only make changes to parts that had both those object names AND were parts of the ShipCap Variable Object
Oh no. See? Leo is better than me.
WAAH
oh
@true frigate as I told you just use nearestObjects
_ship = [
"Land_Destroyer_01_hull_01_F",
"Land_Destroyer_01_hull_02_F",
"Land_Destroyer_01_hull_03_F",
"Land_Destroyer_01_hull_04_F",
"Land_Destroyer_01_interior_01_F",
"Land_Destroyer_01_interior_02_F",
"Land_Destroyer_01_interior_03_F"
];
_shipParts = nearestObjects [ShipCap, _ship, 300];
{
_x setVectorUp [0,0,-1];
} forEach _shipParts;
oh no...
how come?
you're turning every part around his own axis. not around the "boats axis" which does not exist because of the multiple parts
i see. that might cause some issues
well, if it does, at least we all get a good laugh 😄
at both my stupidity, and the boat being completely f*cked
Well the water is a tad shallow and there are a few parts i missed but IT WORKS
\o/
Lou, stupid question
I was the guy with the radio script the other day
I’m stuck with localisation
If I put it in init, the script runs for every player, so the radio plays multiple times.
If I put it in initserver, nothing happens, same result as using the server debug option.
Where do I put code if I just want the server to run it? On the object?
then put it in initPlayerLocal
I think I’ve tested that, same result as in init
(not sure what your script is at all
)
I’m using playsound3d, which has a global effect
So I have a couple of case statements, and then playsound3D
playSound3D is bad
don't use it
not JIP compatible
global
can't stop

consider using say3D instead
Why can I use Playsound3D with dog3.wss but not Say3D?
playSound3D ["A3\Sounds_F\ambient\animals\dog3.wss", _dog, false, getPosASL _dog, 15, 0.5, 100];
_dog Say3D "dog3.wss";
//or
_dog Say3D "A3\Sounds_F\ambient\animals\dog3.wss";
https://community.bistudio.com/wiki/say3D
Sound is defined in "CfgSounds" of the Description.ext or main config.
Why in the hell was this working and now its saying 0 elements provided, 3 expected
because you removed ShipCaps or whatever it was
is there any way to get around this? Using it in a zeus script for a server I play on and cant change CfgSounds
why not?
Doesnt that require access to desc.ext
just add it to description.ext for your mission
Premade templates for like 20 maps. I cant really ask admins to do that just for a script ill run not very often 😄
Then make a mod 
Fair 😄
Has anyone used setObjectScale on something like UserTexture10m_F with a custom texture applied? Does the image scale with nearest neighbor, bilinear, some other form?
I would say stretch, the Arma way\® 😄
Now add vulkan and tell me what it does
no u
Can someone point me to the malaria faces introduced by oldman... [_unit,"PersianHead_A3_01"]remoteExec["setFace",0,true];
Does attachTo not work on the large static ships?
large objects have multiple parts ("sub objects")
@plush oriole #arma3_scripting message
ah so the editor placed one is just an attachment point to spawn the rest of them?
sort of
does 'setvectorup' here represent whatever transformation you want to do to the ship
yeah
it's just what someone else wanted to do
namely capsize the ship
the important part is how to get the ship parts
also this is only for USS Destroyer
I retooled my script to use say 3d
happy with the case to pick the song
now I'm getting a "error generic error in expression" on lines that are "sleep x amount;"
script runs in local debug
but complains
doesnt run at all in init
suspension is not allowed in unscheduled environment
doesnt run at all in init
you shouldn't use init
initplayerlocal?
maybe
if you want your sound file to be in sync with the rest of players it requires more work
I'm not sure I can be arsed
the amount of man hours I've sunk into this is insane lol
can the array returned by https://community.bistudio.com/wiki/fullCrew be modified? I only needs units, not the other stuff. So I would only need a single array. Or is there a more efficient way to return the cargo units ?
both is possible. but the crew command might do what you want
it does not, according to the wiki crew can't be narrowed down to cargo only.
so a driver or gunner is crew too
yup, just tested it, it will return a single array of all vehicle occupants
how can i assign waypoints to a UAV?
since i cant get a pilot -> group -> add waypoint?
ah wait it does return a pilot using currentPilot. nvm
but ideally you should use effectiveCommander (doesn't matter for UAVs)
why is that?
because the driver takes orders from the effectiveCommander
aha okay
since we re at it, how do i tell the drone to fire a missile at something?
okay ill test it out. never sure in arma if theres maybe a better, hidden command
The better way is to force the drone to fire and then make the missile do the targeting 😛
how would i do that? fired EH + setMissileTarget?
- setShotParent
but only if fireAtTarget doesn't work for you
yeah the drone doesnt lock the target for the hellfire. it just fired straight ahead
_cargo = (fullCrew [_vehicle, "cargo", false]) apply {_x select 0};
a simple doTarget and doFire should work tho
will try that tomorrow, thanks!
will try thx
okay this is dumb and unnecessarily complicated. ill just cheese it.
spawn in a missile 10m below aircraft, point towards player, set missiletarget pos-
hell i cant get the missile to fly where i want it to. tried different types of missiles, no success. using "Missile_AGM_02_F" atm
not even the example code of the biki works LMAO
https://community.bistudio.com/wiki/setMissileTargetPos
is it possible to pass nil as a value to a command to get the default parameters, eg:
"MIS_fnc_restrictAreaFSM_warningLayer" cutText [
format ["WARNING! ENTERING RESTRICTED AREA!<br/>test"],
"PLAIN",
nil,
nil,
true
];
``` i only want the structured text parameter. I tested it and it works but who knows, maybe this is an exception or the engine is suffering silently
okay, i suspect that the problem was that all missiles wanted a laser target to target.
i stole this some time ago from here, this helped me:
https://github.com/IR0NSIGHT/ARMA-dump/blob/unlicensed/laserToMissile.sqf
i just created my own laser target and used that.
I should be using kb tell over say3d shouldn't I
Depends what you want to do 
Does sleep suspend all scripts or just the one it was called in?
Why would it suspend other scripts? 
I don't know but it feels like that's what's happening to me. Must be the fade effect thing then?
It depends how you code is set up
Sleep only suspends the script at the position you put it
blkh_1 engineon true;
rec = [] spawn MypathA;
blkh_2 engineon true;
rec = [] spawn MypathB;
blkh_3 engineon true;
rec = [] spawn MypathC;
blkh_4 engineon true;
rec = [] spawn MypathD;
sleep 10;
[0] spawn BIS_fnc_fadeEffect;
sleep 20;
skiptime 2;
[1] spawn BIS_fnc_fadeEffect;
titletext ["<t size='3.0'>2 Hours Later</t>","PLAIN",-1,false,true];
I've got this running and when the fade effect starts the unitplay stops too.
what's the problem again?
The unitplay stops moving when the fade starts
what unit play?
blkh_1 engineon true;
rec = [] spawn MypathA;
blkh_2 engineon true;
rec = [] spawn MypathB;
blkh_3 engineon true;
rec = [] spawn MypathC;
blkh_4 engineon true;
rec = [] spawn MypathD;
The unitplay called by that part.
You probably have way too many spawns
@cerulean cloak are you sure that code is scheduled?
No, what does that mean?
I mean did you spawn or execVM it?
execVM
wasn't that what you did?
- start unit play
- wait 10 seconds
- fade
Is there a way to disable the automatic falling pose when the player is at a certain altitude?
I don't think so 
Yeah, intent is
-Start unitplays
-Wait 10s
-Fade out
-Wait 20s
-Skip 2 hours
-Fade in
-Text
@cerulean cloak those "paths" are for separate vehicles?
Yes
@cerulean cloak I'm not sure if I fully understand the problem. Can you show a video or something?
Hop in a voice channel and I'll screenshare
Can you see my screen ok? @little raptor
@cerulean cloak ok got it
So you expect the helicopters to be fully started and in the air?
yeah, but I think I might just have been impatient.
So this is a single player scenario?
20s feels a lot longer just staring at black.
@cerulean cloak also, about your unit plays
did you record them from the landing pad?
Yeah
Oh?
I recommend you try of these:
- Either use time acceleration during the fade out
- Record the unit play from the fade in part
where you expect the helis to be
I personally recommend the 2nd one
to put the helis in the air use this command : setVehiclePosition
set position mode to "FLY"
Ok, it seems to be fine after all. 20s of a delay just wasn't long enough for the helis to get away from the airbase.
Sorry for all that.
do the CBA event handlers use the same params as the BIS ones for the code block?
but if it's a single player scenario, would you rather players stare at a black screen for 20s?
or just a couple of seconds of black screen
and then immediately unitplay?
It's multiplayer so the guys will have people to talk to.
ok
Plus I don't really want to re-do the untiplay recordings.
you can "crop" them 
You can?
unitplay data is just an array
you only select the part you want
and you get a cropped output
wdym?
which event handlers?
if you're referring to stuff like "Fire" and stuff, yes
they're just vanilla event handlers 
like for CBA_fnc_addClassEventHandler... if say I use "dammage", will it still pull in, params ["_unit", "_selection", "_damage", "_hitIndex", "_hitPoint", "_shooter", "_projectile"]; to use?
How do I crop the unit play arrays? I tried deleting everything before a certain frame time but that lead to them being outside the map phasing through hills.
yes
how did you remove them?
I opened the file, looked for the first frame time greater than 75 and deleted all before it.
and which one did you determine to be the time?
(i mean which element?)
The one on it's own as just a number that had a [ after it.
I hope you mean the first element 
[0.0499954,[12093,17887.5,342.037],[-0.777783,0.628533,-0.000265738],[-0.000206135,0.000167708,1],[-1.29157e-005,-1.83402e-005,-3.16445e-005]]
In that case it'd be the 0.0499954
So subrtract ~75 from each of the first elements?
yeah
How on Earth do I do that?
apply
Actually, subtract them from the time at the 1st element
(Or recording start time if you know how to get it)
{
_x set [0, ((_x select 0)-k)];
} foreach in pathA;
``` Will that do if k is the number I deleted up to?
@little raptor @cerulean cloak just curious but if you wanted to crop the playtime couldnt you record yourself with unitcap as you play the mission with unitplay? and start/stop as you need
?
Ive tried deleting stuff before, I had no luck, but I did with recording during a playing mission
Im trying "Larrows" method for smoke trails, I cant seem to adjust the RGB values the way I want... any help appreciated
_emitter setParticleParams [
["\A3\data_f\ParticleEffects\Universal\Universal_02",8,0,40,1],"","billboard",1,_particleLifeTime,[0,0,0],[0,0,2*_particleSpeed],0,0.05,0.04*_particleLifting,0.05*_windEffect,[1 _particleSize + 1,1.8 * _particleSize + 15],
[[0.7_colorRed,0.7*_colorGreen,0.7*_colorBlue,0.7*_colorAlpha],[0.7*_colorRed,0.7*_colorGreen,0.7*_colorBlue,0.6*_colorAlpha],[0.7*_colorRed,0.7*_colorGreen,0.7*_colorBlue,0.45*_colorAlpha],
[0.84*_colorRed,0.84*_colorGreen,0.84*_colorBlue,0.28*_colorAlpha],[0.84*_colorRed,0.84*_colorGreen,0.84*_colorBlue,0.16*_colorAlpha],[0.84*_colorRed,0.84*_colorGreen,0.84*_colorBlue,0.09*_colorAlpha],
[0.84*_colorRed,0.84*_colorGreen,0.84*_colorBlue,0.06*_colorAlpha],[1*_colorRed,1*_colorGreen,1*_colorBlue,0.02*_colorAlpha],[1*_colorRed,1*_colorGreen,1*_colorBlue,0*_colorAlpha]],
[1,0.55,0.35], 0.1, 0.08*_expansion, "", "", ""];
anyone make sense of this? there is the more in txt, seems like too many RGB options
Hey y'all, I have a question for you. Hopefully it can be resolved quick. Basically I'm using the https://steamcommunity.com/sharedfiles/filedetails/?id=909790601
Radiation script to add sounds and damage to radiation to objects in my missions.
The author mentions it's dedicated tested. However I've gotten it to work on single player, locally hosted eden, but not dedicated. I've moved the .PBO with all the scripts inside the dedicated and it doesn't work. The issue is after I pick a role it gets stuck on an infinite loading screen. Anyone have any ideas??
Im new but export to MP?
I've had some ideas maybe the .ogg sounds can't be transfered over server? Yes I've exported it through MP
lol sry
let me download and look through the script
so gonna need more information to what you did/didn't do. send me your pbo?
yes of course
_list = position player nearObjects ["Item_Laptop_Unfolded", 50];
How do I update this list continuously?
Maybe its more performant to check for nearby Players to the laptop instead of nearby laptops foreach players
Ideally I only want it to update for a player driving a specific vehicle but I'm in the proof of concept phase and just trying to get it to work.
Well you can just use that vehicle as the center to check around
And add a condition that the driver needs to be a player
hm. as you all know, it is possible to fade in / out black screens. is it possible to fade between different colors? like, my whole screen is black, and i want that black to fade into white
Good idea. I changed the position to the variable I named the vehicle and made an eventhandler to call my list script after engine on.
I'm still at a loss on how to get the loop to work
🙂
Hello! Is there any script to hide the grass without sacrificing terrain grid detail?
@signal kite There are Grass Cutter objects you can place. Other than that, nope
if I want to get rid of the grass in an AO - say a circle with 2 km radius - would it be feasible to plaster it with Grass Cutter objects?
because it's such a pain in the ass if you try to shoot while prone
oh, and by the way thanks for 3den enhanced!
Does anyone know what's the command to set the maximum capacity of a vehicle? Trying to get the vics to do more frequent resupplies. Tried setVehicleAmmo but it goes back to default ammo load when they rearm.
Mod.
Create your own RscTitle
Fade in and out to any color you want
Hey there, I am in the editor at the moment and have an air invasion in the background. As i'm doing cinematic screenshots I would like the gun to point in more or less high angle to its top right. I tried searching key words for it on the server but sadly found no script. I hope one of you would be so kind and help me out with a possible script!🙂
I tried the setvectordir command, but that didnt change anything sadly. https://imgur.com/KFN2Jg5
You can always hope in , turn the gun and use the splendid camera to take a screenshot
I am not sure turrets of vehicles can be moved. At least it didn't work when I tried it a few month ago
Or have an AI do it 
@signal kite could always just load a view distance mod that turns the terrain quality down enough to just completely get rid of grass.
hide the grass without sacrificing terrain grid detail?
setTerrainGrid 50

We need a removeGrass <area>, dedmen 😄
@cosmic lichen The problem would be, that the planes would star moving across the sky which wouldnt give me enough time to turn all 4 Flaks and I cant add the firing effects and tracers in there I think? I always just used quick camera instead of splendid.
just disable simulation for the poor plane
Or have an AI do it
Hm, I guess. I just like finetuning everything🥲
Just give the AI a fake target
You can make it as "fine tuned" as you want
Oh? I didnt know about fake targets, i'll look into that. Thank you!
assuming these two test scripts accomplish the same thing, what method or rational would dictate which to use in a given situation,
[]spawn {
waitUntil {sleep 1; if !(player getVariable ["var_value", 0]== 0) then {true} else {systemChat "var is zero"; False}};
systemChat "var is no longer zero"
}
[]spawn {
while {sleep 1; (player getVariable ["var_value", 0]== 0)} do {
systemChat "var is zero"
};
systemChat "var is no longer zero";
}
Looping waitUntil vs while?
for loops that use sleep, there's very little difference
while is a more general loop, you can do many things with it. It doesn't have any suspension by default, so if you use it without sleep it may run many times in a single frame
waitUntil is this:
//same as waitUntil {blabla; condition}
while {blabla; !condition} do {
uiSleep 0.001;
}
waitUntil has a one frame uiSleep built in
So a sleepy while/do is basically a waitUntil? Which means there is effectively no difference between the scripts above in terms of performance or execution?
Would you select while/do in this case?
Where would you definitely not use a while/do?
When and why would the waitUntil solution be a better choice?
waitUntil could be a bit faster (internally). But I'm not sure. Dedmen knows better 
Would you select while/do in this case?
If what I do can be done by waitUntil, no.
Where would you definitely not use a while/do?
A loop without sleep (but with time dependence)
waitUntil {isNull findDisplay 46};
```
a while executes its condition and action code. A waitUntil only executes a condition. so the waitUntil is more efficient, but both should have a sleep
I'd have to check but I think I only have one script that uses while continuously. It's the part of base-builder that allows picking objects up and moving them. Of course suspension in the script would cause the object to drop until the script resumed. By nature it's a limited time event, while the player is holding the object.
each frame might be better then
You're almost certainly right. I think that was the first thing I tried when I wrote the script but couldn't make it work. It may be time to revisit that module.
So for this specific example, the rest of the script executes when the while/do completes. After I begin the onEachframe statement, I'll still need a waitUntil to suspend the rest of the script until player releases the object. Something like,
onEachFrame { do_hold_object_script };
waitUntil {sleep 0.5; !(_caller getVariable ["hold_object", false])};
onEachFrame {}
finish script
Does that sound about right?
why not check inside the onEachFrame if the player isn't holding anymore?
and don't use onEachFrame, use addMissionEventhandler and removeMissionEventhandler
@still forum,
why not check inside the onEachFrame if the player isn't holding anymore?
Because apparently I'm going to use addMissionEventHandler
😋
@hot kernel better to use the stackable "eachframe" eh
onEachFrame { do_hold_object_script };
onEachFrame do_hold_object_script
I don't understand why thats an answer to my question?
onEachFrame {
if !(player getVariable ["hold_object", false]) exitWith {onEachFrame {}};
//...
};
//stackable:
addMissionEventhandler ["EachFrame", {
if !(player getVariable ["hold_object", false]) exitWith {removeMissionEventhandler ["EachFrame", _thisEventHandler]};
//...
}];
@little raptor, thanks, that makes sense!
@still forum, is this what you mean?
hold_object_script= {
if (_caller getVariable ["hold_object", false]) then {
hold_object statements
}else{
release_object statements
}
};
onEachFrame hold_object_script;
why not check inside the onEachFrame if the player isn't holding anymore?
he means what I wrote
Like this then?
addMissionEventhandler ["EachFrame", {
if !(player getVariable ["hold_object", false]) exitWith {
removeMissionEventhandler ["EachFrame", _thisEventHandler];
//release_object statements
};
//hold_object statements
}];
kinda
you could execute the release statements wherever you set player setVariable ["hold_object", false]
but I suppose it wouldn't make that much of a difference
at least not in this case
I'll try it out. Thanks for your help guys!
The players can deactivate tjeir grass details in visual settings
Is there any way to add more pylons to the black wasp or extra magazines. I don't addWeaponTurret, addMagazineTurret to work with pylon weapons. Also setPylonLoadout is limited to the the number of available pylons on the black wasp.
You need to modify to configs at least, and perhaps even the models, to be able to add pylons.
Can't be done with only some scripts
Hola fellow ArmA friends, just a query. I'm trying to make a nice shooting range, I'd like to be able to score people based on their accuracy but that's just too much work. What I've got right now however is an 800m long rifle range. I've got lines of targets every 50 metres, and I'm going to have the option to pop up targets at different distances so they aren't all up at once. Any tips on how to have them spawn folded down? Do I just do this setDamage 0.1; or something?
You can manipulate the targets with
target_1 animateSource ["Terc", 0]; //0 = up, 1 = down
❤️ Many thanks, I can just slap this in the init of each target by the looks of this, right?
if you do it in init then sqf if (local this) then {code above};
You could also use initServer.sqf
{
_x animateSource...
} foreach [target1, target2 ..];```
Awesome, I'm trying to use part of Feurex's tutorial (https://www.youtube.com/watch?v=ehIzXg2Ttqw) to control my range. I'd like the rangemaster to be able to control the range, so it starts off with all targets folded down, and then via a script, he can choose to reset specific areas of targets.
You can do that via addAction, or radio trigger
Yeah he uses a laptop to execute the 'reset' script, which resets all targets within an area. I'm just trying to make it more functional. Once I get that sorted, I intend to have it playSound3D upon selection.
Why does this work: playSound3d [getMissionPath "vScripts\vWeather\sandStormWall.ogg", player];
When this doesn't: playSound [getMissionPath "vScripts\vWeather\sandStormWall.ogg", player];
yeah but playSound3D used to take classname only too... it got expanded in version 2.02 right?
If so, shouldn't playSound get the same love too?
no
and no 😄
Allright, my bad, nevermind what I said
you're confusing it with say3D
klaxon1 playsound3d ["a3\missions_f_beta\data\sounds\firing_drills\drill_finish.wss"];
Am i using this correctly? Called via. sqf on addaction to make a speaker play the drill sound at the start of a firing range
Doesnt seem to be working 😦
just read the command description
https://community.bistudio.com/wiki/playSound3D
playsound3d ["a3\missions_f_beta\data\sounds\firing_drills\drill_finish.wss", klaxon1];
got it, thanks @little raptor my bad!
how to black list numbers in random? I need to make sure that he does not chose a specific number
_n = str (floor random [30, 58, 87]); //it should not chose 55 and 67
well, my function was unscheduled
while doesn't need scheduling
it can run unscheduled for a little time if I remember
10000 cycles top
I need some help with this idea of mine:
Convoy is grouped together (about 5 or 6 vehicles)
Along the way, I want to degroup certain units and have them drive to different waypoints, then turn off their engines at the final waypoint
No re-grouping required
If anyone can help, that'd be great!
If this can be done with trigger or anything, that's fine too
I can spawn a VLS cruise missile, and have it fly in the direction I need... but can't get it to actually home in on a target, even with setMissileTarget T_T I can't rely on the player having a laser designator, since the mission theme is 'heavy fog, GPS guidance only'. The example script for a targeted missile uses thermal signatures, which don't work for the cruise missile.
I recommend using waypoints (I think you have to use "scripted waypoint" or something if you want to do it in 3den?) . Create the new groups and their waypoints in waypoint completion statements.
To move some units to a new group, create a new group and use joinSilent.
Example:
_grp = createGroup blufor;
[unit1, unit2, ...] joinSilent _grp;
_grp addWaypoint [[1,2,0], -1]; //some position
https://community.bistudio.com/wiki/addWaypoint
https://community.bistudio.com/wiki/setWaypointStatements
https://community.bistudio.com/wiki/joinSilent
https://community.bistudio.com/wiki/createGroup
@little raptor thanks!
Okay, I can spawn in an invisible jtac and have him laser designate a target at point blank range... but I can't get them to use their laser designator T_T
Or just use the related function. Durr.
Create a laser designator object
Those "lasers" you see are actually objects
I don't recall what their class name was but you can find it in the config
I couldn't figure that out... is it not "LaserBeam"?
Not as far as I could tell... and my googlefu just turned up people complaining about spawned laser targets not lasting more than 10 seconds, but no code to do so
@manic sigil or just do this:
give yourself a laser designator and lase something
type this in debug console:
typeOf laserTarget player
meh
that's your only option 
Yeah, that at least got my to get it spawned in, but as expected, it disappears after a few seconds :/
And they're not targetable, I think...
Blah.
I dunno why i'm fixating on this, it's a minor thing in a mission that is more of an exploration bonus than anything.
What's a way to set the rotation of these Military Cargo Platform, using scripting? https://i.imgur.com/Aa72Izx.png
I want to spawn one and have one of the panels go down to 60%
it probably uses animation sources
Ah thanks.
Found in that wiki's category animationNames, so now I even know what to name the panels
afaik, this will always reduce terrain grid resolution (making trees on far away hills "hover" above ground)
You could add a user action for your players to clear grass around you. The action could drop a grass cutter object on ground for let's say half an hour or something to keep their number limited.
Personally I like it that sniper has to pick his spot and when sniping I move around a bit to flatten the grass to make the firing position.
I'm trying to edit the movement speed of a modded Skeleton unit, I use the SetCoefAnimation and it does work for less then a second, then speed goes back to normal. This script is executing in eden editor local exec
@hardy tree _this select 2: NUMBER - Break multiplier - Is used to calculate the display length of every line - Default: 0.1
Just increase that. It automatically calculates the time for each line depending on its length
Probably some mod is resetting the anim speed manually
Hmmm, the skeleton does have custom script that is called when damaged. Could that be it?
if there is a setAnimSpeedCoef usage in it
Not that I saw from before, dont have the file on this device to double check sorry. Will do again
Cause that script being called will happen often due to the nature of the check right?
that solution sounds feasible - thank you. I think the grass is great in PvP, but we are playing PvE and it's just annoying.
https://steamcommunity.com/sharedfiles/filedetails/?id=1889104923 If you want it in mod form. Non-ace version is on the github linked in the desc
anyone able to give me some insight on how to use the setObjectScale command
The object has to not be simulated; this enablesimulation false, or unchecking the simulation button in it's editing.
[] spawn {
while{true} do {
{
private "_a";
_channelToDeleteMarkers0 = 0;
_channelToDeleteMarkers1 = 1;
_channelToDeleteMarkers2 = 2;
_channelToDeleteMarkers3 = 3;
_a = toArray _x;
reverse _a;
_a resize 1;
_number = parseNumber toString _a;
if(_number == _channelToDeleteMarkers0) then {
deleteMarker _x;
};
if(_number == _channelToDeleteMarkers1) then {
deleteMarker _x;
};
if(_number == _channelToDeleteMarkers2) then {
deleteMarker _x;
};
if(_number == _channelToDeleteMarkers3) then {
deleteMarker _x;
};
} forEach allMapMarkers;
};
};```Got this script yesterday from a nice guy in [#arma3_editor](/guild/105462288051380224/channel/115333379133669382/) , adjusted it to delete markers from multiple channels simultaneously - but in a very "crude" way. Anybody could help make it less crude, and also less performance heavy?
Just wanna triple check, there's NO way to hide/make invisible certain parts of a prop, only the whole prop?
private "_a"; Don't do that. Use the private keyword, not the command.
Also why private _A but none of the other variables you have in there?
all the ifs can be replaced by a single in
also if the numbers are hardcoded 0-4 anyway, why even put them into variables?
correct
turn string to array, reverse array, resize array to 1 element (will probably reallocate the array, is expensive), turn it into string and parse number.
Oof.
parseNumber can be done with simple subtraction on the number if it can only be 0-9.
Also all these array shenanigans. Just use select to grab the last character in the string.
also you can reverse a string itself too, no need for toArray even if you want to use the complicated way
No idea, why 'private _a', I'm next to clueless with scripting, was given to me as such.
by in do you mean smth along the lines of this?if("0" in _channelToDeleteMarkers) then {etc..
"Channel ID = Global = 0, Side = 1, Command = 2, Group = 3, Vehicle = 4, Direct = 5, custom = 6-15;"
I want only 0, 1, 2, and 3 removed
then you also don't need the parseNumber stuff
Ah you want to extract the channel from a player placed marker
Yes
We have a command for that.. https://community.bistudio.com/wiki/markerChannel
Maybe should've explained that at first - script is for instantly deleting/removing the possibility to place markers
returns the channel as number
"script is for instantly deleting/removing the possibility to place markers"
We have a eventhandler for MarkerPlaced
the while true loop is nonsense then, use the eventhandler
do you only want to delete specific channels? or player placed markers in general?
Player placed markers only
So keep editor markers, and keep markers from direct and vehicle
why are you even checking the channel number then. All player markers literally say _USER_DEFINED right at the start of the marker name
just checking for that would be alot easier
What is the event handler for that called?
Only thing I find that looks similar is "CuratorMarkerPlaced", but idk if thats it
and not sure what that means
addMissionEventHandler ["MarkerCreated", {
params ["_marker"];
if (_marker select [0, 13] == "_USER_DEFINED") then { deleteMarker _marker; };
}];
your while true loop will also kill scheduler performance. It will run for the max allowed time every frame, a total FPS destroyer
Yeah, was worried about that
Whoever wrote that needs a slap on the back of their head 😄
I couldn't find anything about the 'MarkerCreated' on the bi wiki before when trying to find this myself yesterday
What you just wrote - how does it define which channels to delete markers from?
Is that what [0, 13] is?
I c, would there be an "quick" way to do that - or would I need to put a if/in somewhere inside?
addMissionEventHandler ["MarkerCreated", {
params ["_marker", "_channel"];
if (_marker select [0, 13] == "_USER_DEFINED" && _channel in [0,1,2,3]) then { deleteMarker _marker; };
}];
Figured that was somewhere along that, thank you lots!))
Hi any can resolve my doubt about what is wrong with this line of code
{
deleteVehicle SUCCESS_CODE;
}
i need test 4 variables to delete a object on the map i'm making a secuence scripts for puzzles
_c1, _c2,_c3,_c4 are local variable with boolean and SUCCESS_CODE IS a variable on a object on the missions i get error on the if line when execute the sqf on the mission
"SUCCESS_CODE" allcaps name with underscore seperation is usually indicator for a macro, not for a variable name
if its a variable name it should also have a unique TAG_
well some of your _c variables are probably not a boolean
where do you set these variables
show more of the script
_c1 = true;
_c2 = true;
_c3 = true;
_c4 = true;
while {true} do
{
if( !alive CODE_1 ) then {
_c1 = false;
};
if( !alive CODE_2 ) then {
_c2 = false;
};
if( !alive CODE_3 ) then {
_c3 = false;
};
if( !alive CODE_4 ) then {
_c4 = false;
};
if(_c1 && (!_c2 || !_c3 || !_c4)) then
{
deleteVehicle ERROR_CODE;
} else {
if(_c2 && (!_c3 || !_c4)) then
{
deleteVehicle ERROR_CODE;
} else {
if(_c3 && !_c4) then
{
deleteVehicle ERROR_CODE;
}
}
}
if(!_c1 && !_c2 && !_c3 && !_c4) then
{
deleteVehicle SUCCESS_CODE;
}
}
here is the script
your while loop should have a sleep, even just a sleep 0.1
otherwise it will try to kill your fps and check hundreds of times per frame which is nonsense
ok is good to know that
error missing ;

