#arma3_scripting

1 messages · Page 326 of 1

nocturne basalt
#

how can I get the ammoCount for the other turrets?

tough abyss
sly sun
#

Looking for help, making Arma traders: Want to make multiple traders w/chance to spawn, lets say i have 5 possible created traders, each with 20% chance to spawn, how do i make the server load only 1 of the 5

nocturne basalt
#

thanks @tough abyss

still forum
#

@sly sun I think you can even set the chance directly in the Editor.

sly sun
#

Yes, but if each has %20, i dont want 3 loaded, only 1

#

I've searched for dynamic AI spawns and lots thru google, cant find the right stuff :\

#

Does that make sense on what im trying to do?

still forum
#

You have 5 units and only want one of them to spawn

sly sun
#

Yes, sounds simple lol

still forum
#

Please don't copy-paste the same question in multiple channels. Also that has nothing to do with #arma3_config

sly sun
#

thought it read config/EDITING

still forum
#

#arma3_scenario would probably be most fitting. But please don't double-post questions

sly sun
#

So now i shouldn't ask in the correct place

#

Cools

#

Sorry the channels are kinda i'll defined

still forum
#

Should better think first before asking. We are people here and not google.
I'll check some things for you. And you will probably have to script anyway

#

Channels also have descriptions at the top.

indigo snow
#

if you have an array of all shop objects you can just delete random entries until you have the desired amount

sly sun
#

Ah, you learn something new everyday, sorry

subtle ore
#

I'm trying to find the idc of a display. eh = (findDisplay 46) displayAddEventHandler["MouseButtonClick",{hint format["%1",_this];}]; doesn't seem to hint anything.

still forum
#

Of what display?

subtle ore
#

Arsenal.

#

Particularly the Arsenal Load button, want to replace it for new functionality

still forum
#

Just look in the config. RscDisplayArsenal

subtle ore
#

Oh, gotcha. Thanks. I had been looking for it there but to no avail, I will look again

#

Found it, not worries.

still forum
#

Button Load is IDC 44147 and RscDisplayArsenal Display IDD is -1

subtle ore
#

Yep.

still forum
#

I'm quite sure the display is stored in some variable

#

@sly sun Use "Probability of Presence" in Eden. Give every trader a variable. And inside the presence condition check isNil "trader1" && isNil "trader2" and so on.

#

If the probability triggers more than once the condition will detect if one of the other traders was already spawned.

sly sun
#

amazing dedmen, i'll get on that

#

Thanks so much

subtle ore
#

@still forum Ins't -1 supposed to signify a random value to be assigned when opened? I need to wait until the arsenal is open to close the dialog.

still forum
#

-1 is also a normal IDD you can search for. But it's generally used when you don't need any IDD.
If several displays with IDD -1 are open using findDisplay -1 probably only returns the last opened. or the first opened or a random one or whatever ^^

subtle ore
#

Oh okay, thanks. I'll see what this'll do here.

sly sun
#

@still forum So i thought this was working, but trader's 4/5 still appear with isNil "trader1" && isNil "trader2" && isNil "trader3"

#

Doesnt seem to be checking all the conditions

still forum
#

trader 4 should have
isNil "trader1" && isNil "trader2" && isNil "trader3" && isNil "trader5"

sly sun
#

Got to go backwards comp

#

ahh im dumb

still forum
#

w00t?

#

= + [0.90,0.90,0.90,0.85]; + is not needed here

#

_color1 set [3, (_color select 3) * _alpha]; _color is undefined?

#

check the values of the colors before you call set

#

That they swap doesn't make sense

#

Also why do you copy _color but don't copy _nameColor

#

_alpha is undefined

sly sun
#

@still forum Even with each trader having their own isNil respective to all the others, i get multiple spawning

still forum
#

Well in the pastebin _alpha is undefined.
If it's 1 as you say then it can't just be 0...

#

@sly sun Don't know another way then.

sly sun
#

Ok, im gonna move to mission makers and see if anyone is watching that channel

#

Thanks for tryin 😄

still forum
#

You are not copying the array you put into _nameColor

#

anything else could set that to 0

#

If you check the variables before you call set is everything alright there?

tough abyss
#

hey folks, I'd like to turn off the street lamps on tanoa but it seems the default commands don't work. the problem is, I don't know the classnames of the new street lamps, you guys may help me out how to get them?

still forum
#

Well. You modify the global variable. What do you expect? Do you expect it to not get modified?

jade abyss
#

??

#

Yeah, thats correct.

#

What did you expect?!

#
  • Both are "[0.68,0.90,0.36,0.85]"
#

No clue where your Problem is

#

abc = [1,2,3];
_cba = abc; //[1,2,3]

#

I doubt it. Sounds like you change the Array somewhere.

still forum
#

x = y is an assignment yes. but if y is an array then x will be a reference to that array instead of a copy

#

Which is why you use + to copy arrays

jade abyss
#

still forum
#

Which you already do for _color but for some reason don't for _nameColor

jade abyss
#

if Y is a globalVar, not array.

still forum
#

no. I meant it as I said it.
y is a global variable of type array yeah.

jade abyss
#

abc = "abc";
_cba = abc; //ABC
abc = "123"
_cba == "123"
iirc

still forum
#

no.

jade abyss
#

*startingArma*

still forum
#

That would return false

#

By reference only works for arrays

#

Probably done because arrays are expensive to copy. Relative to strings

jade abyss
#
abc = [1,2,3]; 
_cba = abc; //[1,2,3]
systemChat str _cba; 
abc = [3,2,1]; 
systemChat str _cba; //[1,2,3]
#

Should work without +

#

+it checks each time newly, when it's beeing called.

still forum
#

@jade abyss Your example is not modifying the array inside abc/_cba

#

you are resetting abc to a new array

#

@hasty violet Second one

#

It is stored inside a magic secret variable that only a handful of people know

#

what?

#

yeah

#

Sorry 😄 That may have seemed a little too unserious

jade abyss
#

private _team = assignedTeam _x;
_nameColor = + switch (_team) do

_nameColor = + switch (assignedTeam _x) do

Both work -.-

still forum
#

but second one is more performant and more compact

#

Also no one said one of these wouldn't work

jade abyss
#

Sounded like it.

#

+Dedmen - Today at 1:20 AM x = y is an assignment yes. but if y is an array then x will be a reference to that array instead of a copy
Would be wrong then oO

still forum
#

What? What would be wrong on that?

#

yes

#

you can

jade abyss
#

but if y is an array then x will be a reference to that array instead of a copy

#

Thats not the case oO

still forum
#

What where?

#

That is the case.

#

Give me a example code where that is not the case

jade abyss
#

🤔

#

Gimme an example where it's the case.

still forum
#
ABC = [1,2,3];
_var = ABC;
//_var == [1,2,3]
ABC set [0,5];
//ABC == [5,2,3] and _var == [5,2,3]
jade abyss
#

checking again, more or less the same as i did before, but it didn't update _var

still forum
#

What did you do before? Your last example was using a string instead of an array
And your other example didn't modify the array

jade abyss
#

ah, stop. abc = []; = New Array, or?

#

Doesn't matter what was used

still forum
#

yes

jade abyss
#
abc = [1,2,3]; 
_cba = abc; //[1,2,3]
systemChat str _cba; 
abc = [3,2,1]; 
systemChat str _cba; //[1,2,3]```
That one
#

So unless you "re-set" the GlobalVar -> It's refing to the latest one.

still forum
#

yeah. You have two arrays
arr1 is [1,2,3]
arr2 is [3,2,1]

abc = [1,2,3]; //now abc points to arr1
_cba = abc; // now _cba also points to arr1
abc = [3,2,1]; //not ac points to arr2 but _cba didn't change so it still points to arr1

jade abyss
#

nvm, all fine.

still forum
#

if you use for example
abc set [0,3]
abc pointed to arr1 so you modified arr1.
And _cba also points to arr1 so it was also modified

jade abyss
#

i forgot, that with X = [] a you create a "new" array, not modify the existing one.

leaden summit
#

I don't suppose anyone's worked out how to remove "vehicles" from the UAV control list? If I place the carrier defense turrets they fill up the list of UAV's the player can control. I really don't want the player in charge of the carrier guns.
Part of me wishes BI had used a module system similar to the support modules when it came to UAV's, but I guess that would cause more issues

#

Oh wow ok so using that I assume I can have specific UAV's controllable only by certain units? Eg anyone can pick up a UAV controller but only the specif person can control say the greyhawk?

#

And if I name the player units and replace the player with the unit name it will stop that specific player correct?

blazing zodiac
#

Does anyone know of a way to return the class that a controls inherits from, ctrlClassname will return the controls classname but not any it inherits from

little eagle
#

You can't do that unless you know the CONFIG path of the control. In which case it works like every other config.

#

Classname is not enough.

tough abyss
#

@hasty violet did u try to not check against 0? maybe checkVisibility returns a small value if the checked unit is hidden by another unit. just a suggestion. Also a check with a higher value than 0 is better if unit is hidden by smoke.

#

you could just test which value is fitting ur needs by outputting the returned value of checkVisibility via hint or systemChat while looking at the hidden unit.

daring pawn
#
#include "\a3\functions_f\Params\paramGuerFriendly.hpp"

Hi chaps, it seems this causes a game crash stating it cannot find the file when I include the above in my description.ext.

I'm trying to use some of the Bohemia functions in a custom zeus mission.

#

Oh ignore me - Param templates currently don't work with PBO missions manually copied to MPMissions folder. Unpacked missions, Steam missions and missions which are part of an addon works correctly. turns out...

