#arma3_scripting

1 messages ยท Page 690 of 1

winter rose
#

not simple, but double array

drifting portal
#

oh, thanks, but why do I have to double array it? (it worked thanks)

crude vigil
#

if it doesnt have left hand side values, I think it is fine, lou?

#

do I recall it wrong

winter rose
#

when argument is an array, you have to un-trick remoteExec

drifting portal
crude vigil
#

huh, well yeah I personally did that always but didnt know it was actually required, perks of playing safe always

#

but yeah thinking now, ofc how else could it understand the difference...notlikemeow

modest nova
#

does anyone know how to make a gbu blow up? i have a function that uses createVehicle to create a gbu (bo_gbu12_lgb) but i want it to blow up immediately, i tried setting its damage to 1 but it didnt blowup

winter rose
#

make it hit the ground

drifting portal
#
[myvehicle, "rhs_weap_s8"] call BIS_fnc_fire;

is there a way to make this command fire rapidly instead of 1 shell each second?

winter rose
#

maybe change the reload time

drifting portal
#

how's that?

#

do I need to access the config?

winter rose
#

setWeaponReloadingTime

drifting portal
#

but

#

its a rocket pylon

#

so does it count as "reload" ?

winter rose
#

read the wiki ^.^

drifting portal
#

since when I manually use it I can fire it rapidly

winter rose
#

then idk, maybe the function itself is slow

drifting portal
#

got a better command?

#

I don't want to fire at a "target"

#

just fire

winter rose
#

ยฏ_(ใƒ„)_/ยฏ

#

fire
doFire
fireAtTarget (with a virtual one maybe)
forceWeaponFire
doArtilleryFire
doSuppressiveFire
action ["UseWeapon"]
etc ๐Ÿ˜„

drifting portal
winter rose
#

anytime! ๐Ÿ‘ ๐Ÿ˜„

modest nova
winter rose
#

none I know, maybe you can create it on the ground then teleport it immediately to where you want to

drifting portal
drifting portal
#

then remove the object when it explodes

winter rose
#

also all of them are linked in the fire wiki page ๐Ÿ˜‰

floral steeple
#

How do I disable the default AI voices

#

like the: "Man 200 meters front!" stuff.

winter rose
#

setSpeaker

floral steeple
#

ah

#

so if I have custom identities and I don't them to have a voice I can just do:

speaker = nil;
#

?

#

maybe speaker = "";

little raptor
floral steeple
#

ah okay lemme check

#

yep I can just do that, thanks for the help

drifting portal
#
_firesrocket =0; 
while {_firesrocket < 35} do { 
driver myplane forceWeaponFire ["rhs_weap_s8", "Burst"]; sleep 0.01; 
_firesrocket = (_firesrocket +1); 
};
``` when running this in console (debug console), the unit fires at the desired rate, but when I put it in an sqf it fires 1 rocket per second, any reason behind that?
winter rose
#

the console cannot sleep

drifting portal
#

well I do [] spawn {};

#

and put that inside

winter rose
#

then ยฏ_(ใƒ„)_/ยฏ

modest nova
#

does anyone know how to use remoteExec for something like groupChat where it has a parameter before and after it (player groupChat "string")?

winter rose
#
[leftArg, rightArg] remoteExec ["command"];
modest nova
#

ah ok thank you

#

is a variable defined inside a while loop not accessible from outside the while loop?

winter rose
#

no

digital torrent
#

any method to make this execute on all machine? without changing the code's sqf location

{deleteVehicle _x} forEach nearestObjects [getMarkerPos "screamer_1", ["Land_Statue_02_F","B_Soldier_VR_F","Sign_Sphere25cm_F"], 200];
winter rose
#

{} remote exec call, but meh

digital torrent
#

but how?

#

like only the delete vheicle part? or the nearest obejct?

#

not sure which one to use

winter rose
#

everything, using remoteExec

#

but wait

digital torrent
#

how would you treat the foreach?

winter rose
#

it's a deletion, deletion has a global effect

digital torrent
#

it is not working on the dedicated server

#

just tried

winter rose
#

you cannot delete a terrain object though

digital torrent
#

or maybe i ran the code on private local

winter rose
#

should still work

digital torrent
#

yea, they are deletting added object.

#

it works on multiplayer

#

not on dedicated

winter rose
#

weird

digital torrent
#

maybe where i ran the code is the problem

winter rose
#

that and/or you have some commands disabled for clients

digital torrent
#

how would i know if i had commands disabled for clients?

winter rose
#

that's server administration, idk too much

digital torrent
#

oh lol

#

then it is probably not disabled

#

ok thanks, i will try to figure out

winter rose
#

GL!

past wagon
#

is there a scripting command to replace a specific element of an array?

grim coyote
#
_index = 0;
_newData = "test";
array set [_index,_newData];
past wagon
#

hmm

#

ok

#

sweet

#

thanks

grim coyote
past wagon
#

also would there be a quicker way to do this:

var1 = 1;
var2 = 1;
var3 = 1;
var4 = 1;
var5 = 1;

something like this maybe:

var1, var2, var3, var4, var5 = 1;

( i know the bottom one isnt actually correct )

grim coyote
#

Its hard to say exactly what you want but something like this in this exact case:

for "_i" from 1 to 5 do {
  missionNamespace setVariable [("var"+_i),1];
};
past wagon
#

yeah that makes sense

#

i only have 8 variables, so its not a problem

#

i was just curious if there was some way to set a bunch of variables to the same thing at once

drifting portal
#
[] spawn {
setTimeMultiplier 120; 
waitUntil {(date select 3) == 19 && (date select 4) == 35}; 
setTimeMultiplier 0.4;
};

I'm trying to make a time lapse, but I can't figure out why this code is not working

#

I tried dayTime too

winter rose
#

try >=, it might go too fast IDK

drifting portal
#

wanted to try that too

#

it worked

drifting portal
#

tried ```sqf
BIS_fnc_ambientAnim_terminate

winter rose
#

is defined only when the ambientAnim function has been called

drifting portal
past wagon
#

Here is my current code. I am using variables opforflag1, bluforflag1, opforflag2, bluforflag2, etc. for each respective "scenario". How could I condense this into one piece of code, using the value of scenario and adding it on to opforflag and bluforflag? could I do something similar to this: #arma3_scripting message ?

if ( scenario == 1 ) then {
    { if ( isPlayer _x ) then { _x setPos getPos opforflag1; } } forEach units east;
    { if ( isPlayer _x ) then { _x setPos getPos bluforflag1; } } forEach units west;
};

if ( scenario == 2 ) then {
    { if ( isPlayer _x ) then { _x setPos getPos opforflag2; } } forEach units east;
    { if ( isPlayer _x ) then { _x setPos getPos bluforflag2; } } forEach units west;
};

if ( scenario == 3 ) then {
    { if ( isPlayer _x ) then { _x setPos getPos opforflag3; } } forEach units east;
    { if ( isPlayer _x ) then { _x setPos getPos bluforflag3; } } forEach units west;
};

if ( scenario == 4 ) then {
    { if ( isPlayer _x ) then { _x setPos getPos opforflag4; } } forEach units east;
    { if ( isPlayer _x ) then { _x setPos getPos bluforflag4; } } forEach units west;
};

The end result might be something like this:

    { if ( isPlayer _x ) then { _x setPos getPos ("opforflag" + scenario); } } forEach units east;
    { if ( isPlayer _x ) then { _x setPos getPos ("bluforflag" + scenario); } } forEach units west;
copper raven
#

getPos doesn't take string

past wagon
#

yeah

#

i know thats not gonna work, but am I on the right track?

warm hedge
#

There's unfortunately no such thing but a kind of stupid workaround:

