#arma3_scripting

1 messages Β· Page 427 of 1

haughty jewel
#

the wiki is both helpfull and confusing lol

young current
#

and most commands are the same

haughty jewel
#

true, its just putting them together i have problems with.

#

Cache1MarkerPos = [getPos cache1, random 350, random 360] call BIS_fnc_relPos; "markertest" setmarkerpos Cache1MarkerPos

#

that seems to work just double checking

#

yup that works, not sure how its diffrent.

#

cheers

young current
#

ah yeah you had that fnc there too

#

forgot about that

haughty jewel
#

this has taken me too long to get working

#

time to make the mission lol

quartz coyote
#

Hello
I'm having trouble with the Score in FFA gamemode.
I thought it was due to west setFriend [west, 0]; so I tried with player addrating -100000; but got the same result :
When I crash my own plane, the server gives me 5 points though it is a suicide... can someone help ?

sharp silo
#

Hello I'm making a PvP conquest mission and have icons showing above friendly players but they won't show when the player enters a vehicle I'm not sure how to do this any help would be great I can also link what I have so far

halcyon crypt
#

I may be wrong but I don't think you can get the exact world position of a player inside a vehicle and you'd have to use the vehicle itself to place an icon

#

again, probably wrong πŸ˜›

sharp silo
halcyon crypt
#

can't you just take wasteland and check how they did it?

sharp silo
#

I'm new to making missions this is my 1st PvP mission I'm not sure how I would do that

sharp silo
#

Oh right thanks

halcyon crypt
#

that seems to be way more complex than it should've been I think

sharp silo
#

I'm a complete nub nub mate can you point me in the right direction to what I'm looking for in that lol

halcyon crypt
#

look for drawIcon3D and backtrack from there

#

drawIcon3D -> foreach drawPlayerIcons_array -> find all the places where drawPlayerIcons_array is modified -> etc -> etc ^^

sharp silo
#

Ok cheers mate

sharp silo
#

Have no clue how to add that to what I already have lol @halcyon crypt I'll have to do a lot more research thanks again for your help mate

sour saffron
#

what is the lastest and greates positional command ? , it seems Arma has developed a greater level of Aids in relation to float point problems from [0,0,0]

peak plover
#
private _myArr = [1,2,3];
for '_i' from 1 to 10 do {
    _myArr append _myArr;
};

Is this a bad way of repeating array

errant jasper
#

@peak plover beware! This keeps adding larger and larger arrays

peak plover
#

Ahh right

errant jasper
#

And that's assuming the implementation can even handle same argument both sides.

peak plover
#

Is there 'good' alternative?

winter rose
#

yup, ran into this very stupid design not later than last week :D
[1,2,3] + [1,2,3], [1,2,3,1,2,3] + [1,2,3,1,2,3], etc πŸ˜„

errant jasper
#

Just use a different array with what you want to add

winter rose
#

what exactly do you want to do?

peak plover
#

I need this array not to run out

#

any time soon

errant jasper
#

So _addArray = [1,2,3]; _resultArray = []; .... add _addArray to _resultArray X times.

winter rose
#

^

errant jasper
#

*add meaning append

peak plover
#

_locArr append _loc;

errant jasper
#

yeah

peak plover
#

okay makes sense

#

Thansk

winter rose
#

or

for '_i' from 1 to 10 do {
    _myArr append _i;
};

?

#

you would then end with a [1,2,3,4,5,6,7,8,9,10] array

peak plover
#

I need to repeat the elements in the first array

#
private _loc = [1,2];
private _locArr = []; 
 
// make location arr bigger 
for '_i' from 0 to 10 do { 
 _locArr append _loc; 
};
_locArr
winter rose
#

then Muzzleflash's code it is

peak plover
#

Yah

errant jasper
#

Another option may be not to remove elements from the array at all - if possible.

peak plover
#

Actually

#

I found a better solution for my situation

#

I'll just check when array runs out and append once

#

per empty arr

#

Ahh I can use mod for selecting the array element

#

Don't even have to edit array

winter rose
#

you wanted some alternance I guess?

#

can we get the context?

peak plover
#

I'm doing custom sides and respawns for those sides

#

Amount of locations can be from 0 to any

#

amount of sides

#

0 to any

#

Well

#

not really 0

#

from 1 to any

#

sides from 2 to any

#

//    // west and east vs resistance and civilian
//    [['Good Guys',west,east],['Bad Guys',resistance,civilian]]
//    [respawn_round_loc_1,respawn_round_loc_2]
#

I just mod the amount of locations

#

so no matter how many sides, they all get 1

winter rose
#

do you want a random respawn location or always 1, 2, 3 then 1, etc. ?

peak plover
#

In a row

#

1st side gets first 2nd gets second 3rd gets 1st

#

I'm making it so

#

Sides can be defined as single units

#

Or group

#

or whatever really

winter rose
#

oh ok

peak plover
#
[['Alpha','blu_1'],['Bravo','blu_2'],['Charlie','blu_3'],['Delta','blu_4']]

for ex.

#

4 squads

still forum
#

@errant jasper And that's assuming the implementation can even handle same argument both sides.
It doesn't even know if they are the same.

errant jasper
#

@still forum
More like whether it had a naive implementation like:
for (elem : source) target.add_back(elem)
which would 'never' terminate depending on implementation details.

#

E.g. if an iterator was used that did not get invalidated.

still forum
#

oh.........

#

Eh....

#

Hm..

fleet wind
#

How can i turn a picture (Make it rotate / spin) in a dialog?

errant jasper
#

Example in Python:

mylist = [1,2,3]
for x in mylist:
mylist.append(x)

still forum
#

Nah. I think it copies with iterator range

#

allocate new buffer.
copy old content
copy over content to append
replace buffer in array object with new one.

queen cargo
#

@errant jasper sqf-vm dies when doing that πŸ˜…
Not sure about arma, but my sqf implementation gets fucked up because of using the size Parameter of the array in a for loop as upper limit

errant jasper
#

I think you should be okay, if you just read the size once

queen cargo
#

You would be
But I did not do because lazy

unborn ether
#

Home sweet home

queen cargo
#

Well.. The c branch won't get any more love anyways πŸ€·β€β™‚οΈ

#

I Rly hate how that emojie works on my keyboard but not in discord πŸ˜‘

subtle ore
#

I was a little confused X39

queen cargo
#

It is the other gender Variant

subtle ore
#

Yeah but why?

queen cargo
#

But discord sends it out that way

#

Because reason

subtle ore
#

Reason is good enough with me

tender fossil
#

Why does event based code lead often to low coupling of components/code? I hear this often in game programming but I don't directly understand how the latter could result in from former

cedar kindle
#

because it’s subscription based

#

the code that publishes doesn’t have to know about the one that subscribed and continues to function with or without it

tender fossil
#

Interesting, I've been doing that unintentionally I guess

#

So the data feeded to event is publisher and events are subscribers?

winter rose
#

triggering an event is "publishing", attaching yourself to said event is subscribing

tender fossil
#

Yes, that's what I meant

#

Thanks! You're actually the first ones that gave me an answer πŸ˜„

cedar kindle
#

i didn't ? πŸ€”

winter rose
#

