#arma3_scripting

1 messages Β· Page 736 of 1

bitter jewel
#

str

pallid ravine
#

hint str C;

#

str var will convert any variable into a string.

true frigate
#

Brilliant, thanks πŸ™‚

pallid ravine
#

When you use setVariable on an array with public set to true, does it properly sync array contents across the network?
Edit: Seems like it is

#

Does anyone know if it also properly syncs multidimensional arrays?

still forum
#

It syncs the value of that variable, whatever is in there, as long as it's serializable (controls, displays, local only objects are not)

pallid ravine
#

Perfect, thanks!

flint topaz
#

Hi, so I'm trying to get all of the Archer Missle Systems on the mission so I can disable them instantly. But allUnits and allUnitsUAV does not contain the unit. Does anyone have an idea of how to get it "OPTRE"

little raptor
flint topaz
flint topaz
#

yeah thanks I got it working appreciated

tight cloak
#
while (true) do {
removeAllEventHandlers "_drops";
_zombies = []; 
 
{if ((side _x) == east) then {_zombies pushBack _x}} forEach allUnits;


_drops = {_x addEventHandler ["Killed", {
    params ["_unit", "_killer", "_instigator", "_useEffects"];
        systemchat format ["%1 was killed by %2", _unit, _killer];
}];
} forEach _Zombies;

sleep 10;
};

what am i trying to do?
array all opfor and add an EH handler to them so i can then spawn something where they died, systemchat is there for debug just to see if the EH is working.

the array works just fine on a single fire without the EH but then when the EH is added, the EH still does nothing. any pointers on what im doing wrong

#

its on a loop to keep regathering the "_zombies" as they will be spawning constantly and a single fire wont catch those that spawned late to the party

flint topaz
#

} forEach _Zombies; < this is capital

#

_zombies = []; < this is not

warm hedge
#

It doesn't matter