still forum
#

What? You can't #include if you have a PBO in MPMissions?
Why does the preprocessor care about that?
Arma amazes me every few weeks

indigo snow
#

its probably to do when they changed the security with #include

#

no more 'outside' files

#

but missions that dont live in a pbo arent in the right location to #include from the main arma folder now

still forum
#

You mean -filePatching? That doesn't apply in this case

#

And the problem doesn't happen if the mission is unpacked. Only if it's in a PBO

indigo snow
#

no, it only works for missions packed as an addon in a pbo.

#

you can pack a mission as a 'normal' mission pbo and it wont work

#

you'll have to make a special mission addon for it to work

still forum
#

But you can #include from scripts just fine. But not from description.ext.
Arma is weird...

indigo snow
#

yep

#

i suspect because the .ext is parsed way earlier, engineland goes wierd

#

maybe it works if you just use a pbo program that actually precompiles the mission

still forum
#

I don't know if description.ext would get binarized. I don't think so..

limpid pewter
#

so i have this simple little RscTitle, and i want to add a *.paa image to it. How would i do this? i was thinking either like this: ```sqf
class Symbol: RscPicture
{
idc = 1200;
text = "#(argb,8,8,3)color(1,1,1,1)";
x = 0.025625 * safezoneW + safezoneX;
y = 0.181 * safezoneH + safezoneY;
w = 0.0464063 * safezoneW;
h = 0.077 * safezoneH;
image = "myPic.paa";
};

or like this :sqf
class Symbol: RscPicture
{
idc = 1200;
text = "<img size= '1' image='myPic.paa'/>";
x = 0.025625 * safezoneW + safezoneX;
y = 0.181 * safezoneH + safezoneY;
w = 0.0464063 * safezoneW;
h = 0.077 * safezoneH;
};```

meager granite
#

you need to have file path in text

limpid pewter
#

ok so like this sqf text = "myPic.paa"; ro like this ```sqf
text = "<img size= '1' image='myPic.paa'/>";

meager granite
#

Just file path, bottom one is structured text

limpid pewter
#

ok awesome, thanks alot

limpid pewter
#

@meager granite Im assuming, you are one of the people that scripting the game mode KOTH. With your earplugs feature, you have it bound to F1, usually F1 will bring up the AI control menu. If you know, how did you disable that AI control menu?

jade abyss
#

keyHandler

still forum
#

@limpid pewter You can also just remove the AI menu keybind in the Keybinding settings

limpid pewter
#

but for all players? dedmen

#

btw this is what i have atm ```sqf
(findDisplay 46) displayAddEventHandler ["KeyDown", {if (_this select 1 == 59) then {[] spawn mld_fnc_epMain;};}];

jade abyss
#

http://grueslayer.webs.com/Keystate.png

if(!isNil "MyFancyKeyHandler")then{(findDisplay 46) displayRemoveEventHandler["KeyDown",MyFancyKeyHandler];};

MyFancyKeyHandler = (findDisplay 46) displayAddEventHandler ["KeyDown","call DS_fnc_Keyhandler;"];

DS_fnc_Keyhandler =
{
    params["_ctrl","_button","_BtnShift","_BtnCtrl","_BtnAlt"];
    private _ButtonDisabled = false;
    private _BD = {_ButtonDisabled = true;};
    
    if (_button == 59) then{systemchat "F1 Pressed and Key Disabled"; call _BD;};
    if (_button == 60) then{systemchat "F2 Pressed and Key Disabled"; call _BD;};
    _ButtonDisabled
};```
#

In this case call _BD; disables the normal Function of that Button.

still forum
#

Nope. The return of _ButtonDisabled disables the normal Function

limpid pewter
#

so where is _ButtonDisabled defined?

still forum
#

private _ButtonDisabled = false;

limpid pewter
#

oh oopps

jade abyss
#
Nope. The return of _ButtonDisabled disables the normal Function```
called by `call _BD` ...
#

Wich sets _ButtonDisabled to true

still forum
#

But why call a function rather than just exitWith true

limpid pewter
#

ok so what is the significance of _buttonDisabled. When that is returned how does it effect the EH

#

?

jade abyss
#

exitWith in an EH, meh, no.

#

Whats the VarName, Sneaky?

limpid pewter
#

_ButtonDisabled

jade abyss
#

Guess why i named it like that^^

still forum
#

if you return true. The button is disabled

#

if you return false the game button also triggers

jade abyss
#

True (disabled) / False (not disabled, StandardFunction will also be executed)

limpid pewter
#

yes i guessed that

#

but, i don't understand why it will have that effect on the EH

jade abyss
#

Reasons.

#

Magic

#

Call it what you want.

#

Can Execute this action, when pressing this button? -> True/False to the engine. Nothing else.

limpid pewter
#

allright, so it is built into the engine thanks 😃

#

i understand now

still forum
#

The engine basically asks you "Did you handle that Button or do we also need to ask others if they are responsible for that button press"

#

If you return true the Engine knows that button was handled and doesn't continue to ask others

limpid pewter
#

^ Best explanation 😛 thanks dedmen and Dscha( to clarify, no sarcasm meant)

jade abyss
#

```cpp (or "sqf" for Scripts)
YourCode
```
(makes it easier to read for others)

latent root
#

After the last arma update, my trigger no longer works. can someone help me? class Item42 { dataType="Trigger"; position[]={2143.2209,3.172629e+036,3455.395}; class Attributes { condition="this && (local player) && (vehicle player in thisList)"; onActivation="hint parseText format[""<t align='center' size='2.0'>! Safezone !</t><br/>¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯<br/>""];"; sizeA=150; sizeB=150; repeatable=1; activationBy="ANY"; }; id=142; type="EmptyDetectorAreaR50"; };

weak obsidian
#

I'm not 100% sure but doesn't the player variable as such always refer to the local player? Why the extra condition (local player)

jade abyss
#

@latent root cpp right after the 3 `

#

+Condition an actionation look fine to me.

latent root
#

The trigger comes only when I come with open map in the trigger. But when I go normally he comes only 1 sec

#

Sorry for the english

jade abyss
#

Does it work or not?

#

+Trigger check every 0.5s.

latent root
#

He goes already but he should show about 1 min a text now he comes only 1 sec

cloud thunder
#

In my tests some time ago under certain unknown conditions player is not local as demonstarated by KK. Yes Maybe set all three repeatable timers in trigger to the same value.

empty blade
#

tex="mypic.paa"

#

text*

nocturne basalt
#

I have a question for you guys. What is best (performance wise), and what are the difference between these two cases:

if (isServer) then {
     _vehicle animateSource ["animate_something", 1];
};

and

remoteExec [someAnimationScript]; 
jade abyss
#

RE -> Sends over the Command
animateSource -> Animates the Object itself, without the need of sending it over the net (only animState will be transported)

So i would go with animateSource

nocturne basalt
#

ok thanks

still forum
#

They do two different things. So the performance question can't really be asked

nocturne basalt
#

but you can use RE to activate animations on all clients cant you?

jade abyss
#

Why? use animateSource

#

No need for RE.

nocturne basalt
#

yeah sure. just wondered which was best. now I know

jade abyss
#

Animations are send over the net automaticaly.

nocturne basalt
#

ok. just wanted to know what was most efficient

jade abyss
#

AnimSource, in this case.

unborn ether
#

@hasty violet well, you are right. We wrote a whole geom. function to make this work properly.

limpid pewter
#

hey, is there a way to change the speed of a specific animation throught scripting?

#

I am using setAnimSpeedCoef for walking, running animations. but i want to change the ladder climbing animation

#

oh ok

tough abyss
#

I take back my comment. I looked up that command and it should do what you want.

limpid pewter
#

nah, it only affects walking, running and reload animations, i want to speed up the ladder climbing animation

#

but thanks anyway

tough abyss
#

Ok. Maybe it should clarify that in the wiki then.

#

It vaguely says animations.

limpid pewter
#

yeah i agree

empty blade
#

I love it when my doors don't work anymore

subtle ore
#

@empty blade oh yes, especially in winter. Buggers get stuck

empty blade
#

nah I think it's the walls which the hidges are in expanding due to the hot weather sir

subtle ore
#

Shiieet.

modern sigil
#

Does anyone have any go-to side UI dialog "info" panels that they like to use across multiple missions? The BIS_fnc_guiEditor is really tedious for me (probably due to me always forgetting how to copy to clipboard and save the appropriate stuff in the correct files) so I quickly lose motivation every time I approach that part of polishing my missions.

subtle ore
#

@modern sigil do you mean items like the gps.display and such?

modern sigil
#

@subtle ore I was thinking maybe an alternative to the hint panel, but for short, quick notifications that I can show and then hide after a few seconds. So sort of like BIS_fnc_showNotification but for brief phrases and short sentences whereas the built-in notifications dialog is specifically for only a word or two along with a picture.

quasi rover
#

If I place a chopper with crew(AI) and it get seriously damaged, the crews get out of the chopper. How to prevent crews from getting out of the chopper and just stay in the chopper, even though the chopper is seriously damaged?

indigo snow
#

allowCrewInImmobile might get you somewhere

still forum
quasi rover
#

Wow.😄 thanks guys, @still forum @indigo snow

modern sigil
#

Yeah I was about to say that earlier -- I think that the behavior is part of the danger FSM. If I'm right about that, then you'd have to rewrite or replace the FSM. KK's note just says to disable it altogether while they're in vehicles.

quasi rover
subtle ore
#

@quasi rover i believe that the command only applies to ground vehicles

#

Regardless if in flight or not, etc

limpid pewter
#

hey, so i have this ```sqf
drawIcon3D ["resources\pictures\AFlag.paa",[0.525,0.545,0.576,1],getPos aflag_marker,3,3,45];