call compile format ["opforflag%1",scenario];```But not sure if this works in this situation
copper raven
#

no

warm hedge
#

Oh yeah, I forgot that solution

past wagon
#

is just need to use the variable scenario (which equals 1, 2, 3, or 4) and at that to the end of "opforflag" to get opforflag1, opforflag2, etc.

#

ok

#

what does this return?

missionNamespace getVariable ("car" + str _i)
#

does it return a string, or the variable?

#

ohhh

#
("car" + str _i) //returns a string
missionNamespace getVariable ("car" + str _i) //returns a variable
warm hedge
#

I kinda want to see a command to return a identifier itself than a variable, yes

past wagon
#

ok

#

So would this work?

_posBlue = getPos (missionNamespace getVariable ("bluforflag" + str scenario));
_posRed = getPos (missionNamespace getVariable ("opforflag" + str scenario));

{
      if ( isPlayer _x ) then {
            _x setPos _posBlue; 
      };
} forEach units west;

{
      if ( isPlayer _x ) then {
            _x setPos _posRed;
      };
} forEach units east;
copper raven
past wagon
#

ok

copper raven
#

you should save the position into some local variable before looping

past wagon
#

ok

copper raven
#

i.e private _position = getPos (missionNamespace getVariable ("opforflag" + str scenario))
i added the missing ')'

past wagon
#

why private? I still dont understand what private does

#

i added the missing ')'
oh yeah

warm hedge
past wagon
warm hedge
#

I don't see a flaw there, not tested

past wagon
#

ok

past wagon
#

can I make a for loop count backwards? for example, what if I wanted something to do a countdown?

for "_i" from 10 to 1 do {
  hint str _i;
  sleep 1;
};
warm hedge
#

step -1

past wagon
#

ok

#

thanks

past wagon
#

how can I use structured text for strings inside variables? _weaponName and _scopeName are strings

[parseText "Your Loadout: " + <t color='#ffff00'>_weaponName</t> + <t color='#ffff00'>_scopeName</t>] remoteExec ["hint", _caller, false];
#

mb i forgot to use parseText

#

still not working...

copper raven
past wagon
#

ok

past wagon
#
[parseText "Your Loadout: " + "<t color='#ffff00'>" + _weaponName + "</t>" + "<t color='#ffff00'>" + _scopeName + "</t>"] remoteExec ["hint", _caller, false];
#

is this what you mean? ^

copper raven
#

"</t>" + "<t color='#ffff00'>" just put them in a string together, no need to add like that

#

and wrap the whole thing(after parseText) into ()

#

because precedence

past wagon
#

ok

#
[parseText ( "Your Loadout: " + "<t color='#ffff00'>" + _weaponName + "</t>" + "<t color='#ffff00'>" + _scopeName + "</t>" )] remoteExec ["hint", _caller, false];
#

thanks

normal forum
#

any one know a script for inidbi2 for keep vechiles and there invtory and how to make shops

#

or a garrage systym

hasty trout
#

im having some issues with BIS_fnc_spawnCrew, it seems to populate all FFV slots too
is there a way to use something with the same functionality as BIS_fnc_spawnCrew but only fill crew slots that are not ffv?
so turrets+copilot only

copper raven
#

createVehicleCrew?

hasty trout
#

thanks that worked fine

hasty trout
#

Im porting a mission (with permission) to another map + fixing some issues with it. I've solved most problems I wanted to fix but theres one I cant really figure out. This script is run to pick a landingzone from an array list (lzList). It currently checks if it is within allowed distance from another active task (the LZMinDistance part) but I would like it to also check the distance from the player to make it only select a lz within a max allowed distance from player position. Anyone happen to have an idea of how to go about it?

//diag_log format["selectLZ called, _this: %1", _this];
private _excludeList = _this select 0;
private _returnValue = false;

private _candidates = lzList;
if (!(_excludeList isEqualTo false)) then
{
   _candidates = _candidates - _excludeList;
};
private _taskLocations = [];
{
    [_taskLocations, ([_x] call BIS_fnc_taskDestination)] call BIS_fnc_arrayPush;
} forEach ([west] call getSideActiveTasks);

scopeName "main";
private _i = 0;
while {true} do
{
    scopeName "selectloop";
    private _usable = true;
    private _candidate = _candidates call BIS_fnc_SelectRandom;
    {
        scopeName "checkloop";
        private _dist = _candidate distance _x;
        if (_dist < LZMinDistace) then
        {
            _usable = false;
            breakOut "checkloop";
        };
    } forEach _taskLocations;
    if (_usable) then
    {
        _returnValue = _candidate;
        breakOut "selectloop";
    };
    _i = _i + 1;
    if (_i > LZCOUNT) then
    {
        _returnValue = false;
        breakOut "selectloop";
    }
};

//diag_log format["selectLZ returning: %1", _returnValue];
_returnValue
cold pebble
#

Some err, interesting code there. You'll need to loop through all players (playableUnits) and check if that is within your desired distance, similar to your check on _taskLocations

copper raven
# hasty trout Im porting a mission (with permission) to another map + fixing some issues with ...
params [["_excludeList", []]];

private _candidates = lzList;

if (_excludeList isEqualType []) then { _candidates = _candidates - _excludeList; };

private _taskLocations = [west] call getSideActiveTasks apply { [_x] call BIS_fnc_taskDestination };

for "_i" from 0 to LZCOUNT do {
    private _candidate = selectRandom _candidates;
    if (_taskLocations findIf { _x distance _candidate < LZMinDistance } == -1 && { allPlayers findIf { _x distance _candidate < /* ... */ } == -1 }) exitWith { +_candidate };
    false
}

should add tags for your global variables though

willow hound
#

_candidates is no (deep) copy of lzList ๐Ÿ™ƒ

little raptor
copper raven
#

sure, fixed, only matters if they modify the result outside somewhere

little raptor
#

But it's not that either notlikemeow

willow hound
#

The problem is that this is pointless because you are still modifying the original lzList array:

private _candidates = lzList;

if (_excludeList isEqualType []) then {
  _candidates = _candidates - _excludeList;
};
copper raven
#

what?

#

- doesn't modify anything here

#

and there is no need for copies here, ONLY when returning exitWith { +_candidate }; here, incase the user modifies this (position? idk what it is) outside this function(i.e set), THEN it would modify lzlist (if done without the unary +)

willow hound
hasty trout
#
Error in expression <te > LZMaxDistace } == -1 }) exitWith { +_candidate };
false
}>
13:25:04   Error position: <+_candidate };
false
}>
13:25:04   Error +: Type Object, expected Number,Array,Not a Number,HashMap
copper raven
#

ah so you have objects, then omit the +

hasty trout
#

that worked perfectly

#

thanks sharp!

cosmic lichen
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
hasty trout
#

thanks revo

winter rose
#

!purgeban @willow sequoia 0 scam link

lyric schoonerBOT
spark turret
#

Pew pew

shadow knoll
#

i have named multiple things base and no matter what i cant get the action to pop up when im in vicinity of whatever i have labeled player addaction ["Virtual Arsenal", { ["Open",true] call BIS_fnc_arsenal; }, [], 1, false, true, "","(getpos player distance getpos base) < 350 "];

cosmic lichen
#
([base1, base2, base] findIf {player distance _x < 350}) > -1
shadow knoll
#

still doesnt work

spark turret
#

then you re doing something wrong

#

make sure the base objects actually exist

#

can also put this into your watch fields in admin console:

[base1, base2, base] apply {player distance _x}
#

it tells you have far you are from each base.

shadow knoll
#

i put down a physical object

#

i put a flag pole down

hallow mortar
#

(getpos player distance getpos base)
fyi here you can just use player distance base as distance accepts objects as inputs

shadow knoll
#

thanks i will give it a try

hallow mortar
#

I notice your "show window" addAction parameter is set to false. This means that the action will not automatically display in the centre of your screen when it's available; you must open the action menu in order to see it. Double-check whether it appears when you open the action menu.

#

Also, make sure that your objects are named correctly. This is done by double-clicking on the object in the editor and typing a name in the Variable Name field. If you put the name anywhere else (e.g. in the init field or the role description field) it won't work.

#

Now the question I came to ask: is there any way to control the burst length of scripted fire commands for non-artillery units? _ArtilleryFire commands have a burst length parameter, but none of the non-artillery ones do. I'm hoping to script a CIWS firing for atmospheric purposes, and getting the proper long brrrts is important.

spark turret
#

you could force fire on a loop for absolute control

#

did that in the past with scripted MG nests

drifting portal
#

I have done disableAI "all"; to bots, but when for example a grenade explodes near them they go prone for a second and then return back to their normal posture, is there a way to stop this "panic" behaviour ?

hallow mortar
hallow mortar
past wagon
#

say I have an action that only the server host can use. (it is added on initServer.sqf). It runs a script that takes some time, and I don't want the script to be ran more than once at a time. So, at the beginning of the script I remove the action from the object, and at the end of the script I add the action back. Will the action still be visible only to the server host?

winter rose
#

if you execute the script only there, then yes

past wagon
#

ok, thanks

novel delta
#

I use this in a init field in an object as a teleporter

this addAction ["Teleport to Paradise", {player setPos (getPos IUNSParadise)}]

Does anyone have ideas on how to make this team specific, only blufor players can access it?

willow hound
novel delta
#

Thanks

errant harbor
#

is there anyone who can help me make a trigger that activates on a units death? I'm trying to have it where the trigger that activates disables simulation and the unit that dies stays in the animation where he is sitting in a chair

willow hound
#

Singleplayer or multiplayer?

errant harbor
#

multiplayer

#

there is not currently a dead in a chair animation or anything as far as im aware

#

hell i don't even know if stop simulation will keep him sitting in the chair

past wagon
#

what does this mean?

||
little raptor
past wagon
#

ok

#

thanks

little raptor
#

np

willow hound
errant harbor
#

ok thanks for the help Ansin11

willow hound
#

Just be cautious with the Killed EH in multiplayer, it needs to be added on the machine where the unit is local.

drifting girder
#

hey! sorry to bother yall, but is there a way to use the arma 3 support modules while also having acre on a server? with acre, the radio slot/radio itself is removed from the player preventing them from using the support functions. is there a workaround for this?

willow hound
#

@drifting girder One could certainly create a workaround, but it's probably rather complicated.
Either a mod copying the vanilla support modules and the functions behind them, just minus the player-needs-radio-item restriction or a mod patching ACRE to readd the vanilla radio slot, but I don't know if this in turn could break ACRE.

dreamy kestrel
#

Here's a fun trivia SQF function; not meant for serious digestion, just fun trivia. Assuming you have a HASHMAP setup and know its keys. What in your opinion does this do?

// Assume we know _keys belonging to _bundleMap
// Assume also that _bundleMap is a HASHMAP
// Finally, assume also that all keys are known to be underscore ('_') prefixed
(_keys apply { _bundleMap get _x; }) params _keys;
little raptor
shadow knoll
#

i figured out that this code player addaction ["<t size='1.4' shadow='2' color='#FF8C00'>Virtual Arsenal</t>", { ["Open",true] call BIS_fnc_arsenal; }, [], 1, true, true, "","([base] findIf {player distance _x < 350}) > -1"]; will work in single player but it wont in multiplayer... whats the workaround for that?

#

nevermind sorry

#

it looks like if you have the respawn menu template, it will interfere with scripts

sleek nebula
#

Is this a good channel to ask about a scripting question or should I ask in a different channel? The number of channels on this server is a little overwhelming

quick sigil
#

Is it possible to create another slot for clothing? (e.g. glasses, hats, nvgs slots) I want to make all my custom clothing barefoot and then have shoes as a different object.

sleek nebula
# little raptor Yes

Good to know. Thanks! I had a scripting question, but of course it was just a small typo...

void arrow
dusky pier
#

Hi, is possible to get maximum load or uniform/vest/backpack without adding them to player?
to show how much of items it can space inside

dusky pier
#

ah, figured out with that ๐Ÿ™‚

dusky pier
#

stacked on the same problem with vests and backpacks

#
getNumber(configFile / "CfgWeapons" / vest player / "ItemInfo"  / "MaximumLoad");
//returns 0
void arrow
dusky pier
void arrow
#

once sec

dusky pier
#

for uniform worked this one:

_container = getText(configFile / "CfgWeapons" / uniform player / "ItemInfo" / "containerClass");
_load = getNumber(configFile / "CfgVehicles" / _container  / "MaximumLoad");
void arrow
#

oneliner

getNumber (configFile >> "CfgVehicles" >> (getText (configfile >> "CfgWeapons" >> "V_PlateCarrierGL_rgr" >> "ItemInfo" >> "containerClass")) >> "maximumLoad")
#

same for uniform

dusky pier
#

@void arrow that worked, thank you a lot!
i just was searching for same settings in examples (Arma 3 Samples) and just didn't find that

Thank you again! ๐Ÿ™‚

void arrow
#

yw

void arrow
dusky pier
void arrow
#

haha I recall back in 2013 or 2014 we spawned a unit on map, giving him same gear as for player to test if item fits inventory

#

in 2013

#

vestContainer appeared autumn 2013

dusky pier
proven charm
#

anyone know if it's possible to change zeus group icons?

tough abyss
#

Quick question: does the addVest command keep the old vest's inventory or do I have to copy it over and paste it?

still forum
pearl gyro
#

Anyone know how to make a camera to follow a missile or bomb

pearl gyro
#

Thanks

blissful flower
#

Hi guys. Is it possible to create Shape Marker in Eden Editor via script in debug console?
I can create simple marker with something like create3DENEntity ["Marker", "mil_dot", [100,100,0]]; But I do not see the way to make a shape.
Thanks.

warm hedge
#

I don't think that does for Eden Editor. set3DENAttribute instead?

winter rose
#

oh mb meowfacepalm I completely went through

blissful flower
blissful flower
warm hedge
#

What are you trying to do now?

blissful flower
#
_m = create3DENEntity ["Marker", "mil_dot", [3350,4500,0]];
_m set3DENAttribute ["baseColor", "colorGreen"];
_m set3DENAttribute ["markerType", "RECTANGLE"];
#

It's always looks like mil_dot

warm hedge
#

Try "Rectangle" instead, maybe it is a case-sensitive

blissful flower
#

The same.

warm hedge
#

Try to check the value used with get3DENAttribute for a rectangle marker you made via GUI

blissful flower
#

get3DENAttribute gives me [0] for Rectangle and [1] for Ellipse. But setting these values via set3DENAttribute does nothing.

#

I have a guess that another value instead of "mil_dot" have to be used. But not sure.

warm hedge
#

Do [1] or "1" work? If not... maybe a bug

blissful flower
#

Neither [1] nor "1" works

warm hedge
#

Lou, can you slap Dedmen right now to check it out?

blissful flower
#

I looked through the "mission.sqm" , and changed the values accordingly but with no success.

_m = create3DENEntity ["Marker", "rectangle", [3350,4500,0]];
_m set3DENAttribute ["baseColor", "colorGreen"];
_m set3DENAttribute ["markerType", "RECTANGLE"];
cosmic lichen
#

Seems bugged.

tidal ferry
#

Quick question

cosmic lichen
#

There are more things wrong with markers.

tidal ferry
#

What kind of data types are triggers?

cosmic lichen
#

object

tidal ferry
#

Okay, thanks!

cyan dust
#

Good day. Is there a way to disable all player-controlled units chat and radio messages, but keep other units voices?
I tried using in initPlayerLocal:

showSubtitles false;

Works good, but from time to time group leader unit spams 'regroup' message. Then tried:

enableRadio false;

or

enableSentences false;

Both commands seems to disable all units voices, while my goal is to hear enemy bot chatter.

cosmic lichen
#

try disableAI command on player

cyan dust
cosmic lichen
#

yes

cyan dust
#

Will try, thank you

cyan dust
#

Does not work ๐Ÿค”

#

Still group leader spams 'regroup' message

tame stream
#

Hi, anyone have the latest all-in-one-config file with Laws of War config files added...looking for the parade uniform configs

cold pebble
alpine iris
#

Hi, I'm hoping someone might be able to help me with a script for a SOG OH-6 Cayuse mission or let me know if it's even possible. I'm wanting a Cobra to follow me around in my OH-6 and when I drop smoke from the chopper, the Cobra fires a pair of rockets on the smokes position once it's lined up a shot, and then joins back in formation with my OH-6 until I drop another smoke to do another rocket run, would this be possible to do?

copper raven
#

possible, but you need to script it

alpine iris
#

thanks ๐Ÿ™‚ I figured that was the case. Unfortunately I have no experience with scripting so i'm hoping someone might be able to help me out with it

unreal scroll
#

Is there a way to leave the parachute in air?

little raptor
winter rose
#

I think it works yeah ๐Ÿ˜„

unreal scroll
#

Ah, thanks ๐Ÿ™‚

proven charm
#

can you select groups via script when using zeus?

dreamy kestrel
#

here's how I found it useful:

params [
    [Q(_sector), locationNull, [locationNull]]
];
private _active = _sector in MVAR(_allActive);
private _captured = _sector getVariable [Q(KPLIB_captured), false];
private _bluforOnActivation = [_sector getVariable [QMVAR(_sideOnActivation), KPLIB_preset_sideE]] call {
    (_this#0) == KPLIB_preset_sideF;
};
if (!_active || _captured) exitWith { false; };
[
    _sector getVariable [QMVAR(_capUnitsE), []]
    , _sector getVariable [QMVAR(_capUnitsF), []]
    , _sector getVariable [QMVAR(_capTanksE), []]
    , _sector getVariable [QMVAR(_capTanksF), []]
] params [
    Q(_capUnitsE)
    , Q(_capUnitsF)
    , Q(_capTanksE)
    , Q(_capTanksF)
];
private _unitDivisor = count (_capUnitsF + _capUnitsE);
private _tankDivisor = count (_capTanksF + _capTanksE);
// ...
#
private _bundleKeys = [
    Q(_unitDividend)
    , Q(_tankDividend)
    , Q(_unitDividendOffset)
    , Q(_unitDivisorOffset)
    , Q(_unitRatioBias)
    , Q(_unitThreshold)
    , Q(_tankDividendOffset)
    , Q(_tankDivisorOffset)
    , Q(_tankRatioBias)
    , Q(_tankThreshold)
];

private _bundleValues = [
    [
        count _capUnitsF
        , count _capTanksF
        , MPARAM(_capUnitDividendOffsetF)
        , MPARAM(_capUnitDivisorOffsetF)
        , PCT(MPARAM(_capUnitRatioBiasF))
        , PCT(MPARAM(_capUnitThresholdF))
        , MPARAM(_capTankDividendOffsetF)
        , MPARAM(_capTankDivisorOffsetF)
        , PCT(MPARAM(_capTankRatioBiasF))
        , PCT(MPARAM(_capTankThresholdF))
    ]
    , [
        count _capUnitsE
        , count _capTanksE
        , MPARAM(_capUnitDividendOffsetE)
        , MPARAM(_capUnitDivisorOffsetE)
        , PCT(MPARAM(_capUnitRatioBiasE))
        , PCT(MPARAM(_capUnitThresholdE))
        , MPARAM(_capTankDividendOffsetE)
        , MPARAM(_capTankDivisorOffsetE)
        , PCT(MPARAM(_capTankRatioBiasE))
        , PCT(MPARAM(_capTankThresholdE))
    ]
];

private _bundleMap = _bundleKeys createHashMapFromArray (_bundleValues select _bluforOnActivation);

(_bundleKeys apply { _bundleMap get _x; }) params _bundleKeys;
#
private _evaluation = [
    [
        _sector
        , _unitDividend
        , _unitDivisor
        , _unitDividendOffset
        , _unitDivisorOffset
        , _unitRatioBias
        , _unitThreshold
    ]
    , [
        _sector
        , _tankDividend
        , _tankDivisor
        , _tankDividendOffset
        , _tankDivisorOffset
        , _tankRatioBias
        , _tankThreshold
    ]
] apply {
    _x call MFUNC(_canCaptureEval);
};

_evaluation params [
    Q(_unitEval)
    , Q(_tankEval)
];

(_unitDivisor > 0 && _unitEval)
    && (
        _tankDivisor <= 0
            || (_tankDivisor > 0 && _tankEval)
    );
#

Basically the bundle is evaluated in one of two ways, whether sector currently aligned to BLUFOR or OPFOR, with the appropriate OPFOR versus BLUFOR challenge, respectively.

still forum
#

[
_sector getVariable [QMVAR(_capUnitsE), []]
, _sector getVariable [QMVAR(_capUnitsF), []]
, _sector getVariable [QMVAR(_capTanksE), []]
, _sector getVariable [QMVAR(_capTanksF), []]
] params [
Q(_capUnitsE)
, Q(_capUnitsF)
, Q(_capTanksE)
, Q(_capTanksF)
];
wuht the hell....
Just assigning variables instead of using extra params command would be cheaper I'm sure.
Also if you directly assign, you can wrap it all into a macro instead of having the risk of typoing one of the two variables

little raptor
#

don't we have a values command now? ๐Ÿค”

#

also, I'm assuming it's in the same order as keys right?

#

yeah

dreamy kestrel
#

there is, however, considering it's a HASHMAP, not truly an ARRAY, I would not count on the order. The only thing you can know for certain is value at key.

dreamy kestrel
little raptor
velvet merlin
#

is it possible to script a display/panel with head/character preview based on p3d/head+face?

little raptor
#

(only in dev branch ^)

winter rose
little raptor
velvet merlin
#

yea kinda

#

like the idea was onHover on 2d map when you point on units

#

to personalize them

little raptor
#

at least that's the way I decided to do it in my mod meowsweats

velvet merlin
#

pip is an interesting angle. can these be shown in 2d map/custom RscMapControl tho?

#

as for displays - there was one to show/preview p3d i am pretty sure

little raptor
#

which shows the PIP

little raptor
velvet merlin
#

ty

fringe walrus
#

For custom objectives in the editor, would I need to make a script to have the custom objective be successful? When I add one in I have to hop in Zeus to mark it successful.

#

I have a video I can DM someone to explain what I'm referring to. I don't wanna self promote just looking for guidance is all

digital torrent
#

how to make the below code work on dedicated server? Currently working on MP but wish for DS.

Tried scratching my head a few day and still not sure.....

{deleteVehicle _x} forEach nearestObjects [getMarkerPos "screamer_1", ["Land_Statue_02_F","B_Soldier_VR_F","Sign_Sphere25cm_F"], 200];
digital torrent
#

it does nothing on dedicated

#

but it work on multiplayer

#

how to make it work on dedicated server

little raptor
digital torrent
#

no by sqf

#

here is the full cycle

little raptor
digital torrent
#

what do you mean where?

#

basically editor to sqf#1 then to sqf #2

#
_part = _this select 0 select 0;
_dmg = _this select 1;

if(_part == "head")then
    {
        screamerhp_dmg = screamerhp_dmg + _dmg + 20 ;
    }
    else
    {
        screamerhp_dmg = screamerhp_dmg + _dmg;
    };

if(screamerhp_dmg > random [1,2,3])then  //Max HP = 2000 or 6 RPG-7 hit
{
//_entitate allowDamage true;
//_entitate setDamage 1;
//_screamer_anomally setdamage 1;
//deletevehicle (_this select 0);
//deletevehicle _part;
//deletevehicle _screamer_anomally;
//deletevehicle _entitate;
//deletevehicle _grp;

{deleteVehicle _x} forEach nearestObjects [getMarkerPos "screamer_1", ["Land_Statue_02_F","B_Soldier_VR_F","Sign_Sphere25cm_F"], 200];
//["{deleteVehicle _x} forEach","[getMarkerPos 'screamer_1', ['Land_Statue_02_F','B_Soldier_VR_F','Sign_Sphere25cm_F'], 200]"] remoteExec ["nearestObjects"];


//playsound "earthquakes";
//playsound "miscare_screamer";
"scream" remoteExec ["playsound"];
//_emit = _this say3D ["scream", 200];

"Screamer dead" remoteExec ["hint"]; "Screamer dead" remoteExec ["systemchat"];
};
little raptor
#

you can execute that code on any client

digital torrent
#

yea ik, i tried making ti remote exec but bc of the for each and nearest. idk how to include in the remote exec

#

i am used to small simple remote exec

#

not sure how i can remote exect he above

#

tried that but it didnt make sense

["{deleteVehicle _x} forEach","[getMarkerPos 'screamer_1', ['Land_Statue_02_F','B_Soldier_VR_F','Sign_Sphere25cm_F'], 200]"] remoteExec ["nearestObjects"];
little raptor
#

if it's a function, remote exec the function

#

otherwise, use execVM

digital torrent
#

the function on the above would be delete vehicle and nearest object right?

little raptor
#

no

#

since this is a sqf file, for testing you can just use execVM for now

winter rose
#

justโ€ฆ why would you remoteExec deleteVehicle, which is global effect?

digital torrent
#

i am not sure that why. cuz i know on debug deletevehicle is global

little raptor
#

actually I wanted to ask what nearestObject returns

winter rose
#

๐Ÿ’ฅ ๐Ÿ”จ๐Ÿ‘€

#

๐Ÿ˜„

digital torrent
#

just wanted to select any object that place within X meters to delete

little raptor
digital torrent
#

yes why?

#

i mean it work on mp

#

not sure on dedicated now that i think about it

little raptor
#

you still didn't say where you execute that

#

or just say how meowsweats

digital torrent
#

lmao i think i am dumb

#

where u exec -> in a global sqf?

#

how-> editor trigger to sqf to another sqf

little raptor
#

like what command do you use, etc.

digital torrent
#

oh mb

little raptor
#

for example, init.sqf, executed by action, execVM, etc.

winter rose
#

trigger

#

he said ๐Ÿ˜„

digital torrent
#

_entitate addEventHandler ["HitPart", {[[_this select 0 select 5, _this select 0 select 6 select 0] execVM "AL_Screamer\screamer_hp.sqf"];}];

#

so execvm

little raptor
#

does it execute at all?

digital torrent
#

the locality is private

#

yes it execute on dedicated

little raptor
digital torrent
#

what hint?

little raptor
#

"Screamer dead"

digital torrent
#

i didnt put the hit

#

oh yea

#

i see it

#

the hint and system chat works

#

only the delete part dont work

#

the custome eventhandler for hp also work

little raptor
#

see what it gives you

digital torrent
#

ok

#

give me a sec

#

ok nvm

#

seems the hint is not showning

little raptor
#

well I told you it never executes meowsweats

#

or at least I thought I did! ๐Ÿคฃ

#

@digital torrent

While you can add "HitPart" handler to a remote unit, the respective addEventHandler command must be executed on the shooter's PC and will only fire on shooter's PC as well. The event will not fire if the shooter is not local, even if the target itself is local.

digital torrent
#

lmao

#

but it work before haha

#

let me think what i changed

#

ok well that fun

#

guess i need to find another hp script then

#

or how can i solve this lol

#

i dont see any note on hit, does it mean hit can be my solution?

little raptor
#

hit doesn't have a selection

digital torrent
#

does handle damage use the damage value?

#

bc i am using it on a statue

#

which, well dont take any damage at all

little raptor
#

anyway, I guess the other solution is adding the event handler to every PC

digital torrent
#

if it hit kind of head, +20 damage

#

well true, there is no "head" on a status

#

that was dumb

#

i copied that script from internet tbh

little raptor
#

@digital torrent try this:

 [_entitate, ["HitPart", {[[_this select 0 select 5, _this select 0 select 6 select 0] execVM "AL_Screamer\screamer_hp.sqf"];}]] remoteExec ["addEventHandler"];

note that you should NOT use execVM, but for testing you can do it

digital torrent
#

lol ok

#

let me test

#

it works

#

hint and message only

#

with some weird chat

#

remote,1fc92f6b580# 620179: statue_02_f.p3d remote

little raptor
digital torrent
#

is the reason bc of this maybe?

str (nearestObjects [getMarkerPos "screamer_1", ["Land_Statue_02_F","B_Soldier_VR_F","Sign_Sphere25cm_F"], 200]) remoteExec ["systemchat"];
#

yea

#

from system chat

little raptor
digital torrent
#

the delete didnt work so i assumed it is bc of the above

#

ikr

little raptor
digital torrent
#

oh lol

#

but it didnt delete lmao

little raptor
#

what about this?

[_entitate, ["HitPart", {
[[_this select 0 select 5, _this select 0 select 6 select 0], "AL_Screamer\screamer_hp.sqf"] remoteExec ["execVM", 2];}]] remoteExec ["addEventHandler"];
digital torrent
#

btu why u dont suggest remote exec event handler?

#

ok let me try

little raptor
#

just want to check

#

also copy it again

#

I just fixed an error

digital torrent
#

ok

#

same thing

#

remote,1fc92f6b580# 620179: statue_02_f.p3d remote
for each object that i listed for the nearest each

#

deletevehicle didnt happen or work but hint and system chat work

#

otherwise, is there a better method to add a hp system within the same script maybe

#

without creating a new sqf, maybe it will solve the problem

little raptor
digital torrent
#

mm ok

little raptor
#

I didn't really read that script meowsweats

digital torrent
#

bc currently idk if the above hp sysem script is correct

little raptor
#

idk what it does

digital torrent
#

it is really short tbh

#

if hit head = damage+ 20

#

otherwise damage

#

and u define the max damage before your desired script is executed

#

which in my case is delete vehicle

little raptor
digital torrent
#

yea, but i was thinking if there was a method to avoid the setvariable given i dont really get it.

#

like u set the variable in the init then u use them in sqf?

little raptor
digital torrent
#

yes agree

little raptor
#

(unless it's just a predetermined number of objects, which you need a global var for each, which is dumb)

digital torrent
#

agree

little raptor
digital torrent
#

in that case i already did it wrongly as a public variable i guess

#
screamerhp_dmg = 0;
publicVariable "screamerhp_dmg";
#

that was in the init

digital torrent
#

ok so assuming that i change it,
by taking out from the init
and adding the setvariable withtin the same SQF file, will it solve the problem?

little raptor
#

no meowsweats

digital torrent
#

wut

little raptor
#

that was a different problem

little raptor
digital torrent
#

so i have 2 problem?
1- variable (public/ setvariable -> local?)
2- the execution of the script

little raptor
digital torrent
#

init:

screamerhp_dmg = 0;
publicVariable "screamerhp_dmg";

Editor

null=["screamer_1"] execvm "AL_screamer\screamer.sqf"

SQF Screamer

[_entitate, ["HitPart", {
[[_this select 0 select 5, _this select 0 select 6 select 0], "AL_Screamer\screamer_hp.sqf"] remoteExec ["execVM", 2];}]] remoteExec ["addEventHandler"];

screamer_hp

_part = _this select 0 select 0;
_dmg = _this select 1;

if(_part == "head")then
    {
        screamerhp_dmg = screamerhp_dmg + _dmg + 20 ;
    }
    else
    {
        screamerhp_dmg = screamerhp_dmg + _dmg;
    };

if(screamerhp_dmg > random [1,2,3])then  //Max HP = 2000 or 6 RPG-7 hit
{
//_entitate allowDamage true;
//_entitate setDamage 1;
//_screamer_anomally setdamage 1;
//deletevehicle (_this select 0);
//deletevehicle _part;
//deletevehicle _screamer_anomally;
//deletevehicle _entitate;
//deletevehicle _grp;

//{deleteVehicle _x} forEach nearestObjects [getMarkerPos "screamer_1", ["Land_Statue_02_F","B_Soldier_VR_F","Sign_Sphere25cm_F"], 200];
//["{deleteVehicle _x} forEach","[getMarkerPos 'screamer_1', ['Land_Statue_02_F','B_Soldier_VR_F','Sign_Sphere25cm_F'], 200]"] remoteExec ["nearestObjects"];
str (nearestObjects [getMarkerPos "screamer_1", ["Land_Statue_02_F","B_Soldier_VR_F","Sign_Sphere25cm_F"], 200]) remoteExec ["systemchat"];

//playsound "earthquakes";
//playsound "miscare_screamer";
"scream" remoteExec ["playsound"];
//_emit = _this say3D ["scream", 200];

"Screamer dead" remoteExec ["hint"]; "Screamer dead" remoteExec ["systemchat"];
};
digital torrent
#

omg

#

so that why

#

we were getting the weird chat system

little raptor
#

๐Ÿ˜

digital torrent
#

i copied past your str code haha

#

so i assumed u added it

#

facepalm

#

kill me

little raptor
digital torrent
#

? i didnt remove it

little raptor
#

I said paste that code there to see what it gives you

digital torrent
#

oh

#

kill me

#

sooo mmm

#

i guess it should work after i put it

little raptor
#

๐Ÿ˜ถ

digital torrent
#

let me try it

little raptor
digital torrent
#

ok will do

#

within the sqf sqf is fine right?

little raptor
#

huh?

digital torrent
#

i mean the setvariable can be written within the sqf right?

#

no need to put it in init

#

the screamer_hp.sqf

little raptor
digital torrent
#

oh perf

little raptor
#

@digital torrent also where is the object? you don't need nearestObjects. just use the object itself

digital torrent
#

i am spawning multiple of thos object aka boss area

#

so i only want it to delete the one within the marker

little raptor
digital torrent
#

i know it is dumb given i need to create the same thing for each boss area but that my current skill for now

digital torrent
#

the screamer_1?

#

that the marker name

little raptor
#

_target is what you added the event handler to

#

as for the rest of objects, you can use setVariable again to save them:

_someObj setVariable ["other_objs", [obj1, obj2], true];
digital torrent
#

yea it would be a solution

#

making my head go crazy but yea it will work

little raptor
digital torrent
#

yea true

#

ima crying now

#

rip

#

thanks for the help. i will add thos setvariable

jade imp
#

I've got a weird issue here, mission modules and the init scripts are not being applied to remote players when joining. Using the Prairie fire DLC, the exact same script works fine outside of the DLC.

manic sigil
#

I see to have made a lag machine, and I'd rather it didn't. Near as I can tell, the code in question is somewhere around this;

waitUntil {sleep 1; Dragonfly distance NatoGunnery <= 50 OR Dragonfly distance NatoGunnery >= 500};
#

The mission runs smoothly up until there, when it hits one-second lag spikes.

#

Okay, I block comment out the section I thought was the problem, but now it's causing a general slowdown and every terrain object to flicker in and out of existence? o.0

warm hedge
#

What exactly is the full script?

manic sigil
#

It's happening in the editor now, outside the mission

#

It's nearly 300 lines of code, can't really share practically :/

warm hedge
#

pastebin or sqfbin

manic sigil
#

A lot of it is dialogue, as well.

It's occuring in this chunk, though;

sleep 34;
["Investigate","SUCCEEDED"] call BIS_fnc_taskSetState;
sleep 20;

[East, ["Investigate2","InterruptCore"], ["NATO's training is disruptive, but it's their own region. CSAT getting involved may set some of the locals at ease, but will harm relations. Leave the region.", "Leave", "cookiemarker"], Objnull,1,1,true,"",false] call BIS_fnc_taskCreate;
[East, ["Investigate3","InterruptCore"], ["NATO is causing a disruption, and CSAT needs to explore any opportunity to show them up. Fly close to the fireline, that will break them up.", "Stay", "cookiemarker"], Objnull,1,1,true,"",false] call BIS_fnc_taskCreate;

waitUntil {sleep 1; Dragonfly distance NatoGunnery <= 50 OR Dragonfly distance NatoGunnery >= 500};
warm hedge
#

Are you sure about it?

manic sigil
#

The prior sleeps are following a camp_playSubtitles section, but right as those two objectives are starting to load, it craps out.

#

reasonably sure.

warm hedge
#

Uhh. Did you changed waitUntil part to something else? Like, just true?

manic sigil
#

For full

warm hedge
#

if (skipTask == true) exitWith {
What the

little raptor
#

@manic sigil are you sure dragonfly and natogunnery are defined?

manic sigil
#

Yeah, they are.

warm hedge
#

Did you enabled -showScriptErrors?

manic sigil
#

And that's me playing with a debugging script attempt, just setting skipTask = true will advance the mission to the end of the current phase, moving the player and vehicle to the proper positions, etc ๐Ÿ˜›

#

I have not ๐Ÿ˜ฎ

warm hedge
#

Ah wait

#

Since 2.00 it's legit to compare boolean with == ๐Ÿ˜›

little raptor
#

Ye but still notlikemeow

manic sigil
#

Is there a better way? o_o

little raptor
manic sigil
#

well okay if you just say it out loud it makes sense but :C

warm hedge
#

Yeah, I thought it just throw out an error so it's impossible to spot it out. I was wrong

manic sigil
#

Nah, that works fine, so long as I can easily define what the end state is - where the player should be, what should have happened in the course of the task, etc

little raptor
#

@manic sigil anyway, if you say it lags around the waitUntil that means one of two things:

  1. Undefined variables
  2. You're running the code in unscheduled environment
#

My bet is on the second

warm hedge
#

Yeah could be. How did you run this script?

manic sigil
#

Okay, time for me to sound crazy.

#

I have initServer.sqf setting up world events (weather, time, faction alliances if not default), calling variables (task1done = false) just to get it out of the way, then finally ExecVM "Staging.sqf";

warm hedge
#

execVM sounds fine?

manic sigil
#

Staging.sqf is the sequencer of the tasks, in the vein of 'wait until task1done, execvm task2

#

Specifically, in this instance; execVM "Scripts\Tasks\T6.sqf"

#

As I understand it, that should be a scheduled environment.

hollow ibex
#

so if im using remoteExec to do setVehicleInit i would only need this to execute on server?
Im adding a respawn.sqf to init field of a created vehicle that was spawned with script

little raptor
#

@manic sigil your issue is probably an rpt spam because of some error. open the rpt file and check for error spams

warm hedge
#

setVehicleInit is really a nonsense in Arma 3. Why would you need to use?

hollow ibex
#

to add the respawn script into the init after using createvehicle

little raptor
hollow ibex
#

the script uses the init field for the respawn to set the abandoned time and destroyed time till respawn

manic sigil
#

@little raptor Crap, you're onto something.

#

22:52:24 Suspending not allowed in this context
22:52:24 Error in expression <waitUntil {sleep 1; Dragonfly distance NatoGunnery >
22:52:24 Error position: <sleep 1; Dragonfly distance NatoGunnery >
22:52:24 Error Generic error in expression

manic sigil
#

That repeats about a hundred times

little raptor
#

You're executing the code in unscheduled environment

manic sigil
#

It does switch over to

22:52:27 Error Generic error in expression
22:52:30 Error in expression <OR Dragonfly distance NatoGunnery >= 500};>
22:52:30 Error position: <};>
22:52:30 Error Missing ;

#

Which is weird, because that's the same environment i've run everything else in? o.0

little raptor
manic sigil
#

I mean, T6.sqf begins with a waitUntil.

little raptor
warm hedge
#

Frequent error log output kills the performance really efficiently. That would be the issue

hollow ibex
#

k ill look at a alternate option for respawns unless i can get this one to not use the init field

manic sigil
#

Okay... executing the taskcreators and waitUntil in a test.sqf file, same way, doesn't throw an error.

little raptor
manic sigil
#

But why would it matter for one waitUntil, and not the other?

#

In the same file, I mean.

little raptor
manic sigil
#

If they're both in the same .sqf, aren't they executed the same?

manic sigil
#

Okay, the pastebin above is the entirety of T6.sqf

#

It begins with a waitUntil, waiting for the player to approach a location.

#

That works fine, no problems.

#

Then another waitUntil for the player to get close to another position. No issue.

#

Two, actually.

#

THEN the final waitUntil, which just cycles until the player is either too close or far enough away from a position, and that's the one that hangs.

#

Executed T6.sqf via the debug console, same as my test.sqf... same hangup.

#

Same with my backup plan, putting that whole section into a separate .sqf to call on.

#

I've narrowed it down to just that specific waitUntil, something about it just throws a fit.

fervent kettle
#

Quick question, could I use stuff like onPlayerRespawn.sqf in a workshop mod?

next kayak
#

So, I'm trying to make a bunch of VBIEDs rush a position but don't know how to activate them separately. Current I stick a basic trigger on the place I want them to explode on, call each car "car1", "car2", "car3" (etc) and then put the trigger on activation (and set to repeatable) : bomb="BO_GBU12_LGB" createVehicle getPos car1, car2, car3;

#

but only the first car explodes

warm hedge
#

That's no how to use getPos

next kayak
#

that was just what I copypasted from a forum thread, works fine for car1

warm hedge
#

That's no how to use getPos after all

#
{
  "BO_GBU12_LGB" createVehicle getPos _x;
} forEach [car1,car2,car3];```
next kayak
#