#
while {true} do {```It should be this. `while` takes a code not a boolean
flint topaz
#

that is true

little raptor
#

removeAllEventHandlers "_drops";
wat?

#

{if ((side _x) == east) then {_zombies pushBack _x}} forEach allUnits;
units east

#

also this is horribly inefficient

#

and will eventually cause many problems

tight cloak
#

whats the better way?

little raptor
#

don't keep adding and removing event handlers

tight cloak
#

but if i keep adding EH's wont they just stack up if im constantly adding an EH to the unit

little raptor
#

wat?

#

who said keep adding?

#

I said DONT

flint topaz
#

don't you have one event handler?

tight cloak
#

i mean im trying to get all alive opfor, add an eh to them and keep detecting new spawned opfor

flint topaz
#

to control all the zombies?

little raptor
tight cloak
#

is there an easy way to do that?

little raptor
#

yes

tight cloak
#

uh. how if i may ask?

little raptor
#

keep an array of current enemies
get list of all enemies
subtract the two and you get new ones
add the EH to the new ones
update current enemies

tight cloak
#

i shall give it a go

little raptor
#

altho that's less efficient

tight cloak
#

alrighty, ill throw something together and repost it in here if i have troubles

#

ty for the help

tight cloak
#
_zombiedrops = true;
_loop = 0;
_zombies = [];
_zombiesnew = []; 
{if ((side _x) == east) then {_zombies pushBack _x}} forEach allUnits;
sleep 10;

while (_zombiedrops) do { //this is line 8
 
{if ((side _x) == east) then {_zombiesnew pushBack _x}} forEach allUnits;
_zombiesupdate = [_zombiesnew] - [_zombies];
systemChat format ["%1", _zombiesnew];

_drops = {_x addEventHandler ["Killed", {
    params ["_unit", "_killer", "_instigator", "_useEffects"];
        systemchat format ["%1 was killed by %2", _unit, _killer];
}];
} forEach _zombiesupdate;
sleep 10;
_zombiesnew = _zombies;
_loop = _loop + 1;
systemChat format ["while loop running ,%1" ,_loop];
};

getting an error type bool, expected code
line 8

#

the systemchats are just me wanting to see what its throwing out in the loop for now

#

so ignore those even if i have screwed them up

wild prairie
tight cloak
#

its moments like these i curse myself for forgetting minor thing like {}

#

ty

little raptor
#

also what on earth? meowsweats

wind cairn
#

anyone good with pulling items from the config?

warm hedge
#

Well, what's the question?

#

You know what, β€œDon't ask to ask just ask”

wind cairn
#

true

warm hedge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
warm hedge
#

Also protip: you can just edit your post

wind cairn
#
                    || (getText (_x >> 'cursor') isEqualTo 'smg')) 
                    && getNumber (_x >> 'scope') isEqualTo 2" configClasses (configFile >> "CfgWeapons");```
#

Sometimes this just returns an empty string of ""

#

yeah true

warm hedge
#

And what's your intention?

wind cairn
#

get the config names of all arifles, srifles and smg's

little raptor
#

this is just wrong

#

I'm surprised it even returns something meowsweats

wind cairn
#

:/

warm hedge
#

Is it that bad? Seems relatively fine

wind cairn
#

Im still relatively new to sqf, first time i've needed to take from the config like this

little raptor
#

actually I think it's correct (at least the syntax). I counted the parentheses wrong

pliant stream
#

you say it sometimes returns an empty string. when is sometimes?

warm hedge
#

Ah you meant that

wind cairn
#

not sure, I'll grab the rpt file

pliant stream
#

also isn't that thing supposed to return an array

wind cairn
#

yeah it does

warm hedge
#

True. Just tried on vanilla, it never returns "". More like just configs!

pliant stream
#

so you meant empty array and not empty string?

warm hedge
#

Full code please?

wind cairn
#

array looks something like this ["", "srifle_DMR_01_F", "", "" .... ]

#

ill paste into sqfbin

pliant stream
#

that's weird. i assume configClasses is not supposed to return empty strings for the classes not matched?

wind cairn
#

My mistake, it seems the error is occuring when getting the baseClass weapon?

pliant stream
#

aha

wind cairn
#

but then again, all the weapons it takes from the config should have a baseClass no?

pliant stream
#

context does help. the problem was never in the code shown πŸ™‚

warm hedge
#

Oh so yeah, guess I understood what's your intention

pliant stream
#

what is baseWeapon ?

warm hedge
pliant stream
#

ah no attachments

warm hedge
#

If configName _x != baseWeapon, won't show in Arsenal

#

So yeah, basically weapons with no attachments

pliant stream
#
_wepClass = configName _x;
    _baseWeapon = getText (configFile >> "CfgWeapons" >> _wepClass

this is unnecessary. _wepClass is configFile >> "CfgWeapons" >> configName _wepClass

#

but i suppose you really want [configName _wepClass] call BIS_fnc_baseWeapon

warm hedge
#

True. The _x is already a config

wind cairn
#

ah ok

warm hedge
#

But yeah highly recommend to use the function

wind cairn
#

I'll try that, thanks

warm hedge
#

Good luck

pliant stream
#

also, pushBackUnique is idempotent: to do so twice is unnecessary πŸ™‚

wind cairn
#

yeah that was a mistake from debugging

#

Another question I had just quickly, couldn't find anything online about it. What exactly is scope referring to in a weapons config?

warm hedge
#

scope does β€œit is hidden or public”

wind cairn
#

ah it refers to that kinda scope

pliant stream
#

0 is private, meaning cannot be created
1 is protected, meaning can be created but is hidden in the editor
2 is public, meaning can be created and is shown in the editor

warm hedge
#

Almost everywhere uses this. CfgVehicles or somewhere too

pliant stream
#

so you may actually want scope != 0 instead of scope == 2, but that's really for you to decide

wind cairn
#

ok

willow hound
wind cairn
#

all works great, thanks guys πŸ‘

tight cloak
#

you also made me spot a mistake id made

pliant stream
#

i would recommend using more indentation. it helps with spotting mistakes

little raptor
#

also you shouldn't get the list of units before loop

#

everything should happen in the loop

#
_lastZombies = [];
while {true} do {
  _zombies = units east;
  _newZombies = _zombies - _lastZombies;
  {
    _x addEH...
  } forEach _newZombies;
  _lastZombies = _zombies;
  sleep 10;
};
#

and here's the alternative approach I mentioned before:

while {true} do {
  _zombies = units east;
  {
    if (_x getVariable ["AddedEH", false]) then {continue}; //if EH was already added skip
    _x addEH...;
    _x setVariable ["AddedEH", true];
  } forEach _zombies;
  sleep 10;
};
solar zenith
#

Trying to do a mission where we have 10 tasks within that mission. That are selected at random. So the mission has replayablility. Any ideas how

pliant stream
#

well firstly, for maintainability and your own sanity, separate each task into a different file or directory.
at startup on the server you have a list of the tasks and select one. you then call the initialisation code for the selected task and signal all clients to do the same.

jade acorn
#

the easiest way would be to add each task to one trigger and each trigger have with 50% of occurrence

#

@solar zenith

#

but there's a possibility that you get either all tasks or none Hmm

#

do you want any limit of those tasks? if so, you could make an array with selectRandom(s) reducing the array everytime, up to the final number of tasks you want to have

pliant stream
#

do you want to select just one task, or do you want to select K tasks from a set of 10 tasks, or do you want to select 10 tasks from a set of more than 10 tasks?

tight cloak
solar zenith
#

just 1 task at a time at random from a bunch of like 10-20

pliant stream
solar zenith
#

okay.. well im pretty new to it all, i know basic scripting stuff. is there anychance you could explain further or step by step please?

i understand inits, and different sqfs and that

pliant stream
#

okay. you can run initialisation code on the server in init.sqf using isServer or in initServer.sqf.
the server should pick the task. that you can do by say holding a list of task names in an array, and using selectRandom to pick one.
once the task is selected you'll want to execute some initialisation code for that task on the server, and possibly on clients as well.
if you need to execute initialisation code on the clients, you will need to remote execute from the server to the clients.

solar zenith
#

yeah i wouldnt know how to do any of that... dammit... im just trying to replicate the extraction campaign from western sahara. but differently. so you start at the fob. go out and do the first random mission. then come back to the fob with intel. and then it pings the second random mission and so on

dreamy kestrel
#

Q: I think I probably already have a sense for what's going on, but I wonder if I can get some clarification about which return value should be happening.
Scenario: I have a function in which the I have an if then else decision tree at the end with an embedded exitWith. I half expect exitWith to return the function, but it seems as though the trailing debug log is returning instead. i.e.

private _debug = true;
// ...
if (_true) then {
  // where _retval is an [] (ARRAY)
  if (_alsoTrue) exitWith {_retval};
};
if (_debug) then {
  [...] call my_log; // returns BOOL
};

Logs of the calling context indicate I am receiving the BOOL back again, as well as messages hinting at the my_log invocation being part of that return path.
It seems like to me that exitWith is leaving the immediate if then CODE scope, not the overall function.
https://community.bistudio.com/wiki/if
https://community.bistudio.com/wiki/exitWith

pliant stream
#

exitWith is leaving the immediate if then CODE scope,
yes, that is correct.
I have a function
you don't have a function. sqf has no functions

#

the closest you can get to a return statement is probably something like ```SQF
function =
{
private "_return";
scopename "return";
call
{
if (...) then
{
if (...) then
{
_return = _retval;
breakTo "return";
};
};
if (_debug) then
{
diag_log "blah";
};
};
_return
};

pallid ravine
#

I've head "sqf has no functions" before, but I've never understood what people mean by that. It has code which can be stored in a variable that can be called with parameters and produce an output. Is that not a function, for all intents and purposes?

pliant stream
#

yeah, it behaves kind of like what most languages call functions from the outside, though not exactly since you can break out through the caller and mutate the caller's locals. viewed from the inside you have the same weirdness but inverse, and also you lack any built-in concept of return

#

if sqf has functions, it is only by convention. we can say that the language has no functions but we the users have built functions on top of the language

pallid ravine
#

Alright, makes sense. I'm not entirely convinced that what we have shouldn't be classified as functions, but I see your point that they act sufficiently differently from functions as defined in other languages as to make the distinction worthwhile.

dreamy kestrel
pliant stream
#

you also have to consider that there is no functional difference between the code you assign to a variable, calling it a function by convention, and the code you pass to if (...) then

#

really we should be talking about subroutines though. it's kind of a shame how computer science has overloaded the term function

dreamy kestrel
pallid ravine
#

I think I'm understanding now. Even in other languages where code is assigned to variables (javascript for instance), the idea of functions are still widely talked about and used. The distinction that people are trying to make is that there is nothing fundamentally special about a function like there is in C for instance. However, even though there being nothing special about "functions" in a language like sqf, we still follow (and are able to follow) the functional programming paradigm.

pliant stream
#

yeah, except i wouldn't call functional programming since that has a very specific meaning

#

if you want to assign a tag to the paradigms used in sqf, i would instead probably call it imperative structured programming

winter rose
#

we are not renaming CfgFunctions!

dreamy kestrel
dreamy kestrel
copper raven
true frigate
#

Hey so I'm having troubles getting PlaySound3D working in multiplayer, it works fine in singleplayer but only PlaySound works in multi for some reason πŸ€”

true frigate
#
"music1" remoteExec ["playSound"];```
I assumed I could replace playSound with playSound3D. Although I suppose thats not the case
#

apologies, very new to this still πŸ˜„

#

Otherwise for now I've just been using a trigger with
playSound3D [getMissionPath "Rise.ogg", player];

winter rose
true frigate
#

Thats what I was thinking, this works on dedicated too?

winter rose
#

it should

true frigate
#

I'll give it a go and let you know what happens, hopefully my friend can hear it too πŸ˜„

#

Thanks Lou πŸ™‚

pallid ravine
#

What's the recommended way to find and preview assets such as pictures, textures, models, music, etc? In particular, I'm looking for the file paths of the hold action icons in the game to preview them and use then in a hold action script.

jade acorn
pallid ravine
#

@jade acorn Thanks a bunch, I didn't see the "Show text" button on the wiki. I'll have to keep an eye out for that next time.

Speaking of the config viewer though, aside from obvious configs like vehicles, weapons, magazines, etc, how do you actually find stuff? Search via script maybe?

jade acorn
pallid ravine
#

Awesome, thanks a bunch!

digital hollow
jade acorn
#

the holy trinity PES2_Pray

true frigate
#

How do I miss optional parameters in a script?
For example, I need to access volume in playSound3D but it comes after soundPosition in the parameters, I don't want SP to override my positioning from an object

winter rose
true frigate
#

Like this?
playSound3D [getMissionPath "sounds\Fail.ogg", FailSource, false, objNull, 100, objNull, 1000];

winter rose
#

oh wait, I thought you wanted to avoid the object itself

#

I think you can't

true frigate
#

Ahh alright

winter rose
#

maybe [0,0,0], but I don't guarantee it

true frigate
#

So just log position of object and use that instead? πŸ˜„

#

I know for some scripts _x works doesnt it?

winter rose
#

or getPosASL FailSource yeah

true frigate
#

What am I thinking of for that then lol

winter rose
true frigate
#

Ahhhhh right

pallid ravine
#

Would there happen to be a way to smoothly transition weather, even when manual weather is not enabled in the mission config? I was hoping to make a weather script for public zeus that could do smooth transitions.

faint oasis
#

hi, can we get the real "WorldtoModel" position ? because actually i'm trying the "truck WordToModel (ASLtoAGL getposasl _obj1)" but when i use the "attachto" command the relative postion is not "100%" i have a space between the truck and my obj on the "Z" axis so the "Altitude"

faint oasis
winter rose
#

try a getPosASLVisual or a getPosWorldVisual perhaps

faint oasis
#

ok thx i will try then

pallid ravine
#

I jumped onto a public zeus server with scripts enabled and tried a 10 setOvercast 1 that I remoteExec'd and it didn't seem to work. The only way I could change the weather was to subsequently run a forceWeatherChange. As a workaround, I was hoping that multiple small incremental forceWeatherChange's could approximate a smooth transition, but even with small changes it hangs the client for a second or two. So now I'm hoping that I either did something wrong, or that there's a workaround.

winter rose
faint oasis
pallid ravine
#

So it should work, but the system (with weather simulation enabled) can't go any faster than x weather change per minute and inputting a faster transition time than what it can handle will just make it transition as fast as it can?

jade acorn
#

in multiplayer sessions the weather change would desync

#

so you can either force it instantly or wait the 30 minutes to be sure every player sees the same weather

winter rose
jade acorn
pallid ravine
#

It's certainly worth testing! If the limiting speed factor is the weather simulation, that'll make it easier to test in SP. I'll whip up a quick script to periodically log weather parameters to a csv string and pop it into excel for graphing after an hour or so.

#

Thanks again for the help!

true frigate
#

PlaySound3D is only working on my client, not serverside
Trigger
remoteExec ['LouisTag_fnc_SFX1',2];
Description.ext

{
    class LouisTag
    {
        class SpawnUnits
        {
            class SFX1 {file = "SFX.sqf";};
        };
    };
};

SFX.sqf
playSound3D [getMissionPath "sounds\Fail.ogg", FailSource, false, [10444.7,2613.57,17.1143], 100, 1, 0, 0, false];

I know you dont NEED to use remoteExec to execute it for playSound3D, but doing it shouldn't break the multiplayer should it?

true frigate
#

Not for all players, just me

little raptor
#

what's FailSource?

true frigate
#

An object with variablename FailSource

little raptor
#

is your trigger server only?

true frigate
#

Yep

#

Just double checked in case πŸ˜„

little raptor
#

btw how did you test on other clients?

#

I think you're the server right?

true frigate
#

I'm using the host server feature

little raptor
#

and? what about the clients?

true frigate
#

So my friend is helping me test as of now

#

He can hear audio if i use "music1" remoteExec ["playSound"]; but it isnt directional

little raptor
#

but I don't really see what could be wrong with your playSound3D

#

it should work as far as I see thonk

true frigate
#

Thats what's confusing me πŸ˜„

#

It could be a mod to be fair, are there many that mess with that audio?

little raptor
#

I don't think it's a mod issue

#

but in any case using say3D is better

#

playSound3D has so many limitations

#

for say3D you need to define the sound in description.ext (direct path won't work)

#

also it does need remoteExec, because it has local effect

true frigate
#
class CfgSounds
     {
     sounds[] = {Fail, Scream};

     class Fail
     {
          name = "Fail";
          sound[] = {"Fail.ogg", db-40, 1};
          titles[] = {0,""};
     };
};```
Like this right?
#

For description.ext

little raptor
#

leave sounds[] empty (iirc)

true frigate
#

Alright I'll try say3d. Ill keep a backup of this current script in case it turns out i was just being stupid

warm swallow
#

Im trying to teleport a player, but I want it to be like they close there eyes, so a quick fade to black and then teleport and then bam they are in a new place. This is the code I have

cuttext ["", "BLACK IN", 3];
player setPosATL getposATL teleport;
cuttext ["", "BLACK OUT", 3];```
#

this code instantly teleports the player and then fades to black

little raptor
true frigate
#

Mind if I ask how you do that?

winter rose
little raptor
#

Β―_(ツ)_/Β―

little raptor
true frigate
#

Cheers πŸ™‚

little raptor
#

that false flag is for JIP

winter rose
pallid ravine
#

@warm swallow You'll need to use sleep 3 or sleep 4 or something after you first cuttext.

little raptor
#

I thought it was true meowsweats

winter rose
#

remoteExec ["..."] is enough πŸ˜‹

little raptor
#

@true frigate ^

true frigate
#

Alright πŸ™‚

true frigate
#

Is remoteExec ["...", 2] not better as it only executes on the server?

#

Or does it not matter

little raptor
#

because it has local effect

#

i.e only the client where it executes hears the sound

#

@true frigate

true frigate
#

Makes sense. Thank you!

#

Just want to check then (first time using Say3D), this is the correct format?

FailSource say3D ["Fail", 0, 1, false, 0];```
#

I assume 0 distance means infinite, but I could be wrong

little raptor
#

no it means 0

#

so practically no one hears it I think

true frigate
#

Alright I'll just set it to 2000 because thats within range of the players

#

there isnt a downside to setting it high right?

little raptor
#

that's just the max distance

true frigate
#

Alright πŸ™‚

little raptor
#

I think the game uses some kind of attenuation, so it'll never be heard that far thonk

little raptor
true frigate
#

Because i'd like it to be directional πŸ™‚

#

It isnt working as of now, I tried in debug menu and I'm getting NOID <No Shape>

little raptor
true frigate
#

Uh I may have been stupid. If my .ogg files are in a folder, I need to do folder\fail.ogg right....

little raptor
#

ofc

true frigate
#

Oops

#

Surprisingly enough, it works now πŸ˜…

#

Thanks for pointing out what the error meant

warm swallow
#

so im trying to control how many shots i need to take a player down with a shotgun, to be 2 shots needed. I have this code

{_x addMPEventHandler
 ["MPHit",
     {
    params ["_unit", "_source", "_damage", "_instigator"];
    
    _x setDamage damage + 0.5; 
     }
 ];
} forEach [p1, p2, p3, p4, p5 ,p6]``` 
but how would I check to see if they were hit before, because for each player, i want it to increment from 0.5, to 1. But if I add 0.5 to what they've already been hit with they will just die
little raptor
#

how would I check to see if they were hit before
setVariable/getVariable

warm swallow
#

ah

warm swallow
little raptor
warm swallow
#

@little raptor this is what I have

#
{_x addMPEventHandler
 ["MPHit",
     {
    params ["_unit", "_source", "_damage", "_instigator"];
    _x getVariable ["timesHit", 0]
    _x setVariable ["timesHit", timesHit + 0.5]
    _x setDamage timesHit * 0.5; 
     }
 ];
} forEach [p1, p2, p3, p4, p5 ,p6];```
bitter jewel
#

_x means nothing in the event handler code block

#

_unit is what you want to refer to

warm swallow
#

ah

warm swallow
#
{_x addMPEventHandler
 ["MPHit",
     {
    params ["_unit", "_source", "_damage", "_instigator"];
    _unit getVariable ["timesHit", 0];
    _unit setVariable ["timesHit", timesHit + 0.5];
    _unit setDamage timesHit * 0.5; 
     }
 ];
} forEach [p1, p2, p3, p4, p5 ,p6];```
bitter jewel
#

your forEach is iterating over p1...p5, giving them the name _x each in turn, and while doing so assigning an event handler to that _x

#

so yes

#

if that is what you want to do

warm swallow
#

yea

#

ill see if this works

bitter jewel
#

_unit getVariable ["timesHit", 0];

#

you are not storing the value anywhere

warm swallow
#

hmm

#

im trying to create a timesHit variable for each player

bitter jewel
#

why do you add 0.5 to the timesHit and then set damage to be half of timesHit

warm swallow
#

im trying to make it so that each person has to take 2 shots to go down

bitter jewel
#
    {
    params ["_unit", "_source", "_damage", "_instigator"];
    _unitTimesHit = _unit getVariable ["timesHit", 0]; // get the value
    _unitTimesHit = _unitTimesHit + 1; // increment the value
    _unit setVariable ["timesHit", _unitTimesHit]; // store the value
    if (_unitTimesHit >= 2) then {
      _unit setDamage 1;  // kill the unit;
    };
    0; // ???
     }
#

try that

#

no dont try that

warm swallow
#

ok

#

does _unitTimesHit get replaces with like p1, p2... etc

bitter jewel
#

ok now try it

#

no

warm swallow
#

hm

#

ok well

#

the guy i tested it on died in one shot

#

i didnt get any script errors though so

#

im just trying to not make the shotgun i use in my mission op

bitter jewel
#

if you shot them with a shotgun then that triggered probably twice

#

since a shotgun launches multiple projectiles

warm swallow
#

true

#

ill change to slug rounds

#

still doesnt work

#

dang

bitter jewel
warm swallow
#

im getting an error type object expected task in this code

#
if (g1 getVariable ["repaired", false] == true) then
{
    tg1 setTaskState  "Failed";
};```
#

the task is tg1, how do i make it usable for setTaskState

copper raven
tough abyss
#

i have a question, are there any good mods with diving gear? with stuff like rebreathers, drysuits, wetsuits, dive computers, stuff like that?

tight cloak
#

@warm swallow

 _this addEventHandler ["HitPart", { 
 (_this select 0) params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"]; 
 _hits = _target getVariable ["TAG_fnc_hits",0]; 
 _hits = _hits + 1; 
 _target setVariable ["TAG_fnc_hits",_hits]; 
 hint format ["%1 has been hit %2 times",name _target,_hits];
 if (_hits > 10) then { _target setdamage 1} else {
 _target call ACE_medical_treatment_fnc_fullHealLocal; 
 };
}];

i use this, albeit its integrated into ace heal but you can remove that, and change (_hits > 10) to whatever number you wish. the hint is for debug and can be removed safely

#

it sounds like what your looking for

#

curtesy of grumpy old man on Bi forums years ago

warm swallow
steel fox
#

When creating objects relative to a main object. What the best way to get the height at the relative position? Height being the height of the first walk able surface, either ground or an object.
I was thinking of just using lineIntersect and finding it with that, but I'd say someone probably more experienced with positions has solved this before.

open scaffold
#

Hello! It's been a little bit. You guys are the only ones I know that know a good bit about coding, so I figured I would get quality help. I'm trying to configure a radio in game to play music I've added. Here's my code:
`
Description.ext
class playRadio

{
sounds[] = {};
class FBRHFF
{

    name = "FBRHFF";
    sound[] = { "FBRHFF", 10, 1};
    titles[] = {};
    
};

};

initPlayerLocal.sqf

radio addAction ["Play Song",[execVM "playRadio.sqf"]];

playRadio.sqf

_sounds = selectRandom ["FBRHFF"];

{radio, ["FBRHFF", 100, 1]} remoteExec ["say3D"]; `

I'm not entirely sure why I keep getting this error:

Error position: <addAction ["Play Song",[execVM "playRadi>
23:22:45 Error Type Array, expected String,code
23:22:45 File C:\Users\Levi\Documents\Arma 3 - Other Profiles\TemplarBOMSF\mpmissions\Fighting_Bengals_Training.Malden\initPlayerLocal.sqf..., line 1

steel fox
#

execVM should be in {} brackets instead of []. Going by the error.

#

[] makes in an array. it needs {} code or "" for string.

open scaffold
#

so it would be

radio addAction ["Play Song",{execVM "playRadio.sqf"}];

instead of the latter?

steel fox
#

that should work.

#

it is what the error says.

open scaffold
#

Alright, I'll give that a shot

#

Okay, now everything works, it just won't play the song I've selected

#

Granted there's only one song in there

steel fox
#

how is the radio object defined? Is it available on the remoteExec target?

open scaffold
#

I'm not sure, I just put this in the Variable Name in the Object: Init section of the asset I'm using

Variable Name: radio

#

I'm also not sure if that's what you're asking

steel fox
#

Alright. Does say3D work in the debug console with player as the from object? Just to see if the Cfgsounds works?

#

Ah, yeah it won't.

 class playRadio -> NEEDS to be class CfgSounds
{
    sounds[] = {};
    class FBRHFF
    {
        
        name = "FBRHFF";
        sound[] = { "FBRHFF", 10, 1};
        titles[] = {};
        
    };

}; 
open scaffold
#

It's named playRadio because that's what I have that .sqf named

#

I apologize in advance, because I am quite new to this

steel fox
open scaffold
#

Standby

#

So when I call on CfgSounds it'll go to that .sqf, yeah?

#

I guess I'm confused, as there's no CfgSounds in my mission folder

steel fox
#

class CfgSounds is defined in the description.ext

#

CfgSounds is a class, it is not a file.

#

As long as it is defined somewhere where the game looks for configClasses, config.cpp for addons. Or the description.ext for missions. Arma will find it.

open scaffold
#

So Arma will essentially find the song I want to be played THROUGH the Description.ext?

steel fox
#

The song class, FBRHFF will be looked at. It should have a property that will point it to the file that is the song.

open scaffold
#

I have missed an essential part of this..

sound[] = { "FBRHFF", 10, 1}; should be

sound[] = { "FBRHFF.ogg", 10, 1};

steel fox
#

Yep.

open scaffold
#

Okay, it's fixed in the Description.ext, I'm going to see if I can't find out why it isn't playing still.

steel fox
#

Just test the say3D in the debug console

#

with out remoteExec

open scaffold
#

All I get is a popup saying ["say3D]

steel fox
#

what is the code?

open scaffold
#

`_sounds = selectRandom ["FBRHFF"];

{radio, ["FBRHFF", 100, 1]}; ["say3D"];`

#

Again I apologize for this

steel fox
#

remoteExec can't just be removed. you need to adapt the code accordingly

#
radio say3D ["FBRHFF", 100, 1];
``` should work.
#

but _sounds = selectRandom ["FBRHFF"]; doesn't do anything in your code.

open scaffold
#

NOID <no shape>

steel fox
#

Does it play the sound?

open scaffold
#

Negative

steel fox
#

Did you reload the mission after changing the description.ext?

#

if you did, post the them again, with the code you put in the console.

open scaffold
#

You know, I may be a bit daft. I didn't think to reload the mission

#

Still the same error, NOID <no shape>

#

No audio either

steel fox
#

but are you testing in SP or in MP still?

open scaffold
#

SP at the moment, should I be in MP?

steel fox
#

not until you want to test the remoteExec

#

can you post the description.ext and the code you run in the console?

open scaffold
#

Sure, one sec

#

` class CfgSounds

{
sounds[] = {};
class FBRHFF
{

    name = "FBRHFF";
    sound[] = { "FBRHFF.ogg", 10, 1};
    titles[] = {};
    
};

}; `

steel fox
#

aswell as, the folder structure in the mission? what is the path to the FBRHPP.ogg as seen from the description.ext file?

open scaffold
#

I have FBRHPP.ogg set in a folder titled "sounds" in the mpmissions>Fighting_Bengals_Training.Malden

#

Just to be organized

steel fox
open scaffold
#

Listen....

#

It didn't have the folder path to the .ogg file...

steel fox
#

yep

open scaffold
#

Let me reload everything real fast.

#

Triple check my code.

#

Okay, still no sound from the radio

steel fox
#

with the debug console or the whole code?

open scaffold
#

Hang on

#

It works!

steel fox
#

which one?

open scaffold
#

Lemme restart just so I know for sure lol

#

Seems the Debug version works

steel fox
#

which is?

#

the code.

open scaffold
#

radio say3D ["FBRHFF", 100, 1];

steel fox
#

[radio, ["FBRHFF", 100, 1]] remoteExec ["say3D"]; Not tested but that should be the syntax. You can test it in the debugConsole, even in SP it would work.

open scaffold
#

I will give that a try

#

Yep, it works

steel fox
#

swap it into your code and test the whole.

open scaffold
#

Will do, wait one

#

Yep, can confirm it works in SP

steel fox
#

then it will work in MP aswell.

#

Have fun with it.

open scaffold
#

Thank you for your help, by the way. Dealing with beginners must be a headache

steel fox
#

Aslong as they don't take it for granted and read the wiki more and more. its worth it. Having a big ass steamworkshop is defo worth it, imho.

open scaffold
#

Honestly almost diverted to just downloading a mod that would do the same thing, but figured this would be more with it

quasi condor
#
'..._success} do {
_res = (call _findPlace) |#|findEmptyPosition [0, 2, _vehicleName];...'
Error findemptyposition:     .(   :     )
Error ]       .
File... blabla line 15
params ["_taskLoca", "_vehicleName"];

_findPlace = 
{
    _radius = random [100, 140, 200];
    _angle = random 360;
    _rdPos = _taskLoca getPos [_radius, _angle];
    nearestBuilding _rdPos
};

_finalPos = [0,0,0];
_success = false;

while {!_success} do {
    _res = (call _findPlace) findEmptyPosition [0, 2, _vehicleName];
    if (!(_res isEqualTo [])) then {
        _finalPos = _res;
        _success = true;
    };
};

_finalPos```
how to fix this error?
warm hedge
#

findEmptyPosition got an object instead of a position in your code it seems

little raptor
#

sounds more like you've put a hidden character there

#

that's a parsing error

#

but yeah you also need position

quasi condor
#

well i just used Enter and Space

warm hedge
#

But better to make sure

quasi condor
#

call _findPlace is not a position?

little raptor
#

no, you're returning an object

#

nearestBuilding

quasi condor
#

oh i see it

#

nearestBuilding returns object

#

i'll try getPos

little raptor
#

but you should still see if you've actually put any hidden characters there
if it was a syntax error you'd see type object, expected array

quasi condor
#

it says another errors, whatever it passed
thank you for help!

wind cairn
#

Is there a quick way of determining if a script has been run through execVM?

wind cairn
#

πŸ‘

past wagon
#

am I getting the syntax wrong with any of the BIS_fnc_randomPoss?

//INITIALIZE ZONE POSITION ARRAY
_zonePosArray = [
    [0,0,0], 2,
    [0,0,0], 2
];

//GET ZONE POSITIONS
_zonePos5 = if (random 10 > 5) then {
    [["pathZone"], ["water"]] call BIS_fnc_randomPos;
} else {
    selectRandomWeighted _zonePosArray;
};
_zonePos4 = [[_zonePos5, 10], ["water"]] call BIS_fnc_randomPos;
_zonePos3 = [[_zonePos4, 100], ["water"]] call BIS_fnc_randomPos;
_zonePos2 = [[_zonePos3, 500], ["water"]] call BIS_fnc_randomPos;
_zonePos1 = [[_zonePos2, 3000], ["water"]] call BIS_fnc_randomPos;

Syntax:
[whitelist, blacklist, code] call BIS_fnc_randomPos

Parameters:
[whitelist, blacklist, code]: Array
whitelist (Optional): Array - whitelisted areas. If not given, whole map is used. Areas could be:
Object - trigger
String - marker
Array - in format [center, radius] or [center, [a, b, angle, rect]]
Location - location.
blacklist (Optional): Array - blacklisted areas. If not given, water is blacklisted. Areas could be:
Object - trigger
String - marker name or special tags names: "water" - exclude water, "ground" - exclude land
Array - in format [center, radius] or [center, [a, b, angle, rect]]
Location - location.

#

I am trying to use the [center, radius] format in most of these cases

pliant stream
#

making battle royale are we? πŸ˜ƒ

#

anyway, it looks fine. is there a problem?

little raptor
ripe sapphire
#

yo bros is there a way to open a pilotcamera with script?

#

context: giving pilot a user action to open targeting pod (the one you normally open with ctrl+right click)

wind cairn
#

does execVM run the script on whichever client called it? or does it run it on the server?

wind cairn
#

thank you

#

can execVM be used with remoteExec?

winter rose
#

as can almost everything yeah

wind cairn
#

cool, thanks

wind cairn
#

is there any alternative to BIS_fnc_countdown? maybe i'm using it incorrectly, but my game says there is a script error in the function

little raptor
wind cairn
#

I wanna have a timer in my mission so that after the timer (eg 40 mins) runs out the script terminates

#

I haven't added the termination part yet

flint topaz
#

Me go to sleep now for 40 minutes

little raptor
#

just use sleep ... meowsweats

wind cairn
#

but in sleep how can you access the time remaining?

#

actually i guess you wouldnt need to

flint topaz
#

If you don’t need to don’t bother

#

If you do iterate though sleep with a delay of a second until you reach 0

wind cairn
#

yeah that would be way easier

torpid mica
#

Hey, merry Christmas everyone. Can someone help me with this small problem: I want to spawn many markers with the same code, but i donΒ΄t know how to make it working since there needs to be a different variable everytime. This is my code: ```sqf

private _markerName = createMarker ["_USER_DEFINED", getPos player];
_markerName setMarkerType "hd_dot";
_markerName setMarkerColor "ColorGreen";

the code should be executed multiple times to set markers on different locations. But therefore i need different variables every time. How can i do this?
torpid mica
little raptor
#
_markerID = missionNamespace getVariable ["my_markerCnt", 0];
_markerName = createMarker [format ["_USER_DEFINED%1", _markerID ], getPosASL player];
my_markerCnt = _markerID + 1;
hollow plaza
#

Where does activatedAddons get the addons from to list, as in what files/file does it search in order to know what addon files to count in.
I just noticed while testing out stuff with ACE - No medical that even though the mod has all ace_medical addons removed from the addons folder, it still says that stuff like ace_medical_engine is still active when I run the command in game.

#

What I'm trying to get done is use Improved Melee System alongside ACE - No medical due to an addon incompatibility using ACE Medical, but IMS thinks that ace medical is on so it fails to render damage. Might have to tinker around and make a local version of the mod but it'd be nice to know for future.

pallid ravine
#

How do you transition from an animation like "Surrender" to something else? the only thing that seems to work is switchMove, which is undesirable since it immediately snaps into the new animation.

little raptor
#

the only way is switchMove

pallid ravine
#

Got it, thanks!

little raptor
#

e.g.:

connectFrom[] = {"AmovPercMstpSnonWnonDnon", 0.01};
InterpolateTo[] = {"AmovPercMstpSnonWnonDnon", 0.01};
pallid ravine
#

It's a good idea, but I'm making tools for use in public zeus lobbies, so I'm pretty much restricted to vanilla behaviors, so I'll just have to accept having an instantaneous transition from a surrendered to captured state.

little raptor
pliant stream
#

Too bad there is no interpolateMove to complement switchMove

little raptor
#

otherwise AI can snap out of it easily meowsweats

pliant stream
#

Such a command should be very easy to add actually

little raptor
#

yeah

pliant stream
#

It wouldn't be perfect of course, many direct interpolations produce suboptimal results, but might be better than switchMove

small iron
#

do I absolutely have to create a separate file for a single function?
how do I call it from that file? I mean, I hope I don't have to write compile for every function

little raptor
#

you can just write "inline functions"

_fnc_doBla = {
  ...
};

call _fnc_doBla
small iron
#

that's what I needed, thanks

pliant stream
#

Is there a command that is to code as compileFinal is to string?

#

I do A2 and write all functions as shown, but i imagine in A3 you want to make the variables read-only

little raptor
pliant stream
#

It doesn't seem very amenable to defining multiple functions in a single file then

little raptor
#

yeah. which is why I wrote it as a local var meowsweats

pliant stream
#

I guess y'all just use that cfgfunctions thing, but i always found the practice of single function per file terribly unergonomic

little raptor
winter rose
#

or mimic an object with switch

little raptor
#
//blablas.h
_fnc_bla = {};
_fnc_blabla{};
#include "blablas.h"
pliant stream
#

In A2 it makes no difference because there is no compileFinal so i just write

my_global = 0;

my_fn_doSomething =
{
  my_global = my_global + 1;
};
winter rose
#
params [
  ["_mode", "", [""]]
];

switch (toLowerANSI _mode) do
{
  case "create": {};
  case "read": {};
  case "update": {};
  case "delete": {};
  default { ["case %1 does not exist", _mode] call BIS_fnc_error };
};
little raptor
pliant stream
#

Heh i would never do that. If the action is known statically then it better be bound statically too

pliant stream
#

What is the attack vector?

little raptor
#

some attacker changing the global var to a different var

pliant stream
#

But that is not in itself a viable attack vector

#

How do you achieve that in the first place? Overwriting a global

little raptor
#
fnc_heal = {
player setDamage 0;
};

hacker changes it to:

fnc_heal = {
player setDamage 1;
};
```🀣
#

there were some loopholes to execute code in MP. some were posted in some hacker forums. not sure if any of those loopholes still work

small iron
#

there is an error (screenshot: https://imgur.com/a/iND0kov) and I can't quite understand what's wrong

the code is something like this:

FNC_angleToCenter = 
{
  //... something something
  _rotation;
};

addMissionEventHandler ["EntityRespawned", // <-- line 16
{
  params ["_entity", "_corpse"];
  //...
}];
little raptor
#

Β―_(ツ)_/Β―

#

there's nothing wrong with what you wrote above

#

also

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
small iron
#

besides, it shouldn't have a ; there anyway

little raptor
#

oh you also posted the error

#

my bad

#

didn't see it

#

I think you have a hidden character before [

little raptor
small iron
little raptor
#

or should I say extra variable meowsweats

small iron
#

ah got it, it's meant to be driver instead of _entity

little raptor
#

because you've put two variables next to each other without an operator in between

#

SQF is an operator based language

small iron
little raptor
#

compile what?

small iron
#

how do I see the errors like in your screenshot?

little raptor
#

that's from a mod

small iron
#

cool, thanks

buoyant abyss
#

Ok so I'm making a mission that is set above 100 meters in the air.
So the players will be walking up there on a platform. The problem is that whenever I jump or whenever the character hits a lower plane below him, he goes into a freefall animation.

He can still walk but it gets annoying having to constantly wait for the freefall animation to end.

Now I've seen Leopard20's theory on how this could be fixed, in which he posted on the bottom of this page: https://feedback.bistudio.com/T75547. However even then, the problem hasn't been officially fixed yet.

#

If anyone happens to have any potential solutions to this problem, please feel free to share it. And if not, it's fine. I'll just deal with it and have the players walk on a much lower altitude.

quasi condor
#

MERRY CHRISTMAS (in korea)
https://sqfbin.com/duverufuzajebikecoca
This is my script and it doesn't work.
if i run the game, it stucks at loading screen and nothing happens.
I'm trying to fix this but I can't even know error. so please someone fix this as christmas present. blob_ChristmasBlob

little raptor
#

what do we get? πŸ˜›

buoyant abyss
#

Cookies perhaps

#

Those are tasty

quasi condor
#

hmmm..

buoyant abyss
#

Korean Cookies pls

quasi condor
#

ok i'll send it with fedex

buoyant abyss
#

It's a problem that's been bugging me for a while now

#

Eventually I just gave up and went to do other kinds of missions, but I wanted to see if there could be a fix to this

little raptor
#

I'll list them for you

quasi condor
#

okay..

#

ooh i forgot this one

#

findPlaceBuilding.sqf

params ["_taskLoca", "_vehicleName"];

_findPlace = 
{
    _radius = random [40, 100, 200];
    _angle = random 360;
    _rdPos = _taskLoca getPos [_radius, _angle];
    nearestBuilding _rdPos
};

_finalPos = [0,0,0];
_success = false;
_resultPos = [];

while {!_success} do {
    _res = (getPos call _findPlace) findEmptyPosition [0,2,_vehicleName];
    if (!(_res isEqualTo [])) then {
        _finalPos = _res;
        _success = true;
    };
};

if (!_finalPos isEqualTo [0, 0, 0]) then {_resultPos = getPos _finalPos;} else { };
_resultPos```
little raptor
quasi condor
#

it's my first sqf work

little raptor
#
  1. publicVariable: you're broadcasting local vars in your code (e.g. publicVariable "_point";). they must be global.
  2. for [{_i = 1},{_i<=(count _rdMissions - 1)},{_i=_i+1}] do {: your _i starts at 1. it should start at 0. also use the other for syntax (for "_i" from...)
_intel addAction ["적ꡰ 정보", {
    [name _task, "SUCCEEDED"] call BIS_fnc_taskSetState;
    deleteVehicle _intel;
}];

_intel addEventHandler ["Killed", {
    [name _task, "FAILED"] call BIS_fnc_taskSetState;
    deleteVehicle _intel;
}];

_task and _intel are not defined in those scopes
4. if (!_finalPos isEqualTo [0, 0, 0]): ! is a unary command. it has higher precedence than isEqualTo (binary command) so it executes first, but it acts on _finalPos -> error
either wrap the isEqualTo statement in parentheses !(_bla isEqualTo _blabla) or just use isNotEqualTo

pliant stream
#

Someone else was recently asking about the same thing

little raptor
#

yeah I tried but couldn't find any workaround

#

the engine keeps playing the animation

quasi condor
#

alright then i have to replace _intel to this?

little raptor
#

@buoyant abyss you still might be able to snap the players out of it using switchMove

#

but the "halo animation" still triggers for a brief period

little raptor
#

you should use the addAction args

#
_intel addAction ["적ꡰ 정보", {
    params ["_intel", "", "", "_task"];
    [name _task, "FAILED"] call BIS_fnc_taskSetState;
    deleteVehicle _intel;
}, _task];
#

something like that

quasi condor
#

can arguments be array?

little raptor
#

oh wait why did I think it was addAction? 🀣

#

I'm blind... meowsweats

quasi condor
#

there's the same problem at addAction

little raptor
#

oh so Im not blind 🀣

quasi condor
#

lol

little raptor
#

yeah so that covers the addAction

#

for the event handler I need to know what _task is

little raptor
little raptor
#

can it change?

#

does it depend on intel?

quasi condor
#

maybe it's not global variable

#

I defined _task at makeInteltask.sqf

little raptor
#

ok so you associate the "task" with the intel

little raptor
little raptor
#

why do you do name _task?

quasi condor
#

uh

#

wait i need to read docs

little raptor
#

yeah that's wrong

#
private _task = [
BLUFOR, 
format ["task%1", str _taskNumber], 
[format ["%1 κ·Όμ²˜μ— 적의 정보가 λ‹΄κΈ΄ 컴퓨터가 μžˆλ‹€. μˆ˜μƒ‰ ν›„ ν™•λ³΄ν•˜λΌ.", name _loca], "적ꡰ 정보 μˆ˜μƒ‰", "asdf"],
getPos _intel,
"CREATED",
-1,
true
] call BIS_fnc_taskCreate;
#

_task is just a bool

#

you need the taskID

#

which is this format ["task%1", str _taskNumber],

#
private _task = format ["task%1", str _taskNumber];
quasi condor
#

that will be better

#

but my main problem is

#

game stucks

#

when i play the game

little raptor
#

that will be "correct"
anyway:

_intel setVariable ["associatedTask", _task];
_intel addMPEventHandler ["MPKilled", {
    if (!isServer) exitWith {};
    params ["_intel"];
    _task = _intel getVariable ["associatedTask", ""];
    [_task, "FAILED"] call BIS_fnc_taskSetState;
    deleteVehicle _intel;
}];
little raptor
#

the publicVariable ones in particular

little raptor
#

it can loop forever

#

but you run it in execVM so I don't think that's why the game gets stuck

quasi condor
#

hmm... or just my computer sucks? πŸ˜†

little raptor
#

no, but your code has several errors, so ...meowsweats

final sun
#

Hello, I have a question regarding "find" and 2D arrays. Can it be used to find elements in it without having to loop through each cell
and then using "find"?
e.g _array = [[10,"Bob"], [35, "John"], [24,"Nick"]];
Reason is, I want to find the index of a unit in my array after a death has occured and I'm trying to avoid having a foreach loop(for array cells) inside
an event handler that itself is inside a foreach loop(for units)

copper raven
little raptor
#

you're just running the same thing all over again

final sun
quasi condor
little raptor
#

it might succeed if you increase the search radius every iteration

quasi condor
#

i can't increase radius because i'll hide it in a building

#

if I increase it, it will be spawned outside

little raptor
#

not findEmptyPosition

#

findEmptyPosition never returns a pos inside other objects afaik

quasi condor
#

oh

#

that's bad news

little raptor
#

did you even test it before using it? meowsweats

quasi condor
little raptor
#

well you should always test before using something

#

the debug console is intended for that very purpose. you write snippets and test how they behave

quasi condor
#

buildingPos will work. but I think intel might spawn inside something like bed and desk

#

then it cannot be found forever

little raptor
#

buildingPos is where AI can walk

quasi condor
#

oh

little raptor
#

it almost never is inside a "bed or desk"

quasi condor
#

wdym "almost"?

little raptor
#

also arma very rarely has beds and desks thonk

little raptor
#

like I said, the AI should walk there (tho AI has no collision so they can pass thru them). and the player should be able to go there too

little raptor
#

that can happen

quasi condor
#

no problem. i'll try buildingPos

quasi condor
#

well.. i have some problem.

_intel addEventHandler ["Killed", {
    [_task, "FAILED"] call BIS_fnc_taskSetState;
    deleteVehicle this;
}];```
i want to use `_task`, but I can't add arguments unlike `addAction`.
winter rose
#

indeed.

#

(you can use set/getVariable)

quasi condor
#

oh

#

this language is so confusing..

little raptor
quasi condor
#

i think the easiest and best language is kotlin

#

is there java library for arma 3? lol

little raptor
#

no

winter rose
#

to both statements

quasi condor
#

There's GREAT problem...

#

script doesn't create ANY tasks..

little raptor
quasi condor
#

oh i thought wrong

#

i played multiplayer

#

i'll try it again

#

omg it happened again

#

game stucks

little raptor
#

code

quasi condor
#

i think i can fix it

#

hmm it's still not working..

#

findPlaceBuilding.sqf

params ["_taskLoca", "_vehicleName"]; //_taskLoca position must be Pos2D

_findPlace = 
{
    _radius = random [40, 100, 200];
    _angle = random 360;
    _rdPos = _taskLoca getPos [_radius, _angle];
    nearestBuilding _rdPos
};

_finalPos = [0,0,0];
_success = false;
_resultPos = [];

while {!_success} do {
    _res = call _findPlace buildingPos -1;
    if (_res isNotEqualTo [0, 0, 0]) then {
        _finalPos = _res;
        _success = true;
    };
};
_finalPos```

makeIntelTask.sqf

```sqf
params ["_taskNumber", "_loca"];

private _pos3d = getPos _loca;
private _pos2d = [_pos3d select 0, _pos3d select 1];
private _objLocation = [];
while {_objLocation isEqualTo []} do {
    objLocation = [_pos2d, "Laptop_EP1"] execVM "Functions\findPlaceBuilding.sqf";
};

private _intel = "Laptop_EP1" createVehicle _objLocation;
[
BLUFOR, 
format ["task%1", str _taskNumber], 
[format ["%1 KOREAN", name _loca], "KOREAN", "asdf"],
getPos _intel,
"CREATED",
-1,
true
] call BIS_fnc_taskCreate;

private _task = format ["task%1", str _taskNumber];
textLog format ["Created Task: find Intel case. Pos: %1", _objLocation];

_intel addAction ["KOREAN", {
    _arguments = _this select 0;
    [_arguments select 0, "SUCCEEDED"] call BIS_fnc_taskSetState;
    deleteVehicle _arguments # 1;
}, [_task, _intel]];

_intel setVariable ["asdfTask", _task];
_intel addMPEventHandler ["Killed", {
    params ["_intel"];
    [_intel getVariable "asdfTask", "FAILED"] call BIS_fnc_taskSetState;
    deleteVehicle _this # 0;
}];```
little raptor
#

while {_objLocation isEqualTo []} do {
objLocation = [_pos2d, "Laptop_EP1"] execVM "Functions\findPlaceBuilding.sqf";
};
wat? meowsweats

quasi condor
#

how?

little raptor
#

or empty array

#

so _res isNotEqualTo [0, 0, 0] is always true

#

also keep in mind that not all buildings have positions

little raptor
#

it could be what's crashing the game for you

#

you're creating millions of scheduler threads

quasi condor
#

oh

#

that's terrible

little raptor
#

first of all, forget execVM

#

you're using it way too much

#

and wrongly

#

as for what's wrong with execVM:

  1. it recompiles the script every time you run it
  2. you can't return something from it (what you were doing by mistake there). instead it returns the handle to the created scheduler thread
  3. it creates a new scheduler thread (but keep in mind that "thread" doesn't mean multithreaded. SQF is single-threaded). you should avoid creating new scheduler threads as much as possible
quasi condor
#

i can't remove paused script from scheduler?

little raptor
#

you can. using its handle

#

now what are the alternatives?

  1. using CfgFunctions. it compiles the scripts only once.
  2. using compile preprocessFileLineNumbers "file.sqf", and storing the result into a variable as a function (but making sure you only do this once)
    you can call or spawn those functions like before
#

ofc if you're only running execVM once and you want a new thread it's ok to use

quasi condor
#

which one do you recommend?

little raptor
#

CfgFunctions when you want to run a code many times. you can call or spawn the function as many times as you want
for one time scripts, call compile preprocessFileLineNumbers "file.sqf" when you don't want to create a new thread and you want to return a result from a script.
and execVM for one time scripts with new thread

little raptor
quasi condor
#

like this?

class CfgFunctions
{
    class TAAG
    {
        class Category
        {
            class findPlaceBuilding {};
        };
    };
};```
little raptor
#

yeah but use your own tag meowsweats

quasi condor
#

it's my own tag

#

it's TAAG. not TAG

little raptor
little raptor
#

if you care ofc

quasi condor
#

It's crashing again.. and I'm very tireeeed..

#

in my country it's 3am

#

thank you leopard and have good night.. or good day..

past wagon
past wagon
little raptor
#

whitelist (Optional): Array - whitelisted areas. If not given, whole map is used. Areas could be:
Object - trigger
String - marker
Array - in format [center, radius] or [center, [a, b, angle, rect]]

#

[["pathZone"], ["water"]] call BIS_fnc_randomPos;
doesn't match any

#

Array
or does it mean arrays of those? thonk

#

oh right meowsweats

#

then I guess it's correct

#

Β―_(ツ)_/Β―

past wagon
#

hmm

little raptor
#

I got it backwards meowsweats

#

only the first one is correct

past wagon
#

oh

#

ohhh

#

I'm just missing a few []

digital hollow
#

Is there a solution for getting selection-space coordinates and vectors in sqf? I tried to do the vector coordinate-space-switching math, unsuccessfully
ie for something attached to "righthand", finding what vectorDirAndUp it needs to be to point a specific model- or world- orientation.
https://imgur.com/a/qXHPit2
The alternative would be to attach a helper object

past wagon
#

if I have a global variable, that variable will always be accessible anywhere in the mission, right?
For example:

zoneDamage = 0.02;

[] spawn {
  while { true } do {
    sleep 1;
    if (player inArea "restrictedZone") then {
      player setDamage (damage player + zoneDamage);
    };
  };
};

sleep 30;
zoneDamage = 0.05
```Will the spawned code start damaging the player by `0.5` after 30 seconds?
pliant stream
#

That's a global variable

past wagon
#

oh yeah

#

thats what i mean lmao

pliant stream
#

Except for some very specific stuff, yes it's accessible in all scripts on that client

past wagon
#

okay, so my code will work as I expect it to?

pliant stream
#

Uhh probably not

#

There is no guarantee of timely execution for scheduled scripts. In simple terms players with lower framerate may survive longer

pliant stream
digital hollow
#

As you can se in the pictures, attaching the laptop to the hand selection result in it pointing up along the arm. I want to calculate what vectorDirAndUp is needed to have it point, for example, toward the left of the player.

small iron
#

can I not call a pre-compiled function from another pre-compiled function?

#

they appear to be working just fine in init.sqf, but it throws "unknown variable" or something like that when I try to use them from another pre-compiled function

#

how do I go around this?

pliant stream
digital hollow
#

no, just face model right at that pose

pliant stream
#

Right, in a particular pose, of course

#

There is some selectionVectorDirAndUp command i think that probably gives you the rotation matrix for the hand

#

So you invert that and multiply it with the model space rotation matrix

digital hollow
#

Right, that's the vector math part that I failed at xD

small iron
pliant stream
#

Well you have commands for multiply and transpose. Transposing a rotation matrix inverts it

#

A 3x3 rotation matrix is just three perpendicular unit vectors. You already get the Z and Y unit vectors as dir and up. You just need aside which is their cross product

past wagon
#

say I have a zone marker on the map, and I want it to slowly move onto a random position. If I have the position, how would I constantly set it's position to be closer to it's final position until it gets there? Is there a command to make it move in a certain direction?

small iron
#

why does it have to be so painful?

digital rover
digital hollow
faint oasis
#

hi, there is a way to "SetDir" an object attached to a vehicle with the "simulation = false" ?

past wagon
faint oasis
past wagon
#

ik

#

just set the dir

faint oasis
faint oasis
# past wagon yes you can

if you have "enabled" the simulation on your "object" and this object is attached to a vehicle with "simulation disabled" you can't. I have tried you can try too.

#

but i will try to disable the simulation on the object too

past wagon
#

I just tested setting the dir of an object that has its simulation disabled, and you can

#

not sure about attachements

faint oasis
#

yeah but i don't mean an "object with simulation disabled" i mean an "object with simulation enabled but attached to a vehicle with simulation disabled" sorry for my english

past wagon
#

ok

wary python
#

Hello, is there a way to remove the magazine of a player's weapon
I know i could remove the weapon and then add it again, but i was wondering if there is an easier way

winter rose
wary python
#

works! Thanks :)

wary python
#

Is there any point in using removeMagazine instead of removeMagazineGlobal for MP missions?

copper raven
#

i think removeMagazine is local effect

#

so if you want to remove a magazine only for that specific unit on its machine, you can use that

wary python
#

If i add an EH to a playable unit in an MP mission, does it still work if that player respawns or would that be a new unit with no EH on it?

wind cairn
past wagon
#

i mean

#

you need to define it inside the spawn

#

you passed it, now you need to define it. you could do params ["_thisTrigger"] or _thisTrigger = _this select 1;

#

also, line 3 has an error with the string @wind cairn

wind cairn
#

what is the error? @past wagon

past wagon
#
thisTrigger setTriggerStatements ["this", "titleText ['text', 'BLACK'];  
                                                   ^ HERE
#

see how the entire rest of the line is blue, meaning its part of the string?

#

you never closed it

wind cairn
#

it continues on, that is a piece of code that goes to the onAct of the trigger

#

titleFadeOut 2;", ""];};

#

ended there

past wagon
#

ok

#

so that's supposed to be code?

wind cairn
#

yeah

past wagon
#

sorry, lemme check the syntax for that

#

oh then you are correct, my bad

#

didn't know the code was in the format of a string

wind cairn
#

I added the params ["_thisTrigger"]; but it's run into the same issue as before I put it into the spawn, where I get generic expression with the sleep command

past wagon
#

oh

#

you cant have sleep there

#

if that's the execution for a trigger, then it is an unscheduled environment, meaning there is no sleep/waitUntil/while allowed

wind cairn
#

Does putting spawn infront not schedule it?

past wagon
#

I guess not

#

well, I would think so, but if it's giving you "Generic Error in expression" for the sleep, then that might be the case

wind cairn
#

hmm, ill try find a workaround

tough abyss
#
null = [thisTrigger] spawn {
  params["_thisTrigger"];  
  _thisTrigger triggerAttachVehicle [player]; 
  _thisTrigger setTriggerActivation [   "VEHICLE", "NOT PRESENT", true ]; 
  _thisTrigger setTriggerStatements      ["this", "
    [] spawn {
      titleText ['text', 'BLACK']; 
      sleep 5; 
      forceRespawn (triggerAttachedVehicle thisTrigger); 
      sleep 2; 
  titleFadeOut 2;
    }
  ", ""];
};
#

@wind cairn try this

#

the issue is that you're using sleep in your trigger statement w/o spawn, trigger statements are not executed in a scheduled environment

wind cairn
#

I thought I was already using spawn, i must've been using it incorrectly

tough abyss
#

you were, but in the wrong area

#

see how I put one in the quoted code

wind cairn
#

Ah ok

#

I see, thanks very much

tough abyss
#

no problem

past wagon
#

why do some commands use code inside a string, anyway? Why not just {}?

quasi condor
#

hi, this is my code https://sqfbin.com/bacegogekagekerecebu and I have some problem.

  1. When I play the game, call TAAG_fnc_startMission; is not working inside init.sqf. But if i run this code in debug console, it works.
  2. If I spawn Laptop and Ammo box, error occurs.
'...laceBuilding;
};

private _destroyObj = |#|createVehicle ["BWA3_Box_Ammo", _objLoca..."
Error 0 ( )      .( : 3)
blabla (path) fn_makeSmallDestroy.sqf ..., line 10```
little raptor
# quasi condor hi, this is my code https://sqfbin.com/bacegogekagekerecebu and I have some prob...

while {_objLocation isEqualTo []} do { objLocation = [_pos2d, "FIR_MP_Laptop"] call TAAG_fnc_findPlaceBuilding; };
again, wrong.
deleteVehicle _arguments # 1; deleteVehicle _this # 0;
wrong. # is binary and has lower precedence
publicVariable "_point";
I told you before. DONT PUBLISH LOCAL VARIABLES
while {!_success} do { _res = call _findPlace; if (count _res isNotEqualTo 0) then { _success = true; _finalPos = _res; }; }; _finalPos
why do you keep using a while loop? use grid search

#

If I spawn Laptop and Ammo box, error occurs.
you didn't share that code

wind cairn
#

is there an equivalent to exit for sqf?

little raptor
wind cairn
#

a script

little raptor
#

use breakOut or if you're in the main scope, exitWith

wind cairn
#

will exitWith stop the script?

little raptor
#

if you're in the main scope

wind cairn
#

ok

copper raven
little raptor
#

not a unary command

quasi condor
#

Isn't it Hash-select operator?

little raptor
#

yes

quasi condor
#

..?

#

then what is hash-select operator

#

its precedence is 9

#

but select is 4

little raptor
#

who's talking about select?

quasi condor
#

wait i'm confused now

little raptor
#

deleteVehicle _this # 0;
wrong. # is binary and has lower precedence
I'm talking about unary commands

#

in this case deleteVehicle

#

all binary commands have lower precedence than unary commands

quasi condor
#

is binary and has lower precedence

you said # has lower precedence

little raptor
quasi condor
#

oh

#

i got it

#

sooo I should code like

_asdf = _this # 0;
deleteVehicle _asdf;```
this?
little raptor
#

or just use parentheses

#

deleteVehicle (_this#0)

quasi condor
#

you are genius

#

and what is grid search

little raptor
#

divide the map into grids

quasi condor
#

this one?

little raptor
#

no, you have to do it manually

#

you can divide the map into squares of a certain size

#

and search in these grids

quasi condor
#

there's no way to use position 3d?

little raptor
#

I mean search for the building in the grids

#

what you wrote may have a 0 chance of success right now

quasi condor
#

so you mean

#

nearestBuilding

#

cannot search buildings?

little raptor
#

nearestBuilding returns only 1 object

#

and that object may not even have building positions

#

you have to try new objects

little raptor
#
_objs = nearestObjects [_pos, ["house", "building"], 1000, true];
//get a few objects to randomize
_buildings = [];
{
  if (_x buildingPos -1 isNotEqualTo [] && {
    _buildings pushBack _x >= 4
  }) then {
    break; //collect up to 5 buildings
  };
} forEach _objs;
_building = selectRandom _buildings;
#

it's easier and performance wise it's ok

quasi condor
#

alright i'll try that

wind cairn
#

is it possible to disable a trigger locally for each player

little raptor
wind cairn
#

does that do more than just its animation and physics?

little raptor
#

since when a trigger has animation and physics? thonk

wind cairn
#

thats why im confused, what exactly does it disable?

little raptor
#

the trigger

#

it will no longer check the condition and won't activate

wind cairn
#

ok

quasi condor
#
_nearObjects = nearestObjects [_pos, [], 400];
_buildings = [];
{
    if (_x buildingPos -1 isNotEqualTo [] && {_buildings pushBack _x >= 4}) then {break;};
} forEach _nearObjects;
_building = selectRandom _buildings;
getPos _building```
is this right?
#

i think getPos is incorrect

little raptor
#

don't use empty type [] meowsweats
do you have any idea how many objects there could be?!

and no, don't use getPos

#

don't ever use getPos

#

read the wiki as to why

#

also didn't you want a buildingPos?
just return selectRandom (_building buildingPos -1)

quasi condor
#

hmm

#

another error occurs

#
'...ndPlaceBuilding;

private _destroyObj = |#|createVehicle ["BWA3_Box_Ammo", _objLoca...'
Error 0 ( )     .( : 3)
File (path) fn_makeSmallDestroy.sqf
#

and i have question

#

how to read that error?

#

it gives a little information

#

and wth is Error 0 ( ) .( : 3)

wind cairn
#

Is there any way to terminate a script from inside a loop?

#

would 'stacking' exitWith statements work?

#

e.g

{
   if (!(alive player)) exitWith 
   {
       exitWith{};
   };
};
little raptor
wicked roostBOT
#
Arma RPT

Arma generates a .rpt log file each time it's run, which contains a lot of information like the loaded mods, or any errors that appear, this log file can be very useful for troubleshooting problems.

To get to your RPT files press Windows+R and enter %localappdata%/Arma 3

Additionally see the wiki page for more info: https://community.bistudio.com/wiki/Crash_Files

To share an rpt log here, please use a website like https://sqfbin.com/ to upload the full log, that way the people helping you can take a look at it and try to figure out the problem you're having together with you.
Note: RPT logs can hold personal information relevant to your system, the game or others.

little raptor
quasi condor
little raptor
quasi condor
#

it's the same code

little raptor
#

that's wrong

#

textLog doesn't exist

quasi condor
#

it was in VSC sqf extension

#

whatever i removed it

little raptor
#

well it exists, but it does nothing

#

always use the wiki

#

that extension is outdated

#

but anyway that is not the source of the error

#

and I don't see anything else wrong

quasi condor
#

This command is non-functional in the retail version
bruh

#
params ["_taskNumber", "_loca"];

private _pos3d = getPos _loca;
private _pos2d = [_pos3d select 0, _pos3d select 1];
private _objLocation = [_pos2d, "BWA3_Box_Ammo"] call TAAG_fnc_findPlaceBuilding;

private _destroyObj = createVehicle ["BWA3_Box_Ammo", _objLocation, [], 2, "NONE"];
private _task = format ["task%1", str _taskNumber];
[
BLUFOR, 
format ["task%1", str _taskNumber], 
[format ["%1 κ·Όμ²˜μ— 적의 탄약 μƒμžκ°€ μžˆλ‹€. 발견 μ¦‰μ‹œ νŒŒκ΄΄ν•˜λΌ.", name _loca], "적ꡰ νƒ„μ•½μƒμž μˆ˜μƒ‰", "asdf"],
getPos _destroyObj,
"CREATED",
_taskNumber,
true
] call BIS_fnc_taskCreate;

_destroyObj setVariable ["asdfTask", _task];
_destroyObj addMPEventHandler ["Killed", {
    params ["_destroyObj"];
    [_destroyObj getVariable "asdfTask", "SUCCEEDED"] call BIS_fnc_taskSetState;
    (deleteVehicle _this # 0);
}];```
#

here

#

this is fn_makeSmallDestroy.sqf

#

error occurs line 7

little raptor
#

I don't spot anything thonk

#

also there's no need to use str for format

quasi condor
#

private _destroyObj = createVehicle ["BWA3_Box_Ammo", _objLocation, [], 2, "NONE"];
something went wrong here

little raptor
#

my linter only shows this error:

#

which you still haven't fixed

quasi condor
#

hmmm

little raptor
#

also _this # 0 is _destroyObj

quasi condor
#

do you need .rpt file?

little raptor
#

no. what is TAAG_fnc_findPlaceBuilding now?

quasi condor
#

fn_findPlaceBuilding.sqf

little raptor
quasi condor
#

jejus

#

alright

#

that error is gone

#
21:00:17 Error in expression <_intel setVariable ["asdfTask", _task];
_intel addMPEventHandler ["Killed", {
pa>
21:00:17   Error position: <_intel addMPEventHandler ["Killed", {
pa>
21:00:17   Error ?쒗쁽?μ•ΉλΏ‰ ?λΊ€μ“½?섏? ?딆? θΉ‚Β€??_intel)εͺ›Β€ ?덉뒿?λˆλ–Ž. (crashed. I can't read it)
21:00:17 File path..., line 20```
little raptor
#

crashed. I can't read it
like I said read the rpt

quasi condor
#

yeah that was in rpt

little raptor
#

?쒗쁽?μ•ΉλΏ‰ ?λΊ€μ“½?섏? ?딆? θΉ‚Β€??_intel)εͺ›Β€ ?덉뒿?λˆλ–Ž
I don't understand korean. what is that saying? meowsweats

quasi condor
#

that's not even korean

#

we don't use chinese character θΉ‚,εͺ›

little raptor
#

yeah but the rest are korean meowsweats

#

anyway...

#

maybe change the game language to English?

quasi condor
#

we can see it if I open utf-8 encoded txt file with ASCII reader

#

ok i'll try it

wind cairn
#
{
    if (!alive player) then 
    {
        "appTriggerInner" enableSimulation false;
        "appTriggerOuter" enableSimulation false;
        titleText ["You Have Been Killed.", "BLACK"];
        sleep 2;
        titleFadeOut 2;
        breakOut "main";
    };
};```
#

Any idea why its not taking the if path when the player dies?

little raptor
#

you need to create the scope

#

using scopeName

wind cairn
#

I did

#

forgot to invlude in post

little raptor
#

we have event handlers

quasi condor
#

lol game & launcher crashed

little raptor
#

and more importantly never use while loops without sleep

quasi condor
#

don't buy iMac..

wind cairn
#

without? why not?

little raptor
#

a player cannot "die" in that frame, no matter how many times you check meowsweats

wind cairn
#

ok

little raptor
wind cairn
#

does it matter where the event handler is in the code?

little raptor
#

no. it should be only used once. after you add it it'll fire every time that event happens

wind cairn
#

cool

quasi condor
#

finally

#

it makes normal error message

#

Error Foreign error: Unknown enum value: "Killed"

#

is it MPKilled?

little raptor
#

yes. why did you change it?

quasi condor
#

ummm

#

idk

wind cairn
#
{
    params ["_unit", "_killer", "_instigator", "_useEffects"];
    "appTriggerInner" enableSimulation false;
    "appTriggerOuter" enableSimulation false;
    titleText ["You Have Been Killed.", "BLACK"];
    sleep 2;
    titleFadeOut 2;
    breakOut "main";
}];```
still doesn't seem to work
little raptor
wind cairn
#

ah ok

little raptor
#

wrong

#

breakOut "main";
wrong

little raptor
wind cairn
#

how do you access the triggers?

small iron
little raptor
#

but not wrapping them in ""

#

that forms a string

#

it's not a variable anymore

wind cairn
#

doesn't seem to pick it up even though its in mission.sqm

quasi condor
#
_HVTobj addMPEventHandler ["MPKilled", {
params >
21:30:33   Error position: <addMPEventHandler ["MPKilled", {
params >
21:30:33   Error Generic error in expression
21:30:33 File path ..., line 20```
little raptor
quasi condor
#

21:30:42 Cannot create non-ai vehicle FIR_MP_Laptop,

wind cairn
#

nvm bug on my end i think

little raptor
#

are you sure it even exists?

quasi condor
#

wait

#

what the heck

#

cannot find FIR_MP_Laptop

little raptor
#

where did you even get that name in the first place?

quasi condor
#

maybe it's addon object

#

i replaced Land_Laptop_device_F

quasi condor
little raptor
quasi condor
#
params ["_taskNumber", "_loca"];

private _pos3d = getPos _loca;
private _pos2d = [_pos3d select 0, _pos3d select 1];
private _objLocation = [_pos2d, "O_Officer_Parade_Veteran_F"] call TAAG_fnc_findPlaceBuilding;

private _HVTobj = [_objLocation, east, ["O_Officer_Parade_Veteran_F"]] call BIS_fnc_spawnGroup;
leader _HVTobj disableAI "all";
private _task = format ["task%1", str _taskNumber];
[
BLUFOR, 
format ["task%1", str _taskNumber], 
[format ["%1 κ·Όμ²˜μ— HVT (κ³ κ°€μΉ˜ ν‘œμ )이 μžˆλ‹€κ³  ν•œλ‹€. μƒν¬ν•˜μ—¬ κΈ°μ§€λ‘œ λ³΅κ·€ν•˜λΌ. λͺ©ν‘œλŠ” 열병식 예볡(μ°Έμ „μš©μ‚¬, CSAT) 볡μž₯을 μž…κ³  μžˆλ‹€.", name _loca], "적ꡰ HVT 생포", "asdf"],
getPos leader _HVTobj,
"CREATED",
_taskNumber,
true] call BIS_fnc_taskCreate;

_HVTobj setVariable ["asdfTask", _task];
_HVTobj addMPEventHandler ["MPKilled", {
    params ["_intel"];
    [_HVTobj getVariable "asdfTask", "FAILED"] call BIS_fnc_taskSetState;
    deleteVehicle (_this # 0);
}];```
little raptor
#

_HVTobj is a group

#

BIS_fnc_spawnGroup
just use createUnit

quasi condor
#

finally

#

no error now

#

but there's problem

#
_point = 400;
_pointMarker = createMarker [format ["Point: %1", _point], position wherePoint];
_pointMarker setMarkerType "loc_help";
_pointMarker setMarkerText format ["Point: %1", _point];
sleep 10;
call TAAG_fnc_startMission;```
this is `init.sqf`
#

but call TAAG_fnc_startMission; does nothing

#

but if i run that code in debug console, it works

little raptor
#

and what's TAAG_fnc_startMission?

quasi condor
#
_rdMissionCount = random [4, 6, 8];
_rdMissions = [];
// _missionTypes = ["hvt", "kill", "destroysmall", "destroy", "terminal", "hostage", "intel"];
_missionTypes = ["hvt", "destroysmall", "intel"];
_missionAreas = [
    benio,
    corazon,
    drassen,
    elvillon,
    fernando,
    lospeligron,
    manteria,
    maruko,
    sanarulco,
    victorin
];
_rdMissionArea = selectRandom _missionAreas;

for "_i" from 0 to (_rdMissionCount - 1) do { 
    _rdMissions set [_i, selectRandom _missionTypes];
};

for [{_i = 0},{_i<=(count _rdMissions - 1)},{_i=_i+1}] do {
    switch (_rdMissions select _i) do {
        case "hvt": {[_i, _rdMissionArea] call TAAG_fnc_makeHVTtask};
        //case "kill": {[_i, _rdMissionArea] execVM "TaskFunctions\makeKilltask.sqf"};
        case "destroysmall": {[_i, _rdMissionArea] call TAAG_fnc_makeSmallDestroy};
        //case "destroy": {[_i, _rdMissionArea] execVM "TaskFunctions\makeDestroytask.sqf"};
        //case "terminal": {[_i, _rdMissionArea] execVM "TaskFunctions\makeTerminaltask.sqf"};
        //case "hostage": {[_i, _rdMissionArea] execVM "TaskFunctions\makeHostagetask.sqf"}; TODO
        case "intel": {[_i, _rdMissionArea] call TAAG_fnc_makeInteltask};
        default { }; 
    };
};```
little raptor
#

for [{_i = 0},{_i<=(count _rdMissions - 1)},{_i=_i+1}]
ditch that for syntax

#

you don't even need for

#

ever heard of forEach? meowsweats

quasi condor
#

well..

#

i didn't know about forEach when I make that code

#

whatever it works

#

sooo

#

call TAAG_fnc_startMission; why this code is not working in init.sqf

wind cairn
#

leopard is there a way to exit the script when the event handler is executed?

#

sorry for interuppting

quasi condor
#

uh

quasi condor
#

handler's argument

wind cairn
#

the script the event handler is in like initPlayerLocal.sqf -> script.sqf (where event handler is) exit that script and go back to initPlayerLocal.sqf

little raptor
#

you can't