#

btw, i have used ```sqf
hint str (getPos aflag_marker);

quasi rover
#

@subtle ore thanks.

zenith totem
#

@limpid pewter Are you using a texture in a mission or addon?

rancid pecan
#

hello everybody

zenith totem
#

Not buying a Windows license obviously

#

Post your RPT

still forum
#

Using windows is the problem.

zenith totem
rancid pecan
#

okey sorry

peak plover
#

@zenith totem Which mods were you running? @still forum The linux server used to be one of the biggest headaches when arma 3 came out. Is it any better now?

still forum
#

I've only been running Linux since Arma 2

#

Never had any bigger problems

zenith totem
#

@peak plover cough I'm not the one needing support

modern sigil
#

Just a useful, quick SQF thing I thought would be good to share:

//*** When a unit dies, strip all of its equipment so that nothing can be looted!
addMissionEventHandler [
    "EntityKilled",
    {
        params ["_killed", "_killer", "_instigator", "_useEffects"];
        
        if (_killed isKindOf "Man") then {
            _killed setUnitLoadout [[],[],[],[(uniform _killed),[]],[(vest _killed),[]],[],(headgear _killed),(goggles _killed),[],["","","","","",""]];
        };
    }
];
subtle ore
#

@modern sigil or even better, move the gear to a weapon holder

zenith totem
#

That reminds me of a problem I was trying to get around

#

I originally had getUnitLoadout when the local player was killed, but sometimes they'd already dropped their weapon by that point

#

I suppose handleDamage would be the only reliable method to ensure I get the loadout correctly before the unit drops the weapon

limpid pewter
#

@zenith totem sorry jaffa, didn't see your message until now. I am using a texture in a folder within my mission folder

subtle ore
#

@zenith totem yeah handle damage can be processed in same frame as kill event

late gull
subtle ore
#

@late gull Just like the parameters detail to you, the curatorObj is the curator module you have designated to a player. Then a boolean true or false

#

And, it must be executed on the server

late gull
#

ty

grand berry
#

Is there anyway to attach an object to a player's body via memory point that will follow the leaning of the player? Like making a weapon stick to a backpack?

jade abyss
simple solstice
#

Is it possible to have an FiredNear EH only ran by the server, so that the server could send the information to the database to log it? Instead of using remoteExec from the client

jade abyss
#

addEventhandler is local

#

You can try to add it on the Server on that Unit, could work (not sure, tbh)

simple solstice
#

well the thing is I want to log things from FiredMan or FiredNear to the database. but don't want to plug the network traffic, i don't really like the idea of remoteExec from client with log details everytime a client fires

jade abyss
#

Make it a Var on the Client, when he disconnects -> Send it over to the Server

#

e.g. _Unit setVariable ["FiredNeardVar",Status,true];

still forum
#

isn't there FiredMP handler?

simple solstice
#

MPHit there is

still forum
#

If there was only something like Intercept with a Networking Plugin. So you wouldn't have to worry about network traffic...

simple solstice
#

if I knew C++

still forum
#

The world could be so nice. But right now we only have SQF and over 10 year old netcode

simple solstice
#

I appreciate intercept, but I didn't see it used on any mission. Maybe im just blind

still forum
#

Yeah. Mission directly probably not. But stuff like Database logging and Mods in general.

#

Are you sure that remoteExec load is that bad that you can't take it?

#

Try it out maybe it's not that bad

#

or collect the Information on the client and send it out on Intervals

simple solstice
#

Yeah the second thing is more likely for me to try out.

#

Have a var, pushback an array with EH info, and send it every x minute

grand berry
#

@jade abyss thanks, that's what i've been using so far however it doesn't follow the the players positioning as seen here:
https://youtu.be/jrLlMfviRV0

jade abyss
#

¯_(ツ)_/¯

grand berry
#

Haha no worries.

hallow spear
#

is there anyway to see the full list of commands in the function viewer? some are missing such as setflagowner

indigo snow
#

Functions arent commands

#

The wiki has a full list of commands

hallow spear
#

I want to see what happens for the commands. I thought when I was seeing "getArea" it was the command, but perhaps it's BIS_fnc_getArea that I am seeing the details for

tough abyss
#

if you are looking in the function viewer that is indeed what you are looking at, BIS_fnc_getArea

hallow spear
#

ok thanks bunches

hallow spear
#

is it possible to flash a bright light during the day? I can use flare, but only works at night atm

limpid pewter
#

hey, does anyone know of a way to display an image of a weapon on a GUI? Are there built in pictures of the weapons? or would i have to add in my own picture resources?

#

what about rendering a 2D image of the weapons model or something?

warm gorge
#

@limpid pewter In a gamemode I made I did it through RscTitles, and updated the UI control like this:

#
private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
_control ctrlSetStructuredText parseText format ["<t shadow='0' size='4'><img image='%1'/></t>", _picture];
limpid pewter
#

ahh awesome ,so there is an image of each weapon in the config?

warm gorge
#

Yes

limpid pewter
#

cool 😄 thanks

zenith totem
queen cargo
#

You also can use 3d ui elements @limpid pewter killzonekid also had a tutorial about it

limpid pewter
#

Yeah thats was a second option, but what shadow Ranger said worked a treat thanks 😃

queen cargo
#

If you only use vanilla it should always, yes

limpid pewter
#

yeah, all vanilla

waxen jacinth
#

does someone know about the Land_ATM_01_malden_F, isn't that a interactable object - other like houses and stuff?

warm gorge
#

@waxen jacinth What do you mean by interactable? In terms of an ATM?

waxen jacinth
#

nah in terms of..no clue how i can explain it - basically i want do make a interactable object out of it by using the classname for it. but for some reasons, no script recognize it as an object

#

example: NOT WORKING WITH "Land_ATM_01_malden_F" ```_number = 0;

_Container = nearestObjects [player, ["Land_ATM_01_malden_F"], 500];
{
_number = _number + 1;
markername = format ["%1%2", typeOf _x, _number];
_marker = createMarkerLocal [_markername, position _x];
_marker setMarkerShapeLocal "ICON";
_marker setMarkerTypeLocal "mil_dot";
_marker setMarkerColorLocal "ColorGreen";
} forEach _Container;WORKING with "Land_i_Shop_02_b_blue_F"_number = 0;

_Container = nearestObjects [player, ["Land_i_Shop_02_b_blue_F"], 5000];
{
_number = _number + 1;
markername = format ["%1%2", typeOf _x, _number];
_marker = createMarkerLocal [_markername, position _x];
_marker setMarkerShapeLocal "ICON";
_marker setMarkerTypeLocal "mil_dot";
_marker setMarkerColorLocal "ColorGreen";
} forEach _Container;```

#

that's not the example for my interaction script, just something i tried to have all positions displayed but even that doesn't work,.

warm gorge
#

@waxen jacinth

#
_number = 0;

_Container = nearestObjects [player, ["Land_ATM_01_malden_F"], 500];
_Container = nearestTerrainObjects [player, ["HIDE"], 500];
_Container = _Container apply {["atm", (str _x)] call BIS_fnc_inString};
{
_number = _number + 1;
_markername = format ["%1_%2", typeOf _x, _number];
_marker = createMarkerLocal [_markername, position _x];
_marker setMarkerShapeLocal "ICON";
_marker setMarkerTypeLocal "mil_dot";
_marker setMarkerColorLocal "ColorGreen";
} forEach _Container;
waxen jacinth
#

@warm gorge Thanks tho, didn't worked either. Is it possible the atms placed around are just more like cosmetics`?

#

I mean, if i put in any other class like a house, scripts work like charm

warm gorge
#

oops I posted wrong code

#
_number = 0;

_Container = nearestTerrainObjects [player, ["HIDE"], 5000];
_Container = _Container select {["atm", (str _x)] call BIS_fnc_inString};
{
_number = _number + 1;
_markername = format ["%1_%2", typeOf _x, _number];
_marker = createMarkerLocal [_markername, position _x];
_marker setMarkerShapeLocal "ICON";
_marker setMarkerTypeLocal "mil_dot";
_marker setMarkerColorLocal "ColorGreen";
} forEach _Container;
#

@waxen jacinth That should work

remote flame
#

Does anyone here have some scripts or tips on how to make an script that adds money to players for kills of AI or Players? (This is for a dedicated server)

waxen jacinth
#

@warm gorge Thanks pal, that's working. Is it possible they use an other class name for it, then the one are in the editor? How could i basically get the classnames of those?

#

@remote flame there are some missionsystem released, wich have that option - you could take a look at how they doing it, to maybe get some ideas for your own script

warm gorge
#

Have a look at what the nearestTerrainObjects returns, and you can judge what you need to change on that in the select filter

outer hinge
#

If I wanted to add a list of UIDs to Zeus.. Would I listed it in the owner as ["xxxx","yyyy","zzzzzz"]

#

Trying to add Zeus into EPOCH. Since the unit changes when you select a slot... Giving Zeus by the UID, would resolve this. Just having a hard time passing the UID through the owner column.

remote flame
#

Thanks everyone for the help I will look in to it

waxen jacinth
#

@warm gorge Thanks, worked like intented. 😘

remote flame
#

@tough abyss The script work but I have to modify it to my needs, so thanks 😃

#