obsolete message: hey! @cedar kindle ^ helped (I don't know if you saw his messages)

#

@cedar kindle NO you didn't πŸ˜›

cedar kindle
#

you asked why it was considered low coupling :p

winter rose
#

first oneS

#

we both helped, we are the first oneSSS

#

it's because we are a priceless, helpful community πŸ‘Œ

tender fossil
#

πŸ‘Œ

winter rose
#

hahaha sorry for the misunderstanding here m8 - you're welcome!

sharp silo
#

can someone have a look at this please im really stuck i nned the icon to show above friendly players in vehicles at the minute it only shows when they are on foot thanks in advance https://pastebin.com/259KYNqN

meager heart
#

nearestObjects [position, types, radius, 2Dmode]

#

and you have _units = nearestObjects[(visiblePosition player),["Man"],500];

sharp silo
#

ok thanks @meager heart how do i get the class name for the ATV or is that what i put in

meager heart
#

Right click on an object in Eden > Log > Copy class name.

sharp silo
#

got it mate thanks very much

lusty canyon
#

is it possible to create a light source thats directional/conical like a flashlight? so far all the objects bleed light everywhere even through walls.

subtle ore
lusty canyon
#

@subtle ore tried that but didnt give me what i wanted, some of the static camping gear props have a good light cone on them. is it possible to create them but only have the light source visible?
hideobjectglobal also makes the light invisible as well 😭

young current
#

arma+lights does not allow very complex stuff

#

what are you trying to do exactly? might be other ways to do it

subtle ore
#

@young current I think the idea is to form a light that shines sort of like a flashlighgt in a circular pattern

is it possible to create a light source thats directional/conical like a flashlight? so far all the objects bleed light everywhere even through walls.
lusty canyon
#

yeah i want to add a flashlight to the remote designator turret axis

tough abyss
#

When spawning objects (such as a carrier) server-side, if you teleport players to the position on the carrier shortly after, the carrier is missing or parts are missing. After a couple minutes, there is no issue. Is there a way to transmit the data to the clients immediately so it isn't an issue?

young current
#

what kind of an object is this remote designator turret?

subtle ore
#

it's the ones you plop down on the ground and designate things in view

young current
#

vanilla thing?

subtle ore
#

Yes

young current
#

ah

#

shows what I know πŸ˜„

subtle ore
#

Lol

young current
#

and I assume it has to move with it?

subtle ore
#

What has to movd with it?

young current
#

the light

#

with the designator

lusty canyon
#

yeah has to move wth it

young current
#

so you want to create a spotlight?

subtle ore
#

There is no light

young current
#

?

subtle ore
#

it's like a designator with a servo stand

lusty canyon
#

flashlight

young current
#

one of you should now do the talking

lusty canyon
#

B_Static_Designator_01_F

#

thats the vanilla designator

subtle ore
#

I'm sorry, i don'f mean to confuse.

young current
#

np. It just gets confusing fast like that πŸ˜„

lusty canyon
#

its slaved to the players crosshairs (lineintersect) so whatever the player looks at the turret also moves too, now i need a flashlight attached to its turret

young current
#

so kinda like a spotlight

lusty canyon
#

what if a take one of those camping prop torches and remove the model? will it still light up?

young current
#

remove the model how?

lusty canyon
#

like cfg model = "";

young current
#

could be

subtle ore
#

Why not just create it based on model selection?

lusty canyon
#

whats model selection?

subtle ore
#

Just like the player has selections for their hands, feet, etc . They're sort of like reference points. Although i believe some are used for hit detection, not sure though

young current
#

so create a light at the player?

#

or what?

young current
#

its not the same

subtle ore
#

And you can add a ui event handler to check if the mouse is moving x and y

#

How do you mean?

young current
#

if I understood right this is whats wanted

#

not this

subtle ore
#

Yes, i never implied it was attached to the player

lusty canyon
#

ok so i can createvehicle "camping_torch_whatever" get the model selections then use hideselection on it so only the light source remains?

young current
#

if it has hiddenselection

lusty canyon
#

yeah flashlight should be attached to turret axis

young current
#

which it may not have

subtle ore
#

You'd have to check with: selectionNames

lusty canyon
#

ok ill try that, thanks

meager heart
#

nice drawings

#

weapon details and soldier uniform... really impressive

young current
#

πŸ€”

meager heart
#

πŸ˜„

fleet wind
#

How can i set a variable with defult value (ie if the variable gets changed and the code runs again whatever its set to latest is what it will be and not refresh with what ive called defult) what ive written makes little to no sese if someon gets what i want they are magician.

little eagle
#

English?

meager heart
#

set a variable with defult value or get a variable with defult value ?

fleet wind
#

Set a variable

little eagle
#

You lose me after "the code runs again".

fleet wind
#

tbh i lost myself when i wrote it.

little eagle
#

I mean.

if (isNil "_var") then {
    _var = <default-value>;
};
fleet wind
#

Let me try again EXAMPLE code ```sqf
_round = 1

if (_round == 1) then {
bla bla bla
}
else
{
if (_round > 1) then {
.....
}
}

_round = _round + 1;

little eagle
#

Is that part of a loop? Or is it a different script instance every time?

fleet wind
#

Nope¨

unborn ether
#

To init an extension from addon, you just put an extension in the pbo root?

little eagle
#

What nope? Neither?

fleet wind
#

Its a function and NOT in a loop

little eagle
#

So it's a different script instance every time.

fleet wind
#

Yes

little eagle
#

You probably need a global variable then.

fleet wind
#

Wouldent this work ?``` if (isNil "_var") then {
code
}
else
{
if (_var > 1) then {
code
}
_var = _var +1;

#

OO no NVM it wouldent work

little eagle
#

No.

fleet wind
#

crap

meager heart
#

maybe varspace getVariable [name, defaultValue] and use switch, James Grimm ?

unborn ether
#

Dudes one question to anybody who works with callExtension: to init extension from pbo (addon) you just need to put it in the pbo root?

tough abyss
#

you can put it in any addon root or arma3 root directory.

unborn ether
#

@tough abyss thanks.

subtle ore
#

dudes

lusty canyon
#

how can you get any unit to open the arsenal? (ai can be ordered to open arsenal by ammobox addaction, but they take forever to move next to the damn box)


            ["Open",cursortarget] spawn BIS_fnc_arsenal;

always just opens the arsenal for the player

little eagle
#

The arsenal obviously only is a player thing and not for the ai.

lusty canyon
#

like i said it does work on the ai but only through addaction

little eagle
#

Please explain what the ai would do with the arsenal.

lusty canyon
#

i just tested it a second ago, players can select items for the ai

subtle ore
#

I think:
Player edits own self -> Arsenal
Player edits ai loadout -> Arsenal

#

I believe it also has to do where it's executed local to

little eagle
#

but only through addaction
Example?

#

I only know this from the editor.

lusty canyon
#
["AmmoboxInit",[<box>,(<allowAll>,<condition>)]] spawn BIS_fnc_arsenal;

fnc adds an action to the box, then you order your AI next to the box. player can then proceed to select whatever

#

what im asking is a way to bypass that altogether and just open the arsenal on whatever is cursortarget

little eagle
#

Where's the addAction?

lusty canyon
#

the action is on the box itself made by the fnc

subtle ore
#

Take a look at the function itself and it's valid parameters

#

the two you posted above are both biki examples

little eagle
#

If it's not documented on the wiki, then it probably doesn't exist. Good luck working yourself through the arsenal functions, which is 3200 lines of horribleness.

#
["Open",[true,objnull,_entity]] call bis_fnc_arsenal;

3den does this, but who knows if that works ingame. Syntax is not documented in the functions header.

lusty canyon
#

WOW, that works!

little eagle
#

lol

lusty canyon
#

the good thing also those params magically unlocked face/insignia stuff too

little eagle
#

I just copy pasted this from the function that is used in the 3den config. Β―_(ツ)_/Β―

#

BIS_fnc_3DENEntityMenu

#

Apparently in "Open" mode, arg[1,0] means fullArsenal, while [1,1] is the "cargo" and [1,2] is the "center".

#

Guess "center" means which unit is getting dressed up.

#
        "Open" - Open the Arsenal
            0 (Optional): BOOL - true to open full Arsenal, with all categories and items available (default: false)

1,0 is documented, the other two aren't.

#

cargo and center. Both OBJECT. cargo defaults to objNull and center defaults to player.

lusty canyon
#

thanks for that one, next question : can you make a lamp object invisible but still keep the light source it emits?
i tried

{ _campLightStaticProp hideSelection [ _x , true ]; }foreach selectionNames _campLightStaticProp ; 

but nothing happened

little eagle
#

Pretty sure hideSelection only works on simple objects, and those don't emit light afaik.

lusty canyon
#

"Land_PortableLight_single_F" makes a bright directional light cone, i want to use just the light. how to remove extract make model invis?

little eagle
#

Never heard anyone do this, Probably not possible.

meager heart
#

btw you can hide arsenal preload with loading screen

lusty canyon
#

how?

#

if its a mission level thing then nvm i dont want to unpack pbo s

meager heart
#
//--- That will hide arsenal preload
["LoadingScreen"] call BIS_fnc_startLoadingScreen; 
//Preload arsenal 
["Preload"] call BIS_fnc_arsenal;
/* add/remove items */
["Open",[false,_origin]] call bis_fnc_arsenal;
["LoadingScreen"] call BIS_fnc_endLoadingScreen;
#

that will auto open it...

#

_origin that is player

lusty canyon
#

what happens if you just call the preload without a loading screen?

meager heart
#

it will not work i think and then when you try open it /auto open it... first will be preload and after... arsenal

#

with that "hide trick" everything will looks just like normal mission start and arsenal will just open immediately with the action

#

I have "example mission" with the arsenal things ... can send it to you

lusty canyon
#

nah all good thanks (im alergic to missions and cfg, i live in pure SQF land)

meager heart
#

then glhf πŸ˜€

unborn ether
#

What happens to a function within CfgFunctions which has no tag but has preInit or postInit argument. Compiled without tag or just thrown away?

worn hatch
#

Is it possible to stop a specific weapon being holstered? like making it impossible for a certain weapon to actually be holstered

worn hatch
#

or at worst is there anyway to detect when a weapon gets holstereed? so I can then use the DropWeapon action?

unborn ether
#

@worn hatch primaryWeapon|secondaryWeapon|handgunWeapon against currentWeapon will allow you to compare what unit has in his hands and which is on the back.

exotic tinsel
#

how do i add a JIP to a custom radio channel? i have this in my initserver.sqf.

MB_AlphaChannel = radioChannelCreate [[0,0.165,0.439,1], "Alpha", "Alpha", []];
    publicVariable "MB_AlphaChannel";
#

i have this in my init.sqf file but its not working

[player] remoteExec ["TLS_fnc_ChannelSettings", -2, false];
#

and this in my function after i do some player role detection

MB_AlphaChannel radioChannelAdd [_player];
velvet merlin
#

how would you optimize a check on all vehicles avoiding them to flip over?

#

current approach for one vehicle

while {alive(_vehicle)} do
{

    _vel = velocity _vehicle;
    _dir = direction _vehicle;
    _velocity = (_vel select 2);

    sleep 0.25;

    if ((vectorUp _vehicle select 2) < 0.55) then
    {
        _vehicle setVectorUp [(vectorUp _vehicle select 0) * 0.5,(vectorUp _vehicle select 1) * 0.5,0.60];
    };

    if ( (((_vel select 2) - _velocity > 4)) ) then
    {
        _vehicle setPos [ getPos _vehicle select 0,getPos _vehicle select 1,0.5];
        _vehicle setVelocity [((_vel select 0)+(sin _dir)) * 0.5,((_vel select 1)+(cos _dir)) * 0.5,0];
    };
};```
#

wondering if additional more simple checks when looping on all vehicles may be useful

compact galleon
#

@velvet merlin Maybe just stack the execution

little eagle
#

@unborn ether Every function in CfgFunctions has a tag. There's no such thing as a function without tag.

#

Stop trying to hide your code. If someone wants to find out what your mission does, they will.

#

@exotic tinsel Check the RPT. radioChannelAdd has to run on the players machine, but you use remoteExec for some reason.

still forum
#

@velvet merlin I guess optimal way... Only run that script on the guy that owns the vehicle. aka the driver. So that one client can have at most one of these scripts running.

little eagle
#

I think it's mainly for AI.

#

Should be times sin/cos _dir, not plus sin/cos _dir btw.

warm gorge
#

Anyone have any idea why when I create a dialog from initPlayerLocal and once the player is no longer null and the main display isnt null, when they click a button to close it a further loading screen displays for a few seconds?

still forum
#

Because there might be a loading screen after the main loading screen

#

Any mod can start/stop a loading screen whenever they want

#

For example MCC does that

warm gorge
#

This is a vanilla mission, my own one and I've got nothing that could cause one from what I see, so I'm very confused. It seems to only happen in multiplayer too

little eagle
#

There's like 3 loading screens and the player or the mission display being not null doesn't mean all loading screens are done.

warm gorge
#

Is there a way I could wait until their all over?

still forum
#

CBA has a feature. But vanilla...

#

Make the screen black. Sleep 20 seconds. And then make the player see stuff again. And hope all loading screens went through in the 20 seconds

velvet merlin
#

@compact galleon @little eagle @still forum ty

#

is local var assignment always slower?

little eagle
#

Than what?

still forum
#

What?

#

It's slower than assigning no variable. yes.

peak plover
#

I wanna unlfip vehicles like this

#

but i dno how

#

addForce
addTorque

#

?

velvet merlin
#

_vel = velocity _vehicle;
_dir = direction _vehicle;
_velocity = (_vel select 2);

#

should these be done or rather without local var assignment

still forum
#

If you use it more than once then use local var

#

also add private That makes it a little faster

peak plover
#

^

still forum
#

Wait... wtf

  _velocity = (_vel select 2);
 if ( (((_vel select 2) - _velocity > 4)) ) then

aka
if ( (((_vel select 2) - (_vel select 2) > 4)) ) then
also WTF is up with your brackets?
if ((_vel select 2) - (_vel select 2) > 4) then
@velvet merlin that doesn't make sense.
x-x is never > 4

little eagle
#

x-x is never > 4
Prove it.

still forum
#

Okey.. you're right.
Could happen if x is a special datatype that always returns a different value each time it's read

velvet merlin
#

well the above code isnt mine.. and i havent used that yet

#

in the past i used this i believe

#
while {alive _vehicle} do
{
    if ((vectorUp _vehicle select 2) < 0.5) then
    {
        _vehicle setVectorUp [vectorUp _vehicle select 0,vectorUp _vehicle select 1,(vectorUp _vehicle select 2) - 0.05];
    };//... not enough,not even sure if it's correct.

    sleep 0.05;

    if (((velocity _vehicle select 2) > 5) && (sqrt(((velocity _vehicle select 0)^2) + ((velocity _vehicle select 1)^2)) < 20) && ((getPos _vehicle select 2) > 3)) then
    {
        _vehicle setVelocity [velocity _vehicle select 0,velocity _vehicle select 1,(velocity _vehicle select 2) * 0.5];
    };
    sleep 0.05;
};```
#

there is also this variant :P

while {alive _vehicle} do
{
    if (((vectorUp _vehicle select 2) < (0.3)) or (((velocity _vehicle select 2) > 5) and ((getPos _vehicle select 2) > 4))) then
    {
        _vehicle setPos [getPos _vehicle select 0,getPos _vehicle select 1,0];
        _vehicle setVelocity [(velocity _vehicle select 0) * 0.5,(velocity _vehicle select 1) * 0.5,(velocity _vehicle select 2) * 0.5];
    };
    sleep 0.1;
};```
still forum
#

vectorUp _vehicle select 2
See commy. Good example for why to set parens even if not needed

little eagle
#

?

still forum
#

(0.3) Very bad example too.

little eagle
#

Asplain.

still forum
#

vectorUp (_vehicle select 2) doesn't make sense. as _vehicle is an object. as checked before with alive _vehicle

little eagle
#

Yes, it's a good idea to not set parenthesis if they break the code.

#

I don't get what you're saying.

still forum
#

Dunno. I skipped half of the conversation yesterday

#

Who was the guy against parens again?

little eagle
#

Me.

still forum
#

Oh okey then.. @little eagle Hey you! Read above.

little eagle
#

Just look at these examples here. So annoying to read.

still forum
#

mostly annoying because lack of proper indentation or line breaks or and/or and the selects everywhere.....
_vehicle setPos [getPos _vehicle select 0,getPos _vehicle select 1,0]; wow :U

little eagle
#

Yeah, and or usage like this fucks hard with the brain.

#

I think I'm a fan of this:

getPosWorld _vehicle params ["_x", "_y"];
_vehicle setPosATL [_x, _y, 0];
#

_vehicle setVelocity [(velocity _vehicle select 0) * 0.5,(velocity _vehicle select 1) * 0.5,(velocity _vehicle select 2) * 0.5];

_vehicle setVelocity (velocity _vehicle vectorMultiply 0.5);
#

Though, this is an infinite loop for a vehicle. Vehicles change locality, but setVelocity is a command that requires the object to be local. So idk.

still forum
#

That's why I said. Run script on player. Only for vehicle that player drives if he drives one.
Locality and performance problems all solved

little eagle
#

Still think it's for AI. But how do you guarantee that AI's vehicle stays in their hands?

#

Maybe don't care and just let semi working code run. It should do it's job 95% of the time.

still forum
#

AI's can flip vehicles?

little eagle
#

Is that a serious question?

#

Can they not?

peak plover
#

ai need a script that checks if they flipped car or if they stuck their car

little eagle
#

(vectorUp _vehicle select 2) < 0.5

#

Isn't 0.5 like 30 degrees? Would this trigger if the vehicle drives up or down a steep hill?

still forum
#

max is 1 min is -1
so 0.5 is like 45Β° up

little eagle
#

No, it's a sine curve.

#

Not linear.

#

Ah, I think 0.5 means 60 degree here, so it should be fine.

fleet wind
#

How can i write a if ("True") run this code twice {//code}?

still forum
#

what?

#

Ah.. run twice

#

eh

#

for loop. Or just call the code twice

peak plover
#

private _code = {player setdamage 0};
if (true) then {call _code;call _code;};
fleet wind
#

Thanks

compact galleon
#

That; or a for loop.

if (true) then
{
    for "_i" from 0 to 1 do
    {
        // code
    };
};```
#

But I'd assume call is faster than do

still forum
#

{code} forEach [1,2] :u

peak plover
#

oooh

compact galleon
#
_lol = 0;
while { _lol < pi*2 } do
{
    // code;
    _lol = _lol + pi;
};```
still forum
#

{lol1} else {lol2} apply {code}

#

I win?

peak plover
#

winner winner param dinner

still forum
#

Got one more
if (true && _code) then _code
but _code needs to return true

compact galleon
#

lol

still forum
#

my else one can also be used with select I guess select looks weirder than apply

#

_code else _code select {isNil _x}

compact galleon
#
_lol = 0;
_code =
{
    // code
    _lol = _lol + 1;
    _lol < 2;
};
while _code do _code;```
#

Now it's just getting ridiculous

still forum
#

Wait. I need a minute to understand that

compact galleon
#

actually, it's wrong

still forum
#

Do we have a do while loop i SQF?

compact galleon
#

No

still forum
#

bummer.

do _code while (true && _code && {false})
compact galleon
#

_lol = 0;
_code =
{
    // code
    _lol = _lol + 1;
    _lol < 2;
};
while _code do {};```
#

there

#

Other one ran 3 times

peak plover
#

retarded solution nr 29

_code = {ten_a = 2;false};
missionNamespace getVariable ['ten_nilvar',(call _code)];
ten_a    // 2
compact galleon
#

So four * becomes **, wtf

fossil yew
#

In situations where you can add a handler via CBA_fnc_addClassEventHandler or in description.ext, which one is preferred?

still forum
#

if you want it to be permanent then config

#

if you.... you can't remove classEH's

fossil yew
#

mission specific

still forum
#

I would go for config

fossil yew
#

thank you

peak plover
#

Depends on event. I've used fnc and description.ext. I feel like description is beter

velvet merlin
#

@commy2 πŸ’©#9913 thanks again. the above code is from A1 and A2 days. anyhow vehicles can flip with players, AI or no one inside. also AI can also be local to the player if its in his group, right? (not sure about HC - maybe there too?)

tender fossil
#

@velvet merlin AFAIK AI is always local to the player if it's in his group

still forum
#

Not if the AI is leading the group

tender fossil
#

I mean, if the player is the leader

still forum
#

or if the group was manually transferred to the server

tender fossil
#

Can you force the change of ownership of AI that's member of your group?

still forum
#

Changes the ownership of a group (and all its units) to a given client. Group leader can't be a player. setGroupOwner
this command should not be used to transfer ownership of units with AI setOwner
Should not be used doesn't mean it doesn't work.
And what happens if group leader is a player with setGroupOwner

compact galleon
#

Nothing

tender fossil
#

Interesting

still forum
#

But if player doesn't lead group. Or if player joins the group afterwards while it's owned by the server...

compact galleon
#

If a player is the leader he gets ownership of the group

tender fossil
#

Can I use regexp in strings with SQF?

still forum
#

No

#

Well. You can write regexp's in strings. But they won't do anything

compact galleon
#

I was about to say that, lol

tender fossil
#

Hm, aight

strange urchin
#

What’s a reliable to get the local copy of a projectile across multiple machines? I have an event handler that takes the position and type of projectile and remoteexecs to the server, which then uses nearestObject to find the projectile. The server then does the same thing to the HC. Though I’m not sure if this is the best way to go about this.

little eagle
#

Why?

#

What for?

strange urchin
#

We were using a CRAM script that ran on a loop using nearestObjects to find projectiles within 2.5 km. So instead of doing that, I’m trying to use eventhandlers to just add the projectile to an array, which would make that part of the loop infinitely faster.

little eagle
#

Why not just use the fired eventhandler? It triggers for remote units and reports their projectiles too.

#

No need to send anything across the network.

strange urchin
#

Does it really? I was using Firedman. It sometimes didn’t even detect the weapon fire on HC, though. And I noticed that the projectile was null when it was on the server

little eagle
#

What type of projectile?

#

A missile?

#

And yes, fired triggers for remote units.

strange urchin
#

Guided missiles are global objects anyway. I was looking moreso at things like an alamut or mortar. Is FiredMan known to be unreliable for remote units?

little eagle
#

Don't know about firedMan. Always just used fired. Maybe there are differences.

#

Certain simulation types are not passed for remote units. They say objNull instead.

#
params ["_unit", "_weapon", "", "", "_ammo", "", "_projectile"];

// http://feedback.arma3.com/view.php?id=12340
if (isNull _projectile) then {
    _projectile = nearestObject [_unit, _ammo];
};
#

This is the work around.

strange urchin
#

Yes, I noticed that.

#

And that’s the issue I’m having

#

I’m just hoping for a better way to do it.

little eagle
#

There is no better way.

#

And there is no need to transfer anything across the network with this way either.

strange urchin
#

I think I’ll try putting the event handler right on the HC again, this time using β€œFired”

meager heart
#

πŸ€”

little eagle
#

Exactly my reaction.

strange urchin
#

Pardon?

lusty canyon
ruby breach
#

{ } forEach (allMissionObjects "GroundWeaponHolder");

lusty canyon
#

great thanks G

meager heart
#

also weaponsItemsCargo _holder;, jayTAC

lusty canyon
#

strange i have some vests and guns on the ground in front of me but the resulting array is
[24c322acb80# 403457: dummyweapon.p3d REMOTE]

#

oh wait i think i have to do typeof

meager heart
#
0 spawn 
{
    _detectedItems = [];
    {
        _detectedItems set [count _detectedItems, [weaponsItemsCargo _x]];
    } 
    forEach (allMissionObjects "GroundWeaponHolder");
    hintSilent str _detectedItems;
};
ruby breach
#

use pushBack over set [count

still forum
#

in total that script is exactly what apply was made for. So why not use it?

meager heart
#

Β―_(ツ)_/Β―

compact maple
#

Hey guys i got a quick question, i got a function that return false or true. If i call this function like this _aRandomVar = call myfunc.
will _aRandomVar contain the return of the func ?

still forum
#

before:

0 spawn 
{
    _detectedItems = [];
    {
        _detectedItems set [count _detectedItems, [weaponsItemsCargo _x]];
    } 
    forEach (allMissionObjects "GroundWeaponHolder");
    hintSilent str _detectedItems;
};

after:

0 spawn {
    hintSilent str (allMissionObjects "GroundWeaponHolder") apply {[weaponsItemsCargo _x]};
};
#

@compact maple eh.... yes.

compact maple
#

thanks

meager heart
#

need check how faster it will be with apply

#

vs set count πŸ˜€

ruby breach
#

Wiki has a note saying apply vs forEach is ~1.5% faster. Not sure how accurate that is

still forum
#

is correct

#

but that's for a empty forEach loop without any code inside it

ruby breach
#

True

still forum
#

get's quickly irrelevant if you have code in it. especially something like set count bla

indigo snow
#

its on average 0.0022ms slower or something

#

exactly the time needed to increment and assign a variable

queen cargo
#

as far as i know, apply returns a new array

#

or am i wrong in that regard?

still forum
#

correct

meager heart
#

here is the results

Result:
0.284898 ms
Cycles:
3391/10000
Code:
call   
{  
    _detectedItems = [];  
    {  
        _detectedItems set [count _detectedItems, [weaponsItemsCargo _x]];  
    }   
    forEach (allMissionObjects "GroundWeaponHolder");  
    hintSilent str _detectedItems;  
};
/**************************************************************************/
Result:
0.246351 ms
Cycles:
4231/10000
Code:
call {  
    hintSilent str (allMissionObjects "GroundWeaponHolder") apply {[weaponsItemsCargo _x]};  
};
queen cargo
#

well ... there is the reason why empty apply vs empty foreach is slower

#

simply allocation

still forum
#

What?

#

It's not.

#

It's faster.

queen cargo
#

Wiki has a note saying apply vs forEach is ~1.5% faster. Not sure how accurate that is

still forum
#

yes? apply is faster

queen cargo
#

ohh ... wait

#

πŸ™ˆ

still forum
#

@meager heart most time is probably spent in the allMissionObjects there

queen cargo
#

should get more sleep

meager heart
#

apply more sleep, X39 πŸ˜€

compact maple
#

hmm, i have this kind of array: [['item1"],["item2],["item3"]]
i would like this array to be a basic array like ["item1","item2"].. i did deep in the wiki but i cant found what im looking for lol

ruby breach
#

Do an apply/ forEach and pushBack _x select 0 into a new array

compact maple
#

this is a bit tricky, i'll try

#

thx

little eagle
#

@compact maple Check this out:

parseSimpleArray ("[" + (str _items splitString "[,]" joinString ",") + "]");
#

There, needed some parenthesis :~P

compact maple
#

this is perfectly working

#

thanks : )

little eagle
#

yw. I challenge anyone here to find something faster or shorter.

compact maple
#

aha, good luck to them

queen cargo
#

[["broke"],["commy2, the poo fighters,"],["solution"]]
there you go @little eagle

little eagle
#

Commas are not valid in classnames.

queen cargo
#

never was stated that they are class names

little eagle
#

item1 clearly is a classname you dunce.

queen cargo
#

pff

subtle ore
#

🍿

queen cargo
#

even if, putting that into a method to unpack stupid arrays will break

little eagle
#

What?

queen cargo
#
/* magic method to "unpack" single item nested arrays ([[ITEM], [ITEM]]) */
...```
#

now call that with some random stuff you received from some random idiot and it will break

little eagle
#

? He's working on weaponsItemsCargo if you payed any attention.

queen cargo
#

i did not

#

i just wanted to break your code, which i did πŸ˜‰

little eagle
#

No you didn't.

queen cargo
#

[["broke"],["commy2, the poo fighter,"],["solution"]]

little eagle
#

Duh, it also breaks when there any types that can't be serialized in the array.

queen cargo
#

yup

little eagle
#

Any of your functions breaks if fed with illegal arguments.

#

That's literally saying nothing.

queen cargo
#

i call that broken

little eagle
#

Because you're - again - completely wrong.

queen cargo
#

apply is what will always work in those cases

#

_array apply {_x select 0}

little eagle
#

There are no cases where it fails when operating on weaponsItems.

queen cargo
#

i will now head back into my sqf-vm to re-implement the object type

little eagle
#

You got your apply code backwards btw.

#

It's ARRAY apply CODE.

#

Not the other way around.

queen cargo
#

always mix around that crap ...

#

*fixed

little eagle
#

_array = ["blah"];
Hurr durr, your function is broken.

#

Mine would handle it.

still forum
#

If that's in reference to the code posted above....

#

You can just remove the array in the apply code

#

instead of putting it into arrays and taking it out again.
Just don't do that

shadow sapphire
#

What's the generic version of player?

#

I'm trying to write a little script that will allow players to "recruit" local militia to join their group in just the simplest way possible.

#

Like, walk up to militiaman, have an addaction that allows the player to recruit it, but I don't know a generic way to have it be like... this player or some such thing.

still forum
#

player is... generic.. ?

shadow sapphire
#

Hmm... I'm phrasing this wrong.

still forum
#

the player is the local player that executes the script

#

if someone executes your addAction script. Then that guy is player

shadow sapphire
#

So, it can just be player?

#

Oh! Sometimes it IS simple. Haha.

#

Thanks!

meager heart
#

[_unit] joinSilent (group player); done πŸ˜€

#

btw eatin... nice stream... πŸ˜„

still forum
#

o7

#

Now doing real stuff again

strange urchin
#

Anyone know why the Fired and FiredMan EHs don't fire for certain ammo types on remote units? It seems to work consistently when the EH is on the server though, but not from the HC.

shadow sapphire
#

@meager heart, can _unit be this?

meager heart
#

this ?

#

i cant see from here

#

sry

shadow sapphire
#

HAha, not this, but this, sorry.

meager heart
#

oh that one πŸ˜€

#

if i understand... you asking [this] joinSilent (group player); ? if that in this init then yes

unborn ether
#

I missed some fight here

meager heart
#

couple

unborn ether
#

@strange urchin which weapons types are those ?

shadow sapphire
#

Thanks, @meager heart!

#

Why doesn't this work?

player addAction ["[this] joinSilent (group player)", {}];```
meager heart
shadow sapphire
#

I already have it open. I don't understand the syntax, I guess.

#

This is sitting in the init of the militia units.

strange urchin
#

It seems like it fired for vehicle weapons, and the CUP AK-74m. But other than that, it just wouldn't fire unless the EH was server-side.

little eagle
#

this is undefined in that scope.

#

Will not work.

#

unless the EH was server-side
"Server side eventhandler" makes no sense to me.

shadow sapphire
#

I see. Sounds like an area we've tread recently. I'll look back at what we did yesterday or whenever that was.

meager heart
#

@shadow sapphire

action_id = this addAction ["Join group", {
    params ["_target", "_caller", "_ID"];
    [_target] joinSilent (group _caller);
    _target removeAction _ID;
}, [], 1, true, true, "", "_target distance2D _this <= 5"];
little eagle
#

lgtm

strange urchin
#

I tried setting the event handler on the server, and I tried putting it on the HC. What’s not to understand about that?

shadow sapphire
#

@meager heart, worked like a charm.

meager heart
#

nice

still forum
#

@strange urchin handler is where unit is local?

#

Might matter. Not sure

little eagle
#

You have to add it on all machines. If you add it only on the server, it will never be executed on the headless client machine.

worn hatch
#

@unborn ether thanks dude thinking about it for my use I might be able to use just currentWeapon

strange urchin
#

How would adding the same event handler on the same unit to all machines help?

little eagle
#

An eventhandler not added on the local machine will never be executed on the local machine.

#

If you only add an eventhandler on machine A, it will never be executed on machine B.

#

Server, client, hc. They're all the same in this regard. Doesn't matter.

ionic orchid
#

I wish dialogs wouldn't stop rendering for a frame when it needs to load a .paa

strange urchin
#

That's great and all, but I added an event handler to machine B that used a remote unit from machine A. I expect it to fire on machine B.

little eagle
#

And it should be executed.

strange urchin
#

The thing is that it did not get executed, depending on the weapon being used.

little eagle
#

Well there are two possibilities. Either there is a bug that no one reported yet to my knowledge. Or you made a mistake.

#

Maybe make a as simple as possible repro, so someone else can confirm the potential bug.

shadow sapphire
#

How might I go about writing a tiny addaction to get information from civilians?

The script will go in their init.

Something like;

action_id = this addAction ["Question.", {hint format ["Hello."]}];```

But I'd like the hint they spit out to be like;

```I saw a some bad guys half a kilometer to the NorthWest.```

Or something like that, but based on where the enemies actually are.  Something like getdistance and getdirection...
peak plover
#

if u only want the ones that the guy has spotted

shadow sapphire
#

That's pretty neat... Not exactly what I wanted, maybe better than what I wanted, actually.

unborn ether
#

@ionic orchid If you have a static set of .paa you can cache them previously.

peak plover
#

_unit1 distance _unit2

#

returns distance

ionic orchid
#

@unborn ether yeah, I'm trying to hide them in another interface so they are cached - but THAT interface then also doesn't render for a frame for the same reason

unborn ether
#

@ionic orchid Well you can do that on a background of findDisplay 46 while user is passing JIP

ionic orchid
#

testing now where I can do a titleText "BLACK" and hide it all for a few frames on startup

little oxide
#

Any explanation was made for diag_captureFrame in the past ?

little eagle
#

???

still forum
#

People don't need to explain if everything is on the wiki

little eagle
#

The wiki is how people do the explaining.

little oxide
#

No but inside the GUI

still forum
#

What inside the GUI?

#

How the "Copy to clipboard" button works?

little eagle
#

Ingame documentation has many errors and can't really be fixed by the comm like the wiki.

still forum
sharp silo
#

i removed it from the other channel as i thought it went in here

still forum
#

I guess this is something for #arma3_scenario
I don't see scripting in there

sharp silo
#

ok lol

strange urchin
#

Yeah, just added the same event handler on the HC for all units. For infantry at least, FiredMan and Fired EHs only fired on units that were local to the HC

still forum
#

Yeah. Like addEventhandler wiki page says

strange urchin
#

I don't think it says anything about fired EH

little oxide
#

enableDynamicSimulation need to be executed on each client ?

subtle ore
#

Welp

still forum
#

the one who owns the AI is enough I guess

still forum
#

πŸ—ž

subtle ore
#

πŸͺ

strange urchin
#

It says remoteControlled unit, not remote unit.

peak plover
#

oops missread

#

damn

still forum
#

lol

scarlet temple
#

Hi Guys,
I have a little problem with one of my scripts.
I am using CBA_fnc_globalSay3d to play a soundfile on a speific position and never had problems with it before, but now the file playes arround 5 times simultaneous.
This is my code.

{
If (_timer > 0) then {[[_caller, "chopping",180],"CBA_fnc_globalSay3d",true] call BIS_fnc_MP; _caller playmove "AinvPknlMstpSnonWnonDnon_medic4";  sleep 9;};
_x setdamage 1;
_x hideObjectGlobal True;
}```
#

any ideas?

meager heart
#

afaik CBA_fnc_globalSay3d is deprecaited... BIS_fnc_MP is deprecated also...

#

use remoteExec for both ^

queen cargo
#

typeOf objNull what does this output?

still forum
#

OBJECT

queen cargo
#

rly?

#

wtf Oo

still forum
#

It's an object

#

what did you expect

queen cargo
#

typeof != typename @still forum

still forum
#

Ohhh

#

oops

queen cargo
#

πŸ˜›

still forum
#

should be empty string i guess

queen cargo
#

that is what i guess too

#

but i cannot confirm it on my system as i got no arma installed as usual

meager heart
#

_var = objNull; hint str (typeOf _var); //--- ""

still forum
#

" " or "" ? Really a space?

meager heart
#

lol

queen cargo
#

check

#

it is changed

meager heart
#

fixed πŸ˜€

queen cargo
#

createGroup without a HQ/center existing for a given side?

#

grpNull or?

still forum
#

afaik you don't need createCenter anymore

#

A center already exists for every side

queen cargo
#

kk

queen cargo
#

format [] what does this output? empty string?

#

also, what is with eg. format[1]

ruby breach
#

Both return ""

queen cargo
#

error?

ruby breach
#

No error

queen cargo
#

kk

ruby breach
#

Just returns an empty string

queen cargo
#

ty

ruby breach
#

np

queen cargo
#

stuff like no error means that sqf-vm will output warnings all over those places πŸ˜„

whole light
#

Hey gents.

How do I make my dialog scale to the correct size for different ratios and UI sizes? On 16:9 and normal UI my dialog is centered, but different UI sizes throw it way off. Here are some of my basic defines:

#define dce_X 0
#define dce_Y 0
#define dce_H 1
#define dce_W 1
#define dce_BUTTON_H 0.05 * safezoneH
#define dce_BUTTON_W 0.06 * safezoneW
#define dce_SPACE 0.005 * safezoneW
#define dce_COL (dce_X + dce_SPACE)
#define dce_ROW (dce_Y + dce_SPACE)
#define dce_COLINC (dce_BUTTON_W + dce_SPACE)
#define dce_ROWINC (dce_BUTTON_H + dce_SPACE)

queen cargo
#

problem is in how you use it
0 & 1 are the left & right of the savezone

#

if you check out this img

#

you will see, that safezoneW is the FULL width of the center monitor in arma ui scale

#

thus your button_h, button_w, ... defines go rampage

#

in other words: you have to decide wether you want to stay in the safezone square in the middle
or you want the whole display as span range

whole light
#

Thanks mate. I'll take a look at those tools

#

So to make a dialog standard in size, is it best to use static values instead of safezone values? Or is there some formula for detecting and adapting across all scales?

queen cargo
#

format ["%1 %% %1", 0] what does this output?

#

again, check the SafeZone wiki page

#

there are images that show what the 0-1 system will do for the different UI scales and monitor 16:9stuff

whole light
#

Thanks for the help mate

queen cargo
#

no problem

#

also, what happens with format ["%0"]?

meager heart
#

format ["%1 %% %1", 0] // 0 0
format ["%0"] // empty string

queen cargo
#

no error etc? @meager heart

meager heart
#

yep, no errors

queen cargo
#

so more sqf-vm warnings

carmine maple
#

if (isNil '_res') then {0} else {_res}
Found this in a script, is there any point in the line?

queen cargo
#

somevarinfront = ...

#

that probably leading?

#

or any other value context*

#

what you see there is pretty much nothing but returning 0 in case _res is not set yet

#

the actual sense of that code is ... beyond me
as you have to set _res anyways and should never rely on upper scope variables outside of your function that may or may not be set
though ... there are even for that usecases

meager heart
#

@carmine maple that is "fix" for undefined variable

queen cargo
#

would not call that a fix πŸ˜„

#

more broken by design

meager heart
#

quotes man ^

queen cargo
#

sqf-vm-cpp now can do format again ❀ ty @meager heart

meager heart
#

nice

carmine maple
#

ah ok thanks, its part of some quite old code, with many scripts πŸ˜ƒ Have not see that kind of of style for setting an undefined var yet.

queen cargo
#

the c branch could do it the whole time though
but now taking care of more edge cases because ... they came in my mind

#

let me tell you something @carmine maple
if you got some legacy code that still is working, never EVER touch it
never
under any circumstances!
and if you have to touch it for whatever reason, rewrite it

exotic tinsel
#

i could use some help with adding JIP’s to custom radio channels. i have this in my initserver.sqf

    MB_AlphaChannel = radioChannelCreate [[0,0.165,0.439,1], "Alpha", "Alpha", []];
    publicVariable "MB_AlphaChannel";

And this in the init.sqf

[player] call TLS_fnc_ChannelSettings;

And this is in the function after some role detection logic.

MB_AlphaChannel radioChannelAdd [_player];

It works of course just for me when hosting server but no one else.

carmine maple
#

@queen cargo i dont have time to rewrite and recheck 450 different scripts though πŸ˜„

queen cargo
exotic tinsel
#

it works if i do this from the init.sqf but i think this is broadcasting everywhere for each JIP. ```sqf
[player] remoteExec ["TLS_fnc_ChannelSettings"];

#

thats wrong right?

queen cargo
#

yup

#

will be executed on every computer

#

could be correct way to do so though

#

never used that command

exotic tinsel
#

na its wrong, ill keep at it. trying to find syntax for executing this remotely to the server. ```sqf
MB_AlphaChannel radioChannelAdd [_player];

#

this worked

[player] call TLS_fnc_ChannelSettings;
[player] remoteExec ["TLS_fnc_ChannelSettings", 2]; 
#

how do i set it so that you cant hear or see other channel traffic if your in a diff custom radio channel?

queen cargo
#

toString [1, true, "something", {}, []]
what is the output of this?

ruby breach
#

toString [1, true, "something", {}, []] returns ""

#

Which aren't visible in hint or systemChat. Those just show " "

queen cargo
#

ok ...

ruby breach
#

diag_log or copyToClipboard return ""

queen cargo
#
toString [84];
toString [true];
toString [false];
toString ["something"];
toString [{}];
toString [[]];

toArray toString [84];
toArray toString [true];
toArray toString [false];
toArray toString ["something"];
toArray toString [{}];
toArray toString [[]];```
to get more info on this
ruby breach
#
diag_log toString [84];
diag_log toString [true];
diag_log toString [false];
diag_log toString ["something"];
diag_log toString [{}];
diag_log toString [[]];
diag_log str(toArray toString [84]);
diag_log str(toArray toString [true]);
diag_log str(toArray toString [false]);
diag_log str(toArray toString ["something"]);
diag_log str(toArray toString [{}]);
diag_log str(toArray toString [[]]);
``` returns ```
19:54:38 "T"
19:54:38 ""
19:54:38 ""
19:54:38 Bad conversion: scalar
19:54:38 ""
19:54:38 Bad conversion: scalar
19:54:38 ""
19:54:38 Bad conversion: scalar
19:54:38 ""
19:54:38 "[84]"
19:54:38 "[1]"
19:54:38 "[]"
19:54:38 Bad conversion: scalar
19:54:38 "[]"
19:54:38 Bad conversion: scalar
19:54:38 "[]"
19:54:38 Bad conversion: scalar
19:54:38 "[]"
queen cargo
#

ty @ruby breach

exotic tinsel
#

how can i remote execute this on the players client?

6 radioChannelRemove [_player];
edgy dune
#

is there away to tell if a zeus is remote controlling an AI?

strange urchin
#

If you look at the actual script for the module, I think there was a setVariable done on the unit to keep track of that sort of thing.

#

Or maybe it was commented out.

compact galleon
#

Uh.. Is there no vectorDivide command?

little eagle
#
_vector vectorMultiply (1 / _divisor)
#

@carmine maple

Found this in a script, is there any point in the line?
It doesn't do anything on it's own, unless it's the last line and therefore the return value of the function.

#

@scarlet temple
You used CBA_fnc_globalSay3d which has global effects inside BIS_fnc_MP which broadcasts the function everywhere. So every connected clients sends the sound file to every connected client. 2^n sounds will be played where n is the number of dedicated clients. Either use say3D instead of a global variant or drop the BIS_fnc_MP.

#

@whole light If I try to center a control, I usually use 0.5 - width/2 as X and 0.5 - height/2 as Y.

#

@still forum @strange urchin Again, fired will trigger for remote units. AL EG. If this somehow doesn't work on headless clients, then make a repro, because it's a bug. Unless demonstrated I still believe he made a mistake, because I never heard of anyone else having this problem.

velvet merlin
#

like this doesnt make sense, does it?

if (vehicle _obj != _obj) exitWith
{
    unassignVehicle _obj;
    [_obj] orderGetIn true;
    };

{
    unassignVehicle _x;
    [_x] orderGetIn true;
} forEach (crew _obj);```
#

unassignVehicle => leave vehicle
orderGetIn true => get back in
or not?

winter rose
#

@velvet merlin I wouldn't say so exactly

#

like "orderGetIn" to give the order, you are assigned to the vehicle (like for transportation) but you are ordered off ("false") for fighting and still assigned to it for long-distance

#
_unit assignVehicle _myCar; // tells the unit "this is the car you use when I order you to "getin"
_unit orderGetIn true; // "get in your assigned vehicle!"
waitUntil { _unit in _mycar; };
sleep 3;
_unit orderGetIn false; // "get out of your assigned vehicle!"
waitUntil { not _unit in _mycar; };
sleep 3;
_unit orderGetIn true; // "get in your assigned vehicle!"
velvet merlin
#

@winter rose i can see your point. however is this what really happens with the given commands?

compact galleon
#

@velvet merlin Yes. orderGetIn will make the given unit move in or out of its assigned vehicle

velvet merlin
#

but thats kind of the point. if the logic would be the other way round. you force it out but still keep it assigned to the vehicle
however the above is to remove the connection to the vehicle but order them in

compact galleon
#

@velvet merlin Didn't read your initial message. But no, that makes no sense

#

orderGetIn won't do anything if a vehicle isn't assigned

#

Unassigning a vehicle will make the unit get out on its own

scarlet temple
#

@little eagle CBA_fnc_globalSay3d don't work global.. idk why.. but it isn't

#

but i ll test it again

little oxide
#

playActionNow is mp synced ?

little eagle
#

Wiki says Arguments Local, Effects Global, which means that you have to use it on a local unit and it will take effect on all machines.

#

Pretty sure the point of CBA_fnc_globalSay3d is that it works globally.

#

Dunno make sure to whitelist say3D in CfgRemoteExec if you're using that.

warm gorge
#

Is there a way to create an agent locally, like how createVehicleLocal works?

lone glade
#

agents are units

#

you can't create a local only unit*

little eagle
#

Counterpoint: rabbits.

lone glade
#

they're special

#

they're from the ambient class

little eagle
#

You can't create local agents like rabbits, snakes and fish by command yourself.

warm gorge
#

Im making a clothing menu with a 3D preview of the player using an agent. But because this is going to be on multiplayer, I want it to be local. I guess I can just use createVehicleLocal

lone glade
#

wait, it's SP only?

warm gorge
#

Sorry, corrected myself

lone glade
#

you can't

little eagle
#

Not sure if you can dress up the soldier if he is created as vehicle and not as person.

peak plover
#

Just create him and ```sqf
[_unit,true] remoteExec ['hideObject'];

warm gorge
#
_center = (typeOf player) createVehicleLocal [0, 0, 0];
_center setPosATL (getPosATL _sphere);
_center setDir 0;
_center setUnitLoadout (getUnitLoadout player);
_center switchMove (animationState player);
_center switchAction "PlayerStand";
_center setFace (face player);
_center enableSimulation false;

Just tested it then, turns out you can. Now the only issue is the unit is stuck in a holding gun animation.

little eagle
#

You'd also have to handle disconnection, as these objects are transfered to the server and become global objects if the player disconnects.

peak plover
#

^

warm gorge
#

Nah I think I can just use createVehicleLocal now, just have the holding gun animation issue now

peak plover
#

u can give clothes to a vehicle>

little eagle
#

Pretty sure they can't be animated if they're not created as persons. And you didn't even listed to what I wrote about disconnection and CVL created objects becoming global.

peak plover
#

Nice

warm gorge
#

@little eagle Sorry, misunderstood what you said. Didnt even know that was a thing, ill make sure they get properly deleted then

little eagle
#

np. This should be a diclaimer on the CVL wiki page.

warm gorge
#

Yeah theres nothing about it on there

tender fossil
#

Explain me like I'm five: on which machines will initJIPcompatible.sqf execute when a player joins a mission?

#

All clients including headless?

lone glade
#

all clients including headless

tender fossil
#

Thanks @lone glade πŸ˜ƒ

#

Oh... It's not even available in Arma 3 (according to biki) πŸ˜„

#

Sigh

#

Is there any point in hiding server side functionality in addon when the mission and framework is open source and available on GitHub?

still forum
#

no

#

but you can just keep it serverside. To save a little memory on clientside

tender fossil
#

That's what I was thinking as well

#

Thanks for the confirmation πŸ˜›

#

Though, wouldn't it be easier for communities to make their own private edits if the server side functionality was already hidden in server addon?

#

Like just for convenience

#

Oh well, using Workshop mods with SteamCMD seems like a PITA anyways so I guess I'll just tell the hosts to do it themselves

still forum
#

yes. ofcause if you change serverside stuff you don't need to update clientside

tender fossil
#

Then the next stupid question: does the serverside addon have to be compiled into .pbo or can it include just pure source code like missions can?

unborn ether
#

@tender fossil No, you need to declare anything in config.cpp of an addon. CfgFunctions for example.

tender fossil
#

So I just declare stuff in config.cpp and using source code instead of pbo is fine?

unborn ether
#

@tender fossil config.cpp is a config of a pbo. You can't just throw SQF to the addon root.

tender fossil
#

@unborn ether

unborn ether
#

@tender fossil PBO the folder and then place it to a server addons folder.

tender fossil
#

Aight, I see. Thanks for info again @still forum @unborn ether πŸ‘

still forum
#

you can just throw sqf in the addon root. with filepatching.

#

but you shouldn't

tender fossil
#

Is filepatching a security risk @still forum ? Or why shouldn't I do it

still forum
#

no

#

more complicated

tender fossil
#

Is there any resource so I can read more about the topic?

still forum
#

that's why I said "complicated"

#

It is not really a topic

#

once you understood how the arma filesystem works you'll understand that too

tender fossil
#

I see, thanks again πŸ˜ƒ

tough abyss
#

i think (sorry if im wrong) but with file patching you can access all the files on the server even if they are not located within a pbo

subtle ore
#

^ That's my understanding of it, any data that is "unpacked"

still forum
#

yes that's trueish

subtle ore
#

"Trueish" thankong Stop inventing words Dedmen

meager heart
#

trueble *

subtle ore
#

truebleh?

meager heart
#

hmm πŸ€”

subtle ore
#

🀷

native siren
still forum
#

Maybe someone should add the ways to disable that to the wiki

#

No you can't disable it

#

but you can detect when someone is trying to do it. And handle him however you want

native siren
#

Trying to check if someone click shift -?

still forum
#

yes

#

not trying. doing it.

edgy dune
#

so in helicopters if u ctrl+right click it brings up a camera , and some of the helos have nvg and thermals where as some only have thermals. Is there a way to give that optic nvgs? I went ahead and used _this disableNVGEquipment false; but it doesnt work,and im gonna assume it doenst work because the vehicle config doesnt nvgs for the optics to begin with so theres nothing to enable/disable. So my question basicly is how do u add the nvg equipment to a helo?

meager heart
#

something with cameraView and ppEffectCreate maybe πŸ˜€

edgy dune
#

I feel like theres a wasier way XD, if I could edit the config ik where it is,but I cant edit the config sooo rip

fossil yew
#

bis_fnc_initInspectable - is there a way to know if player actually inspected the leaflet?

tender fossil
#

If client sends remote execution request to server, does the function being called have to be defined on client as well?

#

Eg. My client is calling function serverDoSomething on server, but serverDoSomething is defined (compiled) on server only - would this work?

still forum
#

it should

#

the client just sends the name of the function

tender fossil
#

Excellent, thanks again πŸ˜„

unborn ether
#

@edgy dune currentVisionMode will help you detect any vision mode

edgy dune
#

@unborn ether would that let me change the vision mode?

#

or rather

#

is there something that does?>

unborn ether
#

@edgy dune Well, for vehicles theres only disableTIEquipment|disableNVGEquipment afaik. But if you are willing to disable TI in general, just make it this way:

if ((currentVisionMode player) isEqualTo 2) then  {
  85000 cutText [format [(localize 'STR_NOTF_BadVision'),(actionKeysNames ["nightVision",1] splitString '"' select 0)],"BLACK FADED"];
  85000 cutFadeOut 99999999; 
} else {
  85000 cutText ["", "PLAIN"]; 
};

Place it in a while or whatever.

#

@edgy dune If commands above doesn't really disable the equipments, that might mean its scripted within vehicle, or badly composed?

meager heart
#

cough cough

//--- Night vision
0 spawn {
    private _color = ppEffectCreate ["ColorCorrections", 1999];  
    _color ppEffectEnable true;  
    _color ppEffectAdjust [1, 1, 0, [0.4, 1, 0.4, 0], [0.4, 1, 0.4, 0.0], [0.4, 1, 0.4, 1.0]];  
    _color ppEffectCommit 0;

    private _blur = ppEffectCreate ["dynamicBlur", 505];
    _blur ppEffectEnable true;  
    _blur ppEffectAdjust [.2];
    _blur ppEffectCommit 0;

    setAperture 0.1; //--- brightness
};
unborn ether
#

cheater

meager heart
#

bulli

unborn ether
#

πŸ˜„

edgy dune
#

what does the 85000 and 99999999 mean?

still forum
#

layer number. and duration

unborn ether
#

it means "to the infinite and beyond" that this resource will occupy 85000 layer (layers have order) and fade out for duration of 9999999.

edgy dune
#

ah

#

oh yea isnt 99999999 the max amount of elements in arrays?

#

for amra

#

arma*

unborn ether
#

Not sure how you came to arrays, but ask Dedmen for that πŸ˜„

still forum
#

what?

edgy dune
still forum
#

some big number is the max amount of elements

edgy dune
#

the big red warning

#

at the top

still forum
#

atleast someone wrote that on wiki. Whether it's correct I dunno

#

But that has nothing to do with cutFadeOut

edgy dune
#

oh yea ik,it just reminded me

#

if only I could edit the config, but I cant 😦

unborn ether
#

You cant edit configs?

edgy dune
#

nop

unborn ether
#

Which one?

edgy dune
#

well the helicopter that im taking about is in a mod so

unborn ether
#

oh that ones.

edgy dune
#

and I kinda dont wana touch the config cause well ive never done it πŸ˜›

edgy dune
#

yep

verbal otter
#

can i ask for help? i'm working on custom lobby dialog, find RscDisplayMultiplayerSetup in Addons\ui_f, but have a problem. Can't find place where script create this dialog, set player role's listbox and action on buttons.i have a little addon on my server with custom dialogs settings and main menu. But can't find lobby scripts to make it custom too πŸ˜•

still forum
#

there is no script that creates that dialog

#

there are no scripted actions on buttons

unborn ether
#

@verbal otter RscDisplayMultiplayerSetup dialog is handled by the engine itself. Occupied roles is some kind of RscListBox but its content is somewhat specific in the engine, as I found no way how to get/set anything from that. The most you can do is to move all the controls, respecting their IDCs and make it scripted with onLoad-like events.

verbal otter
#

@unborn ether, @still forum thank you! I need remove role selection, just select a side. Is possible to make automatic select role for player?Thank you again!

unborn ether
#

@verbal otter The thing I didn't achieve setting a role scripted, as lbSetCurSel actually just selected a listbox entry, but didn't take a role. That why I've said its somewhat specific. For me it looked like its some RscActiveText on top of listbox which is not activated like this.

#

@verbal otter Also there's no lbData, lbText or lbValue in each of entry afaik. So that gave me more questions.

verbal otter
#

@unborn ether thank you, mate!

broken kindle
#

I am hoping that someone will help me with this. I am new to coding but learning quickly.
What I am trying to do is make a white list for player slots where the slot can be defined and only the player listed came us that slot. if this could be done in the init section when placing players that would be great. If it has to be done to read a slotlist.sqf file that would work also. I have searched the intenet and have not found any code that I can understand. or detailed instructions on how to do this..
Please help me with this if possible.

inner swallow
#

if you want to do this check during slottingg (i.e. in the lobby) i would guess you need to do something we description.ext, since init.sqf isn't executed at this point

subtle ore
#
private _whitelist=["1234","1234"];
if(local player) then
{
    if(!(getPlayerUID player in _whitelist)) exitWith
    {
        endMission "CONTINUE";
    };
};
#

etc etc

broken kindle
#

yes it would be when they connect to the server to choose the player slot

#

I was hoping to name player slot officer1 and only a listed player uid could use that slot

#

office1 = "47585994383994940"

#

officer2 = "65473888475783858935"

#

and so on

subtle ore
#
if(local player) then 
{
  private _whitelist = ["47585994383994940","65473888475783858935"]; //these are player uids 
  private _uid = getPlayerUID player; //uid of connecting player
  switch(roleDescription player) do
  {
    case "officer1":
    {
      if(!(_uid in _whitelist)) then 
      {
        endMission "CONTINUE";
      };
    };
    case "officer2":
    {
      if(!(_uid in _whitelist)) then 
      {
        endMission "CONTINUE";
      };
    };
  };
};
#

Ex

broken kindle
#

thank you so much I have been looking all over the place for this

subtle ore
#

No worries, I recommend you disect and study it. This isn't the only way of doing so and sometimes different techniques are handy to keep on your toolset

#

I want to clarify though: Role description is not unit variable

#
if(local player) then
{
  private _whitelist = ["47585994383994940","65473888475783858935"]; //these are player uids
  private _uid = getPlayerUID player; //uid of connecting player
  switch(str player) do
  {
    case "officer1":
    {
      if(!(_uid in _whitelist)) then
      {
        endMission "CONTINUE";
      };
    };
    case "officer2":
    {
      if(!(_uid in _whitelist)) then
      {
        endMission "CONTINUE";
      };
    };
  };
};

Something along these lines would produce a similar result if a unit variable is set

meager heart
#

playable unit init this setVariable ["var_slot",<number>]; and then getVariable and then switch it maybe ?

broken kindle
#

I have no idea what to do with that code

subtle ore
#

@meager heart Ehhhh....nah. I like this method because it's multi purpose

#

@broken kindle init.sqf or initplayerLocal, put it in a function if you feel.

meager heart
#

i like only your first example tbh, Midnight πŸ˜„

#

was clean

subtle ore
#

The only reason why I changed it because a lot of people confuse "role description" versus "unit variable name"

meager heart
#

Β―_(ツ)_/Β―

subtle ore
#

I guess you could make dynamic and double check, but if you know what you're doing there is no need to. Only if you were to make something like that public

celest rivet
#

Question for long-time-scripting-veterans
Are there any definitive advantages to using SQS instead of SQF in ArmA 3? A friend told me SQS can do some things "better" than SQF in a more simplified way bypassing some aspects of the ArmA 3 engines newer features? Any thoughts?

meager heart
celest rivet
#

@meager heart Thank you! I'm actually in the process of reviewing all of KK's blog posts but hadn't got to that one yet (only read about a quarter of them having started yesterday). I'm reading over it now

wispy kestrel
#

Is switch better than if then else?

unborn ether
#

@wispy kestrel It's not better, its different. If you talk about execution time, mostly the difference start showing up only on huge amounts of data.

wispy kestrel
#

Okay, thanks @unborn ether

tender fossil
#

What I'm doing wrong here? Does it need format command or sth?

[] call ["%1_INIT_server_initServer", MISSION_PREFIX]
tough abyss
#
[] call (format ["%1_INIT_server_initServer", MISSION_PREFIX])
tender fossil
#

Ah, I was using square brackets instead, so that's where it went wrong

#

Thanks πŸ˜‰

little eagle
#

call needs CODE and format reports STRING. This will error out.

#
missionNamespace getVariable format ["%1_INIT_server_initServer", MISSION_PREFIX]
abstract shuttle
#

Good evening guys! πŸ˜ƒ Does somebody got an idea of how to use the custom-map-marker-drawing-function to create a scripted marker which is permanent and static, so it will not disappere once restarting the mission? Thanks for answers! πŸ˜ƒ

tender fossil
#

So your example is correct @commy2 πŸ’©#9913 ...or?

meager heart
#

@abstract shuttle External database probably best way, but also possible saving in profileNamespace

abstract shuttle
#

@meager heart Thanks for your answer! My actual problem is that I do not know how to create such a custum-made/drawn marker via script... I need to create a line following a street (for a quest system...) 😬

subtle ore
#
if(isServer) then
{
  _mkr = createMarker["CookieTrail",[0,0,0]];
  _mkr setMarkerType "hd_dot";
  _mkr setMarkerText "Cookie Trail";
  [_mkr] call mid_fnc_saveMkrToDB;
};
#

mid_fnc_saveMkrToDB:

params["_mkr"];
profileNamespace setVariable[(markerText _mkr),[markerPos _mkr,markerShape _mkr,markerSize _mkr,markerType _mkr],true];
saveProfileNamespace;
#

and then just use createMarker to re create the marker again upon start

abstract shuttle
#

That sounds great! I'll try it out πŸ˜‰ Thanks men! @subtle ore
Found something calles Polyline as well... Is there any possibility to use this command aswell?

subtle ore
meager heart
#

"CookieTrail" setMarkerShape "POLYLINE";

subtle ore
#

Oh, yeah that'd work just fine

#

it's just part of the marker data

abstract shuttle
#

And now as it is a polyline-marker... Where do I have to define each single polygon to draw just like in the drawPolygon command, Midnight already mentioned?

warm gorge
#

How would I go about fully adding weapon items/attachments to a groundweaponholder?

subtle ore
#

@warm gorge addItemCargoGlobal

warm gorge
#
SR_weaponHolder = "GroundWeaponHolder_Scripted" createVehicle (getPos player);
SR_weaponHolder addWeaponCargo [primaryWeapon player, 1];

{
    SR_weaponHolder addItemCargo [_x, 1];
} forEach (primaryWeaponItems player);

This doesn't seem to add them to the weapon, just puts em around it. @subtle ore

subtle ore
#

Oh, to the weapon?

warm gorge
#

Yeah

subtle ore
#

Wait a sec, are you trying to add an attachment to the player's rifle?

warm gorge
#

No, trying to add an attachment to a weapon on the ground. Working on a weapon shop so I want to be able to dynamically switch out the attachments on the 3D preview

abstract shuttle
#

@warm gorge

    _gwh = "groundweaponholder" createvehiclelocal [0,0,0];
    if(_cfg == "CfgMagazines") then {_gwh addmagazineCargo [_item,1];};
    if(_cfg == "CfgWeapons") then {_gwh addWeaponCargo [_item,1];};
    if(_cfg == "CfgGlasses") then {_gwh addItemCargo [_item,1];};

That's how we done it...

subtle ore
#

Ummm...

#

First of all there isn't any declaration of _cfg, so that alone will not work

abstract shuttle
#

No, it's content binded for our server πŸ˜„

subtle ore
#

Then it doesn't apply here, I don't think you should be giving that as an example then.

abstract shuttle
#

Thought it will help... Sorry then...

warm gorge
#

I personally do understand it, just might be confusing for others

#

I appreciate it

#

Thats how im doing it though, however its not working as intended

subtle ore
#

No, it doesn't really make any sense.
if(_cfg == "CfgMagazines") ?
A config entry being equal to "CfgMagazines" ?

abstract shuttle
#

It is just a snippet. We use this in our script and it works fine...

subtle ore
#

Well what I am saying is even if it did work I don't think we're talking about the same thing

unborn ether
#

What's the actual difference between "GroundWeaponHolder_Scripted" and "GroundWeaponHolder" ?

subtle ore
#

It's sort of like doing:

{
    if(_x isKindOf "ItemBase_F") then
    {
        _holder addItemCargoGlobal[_x,1];
    };
} forEach _cfgList;
warm gorge
#

GroundWeaponHolder_Scripted - same as GroundWeaponHolder but will not be auto-deleted when empty

subtle ore
#

@unborn ether I was going to ask the same

#

Interesting, thanks for the info Shadow

meager heart
#

@warm gorge you can't add weapon with attachments in container, Dedmen was working on function for that, ask him...

warm gorge
#

Alright cheers

hushed minnow
#

Hey #arma3_scripting , I have a question about Script Paths

For a .pbo-ed scenario, when I can loadFile "someText.txt"
Will it look in the .pbo itself first, then the Scripts folder of the arma installation path, then the arma install path itself?

#

And by extension, I can't alter the Scriptpath variable in a scenario pbo correct?

inner swallow
hushed minnow
#

I know, it only links the channel

#

If I did a (at)everyone, im sure a lot of people would be pissed

inner swallow
#

it's disabled anyway

#

point being, it's redundant πŸ˜„

#

anyway to answer your question, it looks in the mission root folder first

hushed minnow
#

so just to be absolutely sure, If I have my scenario called 'firstMission.Altis.pbo' and I did a loadFile, It would look in this order?
./Arma 3/MPMissions/firstMission.Altis/ ./Arma 3/Scripts ./Arma 3/

inner swallow
#

oh you're doing loadfile

#

not sure then

#

but usually

hushed minnow
#

yeah. im trying to work out how exactly i would load a file without knowing if it exists or not

inner swallow
#

then you'd simply say execVM "terminalUpload_ws.sqf"

#

or if it was in a sub folder then execVM "f/folder/file.sqf"

hushed minnow
#

yeah, i got that in my mission already, I want to extend it outside the pbo file instead

inner swallow
#

with loadFile specifically you'll have to check the wiki

hushed minnow
fleet wind
#

Hello people. Ive got a bunch of pictures in my mission fine how would the desicriptions includes look. would i have to include every singe picture in there? Simpley i want it to look in a folder for pictures please give an example.

safe forum
#
_array1 = cursortarget getVariable ["Keys",[]];            //["000000","0000001"]
_array1 = _array1 set [0,-1];
cursortarget getVariable ["Keys",[]];               //[-1,"0000001"]

Is it a bug?

hushed minnow
#

No, not a bug, reference type working as intended i believe

hushed minnow
#

I've seemed to not be able to even loadFIle outside of the editor's folder

#

Im so stupid, i needed to enable filepatching for it to work outside of the mission pbo, thank you @inner swallow

inner swallow
#

Ah πŸ˜„

hushed minnow
#

I just tested, it won't check the scripts folder like it says on the wiki, I actually have to specify _z = loadFile 'scripts\myscript.file' instead of just myscript.file

#

Someone should probably edit the wiki

inner swallow
#

hmm?

#

but the file is in a subfolder?

hushed minnow
#

yeah, im saying it doesn't automatically look in a scripts folder itself

#

uhm. like how i wrote it earlier

inner swallow
#

ah

hushed minnow
#

Like this, the wiki says it looks in this order

#

./Arma 3/MPMissions/firstMission.Altis/ ./Arma 3/Scripts ./Arma 3/

#

But it doesnt work as stated, I have to explicitly state that I want to look in the scripts folder, but what is really happening is that its going on to the 3rd option and looking for a subfolder named scripts in the arma root

inner swallow
#

Yeah, i understand now

#

although if you have a BI account you should be able to make the changes yourself

still forum
#

@hushed minnow Not outside of PBO's without filePatching specifically enabled

hushed minnow
#

yeah, i figured it out, and was trying to get someone to make a note of that on the wiki

exotic tinsel
#

how do i set call signs for a dedicated server? setting it in the squad properties doesn't work and neither does using the set call sign module. does anyone have a good how to guide?

still forum
#

same as for not a dedicated server.

#

What do you mean by "call sign"s ?

exotic tinsel
#

when JIP logs on they do not have the callsign for their group i specified using set callsign module, has Alpha 1-2 instead of Bravo

tender fossil
#

Regarding that earlier discussion: which one of these is correct?

[] call (format ["%1_INIT_server_initServer", MISSION_PREFIX])

or

missionNamespace getVariable format ["%1_INIT_server_initServer", MISSION_PREFIX]
still forum
#

first one throws error and doesn't do anything.
second one doesn't do anything.

#

you have to combine both

tender fossil
#

oh, the second one is missing [] call lol

still forum
#

you don't have to pass arguments to call

#

unlike spawn

tender fossil
#

So I can leave the square brackets out?

#
call (missionNamespace getVariable format ["%1_INIT_server_initServer", MISSION_PREFIX])
#

Better now? πŸ˜›

still forum
#

now it has atleast potential to work

tender fossil
#

Does it need the outermost brackets btw?

still forum
#

not sure

#

but... why would you remove them

tender fossil
#

Yeah, if it works that way, there's no problem... Better to use too many brackets than not enough πŸ˜›

errant jasper
#

Though, I always pass explicit arguments when calling other people code, to avoid leaking my own parameters and having them modify it.

still forum
#

yeah. Some people might modify _this by reference.. ugh

errant jasper
#

Yup. One time was enough to scar me for life.

still forum
#

I'd love if these people wouldn't exist.

little eagle
#

Does it need the outermost brackets btw?
Yes.

#

Dedmen, to work around a function modifying _this by reference, you can replace:

call _func;

with

_this call _func

It's the only difference between the two syntaxes actually.
Also, imo, you should handle the args passed to your function in line 1 with params and never rely on _this further down in the code.

tender fossil
#

πŸ‡΅ πŸ…° πŸ‡· πŸ…° πŸ‡² πŸ‡Έ

#

Thanks @little eagle πŸ˜ƒ

exotic tinsel
#

anyone know a good script for locking and unlocking ghosthawk door gunners? not finding much on the nets.

young current
#

lockturret

#

I think is a thing

exotic tinsel
#

yeah, saw that, was hoping to find a built script. ill get started on a script

dry owl
#

what would be a debug command to grab all the positions of roadsigns? such as this Land_SignRestrict_01_speedLimit_70_F, I have used the command before to get gas pump pos.

lusty canyon
#

is it possible to script adding gearsets to the arsenal menu(save/load)

still forum
#

@lusty canyon yes.

lusty canyon
#

nvm i ended up just using get/set loadout command.
next q: im trying to determine if a vehicle is a UAV, im looping through array allUnitsUAV .
is there a more efficient way to know if a vehicle is uav?

knotty mantle
tough abyss
#

I don’t think that works like that lol

#

Although idk of this also checks for panes