#arma3_scripting

1 messages ยท Page 695 of 1

somber radish
#

ooh

robust tiger
#

I'm afraid you'll have to redefine it

somber radish
#

@austere nimbus Where would you place it?

little raptor
somber radish
#

Why?

little raptor
#

as you said it yourself,

Fires locally

#

init.sqf works too

somber radish
#

Yeah, would it not register the event when on Initserver?

little raptor
#

if you want it to trigger for dedicated server and headless clients as well

little raptor
somber radish
#

Ok so it works different than killed EH?

#

Killed registers all killed units but fires only on server. But RemoteExec allows you to send whatever commands you want where u want

little raptor
#

well first of all, killed EH is an object event handler, not mission
second of all, it takes local arguments

somber radish
#

Yup

#

tested

little raptor
#

it should fire on wherever the object is local (if added there)

little raptor
somber radish
#

Hmm,

#

I belive it wasnt

little raptor
#

in MP you should just use MPKilled
it fires for everyone

somber radish
#

but ill do some more testing to be sure

copper raven
somber radish
#

Actually

#

yes

#

I had a MissionEH registering buildingCHanged

#

spawned in by local client

#

The mission EH fired when those building got destroyed on a dedicated server

copper raven
somber radish
#

I just like to have the server do as much as possible to not rely too much on Unreliable clients

little raptor
lucid meteor
#

when im making ORBAT and opening it, i have black screen or only ceiling(HQ and etc.) without subordinates, how do i fix it?
when its black screen i get error with BIS_fnc_ORBATOpen, when there are no subordinates its BIS_fnc_ORBATAnimate

willow hound
#

Yes

#

correct spelling

real tartan
#

@velvet merlin any note on this?

manic radish
#

ive made an array of area markers placed in the editor, however its giving the error "undefined variable CRCK_unsafeLand = [|#|water1...", and also "missing ]", any ideas why?

CRCK_unsafeLand = [water_1,water_2,water_3,water_4,AF_safe_zone,border_1,border_2,border_3,border_4];
willow hound
#

Markers are always identified by strings.

manic radish
#

ahh, thx

#

ill try that

#

that worked, thanks

little raptor
manic radish
#

Ive written this script to spawn a random group from an array

_grpCfg = selectRandom CRCK_groupsGR;//array of group configs
_grp = [_pos,EAST,(_grpCfg)] call BIS_fnc_spawnGroup;