hmm, if any of the cars drives over the trigger, the other one explodes as well, even if it's not near the trigger

warm hedge
#

Oh yeah, I didn't read your goal carefully

#

If you want to do it in one trigger, maybesqf { "BO_GBU12_LGB" createVehicle getPos _x; } forEach ([car1,car2,car3] select {_x in thisList});IDK

next kayak
#

now none of them blow up notlikemeowcry

warm hedge
#
{
  "BO_GBU12_LGB" createVehicle getPos _x;
} forEach ([car1,car2,car3] select {_x inArea thisTrigger});```
next kayak
#

perfect!

#

that seems to have got it all in order

real tartan
#

I am using respawn template "Tickets". I setup that every player have 3 respawn tickets locally to player. When player kills enemy AI, mission is adding additional respawn ticket to side of player for some reason. How to prevent adding respawn tickets to side when enemy is killed?

proven charm
#

hey couple of zeus questions if anyone knows... can you select groups via script command? can you change the group icon?

tough abyss
#

Got a problem, maybe i did not understand how to use the remoteExec right. I use the simple bomb defusing script (https://forums.bohemia.net/forums/topic/196588-release-simple-bomb-defuse-script/) it works, when i use the init line from him. But as i use like 100 bombs ( protecting vehicles with this bomb, you have to defuse to use the vehicle) there is a performance problem - i guess while using to many while loops.

I did decide to use a function which only adds an addAction which then will add the bomb. In SP/MP it works, but not on dedicated. Did try many things, but no luck. Maybe someone has time to explain me, what im doing wrong?

I'll post now the code of the files

#

-> This is the script (rebru_fnc_protectVehicleWithBomb), which is in the init line of each vehicle ( the commented line was a try to get it working, but no luck on dedicated, on sp/mp it works)
Initline

init="call{null  = [this, 30, false, false] spawn rebru_fnc_protectVehicleWithBomb;}";
#
params ["_source","_timer","_kit","_debug"];

//if(!isServer) exitWith {};

_source setVehicleLock "LOCKED";
_source addAction ["Fahrzeug knacken", rebru_fnc_addBombToVehicle, [_source, _timer, _kit, _debug], 1, true, false, "", "", 10];

//[_source, ["Fahrzeug knacken", rebru_fnc_addBombToVehicle, [_source, _timer, _kit, _debug], 1, true, false, "", "", 10]] remoteExec ["addAction", _source, true];    
#

-> This is the script, which then should add the bomb (rebru_fnc_addBombToVehicle)

#
params ["_protectedVehicle", "_caller", "_actionId", "_arguments"];
_arguments params ["_source", "_timer", "_kit", "_debug"];

// Ursprungs Action lรถschen
_protectedVehicle removeAction _actionId;

// Fahrzeug mit Bombe ausstatten
{ null = _arguments execVM "Scripts\bomb\bomb.sqf"; } remoteExec ["call",0]; // Not working
//call { null = _arguments execVM "Scripts\bomb\bomb.sqf"; }; //Not Working

// Fahrzeug abschliessen, solange die Bombe noch aktiv ist
while { _protectedVehicle getVariable ["a3f_bomb_active", true] } do
{
    sleep 1;
};
// Fahrzeug aufschliessen, wenn Bombe entschรคrft
_protectedVehicle setVehicleLock "UNLOCKED";
removeAllActions _protectedVehicle;
#

and as i said, in SP/MP this works, but not on a dedicated server - on dedicated Server it works until the line, where i want to execVM the bomb.sqf

tender fossil
#

Started scripting a gamemode recently... I'm so happy when we get rid of this shiet called SQF ๐Ÿ˜„

hallow mortar
spark turret
warm hedge
#

No risk if you don't care about the logs. This might be true in some context, but mostly doesn't help well

hallow mortar
tough abyss
tough abyss
hasty trout
tough abyss
#

No, its the direction of the TriggerArea

hasty trout
#

ah

#

if not set to true for isRectangle does it act as a sphere?

tough abyss
#

yes, and therefore it is not necessary because a sphere is on every direction the same

hasty trout
#

yeah thats why i asked q:

#

trying to figure out why my gamelogic flags end up on ground level even when i place it further up in the eden editor

hallow mortar
hasty trout
hallow mortar
#

It's possible game logics might be affected by gravity

tough abyss
hasty trout
tough abyss
hasty trout
#

oh angle isnt c

#

thats why i was confused about the height thing

#

i see now that c comes after the boolean

#

x)

#

does getPosATL ignore buildings and only care about the actual terrain?

#

would visiblePosition instead also take into account objects such as buildings?

hallow mortar
#

Yes, or getPosAGLS

hasty trout
hallow mortar
tough abyss
hasty trout
hallow mortar
#

Oh, hold on

#

getPosAGLS doesn't, but the commands listed on the Position page under PositionAGLS will help

hasty trout
#

could i instead look at the position relative to a gamelogic flag instead?

#

and check the vertical distance from the flag?

hallow mortar
hasty trout
#

doesnt appear to be a getPosAGLS?

tough abyss
hallow mortar
#

For example, getPos

hasty trout
#

ah so getPos seems to default to AGLS from reading that entry

#

so i can basically just use getPos with no further scripting needed then?

turbid hare
#

Yo can someone explain to me wtf scope means, currently learning to write the configs and i keep getting an error about scope in one of my classes

warm hedge
hasty trout
# winter rose _gniiiiii_

yeah ive already got the answer from someone else. i got confused because of the c part setting height and i just assumed c would follow b in the order, it was just sloppy reading by me

winter rose
#

no worries, it just "triggers" me as a wiki writer ๐Ÿ˜› no harm done ^^

warm hedge
#

Because c was added really late

manic sigil
#

Right track, wrong tree to bark up.

I think the problem was my ancillary script for making NatoGunnery shoot at an empty truck; I forgot to put a Sleep in a while-do that both gave the order to fire, and slips them a magazine. I think my script just chugged once their backpacks got full and it kept trying to pile rounds in like grandma heard they hadn't eaten since an hour ago.

stark granite
#

Howdy all. Working on a build system script at the moment for a community project, Ive finished the script to my liking and everything was working perfectly using local hosted mp server, but then when moved to dedicated most of my add actions became client specific and other scripts failed to call at all. Is there some major difference between local hosted and dedicated mp with regards to evecVM usage that I'm missing??

#

Also. Trigger being placed by script only working on the player who activated the script which calls it. Doing me a major confused

zenith ferry
#

Any clue how to remote control a turret? Using a console without a Zeus

little raptor
#

MP scripting is a whole other world

faint sage
#

Hey guys!
Any way to spawn RHS OPFOR units (mod units) in AI Spawn?

little raptor
#

I think you can do it manually

#

Check the module function

faint sage
#

In config viewer?

little raptor
#

If it actually reads the faction, you can use setVariable and give it a custom faction

little raptor
faint sage
#

Got it! Thanks bud!

little raptor
#

Np

cosmic lichen
#

I'd like to apply some basic syntax highlighting to strings similar to this
"1. Call in support elements and secure <marker name = 'BIS_mrkDorida'>Dorida.</marker><br />2. Locate the enemy's beachhead.<br />3. Destroy any hostile units encountered there."
Basically anything between < and > should be highlighted. What's the best way to do that?

#

I tried regexReplace but there seems to be no way to replace every single match with the replace string (at least I dunno how)

tough abyss
#

Hello all. I'm working on an ambitious project and joined here to seek some help along the way

cosmic lichen
#

Nevermind. My regex was screwed meowfacepalm

blissful flower
#

@warm hedge , @winter rose , So, is it a bug with Eden editor when it's not possible to create shape markers via create3DENEntity ?

cosmic lichen
#

Yes it probably is.

#

create3DENEntity expects a CfgMarkerClass but shape markers are no class.

winter rose
#

mayhaps, dunno

cosmic lichen
#

@blissful flower I'd open a ticket on the FT if I where you. Chances are good it's going to get looked at.

blissful flower
little raptor
#

wait no meowsweats

#

wait yes meowsweats

blissful flower
fervent kettle
#

theoretically, could I use an array to add multiple items with BIS_fnc_addCommMenuItem?

little raptor
#

but no

fervent kettle
#

So I would have to add a new BIS_fnc_addCommMenuItem function for every single comm Item in my description?

little raptor
fervent kettle
#

Yas

little raptor
#

like I said, they are arrays themselves

#

you can append the items you want to the menu array

#

then reopen it to see the effects

fervent kettle
little raptor
#

this is what a comms menu is:

My_Comms_Menu = 
[
    ["Menu Name",true],
    ["Item Name", [], "", -5, [["expression", "code"]], "1", "1"]
]
#

it's just an array

fervent kettle
#

Yea, so is that the one in the description? Cause mine looks kinda different

little raptor
#

if you want to add something to it:

My_Comms_Menu pushBack ["New Item Name", [], "", -5, [["expression", "code"]], "1", "1"]
little raptor
fervent kettle
#

ah okay, I have pre defined ones

zenith ferry
#

Soo Remote Control of turret? Without being Zeus

little raptor
zenith ferry
#

and turret not being UAV?

zenith ferry
#

Thanks!

little raptor
fervent kettle
#

Had a look but I don't really get it

little raptor
fervent kettle
#

[player, "cCMag"] call BIS_fnc_addCommMenuItem;

#

but I would like to add more menu items at once

little raptor
#

why not do that?

#
{
  [player, _x] call BIS_fnc_addCommMenuItem;
} forEach ["cCmag", "bla", "blabla"];
#

@fervent kettle you can also do it this way:
#arma3_scripting message

_menu = player getvariable ["BIS_fnc_addCommMenuItem_menu",[]];
_menu append [
["New Item Name 1", [], "", -5, [["expression", "code"]], "1", "1"],
["New Item Name 2", [], "", -5, [["expression", "code"]], "1", "1"],
["New Item Name 3", [], "", -5, [["expression", "code"]], "1", "1"]
];
#

(without predefined items, so that you can have dynamic menus)

fervent kettle
little raptor
#

show me the code

fervent kettle
#

wait, typo

true frigate
#

Hey does someone mind going over something simple with me that i really need to actually learn because its probably useful as fuck

#

I know roughly what it is, but i dont know how to write it

#

If i have a group of units with the group variable name 'groupA' (for an example)
Is there a way i can affect all units within that group by using forEach or something else?
For example

forEach unit in groupA;
  disableAI "PATH";

this is probably written wrong and most likely wont work, but hopefully someone gets the idea of what im trying to do ๐Ÿ˜„

true frigate
#

Is that all that needs changing?

little raptor
#

no meowsweats

true frigate
#

I was gonna say lol

little raptor
true frigate
#

So i also wrote it backwards ๐Ÿ˜„

little raptor
true frigate
#

Im assuming _x just means any unit within the group

true frigate
#

Ah, well thanks a lot anyway ๐Ÿ™‚

spark turret
winter rose
spark turret
#

yes

#

why not?

winter rose
#

no ๐Ÿ‘€

spark turret
#

but apply more elegant (bc its edgy)

winter rose
#

and forEach is more human-readable anyway

spark turret
#

human readable is the opposite of elegance, is what my college prof told me

winter rose
#

code is meant to be read by hoomans
always code as if the future guy maintaining your code has the keys to your placeโ€ฆ and a gun

#

don't get me wrong, I love the audacity and beauty of one liners ^^ but I keep them for custom projects, nothing that would be released
(and I love refactoring, too)

faint sage
#

Hey, does anyone know how to stop AI from re-spawning at spawn point? They seem to be spawning non-stop! I want them to stop spawning at a trigger.

tough abyss
#

Wouldn't it be better to spawn on a trigger? So the spawn happens when you want.

faint sage
#

That would be lovely

#

How, if I may ask

#

BIS_fnc_spawnGroup is tricky for me

spark turret
#

hey hey, where do i complain about broken module (weather change in zeus)

little raptor
spark turret
#

Will do thanks

brazen lagoon
#

@spark turret I don't think elegance necessarily has to be at odds with readable but if it's a choice between them, absolutely pick readable

#

like in my mind elegant code is simple, and simple is usually readable

dusky pier
#

Hi, is possible to somehow get mass of weapon?
I find that for magazines, but not exists in weapon config

little raptor
#

@dusky pier ```sqf
configFile >> "CfgWeapons" >> _wpn >> "WeaponSlotsInfo" >> "mass"

