#arma3_scripting
1 messages ยท Page 661 of 1
unless player-hosted
solo hosted or what ? ๐
that and player-hosting, so friends can connect! ๐ non-dedicated servers don't get the love they deserve 
else
{
exitWith {};
};
I just noticed ๐
That syntax is new ๐
I like it
if (hasInterface) then
{
while {true} do
{
{_x setdamage (damage _x + 0.1)} apply (units player select {goggles _x != "G_AirPurifyingRespirator_01_F"});
sleep 10;
};
};
Maybe something like this (Fully untested) @tough abyss
Will definitely break something if two players are in the same group
Might make sense to just let it run in one loop on the server for allUnits
Hi Ive been using the ORBAT creator to make a custom faction with Iron Front assets, and when I am doing anything with the tanks I dont even get an option for the commander or loader slot, so when I am finished and try to spawn them in they default their commanders and loaders to ones from Iron front.
Is there anyway I can go into the file and edit it so the commanders I made go in there instead?
its compiled to Assembly, which is then interpreted
Result:
0.0009 ms
Code:
_a=1
Result:
0.0009 ms
Code:
_aadasdasdasdasdasdasasdasdasdas=1
Very very little. ๐
yes
yes there is
okie
well you can until you run out of memory and crash..
@cosmic lichen would this sqf while {true} do { { if (goggles _x != "G_AirPurifyingRespirator_02_black_F") then { _x setdamage (damage _x + 0.1); }; } forEach AllUnits; sleep 10; };
damage all units
excuse my ignorance @cosmic lichen , but how do i use your export function exactly? ๐
https://community.bistudio.com/wiki/Arma_3:_Respawn#Loadouts_and_Roles
@tough abyss This will also dmg folks inside of vehicles
thats fine
how do i do that
if (isServer) then {
i can cobble together script ok ask me to make it multiplayer compatibal and i aint got a clue
Feed it a unit and execute it
if (isServer) then
{
while {true} do {
{
if (goggles _x != "G_AirPurifyingRespirator_02_black_F") then {
_x setdamage (damage _x + 0.1);
};
} forEach AllUnits;
sleep 10;
};
};
was just about to right that thanks @cosmic lichen
I said "virtually" didn't I?! ๐
class respawnClass
{
displayName = "BadAss Guy";
icon = "Idont know any path";
role = "SpecialOperative";
show = "true";
uniformClass = "U_B_CombatUniform_mcam_vest";
backpack = "";
weapons[] = {"arifle_MX_GL_Hamr_pointer_F","hgun_P07_F","Binocular","Throw","Put"};
magazines[] = {"30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","Chemlight_green","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag_Tracer","30Rnd_65x39_caseless_mag_Tracer","16Rnd_9x21_Mag","16Rnd_9x21_Mag","MiniGrenade","MiniGrenade","1Rnd_HE_Grenade_shell","1Rnd_HE_Grenade_shell","1Rnd_HE_Grenade_shell","1Rnd_HE_Grenade_shell","1Rnd_HE_Grenade_shell","SmokeShell","SmokeShellGreen","SmokeShellBlue","SmokeShellOrange","Chemlight_green","1Rnd_Smoke_Grenade_shell","1Rnd_Smoke_Grenade_shell","1Rnd_SmokeBlue_Grenade_shell","1Rnd_SmokeGreen_Grenade_shell","1Rnd_SmokeOrange_Grenade_shell"};
items[] = {"FirstAidKit"};
linkedItems[] = {"V_PlateCarrierGL_rgr","H_HelmetSpecB","G_Tactical_Clear","ItemMap","ItemCompass","ItemWatch","ItemRadio","ItemGPS","NVGoggles","","acc_pointer_IR","optic_Hamr","","","","",""};
};
// Visit https://community.bistudio.com/wiki/Arma_3_Respawn for detailed information```
@deft dock
```sqf
[get3DENSelected "Object" # 0, "respawnClass", "BadAss Guy" ,"Idont know any path", "SpecialOperative"] execVM "exportRespawnInv.sqf";
are you sure?! ๐
then why do you run out of memory (heap) faster than stack size?!
I think it always works in the other way around (at least in my experience)
Thanks!
Real Virtualtiy
I don't know what you mean ๐
if you mean "internally" (creating objects and stuff), well yeah
but at the end it is interpreted
Arma stack is really big.
Also unscheduled vs scheduled is a difference 
hmmm huston we has a problem my frames have tanked now going to try altering my hazard script
so if i tried running it from the server it wouldnt work
if (isServer) then
{
{
_x addgoggles "G_AirPurifyingRespirator_02_black_F";
} forEach units east;
call {
{
{
_x cutRsc ["RscCBRN_APR_02", "PLAIN", -1, false];};
} forEach allUnits;
};
};```
explains why the overlays not working anymore
correct, also because cutRsc does not take an object ๐
you would only need it to be running once
because cutRsc goes over the current camera, that's it
how can i reach the 3CB BAF apache flare launcher? its name should be UK3CB_BAF_CMFlareLauncher. for other vehicles it works with: [vehicle player, "CMFlareLauncher"] call BIS_fnc_fire;
but that is weird, it should throw an error
it dosnt even throw an erro in mp it just odsnt work
hold up im gunna rip this bit out and run it local se if it works
there is also a stray {
it threw the error before the stray
ok how would i get
{"YourLayerName" cutRsc ["RscCBRN_APR_02", "PLAIN", -1, false];};```
i cant just use player
or would that work```sqf
{"player" cutRsc ["RscCBRN_APR_02", "PLAIN", -1, false];};
idk thats what the video say

Typically you have to look through its mags and check their configs. I think type = 256 means flare
thx.i am not quite good at scripting. do i have to use somthing else as a class name? or maybe the ammo name?
get "cfgWeapons" >> "weapon" >> "magazines"
now get "cfgMagazines" >> "mag" >> "type" for each of them
if at least one of them is 256 the weapon is a flare
if (isServer) then
{
{
_x addgoggles "G_AirPurifyingRespirator_02_black_F";
} forEach units east;
{
["RscCBRN_Overlay", ["RscCBRN_APR_02", "PLAIN", -1, false]] remoteExec ["cutRsc", _x];
} forEach allPlayers;
};
@tough abyss Not tested but might work
@sacred slate something like this:
_mags = magazinesAllTurrets _veh;
_cfgMags = configFile >> "cfgMagazines";
_hasFlare = -1 != _mags findIf {
getNumber(_cfgMags >> _x#0 >> "type") == 256
};
I copy pasted it from my mod
it's not exactly what you should use
but close
(the main difference is getting all vehicle weapons and checking their supported mags)
@cosmic lichen it works thank setting up for multiplay is the part i struggle with the most
ok i think i set this one up right for a server
if (is server) then
{
if !(allPlayers in list shelter1 || allPlayers in list shelter2) then
{
{_x setdamage (damage _x + 1);
} forEach unit allPlayers;
};
};```
and this is the one other script i need help with to make mp compatiblesqf while {alive player} do { sleep (selectRandom [600,900,1200,1320,1980,300, 450]); b1 sideChat "ALL forces be advised, emission detected! Seek shelter immediately!"; sleep 1; [1] spawn BIS_fnc_earthquake; sleep 30; b1 sideChat "Emission will hit in thirty seconds!"; sleep 1; [2] spawn BIS_fnc_earthquake; sleep 15; b1 sideChat "Emission in fifteen seconds!"; sleep 1; [3] spawn BIS_fnc_earthquake; sleep 10; b1 sideChat "FIVE SECONDS! GOD HELP YOU IF YOU ARNT INSIDE YET!"; sleep 1; [4] spawn BIS_fnc_earthquake; b1 sideChat " EMISSION INCOMING"; sleep 3; [4] spawn BIS_fnc_earthquake; shelter = execVM "shelter.sqf" sleep 10; b1 sideChat "The emission has passed";
or is this ok as is
since SideChat and earthquake are both local only
The first script is completly wrong
if (isServer) then {
allPlayers select {!(_x in list shelter1) && {!(_x in list shelter2)}} apply {
_x setdamage (damage _x + 1)
};
};
although can't you just set the trigger to server only
idk how you are activating it
your second script confuses me, while {alive player} do seems wrong, do you want multiple earthquakes to occur?
and you want the random timing coming from the server or else you will get locally timed earthquakes
@slim oyster in order
- im not sure?
- the first script is activated by the second one its the shelter.sqf
3)yes i want multiple earthquakes that ramp up in speed and intensity to mimic as best i can the blowout events of the stalker games - from what im learning yes i will want the random time to come from the server as all players are supposed to feel it at same time
_x setdamage (damage _x + 1)
```
@winter rose hey hey dont look at me youtube gave me that
@winter rose oh yeah that was me mostly going if it aint broke dont fix it to the script
when i copy pasted that section from my hazards script
oh well i still got the radiation and gasmask scripts working for mp so huzzah
uh I assume he wanted _x setdamage (damage _x + 0.1) instead
or yes, setdamage 1
setdammmmage 1
you forgot one m
@slim oyster nah ya see i used this for my hazards scrip and went if it aint brok why fix and change it from 0.1 to 1 for this script
any way its moot now im scraping the emission scripts

i have deadly radiation that effect any opfor unit even ai stupid enough to take off their masks now
Anyone who knows how to ad the turret from the "B_Heli_Attack_01_F" on to the "B_Heli_Transport_01_F"?
it is part of the model, I believe.
is the transport 1 f the ghost hawk if so you could script the miniguns to fire the ammo from the attack heli
or take an orca you can fit it with 20mm auto cannon from the AAF jet
I was thinking about giving the command seat in the the ghost hawk a minigun too with the camera functions of the balackfoot.
That will be very overpowered..
just change the weapons on the kajman
be easier than scripting a whole turret onto a ghost hawk
Ok, so scripting a whole turret onto a ghost hawk is possible, its just hard.
anythings possible if you just use your.....
I have been looking into the animations to do it without success yet.
id assume that to script a different gun it needs to have a gun in the first place
i mean ive sen kajmans with the turret gun scripted to 7.62
I know how to do that.
and to fire mortar flare rounds instead of rockets
What I want to do is script a turret on to another vehicle.
yeah idk like i said i think it might be imposible to add a turret to a different vehicle if it dosn't have a turret to begin with
still best of luck in your endeavors
Can anybody give me a hint what is wrong with this piece of my script ? I get a "generic error" message when I try to run it :
_var1 = [getMarkerPos "enemy_infantry1", side east, (configfile >> "CfgGroups" >> "East" >> "CUP_O_RU" >> "Infantry_EMR" >> "CUP_O_RU_InfSquad_EMR")] call BIS_fnc_spawnGroup;
_var1 = [getMarkerPos "enemy_infantry1", side east, (configfile >> "CfgGroups" >> "East" >> "CUP_O_RU" >> "Infantry_EMR" >> "CUP_O_RU_InfSquad_EMR")] call BIS_fnc_spawnGroup;
// a.k.a
private _pos = getMarkerPos "enemy_infantry1";
private _class = configfile >> "CfgGroups" >> "East" >> "CUP_O_RU" >> "Infantry_EMR" >> "CUP_O_RU_InfSquad_EMR";
private _side = east; // not side east
private _var1 = [_pos, _side, _class] call BIS_fnc_spawnGroup;
@broken steppe sqf side eastis not valid, east is enough ๐
Thanks a lot !
Thanks ๐
How do does a script that selects allied AI within 50 meters weather they are in your group or not look?
I know this isn't a finished script, but it gives an idea about how far I have come.
_veh = "B_CTRG_Heli_Transport_01_tropic_F"createVehicle (player modelToWorld [8,0,0]);
_veh addAction [
"Force nearby AI to enter", {
player(!=player) assignAsCargo _veh;
}, nil, 0, true, false];
_veh addAction [
"Force nearby AI to exit", {
player(!=player) assignAsCargo _veh;
}, nil, 0, true, false];
player(!=player)
what is this ๐
I think you need to perform a search for AI in a X radius around the players first and actually attach that AI to a _var to be used
ok thank you
Is that a (broken) test to see if the players vehicle ==player? Aka check if player is in a vehicle
perhaps I am misusing it wrong. What I was looking for was a function to select infantry that are not controlled by a player.
You gotta know the AI in the area of the player first.
https://community.bistudio.com/wiki/nearEntities
With that you could do a small search for 3/5 meters around the player and get all the AI near it.
Yeah its very wrong. The syntax is
(Variable1 comparator variable2) and then you can mix that
Like (1 == 2)
Or ("blue" isEqualTo "green")
Or (vehicle player != player)
Since we re at it, is there documentation about sqf compiler/interpreter/reduction?
_veh = "B_CTRG_Heli_Transport_01_tropic_F"createVehicle (player modelToWorld [8,0,0]);
_man = player nearEntities ["Man", 20];
_veh addAction [
"Force nearby AI to enter", {
_man assignAsCargo _veh;
}, nil, 0, true, false];
Got a:
' , |#|_man assignAsCargo _veh;
Error Undefined variable in expression: _man
_men = player nearEntities ["Man", 20]; //returns an array of all entities that match description. => [unit1,unit2,unit3]
also, if you add an action, it is seen as "a separate script" -> it does not have any (local) variables you have declared before, like _men.
instead, put the men declaration code inside the addAction code.
this also makes sense, because the complete code is run (probably) at mission start. thats when your code is looking at units around the player and saving it. the _men variable does NOT auto update. (variables never do, unless specifically told to do so in special cases)
so even if your actions code would know the _men variable, it would have super outdated info in it. instead run the code at the moment the action is called.
@fresh wyvern
next error you will get is "expected object, got array".
you have to assign every unit as cargo individually because assignAsCargo takes 1 (one) unit as input, not multiple.
so a foreach loop will do
Thanks a lot! I will try to make it work ๐
hello, Q: when you invoke ctrlMapAnimAdd you can specify the zoom... is there a way to get the current zoom?
or is this ctrlMapScale that would return that number?
You can use https://community.bistudio.com/wiki/BIS_fnc_zoomOnArea and store the returned zoom value
But I guess you are using a custom map control?
NOpe, since you can't pass a control to the function
You could however check out the code and see how they calculate the zoom in there
anyway from a UI perspective, I'd like to shift the position, but not necessarily change the zoom, or at least maintain the current zoom
Do you know where I go wrong?
_veh = "B_Heli_Transport_01_F"createVehicle (player modelToWorld [8,0,0]);
_veh addAction [
"Force nearby AI to enter", {
_man = player nearEntities ["Man", 20];
{_man assignAsCargo _veh;
[_man] orderGetIn true;}
forEach _man;
}, nil, 0, true, false];
use _x in your forEach loop
_x is the element forEach provides, also _forEachIndex
?
no
{ _x setDamage 1 } forEach _men; // _x = 1 man
Like this?
_veh = "B_Heli_Transport_01_F"createVehicle (player modelToWorld [8,0,0]);
_veh addAction [
"Force nearby AI to enter", {
_man = player nearEntities ["Man", 20];
{_x assignAsCargo _veh;
[_x] orderGetIn true;}
forEach _man;
}, nil, 0, true, false];
yes
for readability sake, rename _man to _men (plural)
you can also do this```sqf
_veh addAction [
"Force nearby AI to enter", {
_men = player nearEntities ["Man", 20];
{
_x assignAsCargo _veh;
} forEach _men;
_men orderGetIn true;
}, nil, 0, true, false];
also I believe using "CAManBase" is better
What is "CAManBase"?
Ah "CAManBase" instead of "Man"
so... @fresh wyvern, open the map editor, drop a "man" anywhere, right click or select, I forget which, there is an option somewhere there to view the config. very informative.
very fitting description of our society
tells you an awful lot about the model, including the class hierarchy
well, technically, aren't we all, depending on family... maybe less so after this mrna v4x, but we'll see
I know about the function, but I am pretty new to this. Trying to learn as fast as I can.
@fresh wyvern yep, no worries. I'm somewhat seasoned at it, but continually learn.
the config lowest line tells you its hirarchy/heritage. so if you know the abrahams tank is derived from "tank" -> "land", selecting all "Land" will also select the abrahams
yes, I think "Land" will select a lot of other things as well
oh that was a good fire fight, i tell you the key to playing with ai is to get a good map that actualy works with the ai
4 v atleast 12 and i didnt lose a man, and i was spetznas so noooo armour
@fresh wyvern hope all this was helpful
It was.
Is still haven't gotten the code to work though.
I get an error on the "_veh" in:
_x assignAsCargo _veh;
_veh = "B_Heli_Transport_01_F"createVehicle (player modelToWorld [8,0,0]);
_veh addAction [
"Force nearby AI to enter", {
_men = player nearEntities ["CAManBase", 20];
{
_x assignAsCargo _veh;
} forEach _men;
_men orderGetIn true;
}, nil, 0, true, false];
_veh also does not exist anymore in the actions code. it has forgotten all variables at that point
but the action provides you with info about who called it and where it is attached to, in the "_this" variable
oh right, true; yes, have to be careful of scopes and of variable life times.
"this moveInCargo (nearestObject [this,""B_Heli_Transport_01_F""])"
Thanks for letting me know.
params ["_target", "_caller", "_actionId", "_arguments"]; // = _this
i remember addactions when i first started scripting. damn they were so complicated and it was awful
agree..
Now I get the error on the
|x|assignAsCargo
_veh = "B_Heli_Transport_01_F"createVehicle (player modelToWorld [8,0,0]);
_veh addAction [
"Force nearby AI to enter", {
_men = player nearEntities ["CAManBase", 20];
{
_x assignAsCargo "_target";
} forEach _men;
_men orderGetIn true;
}, nil, 0, true, false];
Whit this the error is on the
|x|_target
_x assignAsCargo _target;
well you have declare the _target variable first. thats what params ["_target", "_caller", "_actionId", "_arguments"]; // = _this
does. the only variable that is available by default is _this.
and params takes _this and splits it up into pieces and attaches the vallues to the names you gave it (target, caller, etc)
?
_x assignAsCargo _this(_target);
Guys, what was the way to find if a player was damaged by an explosion inside a HandleDamageEH?
no, just add the params line into the add action code at the top
params ["_myVar"] is the same as _myVar = _this select 0; it does the same thing.
Still get the same error.
_veh = "B_Heli_Transport_01_F"createVehicle (player modelToWorld [8,0,0]);
_veh addAction [
"Force nearby AI to enter", { params ["_target", "_caller", "_actionId", "_arguments"];
_men = player nearEntities ["CAManBase", 20];
{
_x assignAsCargo _this;
} forEach _men;
_men orderGetIn true;
}, nil, 0, true, false];
This worked!!!
_veh = "B_Heli_Transport_01_F"createVehicle (player modelToWorld [8,0,0]);
_veh addAction [
"Force nearby AI to enter", { params ["_target", "_caller", "_actionId", "_arguments"];
_men = player nearEntities ["CAManBase", 20];
{
_x assignAsCargo _target;
} forEach _men;
_men orderGetIn true;
}, nil, 0, true, false];
there you go ๐
the correct tactic in such "nested" scripts (actions, eventhandlers, functions)
is to
- declare the available variables at the top with params
- use these variables
Thanks a lot!
if you want to refine your script, you could sort out any units that are not the same faction as the player, so you dont load up on enemies or civs
even better, it privates the variable as well:
params ["_var"];
// ==
private _var = _this select 0;
``` and can also take in array as well as argument:
```sqf
[value] call _fnc;
// same as
value call _fnc;
Guess this will do it?
_veh = "B_Heli_Transport_01_F"createVehicle (player modelToWorld [8,0,0]);
_veh addAction [
"Force nearby AI to enter", { params ["_target", "_caller", "_actionId", "_arguments"];
_men = if (blufor) then {player nearEntities ["CAManBase", 20]};
{
_x assignAsCargo _target;
} forEach _men;
_men orderGetIn true;
}, nil, 0, true, false];
didn't work..
nope, you have to test every single unit again.
also your test is not a test.
(variable comparator variable), what you want is
(side _caller isEqualTo side _unit) and do this for every unit in your _men array
How do I incorporate that?
the easiest way right now is to add the if statement in the foreach loop. that way, you can test every unit before it is loaded.
_veh = "B_Heli_Transport_01_F"createVehicle (player modelToWorld [8,0,0]);
_veh addAction [
"Force nearby AI to enter", { params ["_target", "_caller", "_actionId", "_arguments"];
_men = player nearEntities ["CAManBase", 20];
{
_unit = _x;
if (side _caller isEqualTo side _unit) then
{
_unit assignAsCargo _target;
};
} forEach _men;
_men orderGetIn true;
}, nil, 0, true, false];
Ah, you have to apply code at two places
you could test the unit for being blufor, but maybe you want to play as opfor one day, so comparing player faction to unit faction is more dynamic
ah wait no
sorry i corrected it.
sleep 1080;
_endZoneSize = getMarkerSize "EndZone";
while { true } do
{
sleep 0.05;
_endzoneSize - 1 = _endZoneSize;
setMarkerSize "EndZone" _endZoneSize;
};
how does this code look?
it wants some tabs
my goal is that it decreases the size of an ellipse marker over time
ร h yeah
Thanks a lot!!
sleep 1080;
_endZoneSize = getMarkerSize "EndZone";
while { _endZoneSize >= 30} do
{
sleep 0.05;
_endzoneSize = _endZoneSize - 0.0125;
"EndZone" setMarkerSize [_endZoneSize, _endZoneSize];
};
so basically everything between two code brackets is +1 indetation { }
yeah exactly
ok
so will that code decrease the size of the ellipse by 0.0125 every 0.05 seconds? or am i trippin?
the syntaxes are wrong:
- getMarkerSize returns an array
_endzoneSize - 0.0125 = _endZoneSize;new/updated variables have to be on the left side:_endzoneSize = _endzoneSize - 0.0125;setMarkerSizesyntax:markerName setMarkerSize [a-axis, b-axis]:"EndZone" setMarkerSize [_endZoneSize, _endZoneSize];- that while loop needs an exit condition
oh yeah lol missed that
ok
can i interest you in a good old syntax highlighter:
visual studio code + sqf lint extension
.
@distant oyster this better:
sleep 1080;
_endZoneSize = getMarkerSize "EndZone";
while { _endZoneSize >= 30} do
{
sleep 0.05;
_endZoneX = _endZoneSize select 1;
_endZoneY = _endZoneSize select 2;
_endZoneX = _endZoneX - 0.0125;
_endZoneY = _endZoneY - 0.0125;
"EndZone" setMarkerSize [_endZoneSize select 1, _endZoneSize select 2];
};
point (1) is still not fixed
just use select?
nope, you try to do math on an array at line 6
oh yeah
so you have to split the endzoneSize into x and y before you do the math
yeah
if you use the same length for x and y anyways, you can just select x in line 2 and work with that, use it as x and y in line 7
also, arrays start at index 0, not 1
[imEntry#0, imEntry#1, imEntry#2] etc
im not quite sure what that means
but is this any better?
sleep 1080;
_endZoneSize = getMarkerSize "EndZone";
_endZoneXY = _endZoneSize select 0;
while { _endZoneX + _endZoneY > 30} do
{
sleep 0.05;
_endZoneXY = _endZoneXY - 0.0125;
"EndZone" setMarkerSize [_endZoneXY, _endZoneXY];
};
yeah, now you just have to use the x and y in setMarkerSize ๐
if you want deconstruct, _endZoneSize params ["_endZoneX", "_endZoneY"], with or without type checking
what i meant is this:
sleep 1080;
_endZoneSize = getMarkerSize "EndZone";
_endZoneX = _endZoneSize select 1; //same value as Y
_endZoneY = _endZoneSize select 2; //same value as X
while { _endZoneX >= 30} do
{
sleep 0.05;
_endZoneX = _endZoneX - 0.0125; //same math operation as Y
_endZoneY = _endZoneY - 0.0125; //same math operation as X
"EndZone" setMarkerSize [_endZoneSize select 1, _endZoneSize select 2];
};
//so instead:
sleep 1080;
_endZoneSize = getMarkerSize "EndZone";
private _endZoneX = _endZoneSize select 0; //same value as Y
while {_endZoneX >= 30} do
{
sleep 0.05;
_endZoneX = _endZoneX - 0.0125; //same math operation as Y
"EndZone" setMarkerSize [_endZoneX, _endZoneX]; //pass x into x,y
};
getMarkerSize "EndZone" params ["_endZoneX"];
while {_endZoneX >= 30} do {
sleep 0.05;
_endZoneX = _endZoneX - 0.0125;
"EndZone" setMarkerSize [_endZoneX, _endZoneX];
};
sleep 1080;
_endZoneSize = getMarkerSize "EndZone";
_endZoneXY = _endZoneSize select 0;
while { _endZoneXY > 30} do
{
sleep 0.05;
_endZoneXY = _endZoneXY - 0.0125;
"EndZone" setMarkerSize [_endZoneXY, _endZoneXY];
};
will that ^ work as well?
while { _endZoneX + _endZoneY > 30} do //both variables are not defined.
other than that, yeah.
look at this and the documentations for params, for a more elegant way
Arma does not know what to do with [_x, _y] > _z
no matrix operations to my knowledge anyway
apply ๐ ๐
^^ yep, I am deconstructing more and more using params. very useful technique.
very true. also dedmen told me that private variables are more performant (for whatever reason)
if its a singleplayer mission yes
I would like the code to start running as soon as the mission starts
if its a mp mission, initServer.sqf
for MUTIPLAYER
ok
wait I already have code in the init.sqf file
should I move it to initServer.sqf?
its easier to learn scripting in SP, in multiplayer stuff is more complicated.
well yeah but rn I am working on an mp mission project
yeah. init runs for every player, so 10 players = marker gets resized 10 times as often as intended.
if (!(player in endzonemarker)) then {setDamage 1} ?
i have to admit that i never played a battle royal mode so i dont really know how it works lol
yeah
ok
!true == false
!false == true
_myBoolean = !_myBoolean //button which inverses each press
//ENDZONE DAMAGE
sleep 60;
while { true } do {
waitUntil { sleep 1; alive player };
if !(player inArea "EndZone") then
{
player setDamage (damage player + 0.05);
};
};
that is the code I have for the damage
addDamage doesnt exist ?
oh yeah
^
I was testing something
^
i know
and do some maffs
ik ik ik
quick maffs
btw is damage ๐ not getDamage
someone said to change it to addDamage a little while ago and i never got to changing it back
well addDamage does not exist
but there is a problem with that code
it doesnt actually damage the player by 0.05 every second when they are outside the endzone
it works when I set the damage to 1
you get the damage, you increase it by 0.05, you set the new damage
oh
ok
oh
setting damage doesnt add damage
that was why that guy wanted me to use addDamage
but there is no such thing
yup
same thing for adjusting positions. player setPos ([0,10,0] vectorAdd getPos player) will teleport the player 10 meters up
//ENDZONE DAMAGE
sleep 60;
while { true } do {
waitUntil { sleep 1; alive player };
if !(player inArea "EndZone") then
{
player setDamage (damage player + 0.05);
};
};
how does this look?
hmmmmmmmmm not sure if the ! can be outside a bracket ()
test it, if it breaks, let us know
its always worked correctly when I had the damage set to 1
i have used that code for a long time
well then thats good
but i never messed around with the damage values, just had it instantly kill players outside the zone
also at what point does a player start limping?
lol
dont know, only use ace
ok
Maybe try it out yourself with some sleep and showing your current damage with a hint
okay
or I could just time it
because I take 0.05 damage each second
see how many seconds it takes
20
0.5 iirc
what?
limping starts @ 0.5 damage
Could slow the damage additon after 0.5 to torture them longer bc they cant run away
๐
thanks
you could also setDamage while keeping the legs damage to a non-limping level
yeah
but I think its okay if they limp
hey does anyone know how fast walking speed and running speed are?
How do I eject only the infantry which is in the cargo position?
_veh = "B_Heli_Transport_01_F"createVehicle (player modelToWorld [8,0,0]);
_veh addAction [
"Force passengers to eject", { params ["_target", "_caller", "_actionId", "_arguments"];
_men = player nearEntities ["CAManBase", 7];
{
_x unassignVehicle _target;
} forEach _men;
_men action ["Eject", vehicle _men];
}, nil, 0, true, false];
Guys, what was the way to find if a player was damaged by an explosion inside a Handle Damage Event Handler?
i dont see any examples on data types in the docu, is that the way?
params [
["_unit",player,[Object]]
];
or does it take a string? also the "data type list" is not very helpful
hey guys! im doing this scenario where its pvp/pve and the team with the most "points" wins, you get points by completing objectives, killing bots and killing enemy players, how do i set up a points system?
i also want it so that theres a zeus on both sides with limited resources and when players take out bots spawned from that zeus they still count as points
params [
[
"_unit", // varname
player, // default value
[objNull, []] // value -of the same type- as expected
];
aha, let me guess, i could also create a goat and pass that as the object type
nothing as intuitive as arma. thanks lou
usually use *null values
except ofc for sides
I'm trying to create a duel situation with players starting 10 m apart looking away from each other. problem is they should not be able to leave their position or change their stance only look and turn around - any idea how to script that?
also, it does not let me recompile my function during mission. the button in the functions viewer is greyed out.
the easiest way would be to use disableUserInput. but read the biki page and the dangers of using it. another option would be to disable the simulation of them.
iirc you have to set this to 1: https://community.bistudio.com/wiki/Description.ext#allowFunctionsRecompile
why not use the Explosion EH? https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Explosion
keyDown event handler and overriding WSAD keys
they should still be able to turn, aim and shoot. afaik disableUserInput and enableSimulation will not allow that.
oh sorry misread that question. yeah what @winter rose said
and also YXC (to avoid stance changes)?
yyyup
better to use the inputAction command
and maybe lean left/right things
you could make use of the alt syntax of fullCrew
I guess I'll leave that activated, so players can dodge bullets Matrix-Stlye ๐
@fresh wyvern
_veh = "B_Heli_Transport_01_F"createVehicle (player modelToWorld [8,0,0]);
_veh addAction [
"Force passengers to eject", { params ["_target", "_caller", "_actionId", "_arguments"];
_cargo = fullCrew [_target, "cargo"] apply {_x select 0}; // thanks @Aebian
{
_x unassignVehicle _target;
_x action ["Eject", vehicle _men];
} forEach _cargo ;
}, nil, 0, true, false];
_cargo = (fullCrew [_target, "cargo"]) apply {_x select 0}; ``` is needed to make it work with unassignVehicle
otherwise the array has other parts of the unit in
whoops yeah i have never used that command before just reading the BIKI
What an elegant way to access a nested array ๐
I am using the Explosion EH, but I want to stop any explosion damage via the HandleDamageEH because the Explosion EH is handling THAT particular damage type
player addEventHandler ["Explosion", {
params ["_vehicle", "_damage"];
if !(isNull objectParent _vehicle) exitWith {};
if !(local _vehicle) exitWith {};
if !(alive _vehicle) exitWith {};
if !(_damage > 0) exitWith {};
if (lifeState _vehicle == "INCAPACITATED") exitWith {};
private _currentLegDamage = 0;
_currentLegDamage = _unit getHit "legs";
call {
if (_damage < 0.1) exitWith {_unit setHit ["legs", (_currentLegDamage + 0.1)];};
if (_damage < 0.2) exitWith {_unit setHit ["legs", (_currentLegDamage + 0.2)];};
if (_damage < 0.3) exitWith {[_unit,2,true] spawn vTempIncapacitation; _unit setHit ["legs", (_currentLegDamage + 0.3)];};
if (_damage < 0.6) exitWith {[_unit,4,true] spawn vTempIncapacitation; _unit setHit ["legs", (_currentLegDamage + 0.4)];};
if (_damage < 0.9) exitWith {[_unit,6,true] spawn vTempIncapacitation; _unit setHit ["legs", (_currentLegDamage + 0.5)];};
if (_damage >= 0.9) exitWith {[_unit,8,true] spawn vTempIncapacitation; _unit setHit ["legs", (_currentLegDamage + 0.6)];};
};
}]; ```
I want these other two markers to be in the same location as the endzone marker, which is random. I am getting an error "undefined variable in expression setmarkerpos"
_endZoneLocation = getMarkerPos "EndZone";
_endZoneLocationX = _endZoneLocation select 0;
_endZoneLocationY = _endZoneLocation select 1;
setMarkerPos "InnerBorder" [_endZoneLocationX, _endZoneLocationY];
setMarkerPos "OuterBorder" [_endZoneLocationX, _endZoneLocationY];
oh nevermind I got it
I had the marker names and setMarkerPos reversed
Hi, thanx for helping out.
I do get an error on
|x|unassignVehicle
[_x] @fresh wyvern
didn't work..
This gets an error on:
|x|unassignVehicle
_veh = "B_Heli_Transport_01_F"createVehicle (player modelToWorld [8,0,0]);
_veh addAction [
"Force passengers to eject", { params ["_target", "_caller", "_actionId", "_arguments"];
_cargo = (fullCrew [_target, "cargo"]) apply {_x select 0};
{
_x unassignVehicle _target;
_x action ["Eject", vehicle _men];
} forEach _cargo;
}, nil, 0, true, false];
[_x] unassignVehicle _target;
Does get the same error.
crazy question
If I have a global marker, can I change its size, etc. locally?
"marker" setMarkerSizeLocal blabla
does it work on global markers or only local ones?
unassignVehicle _x;
because the syntax is sqf {unassignVehicle _x} forEach _cargo;
@little raptor A global marker? They're all (secretly) local.
how can I make text appear on screen for all players during a mission?
Multiplayer optimisation: Global marker commands always broadcast the entire marker state over the network. As such, the number of network messages exchanged when creating or editing a marker can be reduced by performing all but the last operation using local marker commands, then using a global marker command for the last change (and subsequent global broadcast of all changes applied to the marker).
The global marker commands all have this note ๐
How would you make it appear in singleplayer?
that's exactly what I wanted to do (modifying the marker by dragging, etc.)
only updating it when the user releases mouse button
anyway, thnx! ๐
not sure
Thanks a lot!! Finally got the script right!
_veh = "B_Heli_Transport_01_F"createVehicle (player modelToWorld [8,0,0]);
_veh addAction [
"Force passengers to eject", { params ["_target", "_caller", "_actionId", "_arguments"];
_cargo = (fullCrew [_target, "cargo"]) apply {_x select 0};
{
{unassignVehicle _x} forEach _cargo;
_x action ["Eject", vehicle _target];
} forEach _cargo;
}, nil, 0, true, false];
There are many forms of text on screen @past wagon, you should choose one first before worrying about multiplayer ๐
you actually don't need the foreach in the foreach. @fresh wyvern sqf _veh = "B_Heli_Transport_01_F"createVehicle (player modelToWorld [8,0,0]); _veh addAction [ "Force passengers to eject", { params ["_target", "_caller", "_actionId", "_arguments"]; _cargo = (fullCrew [_target, "cargo"]) apply {_x select 0}; { unassignVehicle _x; _x action ["Eject", vehicle _target]; } forEach _cargo; }, nil, 0, true, false];
Thanks again!! ๐
welcome
anyone can maybe tell me why the aircraft does not limit the speed? Pilot doesn't seem to be affected at all. However I know the if-clause will be reached because if I add a hint it will be printed each second lmao
waitUntil {(_aircraft distance _destination) < 2000};
previousSpeed = 3.6 * (velocityModelSpace _aircraft select 1);
while {previousSpeed > 5} do
{
scopeName "landingCycle";
sleep 1;
speedCache = previousSpeed - 10;
if (( 3.6 * (velocityModelSpace _aircraft select 1)) < previousSpeed - 1) then
{
_aircraft limitSpeed previousSpeed;
previousSpeed = speedCache;
};
};```
the issue is not with the speed command. and scopeName is just a way to name a while-clause so you can kill it with breakOut
break ๐
No, mean you can just use break ๐
that breaks all code blocks in the while. However neither was part of my question
I guess the problem lies with _aircraft limitSpeed previousSpeed;
What type of vehicle is _aircraft?
a chopper
Ah. Ive made a similar attempt to temper the AIs death flare, though mine was a bit more crude.
mine is just so that the helo slows down gradualy before reaching the landing site
because AI does not do that by default :/
instead it goes full collective and then at the last meters vertically sky-rocket into the air to slow down
Yeah , exactly. So they dont pull up suddenly, i getcha.
My attempt wasuch the same, just no maths or mucking with velocity vectors, just getSpeed.
waitUntil {(_aircraft distance _destination) < 2000};
private _previousSpeed = speed _aircraft; //Assume speed is 10
while {_previousSpeed > 5} do { //10 > 5? Yes.
sleep 1;
private _speedCache = _previousSpeed - 10;
if (speed _aircraft < _previousSpeed - 1) then { //10 < 9? No.
_aircraft limitSpeed _previousSpeed;
_previousSpeed = _speedCache;
};
};
Yeah, kinda like that
well yeah my math thing is kinda the speed thing lol .
That's his code, just modified so that I can actually read and comprehend it.
speed is not 10 though, speed is more like 150 :D
Same thing though...
Exactly, simplified :p im sure theres benefits to looking at the models velocities, but speed is goos enough for a straight flying AI.
150 < 149? No.
I was more referring to //Assume speed is 10
I think he did that for demonstration purposes
You're not slowing down the helicopter until the AI is already slowing it down is what I'm saying.
Because you never enter the if-statement.
Doesn't make a lot of sense to me.
Then I guess the AI does not care about limitSpeed.
you don't need an apply either
you do. If you do it without you have more then just the unit object in the array
top is with apply. Bottom is without @little raptor
yeah gotta access the nested array
While {speed _Aircraft >20} do {
Sleep .5;
_currentSpeed = speed _aircraft;
_aircraft limitSpeed _currentSpeed-3;}
No, that's not it, just tested it, helicopter pilot AI does care about limitSpeed.
They do, though, ive been testing as well.
Did you disable his AI at all?
Hell, ive been graphing speed vs reduction per cycle vs height gained xD
I did actually. but nothing with move: sqf { _x disableAI "AUTOCOMBAT"; _x disableAI "AUTOTARGET"; _x disableAI "TARGET"; } forEach [driver _aircraft];
Fun fact, the huron is smooth af
maybe it depends on the kind of chopper
also ai is dumb with helis. they wouldnt accept full passenger with me, they always kicked out two dudes who had to walk
probably gonna look at my speeding stuff later. gtg almost 1am here sleep. Thanks for the help so far.
@hollow lantern Tested my variant of the code, the if-statement is only entered once the AI is already slowing down for landing anyways.
maybe I then miss interpreted the while execution. So the if statement once it gets activated then runs "forever" until the condition is satisfied
and that activation only happens when it is already too late
I see
what
tbh this is a weird way of updating your previousSpeed. you decrease the speedCache over time without ever setting it again to the actual speed of the plane. why not do
_aircraft limitSPeed (speed aircraft - 10) on a loop?
This code looks very prone to loosing connection to realitiy
you don't need it
Pls gib alternativ
Whenever someone gets a chance; how I set up a pbo with pbo manger to add sounds?
You wanna make it a mod or use it for one missopn only?
For an addon sorry yeah
I assume the same way like description ext but into an addon
Thats how my module at least worked
Already went there
And Its dead?
well the one guy who did help didn't fix what I needed fixing
Ah
I have the description ext thing in a config.bin inside my pbo
That sounds correct
Is the pbo inside a folder called @MyMod or sth?
It's inside an addon folder which is inside a mod folder yes
You mean the rpt or something else
Yeah
It states what mods are loaded, look for yours in there
Hm also you can search ingame in the config browser for your mod to make sure it was loaded
Sorry i dont know a lot about mods, i once made a module and it barely worked
Try #arma3_config if you cant figure it out, also try to follow the biki on addons
@hollow lantern
_cargo = fullCrew [_target, "cargo"];
{
_unit = _x#0;
unassignVehicle _unit;
_unit action ["Eject", vehicle _target];
} forEach _cargo;
you might be wondering what's the difference?
the difference is, when you use apply you're doing two loops
this is just one
and sqf loops are slow
avoid them as much as possible
Agreed but not as pretty
I got points taken away last comp sci homework for wrtitng my own loop that does three things instead of having 3 loops with prebuilt functions. ๐
Anyone who know how to make these fire simultaneously?
_veh = "B_CTRG_Heli_Transport_01_tropic_F"createVehicle (player modelToWorld [8,0,0]);
_veh addMagazineTurret ["2000Rnd_65x39_Belt_Tracer_Red", [-1]];
_veh addWeaponTurret ["LMG_Minigun_Transport", [-1]];
_veh addMagazineTurret ["2000Rnd_65x39_Belt_Tracer_Red", [-1]];
_veh addWeaponTurret ["LMG_Minigun_Transport2", [-1]];
by fire you mean execute?
isNil {
_veh = "B_CTRG_Heli_Transport_01_tropic_F"createVehicle (player modelToWorld [8,0,0]);
_veh addMagazineTurret ["2000Rnd_65x39_Belt_Tracer_Red", [-1]];
_veh addWeaponTurret ["LMG_Minigun_Transport", [-1]];
_veh addMagazineTurret ["2000Rnd_65x39_Belt_Tracer_Red", [-1]];
_veh addWeaponTurret ["LMG_Minigun_Transport2", [-1]];
};
that's different 
sqf is not the same as other languages
apply is almost the same as forEach in terms of performance
not as pretty
there's literally no difference at all ๐
Is there a script way I can make AI look at a specific angle on the verticle axis?
Like reference point A then look 45 degrees up?
no
you'll have to make the AI target a fake target
Dang, was hoping to avoid that.
Thanks for letting me know, was crawling through the wiki since I posted that.
okay I gotcha in terms of the new Arma 3 pointer #. I forgot that unassignVehicle also takes peds as argument and not just vehicles
new more like "wasn't in Arma 2"
okay just want to check if im getting somthing right here the setDate command is technicaly local but if used on the server at mission start all the clients will have their date changed to server correct
Thanx a lot! This made the AI exit the aircraft much faster ๐
With this I still have to toggle between the weapons in weapon-group 1
also i believe i have this written correctly
if (isServer) then
{
waitUntil {time < 0};
{[2021, 3, 11, 19,23] remoteExec ["setDate"];
[30, .6] remoteExec ["setWaves"];
[300, 0.75] remoteExec ["setOvercast"];
[300,0.5] remoteExec ["SetGust"];
} forEach playableUnits;
setWind [5, 0, true];
time setRain 0.5;
300 setLightnings 0.3;
300 setFog [0.4, 0.3, 50];
};```
edit: think this is right now
Is there a way to use CfgCloudlets with particle sources if the class it self has expressions as such in them?
interval = "0.003/((-(speedY interpolate [-16,0,-9,0])) - 1)";
usually when uses setParticleClass on those, nothing shows up.
NO
why would you remoteExec global variables, why
https://community.bistudio.com/wiki/setDate
Clients' local date is automatically and periodically synchronised with the server date.
In order to change the date without waiting for automatic synchronisation, use remote execution: ```sqf
[[2001,6,22,12,0]] remoteExec ["setDate"];
so the put a damn G on the wiki then
here, you are remoteExec'ing it as many times as there is a playable!!
no, because it still has a local effect
but on the server, hence the doc pain
if (isServer) then
{
waitUntil {time > 0};
setDate [2021, 3, 11, 19,23];
300 setWaves 0.6;
300 setOvercast 0.75;
300 SetGust 0.5;
setWind [5, 0, true];
time setRain 0.5;
300 setLightnings 0.3;
300 setFog [0.4, 0.3, 50];
};```
better @winter rose
nvm ive deleted somthing
waitUntil {time < 0}; > no?
yeah i hit the wrong one and in my defence Lou i was going of the advice you gave for the wiki before L for local G for global
it had an L so i had to remote it for every clent
???
what do you mean?!
the wiki
Local, he meant
the wiki for the comands i executed had
LELocal a local effect means that the effect will only happen on the machine where the command is executed
ok. I thought you meant a literal L 
setDate has a Local effect on the wiki
because it has, but also because the server synchronises it back
i didnt know that i just had your advice from earlier L for local G for global
and I am not assaulting you don't worry ๐
@winter rose all g but i fixed up the script, so this new script will over the corse of 5 min change the weather to a fairly crappy day right
almost
if (isServer) then
{
waitUntil {time > 0};
"setDate" [2021, 3, 11, 19,23]; // you kept the quotes
300 setWaves 0.6;
300 setOvercast 0.75;
300 SetGust 0.5;
setWind [5, 0, true];
time setRain 0.5; // why time?
300 setLightnings 0.3;
300 setFog [0.4, 0.3, 50];
};
so it means it will try to stick around the middle more
ah ok then what i put might be a bit better for what i want but cool thanks lou
waitUntil {time > 0};
๐ฅ
sleep .1;? ^^
yes
Is there a way where one vehicle player can fire two vehicle weapons simultaneously?
Might be something for performance optimisations page
two turrets
true
Not really an issue for time > 0 but for time > 10
it was what was on the wiki for setdate
Thanks, will be fixed
But then you by default fire either or.
yes, no way to fire two weapons at once (unless scripted)
Do you know where I can look to script it?
Fired Event Handler = fire/doFire etc would be my guess
Thanks.
ok that might be a little to random made the fog so thick i cant see the gun in front of me
still it works made a completely randomized weather script
if (isServer) then
{
_randomN = random 1; //Used for everything but fog and time
_randomH = random 24; //Random hour
_randomM = random 59; //Random minute
_randomF = random 50; //random fog altitued between 1 and 50
_randomF1 = random 0.2; //Random fog decay any hire and good luck seeing an inch infront of you
_randomF2 = random 0.6; // Random Fog base
waitUntil {time > 0};
setDate [2021, 3, 11, _randomH,_randomM];
0 setWaves _randomN;
0 setOvercast _randomN;
0 SetGusts _randomN;
setWind [5, 0, true];
0 setRain _randomN;
0 setLightnings _randomN;
0 setFog [_randomF2, _randomF1, _randomF];
};```
time will be > 0 exactly in the next frame (unless the game is paused, which can't happen in MP). So it's pointless.
In fact it can work better without sleep (if time is already larger than 0 waitUntil is skipped)
@little raptor does this make sense?
_troops = fullCrew [_aircraft, "cargo", false];
{
_unit = _x#0;
unassignVehicle _unit;
} forEach _troops;
vs.
_troops = (fullCrew [_aircraft, "cargo", false]) apply {_x select 0};
{unassignVehicle _x} forEach _troops;```
I guess based on your suggestion the first is faster.
why two unassigned vehicles?
sorry I messed that up
also select = #
this is even faster (not creating _unit and _troops because they're used once):
{
unassignVehicle (_x select 0); //or unassignVehicle (_x#0);
} forEach fullCrew [_aircraft, "cargo", false];
@hollow lantern you could even use apply:
fullCrew [_aircraft, "cargo", false] apply {unassignVehicle (_x select 0)};
I'm assuming there won't be any big difference performance-wise
that's neat. Removes the need for forEach
(but it returns an array of "null")
if (isServer) then
{
_gasMask =["G_AirPurifyingRespirator_02_black_F", "G_AirPurifyingRespirator_02_black_F", "G_AirPurifyingRespirator_02_sand_F", "G_AirPurifyingRespirator_02_olive_F", "G_RegulatorMask_F" ]
while {true} do
{
if
(_x in list Radiationzone || goggles _x != _gasmask or _x !( in "B_APC_Tracked_01_CRV_F")) then
{_x setdamage (damage _x + 0.1);};
} forEach units east;
sleep 10;
};
};```
just spit balling here and im pretty sure some one posted a script for this the other day but i wanted to try for my self does this work?
edited
@little raptor that better if not can i get a hint for 100
still has an issue if ();
@tough abyss also _x !( in "B_APC_Tracked_01_CRV_F")
yeah was unsure about that i wanted it so that if their not in a bobcat it will hurt them
I mean the syntax is wrong
can you show how it would be then please
Hi is there a way to spawn a random weapon on the floor from the CfgWeapons classes?
@tough abyss sqf 101:
understanding some confusing data types
- anything with {} around it is called
code - anything with [] around it is called
array - anything with "" around it is called
string
how do commands work? there are 3 types of commands:
- nullar (no arguments): like
player - unary (1 argument, which is always on the right): e.g.
! condition,alive _unit,createVehicle [] - binary (2 arguments, one on left one on right): e.g.
player setPos _pos,"type" createVehicle [0,0,0],1+2
you can simply look at the description of the command on wiki to understand everything now:
Syntax:
unit in vehicle
Parameters:
unit: Object - entity person
vehicle: Object - entity vehicle
Return Value:
Boolean
this is a binary command
left argument: object
right argument: object
object in object
@tough abyss now what is wrong with what you're doing?
_x !( in "B_APC_Tracked_01_CRV_F")
- you're using
inas a unary command (in "...") - your right hand argument is a
string(notice the"...")
_x !in "B_APC_Tracked_01_CRV_F" ?
ok part of the problem is i dont know how to call for a type of vehical
what is _x?
what is "B_APC_Tracked_01_CRV_F"?
https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting @tough abyss Reading through the page and sub pages might clear some thing up.
"B_APC_Tracked_01_CRV_F" is the class name for the vehical type i want
well yes
but it's a STRING
review this again:
#arma3_scripting message
trust me
it'll help you
Hey R3vo ^^
yes
so take the "" away then
do you have an object named B_APC_Tracked_01_CRV_F?
noooooooo thats what im trying to say i dont want to kname every bobcat i want the script to recognise that vehical class i dont know how to do that tho
_wpList = (configFile >> "cfgWeapons") call BIS_fnc_getCfgSubClasses;
This gets all the weapons right ๐ ?
@tough abyss
ok since this is gonna take forever like this I'll just give you the answer
but try to review this stuff 
!(vehicle _x isKindOf "B_APC_Tracked_01_CRV_F")
im sorry i haven't go thru and read every wiki page and know every bit of syntax
i was working with what i knew
I guess so?
you can just use this:
_wpnClasses = "getNumber (_x >> 'scope') == 2 && getNumber (_x >> 'type') == 1" configClasses (configFile >> "cfgWeapons");
_wpn = configName selectRandom _wpnClasses;
_container = createVehicle ["WeaponHolderSimulated", _pos];
_container addWeaponCargoGlobal [_wpn, 1];
it's ok that you don't know some commands
we can help you with that
I was trying to teach you how to understand the commands and use the wiki better ๐
@heady quiver btw that's not tested
I see.. what about this i want to ONLY spawn pistols:
_pistolConfigs = "((configName (_x)) isKindof ['Pistol', configFile >> 'cfgWeapons']) && (getText (_x >> 'displayName') != '')" configClasses (configFile >> "cfgWeapons");
How would i pull this off ?
selectRandom[_pistolConfigs];
and then createVehicle on it?
it already gives you an array of pistol configs
Yes
just use it similar to this
#arma3_scripting message
no need to wrap it again then
also what I wrote gives you rifles
Mmm
_pistolConfigs = "((configName (_x)) isKindof ['Pistol', configFile >> 'cfgWeapons']) && (getText (_x >> 'displayName') != '')" configClasses (configFile >> "cfgWeapons");
private _weaponHolder = createVehicle ["Weapon_Empty", getPosATL player, [], 0, "CAN_COLLIDE"];
_weaponHolder addWeaponCargo [selectRandom _pistolConfigs, 1];
This spawns a inventory action on the ground but no weapon x)
Ah got it.
or not.
It spawns spectrums x)
Is there a way to 'exlude'
add the class of the spectrum devise into your condition before configClasses
&& configName _x != "spectrumSomething"
_pistolConfigs = "((configName (_x)) isKindof ['Pistol', configFile >> 'cfgWeapons']) && configName _x != 'Weapon_hgun_esd_01_F' && (getText (_x >> 'displayName') != '')" configClasses (configFile >> "cfgWeapons");
private _weaponHolder = createVehicle ["Weapon_Empty", getPosATL player, [], 0, "CAN_COLLIDE"];
_wpn = configName selectRandom _pistolConfigs;
_weaponHolder addWeaponCargoGlobal [_wpn, 1];
' instead of "
!(_configName _x in [array])
_exludedPistols = ['Weapon_hgun_esd_01_F', 'Weapon_hgun_esd_01_antenna_02_F', 'Weapon_hgun_esd_01_antenna_03_F', 'Weapon_hgun_esd_01_antenna_01_F'];
_pistolConfigs = "((configName (_x)) isKindof ['Pistol', configFile >> 'cfgWeapons']) && !(configName _x in _exludedPistols) && (getText (_x >> 'displayName') != '')" configClasses (configFile >> "cfgWeapons");
private _weaponHolder = createVehicle ["Weapon_Empty", getPosATL player, [], 0, "CAN_COLLIDE"];
_wpn = configName selectRandom _pistolConfigs;
_weaponHolder addWeaponCargoGlobal [_wpn, 1];
if (isServer) then
{
_gasMask =["G_AirPurifyingRespirator_02_black_F", "G_AirPurifyingRespirator_02_black_F", "G_AirPurifyingRespirator_02_sand_F", "G_AirPurifyingRespirator_02_olive_F", "G_RegulatorMask_F" ];
while {true} do
{
if
(_x in list Radiationzone || goggles _x != _gasmask or !!(vehicle _x isKindOf "B_APC_Tracked_01_CRV_F")) then
{_x setdamage (damage _x + 0.1);}
} forEach units west;
sleep 10;
};
};```
getting an error on line 14 missing {
@heady quiver Also, you are writing _configName instead of configName
@tough abyss Then check the braces
The format is also awful to read
@tough abyss two !
"!!"
_exludedPistols = ['Weapon_hgun_esd_01_F', 'Weapon_hgun_esd_01_antenna_02_F', 'Weapon_hgun_esd_01_antenna_03_F', 'Weapon_hgun_esd_01_antenna_01_F'];
_pistolConfigs = "((configName (_x)) isKindof ['Pistol', configFile >> 'cfgWeapons']) && !(configName _x in _exludedPistols) && (getText (_x >> 'displayName') != '')" configClasses (configFile >> "cfgWeapons");
private _weaponHolder = createVehicle ["Weapon_Empty", [getPosATL player # 0, getPosATL player # 1, 0.04], [], 0, "CAN_COLLIDE"];
_wpn = configName selectRandom _pistolConfigs;
_weaponHolder addWeaponCargoGlobal [_wpn, 1];
@heady quiver You need to add a little offset in Z otherwise the pistols disappear in the ground
yeah fixed that still throwing the missing brace error
Yeaa i just realised that
Then check where it is missing
its the close } brace for the do loop
How would i do that ๐ ?
but the open { is thre
What editor is that?
A decent ide will also show you where it's missing if you hover over it
Visual Studio Code
cool
screw that noise use notepad like a boss
yep
XD
Waste our time like a boss...
im kiding
How would i offset getPosATL player ?
Check the code I posted
vectorAdd
dirty but simple
.
ok where do i get those add on @spark turret
In visual studio code
what the sqf parts
Thanks got it working.
One more question, prob very easy for you guys.
How would i get the weapon to spawn with mags.
addWeaponWithItemsGlobalSomething ๐
addWeaponWithAttachmentsCargoGlobal 
that sure is a mouthful
๐คฃ
Only one problem, i need to define the mags myself but i want it to be random from whats available with that weapon
bis_fnc_compatibleMags
maybe it had a "get"?
I don't know
no 
BIS_fnc_compatibleMagazines
I mean I wasn't sure if it's called BIS_fnc_getCompatibleMagazines or just BIS_fnc_compatibleMagazines
If in doubt just look it up here https://community.bistudio.com/wiki/Category:Scripting_Commands_by_Functionality
yeah I did 
I was just mentioning that off the top of my head at first
hmm also this bit dosnt work either goggles _x != _gasmask
_gasmask is an array with the different gasmask class names
!(goggles _x in _gasmask)
it's also case sensitive
do i have to manuall put conditions for each mask type
also script is huring me outside trigger area
no
also why units west + in list?
simply use forEach list RadiationZone
even this is faster than that ( I mean west + in list):
forEach (units west inAreaArray RadiationZone)
(but just use the above code, not this one, since you already have a trigger)
// Spawn mags
_getRandomMag = _wpn call BIS_fnc_compatibleMagazines;
_mgsHolder addMagazineCargoGlobal [_getRandomMag, 1];
Im stupid?
ok and how do i work that into an if condition sqf foreach (units west inAreaArray Radiationzone || !(goggles _x in _gasMask) or !(vehicle _x isKindOf "B_APC_Tracked_01_CRV_F"))
- that returns an array of mags, you have to select a random one
- the mag won't be loaded into the weapon
Its fine that it wont load in the gun.

I said simply this:
forEach list RadiationZone;
and remove _x in list RadiationZone
Got it working nice
_exludedPistols = ['Weapon_hgun_esd_01_F', 'Weapon_hgun_esd_01_antenna_02_F', 'Weapon_hgun_esd_01_antenna_03_F', 'Weapon_hgun_esd_01_antenna_01_F'];
!(configName _x in _exludedPistols)
This doesnt work btw it still spawns the weird antenna's
maybe there are more classes then just the few
what _x?
there is no _x here
// Spawn random pistol
_exludedPistols = ['Weapon_hgun_esd_01_F', 'Weapon_hgun_esd_01_antenna_02_F', 'Weapon_hgun_esd_01_antenna_03_F', 'Weapon_hgun_esd_01_antenna_01_F'];
_pistolConfigs = "((configName (_x)) isKindof ['Pistol', configFile >> 'cfgWeapons']) && !(configName _x in _exludedPistols) && (getText (_x >> 'displayName') != '')" configClasses (configFile >> "cfgWeapons");
private _weaponHolder = createVehicle ["Weapon_Empty", getPosATL player vectorAdd [0,0,0.1], [], 0, "CAN_COLLIDE"];
_wpn = configName selectRandom _pistolConfigs;
_weaponHolder addWeaponCargoGlobal [_wpn, 1];
// Spawn mags
_getMag = _wpn call BIS_fnc_compatibleMagazines;
_getRandomMag = selectRandom _getMag;
_weaponHolder addMagazineCargoGlobal [_getRandomMag, random 5];
there is no _x
configClasses
the simplest and fastest way to exclude is this:
_exludedPistols = _exludedPistols apply {configFile >> "cfgWeapons" >> _x};
_pistolConfigs = _pistolConfigs - _exludedPistols;
and remove that from inside the configClasses condition
just use what I wrote earlier
100 times faster
_pistolConfigs = "getNumber (_x >> 'scope') == 2 && getNumber (_x >> 'type') == 2" configClasses (configFile >> "cfgWeapons");
// Exclude items
_exludedPistols = ['Weapon_hgun_esd_01_F', 'Weapon_hgun_esd_01_antenna_02_F', 'Weapon_hgun_esd_01_antenna_03_F', 'Weapon_hgun_esd_01_antenna_01_F'];
_exludedPistols = _exludedPistols apply {configFile >> "cfgWeapons" >> _x};
_pistolConfigs = "getNumber (_x >> 'scope') == 2 && getNumber (_x >> 'type') == 2" configClasses (configFile >> "cfgWeapons");
_pistolConfigs = _pistolConfigs - _exludedPistols;
private _weaponHolder = createVehicle ["Weapon_Empty", getPosATL player vectorAdd [0,0,0.1], [], 0, "CAN_COLLIDE"];
_wpn = configName selectRandom _pistolConfigs;
_weaponHolder addWeaponCargoGlobal [_wpn, 1];
// Spawn mags
_getMag = _wpn call BIS_fnc_compatibleMagazines;
_getRandomMag = selectRandom _getMag;
_weaponHolder addMagazineCargoGlobal [_getRandomMag, random 5];
move this part below the configClasses: _pistolConfigs = _pistolConfigs - _exludedPistols;
should work now
yes
is there a list of all the types?
hey for my code should the trigger to be server only or not
probably
What does your trigger do?
its just there for the list
then it won't matter
actually I think it should not be server-only
depends where that code was being executed
if it was being executed on the server then yeah it should be server only
allowFunctionRecompile turned on in CfgFunctions?
ok then somhing is still wrong then the code isnt throwing errors any more but im still taking damage now even with mask on.```sqf
if (isServer) then
{
_gasMask =["G_AirPurifyingRespirator_02_black_F", "G_AirPurifyingRespirator_02_black_F", "G_AirPurifyingRespirator_02_sand_F", "G_AirPurifyingRespirator_02_olive_F", "G_RegulatorMask_F" ];
while {true} do {
{
if (!(goggles _x in _gasMask) or !(vehicle _x isKindOf "B_APC_Tracked_01_CRV_F")) then
{_x setdamage (damage _x + 0.1);}
} forEach list Radiationzone;
sleep 10;
};
};```
yes
solved already! ๐
Hey Leo, is there also a way to do it the other way arround instead of exclude only include?
makes no sense
since your array is smaller and you're getting all weapon configs just use the smaller array
if it may contain some classes not found in cfgWeapons (e.g because of mods, dlcs) etc., use arrayIntersect
Well i want for example only 2 weapons: M4, AK
@little raptor any reason im taking damage with this code even with mask on
perfect size for my mouth
whats the proper way to indent the thing then
use the tab key
an IDE will help with keeping the indents
like vscode or npp
couldn't you just use items instead of attachments ? ๐
no
๐ฅฒ
@little raptor ```sqf
if (isServer) then
{
_gasMask =["G_AirPurifyingRespirator_02_black_F", "G_AirPurifyingRespirator_02_black_F", "G_AirPurifyingRespirator_02_sand_F", "G_AirPurifyingRespirator_02_olive_F", "G_RegulatorMask_F" ];
while {true} do
{
{
if (!(goggles _x in _gasMask) or !(vehicle _x isKindOf "B_APC_Tracked_01_CRV_F")) then
{
_x setdamage (damage _x + 0.1);
}
} forEach list Radiationzone;
sleep 10;
};
};```
better
yeah
it could be a case sensitivity issue
convert all of those gas mask classes to lower case
then use this
!(toLowerANSI goggles _x in _gasMask)
@tough abyss if you use np++ just select the array and press ctrl+u
you mean like this ```sqf
if (isServer) then
{
_gasmask =["g_airpurifyingrespirator_02_black_f", "g_airpurifyingrespirator_02_black_f", "g_airpurifyingrespirator_02_sand_f", "g_airpurifyingrespirator_02_olive_f", "g_regulatormask_f"];
while {true} do
{
{
if (!(toLowerANSi goggles _x in _gasmask) or !(vehicle _x isKindOf "B_APC_Tracked_01_CRV_F")) then
{
_x setdamage (damage _x + 0.1);
}
} forEach list Radiationzone;
sleep 10;
};
};
but why they are the class names
because in is case sensitive
classname = string
so i have to retype all them in lower case in vcs
_getAttachment = _rndRifle call BIS_fnc_compatibleItems;
_getRandomAttachment = selectRandom _getAttachment;
_weaponHolder addMagazineCargoGlobal [_getRandomAttachment random 2];
This not working for some reason ๐ค
done that now
x)
because it misses ,
update this with what you have now
#arma3_scripting message
let me take a look
Seems to spawn a invisible attachment ๐ค
@little raptor done
seems good. give it a try
I think you should use addItemCargoGlobal
@little raptor negative damaging me even with gasmask on
Yep... ty.
what does this give you?
goggles player
try it in debug console
"G_AirPurifyingRespirator_02_black_F"
on global and local
testing in multiplayer btw
did you exit to eden or just go back to lobby?
I added the vectorAdd to the weapon spawn but when the mags spawn after it they will be in the ground anyway to fix that?
use weaponHolderSimulated
ty
@little raptor went bvack to eden just now tried again still damaging
wait do you want them to float in the air?
Just to spawn it with the weapon.
on the ground
_rifles = ['rhs_weap_hk416d145', 'rhs_weap_akm', 'rhs_weap_ak103','rhs_weap_m4'];
_rndRifle = selectRandom _rifles;
private _weaponHolder = createVehicle ["weaponHolderSimulated", getPosATL player vectorAdd [0,0,0.1], [], 0, "CAN_COLLIDE"];
_weaponHolder addWeaponCargoGlobal [_rndRifle, 1];
_getMag = _rndRifle call BIS_fnc_compatibleMagazines;
_getRandomMag = selectRandom _getMag;
_weaponHolder addMagazineCargoGlobal [_getRandomMag, random 5];
_getAttachment = _rndRifle call BIS_fnc_compatibleItems;
_getRandomAttachment = selectRandom _getAttachment;
_weaponHolder addItemCargoGlobal [_getRandomAttachment, 1];
try this:
remove the script
make sure you don't take any damage
now execute this in debug console:
[] spawn
{
_gasmask =["g_airpurifyingrespirator_02_black_f", "g_airpurifyingrespirator_02_black_f", "g_airpurifyingrespirator_02_sand_f", "g_airpurifyingrespirator_02_olive_f", "g_regulatormask_f"];
while {true} do
{
{
if (!(toLowerANSi goggles _x in _gasmask) or !(vehicle _x isKindOf "B_APC_Tracked_01_CRV_F")) then
{
_x setdamage (damage _x + 0.1);
}
} forEach list Radiationzone;
sleep 10;
};
};
then I guess it should work
ty
global or local
server
nope took damage
but you didn't take damage without that?
yes
no damage till i ran script
moment i ran it my guy started making grunting sounds
your condition is wrong
would me spawning in the gasmask be causing it
replace or with and (or &&)
okay ** returned an error but && seems to be working
that was a typo 
I corrected it
ok yeah i can see how or was rong
also why spawn
should i change it to [] spawn in my script or keep it to while
no
it was for something else
debug console is unscheduled
you can't use sleep in it
How do i add holdAction function to all classes with the type Land_PortableCabinet_01_closed_black_F
if you have CBA it's easy
yea?
do you?
yea
specifically this example
class Extended_Init_EventHandlers {
class Land_PortableCabinet_01_closed_black_F {
class My_Cabinet_init_eh {
init = "call some_fnc_addHoldAction";
};
};
};
Just realized i might nog even need it
๐
x)
Not sure....
createVehicle ["Land_PortableCabinet_01_closed_black_F", getPosATL player vectorAdd [0,5,0], [], 0, "CAN_COLLIDE"];
i got this right.
and i want this:
[milBox,
"Search","\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa",
"container distance _target < 3",
"_caller distance _target < 3",
{},
{},
{_this call spawnItem },
{},
[],
3,
0,
true,
false
] remoteExec ["BIS_fnc_holdActionAdd", 0, container];
on all of those.
since you create them yourself there is no need
for event handler
The plan is to create them (dynamic loot) but i want that action on all of them
so i can basically just merge those together and its not heavy to load?
that's what I said ๐
it won't be any different than any other method you planned to use (such as event handlers)
(it's even faster)
how would this work ?
spawnLootableMillCrate = {
_lootCrate = createVehicle ["Land_PortableCabinet_01_closed_black_F", getPosATL player vectorAdd [0,5,0], [], 0, "CAN_COLLIDE"];
[_lootCrate,"Search","\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa","\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa","_lootCrate distance _target < 3","_caller distance _target < 3",
{},{},{_this call spawnWeapons },{},[],3,0,true,false
] remoteExec ["BIS_fnc_holdActionAdd", 0, _lootCrate];
};
nvm got it.
is that a global setting for all functions or function specific? i had the function specific "recompile = 1;" flag, but biki says thats auto enabled for mission functions, and arma told me its a redundant statement.
would
if (isServer) then
{
while {true} do
{
if (east KnowsAbout group T1 <=1.4 ) then
{
QRF addWaypoint [(getPos T1),100];
};
};
};
``` work
=< will break, use <=
ok
other than that, yes. but it will only check once.
@spark turret what bout that
thats where the fun begins and you map every key to throw grenade
which one is faster: 1) SQF private _allRealPlayers = (allPlayers - entities "HeadlessClient_F"); if (_allRealPlayers findIf {(_x distanceSqr _zombie <= 1200^2)}) isEqualTo -1) then {deletevehicle _zombie;}; OR 2) ```SQF
if (({_x distance2D _zombie <= 1200} count _allRealPlayers) isEqualTo 0) then {deletevehicle _zombie;}; ```
Thanks!
// Allowed items in Loot Table
_items = [
'Item_FirstAidKit'
];
// Select random weapon from loot table
_rndItem = selectRandom _items;
// Create item on ground after search
private _itemHolder = createVehicle [_rndItem, getPosATL player vectorAdd [0,0,0.1], [], 0, "CAN_COLLIDE"];
_itemHolder addItemCargoGlobal [_rndItem, 5];
For some reason this only creates 1 first add kit anyone knows wqhy?
Does this even work?
You should be creating a weapon holder with createVehicle and then add items to it
it creates one medical thingy x)
Yes
mmm
Because the kit is not a weapon holder but an object the player can pick up
yea i want to spawn like 3 for example ๐ค
_holder = createVehicle ["weaponHolderSimulated", getPosATL player vectorAdd [0,0,0.1], [], 0, "CAN_COLLIDE"];
_holder addItemCargoGlobal [_rndItem, 5];
Now there will be 5 first aid kits in the weapon holder
Nope
Not doing anything now
searchMedical = {
// Allowed items in Loot Table
_items = [
'Item_FirstAidKit'
];
// Select random item from loot table
_rndItem = selectRandom _items;
// Create item on ground after search
_holder = createVehicle ["weaponHolderSimulated", getPosATL player vectorAdd [0,0,0.1], [], 0, "CAN_COLLIDE"];
_holder addItemCargoGlobal [_rndItem, 5];
};
current code
trying it with a pistol works but not with medical kit.
oh..
FirstAidKit is the classname for the inventory item.
thats it
TY
searchCivBackpacks = {
// Allowed items in Loot Table
_items = [
'B_FieldPack_blk',
'B_FieldPack_cbr',
'B_FieldPack_ghex_F',
'rhs_sidor',
'rhs_assault_umbts'
];
// Select random item from loot table
_rndItem = selectRandom _items;
// Create item on ground after search
_backpackHolder = createVehicle ["weaponHolderSimulated", getPosATL player vectorAdd [0,0,0.3], [], 0, "CAN_COLLIDE"];
_backpackHolder addBackpackCargoGlobal [_rndItem, 1];
};
Why does this work when i execute it in the game but when i call the function to it, it doesnt?
Seems to work again
weird.
how do i finish this sqf if (_x isKindOf "Land_FMradio_f") then { my code here }forEach......};
{
if (_x isKindOf "stuff") then
{
// ...
};
} forEach _list;
proper indentation saves lives ๐
huh actualy now that i think about it my plan isnt going to work i dont think
{
_Radios =["land_fmradio_f", "land_survivalradio_f"]
while {true} do
{
if (toLowerANSI _x isKindOf in _Radios) then
{
playSound3D [filename, soundSource, isInside, soundPosition, volume, soundPitch, distance, offset]
};
}forEach _Radios;
};
``` i dont belive this is correct or will work
Correct, it won't work ^^
cause it wants the object for sound source
right
sod it il just run the play sound through the objects int field
sigh
wait wont wwork dam it all
Stahp
Write on paper or notepad:
- what do you want to do?
- what are the logical steps?
- what are the corresponding commands?
And don't you jump a step of that list ๐
- Set goal way out of own ability: code arma 4 in sqf
- Try object init: executeArma4.init();
- Doesnt work
- Go to discord and ask Lou to write the script for you.
plz halp. this is not working:
{
_x disableAI โAUTOCOMBATโ;
} forEach (allUnits select {playerSide isEqualTo side _x});
Is playerSide a command?
well at least this works
Ah okay, unfamiloar with it
{
addSwitchableUnit _x;
} forEach (allUnits select {playerSide isEqualTo side _x});
The code is fine then
error, invalid number in expression, for autocombat
hmm its not throwing any errors ```sqf
if (isServer) then
{
while {alive Radio} do
{
playSound3D ["\sounds\Dirge.wav", Radio];
sleep 263;
};
};```
i think my file adress is wrong
@winter rose sorry to be a pain can i get a hand with this
Guys hello, recently i've tried to make a sequence of 3 animations i've put them into an sqf file and made a trigger do the job, the problem is that the unit only do one animation.
Inside SQF file:
bot1 switchMove "acts_millerChooper_in";sleep 3.966;
bot1 switchMove "";
bot1 switchMove "acts_millerChooper_loop";
sleep 23.100;
bot1 switchMove "";
bot1 switchMove "acts_millerChopper_out";
sleep 3.599;
bot1 switchMove "";
bot1 switchMove "acts_millerChooper_in"; #sleep 3.966;
bot1 switchMove "";
bot1 switchMove "acts_millerChooper_loop";
sleep 23.100;
bot1 switchMove "";
bot1 switchMove "acts_millerChopper_out";
sleep 3.599;
bot1 switchMove "";``` you didnt space the sleep perhaps
hold up le me check
at first i did spaced, but it still happened
now das weird
(spacing should not matter; you can write ;player setDamage 1;hint "OK";)
do you use execVM?
yep, i used it in the trigger
the 1st animation the unit did, but the 2nd freezed and at the 3rd it did the correct animation
at the beginning i thought it was because of the loop timming from sleep command but then i've added the correct time wich is "23.100" and it still happened
does the animation "loop" have something to do with it ?
bot1 playMove "acts_millerChooper_in";
sleep 3.966;
bot1 playMove "";
bot1 playMove "acts_millerChooper_loop";
sleep 23.100;
bot1 playMove "";
bot1 playMove "acts_millerChopper_out";
sleep 3.599;
bot1 playMove "";``` tested
it works
the 3 animations ?
yup
ok, i will copy it and test it out
il show you jump to genral chat
copy that
if (isServer) then
{
while {alive Radio} do
{
playSound3D ["sounds\Dirge.wav", Radio];
sleep 263;
};
};```
little help anyone this isnt throwing an error and isnt playing the audio
nearestObjects [player, ["house"], 200]; <-- how would i loop over this and get random positions inside the houses?
private _houses = <this ^>;
{
// get random pos code here
} forEach _houses;
your above code :p
getPosATL _x?
he means AI positions inside the house
well..
IM going to bed
is there a way to completely randomization player locations, and spawn them anywhere over land?
maybe
_randomPosMapNoWater = [] call BIS_fnc_randomPos;
And yea i mean random spawn also insdie the house
private _houses = nearestObjects [player, ["house"], 200];
{ systemChat format['%1', getPosATL _x] } forEach _houses;
This gives me 3 positions back (from the houses i manually placed in VR, which works fine but i also want inthose houses a couple locations for loot or AI
thats pretty much what Im looking for, thanks a lot
np, glad i can help someone instead always asking for help ๐
_randomPosMapNoWater = [nil, ["water"]] call BIS_fnc_randomPos;
in this script would "water" just be water if it is a trigger instead of a marker?
See the Biki; those are keywords ;-)