@tough abyss Dude It works!!! I fucking love you man 😍

limpid pewter
#

is there a way of making a RscPicture a button without creating another button class to go over that picture?

queen cargo
#

yes

#

you just have to reenable it and add a click event handler

limpid pewter
#

ok so in the RscPicture class, i put onButtonClick = blah blah;

queen cargo
#

not onButtonClick

#

the picture is no button

limpid pewter
#

and what exactly do you eman by reenable?

#

onMouseButtonClick?

queen cargo
limpid pewter
#

awesome, so if i wanted a picture to act as a button the whole time the menu is open, i would enable the ctrl upon menu initialisation and then use that onMouseButtonClick in the class to execute something?

queen cargo
#

yup

#

as tipp: use a single function to create the dialog

#

if you need to add some elements that require refreshment, create a spawn that will stay open for the lifetime of the UI using a while loop

#

and put all things that might change during UI runtime in there

limpid pewter
#

yeah thats about the way im doing it atm

#

thanks for your help

queen cargo
#

npnp

cedar kindle
#

playerSide is incorrect if you group units to different sides in the editor. side group player is recommended

tough abyss
#

if im using vehicle setVariable ["Varnam", units player]; and the player logs out, will the getVariable ["Varname", []]; return an empty array?

queen cargo
#

it will be the result of "units player" at the tiem the command was executed

tough abyss
#

what would be a way to check if the said unit in the array is still online?

queen cargo
#

depending on what you have set in your description.ext

#

isPlayer or isNull

#

as when the object will "fallback" to AI when player DCs, it will no longer return true on isPlayer

#

and in case you set those to then disappear, the object will automatically set to objNull

#

which can be detected via isNull

tough abyss
#

thanks will try isNull

plucky beacon
#

Is this the chat i should talk about addons or somewhere else

#

Specifically signatures

still forum
#

As long as there is no one here that wants to do scripty stuff. Sure. Go ahead

plucky beacon
#

Can you explain the difference between a .bikey and .bisign

still forum
#

.bikey is your public key.
.biprivkey is your private key.
and .bisign is the signature of the file that belongs to that.
the bisign is created by "hashing" the file and your privatekey.
and Arma can then use your public key together with the .bisign and your file to confirm that it was signed with your private key

plucky beacon
#

My mod has a bisign but no bikey

still forum
#

the .bikey get's created together with the .biprivkey

plucky beacon
#

I remember doing that process with addon builder too. strange.

#

It was months ago.

still forum
#

If you created the bisign you also had your private key handy. And the bikey should be right next to the private key

plucky beacon
#

Alright then, do i make a keys folder?

#

Or just in addons

still forum
#

the .bikey belongs in Arma 3\keys\file.bikey
when your bisign is in Arma 3\@mod\addons\file.bisign

#

If you are packing your Mod in a zip just put it next to the addons folder

plucky beacon
#

Ya im talking distribution so I'll put it there

#

Thanks Dedmen you're a pal

still forum
#

PAL is so meh.. NTSC is the real thing

plucky beacon
#

NICE MEME

tough abyss
#

Is there a command to return all the objects within a group?

#

I can't find it.

#

Nevermind, BIS_fnc_groupVehicles seems to be what I'm looking for.

plucky beacon
#

waitUntil {_adminState = admin owner player; sleep 5; (_adminState == 2)};
Is this a valid way of waiting until a player has logged into admin?

still forum
#

Looks good to me

plucky beacon
#

alrighty time to give a it a goooo

austere granite
#

going to keep the context low, because it'll just sidetrack the discussion, but does anyone know of a way of scaling the images coming through htmlLoad on the SQF side?

#

Normally you'd just go with resizing the control, but in html control's case that'll just crop the image instead of resizing it

dim owl
#

Hi, can I import a music into my CfgSounds in description.ext ?

#

with a path ? Or can i easily turn on the music on the player ?

plucky beacon
#

Aaaah so this is how you return your admin state locally _adminState = call BIS_fnc_admin;

chrome mason
#

What waitUntil command can be used before a script executes on a player so that when they are finished loading and they see the world and their gun, the script runs?

#

waitUntil {!isNull player}; - never mind

plucky beacon
#

I was wondering how do you use the custom controls keybindings in a mod or script. Like how do I write an event handler for if the keybinding is pressed. I've done normal keys before but not custom controls.

austere granite
#

basically just check if _button is the same as the keybind you want

#

on a keyDown displayAddEventHandler

plucky beacon
#

but how do I get _button of Custom Control 12

austere granite
#

custom control 12?

plucky beacon
#

Yes, in controls theres a category called Custom Controls

austere granite
#

ah in that can you wanna check actionKeys

plucky beacon
#

uhmmm

austere granite
#

if (_button in (actionKeys "user1")) then { true; };

plucky beacon
#

ya this looks like it

#

thanks

plucky beacon
#

now I just need to figure out how to compare actionKeys to a DikCode

#

i.e. that _button

austere granite
#

[1:25 AM] Adanteh: if (_button in (actionKeys "user1")) then { true; };

#

i wonder

plucky beacon
#

What are you thinking?

austere granite
#

... that's how you do it

plucky beacon
#