or
```sqf
configFile >> "CfgWeapons" >> _wpn >> "ItemInfo" >> "mass"

for items

little raptor
spark turret
#

Iirc that field is useless. But inventory size resembles mass

dusky pier
past wagon
#

how do I get the player name of a unit controlled by a player?

#

what does player return?

#

does it return the object name, or the player's name?

past wagon
#

ok thanks

little raptor
past wagon
#

ok

#

thats what I thought

#

i will check out name, thanks

little raptor
#

not its name

past wagon
#

yeah

#

ik

#

and in onPlayerKilled.sqf, old unit is the unit that got killed?

little raptor
#

ye

spark turret
#

I remeber, my first script was using weapon mass, since i couldnt read that from config, i did the only logical thing.

On gamestart an invisivle unit is created. Weighed, addweapon, weighed, noted in array, next weapon

past wagon
#

Am I doing it correctly if I put this in onPlayerKilled.sqf? should I use params instead?

_oldUnit = _this select 0;
_killer = _this select 1;
_killedPlayerName = name _oldUnit;
_killerName = name _killer;
little raptor
#

plus it's shorter

past wagon
#

ok

#

when I do params, do I need to do the full array or can it just be for the first couple elements of the array (the ones I need)

params ["_oldUnit", "_killer"];
_oldUnitName = name _oldUnit;
_killerName = name _killer;
little raptor
little raptor
#

np

past wagon
#

can I remoteExec a function? such as BIS_fnc_dynamicText? the execution is spawn.

spark turret
#

thats exactly what remoteExec is for ๐Ÿ˜„

past wagon
#

yeah

#

but what would the syntax be like?

#

would it be different

spark turret
#

[parameters for function] remoteExec ["nameofmyfunction",numberfortargets];

past wagon
#

ok

spark turret
#

["uwu"] remoteExec ["hint",2,true];

past wagon
#

so remoteExec basically replaces spawn

#

in the case of BIS_fnc_dynamicText

spark turret
#

pretty much, but the right argument is a bit more complex. it needs teh number for target machines and the JIP bool

past wagon
#

yeah

spark turret
past wagon
#

ik

#

thanks

spark turret
#

np

tidal ferry
#

Hey, quick question

#

So I'm launching a dedicated server from the launcher for testing purposes

#

But I want it to load a specific profile which has custom settings for difficulty

#

How would I go about specifying the -name parameter within the launcher server settings? Will the server listen for that?

past wagon
#

if a player dies without getting killed by another player, would the variable _killer in onPlayerKilled be nil?

params ["_oldUnit", "_killer"];
_oldUnitName = name _oldUnit;
_killerName = name _killer;
brazen lagoon
#

@past wagon i think the two are the same

#

if a player kills themselves

past wagon
#

so if the death message just says "Player was killed." then _oldUnit and _killer are the same?

#

ok

open flume
#

how would I disable collisions for an object?
(for multiplayer)

past wagon
#

is there an easy way to disable accessing inventory of dead players?

past wagon
#

thanks

past wagon
#

this is all I have so far. How do I use this to make it so players can't open their inventory?

player addEventHandler ["InventoryOpened", {
  true;
};
slate cypress
past wagon
#

ooooh

#

thats what that meant

past wagon
#

and the wiki says that the unit doesnt have to be local when you add the event handler, but it must be local for it to trigger.... does that mean it will work if I put this code in initPlayerLocal.sqf?

slate cypress
past wagon
#

ok, thanks

slate cypress
past wagon
#

yep

slate cypress
#

I just read your context.
This will prevent the opening of all inventories by the player, not just dead bodies.
To make it prevent the opening of a dead body's inventory only, you'll need to use targetContainer. I can't help you with that though because I've never used it before.

past wagon
#

yeah I know

#

i never mentioned it, but its more convenient to just prohibit opening inventories in general

slate cypress
past wagon
#

Will this event handler remain on the player if they respawn?

player addEventHandler ["InventoryOpened"], {
    true;
};
past wagon
#

I tried putting it in onPlayerRespawn as well as initPlayerLocal and it is still not working. I can open my inventory just fine

past wagon
#

Whats the proper way to do this? neither of these ways work:

waitUntil { player !inArea "myMarker" };
waitUntil !{ player inArea "myMarker" };
warm hedge
#
waitUntil {!(player inArea "myMarker")};```
past wagon
#