however it gives this error and doesnt spawn the group (the error is in the spawngroup function sqf file itself), what have I done wrong?
...= getNumber(configFile >> "CfgCehicles" |#|>> _type >> "isMan == 1;"

hallow mortar
#

That shows the error position but what kind of error does it say it is?

frigid mountain
#

sorry, i'm new at scripting, but whenever i activate the trigger, i get the error "Script scriptname.sqf not found"

hallow mortar
frigid mountain
hallow mortar
frigid mountain
#

0 = [] execVM "scriptname.sqf";

hallow mortar
frigid mountain
#

yes, i have file extensions turned on

#

its the same name in the mission folder as it is in the on act field

hallow mortar
# manic radish generic error

it might be helpful to see the rest of the script file to see what it's actually doing, but I have some doubt about the use of "isMan == 1;" in a configFile command. I also think it would help if you spelled it cfgVehicles instead of cfgCehicles

hallow mortar
manic radish
# little raptor most probably _grpCfg is not what it should be

im using this to create the array, I dont think there is anything wrong with it because it seemed to work earlier

CRCK_groupsGR= 'true' configClasses (configfile >> "CfgGroups" >> "East" >> "O_USSR" >> "Armored");//selects all groups that are not air groups
CRCK_groupsGR pushBack ('true' configClasses (configfile >> "CfgGroups" >> "East" >> "O_USSR" >> "Artillery"));
CRCK_groupsGR pushBack ('true' configClasses (configfile >> "CfgGroups" >> "East" >> "O_USSR" >> "Infantry"));
little raptor
#

use append

#

instead of pushback

frigid mountain
manic radish
# little raptor instead of pushback

thanks, that was it, it seemed to work earlier because when sent the array in a hint to check it, it looked normal cause I didnt notice the extra [] and I thought it was just reaching the max size for a hint

hallow mortar
little raptor
#

it won't work yes

#

but no errors

little raptor
#

it just gives you configNull

manic radish
#

not my script

#

I mistyped it cause i cant post images here

hallow mortar
frigid mountain
#

yeah, that was the issue

#

there were two different folders with the same name,

little raptor
frigid mountain
#

just one had the tilde and the other didn't

little raptor
hallow mortar
#

Arma will read from the folder that has exactly the same name as the mission (because the folder name determines the technical mission name) so if you put it in the one that doesn't match, it obviously won't see it

manic radish
frigid mountain
#

yeah, that fixed it

#

thanks

hallow mortar
valid abyss
#

Hello, how do i use Addon builder in arma 3 tools?

warm hedge
#

#arma3_scripting might not be the best place to ask but still, what do you mean? What's unclear?

valid abyss
#

How to use it, what do i do to publish an addon?

warm hedge
#

And what is your knowledge so far?

valid abyss
#

Pretty much nothing

#

Are there any videos or forum topics you can link?

warm hedge
#

First step: Never refer videos.
Second step: No, not really. Since this is really the very very basic step... Let me write some code for you just to show an example

elfin comet
#

(Link for context)
#arma3_scripting message
If any one can help I do still need help with getting my AI Co-pilot to talk in Vehicle chat.

I have tried having the variable of the co-pilot be the one in the command but it still makes the pilot talk instead. and if i remove the vehicle from vehicle playerHeliCo vehicleChat "Stuff being said";, it skips the line entirely.

warm hedge
#

A vehicle doesn't speak after all. So you must be done something wrong

lucid meteor
#

Is ORBAT scripting or config?

warm hedge
#

Config

elfin comet
warm hedge
#

Who is the playerHeliCo? Make sure you put into the correct one

willow hound
elfin comet
willow hound
#

You are using the command correctly though; it just can't do what you are looking to do.

warm hedge
#

Are you sure? Make sure it points not the vehicle

willow hound
elfin comet
warm hedge
#

Ah, that's not what I'm aware

#

I thought it always behaves like any other chat commands...

willow hound
#

Yea I've been there too ๐Ÿ™‚

radiant siren
#

QUESTION:

I am trying to have the AI play an animation when they are not moving, walking, running, etc. So when they are static and not following player or waypoint, want them to play an animation. I know I can do switchMove then cancel it when I want them to move to a waypoint and have them play animation again. Just seeing if it's possible to do so all the time instead? If this makes sense haha

I have tried this:

if (this doFollow player) then {[this, ""] remoteExec ["switchMove", 0]} else {[this, "LIB_LCVP_Cargo_0"] remoteExec ["switchMove", 0]};

nothing happens though? follows player but no animation. (still new to scripting, be gentle please haha)

cold pebble
past wagon
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
west grove
#

hmm. i have a bit of a logic problem. i am check if the player is out of ammo via sqf (player ammo primaryWeapon player == 0) && (count magazines player == 0) the problem is, if the player has only 1 mag in his inventory and then reloads his weapon .. for a very short moment the condition is true (taking mag from the inventory while slowly reloading the rifle). i have no idea how i could get around that.

past wagon
#

it might not fix your problem perfectly, but it could help

west grove
#

i'm not sure how removing the magazines helps?

past wagon
#

it makes sure that the player wont get through the check and still have magazines after

west grove
#

well, removing their last magazine is not a good solution ๐Ÿ˜„

past wagon
#

yeah

#

depends on your priorities

west grove
#

no, it simply looks bad ๐Ÿ˜„ hud says you have 1 mag left, you press reload to reload and suddenly the magazine disappears. that's really not a solution.

robust tiger
#

Can you do the check after the weapon is loaded?

west grove
#

best would be to somehow add a delay and do a second check. but need to think of how to implement that into my fsm

somber radish
past wagon
#

if I have an array of players called _playerArray, can I do something like this to get the players from both sides?

_bluforPlayerArray = _playerArray west;
#

I know you can do this:

_bluforPlayerArray = units west;

and units returns an array, so

west grove
#

ok, found a workaround for my problem. i am using the reloaded event handler to check if the player is out of mags. if yes, i'm setting a variable. then later in my fsm i just have to check if that variable is true & the weapon is empty. done. player can't pick up new mags inbetween, so that's a good enough solution for me.

robust tiger
past wagon
#

wait

#

nevermind

#

i will just do it that way

past wagon
past wagon
somber radish
wide fulcrum
#

Whats the best way to script an explosion

drifting portal
robust tiger
past wagon
#

whats the problem here? im not getting any errors.

while { west countSide allPlayers < 1 or east countSide allPlayers < 1 } do {
    ["WAITING FOR PLAYERS", 0, 0, 1, 0, 0] remoteExec ["BIS_fnc_dynamicText"];
    sleep 1;
};
spark turret
#

does addMagazine work for dedicated? it says global effect, but why does addMagazineGlobal exist then?

little raptor
past wagon
#

oh

#

i think i know lol

#

the y coord I put in is off the screen

little raptor
#

but it misses a syntax

past wagon
little raptor
#

why do you start with inits all the time? meowsweats

little raptor
#

see if

["WAITING FOR PLAYERS", 0, 0, 1, 0, 0] call BIS_fnc_dynamicText;

works at all

past wagon
#

well that was weird

#

there was a "Generic Error in Expression" right before the sleep command

#

so I re-did the indentation and now it works fine

#

thanks

little raptor
#

that's why

past wagon
#

then I basically re-typed that line of code and it worked fine

#

in the console

#

but now its still not working in game

#

this is so weird

#

it still says generic error in expression right before the sleep command

#

but its also working

#

but it wont work in game

robust tiger
#

are you running it in scheduled environment?

past wagon
#

yes

#

initServer

#

but if someone could explain the difference between scheduled and unscheduled, that would be great because im still kind of confused about that

little raptor
past wagon
#

I did

#

it works fine

#

wait

past wagon
#

does sleep not work in an unscheduled environment?

little raptor
#

unscheduled = no suspension = execute everything at once

past wagon
#

but it will still take a while loop?

little raptor
#

while doesn't have sleep

#

waitUntil does
so that one doesn't work

past wagon
#

yeah

#

yeah

#

well I need it to work in initServer

#

which it doesnt appear to be

little raptor
past wagon
#

its working now

#

that whole thing was inside a while loop which i forgot to close off

#
while { true } do {
    sleep 10;
    while { west countSide allPlayers < 1 or east countSide allPlayers < 1 } do {
        ["WAITING FOR PLAYERS", -1, -1, 1.1, 0, 0] remoteExec ["BIS_fnc_dynamicText"];
        sleep 1;
    };

the code in initServer looked like this

#

I assumed the error was inside the smaller loop so I only tested that part ๐Ÿ˜ฌ

wide fulcrum
#

@robust tiger will that work? will it go off?

#

or will it just sit there

robust tiger
#

it ought to

wide fulcrum
#

ok, ive never done it so

robust tiger
#

thats how you made IEDs back in arma 2

#

some examples

#

For instance:

"Bomb_04_F" createVehicle (getpos player)
#

Try this in the debug console and unpause the game ๐Ÿ™‚

past wagon
#

will a local variable keep its value through different iterations of a while loop?

robust tiger
#

unless you redefine it?

#

Could you post an example of what you mean

past wagon
#

yeah

#
while { true } do {
  if ( count allPlayers == 3 ) then {
    _number = 10;
    systemChat str _number;
  };
};

would _number ever return nil?

#

wait

#

one sec

#

yeah idk lol

#

nevermind, I guess. I was just curious, but it seems like it will never be possible since the loop repeats, so whenever the variable is used it will be re-defined

#

so it doesnt matter

robust tiger
#

outside of the if scope it should "return nil"

past wagon
#

yeah

#

i guess my question doesnt really make sense

robust tiger
#

so they don't wander in military bases and such, perhaps?

drifting portal
#

maybe

#

wish wiki explained it

#

thanks

hallow mortar
#

So I have this in initServer.sqf:

vehNATO_AH2 setObjectTextureGlobal [0,"\a3\air_f\Heli_Light_01\Data\heli_light_01_ext_ion_co.paa"];๏ปฟ
vehNATO_AH2_1 setObjectTextureGlobal [0,"\a3\air_f\Heli_Light_01\Data\heli_light_01_ext_ion_co.paa"];```
the first line works as expected, textures the helo, all good.
Then it throws a script error, `Invalid number in expression`, placing the error location at the end of the first line. Consequently the second line doesn't happen.

Now...I can't see what's wrong here. Variable names are correct, the commands are otherwise identical, syntax seems correct.
#

Found it. Apparently when I copied the command from the BI forum, it picked up an invisible character at the end of the line that was somehow ruining everything

past wagon
#

I need an array of a unit's loadout for my code. how can I get it easily and copy paste it?

copper raven
#

copyToClipboard str getUnitLoadout _unit?

past wagon
#

thanks!

#

wait

#

doesnt seem to be working

#

where do I execute that?

unreal scroll
#

@past wagon Console - Exec locally.

past wagon
#

I did

unreal scroll
#

And? What your clipboard contains then?

past wagon
#

what it did before

#

something irrelevant

unreal scroll
#

Did you defined the _unit? ๐Ÿ™‚

past wagon
#

yeah it has a different variable name but I changed it

unreal scroll
#

Then just do getUnitLoadout _unit and copy the output from the console.

past wagon
#

I didnt get any errors

#

I tried that

#

and it didnt give me any output

unreal scroll
#

Can you show me your code?

past wagon
#

sure

#

the unit's name is LOADOUT

#
copyToClipboard str getUnitLoadout LOADOUT;
unreal scroll
#

So, when you type LOADOUT in your console - what do you get?

past wagon
#

nothing happens

unreal scroll
#

Then this is not a unit name. Check again.

past wagon
#

wait

#

yeah i deleted the unit

#

let me put it back

#

still nothing happens when I exec LOADOUT into the console

#

this is supposed to be done in the editor, right? not in game?

unreal scroll
#

You need to load the level, not in the editor mode

past wagon
#
[["srifle_DMR_03_F","","","optic_Arco_blk_F",["20Rnd_762x51_Mag",20],[],""],[],[],["U_C_Driver_1_red",[["FirstAidKit",2]]],["V_PlateCarrier1_blk",[["SmokeShellRed",2,1],["HandGrenade",1,1],["20Rnd_762x51_Mag",9,20]]],[],"H_RacingHelmet_1_red_F","",["Binocular","","","",[],[],""],["","","","","","NVGoggles_OPFOR"]]
#

there we go

#

lol

unreal scroll
#

Hmm... Put every array element from the first level at the new line, it should become more readable.

#

But it is better to use dictionary/hashmap.
Name keys as elements of equipment, and fill values.

past wagon
#

im still confused

#

when you say first level, you mean the first line that appears in the discord message?

unreal scroll
#

Like

_loadout = createhashmap;
_loadout set ["uniform",//put uniform loadout here];
...

Then, if you need to restore:

_unit setunitloadout [_loadout getOrDefault ["rifle",""],...];
past wagon
#
[["srifle_DMR_03_F","","","optic_Arco_blk_F",["20Rnd_762x51_Mag",20],[],""],[],[],["U_C_Driver_1_red",[["FirstAidKit",2]]],
unreal scroll
#

See, in this case you have an array of loadouts (I suppose) that consists of one element.
That element starts from "srifle_DMR_03_F" - it is located on he same level (I can mess with english terms) as, say, "optic_Arco_blk_F" or ["20Rnd_762x51_Mag",20] elements. But "20Rnd_762x51_Mag" element located "deeper".
Every element on the frst level represents the loadout element - primary weapon, handgun, launcher, uniform, backpack and so.
But, for example, uniform is the container, and it is represented as an array, that consists of other elements.
P.S. I can mess with loadout structure, writing just by memory.

past wagon
#

k

#

so

#
[
    ["srifle_DMR_03_F","","","optic_Arco_blk_F",["20Rnd_762x51_Mag",20],[],""],[],[],
    ["U_C_Driver_1_red",[["FirstAidKit",2]]],
    ["V_PlateCarrier1_blk",[["SmokeShellRed",2,1],["HandGrenade",1,1],["20Rnd_762x51_Mag",9,20]]],
    [],"H_RacingHelmet_1_red_F","",["Binocular","","","",[],[],""],["","","","","","NVGoggles_OPFOR"]
]

how does this look

astral dawn
#

Looks strange. Think of you array like it's a hierarchy. Put a new line after each element of first level. Then it will make sense. ๐Ÿคทโ€โ™‚๏ธ

unreal scroll
#

"Think of you array like it's a hierarchy."
I don't think you made it clearer for him ๐Ÿ˜

@past wagon As for me, I like compact view ๐Ÿ™‚
If it is poor readable, comment lines:

[
    ["srifle_DMR_03_F","","","optic_Arco_blk_F",["20Rnd_762x51_Mag",20],[],""], // Primary weapon
    [], // Launcher
    [], // Handgun
    ["U_C_Driver_1_red",[["FirstAidKit",2]]], // Uniform
    ["V_PlateCarrier1_blk",[["SmokeShellRed",2,1],["HandGrenade",1,1],["20Rnd_762x51_Mag",9,20]]], // Vest
    [], // and so...
    "H_RacingHelmet_1_red_F",
    "",
    ["Binocular","","","",[],[],""],
    ["","","","","","NVGoggles_OPFOR"]
];

But, as I said, good data structure is the key. I think dictionary is the best way if you want to USE it.
If you need to READ it - then you can use the format above.

astral dawn
#

"Think of you array like it's a hierarchy."
well, we have an array of elements, each element is another array with its own amount of elements. Ignore how each subarray is structured, just put a newline after every subarray. Then you can treat each subarray same way if needed, but add one more tab every time you go one level down. That's the general way to go with such weird arrays.

past wagon
#

ok it makes sense now

#

it was just pretty overwhelming

#

thanks guys

cosmic lichen
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
desert palm
#

yes ive done that ending with a ; but in only spawns the array that is below

warm hedge
#

R3vo meant you SHOULD apply the format as the bot shown

desert palm
#

oh sorry

#

It only seems to spawn the ones in the BRAVO spawn target

warm hedge
#
^don't forget to place sqf before
#

Also this code doesn't spawn anything it seems

#

No

#

If you can't post here directly just use sqfbin

desert palm
#

ok i will search for it

#

this is the whole script I am wanting to add another spawntarget in a different location hence the ALPHA target that i added but it only seems to obey the bravo target

cosmic lichen
#

Can you please post it with highlighting?

desert palm
#
_Spawntarget = BRAVO; 
_Spawndistance = 200;
_Deletedistance = 1000;
_Spawngroups = [
 (configfile >> "CfgGroups" >> "East" >> "rhsgref_faction_chdkz" >> "rhsgref_group_chdkz_insurgents_infantry" >> "rhsgref_group_chdkz_insurgents_squad")
];

_Spawnmaxdelay =5;
_Spawnavgdelay =10;
_Spawnmindelay =15;
_Spawnside = OPFOR;

_AISkills = [
 ["aimingShake", 0.2],
 ["aimingSpeed", 0.2],
 ["endurance", 0.5],
 ["spotDistance", 0.5],
 ["spotTime", 0.5],
 ["courage", 1],
 ["reloadSpeed", 0.5],
 ["commanding", 1],
 ["general", 0.5]
];

while {true} do { 
 _SpawnPosistion = _Spawntarget getRelPos [_Spawndistance, round random 360];
 _NewGroup = [_SpawnPosistion, _Spawnside , _Spawngroups select (floor (random (count _Spawngroups)))] call BIS_fnc_spawnGroup;

 _NewGroup setVariable ["spawned",true];

 {
  _EditUnit = _x;
  {_EditUnit setSkill _x;} forEach _AISkills;
 } forEach units _NewGroup;

 _NewGroup setBehaviour "AWARE";
 _NewGroup setSpeedMode "FULL";
 _NewGroup setCombatMode "RED";

 _GroupWayPoint = _NewGroup addWaypoint [position _Spawntarget, 0];
 _GroupWayPoint setWaypointType "MOVE";

 {
  _EditGroup = _x;
  for "_i" from count waypoints _EditGroup - 1 to 0 step -1 do  { deleteWaypoint [_EditGroup, _i];};
  _NewGroupWayPoint = _EditGroup addWaypoint [position _Spawntarget, 0];
  _NewGroupWayPoint setWaypointType "MOVE";
  {
   if (_Spawntarget distance _x>_Deletedistance) then {deleteVehicle _x;};
  } forEach units _EditGroup;
 } foreach (allGroups select {side _x == _Spawnside && (_x getVariable ["spawned",true])});

 sleep (random [_Spawnmindelay,_Spawnavgdelay,_Spawnmaxdelay]);
};```
#

Oh like this im sorry

robust tiger
desert palm
#

yes I think so, I think that it is the way I made the sqf because this one is the original and I want to run the ai again in a different spawn marker

#
_Spawntarget = ALPHA; 
_Spawndistance = 200;
_Deletedistance = 1000;
_Spawngroups = [
 (configfile >> "CfgGroups" >> "East" >> "rhsgref_faction_chdkz" >> "rhsgref_group_chdkz_insurgents_infantry" >> "rhsgref_group_chdkz_insurgents_squad")
];

_Spawnmaxdelay =30;
_Spawnavgdelay =40;
_Spawnmindelay =50;
_Spawnside = OPFOR;

_AISkills = [
 ["aimingShake", 0.2],
 ["aimingSpeed", 0.2],
 ["endurance", 0.5],
 ["spotDistance", 0.5],
 ["spotTime", 0.5],
 ["courage", 1],
 ["reloadSpeed", 0.5],
 ["commanding", 1],
 ["general", 0.5]
];

_Spawntarget = BRAVO; 
_Spawndistance = 200;
_Deletedistance = 1000;
_Spawngroups = [
 (configfile >> "CfgGroups" >> "East" >> "rhsgref_faction_chdkz" >> "rhsgref_group_chdkz_insurgents_infantry" >> "rhsgref_group_chdkz_insurgents_squad")
];

_Spawnmaxdelay =30;
_Spawnavgdelay =40;
_Spawnmindelay =50;
_Spawnside = OPFOR;

_AISkills = [
 ["aimingShake", 0.2],
 ["aimingSpeed", 0.2],
 ["endurance", 0.5],
 ["spotDistance", 0.5],
 ["spotTime", 0.5],
 ["courage", 1],
 ["reloadSpeed", 0.5],
 ["commanding", 1],
 ["general", 0.5]
];```
#

and this is what i done now that only spawns the bravo

cosmic lichen
#

This script looks familiar

desert palm
#

yes i saw it on youtube from Dayzmedic

cosmic lichen
#

Where did you get it?

#

Ah ok

robust tiger
#

Aaah, are you executing it like that? I think you're overwriting your variables, so only the last one gets through

desert palm
#

How do I fix that? I made it in the missions file folder

robust tiger
#

The simplest crude way is to copy-paste the spawn code in-between the _spawnTargets. So it would be: Define stuff for ALPHA -> spawning script -> define stuff for BRAVO -> spawning script

#

or you could put in a function

desert palm
#

like this?

_Spawntarget = ALPHA, BRAVO; 
robust tiger
#

you might wanna be careful, since you have no terminating condition, they will spawn indefinitely

#

Oh right it's a loop

desert palm
#

Oh ok ill give it a try

robust tiger
#

If you want the indefinite spawning, I recommend to call THAT script from outside with another script which would be timed

desert palm
#

Sadly they still go to one point :<

#

ill try to add multiple sqf and call on them via trigs

desert palm
#

So i tried to make individual sqfs for different targets

#

now the issue is when a composition spawns on alpha the one on bravo will be deleted

ocean orchid
#

Do people here know if the vehicle customization is just saved as a variable on the vehicle itself or if there's a function for getting it? I can't seem to find a function on the biki but I may just not know what I need to look for.

finite sail
#

@ocean orchid , this function was given to me

#

I dont claim to know how it works, lol

#

or that its exactly what you want

willow hound
# desert palm now the issue is when a composition spawns on alpha the one on bravo will be del...

This code is a mess to read and work with, but either way:
Both scripts, the one running for Alpha and the one running for Bravo (it should really only be one script with a parameter for _spawnTarget, but we all have to start somewhere) apply the despawn code on the same set of groups, but with different _spawnTargets that the distance is calculated to.
So the Alpha script will also check the distance of groups spawned by the Bravo script and then delete them if they are too far from Alpha; vice versa for the Bravo script.

finite sail
#

hang on, @ocean orchid , i'll put it in pastebin

cosmic lichen
#
{
  diag_log "#### ARGUMENT (0): _obj doesn't exist";
  _colour = "Unknown";
};```
Just "Unknown"
finite sail
cosmic lichen
#

@finite sail The exitWith is incorrect

finite sail
#

is it?

cosmic lichen
#

You return nil

finite sail
#

ah yes

#

i think the calling script copes with that

#

but yes, its not ideal

#

blame pierreMGI.. he wrote it ๐Ÿ™‚

#

i added disclaimer above ๐Ÿ™‚

ocean orchid
#

Thanks a bunch!

finite sail
#

welcome mate

trim sentinel
#

Can I customize their Arsenal per role? Say I want the SL to have extra things in the Arsenal a rifleman wouldnโ€™t

willow hound
#

Yes, but it's a terrible hassle.

trim sentinel
#

That sucks, what would be an alternative way

#

Iโ€™ve tried to think of alternatives but canโ€™t

#

I need to stop people from grabbing snipers who arenโ€™t snipers etc

robust tiger
#

If they have a disallowed weapon, you delete it after they close the arsenal, in theory

trim sentinel
#

I wonder could I lock arsenals per squad

#

Like each role has their own Arsenal and they canโ€™t use any but theirs

#

Then I can just customize the weapons inside

robust tiger
willow hound
#

I told you, either way it's a tremendous amount of work.
You can write whitelists with all the items allowed and then only add the whitelist corresponding to the player's role to the Arsenal (Arsenals are local) -- that requires writing huge whitelist arrays that include every single item you want available.
You can write blacklists that take away items the player is not supposed to have when the Arsenal is closed -- but that too requires writing blacklist arrays (though you might be able to save some work by using isKindOf to blacklist a selection of items that all share a common superclass).

robust tiger
#

you might wanna disable the load button too

willow hound
#

I once created such a system for Invade & Annex 3, you can check that out to see how I did it there.

desert palm
#

in what part will i insert that

#

apologies I do not know much about this

willow hound
#

The parameter? It would not solve the problem of Alpha deleting Bravo's groups and vice versa. Do you want to know anyways?

finite sail
willow hound
#

Explaining is not the big deal, the whitelists / blacklists are.

finite sail
#

yep, but the having to explain is another reason not to do blacklists

#

because the side or faction isn't stored anywhere in weapon/ammo config, it's a massive PITA

#

You can sort of do something using gettext "author" if you want to exclude all RHS, for example

#

but thats the only part of this thats easy

desert palm
willow hound
#

It's not much that needs to be changed:
Change the first line (_Spawntarget = BRAVO;) to params ["_spawnTarget"];.
Then when you want to run the script for the Alpha group, you do it like this: [Alpha] execVM "MyScript.sqf";. To run it for Bravo, use [Bravo] execVM "MyScript.sqf"; and so on.

desert palm
desert palm
#

im sorry im just new w this scripting thing

willow hound
#

Yes, that is correct.
Just make sure you use the actual name of the file instead of MyScript.sqf.

desert palm
#

yes spawnbaddies.sqf

willow hound
#

Oh, you forgot a ; after params ["_spawnTarget"] ๐Ÿ™ƒ

desert palm
#

how will i know to spawn the params?

#

if it is not marked by a name

willow hound
#

Sorry, what do mean?

desert palm
#

i named the spawned target as alpha because in game i set a marker for when the ai spawn they will go to the target

willow hound
#

I still don't understand your question, sorry.

desert palm
#

_Spawntarget = ALPHA; Is named ALPHA/BRAVO because the Ai will spawn around the alpha/bravo marker if i replace it with params ["_spawnTarget"]; where will the ai spawn?

spark turret
#

how do i get a new array instead of its pointer ?
_arr = _loadout select 0; //returns pointer

warm hedge
#

Pointer?

robust tiger
#
_arr2 = +_arr

creates a copy

spark turret
#
_arr = _loadout select 0; //returns pointer
_arr insert [0,"uwu"]; //will modify loadout array too
spark turret
willow hound
desert palm
#

there is an error can i dm the screen shot to you?

#

i cannot copy and paste it sadly

willow hound
desert palm
#

copy wait one

warm hedge
#

_params is not a command but params

dreamy kestrel
#

Hmm... how much of a performance hit is it when you start populating "proxy" objects i.e. grass cutters with a lot of public variables.
According to this article... https://community.bistudio.com/wiki/Arma_3:_Simple_Objects#Performance
Multiply that by dozens of potentially public variables, over dozens of such proxy objects...
Rethinking whether that is such a great idea after all.

desert palm
#

oh where will I put the params

#

oh ok

dreamy kestrel
#

Really what I need is an up to date Arma Scripting Profiler to help me see what may be killing my FPS during this transitional consideration, but that is a separate subject.

smoky rune
#

Is there any way to recompile custom GUI (.hpp files) without mission reloading?

warm hedge
#

Save the mission in Eden Editor. Also test in Eden Editor workspace is a better way to debug

smoky rune
#

Also test in Eden Editor workspace is a better way to debug
You mean that a way to create dialog in EDEN environment exist?

smoky rune
#

It really works, thanks for info

willow hound
drifting portal
#

is there any possible way to change a players fov using commands? (such as the zoom in and out effect which can be helpful for certain offline missions scenes)

desert palm
#

Omg thank you @willow hound it worked thank you very much โค๏ธ

dreamy kestrel
dreamy kestrel
robust tiger
dreamy kestrel
dreamy kestrel
#

I learned this the other day, SQF ternary statement:

// _condition is BOOL
// _trueVal and _falseVal are ANY
if (_condition) then { _trueVal; } else { _falseVal; };

This also works fantastically:

[_falseVal, _trueVal] select _condition;
#

Since there's not truly a ternary operator, but that's pretty concise.

desert palm
willow hound
#

That is true.

#

How much of the code that handles the deleting do you understand?

fair drum
#

unless, you could force a keydown on a player, then you could use the built in zoom function, but I don't think that's possible either.

desert palm
little raptor
little raptor
fair drum
willow hound
#

The zoom is applied before rendering

little raptor
#

or should I say before it

fair drum
#

I see, the more ya know!

willow hound
#

You can notice some geometries / LODs changing when you zoom; plus, if it was only a zoomed in version of the rendered frame the resolution would suffer accordingly

real tartan
#
    if ( ceil ( time % 10 ) isEqualTo 0 ) then 
    {
      // every 10 seconds do stuff ?
    };

is this correct ?

still forum
#

// every 10 seconds do stuff ?
But what if you condition executes twice in the same second

little raptor
#

also technically it's not "Every 10 seconds"

still forum
#

if it executes at 9.00001 and 9.5

little raptor
#

(or just sleep/uiSleep if it's scheduled)

real tartan
#

extending a bit code for clarification ...

while { condition } do 
{
  // run stuff

  if ( ceil ( time % 10 ) isEqualTo 0 ) then 
  {
      // do stuff every 10 seconds without use of timer
  };

  // run stuff

  sleep 1;
};
#

does it make sence ?

little raptor
#

anyway, like I said, use a timer

#
_nextRun = time + 10;
while { condition } do 
{
  // run stuff

  if ( time > _nextRun ) then 
  {
      // do stuff every 10 seconds without use of timer
      _nextRun = time + 10;
  };

  // run stuff

  sleep 1;
};
#

unless you have something else after the loop, just use sleep 10

willow hound
# desert palm technically non

After a group is spawned, a little custom marker variable is set on that group to mark it as one of the groups spawned by the script:

...
_newGroup setVariable ["spawned", true];
...
```Then the `forEach`-loop comes (I reformatted it and fixed a small error), that's where the deletion happens:
```sqf
{
  _editGroup = _x;
  ... // <-- Some waypoint stuff
  //Delete stuff:
  {
    if (_spawnTarget distance _x > _deleteDistance) then {
      deleteVehicle _x;
    };
  } forEach units _editGroup;
} forEach (allGroups select {side _x == _spawnSide && (_x getVariable ["spawned", false])});
```Let's examine the outer `forEach`-loop:
It iterates over the array that results from `allGroups select {side _x == _spawnSide && (_x getVariable ["spawned", false])}` - that array contains every group `_x` in the mission that satisfies these two conditions: `side _x == _spawnSide` and `_x getVariable ["spawned", false]`.
The purpose of that second condition (and of the marker variable) is to prevent the script from deleting groups that were not spawned by the script, groups that you placed in the Editor for example. Very simple: Groups that were spawned by the script have the marker variable, groups that were not spawned by the script do not have the marker variable.
In conclusion, the outer `forEach`-loop determines which groups will be *considered* for deletion: All groups that satisfy the two conditions.
These groups are then checked for their distance from `_spawnTarget`, and if a group is too far away it is deleted (actually the script checks and deletes every individual unit from the groups, but that's not important now).

Does that make sense so far?
I have not explained the actual problem yet, we'll get to that once you have some general understanding of what's going on.
desert palm
#

How can I apply the top part?

#

that marks the group that is spawned so it wont be deleted right?

willow hound
#

The purpose of that second condition (and of the marker variable) is to prevent the script from deleting groups that were not spawned by the script, groups that you placed in the Editor for example. Very simple: Groups that were spawned by the script have the marker variable, groups that were not spawned by the script do not have the marker variable.
The marker variable from the top part and the marker variable in this part are the same one.

desert palm
#

Yes, i added the edited bottom part to the sqf replacing the past one, where will i put the top script?

willow hound
#

It's the same code as the code you already had, it does not fix the problem yet, you don't need to put any of that code anywhere ๐Ÿ™‚

#

I'm trying to explain the problem before I fix it.
So, do you have some understanding of how the code currently works after reading that lengthy explanation above?

desert palm
#

yes you stated the functions and on what the code does :>>

desert palm
#

How can I apply that, been doing that yet no success it keeps on showing errors

dreamy kestrel
#

Q: can you render a HASHMAP a publicVariable? i.e.

private _player = ... ; // a PLAYER OBJECT
MY_map = createHashMap;
// populate map with stuff and ship it
owner _player publicVariableClient "MY_map";
willow hound
#

Alright, let's look at the problem then.
Let's say that at some point in time we have three groups in the mission:

Group A - Spawned by [Alpha] execVM "spawnbaddies.sqf";
Group B - Spawned by [Bravo] execVM "spawnbaddies.sqf";
Group E - Created in the Editor
And let's say that the processor is executing the forEach-loop inside [Alpha] execVM "spawnbaddies.sqf"; right now.

So what groups does that loop iterate over?
All groups that satisfy the two conditions explained earlier. We only have to look at the second condition (_x getVariable ["spawned", false]) for this example.
For group A, that condition is true (because A was spawned by spawnbaddies.sqf, the marker variable "spawned" is there).
For group B, that condition is true (because B was spawned by spawnbaddies.sqf, the marker variable "spawned" is there).
For group E, that condition is false (because E was not spawned by spawnbaddies.sqf, the marker variable "spawned" is not there).
That means that the outer forEach-loop ends up iterating over this array: [A, B].
Now remember, we are inside [Alpha] execVM "spawnbaddies.sqf"; right now, so _spawnTarget is Alpha.
In the next step, the processor takes each group inside the array [A, B] and checks how far that group is from Alpha.
And that is the problem: It also checks how far group B is from Alpha, even though group B was spawned for Bravo, not for Alpha. And if B is too far away from Alpha, well, then it gets deleted.

Does that make sense @desert palm?

desert palm
#

Yes that now i get it the code needs to satify the spawned ai and when it spawns it to not delete it because it read it in a way that it spawned and therfore marked

#

Geez thanks for this ๐Ÿ˜

#

The variable e is not in the file therefore it did not spawn unlike the other 2 that when the script called for the execvm it was there

willow hound
#

Oof krtecek

desert palm
#

Why it is what I understood in a nutshell

#

Im using my phone rn srry

#

When ai spawns on alpha the ones on bravo gets deleted because

#

I am having trouble on getting the right format for the script and on how to do it

willow hound
#

Don't worry about it.

#

No guarantees for good performance though, I didn't feel like rewriting the whole thing.

dreamy kestrel
#

Q: when you add an action, you can provide _arguments right, these are passed to the _script.
are the args available to the _condition at all?

willow hound
#

No.

dreamy kestrel
#

Hmm so you have to get creative, format a condition perhaps.

little raptor
dreamy kestrel
#

the only challenge with that in this instance, I've got the same action rinsed and repeated three times, Add XYZ capability to factory, either X or Y or Z, which conditions and event handlers need to also recognize

little raptor
#

(as in numbers, strings, and also nular commands)

dreamy kestrel
#

right, fair enough. thank you.

little raptor
#

@dreamy kestrel you can still use setVar and getVar tho:

_id = _target getVariable ["my_action_id", 0];

_condition = format ["_args = _target getVariable ['my_action_args_%1', []]; bla bla bla", _id];
_target addAction [...., _condition];
_target setVariable [format ["my_action_args_%1", _id], _args];
_target setVariable ["my_action_id", _id + 1];
#

this way you can have different args for different actions

past wagon
#

anyone know why this isnt working? the waitUntil is returning nil because _mapTrigger is undefined:

scenario = 1;
_mapTrigger = missionNamespace getVariable ( "mapTrigger" + str scenario );
waitUntil { ( units west inAreaArray _mapTrigger ) isEqualTo [] or ( units east inAreaArray _mapTrigger ) isEqualTo [] };

mapTrigger1 is the name of a trigger in the mission.

little raptor
past wagon
#

well scenario doesnt always equal 1

#

and there are different mapTriggers for each scenario

#

i did find a better way to do it though

#

so its not important, but if you see anything wrong with the code, lemme know

little raptor
#

just make a function

#

it seems to me that what you're doing is execute something when the units leave the trigger area
so just use a trigger, and execute the function from the On Deactivation statement

past wagon
fast pond
#

or better yet, missionNamespace getVariable ( "mapTrigger" + str 1 );

past wagon
fast pond
fast pond
# past wagon it does return mapTrigger1

I can't see any problems in your code. Try adding in a few systemChat commands to see what goes wrong where. Ex:

scenario = 1;
_mapTrigger = missionNamespace getVariable ( "mapTrigger" + str scenario );
systemChat str _mapTrigger;
waitUntil { ( units west inAreaArray _mapTrigger ) isEqualTo [] or ( units east inAreaArray _mapTrigger ) isEqualTo [] };
#

ah, idk then, good luck

past wagon
# fast pond I can't see any problems in your code. Try adding in a few systemChat commands ...

ive decided to use a different method that will also make a lot of other things easier. this my new code, but im still getting the same error as before:

_scenarioArray = selectRandom [
    [blueFlag1, redFlag1, mapTrigger1, 1],
    [blueFlag2, redFlag2, mapTrigger2, 2],
    [blueFlag3, redFlag3, mapTrigger3, 3],
    [blueFlag4, redFlag4, mapTrigger4, 4],
    [blueFlag5, redFlag5, mapTrigger5, 5],
    [blueFlag6, redFlag6, mapTrigger6, 6],
    [blueFlag7, redFlag7, mapTrigger7, 7],
    [blueFlag8, redFlag8, mapTrigger8, 8],
    [blueFlag9, redFlag9, mapTrigger9, 9],
    [blueFlag10, redFlag10, mapTrigger10, 10]
];
_scenarioArray params ["_blueFlag", "_redFlag", "_mapTrigger", "_scenarioNumber"];
waitUntil { ( units west inAreaArray _mapTrigger ) isEqualTo [] or ( units east inAreaArray _mapTrigger ) isEqualTo [] };
#

I think there must be a problem with the bottom line, but I have no idea what it is. you can ignore everything in the scenarioArray's besides mapTrigger1, etc....

fast pond
#

try replacing _mapTrigger with mapTrigger1 and see if it works. At least then you might be able to figure out if it is a problem with the variable or something else. I usually check for units in triggers with count, so I am not the best person to review that line of code.

past wagon
#

yeah good idea

#

thanks

#

its actually working now with this new method im using

#

thanks for the help guys

fair drum
#

there a dedicated command to find out if a unit is in water? I could always just do some asl checks if not.

fair drum
#

sigh... just tried using the emiter editor mod, it deleted every object in my scenario and then the autosave kicked in

unreal scroll
#

Sometimes my civilians try to swim to a nearest wp, even if it is on land.
Can swimInDepth command help in this case? Like _unit swimInDepth -0.5?

fair drum
#

i bet you what will happen is they will walk into the water till the depth you set, then path through the water where it can stand until it finds a path through it

desert palm
#

Hey @willow hound sorry i fell asleep it was late from im from, IT WORKS THANK YOU VERY MUCH BUD YOU THE BEST :>> :<3

#

thanks for teaching me the ropes as well it will definitely help :>

past wagon
#

if I did:

_vehicle setObjectTextureGlobal [0, "texture.paa"];
_vehicle setObjectTextureGlobal [1, "texture2.paa"];

then what would getObjectTextures _vehicle return?

torpid quartz
#

So if I had two triggers that both activated when their respected owner went inside them, but I only wanted one to go off and the other to get disabled when the first one goes off.

How would I do this? Have Part1 = true in both triggers activation and
This !& part1 in both of their requirements?

warm hedge
#

!& is not a thing. Use !(condition) method

warm hedge
gilded rover
past wagon
#

ok

#

what would be the best method to make all players invincible while they are in a certain area, but enable damage when they are not. I know many ways I could do this, i'm just wondering that since this is such a simple thing, there might be an easier way to do it that I'm not thinking of.

unique sundial
#

IMO {activateForceShield _x} forEach allPlayers is the best

past wagon
#

cant find that on the wiki, but im already using enableDamage. What im wondering about is the aspect of having it enabled under a certain condition and disabled under the other condition.

#

I cant think of any ways that wouldnt end up having redundancies and possible performance effects, using while true loops

unique sundial
#

Oh sorry I must have looked in Arma 4 wiki

past wagon
#

lol

#

I wasnt sure if that was a joke but I wasnt gonna ask

unique sundial
#

nah post your variants and weโ€™ll see which one is more efficient

past wagon
#

ok

desert palm
#

Is it possible to set the amount of ai that will spawn in and by waves? ex.Alpha 50 ai. Spawn in 10 ai when 8 are dead?

past wagon
#
//option 1
while { true } do {
  if ( player inArea "myMarker" ) then {
    player allowDamage false;
  } else {
    player allowDamage true;
  };
};

//option 2
while { true } do {
  while { player inArea "myMarker" } do { 
    player allowDamage false;
  };
  player allowDamage true;
};

//option 3
while { true } do {
  waitUntil { player inArea "myMarker" };
  player allowDamage false;
  waitUntil { player not inArea "myMarker" };
  player allowDamage true;
};
#

those are a few that I have thought of

warm hedge
#

It might be more complicated but easy to switch on off: use HandleDamage

past wagon
#

ok

#
player addEventHandler ["HandleDamage", {
  if ( player inArea "myMarker" ) then {
    0;
  };
}];
#

is that how I would do it?

warm hedge
#

Seems fine

#

Or, remove ; from the 0

past wagon
warm hedge
#

Should

#

Return value must be passed without ;

past wagon
#

ok

#

would that matter for this:

player addEventHandler ["InventoryOpened", {
    true;
}];

?

warm hedge
#

Yep

#

(AFAIK and IIRC)

past wagon
#

ok

#

thank you!

willow hound
gilded rover
#
while { player inArea "myMarker" == true } do 
{
  player allowDamage false;
};``` wouldnt this work too?
cyan dust
#

Good day. I'm struggling with placing USS Freedom during the mission with createVehicle. It always faces south and getting tilted (I guess the last part is dependent on position of placement or rather terrain slope underneath), have anyone solved such issue?

cyan dust
desert palm
gilded rover
warm hedge
gilded rover
past wagon
warm hedge
#

But == true is now a legit code now. It's possible but not mandatory, yes, though

cyan dust
warm hedge
#

Because it isn't really intended to be there for end users!

desert palm
gilded rover
desert palm
#

better question if, in the triggers if my activation script is [BRAVO] execVM "spawnbaddies.sqf"; what will i put in the deactivation if i want to deactivate this? (like if players were outside the trigger area the script will be deactivating)

#

how do i not execute ๐Ÿ˜

warm hedge
#

Depends on what spawnbaddies.sqf is

cyan dust
#

@warm hedge you're a life-saver, you know that? Thanks man

warm hedge
#

What do you mean? Lifesaver jacket must be worn if you're on a ship!

desert palm
#

it spawns ai to the target when the time value is met eg. every 5 mins

gilded rover
#

that depends , you can have a second script that just deletes all the units , but i would have the script check if the units are inside the area before spawning a new wave , by that you can just leave the deactivation empty unless you want to remove the wave completely

desert palm
#

its a script that i found of youtube from dayz medic and we've been making it work thanks to ansin. What it does is spawn dynamic ai randomly around a certain target and the waves of spawning in is controlled by time. Im wanting to change that to Ai count ex. maximun of 50 in target ALPHA that will spawn by groups of 8 when 4 of them gets killed it will spawn another 8 until the maximum of 50 is spawned.

this is the script: https://sqfbin.com/miqezopotaromexehori

desert palm
gilded rover
#

yeah i know , i'm, just saying you can either write another script , or do it in the deactivation or just leave it blank if you check in the activation if everyone is in the trigger area (pretty sure you can do that under the conditions)
Ill have a look later at this

warm hedge
#

Since it is while {true} loop, you can't stop it. In order to stop it, you can assign a variable there and make it false when the trigger decides to make the variable false, so it'll stop

desert palm
#

ohh so i will replace the while {true} but with what script can i do with it and how can i set the parameters to ai spawned and not by time

desert palm
gilded rover
desert palm
#

okie :>

gilded rover
#
count(allUnits select {side _x == east} inAreaArray Killhouse1)
``` let me look at that spawn code because this is going to bother me xD
desert palm
#

ok thanks haha

gilded rover
#

on line 60 try

sleep (<code i sent you> == 5);
``` instead and let me know
#

otherwise we are going to utilise a waitUntil

cosmic lichen
#

Use units east instead of allUnits.

gilded rover
#
count(units east inAreaArray Killhouse1)
``` like this @cosmic lichen ?
desert palm
#
count(units select {side _x == east} inAreaArray Killhouse1)```
cosmic lichen
#

Yes

desert palm
#

replace killhouse1 with the trigger name?

gilded rover
#

jup , what is the trigger that is used as the area?

cosmic lichen
#

What's that

gilded rover
#

Replace that sleep with this maybe```sqf
waitUntil(count(units east inAreaArray Killhouse1) <5);

desert palm
#

copy, killhouse being the name of the trigger right?

gilded rover
desert palm
#

what should i replace lines 13-16 with?

#

error

desert palm
gilded rover
#

my code for line 60 should not be causing issues at line 31....

#

and if you replace line 60 with the original code it works?

desert palm
gilded rover
#

leave line 16 as is

#

line 13-15 can be removed if sleep is removed

#

line 16 is used in the spawning of things

desert palm
#

ok how will i configure it to be random like it spawns 8 ai and 10 after when only 3 is left

gilded rover
#

if we get this to work rather use this as it will work better (side OPFOR is defined as the spawn side , meaning if you want BLUFOR then you can only change that and not have to change it in the wait as well) ```sqf
waitUntil(count(units _Spawnside inAreaArray Killhouse1) <5);


the random spawning I will look at now as soon as we fix this , but doesnt it already do random amount of groups
willow hound
gilded rover
#

yeah now i see where ALOT of problems come in xD

gilded rover
willow hound
#
while {true} do {
  //Spawn group
  //Sleep random
};
```It's the same script as the original for the most part, I just adjusted it to stop it from deleting groups it is not supposed to delete and applied some formatting and autopilot-code-changes like private variables.
desert palm
desert palm
gilded rover
#

okay so 1st , you want more than one group , randomised obv?
2nd change sleep to count alive opfor units?

desert palm
#

yes

#

and it will no longer spawn any more units when the maximum ai spawned is met?

#

smth like that

gilded rover
#

np i just downloaded VS Code so i can get SQF extention so i dont have to look at grey text xD, I am busy modifiying the script , hope it works

desert palm
#

but is it possible just to do it by trigger? the original script but in a trigger that when players are out of the trigger area it will deactivate?

gilded rover
desert palm
#

sure idk how to do that tho

#

anything will do

gilded rover
willow hound
#

waitUntil expects curly brackets and outBounds is undefined.
The forEach _spawnedGroups-loop should probably be pulled out of the for-loop.

desert palm
gilded rover
desert palm
#

what should i name the spawn targets

#

just alpha nad bravo?

gilded rover
#

yeah , anything realy

gilded rover
desert palm
#

How many ai will spawn before the next wave does? what lines should i edit for that

gilded rover
#

avg of 2 groups will spawn , and once the unit count (all the opfor units drop below 5 or are 5 ) a new batch will spawn

#

for units to spawn the for loop (i placed a comment) and for the waiting is that last waitUntil that i need to fix

desert palm
gilded rover
#

wrong bracket type my bad

#

probably just define it inside the activation of the trigger

desert palm
copper raven
#

parentheses cannot contain commas like that

#

i think you meant to use [] instead

winter rose
#

wrong bracket type my bad
indeed

copper raven
#

and the second error is self-explanatory

desert palm
#

the error is in the sqf? how to fix then

desert palm
#

i think it is smth to do with line 27? @gilded rover

gilded rover
#

change the !outbounds to true (completely remove it , i will help you implement that later , need to get my stuff ready for my exam

desert palm
#

oh ok goodluck ping me when ur good ๐Ÿ˜‰

dreamy kestrel
#

Q: re: public variables with regard to the pre- and post- init phases...
When may new joins expect to 'see' public variables with respect to their pre- post- init phases?

gloomy aspen
#

Hey! Im currently running into an issue with detaching an item (IR Strobe using the NVG_TargetC)

ACE interaction calls this script

_irstrobe = "NVG_TargetC" createVehicle getpos player;
_irstrobe attachTo [player,[0,0,0.2],"neck"];```

which works fine, but then when the player goes to remove it 

```sqf

detach _irstrobe;
_irstrobe setPosATL [-10000,-10000,100000];
deleteVehicle _irstrobe;

if (true) exitWith {};

Doesnt work ๐Ÿ˜ฆ Any tips?

dreamy kestrel
gloomy aspen
#

This is for a mod mate, so its attached via. ACE Self Interaction which calls the first bit of script

Then to remove it it calls the second bit of script, but that bit isnt working :/

#

@dreamy kestrel

robust tiger
gloomy aspen
#

@robust tiger Do you think (looking at that code) I will have issues with the IR Strobe showing on all players machines?

robust tiger
dreamy kestrel
dreamy kestrel
gloomy aspen
#

@dreamy kestrel @robust tiger How would you guys suggest I re-write the code below to re-define _irstrobe so it can be recognised and detached? Sorry to ask, im just at a loss!


detach _irstrobe;
_irstrobe setPosATL [-10000,-10000,100000];
deleteVehicle _irstrobe;

if (true) exitWith {};
spark turret
#

with an action by the players?

#

use ace addaction

#

or vanilla addAction, which you prefer

dreamy kestrel
robust tiger
#

Is it from an action, or are you using waitUntil?

gloomy aspen
#

@robust tiger Its all from ACE Self interaction, what youre seeing there is the script the actions execute

robust tiger
#

Simplest crude way is to remove the underscores from the variables, making them global. Unless you're gonna be making more of these IR strobes for different units, it's not going to be an issue.

gloomy aspen
#

Ill give that a try, thanks mate ๐Ÿ™‚

robust tiger
#

Like AI for example

gloomy aspen
#

Yeah its just for players to turn on an IR Strobe on their helmets using ACE Self Interaction

versed widget
#

does all the hitparts uses Czech names ?

robust tiger
versed widget
#

yes i tried motor for engine and kolo for wheel didnt work

robust tiger
#

List of all hit points for an object

versed widget
#

thanks

past wagon
#

is there a command that I can use to edit a sting? for example:

_name = selectRandom [
  "Charlie Smith",
  "John Brown",
  "Robert Williams"
];
// how can I get *just* the first name from the variable _name?
still forum
#

you want to get the stuff before first whitespace?

winter rose
#

split

still forum
#

_name = _name select [_name find " "]
or _name = (_name splitString " ") select 0;

robust tiger
past wagon
still forum
#

First thought was regex, but I think we didn't release that yet notlikemeow

unreal scroll
#

@still forum"_name = _name select [_name find " "]"

_name = _name select [0, _name find " "]
still forum
#

noooooo

signal root
#

Hey, I was trying to get the player to sit with

player switchMove "HubSittingChairA_idle3"

But it wont work (I tried playMove, playMoveNow as well) - it does play other animations though

warm hedge
#

Some animations were not intended to be used by a player unit

signal root
#

:c

#

But I saw a guy on youtube using HubSittingChairUA_move1 but that also didn't work .-.

warm hedge
#

Maybe use sqf player disableAI "ANIM"but not sure

warm hedge
#

Essentially it's just a switchMove, same thing

meager epoch
#

does anyone know why the following code causes an error? (error in generic expression)

sleep 5;
hintSilent "";```
frank mango
#

whats the context?

meager epoch
#

i want the hint to be visible less time (if its possible)

#

cause it usually stays for like

#

what

#

30 secs?

#

i want it to be there for 5-10s and then to dissapear

#

according to the bohemia page, this should do that

#

but it aint working

warm hedge
#

You're runnimg the code in the context where you can't sleep

meager epoch
#

do i have to put it in

#

like

#

0= {...}

warm hedge
#

spawn. Also I suggest you to write longer sentence per a post

meager epoch
#

alright, thanks. will try it out later

signal root
#

havent thought that i needed to disable some ai things on a not ai guy

warm hedge
#

So don't I ๐Ÿ™‚ But animation transitions were handled by that I assume

little raptor
unreal scroll
#

ContainerOpened EH doesn't work with dead bodies?

robust tiger
unreal scroll
#

Thanks

willow crater
#

Iโ€™m trying to add multiple classes of uniform for my cops on my life server. Currently they have a retextured U_rangemaster uniform, and Iโ€™m trying to add a retextured โ€œU_B_CombatUniform_mcamโ€ for my highest level cop only. Do I need to create a new class/license/faction for this (maybe a swat license or something?) or is it possible to add multiple uniform classes for one faction?

dreamy kestrel
#

Q: re: HASHMAP, I am not sure I see any rhyme or reason here, except that, as half-expected, we cannot depend on the order of keys.

_m = createhashmapfromarray [['a', 1], ['b', 2]];
_m set ['c', 3];
keys _m

Yields ['b', 'c', 'a']. Actually, it seems that no matter how I present the pairs, I get the same answer back, regardless. Not that I want to depend on that.

little raptor
#

if you want the elements to be in a certain order, use arrays
a hashmap is merely intended to be used for fast lookup

unique sundial
undone dagger
#

I'm really new to scripting, anyone here able to help with a role based ACE Arsenal script?

#

I've seen examples but no clue whatsoever in how to use it

late jacinth
#

I know disableAI "move but is there a way to keep an AI in a certain area? Such as remain on a tower? thx

unique sundial
#

give them waypoints maybe

#

or make them guard the area

late jacinth
#

I have given them waypoints. They engage and disreguard their waypoints to do so

tough abyss
#

Whats the best way to have players all start as civilian and then create ways for them to "choose a faction" in game. I know theres reputation and other variables to declare allegiance.

Im wondering if i need to set out and make an sqf file and define factional loyalty points. I can have points deduct from red/blue whatever upon killing npcs of that faction and then trigger a join group function to "set their faction". But is there an easier way?

I also want to keep this persistent either on my server or maybe use Alive persistence

winter rose
tough abyss
#

yeah im thinking an addaction on a terminal for each faction to do that

#

maybe use alive to keep it persistent?

undone dagger
#

@winter rose Do you know how make a role based ACE Arsenal script?

winter rose
#

no

keen orchid
#

hey, i'm working on a script which respawns a vehicle once it's been destroyed for a persistent sorta scenario thing im trying (i'll be expanding on it later so that's why im not using a built-in system) but when I run my code i get an reserved variable in expression error and since im not super experienced with arma coding i was wondering what the issue is, ty for help:

_tempname = vehicleVarName _this;
deleteVehicle _this;
setVehicleVarName = _tempname;```
#

(_this is equal to the destroyed mrap)

warm hedge
#

setVehicleVarName is a command (reserved variable in the error) so you cannot re-define

keen orchid
#

is there a way to set a var name on spawn?

#

oh wait

#

i can just do
mrap = createVehicle ["I_MRAP_03_F", [8665.003, 18462.355], [], 0, "CAN_COLLIDE"];
right?

warm hedge
#

Yep

versed widget
#

what is the tracks hitpart called i couldnt find it anywhere ?

warm hedge
#

You probably can try your luck with getAllHitPointsDamage

versed widget
#

i even tried with hint str _selection and each time i get otocvez

warm hedge
#

What is _selection?

robust tiger
#

You can look these up in the config of the vehicle under the HitPoints class

versed widget
warm hedge
#

hitPart can fire more than once so hint will be overwritten. Use systemChat instead

versed widget
#

wow didnt think about it thanks a ton

unreal scroll
#

We can create a hashmap from an array. Is there a command to make an array from a hashmap?

copper raven
unreal scroll
#

Nope, it works incorrectly: [[key, key, ...], [value, value, ...]]
I've converted with the following:

keys Hashmap apply {[_x, Hashmap get _x]};

Sorry, didn't tell about need to keep the structure. Some technical nuances ๐Ÿ™‚

copper raven
#

use the other syntax then

still forum
unreal scroll
#

Of course. But, as I said, I have some technical nuances, and need to keep the same readable structure.
If it is showed as [[key1,["Dรคdalus 3","Diogenes 2"]],[key2,["Seewind"]]...] and so, it should stays the same both for hashmap and array.

still forum
#

uhm

#

Are you even listening to what we are telling you?

#

Please just read the wiki page

unreal scroll
#

"Are you even listening to what we are telling you?"
Absolutely. I didn't want so say it works incorrectly at all, sorry. Just not what I needed.
If you wish to know... I have a save in profileNameSpace, and the saved data structure is the hashmap.
Also, the save can be converted to a string, so it need to be quickly converted to a save - but the data structure in that text save will become an array.
Of course, it is better to save it in array, and restore it as an array, but it needs time to rewrite the save system a bit. Just doing some temporary workaround.

fleet sand
graceful kelp
#

Hello so i have a question and need some help
im trying to check for weapon guidance typo on incoming missiles

_seekerhead = configFile >> "CfgAmmo" >> "_X" >> "weaponLockSystem";
if(_seekerhead = 8) then

but if it returns "8+4" it wont work how do i check to see if "8" or any other number is present among mutiple text characters

grim coyote
#
"8" in "8+4"
#

also use == when comparing 2 values

graceful kelp
#

so would this work

_seekerhead = configFile >> "CfgAmmo" >> "_X" >> "weaponLockSystem";
if("8" in "_seekerhead") then
grim coyote
#

can you post your full code?

#

Because you also use "_x" instead of _x only

graceful kelp
#
_Missile = nearestobject [_Hostile,_munition];
_seekerhead = configFile >> "CfgAmmo" >> "_Missile" >> "weaponLockSystem";
if("8" in "_seekerhead") then
willow hound
#

You don't need to (actually you must not) wrap variables in quotes to use them ๐Ÿ™‚

graceful kelp
#

so _seekerhead instead of "_seekerhead"

grim coyote
#
_missile = nearestobject [_Hostile,_munition];
_seekerhead = configFile >> "CfgAmmo" >> typeOf _missile >> "weaponLockSystem";
if ("8" in _seekerhead) then {
graceful kelp
#

thanks

#

i saw that

grim coyote
#

Im not sure if "weaponLockSystem" returns class or value tho

graceful kelp
#

iv already tested that part

grim coyote
#

ok

wicked fulcrum
#

In the case where I want to draw a "symbol", "marker" or "icon" on specific units only visible for zeus to show that these AI units are "special" in some way. What approach would be best to also avoid hogging performance? Any good advices?

I was thinking about doing a draw3d handler, local for each zeus that draws an icon or circle on the unit. Might be possible to only draw when in zeus view, and within the viewport of zeus to save performance? (although not yet sure how to limit it like that).

Although if you have many units that is special I could see that potentially having negative influence of performance. A map-marker for zeus only could be a possibility, but not as "user friendly" as zeus would have to toggle between map and zeus-view to identify which unit was affected.

little raptor
# wicked fulcrum In the case where I want to draw a "symbol", "marker" or "icon" on specific unit...

Might be possible to only draw when in zeus view
yes, use findDisplay in the Draw3D EH to find the zeus display. if it doesn't exist, don't do the drawing.

within the viewport of zeus to save performance
yes. altho you only save the "scripting" performance (CPU); the engine won't draw anything if it's not on screen, so you won't save much GPU performance.

if you have many units that is special I could see that potentially having negative influence of performance.
just use an external scheduled loop that generates an array of all units withing a certain range (say 2000 m), and use it in the Draw3D event handler

wicked fulcrum
# little raptor > Might be possible to only draw when in zeus view yes, use findDisplay in the D...

Thank you!

Makes sense to find the display and only draw if it exists. Ah nice. I had a feeling something like that would be baked in to optimize draws, but wasn't sure. That makes it easier.

just use an external scheduled loop that generates an array of all units withing a certain range (say 2000 m), and use it in the Draw3D event handler
So this saves performance as the external scheduled loop that finds all units isn't run every re-draw/frame but more sensible maybe every 0.2 or 0.5 seconds, and the Draw3D only spends time on drawing the given array?

Makes alot of sense. Didn't think of it that way. Thanks!

little raptor
#

the external scheduled loop that finds all units isn't run every re-draw/frame but more sensible maybe every 0.2 or 0.5 seconds
yeah. even if you made it run without any sleep, it still won't slow down the game because it's scheduled (tho it depends what command you use; e.g. allUnits select {!isPlayer _x} won't have any performance impact in scheduled environment)
but a sleep is recommended because without it your code will take away other scripts' "chance" to execute

wicked fulcrum
#

Thanks! Helps alot on my understanding for performance!

frosty cairn
#

Where do I execute missionNamespace stuff? In init.sqf?

copper raven
#

"missionNamespace stuff"?

gloomy aspen
#

Hey guys if the condition for a door to be openable is as below, what should I put in the players INIT so they can open it?


condition = "((this animationPhase 'doorcell4') < 0.5) && myjob IN [""Cop"",""doc"",""EMS""]";
gloomy aspen
#

@little raptor Could you advise how I might write that? I will look on the BI forums too to understand it a little better, but im a bit lost

little raptor
gloomy aspen
#

OK, thanks ๐Ÿ™‚

#

@little raptor Works perfectly, thank you!

frail orbit
#

Trying to get a trigger to activate from a specific AI unit. I name the guys variable "bob" and put in the trigger condition "bob in thislist". Am I missing anything?

copper raven
#

even though your condition is only bob in thislist, bob still has to satisfy trigger condition, because thats how thisList is populated iirc

#

(i might be wrong, just a guess :D)

robust tiger
obtuse quiver
#

hello everyone, i encountered a problem while fixing some code, im a newbie but i did my best.
Problem: i would like to have all civilians to run this script, but for now the only civilian that's running the script is "C_man_1"
Code: ["C_man_1", 0, ["ACE_MainActions"], _action, true] call ace_interact_menu_fnc_addActionToClass;
i have to change "C_man_1" with the civilian side but i don't know how to do that yet :/

fair drum
#

let me look up that function so i can help you. one sec

obtuse quiver
#

okie dokie

#

got kinda lost with the wiki and stuff

fair drum
#

well you are using ACE, which kinda needs a understanding of sqf already

obtuse quiver
#

yep indeed

#

i know some of the basics, i watched alot of tutorials, read stuff here and there but im still learning ya know

fair drum
#

try using false for the 5th argument

#

also, if that doesn't work, you can go back to CBA's addClassEventHandler and use 'init' for the event then call the script from there until I see more about what ace is doing with that function

obtuse quiver
#

roger that thanks i'll try the CBA's addClassEventHandler

fair drum
#

oh you want this to be in the ace interaction menu? or just in general running on the civilian

#

if you want it in the ace interaction menu, scratch the cba thing

obtuse quiver
#

oh okk

fair drum
#

oh I see your issue, you want it running on ALL civilian class names. you are just giving the function a single class name atm.

obtuse quiver
#

yep

fair drum
#

alright, either fill them out manually into an array of class names and do a forEach or a apply with that function, or I'll dig around in the config for a more universal way

#

also, this function is not global, so it needs to be fired on every machine

obtuse quiver
obtuse quiver
fair drum
#

give me a sec

#

these civilians are spawned in during the mission correct? using script? or the civilian presence?

obtuse quiver
#

yep, spawned during the mission

fair drum
obtuse quiver
#

_action = ["CivInt", "Civilian Interaction", "\z\ace\addons\interaction\UI\team\team_management_ca.paa",{}, {true}] call ace_interact_menu_fnc_createAction; there ya go

obtuse quiver
#

will do

fair drum
obtuse quiver
#

mmmh

#

i think im doing something wrong, btw the code i shared was not all of the code

#

but they kinda run on the same basis

fair drum
#

i was trying to just get it all done lol, share the code

obtuse quiver
#

sorry about that ๐Ÿ˜…

fair drum
#

use sqf bin

obtuse quiver
#

another thing, this is not my code i just touched some stuff around

fair drum
#

that would be why nothing showed up when i tested it, because you had no code in the action. thought it would at least pop something up

obtuse quiver
#

next time i'll share everything in one go ๐Ÿ˜…

fair drum
#

okay, so now that I can see what its doing, I created an infinite loop somewhere of adding actions, let me tweak it again...
okay fixed that

obtuse quiver
#

thanks alot man! <3

fair drum
#

its not done yet, running into more things putting things together. like I have no idea if these actions are lost on death or not, because that changes where scripts are placed

obtuse quiver
#

i'd prefer if the action remained after unit's death 'cause it might be useful

#

now it's working as i wanted it to work, perfect for my mission

fair drum
obtuse quiver
#

woah! you made alot of work there man thanks alot for your time!

fair drum
#

prego

obtuse quiver
#

๐Ÿ˜‰

pulsar bluff
#

most efficient way to get position of point 3 in arma?

fair drum
#

is that equidistant? or like 2/3 distant?

pulsar bluff
#

2/3

#

how to get a position 1/3 or 2/3 of distance between

warm hedge
#

vectorLinearConversion

#

@pulsar bluff ^

pulsar bluff
#

ahh nice

limber stump
#

Is setObjectScale MP compatible? I tried to change object scale on my editor, It works perfectly, but doesn't work on my server.

fair drum
limber stump
#

Should I put it on init.sqf?

fair drum
#

yeah, in the gamemode I made, I use the 200cm orbs to scale them up to act as shields. i have the object scale command in the init

limber stump
#

can you show me the script?

fair drum
#

standby let me dig it up

fair drum
limber stump
warm hedge
#

How did you do?

limber stump
#
  • I bind a variable "object1" to my sphere.
  • I bind variable "human" to my unit
  • Then I run the script using debug console using Global Execute
fair drum
#

oh with the zeus variable bind? run it on a server execute and see what happens

#

and also post the script

warm hedge
#

Please post the code, a summary isn't details

fair drum
#

give us the precious

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
limber stump
#
// "human" is my units
// "object1" is my sphere object
if (isServer) then {
  object1 attachTo [human, [0,0,5]];
  object1 setObjectScale 5;
};
fair drum
#

units? you mean single unit right?

limber stump
fair drum
#

what is said object?

#

oh you used the same sphere as i did?

limber stump
#

yes, i test it using sphere just like yours

warm hedge
#

Error?

fair drum
#

i wonder if its something with the zeus variable bind. try using it in a init box instead

limber stump
# warm hedge Error?

I don't see any error, the attachTo part is working well, but the setObjectScale has no effect on it.

#

Hmmm, Now It works, but when I am walk, the sphere scale reset, and then when I stop, the scale going back to 5.

fair drum
#

in my use, the carriers are still, so there is no problem

limber stump
final sun
#

Hello, I got a small question. Does anybody know how to force a unit to throw a grenade? (smoke grenade in this instance), I tried selectWeapon and then fire but it doesn't seem to work. (I tried both SmokeShellMuzzle and SmokeShell as the parameter)

dusk shadow
#

Thrown or underslung smoke?

warm hedge
#

Try BIS_fnc_fire

dusk shadow
#

Anyone know or have a list of data types that can be saved to profileNamespace without data loss between game restarts?

final sun
dusk shadow
#

@warm hedge Even objects? Seems funky if that's the case

warm hedge
#

Not tested but I don't see why it wouldn't work, even if it points objNull. But someone should confirm I think?

dusk shadow
#

Ye, I guess I'll have to run some tests

warm hedge
#

What's your usecase/situation?

dusk shadow
#

Just writing a general mission state save module and wanna cover my basis

#

But ill do some runs and see what i can figure post-lunch

#

cheers

#

@final sun Take POLPOX suggestion and use BIS_fnc_fire

#
[bob, "SmokeShellMuzzle"] call BIS_fnc_fire;
#

Should throw a White Smoke grenade

#

make sure bob has one in his inventory

final sun
simple hemlock
#

Hey! Does anyone know if createSoundSource can only be ran one at a time? I'm trying to make multiple ambient sounds but only one seems to play. In mission when I travel to the second source it starts playing, but then the first stops, or I'll approach the second and it never starts playing whilst the first one continues

versed widget
#

if (player != vehicle player) then { sleep 1;};
why im getting missing ; ?

warm hedge
#

How did you do?

versed widget
#

im using it as a condition to play my script but even when using it alone it says missing ; before then

#

tried if !(player == vehicle player) and got the same thing

dusk shadow
#

There's nothing wrong with this line:

if (player != vehicle player) then { sleep 1;};

The problem must be on a previous line. Probably a missing semicolon preceeding the if

warm hedge
#

In where?

versed widget
#

i got no previous line its the first

warm hedge
#

Make sure every spaces are spaces. You might have some strange garbage character which hidden in those spaces

dusk shadow
#

Also make sure its the right file and line, for example you could fixed it in one place but not another.

#

You can test the code yourself in the debug console. The if-line will not throw an error there. Hence the problem stems from somewhere else

versed widget
warm hedge
#

sleep or every suspend commands never accepted by Debug Console, directly

dusk shadow
#

Yeah, where you in a vehicle at the time, that could've done it?

#

cause the { sleep 1; } is not executed unless the if returns true

#

and would only throw an error in that case, though probably should've been a generic error

unique plank
#

Hey i'm a total beginner with arma scripting and have some questions I was hoping you guys could answer

unique plank
#

I'm working on a scenario and would like to implement an undercover/detection script that basically makes soldiers friendly until you pull a weapon out

#

right now the way i have implemented it is with triggers in the eden editor

dusk shadow
#

What's your previous scripting with coding?

#

previous experience*

unique plank
#

I've done one uni course on python and have a fair bit of experience with C# in unity

#

what I am using at the moment is player addrating -100000; to make ai target you (the player starts in the civilian team) and then addrating +100000 to make them friendly again

#

the problem i have is this only works some of the time and im not sure why

warm hedge
#

It makes turn everyone enemy

#

Even from friends

#

Use setCaptive instead which makes someone civilian

unique plank
#

do you suggest i start players in the independent team and setCaptive them to make them friendly?

#

how would I make them hostile again if they pulled out a weapon?

dusk shadow
#

setCaptive false

unique plank
#

cool

#

i would like to make this into a script because right now it is running using triggers and is quite clunky

#

how would i go about doing this?

dusk shadow
#

Read over the BIKI on some of the basic topics like entry point scripts (Event scripts) and possibly the functions library, they should point you in the right direction

unique plank
#

cheers for the help

dusk shadow
#

Also see some of the pinned messages in this room

warm hedge
#

Nice!

#

Well, actually this is what I've expected

dusk shadow
#

Yeah, it's nice when the world makes sense ๐Ÿ˜›

warm hedge
#

BTW... it returns null even if it's the same mission?

dusk shadow
#

yes

warm hedge
copper raven
#

i mean it all makes sense ๐Ÿ˜„

warm hedge
#

This^ tho might worth a write?

copper raven
#

i guess

#

won't make things worse ๐Ÿ˜„

versed widget
#

waituntil {player == vehicle player}; seems not working

candid cape
#

Hi!

#

One question, I need to know if drawIcon3D can be executed so that another player can see your drawIcon3D

#

I have this code, but it runs and other players don't see the text above my head

#
aaa = addMissionEventHandler ["Draw3D", 
    {
    if (player distance player > 10) exitWith {};
    if ([objNull , "VIEW", player] checkVisibility [eyePos player, eyePos player] < 0.3) exitWith {};
    drawIcon3D ["\a3\ui_f\data\map\Markers\System\dummy_ca.paa", 
    [0.9,0.1,0.9,1], visiblePosition player vectorAdd [0,0,2.1], 0.2, 0.2, 45,format [
        
    "%1 - %2",name player, getplayeruid player], 2, 0.07, "RobotoCondensedBold"];
    }];

sage dawn
versed widget
#

thats my first line

#

to excute a script

sage dawn
#

in a sqf script?

versed widget
#

yes

sage dawn
#

how are you executing the script?

#

execVM?

versed widget
#

via postInit in the config but i tried it on the debug console it didnt work

#

my code never got excuted even when the statement is true

sage dawn
#

so do you launch the script when the player is in a vehicle and then want it to execute when they are no longer in a vehicle?

versed widget
#

i want it to be excuted when the player is on the vehicle and stop when he is not

sage dawn
#

you're doing to the opposite then

#

when you launch the script it will wait until the player is not in a vehicle and then execute the rest of the script

versed widget
#

really ? meowsweats

sage dawn
#

maybe you're looking for a while and not waitUntil?

#

that would execute whatever is in the while code as long as that condition is true

versed widget
#

does while checks repeatedly even after the statement is true ?

sage dawn
#

it will check every frame if the condition is true

#

and execute the same code

#

when the condition becomes false, it will stop

versed widget
#

oh yeah that may help how about performance impact is it optimal ?

sage dawn
#

depends on what code you're going to be running

versed widget
sage dawn
#

you're better off putting the while inside the sqf itself

#

player != vehicle player is when the player is in a vehicle

#

so if you want it to run while the player is not in a vehicle, it would be while {player == vehicle player}

#

and again it depends on what is actually happening in your sqf

#

if it's a lot of code the it might not be good for every frame

#

but I'm also not the person to ask about optimization

versed widget
sage dawn
#

I'm pretty sure execVM'ing one script and then having it run while code inside of it is better than having the while execVM on every frame

versed widget
#

is it possible to make while not to check for every frame ?

#

maybe by adding sleep

somber radish
#

Anyone got some resources for making a Bug tracker / user feedback?
I'd like to have a ingame function that allows the user to send a complaint directly from a window in-game and have that pop up on my discord server (using a bot)

warm hedge
#

If there's a possibility, it would be a dll

austere granite
#

In theory you could use htmlLoad with a query param as input

#

I've used stuff like that in the past to get stats on Tanoa ownership

warm hedge
#

Huh... that kind of stuff possible?

still forum
#

you'd need to whitelist your domain/URL in config. Afaik only modconfig can do that

austere granite
#

Correct

somber radish
still forum
#

ye

#

Well you can run a server only mod on your server that whitelists it on your server

#

and then remoteExec the htmlLoad to your server from the mission scripts

somber radish
#

Aah

#

ait

#

thnx!

austere granite
#
private _hasApex = ["no", "yes"] select (395180 in (getDLCs 1));
(_args select 0) htmlLoad (toLower format ["http://topsekrut.xyz/apex/%1.html", _hasApex]);

is actually what we did, but query args should be a-okay too

snow pumice
snow pumice
graceful kelp
#

hi i have a similar question to yesteurday which was to get this to work "final product"

_Seekerhead = getText (configFile >> "CfgAmmo" >> _munition >> "weaponLockSystem");
while {(alive _Missile) && (alive _Heli)} do {
    if (("2" in _seekerhead) && (_Heli getVariable "fza_ah64_irjstate" == 1) || (_Heli getVariable "fza_ah64_irjon" == 1)) then {
        [vehicle player, "fza_AseIRjammer", [-1]] call BIS_fnc_fire;
    };
    if (("8" in _seekerhead) && (_Heli getVariable "fza_ah64_rfjstate" == 1) || (_Heli getVariable "fza_ah64_rfjon" == 1)) then {
        [vehicle player, "fza_AseRFjammer", [-1]] call BIS_fnc_fire;
    };
    sleep 0.3;
};

im now trying to get something similar to work for checking if its anti air

_Radarrange = getText (configFile >> "cfgvehicle" >> "_unit" >> "ActiveRadarSensorComponent">> "class AirTarget">> "maxRange");
if (_radarrange > 100) exitwith {true}
false;

but im not sure if cfg vehicles is the correct path to find ActiveRadarSensorComponent

snow pumice
graceful kelp
#
_Radarrange = getText (configFile >> "cfgvehicle" >> "SAM_System_03_base_F" >> "components" >> "SensorsManagerComponent" >> "Components" >> "ActiveRadarSensorComponent">> "AirTarget">> "maxRange");
hintsilent format ["range= %1",_Radarrange];

dose not seem to work
im using sam 3 name as a test

snow pumice
#

try getNumber

snow pumice
graceful kelp
snow pumice
graceful kelp
#

tried a few

willow hound
#

CfgVehicles