I just used this if (inputAction "user12" > 0) then {

#

because there is no way I know of to get _button the way it suggests

#

and I only need to know what it's pressed anyway

still forum
#

Just use CBA Hotkeys. One line of script and everything just works

plucky beacon
#

not using cba

#

no dependencies

still forum
#

ugh. Okey then.

plucky beacon
#

I got it working anyway

#

just one problem

#

it only draws icon 3d when in zeus camera

#

🤷

still forum
#

How are you drawing it? Using a Draw3D eventhandler?

plucky beacon
#

hastebin?

still forum
#

Not necessarly.

plucky beacon
#

alright

#

yes i am

#

addMissionEventHandler ["Draw3D", {

still forum
#

Okey. Then hastebin. 😄

plucky beacon
#

lol

#

it's not cleaned up but you probably seen this before

still forum
plucky beacon
#

And for the record it always displayed only in zeus, it just wasn't a problem until someone asked for a non-zeus verison

still forum
#

curatorCamera distance _x
You should hint or systemChat that to make sure it produces valid outputs

#

wait.

#

Solved it already ^^

plucky beacon
#

wheeeeeere

#

is it because curator camera distance

still forum
#

non-zeus obviously doesn't have a curatorCamera

plucky beacon
#

rip

#

alrighty

#

literally saw it the same time you did too

still forum
#

you can use ATLToASL (positionCameraToWorld [0,0,0]) to always get the current position of the Camera.
This pos is ASL. But you can change that to whatever you need

#

Works the same in zeus/first/third-person or spectator

plucky beacon
#

even splendid cam?

still forum
#

yep

plucky beacon
#

how dandy

still forum
#

Only bad thing is it only works for the local player and not for remote players. But as you only want Camera position you don't care about that

plucky beacon
#

ya I only need local

narrow musk
#

Guys, im trying to hide a house in malden but the radius ive set for the script only works if it's at 10 which also deletes objects in the building which i dont want it to do, so could i please have some insight onto how to apply the init of the logic to only hide the house and not other objects:
Here is what i'm trying to do that wont work:

0 = this spawn { 
    sleep 5; 
    { 
        _x hideObject true; 
    } foreach (nearestTerrainObjects [_this,[],10] && == TypeOf in ["Land_i_House_Big_01_V3_F"]);     
};
#

Everything after and including the && is what im trying 😛

still forum
#

😄

#

Gosh

#

You have no idea how scripting works. Gimme a second

narrow musk
#

Awsome atleast i tried tho right? lol

oblique spoke
#

lol

jade abyss
#

What kind of abomination is that code above?

still forum
#
0 = this spawn { 
    sleep 5; 
    { 
        _x hideObject true; 
    } foreach (nearestTerrainObjects [_this,[],10] select {(typeOf _x) in ["Land_i_House_Big_01_V3_F"]});     
};

Try that

sly sun
#

_markername="MARKER_NAME"; _terrainobjects=nearestTerrainObjects [(getMarkerPos _markername), [], (getmarkersize _markername)select 0]; {hideObjectGlobal _x} foreach _terrainobjects;

jade abyss
#

```sqf
CODE
```

still forum
#

Your code is logically correct but not syntactically (Weird word. Syntax is completly wrong is what I meant)

narrow musk
#

Thank you @still forum it was @chrome mason that suggested i try this -.-

still forum
#

Bad Monkey! 😄

sly sun
#

Hey @still forum , can i reverse this effect to watch/edit the radius

#

1sec

#

_location=[[LOCATION]];
_radius=25;
_terrainobjects = nearestTerrainObjects [_location, [], _radius];
{hideObjectGlobal _x} foreach _terrainobjects;

still forum
#

what "effect" is there to "reverse"?

sly sun
#

Can i show the hideobject

#

basically undo it

still forum
#

you mean unhide the object?

sly sun
#

yea

#

lol

still forum
#

Alternative syntax

#

_x hideObjectGlobal false

sly sun
#

amazing

#

ty

#

How long you been doing this?

still forum
#

Scripting? Uhm.. About a year before Arma 3 alpha was released.

#

Don't know how long that has been now

sly sun
#

Any major tips you wanna tell me before i build my entire map

#

And have to restart it becasue something

#

i jacked in the start

still forum
#

Learn how to use Google and the search feature on the BI wiki

sly sun
#

Yea, i've been there a lot. I've been building my map for about a week

#

and im worried about # obejcts and shit lol

#

i'll find out the hard way i guess

chrome mason
#

Oh boy what am i being dragged into

#

meh i've never dealt with world logic before so 😛

still forum
#

😄 No worries. It's already over ^^

sly sun
#

Someone called it "abomination "

#

😄

chrome mason
#

Thanks @still forum

#

And thanks @jade abyss for your support! 😂

jade abyss
#

wut? I didn do nutting

chrome mason
#

I know 😄

#

I make bad joke?

plucky beacon
#

#dontMentionUnecessarily

tough abyss
#

Or maybe I'm missing what they're telling me.

#

I also can't find it in function viewer?

#

Ah. There it is. Function viewer gives me the same information.

willow rover
#

Is there a way to retexture the look of the Arma 3 inventory? I want to make a mod that retextures it to match aspects in my mission.

plucky beacon
#

Not sure because I'm pretty sure that's all stuff with diolagues

#

Also, has anyone else experienced issues where if your mod breaks you need to restart your computer because the mod it launched with is in your memory even after it crashes for some reason

tough abyss
#

All I do is restart Arma and that's fixed. I don't think it requires pc restart

plucky beacon
#

I needed to rename the mod folder for it to work

#

Also, anyone know how I can have a script run everytime I open the zeus interface, I know CBA has stuff but I need something with no dependencies

simple solstice
#

@willow rover breaking point does it

#

@plucky beacon maybe displayAddEventHandler, but idk tho (findDisplay 46) displayAddEventHandler ["keyDown", "_this call functionName_keyDown"];

#

you can change the 46 display to the zeus one

#

but i have no idea if this is right ;p

tough abyss
#

is playMusic local or global

#

i'm prety sure it's local but i need to be sure

cedar kindle
#

local

tough abyss
warm gorge
#
private _vehicle = cursorObject;
private _pos = ASLToATL (getPosASL _vehicle);

_vehicle allowDamage false;
_vehicle setPosATL [_pos select 0, _pos select 1, (_pos select 2) + 0.5];
_vehicle setVectorUp [0, 0, 1];
_vehicle allowDamage true;

Am I doing something wrong here? For some reason this unflip vehicle script isn't working properly all the time.

simple solstice
#

maybe because of cursorObject?

#

did you try using nearestObject instead of it?

warm gorge
#

Nah its definitely not that, like it moves slightly but if the vehicle is at a certain angle it like doesnt unflip it properly, for some odd reason

#

I might try "_vehicle setVectorUp surfaceNormal (getPos _vehicle);" to see if it makes any difference

simple solstice
#

well i didn't knew what the issue was, so it is rotating but in a bad way

warm gorge
#

Its hard to tell, but I think so

simple solstice
#

hmm

#

how about this

private _vehicle = cursorObject;
_vehicle setPos (getPosATL _vehicle);
warm gorge
#

Yeah I tried that I think, lifted it up quite a bit in the air

simple solstice
#

it works for me

#

without issues

warm gorge
#

Yeah I might just do it like that

lofty rapids
#

HI there! Is it possible to have two cutrsc without removing the previous image? THank you! 😃

vapid frigate
#

i think as along as the layer is different it should work

lofty rapids
#

It is a diifferent layer, i want to add a cold breathe effect, but it always remove the other one...

#

(It is supposed to be a smooth transition)

#

Oh, found a solution, i had to call bis cutrsc layer function 😃

peak plover
#

can cba initPost be used as a class eventhandeler ?

#
["CAManBase", "initPost", {systemChat str _this + " has just been created"}] call CBA_fnc_addClassEventHandler;```
limpid pewter
#

hey can anyone see any problem with this? ```sqf
["B",bFlagCapped] remoteExec ["mld_fnc_scoreHudPointsUpdate",-2];

#

the function works when called on the client, but it isn't when spawned using the above line of code

peak plover
#

You can try 0 instead of -2. Are you running this in editor?

limpid pewter
#

yes, i am using the same command format as above in another server function, and it works fine. Only difference being that i am using the client ID instead of -2

#

so do you think that runnning it in editor could be the issue?

peak plover
#

if you run it with 0 and it works then yeah..

#

What does the function look like when normally used?

limpid pewter
#

ahh awsome, the 0 thing is working

#

it looks like this normally, when run on the client (by looks like i assume you mean, how it looks like when called). ```sqf
["A",2] spawn mld_fnc_scoreHudPointsUpdate;

#

or something similar

#

either way, it all works fine now with the 0 thing, i will just have to use -2 when i run it on the actually dedi

peak plover
#

Sweet potatoes!

waxen jacinth
#

ctrlSetEventHandler ["ButtonClick", "call fnc"]; is there a function for opening something like a hyperlink, redirecting to browser, when buttonclick? or any ideas how i can do it?

waxen jacinth
#

thanks

still forum
#

callExtension could do anything you want

peak plover
#

But that requires a mod

#

If you could add extensions to missions

tough abyss
#

If you could add extensions to missions (which arma would load), it would be dangerous to join a server

still forum
#

Ouh yeah. I always forget that there are non-dependency thingies 😄

peak plover
#

Yeah, I forget there are people who play vanilla as well. Dis gust thing

#

Anway, could there be like a extension that would allow pretty much anything mission side?

#

One extension to do anything?

#

Like extended eventhandelers

still forum
#

Intercept ^^
If you use workshop Mods you could just add a dependency to that extension Mod.
I don't know why people always want dependency-less Missions.
I understand that for several Gigabyte big Mods. But not for the couple KB for CBA or a small extension

peak plover
#

Yeah, now with arma 3 launcher and workshop it's a little like in gmod, you choose a server and it downloads the mods needed.

torn jungle
#

Im dissallowing the mod Gcam except for one specific admin/picturetaker in my missions. Would this work?

#
if(isClass(configFile>>"CfgPatches">>"gcam") && (_uid == 76561198068167250)) then {} else {endMission "END2";};```
narrow musk
#

Trial and error 😄

polar folio
#

anyone got a good idea how to know if a certain weapon slot is selected? just wondering if there is a event based way i am missing before i do it the frequent check way

peak plover
#

currentWeapon

#
(currentWeapon player) isEqualTo (primaryWeapon player) //primary slot selected
meager granite
#

uid is string @torn jungle

zenith totem
#

@still forum Because it's harder to start or grow a community on servers that requires mods, even if they're tiny mods.

sage belfry
#

hey, anyone know how to get entries from a description or config from the server before preInit?

polar folio
#

@peak plover thx but i knwo the condition. i was wondering if there are some known hacks to do it event based

still forum
#

@sage belfry Why before preInit? They can't change

#

@polar folio CBA has a Player eventhandler
I think it's CBA_events_weaponEvent get's triggered everytime the current weapon changes

sage belfry
#

@still forum I need the server ip and an chosen port, you know for what

still forum
#

you won't find that in config or description

peak plover
still forum
#

parse startParameters using GetCommandLineA on Windows. (Serverside)
Ohh.. you want it clientside you mean?

sage belfry
#

yes, clientsided

still forum
#

one sec

polar folio
#

yea i'm looking to do it myself without CBA though. any ideas how it is done in CBA? i might just go with anim EHs and read some properties from the config classes of the anim

still forum
#

I'd say detect it serverside at preInit. And then remoteExec a script with JIP enabled and pass ip/port along

polar folio
#

oh so it's just a condition check on each frame?

peak plover
#

Yes

polar folio
#

hm. that is what i wanted to avoid if possible. but it's no big deal. thx for the info guys

peak plover
#

stacked pfh

#

Loops don't start causing lag until >5k

still forum
#

That statement is wrong 😄 sooo.. wrong.

polar folio
#

oh yea. not saying it's bad. i jsut have my own system for that kind of stuff in place. was looking for some more engine based thing. more curiosity than necessity

peak plover
#

I tried a while ago with basically empty loops, but this was in VR and perfect conditions. In real gamepaly when more is going on it's probobly smaller

still forum
#

Whats in the loop is important.

#

also a onEachFrame handler is not really a loop

queen cargo
#

AnimDone
afterwards just do the checks

#

might can cause trouble with switchMove commands

polar folio
#

yer i figured that's the best way. or atleast easiest. better than crazy ideas like adding EHs to the ammo/weapon HUD 😄

queen cargo
#

indeed
at least you try to avoid CBA
no one will admit but it takes a few FPS due to some dump ways they do stuff

still forum
#

#Intercept CBA Plugin :3

polar folio
#

or a way to properly hide scroll actions while keepign them active to use that shortcut hack

queen cargo
#

would indeed be better @still forum

peak plover
#

Everything takes a few FPS. Many people don't know that even adding attachments will decrease fps. That's why AI should not have any

queen cargo
#

@polar folio those animation EHs are those

#

cheap excuse for bad coding

peak plover
#

Yeah, wish we could just toggle action menu actions in controls if we assing keys to them

#

Is there a way to remove them? I don't need to scroll down and have gear up/down there if I bind it on G

polar folio
#

wasn't there some action menu streamlining stuff done that allows that? not sure if the gear function was included in that though. also can't remember how it worked exactly. probably some toggle option somewhere, if an action is bound to a key

tough abyss
#

Oh shit, that's really cool. Thanks @tough abyss, I never noticed that.

sharp jay
#

Is it possible to have custom text on signs without adding pictures to your mission?

remote flame
#

Anyone here know how to make it possibole to drop random supply drops on random locations (Dedicated Server)

simple solstice
#

well, you are basicly asking if someone would write a script for you

remote flame
#

Well I am asking if anyone have some tips or know a command that I can use

simple solstice
#

there is no "command" for that. tips i can give you: look at some missions that have random loot drops, and see how they are done

#

try writing a script that would spawn a crate infront of you with random loot you want

remote flame
#

Ok, will do

modern sigil
#

Question:

I know that TFR will sometimes not give compatible radios to all players in a server (especially if they JIP). The lazy way to fix this is to just place an Ammo box full of TFR radios... but there must clearly be a more convenient way, scripting-wise at least, to sort that stuff out ahead of time so that you don't have to fuck around with the radios for a while at the start of a mission. What way is that?

#

I've tried reviewing the TFR scripting functions on the Github's wiki page but I feel like I've had inconsistent results by testing them out on my own in the editor. Testing on a dedicated server has a lot of overhead time in between iterations, so I figure it'd save time to just ask here and see if there's maybe a tutorial or something out there that I'm just not seeing.

lean tiger
#

Is there a BIS_fnc anywhere that will iterate through all contents of a container (and any containers in it), etc, into a string?

#

and back again?

#

I'm coming up on having to write one, but this sounds like a problem someone else would have tackled before

subtle ore
#

array of strings

lean tiger
#

Saw that, but is weapon specific, can't find the inverse, also in test doesn't pull down if it has anything loaded, the ammunition, or the attachments

subtle ore
#

@lean tiger specific type of weapon?

#

{if(_x isKindOf['Rifle',configFile >> "CfgWeapons"];} forEach _myLaserGunArray;

lean tiger
#

sorry, I mean, that only gets weapons in the vehicle

#

it's specific to weapons*

#

wouldn't get ammunition, uniforms, etc

subtle ore
#

yes getWeaponCargo is specific to weapons

lean tiger
#

It's just itching me there has to be a "storage dump to string // array" function

#

and inverse

#

load from string, etc

subtle ore
#

Nata, why need a function when you have getWeaponCargo

still forum
#

@modern sigil Try TFAR 1.0 😉

lean tiger
#

I think you're misunderstanding @subtle ore 😦

#

let me share more context

subtle ore
#

I believe I am 😦

still forum
#

getWeaponCargo getItemCargo getMagazineCargo @lean tiger

#

Afaik there is no already done script that combines all these into one script

lean tiger
#

I haven't tried itemCargo yet

#

but it's coming across to me it wouldn't recursively search container (uniform/backpack) contents either

#

😦

#

maybe I'll be the first

#

greater context:

#

wrote a SQL Server database connector last year, now that I'm getting some time back, working on a persistent / MSO-esque scenario

#

would love to just dump container contents to DB on the reg

#

and reload it on init

subtle ore
#

So let me ask this, what is the getter cargo commandsd not doing for you?

lean tiger
#

when I was testing it last year (which I concede, has been some time) it didn't pull down weapon attachments or loaded magazine type, or remaining magazine count

#

also I used weaponCargo, not getWeaponCargo

#

get- is ARMA2 and appends a count to the end instead of each instance getting its own index

still forum
#

Yeah. There is definetly no script ready for that. That's quite complicated territory.

lean tiger
#

foo

#

thanks for the quick consult 😃

iron stream
#

so i'm a beginner with sqf

#

I've tried this out:

#
player addEventHandler ["onPlayerKilled", "systemChat Player Dead;"];
#

But it doesn't output anything 🤔

#

When I kill myself

lean tiger
#

you're running as MP? That the scenario isn't ending when you die, right?

iron stream
#

Singleplayer

#

Oh so it ends before I get to see anything right?

still forum
#
player addEventHandler ["onPlayerKilled", "systemChat 'Player Dead';"];
#

everything is correct.

#

You just need to pass a string to systemChat

#

also you can

player addEventHandler ["onPlayerKilled", {systemChat "Player Dead";}];
lean tiger
#

yeah, ignore me, been out of the saddle for too long

still forum
#

I also think you need to remove the on from onPlayerKilled

lean tiger
#

it's just killed

#

on a vehicle

iron stream
#

Still not receiving anything

#

I'm on foot

still forum
#
player addEventHandler ["killed", {systemChat "Player Dead";}];
lean tiger
#

Also: @still forum -- I think this might actually have been totally done before, the Survive-Adapt-Win campaign would rip the storage out of whatever vehicle you were driving and save it into the campaign storage

#

just recalled that 😃

iron stream
#

Okay it works with killed

#

Thanks!

#
player addEventHandler ["killed", {systemChat format ["Player Dead: Killed by %1", _this select 1];}]; 
still forum
#

Campaign saves is something different though. The engine save-game system ofcause can save that

lean tiger
#

I mean it's added to the weapon pool

rotund cypress
#

@iron stream Be aware that doing it that way will only display the chat entry for yourself.

iron stream
#

Yeah

rotund cypress
#

Maybe thats what you want 😉

iron stream
#

I'm only testing ^^

#

It's quite easy to understand it

#
player addAction ["System Chat Pos", {systemChat format ["%1, %2, %3", player getPos select 0, player getPos select 1, player getPos select 2]}, nil, 6];

Now I'm getting missing ] somewhere here

rotund cypress
#

Ah yes, then that is very handy 😃

#

getPos player

#

getPos object

iron stream
#

oh ok

#

Ayy it works!

rotund cypress
#

also, for readability you can also do sqf (getPos player) params ["_posX", "_poxY", "_posZ"];

#

THen those variables will be defined and privatized for you

#

That is before the addaction, and then u would use those variables instead.

iron stream
#

(variable to get stuff from) params [array of returns]; ?

rotund cypress
#

Well, you sort an array

iron stream
#

Wouldn't that save the player's position only once and not every time I use the action?

rotund cypress
#

You can do it inside the addAction

#

And it's not the array of returns, it's each element at the index order

iron stream
#

Or create a function

#

That would probably be cleaner

#

Are those even called functions in SQF?

rotund cypress
#

Well, kinda

#

You would just call code

#

But the code would be defined in the file

#

I see no need for it here though

#

But if you want to do that you would do _myFnc = {code...};

#

call _myFnc;

#

in your case I guess it would be [getPos player] call _myFnc;

iron stream
#

how do I return values with a function?

rotund cypress
#

Just leave it at the end of execution

#

For example _string = "";

#

_string

#

but there is really no need for a function here, you would have to sort out multiple times then, sort out the returns etc

iron stream
#

ok

rotund cypress
#

This is how I would do it personally ```sqf
player addAction ["System Chat Pos", {
(getPos player) params [
["_posX", 0, [0]],
["_posY", 0, [0]],
["_posZ", 0, [0]]
];

systemChat format ["%1, %2, %3", _posX, _posY, _posZ]

}, nil, 6];```

still forum
#

why not just format ["%1", _pos] ?

rotund cypress
#

Ye that as well ^^

iron stream
#

that works?

still forum
#

Yes.

#

format can stringify anything

#

same as str _pos

rotund cypress
#

I believe str is faster though

iron stream
#

oh yeah

#

nice

still forum
#

not much but yeah.

iron stream
#

ok gtg eat thanks for the help lads!

plucky beacon
#

So who wants to help give me a rundown on userconfig files for addons

#

:D

still forum
#

Addons to have description.ext. But #include works everywhere.

#

for userconfig files you need to enable -filePatching. And be careful not to #include a userconfig inside a script file because that would allow anyone to execute any script inside your Addon

plucky beacon
#

Hmmm

still forum
#

#include'ing userconfigs is generally discouraged. Because if that file is missing your game will crash

plucky beacon
#

I want to make my mod configurable though 🤷

still forum
#

CBA settings

plucky beacon
#

No dependencies

#

🤔

still forum
#

No dependencies for a Mod?

plucky beacon
#

Yes

still forum
#

Why? ^^

#

Then you have to go with userconfig or implement your own settings system.

plucky beacon
#

Alright that's my answer

#

It's only a client side mod

#

Does workshop support userconfig files?

still forum
#

Not sure. Don't think so.

#

After a minute of googling the answer is no.

plucky beacon
#

My phone can barely load google homepage from here atm

still forum
#

And as userconfig requires you to enable filePatching anyway. You also need to allow filePatching serverside.
And at that point you could also just use CBA client and serverside.

#

@hasty violet Not an option. It's clientside only.

plucky beacon
#

It doesn't have to be mid game it probably can't be honestly, everything initalizes post init

#

I'll probably just try what enhanced movement did

iron stream
#

Does anybody have the complete list of events in SQF?

iron stream
#

Yeah

#

Thanks

jade abyss
#

Bookmark the first Link.

iron stream
#

Done

#

So I'm just testing out stuff, but how do I remove the Deployed state of a weapon (aka bipod activated)?

#

I know I have to add an event handler on the player for WeaponDeployed first

indigo snow
#

action, probably

iron stream
#

Decided to go with unitPos

#

If prone force it back up

#

SQF is fun

subtle ore
#

@Erlite#2215 Made my gut wrench a little, but sure I guess.

dusk sage
#

Give it some time... 🤣

limpid pewter
#

So i have this in my initPlayerLocal.sqf sqf ctrlTitle = controlNull; ctrlCapPoint = controlNull; ctrlBar = controlNull; to initialise the controls. Then in a function used to update some of the controls, i have this ```sqf
if ((isNull ctrlTitle) or (isNull ctrlCapPoint) or (isNull ctrlBar)) then {
ctrlTitle = (uiNamespace getVariable "captureProgress") displayCtrl 1100;
ctrlCapPoint = (uiNamespace getVariable "captureProgress") displayCtrl 1101;
ctrlBar = (uiNamespace getVariable "captureProgress") displayCtrl 4020;
};


can anyone see a reason as to why this might be the case?
limpid pewter
#

ok so it is updated in the function that is called every 0.5 seconds

#

sorry spawned

#

basically it is spawned once for each player in a triggger, it then starts a while do loop while that player is in the area of that trigger (locally). That loop then updates the controls,

#

the controls are a progress bar (to display the capture progression) and the title and capPoint are both structured texts, taht are only update once the capture point is captured.

limpid pewter
#

nevermind, i am just going to use a if (isNil ) as well as a if (isNull) that way it will work in any condition.

meager granite
#

If they're undefined means uiNamespace getVariable "captureProgress" is undefined

#

And you run your code before you start your display or assign it to uiNamespace's "captureProgress"

#

You can either fix that or change to uiNamespace getVariable ["captureProgress", displayNull]

tough abyss
#

The _pos array returned by onMapSingleClick is [X,Y,Z], right?

remote flame
#

How do you make so that when an player is near an object the player gets money? (Multiplayer)

limpid pewter
#

@meager granite So i should just defined the controls at in initPlayerLocal.sqf? Will that fix it?

#

only asking, because you were saying, run your code at start, why not just run it in the initPlayerLocal script?

#

if i define them in there, and give them the control ID, then they should stay defined for the whole mission, is that right?

#

@remote flame Use the nearestObjects (https://community.bistudio.com/wiki/nearestObjects) command, it will return an array of all objects in specified radius. Then use the foreach command and check if the objects are player. Then for the objects that are players run a script that will give them "money"(money isn't a system inplace in arma already, so i assume you already have made a money system). Hope this helps

remote flame
#

It helps alot, Yes I have a money system. thank you I will try this 😃 @limpid pewter

limpid pewter
#

cool, i helped someone for oncce 😃

tough abyss
#

Is there a way to use onMapSingleClick for multiple clicks?

limpid pewter
#

make a simple counter, so if they click, wait for a second click, and then only if both are clicked, then do soemthing

tough abyss
#

Hello, anyone knows why it would return 0 after I kill a unit?

_pe_pl_kills = score PE_PL; 
hint format["%1",_pe_pl_kills];
limpid pewter
#

what you have put there looks fine

tough abyss
#

I don't get it ><

#

what the heck

#

I killed 2 units inside a vehicle and it counted them

limpid pewter
#

so it works then?

tough abyss
#

No lol

#

It counted only the vehicle kill

#

apperantly when you kill a vehicle it gives you 2 points

limpid pewter
#

make sure pe_pl is the var name of the unit also, that;s the only reason i can see that it wouldn't work is if the unit isn't defined correctly

tough abyss
#

It is

limpid pewter
#

no annoying little spaces after the var name? triple check

tough abyss
#

nono

#

It adds the points

#

but only if I kill vehicles

#

I killed 3 vehicles and now the hint says "6"

limpid pewter
#

yeah idk, man i probably shouldn't have responded to start with, see if someone else can help you

tough abyss
#

well you tried 😛

#

thanks anyways 😄

tough abyss
#

Anyone please?

halcyon crypt
#

also note that score is only useful in MP

tough abyss
#

@limpid pewter can you elaborate further?

#

Like this? ```SQF
["pointsEH", "onMapSingleClick", {
private _i = 0;

if (_i == 0) then {
    _point1 = _pos;
else {
    _point2 = _pos;
};

}] call BIS_fnc_addStackedEventHandler;

limpid pewter
#

oh lol, i thought you were talking about my issue haaha, i spent like 4 mins writing an explaination of my issues haha XD

tough abyss
#

No, sorry 😕

limpid pewter
#

nah so i was saying (not sure if exactly what you wanted) to run a script in the EH that would baisically wait for the script to be run a second time (to create a double click effect) and once the script had been run twice in quick succesion then run what ever code you wanted the EH to run

tough abyss
#

I don't need a double click effect. I need to click on two points on the map, than I do some stuff with them.

limpid pewter
#

oh ok

#

so you want to essentially click on one point on the map, log that position, then click on another?

#

is that correct or am i way off?

tough abyss
#

Yes, click on two sperate positions and log both.

limpid pewter
#

well then in kinda the same way, you should run code that will check if the code had been run once before. If not, then log that pos as number 1, if it has run before, then log that pos as number 2

#

that sorta thing

#

gimme like 3 mins and i will show example

tough abyss
#

Ok, I'll wait.

limpid pewter
#

simple, but it shows the concept im explaining i guess 😃

tough abyss
#

Thanks, I'll try it.

limpid pewter
#

in that case ```sqf
check = 0;
mapPosArray = []; // mapPosArray [pos1,pos2]
NEV_fnc_logTwoMapPos {
if (check == 0) then {
mapPosArray set [0,_pos];

};
if (check == 1) then {
mapPosArray set [1,_pos];
};
If (check > 1) then {
check = 0;
};
check = check +1;
};

["pointsEH", "onMapSingleClick", {
call NEV_fnc_logTwoMapPos;
}] call BIS_fnc_addStackedEventHandler;```

tough abyss
#

👍

limpid pewter
#

There you go, streamlined hehe ```sqf

mapPosArray = []; // mapPosArray [pos1,pos2]

["pointsEH", "onMapSingleClick", {
if ((count mapPosArray) == 0) then {
mapPosArray set [0,_pos];

};
if ((count mapPosArray) == 1) then {
mapPosArray set [1,_pos];
};
If ((count mapPosArray) > 1) then {
mapPosArray = [];
};
}] call BIS_fnc_addStackedEventHandler;```

#

@tough abyss

indigo snow
#

instead of having an extra check variable, you can simply count the size of mapPosArray

limpid pewter
#

^

#

dat would work too

tough abyss
#

Hi all, any ideas why attachTo with a static object not work.

I am trying to attach the static model of the Pillar of Dawn from Operation Trebuchet to a jet so I can see it move in the sky.

However it just remains static and the jet flys away

this attachTo [star1];

star1 being the jet

limpid pewter
#

haha that would be awesome 😄

iron stream
#

static = doesn't move

#

so yeah probably done on purpose

limpid pewter
#

^ if you still can't figure out how to attach it to the jet, just run a loop that will act on the jet and the static object. The loop will constantly check the possistion of the jet (btw i would recommend a xian instead) and setPos the postion of the Pillar of daw

#

As usually, very clunky around about way of doing it, but it would work ( will be quite laggy tho)

tough abyss
#

They are doing it here, I wonder if they are using the method you suggested

limpid pewter
#

in the description "Just a test to see how the object move script would work", so i assume yes they're using something similar to what i suggested (since he said object move script).

#

maybe ask them on their TS "Join us on Teamspeak for questions or if you are interested in joining:
185.62.205.33:10013"

#

also have you looked at the BIS forum link that was in the description

#

But that script will only work from marker to marker, if you wanted to be able to control the ship then what i suggested would be best

tough abyss
#

Yea trying that script out, need to adjust the altitude though as its flying across the ground a Z=0

limpid pewter
#

haha yeah, that wouldn't be so great 😃

tough abyss
#

hmmm seems there is no Z index for markers 😦

#

At least in the editor when I try to change it

limpid pewter
#

correct, so you would have to do```sqf
_markerPos pushBack Zvar;

#

that would add the height

tough abyss
#

I am thinking I might modify the script to ignore z index of marker and just use the objects Z index at mission start?

limpid pewter
#

that would work, except for when there are mountains XD

#

you would need to pick a high enough altitude to avoid all obsticles

tough abyss
#

It will be high enough opefully 400 metres

limpid pewter
#

yeah should be

tough abyss
#

Hmmm complaining that I am using an array instead of string but the docs for setMarkerPos say array is a valid parameter

_atl = (getPosASL _obj) select 2;

_markerPos1 = getMarkerPos _mkr1;
_markerPos1 setMarkerPos [_markerPos1 select 0, _markerPos1 select 1, _atl];
limpid pewter
#

_markerPos1 setMarkerPos [_markerPos1 select 0, _markerPos1 select 1 ?

#

what is _markerPos1

#

_markerPos1 needs to be string name of the marker

tough abyss
#

Completely refactored the script haha, seems stupid to use markers, getting it to accept generic objects now

#

Almost working it just seems to be jerking a bit, I think its something to do with the terrain

#

Think I might need to use setPosAGL?

#

Woohoo

limpid pewter
#

seems to be jerking a bit yeah thats gonna happen with static objects

tough abyss
#

asl fixes that

limpid pewter
#

heey i was reading that XD

#

awesome 😃

tough abyss
#

Sorry ging to pastebin it , didnt want to spam the channel

limpid pewter
#

yeah thats a good thing

tough abyss
#

Thanks all for the help

limpid pewter
#

all g

iron stream
#

How does one add an event handler to a player when they connect to the server?

subtle ore
#

@iron stream initPlayerLocal

iron stream
#

thanks

#

ummm I don't see it in the docs @subtle ore

solemn steppe
#

Hello there, I'm looking to detect if some units are dead ```_endGameThread = [] spawn {

waituntil {
    
    if {(!alive arty_1) and (!alive arty_2) and (!alive arty_3)} exitWith { CODE };

sleep 3;
false

};

};```
Doesn't work, I've got a "expected BOOL" error. Any ideas ?

subtle ore
#

@iron stream it's an event script. make it in the root of your mission folder initPlayerLocal.sqf

iron stream
#

oh ok

subtle ore
#

@solemn steppe your waitUntil needs to return a boolean not a piece of code.

remote flame
#

Does anyone know if you have an "undefined variable in expression" what to do? have tried everything but it dosent work

lean tiger
#

share some context?

#

A lot of stuff leads to that 😮

#

commonly typo's or locality issues

subtle ore
#

@remote flame means the variable you are trying to use doesn't have a value. Doesn't always mean you are using a variable either

#

@lean tiger locality issues would be seen ingame and would break the script without error usually.

remote flame
#

Ok, I am trying to call SHK_pos but it only gives me "undefined variable in expression shk_pos"

lean tiger
#

Since you just schooled me, would you know any command to get the type of a variable? Looking to recursively pull all distinct values out of a mixed tree in an array

subtle ore
#

@remote flame the function needs to exist somewhere. if you are calling it like this: call shk_pos check your description.ext for a CfgFunctions entry. If it doesn't exist call it from the directory like so: call compile preProcessFile "scripts\shk_pos" with SHK_pos it returns a value, it doesn't generate markers or anything of that sort.

#

@lean tiger typeName I believe.

lean tiger
#

I swear to god I searched the wiki

#

if that's it

remote flame
#

will try

#

thx

lean tiger
#

fuck me, thanks Midnight

subtle ore
#

@remote flame yep sure thing

#

@lean tiger yeah the wiki is hard to find things in sometime, glad you found a solution

lean tiger
#

were you who I was speaking with yesterday about the full inventory dump?

#

I'm on an interesting path to that

subtle ore
#

@lean tiger Yep I was, what's the progress look like?

remote flame
#

Tried calling it from init but still same error.

#

private ["_mapCenter"];
_mapCenter = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition");
[_mapCenter, random 4000, random 360, false] call shk_pos;

#

That is the code trying to call it

subtle ore
#

@remote flame which variable is coming up undefined?

remote flame
#

shk_pos

subtle ore
#

Okay, let me point you back where we started. Does your description.ext have a CfgFunctions entry for shk pos? If not, you will need to execute it from the directory

#

ex: [_mapCenter,random 4000,random 360,false] call compile preProcessFile "scripts\shk_pos.sqf";

remote flame
#

I will try thx

lean tiger
#

Midnight -- mix of everyContainer and weaponsItemsCargo

#

everyContainer replies with the class name then the instance id of every uniform/vest/etc in a container

#

so if you just make a generic function, you can recursively get through the whole tree

#

problem is weaponsItemsCargo passes the magazine and its ammo count as well as an array

subtle ore
#

@lean tiger Cool, so a very interesting way of keeping track of everything. Is it executed specificially or does it account for all vehicles?

lean tiger
#

I haven't implemented it yet

#

Fixing my DB connector 😦

#

then I'll just have the server dump it to DB every 60 seconds or so

#

then listen to all players in an area, mine through their stuff as well

subtle ore
#

Every 60 seconds? What if there aren't any players on the server? Isn't that a waste of DB entries?

remote flame
#

@subtle ore I am doing exactly as it tells me in the shk_pos_init.sqf:

#

Usage:
Preprocess the file in init.sqf:
call compile preprocessfile "SHK_pos\shk_pos_init.sqf";

Actually getting the position:
  pos = [parameters] call SHK_pos;
#

But still undefiend variable

subtle ore
#

@remote flame Because it has no idea what shk_pos is until you preProcess it

lean tiger
#

of course it is, but you're talking to a database goon who loves stats 😃

remote flame
#

I preprocess it in init.sqf.

#

Shouldent that do the trick?

lean tiger
#

if there aren't any players in the area, then it doesn't fire

#

not foolproof, other scripts could inject/take items and it wouldn't catch that

#

but yeah

#

could probably also route it through a stored procedure to diff it, then not insert on no change

remote flame
#

Found the problem

#

but dont know who to fix it

lean tiger
#

go on

remote flame
#

So my script for my stores is making it not work took away call compile preprocessfile "scripts\shop\storehandler.sqf"; and it worked with shk_pos

#

dont know how to have them both if they are not working well together

lean tiger
#

probably a collision on a variable/function name

#

if I had to guess

remote flame
#

How can you fix such thing?

lean tiger
#

notepad++ find and replace in files

#

in a sentence

remote flame
#

ok I will do that thx

#

It works now... @lean tiger @subtle ore

#

I just deleted the preprocess in init and replaced it with a copy and it worked

#

But now when I got you pros here can you find something wrong with this code?

#

cash=10000;
level=1;

addmissioneventhandler [
"entitykilled",
{
params ["_killed","_killer","_instigator"];
if (player isEqualTo _instigator) then {
if (((side _killed) getFriend playerSide) < 0.6) then {
cash=cash+100;
cutText ["Kill +100$","PLAIN DOWN",2];

         (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: %1",cash];
         
        };
    };
}];
#

It is supposed to add money for kills of AI or Players

lean tiger
#

not familiar with getFriend, thought that was all basically a bit

#

not a sliding scale

#

looks good from here

remote flame
#

Because it dosent give any money

lean tiger
#

nope

remote flame
#

Do you know a fix?

lean tiger
#

truly, its been a year since I did this actively, and I work with a fuckton of other stuff

#

but I'm pretty sure cash = cash + 100 is local to the function

#

throw a hintSilent cash; after that line

#

see if it returns 100 or the new sum

#

if it doesn't fire, period, your IFs need tweaking

remote flame
#

Ok, btw this code is in "initLocalPlayer.sqf"

#

is that right?

lean tiger
#

heck if I know, I don't know your scenario file structure 😉

#

init.sqf is all that matters, then its locality splits

remote flame
#

Ok

#

thx for info

#

😃

tough abyss
#
_pe_pl_kills = score PE_PL; 
hint format["%1",_pe_pl_kills];
_pe_pl_kills = getPlayerScore PE_PL; 
hint format["%1",_pe_pl_kills];

Both return 0 when I kill a player but gives me points when I kill vehicles

#

Anyone knows why?

subtle ore
#

@tough abyss Because it's an array of return values not just one return for getPlayerScores

tough abyss
#

It doesn't matter

#

it goes 0,1,0,0,2

#

the first one is infantry

subtle ore
#

Yes of course

tough abyss
#

and when I kill a unit it stays 0

#

"score" does the same

subtle ore
#

what I'm saying is that you should try and select the first, and see where it fails at retrieving the scores

#

Because it you had said it retrieves the vehicle scores

tough abyss
#

getPlayerScore PE_PL select 0;

#

like that?

subtle ore
#

yep

tough abyss
#
_pe_pl_kills = getPlayerScores PE_PL select 0;
hint format["%1",_pe_pl_kills];

gives 0 when I kill 1 infantry

#
_pe_pl_kills = getPlayerScores PE_PL select 1;
hint format["%1",_pe_pl_kills];

gives 1 when I kill 1 vehicle

halcyon crypt
#

do you use ACE?

tough abyss
#

I do

halcyon crypt
#

try without and check if there's a difference

tough abyss
#

it works

#

dafuq

#

😐

halcyon crypt
#

yeah when using ACE medical kills don't get registered properly

#

at least that's what we saw in ALiVE

#

that's the/our "fix"

#

and you probably have to set the score manually

scarlet temple
#

o/.. just a small question.. i triy to create a eventhandler with CuratorObjectPlaced... how can i get the placed object?

#

i tried already
_x addEventHandler ["CuratorObjectPlaced", {[_this] call fn_update_civ_zeus;}

subtle ore
#

@scarlet temple _this is an array, not the object placed.

#

selection 1 of that array _this select 1 is the object

scarlet temple
#

aaah!

#

thx!

ivory vector
#

anyone know why switch weapon isnt working in cam ?

#
    player switchMove "FXStandDip";
    player action ["SwitchWeapon", player, player, 100];
    waitUntil {currentWeapon player == ""};
    player playMove "Stand";
    0 cutFadeOut 5;
    //Open the Menu if its not already open Kapp
    if(isNull (findDisplay 95446))then{
        createDialog "LoginMenu";
    };
    life_shop_cam = "CAMERA" camCreate getPos player;
    _pos = [[-744.98,14992.2,0.00177002], 10, 50, 3, 0, 20, 0] call BIS_fnc_findSafePos;
    player setPos _pos;
    player setDir 226.173;
    showCinemaBorder false;
    life_shop_cam cameraEffect ["Internal", "Back"];
    life_shop_cam camSetTarget (player modelToWorld [0.65, 0.5, 1]);
    life_shop_cam camSetPos (player modelToWorld [1, 4, 2]);
    life_shop_cam camSetFOV .50;
    life_shop_cam camSetFocus [50, 0];
    life_shop_cam camCommit 0;
    life_cMenu_lock = false;

player still has weapon out and

#

if I manually use ```
player action ["SwitchWeapon", player, player, 100];

#

I think i got it just had to put a small sleep in

remote flame
#

Anyone know how to give money to the player that reach an objective first?

#

_missionDone = false;

while {!(_missionDone)} do {
{

if ((_x distance art) < 10) then {
  
 cash=cash+2500;
 (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: %1",cash];
 hint "Award for your efforts 2500$";
 };
    _missionDone = true;
};

}foreach playableUnits;

sleep 0.5;

peak plover
#

@ivory vector player action ["SwitchWeapon", player, player, 100];

#

Why 100?

#

Isn't that the weaponindex?

little eagle
#

If you use an out of bounds index, you put your weapon on the back.

#

Maybe some weapon reaches 100 here though. ~250 would be safer.

peak plover
#

I don't think that would not explain why it works manually

simple solstice
#

@remote flame why is _missionDone = true; outside the if scope?

peak plover
#

private _missionDone = false;