ah

#

thanks

past wagon
#

the goal is to make the player invincible only while inside spawn. I dont understand why this code is making the player always be invincible. this is in initPlayerLocal.

while { true } do {
    waitUntil { player inArea "SpawnMarker" };
    player allowDamage false;
    waitUntil { !( player inArea "SpawnMarker" ) };
    player allowDamage true;
};

I know there are other ways to do it, and for now I am doing it this way, which works:

while { true } do {
    sleep 1;
    if ( player inArea "SpawnMarker" ) then {
        player allowDamage false;
    } else {
        player allowDamage true;
    };
};

I prefer using waitUntil though because if I use an if then else statement, then I have to add a delay for performance and that leaves a small window of time where you could potentially still take damage in spawn.

#

I just dont see how there would be a situation where the player is not inside the spawn marker, but they are still invincible

unreal scroll
#

@past wagon If it supposed that you can return to spawn and you need the damage to be disabled again, you better to run PerFrameEventHandler to check position.

#
[{
    _handle = _this select 1;
    (_this select 0) params ["_player"];
    if !(alive _player) exitWith {
        [_handle] call CBA_fnc_removePerFrameHandler;
    };
    _player enableDamage !(_player inArea "SpawnMarker");
}, 1, [player]] call CBA_fnc_addPerFrameHandler;

"and that leaves a small window of time where you could potentially still take damage in spawn."
You can set the time interval to one frame: ...}, [player]] call CBA_fnc_addPerFrameHandler;, it is identical to waituntil, but I wouldn't recommend to use per-frame checking in complex missions.

"that leaves a small window of time where you could potentially still take damage in spawn."
So just disable damage at entity spawn, with EH ๐Ÿ™‚

Also you can use events to enable/disable damage, like EntityRespawned + EntityKilled, or MPRespawn + MPKilled.
I recommend 1 or 2-second PFH + EH to detect kills/respawns, it is much more reliable.

past wagon
#

thank you

real tartan
pulsar bluff
#

anyone happen to know the ppEffect for really darkening a players screen when incapacitated?

crude vigil
#

or u can very easily setAperture

pulsar bluff
#

im already applying a setaperture

#

its in tunnels on SOG dlc

#

right now when the player goes down, their head can glitch thru the wall and they can see the entire tunnel network outside geometry

#

so i want to apply real darkening when they go down in tunnel

winter rose
#

cutRsc "BLACK" then ๐Ÿ˜„

pulsar bluff
#
bis_revive_ppVig ppEffectAdjust [1,1,0,[0.15,0,0,1],[1.0,0.5,0.5,1],[0.587,0.199,0.114,0],[1,1,0,0,0,0.2,1]];
bis_revive_ppBlur ppEffectAdjust [0];```
#

haha

crude vigil
#

I dont really understand how already setting an aperture is preventing u from setting a new aperture but okay ๐Ÿคจ

winter rose
#

using setApertureNew I hope btw

pulsar bluff
#

maybe it doesn't, i dont know too much about these screen/lighting effects

crude vigil
#

Whatever you feel more comfortable with, aperture is just a set of numbers for received light

pulsar bluff
#

i am just hoping there's a number in the above ppEffectAdjust code i change to darken it

#

syntax is unclear so will need a bit of trial and error i guess

crude vigil
pulsar bluff
#

haha

#

can you tell me, how setaperture wont overwrite setaperture?

winter rose
#

it will

pulsar bluff
#

like i am using it in a loop, and there is no variable name for the setaperture effect that i can see

winter rose
#

have a global var you increase / decrease

pulsar bluff
#

yea

#
    setApertureNew [-1];
};
if ((_value >= 0) && (_value < 50)) exitWith {
    setApertureNew [3,3,3,1];
};
if ((_value >= 50) && (_value < 250)) exitWith {
    setApertureNew [12,12,12,1];
};
if ((_value >= 250) && (_value < 500)) exitWith {
    setApertureNew [15,15,15,1];
};
if ((_value >= 500) && (_value < 1000)) exitWith {```
#

basically just an alias function of the vn_fnc_tunnel_aperture function

crude vigil
#

why would overwriting it be a problem, record the values before you get incapacitated, apply your own, once changed, put it back

pulsar bluff
#

didnt even know about that command

#

so i have changed to

#
    (player getVariable ['QS_client_inTunnel',FALSE]) &&
    ((lifeState player) isEqualTo 'INCAPACITATED')
) exitWith {
    setApertureNew [75,75,75,1];
};
if (_value <= -1) exitWith {
    setApertureNew [-1];
};
if ((_value >= 0) && (_value < 50)) exitWith {
    setApertureNew [3,3,3,1];
};
if ((_value >= 50) && (_value < 250)) exitWith {
    setApertureNew [12,12,12,1];```
floral steeple
#

I'm a bit confused about the "params" command in SQF scripting.
I'm trying to say that an array is a parameter and can only contain strings.

Would I go about implementing such a thing like this?

params [...
  ["_information", [null, null, null], [[str, str, str]]]
];
pulsar bluff
#

looks okay yes

floral steeple
#

Alright

#

I'll attempt to see if it works

pulsar bluff
#

trial and error is your best bet

warm hedge
#

I don't think null does exist?

floral steeple
#

I looked it up and changed it to nil within my script haha

winter rose
#
params [
  [
    "_information",  // var name
    [],              // default value
    [[]]             // expected data
  ]
];
#

then you check if isEqualTypeAll @floral steeple ๐Ÿ™‚

floral steeple
#

I even more confused lol

winter rose
#

you cannot check an array content with params like you want to ๐Ÿ™‚

#
params [
  [
    "_information",  // var name
    [],              // default value
    [[]]             // expected data
  ]
];

if !(_information isEqualTypeAll "") exitWith { ["not all info was string"] call BIS_fnc_error };
floral steeple
#

so something like:

params [
    ["_id", "", [str]], 
    ["_information", [], [[]]], 
    ["_destination", [], [[]]], 
    ["_type", "", [str]]
];

if !(_information isEqualTypeAll "") exitWith { ["Not all data in Information was a string"] call BIS_fnc_error };
if !(_destination isEqualTypeAll 0) exitWith { ["Not all data in Destination is a Number."] call BIS_fnc_error };
#

could work?

willow hound
#

str is a command, not a data type

floral steeple
#

oh

#

so it needs to be ""?

willow hound
#

Yup ๐Ÿ™‚

floral steeple
#

ah okay thanks

#

also

#

I have one more question to see if something like this would work haha

[[blufor, false] call BIS_fnc_sideColor] call BIS_fnc_colorRGBtoHTML;
willow hound
#

Nested calls are okay, yes

floral steeple
#

ah alright, just making sure

willow hound
#

However, in this case you have an excess pair of square brackets. When BIS_fnc_sideColor returns, the expression looks like this:

[[r,g,b,a]] call BIS_fnc_colorRGBtoHTML;
```But `BIS_fnc_colorRGBtoHTML` expects this:
```sqf
[r,g,b,a] call BIS_fnc_colorRGBtoHTML;
floral steeple
#

ah

winter rose
#

just for readability's sake, don't one-line that ^^

willow hound
#

Personally, I hate introducing variables for one-time use meowtrash

floral steeple
copper raven
winter rose
#

code is meant to be read by hoomans

copper raven
#

but doing that its +2 sqf instructions

winter rose
#

also, debug tells you the precise line

#

if you inline everything, good luck for that

floral steeple
#

Are there ways to create variables via the Description.ext file then?

winter rose
#

โ€ฆwat

floral steeple
#

because I'm going to be using the sideColor's HTML value HEAVILY

#

(I'm writing a dialogue system)

winter rose
#

you can define values in Description.ext yes

#

see getMissionConfigValue iirc

#

my memory hasn't failed me! \o/ this time

floral steeple
#

lol

copper raven
#

use a hashmap instead

floral steeple
#

I-

willow hound
#

There are only four relevant sides, I'd just make four global variables in some init script and be done with it.

floral steeple
#

yeah I dunno where I'd put them though to be honest

#

besides I think it would be a little cooler to have custom colors for the enemies and the player's team and what-not

slate cypress
#

When you use a composite function in a one-liner, does the memory of the inner function get freed after the line has completed or does it wait for the sqf to finish?

modest nova
#

Damn I didn't realize Arma had hash maps, and here I was using setvariable and get variable to do the same exact thing

copper raven
#
rif_sideColorsHexHash = [west, east, resistance, civilian] createHashMapFromArray (["blufor", "opfor", "independent", "civilian"] apply {
    private _key = _x;    
    ["r", "g", "b", "a"] apply {profileNameSpace getVariable format ["map_%1_%2", _key, _x]} call BIS_fnc_colorRGBToHTML
});
// usage
private _westColor = rif_sideColorsHexHash get west;
copper raven
floral steeple
#

that's a bit too advanced for my tastes

#

I have absolutely no idea what that is, does, nor used for.

faint sage
#

Is it possible for AI to perform task upon spawning, like garrisoning, patrolling and defending? Given that they were just spawned on a marker using a trigger

patent lava
faint sage
#

Should I add them after the spawn lines in the script?

patent lava
#

haven't tested it, but it's probably better if you run those functions after the units have spawned in

faint sage
#

That is not possible as I will have no control over them or zeus (No zeusing, totally autonomous mission. Everything will be activated via trigger). Never mind, I think I found how to put it in use. Will post it here once I've done it

unreal scroll
#

Anti-bouncing script for planes with bugged physics:
https://youtu.be/4QWO9lk8csw
https://youtu.be/IlkK6agy_Xw

_veh addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];

if (canMove _unit) exitWith {};

// Plane is crashing
if (((getposATL _unit) #2) > 100 && {_unit getvariable ["OT_planehandler",-1] isEqualTo -1}) exitWith {
    _planehandler = [{
        _handle = _this select 1;
        (_this select 0) params ["_unit"];
        if (((getposATL _unit) #2) < 20 or {isTouchingGround _unit}) exitWith {
            [_handle] call CBA_fnc_removePerFrameHandler;
        };
        _unit setvariable ["OT_speed", velocity _unit #2, false];
    }, 2, [_unit]] call CBA_fnc_addPerFrameHandler;
    _unit setvariable ["OT_planehandler",_planehandler,true];
};

if ((isTouchingGround _unit or ((getposATL _unit) #2) < 15) && {isNull _instigator} && {_selection == ""} && {_hitPoint == ""}) exitWith {
    _unit removeAlleventhandlers "handledamage";
    if (_unit getvariable ["OT_speed",0] < -50) then {
        "LIB_SC50_Bomb" createVehicle [getpos _unit #0, getpos _unit #1, 0]; // Any object to explode
        deletevehicle _unit;
        private _objects = nearestTerrainObjects [getpos _unit,["TREE","SMALL TREE"],15,false,false];
        {
            _x setdamage 1;    
        } foreach _objects;
    };
};
};
];
spark turret
#

is there a way to get the names of all mission layers and their folder strucutre?

#

never mind, getMissionLayers does that

#

wierdly it didnt show up in my google and biki search

faint sage
#

Well if it does not work, their is a mod called 'No more aircraft bouncing' ๐Ÿฅด

unreal scroll
#

"their is a mod called 'No more aircraft bouncing' "
It does nothing beyond setting z velocity to -1, decreasing plane's vertical speed
So I made this.

faint sage
spark turret
#

does arma support structs? ๐Ÿ‘€

spark turret
winter rose
spark turret
#

struct dog {int legs; int eyes; function bark();};

little raptor
spark turret
#

shame

winter rose
spark turret
#

idk, wierd magic

little raptor
#

structs come before classes ๐Ÿ˜…

spark turret
#

hm i guess i could build my own struct support

#

or i wont and just live with what i have ๐Ÿ˜„

little raptor
#

That's what I used to do meowsweats

winter rose
cosmic lichen
#

hashmap, then you got your properties and fast access ๐Ÿ˜„

wicked fulcrum
#

am I correct in understanding that when using params all variables are passed into the private variables as copy-by-value and not as a reference to the original variable?

As in, if I have an array and do

private _arr = ["value1", "value2"];
_arr params ["_item1", "_item2"];
_item2 = "new value";
(_arr select 1) == _item2 // this would be false?
#

actually, why am I not just testing this ingame.... nwm

#

^yet another example of rubber-duck debugging. Didn't realise how easy I could test it until I typed it out ๐Ÿ˜…

wicked fulcrum
#

Is there any way to get the length of an sound file like .ogg dynamically so I know how long to "sleep" for to allow it to play to the end?
Or am I required to "hardcode" that information?

winter rose
#

hardcode IIRC

wicked fulcrum
#

alright cheers. Function with big switch-case, it must be then ๐Ÿ™‚

little raptor
winter rose
wicked fulcrum
winter rose
#

yep indeed. you could also use some CfgSFX or IDR what

wicked fulcrum
# little raptor Hashmap

that is not a bad idea. Guess I could just key the classname of the sound. And define the variables for that sound in preinit

wicked fulcrum
# winter rose yep indeed. you could also use some CfgSFX or IDR what

Ohhh. I did not realise CfgSFX existed. That seems to do the repeating for me. However I don't think I can dynamically set the delay between the repeat. In some cases I might want to repeat a sound as soon as it finishes, in others I want a delay between repeats of x seconds.

Although for atmospheric or machining sounds it seems very handy with CfgSFX.

wicked fulcrum
# little raptor Arrays are passed by reference

If I change _item2 = "new value"; in my previous example, the original value in the array is not changed? I assume that is because I don't use set. But if they are passed by reference to params shouldn't the changes to the private variables reflect in the original array?

Or am I choking on the concepts here? ๐Ÿ˜†

wind hedge
#

And perhaps also a crater

spark turret
#

is Bis_fnc_randomPos broken?
biki says you can input a center + radius, but that throws an error, internal to the function:

 _pos = [[getPos player,500],["water"]] call BIS_fnc_randomPos;```
=>
```18:14:42 Error in expression <s, rectangular _this, -1]};


if (_this isEqualTypeArray [[], 0, 0, 0, false]) e>
18:14:42   Error position: <isEqualTypeArray [[], 0, 0, 0, false]) e>
18:14:42   Error isequaltypearray: Type Number, expected Array
18:14:42 File A3\functions_f\Misc\fn_getArea.sqf..., line 30
18:14:42 Error in expression <s, rectangular _this, -1]};


if (_this isEqualTypeArray [[], 0, 0, 0, false]) e>
18:14:42   Error position: <isEqualTypeArray [[], 0, 0, 0, false]) e>
18:14:42   Error Generic error in expression
18:14:42 File A3\functions_f\Misc\fn_getArea.sqf..., line 30
#

never mind, syntax error on my side.

wicked fulcrum
spark turret
#

yeah that was it

winter rose
#

๐Ÿ‘€

little raptor
#

that applies to params, =, etc.