#arma3_scripting

1 messages · Page 111 of 1

hallow mortar
#

I suggest using getIn or getInMan event handlers like I said

twin oar
#

I have and did

#

It only works on the editor

#

once it goes to my dedicated it doesn't at all

#

kicks me from every vehicle despite the whitelist

hallow mortar
#

Then there is an issue with your implementation. It is possible to create such a system; it's been done before.

twin oar
#
this addEventHandler ["GetInMan", {
  params ["_unit", "_role", "_vehicle", "_turret"];
  if (
    getPlayerUID _unit in whitelistedUIDs ||
    !(typeOf _vehicle in IWantToBlockTheseVehicles) ||
    (_role == "cargo")
  ) exitWith {};
  hintSilent "You must be in ZR to use this vehicle"; 
  _unit moveout _vehicle; 
}];
#

This is what I'm using

sullen sigil
#

are you testing it in mp

twin oar
#

Yes

#

It works in MP editor

#

but on my dedicated it doesn't work at all

sullen sigil
#

are you broadcasting the global variables

#

and please dont tell me youre putting this in an init

twin oar
#
IWantToBlockTheseVehicles = [
    "RHS_Ka52_vvsc",
    "rhsgref_ins_BM21",
    "I_APC_Wheeled_03_cannon_F",
    "rhs_uh1h_hidf_gunship",
    "rhs_t15_tv",
    "C_Offroad_01_comms_F"
];
sullen sigil
#

are you broadcasting it

twin oar
sullen sigil
#

every single player that joins the server will add an event handler running that same code to that unit

#

bad

#

but doesnt matter for anything aside from optimisation

#

you need to broadcast the global variables unless you define them on each client

#

which is similarly bad

twin oar
#

that's where I get lost

wind flax
#

Hey guys, I'm wondering, what would be the easiest way to rotate an object 180 degrees?

twin oar
#

Like I looked at publicVariable on the wiki

#

tried to follow it and kept getting lost

sullen sigil
#

no thats wrong hang on

#
private _dir = getDir _obj1;
private _newDir = if (_dir > 180) then {
  _dir - 180
} else {
  _dir + 180
};
_obj1 setDir _newDir;```
#

probably a better way of doing it but i think that should be fine

sullen sigil
#

all there is to it

twin oar
#

So I would just do

twin oar
#
publicVariable "IWantToBlockTheseVehicles"
#

as that's is the list of blocked vehicles

sullen sigil
#

on server, yes. not each client as if you have a unit join mid-mission they will overwrite it again

#

meaning if you find something you want to block mid mission it will subsequently be removed again

twin oar
#

so in my InitServer throw that there?

sullen sigil
#

along with the definitions of the variables

#

get rid of the definitions elsewhere

twin oar
#

The definitions are only here

sullen sigil
#

then thats why

#

you need to publicvariable them

twin oar
#
IWantToBlockTheseVehicles = [
    "RHS_Ka52_vvsc",
    "rhsgref_ins_BM21",
    "I_APC_Wheeled_03_cannon_F",
    "rhs_uh1h_hidf_gunship",
    "rhs_t15_tv",
    "C_Offroad_01_comms_F"
];
sullen sigil
#

your client doesnt know what IWantToBlockTheseVehicles is

#

only the server does

twin oar
#

so initplayerlocal?

sullen sigil
#

what

#

no

twin oar
#

smh

#

sorry it's been a long day

queen cargo
#

Did anybody yet test the implications of createHashMapObject?
Thinking about using it to enable "disposable" things i just can throw in variable and have it removed once the scope was left.
Sample:

// canSuspend = true

// Blocks UserInterface and other shinanigans
// and returns a hashmap object with `#delete` set
private _lock = [] call XMS_BlackOutSystem_fnc_SetBlackout; 
while {/* condition */} do {
  sleep 1;
};```
Would this work (like especially in performance branch with the optimizations)? Is that a heavy impact on performance or memory?
(ignore non-related code obviously as it won't end in a while loop doing sleep)
sullen sigil
#

i think leopard is the only one who uses HMO 🙈

twin oar
sullen sigil
#

no

#

you would broadcast the variables

#

on the server

#

the client then gets said variables

#

you dont need to define them on the client

#

dont put that in the players init put it in initplayerlocal.sqf

twin oar
#

okay just making sure I'm doing this right

#

publicVariable "IWantToBlockTheseVehicles" goes in the InitServer.sqf

#

the other goes in InitPlayerLocal.sqf

sullen sigil
#

yes

twin oar
#

okay so remove everything from the players inits

#

It doesn't kick me out of the vehicle

sullen sigil
#

put systemchat debugs in

#

you need to be broadcasting whitelisteduids too

twin oar
#

so in the initServer put back the whitelisteduids

twin oar
sullen sigil
twin oar
#

My bad

twin oar
sullen sigil
#

did you publicvariable it

twin oar
#

no

sullen sigil
#

then what do you expect

twin oar
#

so it would be

publicVariable "whitelistedUIDs = ["123456"];"
#

?

sullen sigil
#

no

#

literally just the variable name

twin oar
#

oh okay

sullen sigil
#
whitelisteduids = [blahabalashdasdaldkhsdlahk];
publicvariable "whitelisteduids";```
twin oar
#

Okay

#

I did exactly what you said

#

still nothing

#
publicVariable "whitelistedUIDs";
publicVariable "IWantToBlockTheseVehicles";

in the InitServer.sqf

#

with the UIDS above it

#
IWantToBlockTheseVehicles = [
        "RHS_Ka52_vvsc",
    "rhsgref_ins_BM21",
    "I_APC_Wheeled_03_cannon_F",
    "rhs_uh1h_hidf_gunship",
    "rhs_t15_tv",
    "C_Offroad_01_comms_F"
];

in initPlayerLocal.sqf

hallow mortar
#

You shouldn't do publicVariable "IWantToBlockTheseVehicles" in initServer.sqf if you're not also defining that variable there.
Either define it in initPlayerLocal.sqf (and don't need to publicVariable it because all players then have it defined locally), or define it in initServer.sqf (and publicVariable it to the clients from there). Doing half of each is unlikely to work properly.

twin oar
#

okay got ya

#

okay I just tried in both

#

still didn't work

#

as in I put it in Local took out the public variable

#

nothing

#

Put all of it in the initServer.sqf and nothing

#

with the addition of the public variable

hallow mortar
#

What do you mean by "nothing"? The problem still happens and you get kicked when you shouldn't? The system does not do anything at all?

twin oar
#

The systen does nothing at all

#

my apologies

hallow mortar
#

What exactly - and I mean literally post it - is in initPlayerLocal.sqf?

twin oar
#
#include "x_setup.sqf"
diag_log [diag_frameno, diag_ticktime, time, "Executing MPF initPlayerLocal.sqf"];
__TRACE_1("","_this")

diag_log ["DOM initPlayerLocal.sqf, sending this to init player on server:", _this];

if (getClientStateNumber >= 11) exitWith {
    diag_log "Dom game already ended... Exiting";
};

_this remoteExec ["d_fnc_initPlayerServer", 2];

if (hasInterface) then {
    0 spawn d_fnc_tasks;
};

player enableAttack false;

diag_log ["Dom d_database_found:", d_database_found];
diag_log ["Dom name player:", name player];

diag_log [diag_frameno, diag_ticktime, time, "MPF initPlayerLocal.sqf processed"];
SP1 addAction
[
    "spawn Ammocrate",
    {
        createVehicle
["rhs_mags_crate", position H21,
[],10,"NONE"];
    }
];
whitelistedUIDs = ["xxx"];
IWantToBlockTheseVehicles = [
        "RHS_Ka52_vvsc",
    "rhsgref_ins_BM21",
    "I_APC_Wheeled_03_cannon_F",
    "rhs_uh1h_hidf_gunship",
    "rhs_t15_tv",
    "C_Offroad_01_comms_F"
];
#

obviously not putting the UID's out there

#

but in it my uid is removed

hallow mortar
#

Where's the EH being added?

twin oar
#

I had it in every playable units Init and got told to remove it

#

so nowhere

hallow mortar
#

Well, that'd be why it's not doing anything

#

Putting it in every unit's init was not a great way to implement it, but you do still need to have it somewhere

twin oar
#

maybe in OnPlayerRespawn?

#

so it would do check everytime they respawn?

hallow mortar
#

That's probably sensible. You should put it in initPlayerLocal.sqf as well if you do not have respawn-on-start turned on.

twin oar
#

anyway different I should write it?

hallow mortar
#

You'll need to change the object it adds the EH to. this will not be valid in the new context; player should work.

twin oar
#
this addEventHandler ["GetInMan", {
  params ["_unit", "_role", "_vehicle", "_turret"];
  if (
    getPlayerUID _unit in whitelistedUIDs ||
    !(typeOf _vehicle in IWantToBlockTheseVehicles) ||
    (_role == "cargo")
  ) exitWith {};
  hintSilent "You must be in ZR to use this vehicle"; 
  _unit moveout _vehicle; 
}];
#

that's what I have rn

hallow mortar
#

The logic appears to be sound. Changing the object as mentioned should be all that's needed.

#

In the final version, you should give your variables more unique names (it's recommended to use a prefix based on your name, e.g. moz_var_vehicleAllowList, moz_var_vehicleBlockList) to prevent accidental conflicts with other mods or scripts that might use those names.

twin oar
#

right okay

#

now the object would be "this" correct?

twin oar
#

so _player addEventHandler?

hallow mortar
#

Not _player, player

twin oar
#

okay

#
player addEventHandler ["GetInMan", {
  params ["_unit", "_role", "_vehicle", "_turret"];
  if (
    getPlayerUID _unit in whitelistedUIDs ||
    !(typeOf _vehicle in IWantToBlockTheseVehicles) ||
    (_role == "cargo")
  ) exitWith {};
  hintSilent "You must be in ZR to use this vehicle"; 
  _unit moveout _vehicle; 
}];
#

that worked in the editor

#

I'll see if it works in the dedicated

graceful kelp
#

any idea how i could go around getting the world aim position of a helicopter turret? [0]

split scarab
#

I'm getting this error only while testing in singleplayer?

private _friendlyPlayers = (playableUnits + switchableUnits) select {side group _x == side group player};
{
  private _sideNumber = (side group _x) call BIS_fnc_sideID;
  ...
  _marker setMarkerColorLocal (["colorOPFOR","colorBLUFOR","colorIndependent","colorCivilian"] select _sideNumber);
} foreach _friendlyPlayers;
vocal mantle
open hollow
#

its posible to save a variable inside a mission to be used only in 3den?

#

something that is stored in the sqm i mean

warm hedge
#

No. They're not connected

#

Object variable names are also not useable in Eden workspace

vocal mantle
#

"Added: UI rotation commands: ctrlAngle, ctrlSetAngle; config setting: angle, centerU, centerV for CStatic controls"

open hollow
warm hedge
#

Ah, if you mean that, I guess that's a thing

hallow mortar
sullen sigil
#

is there currently any way of detecting a gun hit

#

as in a bullet hitting a units gun

warm hedge
#

Good question 🤔 I've never think there is a way to detect a lucky shot

hallow mortar
#

Projectile EHs could probably do it, but that's not very efficient

sullen sigil
#

mmm... wondering what would even get it? unit hit without any damage taken? 🤔

#

not like weapon is its own object either so cant get a hit eh for that

warm hedge
#

Maybe add EH to the projectile instead

sullen sigil
#

would rather not have to do that though
fired eh on everything to hitpart eh on each shot meowsweats

#

idea is random chance for bullet to hit mag and cause small explodion, else gun gets dropped/otherwise disabled

#

(im fucking fed up of gun hits)

smoky verge
#

I've been having issues with the mod Eden 2.0 the light modules don't carry over their Attenuation settings from eden to ingame, resulting in very flat light colors

Module

_light = "#lightpoint" createVehicle _pos;

[_light,_color,_ColorLightAmbient,_brightness,[_AttenuationS,_AttenuationC,_AttenuationL,_AttenuationQ,_DistanceFade,_Distance],_dayLight,_flare,_flareBrightness,100] remoteExec ["Light_Component_fnc_spawn",0,true]

Function

_light = _this param [0, objnull, [objnull]];
_color = _this param [1, [0,0,0], [[]]];
_ColorLightAmbient = _this param [2, [0,0,0], [[]]];
_brightness = _this param [3, 1, [1]];
_setLightAttenuation = _this param [4, [2, 4, 4, 0, 9, 10], [[]]];
_dayLight = _this param [5, false, [false]];
_flare = _this param [6, false, [false]];
_flareBrightness = _this param [7, 5, [5]];
_flareMaxDistance = _this param [8, 100, [0]];

_setLightAttenuation params ['_AttenuationS','_AttenuationC','_AttenuationL','_AttenuationQ','_DistanceFade','_Distance'];

_light setLightBrightness _brightness;
_light setLightDayLight _dayLight;
_light setLightAmbient _ColorLightAmbient;
_light setLightColor _color;
_light setLightUseFlare _flare;
_light setLightFlareSize _flareBrightness;
_light setLightFlareMaxDistance _flareMaxDistance;
_light setLightAttenuation [_AttenuationS,_AttenuationC,_AttenuationL,_AttenuationQ,_DistanceFade,_Distance];

I don't understand whats wrong
I'm not sure if there is other code somewhere that could be the cause

brazen lagoon
#

hey, is there a helper function to make things display above units in game?

warm hedge
#

drawIcon3D can help you

brazen lagoon
#

yeah, I mean is there a helper fn that uses that

#

something like [_obj, "text"] call bis_fnc_text3d

manic kettle
#

Is there a way to grab ALL elements inside an array of arrays? i have a rather complex array of array heres and i need to pull just the elements that are strings.
It has a rather strange organization. Any other ideas welcome

[[1,[[1,[]],[0,[["rhs_acc_1p63",any],["rhs_acc_1p29",any]]],[3,[]],[2,[]]]],[0,[[1,[["ace_csw_kordCarryTripodLow",any],["ace_csw_kordCarryTripod",any]]],[0,[["rhs_weap_ak103",any],["rhs_weap_ak103_gp25",any],["rhs_weap_ak103_gp25_npz",any],["rhs_weap_ak103_npz",any]]],[2,[["rhs_weap_pb_6p9",any],["UK3CB_BHP",any]]]]],[9,[["Binocular",any]]],[11,[["ItemCompass",any]]],[12,[["TFAR_anprc154",any],["rhsusf_radio_anprc152",any],["ItemRadio",any],["TFAR_anprc148jem",any],["TFAR_anprc152",any]]],[14,[["ItemGPS",any]]],[3,[["rhs_6b26_green",any],["rhs_6b26_bala_green",any]]],[6,[["B_AssaultPack_blk",any]]],[7,[]],[8,[["ACE_NVG_Gen1",any]]],[10,[["ItemMap",any]]],[13,[["ItemWatch",any]]],[15,[]],[16,[]],[17,[["ACE_Sandbag_empty",any],["ACE_Fortify",any]]],[2,[["ACE_10Rnd_762x67_Berger_Hybrid_OTM_Mag",any],["ACE_10Rnd_762x67_Mk248_Mod_0_Mag",any]]],[4,[["rhs_uniform_6sh122_gloves_v2",any],["rhs_uniform_6sh122_v2",any]]],[5,[["rhs_6b13_Flora",any],["rhs_6b13_Flora_6sh92",any]]]]
warm hedge
granite sky
#

and then select { _x isEqualType "" }

#

Might need a nil guard. Not sure.

opal zephyr
manic kettle
#

do i have to flatten it multiple times?

warm hedge
#

I do not believe so

granite sky
#

Example says not.

sullen sigil
manic kettle
#

I tried flattening it but its still not one big array, this is the select 0 of the 'flattened' array
[[1,[]],[0,[["rhs_acc_1p63",any],["rhs_acc_1p29",any]]],[3,[]],[2,[]]]

#

oh its a hashmap in arrays 😰 oh gods

granite sky
#

oh, hence the anys

#

yeah you might have to do that the hard way.

manic kettle
#

thanks ACE update 😭

#

whats the hardway lol

granite sky
#

just use brain :P

manic kettle
#

i hate bran

sullen sigil
#

you just need the keys right

manic kettle
#

Well the values i guess

sullen sigil
#
private _output = [];
{
    _output pushBack _x;
} forEach arrayofstuff;
_output```
#

oh wait

#

hang on

#

this is done by tabs

#

im on amoled mode which has no syntax highlighting

#

it should be fairly similar just nest a foreach in there

#

first foreach iterates tabs, second iterates tab contents

granite sky
#

Assuming that it's not an arbitrary pile of hashmaps and arrays, sure.

manic kettle
#

hmm yeah i'll give that a shot

sullen sigil
#

im eating my dinner ill be at my computer soon

edgy dune
#

does anyone know what the formula for the velocity of bullets would be at certain distances or times if given its initial velocity and air friction?

dusk gust
edgy dune
sullen sigil
#

do you know the units of friction and if its constant deceleration or not

granite sky
#

There are two different units used in config for different sized rounds.

sullen sigil
#

oh how wonderful

granite sky
#

And it's not constant deceleration.

sullen sigil
#

even more wonderful

granite sky
#

IIRC you need a differential equation solution even if you exclude gravity.

sullen sigil
#

most likely

#

i should know this im studying physics

granite sky
#

If you include gravity then I'm not sure there's a direct analytic solution.

sullen sigil
#

gravity is just a "constant" acceleration downwards isnt it

#

at least thats how i hope BI treat it

granite sky
#

yeah but the trouble is that it adjusts the direction of bullet velocity.

sullen sigil
#

then again they use some weird value like 9.6 for it iirc

#

ah true

#

though dont think bi handles that

#

ace adv ballistics does

granite sky
#

It does because it's simulated.

sullen sigil
#

oh dear lord

granite sky
#

incremental.

sullen sigil
#

@edgy dune what do you want this for because if its tracing a bullet path theres already stuff for that

edgy dune
sullen sigil
#

same bullet mass?

granite sky
#

IIRC the friction coefficient in the bullet config is massless.

sullen sigil
#

oh its just a straight config value?

granite sky
#

which is why it has two different scales :P

sullen sigil
#

i would recommend just generating a coef or something based off friction value and muzzle velocity then tbh

edgy dune
sullen sigil
#

as that'll scale the same

edgy dune
#

well im not tryna create something, im just tryna see between two rounds which has the higher velocity/typicalspeed ratio

meager granite
#

More observations, if client receives too much damage at the same frame, it might get split:

  • Player 2 freezes
  • Player 1 hits Player 2 50 times
  • Player 2 unfreezes and finally gets the messages
  • Player 2 does ~40 HandleDamage cycles one frame, then ~10 HandleDamage cycle fires next frame
granite sky
#

Not really sure how you arranged that particular case, but yes :P

meager granite
granite sky
#

oh, that sort of freeze

tulip ridge
#

How can you get a random key from a hashmap (or just the values, whichever works)?

sullen sigil
#

does select work on hashmaps i cant remember

#

if so just selectrandom

tulip ridge
#

It does not :P

sullen sigil
#

else generate random number based on count, foreach the hashmap until you reach random

tulip ridge
#

Yeah that works, just wanted to check if there was like a cleaner way to do it

#

Actually hmm, it's for ace so it might use CBA's hashmaps

sullen sigil
#

there probably is a cleaner way to do it its 4am for me

#

you should take me less seriously than you take me normally which should be not at all

tulip ridge
#

Fair enough

#

Bed or transformation commands removed (because I most definitely have that ability)

tulip ridge
tulip ridge
#

The velocity transformation commands you asked for capital ships

sullen sigil
#

oh

#

those arent transformation commands

meager granite
#

or values

#

whichever you need

tulip ridge
#

values yeah, I guess I missed that on the hashmaps wiki page

sullen sigil
#

oh thats a thing

#

news to me

tulip ridge
sullen sigil
#

nein is angular velocity access

#

was already in engine afaik just inaccessible for some reason

#

probably due to some of the funkiness that it has

open fractal
#

hi, i'm running the following script to create a particle effect of a pistol flying from the player's hands:

private _velocity =  [(sin (getDir player))*20, (cos (getDir player))*20, 1];
private _particleParams = [
    "\A3\weapons_F\Pistols\Rook40\Rook40_F.p3d",
    "",                /* String */
    "SpaceObject",                /* String - Enum: Billboard, SpaceObject */
    1,                /* Number */
    5,                    /* Number */
    [.18,0.8,1.4],                        /* 3D Array of numbers as relative position to particleSource or (if object at index 18 is set) object.
                                    Or (if object at index 18 is set) String as memoryPoint of object. */
    _velocity,                /* 3D Array of numbers. */
    1,            /* Number */
    5,                        /* Number */
    0,                        /* Number */
    0,                    /* Number */
    [1],            /* Array of Numbers */
    [[1,1,1,1]],                        /* Array of Array of RGBA Numbers */
    [0.5],                /* Array of Number */
    0,        /* Number */
    0,    /* Number */
    "",                /* String */
    "",        /* String */
    player,
    0,
    true,
    .5,
    [],
    vectorDir vectorRef
];
drop _particleParams;

_velocity is supposed to throw the gun in the direction the player is facing, but for some reason the particle is going in bizarre directions when the player is not facing north. This velocity method works for pushing vehicles around in the direction the player is facing, but it's simply not working with the particle effect. Anyone know why?

south swan
#

animation velocity seems to also be relative to the source object blobdoggoshruggoogly try _velocity = [0, 20, 1]; or something like that

thorny radish
#

Not sure if this belongs here or in editor but I am working on a mission and I’ve reached a bit of an impasse. I want to be able to put down a bunch of the same object that creates a marker and runs a predetermined set of script and can sync to a trigger and the more I’m messing with it the more I’m realizing that I’m just describing a module right? Should I just be making my own module at this point? And how is that even done?

open fractal
hallow mortar
drowsy sparrow
#

was wondering if anyone knows why sqf lineintersectssurfaces is returning all it's data in the format of a 1 item length array

#

despite the fact that it has more than 1 item of data in it

warm hedge
#

maxResults: Number - (Optional, default 1) max results to return. -1 to return every result

drowsy sparrow
#

strange that it would even return as an array then

#

thank you, this helps

hallow mortar
drowsy sparrow
#

so how would I select a part of the data it returns with that array

#

since it's just a 1 item array

#

all i need is the z value of the intersectPosASL from the first intersection

#

I don't really care about the rest of the data

#

essentially all i'm doing is raycasting using the lineintersects 10 meters below me to check if there is a surface below the player and I want to know what the height difference is between the surface and my player

fair drum
#

[[a,b,c],[a,b,c]] apply {x select 0}

Returns all a values

hallow mortar
#
_results = lineIntersectsSurfaces [blah];
_item1 = _results select 0;
_item1pos = _item1 select 0;
_item1posZ = _item1pos select 2;```
drowsy sparrow
#

oh I see

#

so we select into the single item of the return

#

and that allows me to then select further parts of the return

#

apologies if i'm a bit slow, array's were never my strong suit

warm hedge
#

AKA it is how you navigate multi-dimension array

hallow mortar
#

It is an array of arrays. You can do any array thing you like to an array that's inside an array, once you select it.

drowsy sparrow
#

thank you!

#

you are all very helpful

hallow mortar
#

You should count the results (outer array) before selecting on it though; depending on conditions and stuff there could be nothing in it

drowsy sparrow
#

yes I have a check for that already in case the array is empty (nothing below the player)

#

okay so I am still running into one issue, I've selected down to an array which has my position values, but it claims it is only a 1 count array, however when I select into that array it only returns the x value]

#

trying to select position 1 or 2 returns an error as there isn't a position 1 or 2 despite the array now just being [x,y,z]

#

(formatted as array length count, value of array, and a text break)

#

oh wait

#

my debug is bad nevermind

#

yep my bad, thank you

wind flax
#

Is there anyway to hide a selection on an object which is not a simple object?

granite sky
#

animateSource maybe. Not my thing.

wind flax
#

ACE interactions won't work on simple objects unfortunately

thorny radish
#

Is there a way to do allMapMarkers but for areas placed in the editor? Like the ellipse and rectangle areas?

hallow mortar
#

Those are markers and they're included in allMapMarkers.

_ellipsesAndRectangles = allMapMarkers select {markerShape _x in ["RECTANGLE","ELLIPSE"]};
thorny radish
#

Thats odd

#

I must be doing something wrong

#

thanks

split scarab
#

Anyone know if it's possible to make TFAR short wave radios have infinite range or let Zeus hear all radio chatter without range limit?

still forum
#

Yes. No

#

Global range coefficient. In tfar global settings

tulip ridge
#

Ah figured it out, I had forgot to put back the sin, cos, etc.

scenic shard
#

I want to do something seemingly simple but i keep getting myself confused with all the different types of positions and vectors..

I have 2 objects placed in the editor. And I want to get the relative position between them (coordinates, rotation etc) so I can later move object 2 and place them the "same way" even if the first object moved elsewhere.

when I try object 2 either ends up on the other side of the map or inside object 1 and not how i placed it

sullen sigil
#

getRelPos

scenic shard
#

hmm, that one only returns [0,0,0] in my case, and they are not at the same position

sullen sigil
#

worldtomodel and modeltoworld

#

script it, cant use the condition dropdown things

stray flame
#

Okay so im back. Sorry for the delay. How does one do this? Reading the wiki it seems like I should put it in the script?

hallow mortar
#

Use diag_log to print the value of player at the moment of execution to the RPT file.

diag_log format ["HAMSCH DEBUG: value of player in <your script file name here>: %1",player];

if it prints <NULL-object>, there's your problem.

dark pecan
#

Hello again folks. So i had a script that you guys helped me back in 2021. This was the code that is inside the file "initPlayerLocal.sqf". Basicly it sets a certain insignia to the character based on the name. After 3 seconds it will reset to the same insignia as before. The problem is. The 3 seconds delay does not work. How can i fix it?

_player addMPEventHandler ["MPRespawn", {
    params ["_unit", "_corpse"];
    _insignia = call {
        if ("[OR-1]" in name _unit) exitWith {
            "insignia1";
        };
        if ("[OR-2]" in name _unit) exitWith {
            "insignia2";
        };
        if ("[OR-3]" in name _unit) exitWith {
            "insignia3";
        };
        //default insignia in case none of the above match:
        "insignia0";
    };
    [_unit, _insignia] spawn {
      params ["_unit", "_insignia"];
      sleep 3;
      isNil {
        _unit setVariable ["BIS_fnc_setUnitInsignia_class", nil];
        [_unit, _insignia] call BIS_fnc_setUnitInsignia;
      };
    };
}];```
granite sky
#

You mean it works but there's no delay, or what?

dark pecan
granite sky
#

What's the correct insignia in that case?

#

All that code does is set the insignia on respawn. There's no arsenal handling.

dark pecan
#

for players with "[OR-1]" on they're name should be re applied the "insignia1"

granite sky
#

when?

dark pecan
#

It doesn't goes back to the correct insignia

granite sky
#

gives up

#

We're not mind-readers. You have to describe exactly what you want the code to do.

dark pecan
#

ok. I'll try again.

#

When a player joins the server with the custom tag [OR-1] the server will set an insignia1 to that player, if another player has [OR-2] it will set the insignia 2. If none of the above it sets another insignia for example insignia4. While the server is running i want the insignias to be set again to the character every 3 seconds.

sullen sigil
#

you need to loop it

#

while alive unit do

granite sky
#

Instead of the MPRespawn, yes

dark pecan
#

My problem is: with the code above, the players when they join the server they get the correct insignia. When they die, they don't recieve the insignia.

sullen sigil
#

add while alive unit on initplayerlocal

granite sky
#

I'm gonna check the BIS_fnc_setUnitInsignia code because Leopard's example doesn't make sense if it's really global effect.

#

and Leopard usually knows what he's talking about :P

sullen sigil
#

theres some problems with setobjecttextureglobal in mp iirc

dark pecan
granite sky
#

If executed from an object's init field (which should not be done anyway for GEGlobal commands), execution may happen too early and fail to broadcast over the network and to be JIP compatible.

#

This is running later, should be fine. Probably :P

sullen sigil
#

we have a few bug reports about it in usp with insignia func

#

and theres a handful of problems with it in aceax, dunno if those were fixed or not

#

image that was provided

#

We currently use the AIO version of the mod and I've noticed an issue when we use bis_fnc_setUnitInsignia
I have a script (I've mentioned it before) that adds the blood type patch for each player to their shoulder using [_unit, "USP_PATCH_BLOOD_OPOS_BLK_ALT"] remoteExec ["bis_fnc_setUnitInsignia", 0];

#

similar problems got reported to me directly but those were aceax related meaning issue is almost certainly with setobjecttextureglobal

#

i think i may have brought it up with dedmen at some point but cant be sure

dark pecan
#

But does this have anything to do with ace ?

sullen sigil
#

no its a bug with the scripting command/bi func

dark pecan
#

hm... ok

sullen sigil
#

is the insignia being applied at any point atm

dark pecan
#

yes

#

when the server starts

sullen sigil
#

yes do what i said with initplayerlocal

dark pecan
#

when the mission starts they recieve the correct insignia

sullen sigil
#

definitely dont create a new scheduler thread for each respawn

dark pecan
sullen sigil
#

in initplayerlocal.sqf directly

#

not inside an eh

dark pecan
sullen sigil
#

sshow

dark pecan
#

inside the initplayerlocal.sqf

sullen sigil
#

i literally said not inside an eh

dark pecan
sullen sigil
#

your code is inside an event handler

#

not initplayerlocal.sqf

dark pecan
#

So should i delete anything from the code ?

sullen sigil
#

it shouldnt be inside an event handler

#

the words event handler shouldnt be in initplayerlocal.sqf

#

banned

#

use a while loop instead

dark pecan
sullen sigil
#

no

sullen sigil
dark pecan
#

What should be the condition for the while.. alive ?

sullen sigil
dark pecan
#

Ok, i'm starting to understand the logic, but how do i type it on the code ? Because the wiki has examples but i don't see how

#

like this?

sullen sigil
#

no

dark pecan
#

;_;

sullen sigil
#

is that how any of the wiki examples look

dark pecan
#

they don't have the MPRespawn

#

but they have the "{" after the while

sullen sigil
#

yes and you have [ after the while

#

and you dont even have do either

dark pecan
sullen sigil
#

no need for params

#

oh yeah i forgot this needs to be scheduled

#
params ["_player"];
[_player] spawn {
  params ["_player"];
  while (alive _player) do {
    //code
    sleep 3;
  };
};```
dark pecan
#

But how does it apply the insignia after the 3 seconds ?

sullen sigil
#

put your code in there

#

instead of //code

dark pecan
#

What is the code ?

sullen sigil
#

hang on thats written a bit daft let me just rewrite it

dark pecan
#

I can send the file here

sullen sigil
#
params ["_player"];
[_player] spawn {
  params ["_player"];
  while {alive _player} do {
    private _name = name _player;
    private _insignia = switch (true) do {
      case ("[OR-1]" in _name): {"insignia1"};
      case ("[OR-2]" in _name): {"insignia2"};
      case ("[OR-3]" in _name): {"insignia3"};
      default {"whateveryouwanthere"};
    };
    _player setVariable ["BIS_fnc_setUnitInsignia_class", nil];
    [_player, _insignia] call BIS_fnc_setUnitInsignia;
    sleep 3;
  };
};```
#

use that instead

dark pecan
#

in "initPlayerLocal.sqf" ?

sullen sigil
#

yes

dark pecan
#

ok, testing.

#

One thing. If the players does not have none of the tags above he should get a specific insignia.

sullen sigil
#

edited for it

dark pecan
#

Sorry what does that do ?

#

If a player have none of the tag above receives for example "insignia12" ?

sullen sigil
#

they receive "whateveryouwanthere"

#

change it to the class

dark pecan
sullen sigil
#

no thats just default

#

given it says default next to it

dark pecan
#

but in between "" what represents ?

sullen sigil
#

you tell me, its the script you provided

dark pecan
#

the tag or the name of the insignia ?

sullen sigil
#

insignia

dark pecan
#

but is in between ""

#

should it be default {"insignia12"}; or default {insignia12}; ??

sullen sigil
#

quoted

dark pecan
#

ok!

#

I've tested it, but i don't receive no insignia

sullen sigil
#

have you changed the insignias to the proper ones

dark pecan
#

yes

sullen sigil
#

show your initplayerlocal

dark pecan
sullen sigil
#

add:

systemChat str _name;
systemChat str _insignia;

before the call bis_fnc_setunitinsignia

dark pecan
#

like this ?

sullen sigil
#

yes

dark pecan
#

got this error

sullen sigil
#

oh

#

duh

#

change while (alive _player) to while {alive _player}

#

brackets go to curly braces

dark pecan
#

oh...

#

right

sullen sigil
#

my bad i dont use while i use cba

dark pecan
#

it's alright i didn't saw it either

#

testing

#

it said the name and the insignia. Wich is great. The insignia now appears. But if i go to arsenal and i change the insignia i wanted the server to force the character to have that specific insignia and not the one that was choose from the arsenal

sullen sigil
#

if its still saying the names and not overwriting after 3 seconds thats a problem with bis_fnc_setinsignia

dark pecan
#

I only got the message when i joined the server.

#

That's the same problem with the code that Leopard sent me.

sullen sigil
#

change all instances of _player to player

dark pecan
#

When i join the server the script works. If i die or i change it on the arsenal, it doesnt force the correct insignia

dark pecan
#

Same problem.

#

Does this code keeps updating the insignia every 3 seconds ?

sullen sigil
#

uh

sullen sigil
dark pecan
#

So the message should keep showing ?

#

every 3 sec

sullen sigil
#

but if youre only getting one systemchat then its not looping properly

#

yes

dark pecan
sullen sigil
#

try note out the top two lines and the bottom line

#

with // at the start of each of them

dark pecan
#

like this right ?

sullen sigil
#

yes

dark pecan
#

Same problem as before, but this shows up:

sullen sigil
#

unrelated

#

should be anyway

dark pecan
#

It only sends 1 message

sullen sigil
#

get rid of the // and check in a differenet mission file

#

though its gone 1am so i should probably stop trying to debug its a pointless exercise

dark pecan
#

wait

#

different scenario works

#

1 am here too

#

but it works in different scenario

sullen sigil
#

issue rests with something in your scenario messing stuff up then most likely

dark pecan
#

Copy

#

I'll see what i can do

#

thanks

#

how do i delete the messages btw ?

#

systemchat ?

sullen sigil
#

yeah just get rid of systemchat lines

dark pecan
limber thunder
#

Hi guys,
I am trying to teleport players p1, p2, p3 and p4 to the positions of padWest0, padWest1, etc.
But I have problems with the array _getPosWest = getPosASL padWest select _num4;. When I run the code I get this error message: "Error getposasl: Type Array, expected Object". Can someone tell me how to make getPosASL take the position of the selected array element?

_num4 = 0;
teamWest = ["p1", "p2", "p3", "p4"];
padWest = ["padWest0", "padWest1", "padWest2", "padWest3"];
{
    _select4 = teamWest select _num4;
    _slectPadWest = padWest select _num4;
    hint str _slectPadWest;
    _getPosWest = getPosASL padWest select _num4;

    _select4 setPosASL _getPosWest;
    _num4 = _num4 + 1;
    sleep 0.1;
} forEach teamWest;
warm hedge
#

What exactly are padWest0s? Markers?

limber thunder
south swan
#

not to sound rude, but my eyes are bleeding

warm hedge
#

They should be indicated without quotation marks. With them, they're just strings

#

Same for p1s too

limber thunder
#

I tried it but get the same error massage

warm hedge
#

Well what I've said is not the only error there

#

Give me a few to point things

#
  • "p1" is a string, not an object so it cannot fetch any object info. Same for other objects.
  • _num4 is not necessary. _forEachIndex is a thing to count the current iteration index in a forEach.
  • teamWest and padWest, if they are only for this script, they should be defined in locally. AKA, put _ as prefix.
  • You are iterating teamWest using forEach but you didn't use _x and have _select4 instead. _x is the magic variable to use the current item of the iteration.
  • _selectPadWest is unused.
  • getPosASL padWest select _num4 should have a bracket to select the current pad so getPosASL (padWest select _forEachIndex).
south swan
#
  • you can get contents of global variable by its string name like this: private _value = missionNamespace getVariable "p1";
warm hedge
#

Well that's a thing too, but it looked very workaround for no reason to me

south swan
#

p1/p2/p3/p4 aren't guaranteed to exist if players aren't connected when the code is running

limber thunder
#

I have stored above in the script only the players in an array which are also on the server. After that I split the array into two new ones. Once for all Bluffer players in teamWest and all Opfor players in teamEast

#

Thanks for your feedback I try to implement it then

split scarab
#

How do you use initPlayerLocal.sqf, do you just create the file in the mission folder and put your code in there or do you have add any default options or wrap the code in something first?

#

Also how to stop the auto reporting in chat? "Enemy front, 200 meters" thing (Auto reporting in difficulty settings only removes automatic map markers)

warm hedge
#

disableAI "RADIOPROTOCOL" should do

patent sparrow
#

Hello, I am trying to remove or replace some lights via script. The problem is that both using setdamage, setHit, switchLight, hideObject etc. Nothing seems to remove some lights from the streetlights anymore. The latter can also be destroyed with a tank shot but their light persists

winter rose
patent sparrow
#

Hello Lou, no no it was Altis. I'm surprised as well. No mods, the Altis airport's lamps where I was testing

winter rose
#

hmm, can you provide coordinates/model, and how you scripted it?

patent sparrow
#

sure just a sec

winter rose
#

I shalt wait… this time

patent sparrow
#

{_x allowDamage false; _x hideObjectGlobal true; _x enableSimulationGlobal false} forEach [
_oldLamp
];

private _newLamp = createVehicle ["Land_LampStreet_small_F", _oldLamp getPos [0, 0], [], 0, "CAN_COLLIDE"];
_newLamp setDir (direction _oldLamp);
_newLamp setPosATL (getPosATL _oldLamp);```
(sorry I had my pc off) just a simple example of how it can be replaced with another object. But as mentioned, I could use any method, such as even a module to hide the old lamp or even shoot it from a tank and its light would still persist.
#

can I show a picture?

winter rose
#

in this channel only if you accepted the #rules I believe

patent sparrow
#

the light stays there despite the fact that you can destroy or hide the lamp

#

isn't that strange?

winter rose
#

oh that's because you disabled its simulation

#

just hide it and it should be fine, or turn it off before doing so 🙂

patent sparrow
#

this was a simple example. I have tried them all. Even just with hideObject, or for example, a module for hiding objects. In this picture I simply used a tank and shot the lamp, without scripts

winter rose
#

wat

patent sparrow
#

yep that's weird

winter rose
#

investigating [15296.1,17513.1,0.0281658] right now 😄

patent sparrow
#

haha

#

I mean, I don't want to waste your time forgive me

#

I was just surprised tbf

winter rose
#

no worries here, and same yeah! 😄

#

(11.5 GB update, plz wait…)

patent sparrow
#

omg I feel bad now 😅 I last thought that it might be a problem with some cached files. If the experience should be different for you then that would be the problem

#

thanks anyway i appreciate it

winter rose
#

"Last usage: September 18th" 🕵️

patent sparrow
#

you've been busy, which is a good thing

winter rose
#
cursorObject setDamage 1;
```kills the lamp properly
#

maybe some scripted system?

#
cursorObject enableSimulation false;
cursorObject setDamage 1;
```yep
patent sparrow
#

that's weird hmm, don't use mods and as I mentioned I can join and shoot the lamp with a tank - my lamp falls to the ground but the light stays on and suspended. I will try to verify cache integrity* and maybe write back to you. I apologize!

winter rose
patent sparrow
#

yes yes that's what triggered me

#

I don't know, I'm confuse but at the same time happy that this is not a thing for you

winter rose
#

well, I'm using profiling branch too but that shouldn't be the issue otherwise more people would have reported it
I recommend checking Steam files indeed, and if it does not solve it… #arma3_troubleshooting I suppose - sorry I can't help more 😬

patent sparrow
#

I agree and thanks again. Im verifying the integrity and I am at 50%, then I will test again

dark pecan
#

Hello, once again. Yesterday i showed a script made by Leopard that would force the players to get a specific insignia based on a they're arma name and that would loop every 3 seconds. The problem is, in editor if i set a respawn position, the script would not loop. So i'm assuming, if the player dies the scrip stops looping. Can anybody help me?
code:

[_player] spawn {
  params ["_player"];
  while {alive player} do {
    private _name = name _player;
    private _insignia = switch (true) do {
      case ("[O-2]" in _name): {"insignia6"};
      case ("[OR-2]" in _name): {"insignia2"};
      case ("[OR-3]" in _name): {"insignia3"};
      default {"insigia7"};
    };
    _player setVariable ["BIS_fnc_setUnitInsignia_class", nil];
    systemChat str _name;
    systemChat str _insignia;
    [_player, _insignia] call BIS_fnc_setUnitInsignia;
    sleep 3;
  };
};```
#

P.S.: I had a scrip that Leopard helped me out in 2021, i've posted that one yesterday. I don't know wich one is easier to work with.

little raptor
dark pecan
little raptor
#

where are you adding it?

dark pecan
#

initPlayerLocal.sqf

little raptor
#

did it work before?

dark pecan
#

I'll bring the code down here

#

Yes

#

Before it worked perfectly

little raptor
#

I guess the MP event is broken somehow (not added after respawn) think_turtle

dark pecan
#

-Yesterday at 2AM i was testing out different approaches and the conclusions that i got with that script you provided me was:
Player with no respawn set. The insignia is not applied, neither refreshed.
Players with respawn set. The insignia is first applied but not looped.

#

-The one that KJW provided me was:
Player with no respawn set. The insignia is applied and refreshed.
With a respawn set. The insignia is first applied but not looped

little raptor
#

@dark pecan maybe try this instead

fnc_setInsignia = {
    params ["_unit", "_insignia"];
    sleep 3;
    isNil {
        _unit setVariable ["BIS_fnc_setUnitInsignia_class", nil];
        [_unit, _insignia] call BIS_fnc_setUnitInsignia;
    };
};
fnc_getInsignia = {
  _insignia = call {
        params ["_unit"];
        if ("[OR-1]" in name _unit) exitWith {
            "insignia1";
        };
        if ("[OR-2]" in name _unit) exitWith {
            "insignia2";
        };
        if ("[OR-3]" in name _unit) exitWith {
            "insignia3";
        };
        //default insignia in case none of the above match:
        "insignia0";
    };
    _insignia 
};
doubledax_lastPlayer = objNull;
fnc_waitForPlayer = {
  while {!alive player} do {sleep 1;};
  player addEventHandler ["killed", {[] spawn fnc_waitForPlayer}];
  player addEventHandler ["Deleted", {[] spawn fnc_waitForPlayer}];
  [player, player call fnc_getInsignia] call fnc_setInsignia;
};

[] spawn fnc_waitForPlayer;
#

it's not exactly good but blobdoggoshruggoogly

dark pecan
#

Ok, and this works with anyone on the server right ?

dark pecan
little raptor
#

you should put it in initPlayerLocal

#

and stop pinging me

dark pecan
#

sorry.

little raptor
#

if that doesn't work either:

fnc_setInsignia = {
    params ["_unit", "_insignia"];
    sleep 3;
    isNil {
        _unit setVariable ["BIS_fnc_setUnitInsignia_class", nil];
        [_unit, _insignia] call BIS_fnc_setUnitInsignia;
    };
};
fnc_getInsignia = {
  _insignia = call {
        params ["_unit"];
        if ("[OR-1]" in name _unit) exitWith {
            "insignia1";
        };
        if ("[OR-2]" in name _unit) exitWith {
            "insignia2";
        };
        if ("[OR-3]" in name _unit) exitWith {
            "insignia3";
        };
        //default insignia in case none of the above match:
        "insignia0";
    };
    _insignia 
};
doubledax_lastPlayer = objNull;
while {true} do {
  while {doubledax_lastPlayer isEqualTo player} do {sleep 1;};
  [player, player call fnc_getInsignia] spawn fnc_setInsignia;
  doubledax_lastPlayer = player;
};
patent sparrow
dark pecan
#

Ok, i will test it out and let you know!

#

Oh you changed the whole code.

#

Ok

little raptor
#

I guess MP one runs globally?

#

maybe that's why it doesn't work

dark pecan
#

Leopard, one question, does the respawn cooldown has something to do with the sleep 1 ?

little raptor
# dark pecan Hello again folks. So i had a script that you guys helped me back in 2021. This ...

you can also try that like this:

params ["_player"];
_player addMPEventHandler ["MPRespawn", {
    if (!local _unit) exitWith {};
    params ["_unit", "_corpse"];
    _insignia = call {
        if ("[OR-1]" in name _unit) exitWith {
            "insignia1";
        };
        if ("[OR-2]" in name _unit) exitWith {
            "insignia2";
        };
        if ("[OR-3]" in name _unit) exitWith {
            "insignia3";
        };
        //default insignia in case none of the above match:
        "insignia0";
    };
    [_unit, _insignia] spawn {
      params ["_unit", "_insignia"];
      sleep 3;
      isNil {
        _unit setVariable ["BIS_fnc_setUnitInsignia_class", nil];
        [_unit, _insignia] call BIS_fnc_setUnitInsignia;
      };
    };
}];
winter rose
dark pecan
#

The three scripts the same thing. If i die, it does apply the correct insgnia. While the character is alive it doesn't loop.

#

Leopard another question. The 3 seconds of delay are also applied when the unit is alive ?

split scarab
#

Is there a way to disable respawn for one specific unit?

#

I have an 8v1 manhunt scenario so I'd love if the solo player either never respawned or respawned instantly/after 10 seconds whereas the 8 hunters have a 2 minute respawn

digital hollow
#

Not really, but you can respawn everyone instantly, and do the timer afterwards. You can teleport the waiting players into a locked vehicle, or a far away island, etc

split scarab
#

How would the timer afterwards work?

#

Like respawn them instantly and freeze them with enableSimulation false; for X seconds?

digital hollow
#

spawn/sleep. ah, you can try that, it may not be very friendly to player experience tho.

split scarab
#

If I respawned them instantly and then did sleep, they'd still be able to walk around and do stuff no?

digital hollow
#

You can teleport the waiting players into a locked vehicle, or a far away island, etc

split scarab
#

Mm okay

drowsy sparrow
#

how do I detect if a variable is undefined? I would like to exit if my variable is not yet defined but isNil and isNull don't work unfortunately

granite sky
#

you're probably using isNil incorrectly.

#

if (isNil "myVar") exitWith {}

#

Note the quotes.

drowsy sparrow
#

oh interesting

#

affirm will try

#

sweet, simple fix, thanks!

little raptor
little raptor
#

if you want to loop it:

params ["_player"];
_player addMPEventHandler ["MPRespawn", {
    if (!local _unit) exitWith {};
    params ["_unit", "_corpse"];
    _insignia = call {
        if ("[OR-1]" in name _unit) exitWith {
            "insignia1";
        };
        if ("[OR-2]" in name _unit) exitWith {
            "insignia2";
        };
        if ("[OR-3]" in name _unit) exitWith {
            "insignia3";
        };
        //default insignia in case none of the above match:
        "insignia0";
    };
    [_unit, _insignia] spawn {
      params ["_unit", "_insignia"];
      sleep 3;
      _unit setVariable ["BIS_fnc_setUnitInsignia_class", nil];
      while {alive _unit} do {
        waitUntil {sleep 1; _unit getVariable ["BIS_fnc_setUnitInsignia_class", ""] != _insignia};
        _unit setVariable ["BIS_fnc_setUnitInsignia_class", nil];
        [_unit, _insignia] call BIS_fnc_setUnitInsignia;
      };
    };
}];
dark pecan
#

I will try it now. Thanks for replying!

little raptor
#

made a small change btw while {true} -> while {alive _unit}

dark pecan
#

Ok, but Leopard if you have time, could you answer this. Why did the script didn-t worked this time? Back in 2021, it would loop after death and even when alive?

#

curiosity

little raptor
#

Back in 2021, it would loop after death and even when alive?
no it shouldn't have

#

there was no loop in there

dark pecan
#

But ok it works now

thorny radish
#

Is there a way to store a variable local to an individual object? Like if I want a trigger to store who activated it last? And if not then how could I accomplish this?

thorny radish
#

👍

thorny radish
#

Sorry for the noob questions but im messing around with the "setVariable" stuff with ALiVE and for some reason it keeps telling me this line is missing a "]" but I cant see a missing bracket anywhere.

_x setVariable [_sectorOwner, ([getposATL _x, triggerArea _x select 0] call ALiVE_fnc_getDominantFaction), true)];

granite sky
#

Last ) shouldn't be there.

thorny radish
#

I even quadruple checked it as to not look stupid

granite sky
#

I would strongly recommend the Advanced Developer Tools mod. You can paste code into it and it has a very good chance of highlighting the syntax error correctly, unlike Arma itself.

thorny radish
#

Ive not heard of that

dark pecan
thorny radish
#

Where can I find it?

dark pecan
#

Once again thank you Leopard.

thorny radish
#

I only picked up this SQF stuff a couple days ago, only got notepad++ configured for it yesterday

granite sky
#

I don't know anything outside Arma that's any good at SQF syntax, unfortunately.

little raptor
#

last time I checked a few people are creating new language servers for VSCode in #arma3_tools

#

didn't have time to test it

cosmic lichen
#

It's pretty nice

little raptor
#

I was working on one myself but didn't finish it (it's still very far from complete). if that one's nice I don't have to anymore 😅

cosmic lichen
#

Just as an example

little raptor
#

e.g. player addAction [player]

cosmic lichen
#

nope

little raptor
#

I sort of had that one working (extracted info from wiki)

#

but since wiki was inconsistent it was broken sometimes

scenic shard
#

I have some issues with some vector stuff, I want to first save the position of a object in relation to another. save the needed info and later use that to find that relative position again.

It kinda works but I need to make the relative direction work correctly, right now it is always the same direction even if the car has rotated.

this is what I have, it is a test written in the console only so far but I hope you get the idea.

private _vPos = getPos car;
private _tPos = getPos testObj;

vDir = _vPos vectorFromTo _tPos; //not correct..
dist = car distance2D testObj;

//these values will be saved and used to restore Pos later
//vDir = [0.803501,0.326796,0.497584];
//dist = 1.24032;

private _distVector = vDir vectorMultiply dist; 
private _finalPos = _vPos vectorAdd _distVector;

testObj setPos _finalPos;
granite sky
#

There is getRelDir

#

Also you could replace those two with vectorDiff. You have potential issues with the Z coordinate either way though.

little raptor
#

the correct way to do what you want is this:

_relPos = car worldToModel (testObj modelToWorld [0,0,0]);
_relDirAndUp = [vectorDir testObj, vectorUp testObj] apply {car vectorWorldToModel _x};

// now to go from relative to absolute:
testObj setPosWorld (car modelToWorldWorld _relPos);
testObj setVectorDirAndUp (_relDirAndUp apply {car vectorModelToWorld _x});
sullen sigil
little raptor
#

each loop ends once the unit is dead

sullen sigil
#

oh ofc duh

raw vapor
#

How can I make a music track loop for all players in an MP scenario?

Say I have a song. It's 3 minutes long in total. The music between 0:30 and 2:00 of the track are a big looping segment. When the song hits 2 minutes, I want it to restart at 0:30 until the conditions are met for it to stop looping. When that happens, it just plays through to the end at 3:00 instead and fades out. The song already does this on its own.

How can I do that?

For context, I am using a video game soundtrack from Project Wingman (with permission) for a mission I'm doing. The songs are built to loop. I just need to make them loop in ArmA, preferably without having to open audacity to upload an unnecessarily long 30m "extended" version to my mod list or mission.

scenic shard
dark pecan
#

Leopard. About the mods i've realised something. When i get to the arsenal and i grab any piece of gear the insignia disapear.

#

But the rest is perfect!

late parrot
#

Any reason I am having receiving bool type errors with this?

params["_player"];

_uid = getPlayerUID player;

if (_uid in AdminList) then {true} else {false};
waitUntil{!(isNil "AdminList")};
_isAdmin = player call fnc_isAdmin;

if {_isAdmin} then {

    player addAction ["Admin Menu", {execVM "fnc_openMenu"}];
    player addAction ["Open Menu", {execVM "scripts\openMenu.sqf"}];

};

the second block is where im having the issues.

sullen sigil
#

cant remember of the top of my head if ; at end of final line stops returning or not

#

i think it does

#

i.e get rid of the ; at the end of fnc_isadmin

thorny radish
#

So Im using a forEach loop to access every trigger in my mission:

forEach (allMissionObjects "EmptyDetector");

However, when I try to run setTriggerStatements on _x it errors saying that its an array not an Object?

_x setTriggerStatements [

Am I misunderstanding something?

little raptor
#

the second block is where im having the issues.
which second block?

#

anyway, I doubt fnc_isAdmin is defined

late parrot
#

No I specifically created a function for it

little raptor
little raptor
#

oh nvm I missed that you're using {} here : if {_isAdmin} then {

#

should be if (_isAdmin)

late parrot
#

I'm not at home, but yes. The first code block is the fn_isAdmin

The 2nd code block is Initlocalplayer.sqf

#

OH

#

I appreciate it friend

thorny radish
#
{
if (typeOf _x isEqualTo "EmptyDetector") then {
            
      //Create Marker on Trigger and Assign it to Trigger
      _newMarker = createMarker [format["check%1", str(_count)], getPos _x];
      _newMarker setMarkerShape "ELLIPSE";
      _newMarker setMarkerSize [triggerArea _x select 0, triggerArea _x select 1];
      _newMarker setMarkerColor "ColorWhite";
      _newMarker setMarkerDir (triggerArea _x select 2);
      _x setVariable ["_localMarker", _newMarker, true];
            
      //Create Flag on Trigger and Assign it to Trigger
      _newFlag = createMarker [text(nearestLocation[getPos _x, "nameCity"]), getPos _x];
      _newFlag setMarkerType "flag_Poland";
      _newFlag setMarkerText text(nearestLocation[getPos _x, "nameCity"]);
      _newFlag setMarkerSize [1,1];
      _x setVariable ["_localFlag", _newFlag, true];
            
      //Set first owner of area
      _x setVariable ["_sectorOwner", ([getposATL _x, triggerArea _x select 0] call ALiVE_fnc_getDominantFaction), true];
            
      //Create Trigger Logic
      _x setTriggerStatements [
            
        ([getposATL thisTrigger, triggerArea thisTrigger select 0] call ALiVE_fnc_getDominantFaction) isNotEqualTo (thisTrigger getVariable "_sectorOwner"),
        switch([getposATL thisTrigger, triggerArea thisTrigger select 0] call ALiVE_fnc_getDominantFaction) do
        {
            case "LIB_WEHRMACHT": {(thisTrigger getVariable ["_localMarker", "notFound"]) setMarkerColor "ColorBlue"; (thisTrigger getVariable ["_localFlag","notFoundFlag"]) setMarkerType "LIB_Faction_WEHRMACHT";};
            case "LIB_RKKA": {(thisTrigger getVariable ["_localMarker", "notFound"]) setMarkerColor "ColorRed"; (thisTrigger getVariable ["_localFlag","notFoundFlag"]) setMarkerType "LIB_Faction_RKKA";};
            case "LIB_GUER": {(thisTrigger getVariable ["_localMarker", "notFound"]) setMarkerColor "ColorGreen"; (thisTrigger getVariable ["_localFlag","notFoundFlag"]) setMarkerType "flag_Poland";};
                
        },
        ""
    ];
            
            
    _count = _count + 1;
};
}forEach (allMissionObjects "EmptyDetector");

Thats the whole foreach loop. Im very new to SQF and am messing around with a capture point system for an ALiVE mission I made for some of my friends a while back for context. Probably a lot wrong with it but Im unsure why the _x is being seen as an array

hallow mortar
#

You don't need the typeOf isEqualTo check, since you've already filtered it down to only being "EmptyDetector" objects by using the parameter for allMissionObjects

#

The trigger statements are being set wrong. They need to be given as strings, because you're trying to pass code to evaluate later, rather than code to evaluate now and then pass the result of that code.

thorny radish
#

Makes sense

hallow mortar
#

When you convert your trigger statements to string, you should either wrap them in ' rather than " as normal, or change the " inside the code itself to be '. Or use double " inside the code. Using the same type and quantity of quotes as delimiters both inside and out will confuse the game.

thorny radish
#

Gotchya

#

Thanks for the help

#

Its still finding the _x as an array though

dark pecan
#

Hello Leopard sorry for bothering you again. First of all thank you for all the help that you gave me. Seriously. But with playing with the script i've realised something.
So when i get on arsenal if i pick any gear the insignia doesn't get assigned. The only time the insignia appears, is if i select another insignia or if i die.

_player addMPEventHandler ["MPRespawn", {
    if (!local _unit) exitWith {};
    params ["_unit", "_corpse"];
    _insignia = call {
        if ("[E-1]" in name _unit) exitWith {
            "";
        };
        if ("[E-2]" in name _unit) exitWith {
            "insignia6";
        };
        if ("[E-3]" in name _unit) exitWith {
            "insignia7";
        };
    [_unit, _insignia] spawn {
      params ["_unit", "_insignia"];
      sleep 3;
      _unit setVariable ["BIS_fnc_setUnitInsignia_class", nil];
      while {alive _unit} do {
        waitUntil {sleep 3; _unit getVariable ["BIS_fnc_setUnitInsignia_class", ""] != _insignia};
        _unit setVariable ["BIS_fnc_setUnitInsignia_class", nil];
        [_unit, _insignia] call BIS_fnc_setUnitInsignia;
      };
    };
}];```
thorny radish
#

At least I assume thats what this debug is trying to tell me

hallow mortar
#

_x must be an Object to begin with, because allMissionObjects only returns Objects, and if it wasn't it would fail the typeOf check. It would also fail at any of the setVariables since they can't accept Arrays as namespace targets.

#

Add a systemChat str _x; both before and after the _x setVariable ["_sectorOwner" ...] line.

#

Oh, also, you shouldn't use "_varName" with setVariable - it sets global scope variables, not local scope, and trying to use the local scope _ prefix may confuse it.

thorny radish
hallow mortar
#

My suspicion is that that ALIVE function is doing something with an _x and not protecting it properly, so it's overwriting your _x.
called code - even functions - is not really a separate scope. It's as if that code were run inline here in your script. It is a subscope, which means there can be crossover if variable assignments in the lower scope aren't done safely.

elfin comet
#

tfw you forget that selectRandom exists

selectedRoad = _filteredNearbyRoads select floor random [0, count _filteredNearbyRoads / 2, count _filteredNearbyRoads];```
thorny radish
hallow mortar
#

You can save your _x to a different private variable and refer to that instead

granite sky
hallow mortar
thorny radish
#

Makes sense

#

I really appreciate you boss

elfin comet
late parrot
#

My last Question for today.

On an item I have this

Alpha addAction ["Teleport Map", {execVM "scripts\Teleport_Map.sqf"}];

and what I am trying to format and execute is something like this

onMapSingleClick
{
    _Teleports = [Alpha, Bravo, Charlie, Delta] select {(_pos distance2D getPos _x < 10)};
    if ((_Teleports isEqualTo [])) exitWith
    {
        hintSilent "Please select a location to teleport to";
    };
    selectedTELE = _Teleports select 0;
    hintSilent format ["Selected Location: %1", (((str selectedTELE) splitString "TELE") select 0)];
    ((uiNamespace getVariable "disp_respawnSelectionMenu") displayCtrl 800) ctrlAddEventHandler ["ButtonClick",
    {
        if ((speed selectedTELE isEqualTo 0)) then
        {
            hintSilent format ["You have respawned at location #%1", (((str selectedTELE) splitString "TELE") select 0)];
            player setPos [(getPos selectedTELE select 0), ((getPos selectedTELE select 1) - 8), (getPos selectedTELE select 2)];
        } else
        {
            hintSilent "Teleport currently unavailable.";
        };
    }];
};

edit: Reformatted properly.

granite sky
#

What's the question?

late parrot
#

Oh sorry, How can I get that bottom code block to be executed properly? While I got it formatted I can't get it executed alongside the GUI of the RscMap as well

warm hedge
#

onMapSingleClick only works on the map that can be opened by M key

little raptor
dark pecan
#

Like this ?

#

or this ?

split scarab
#

Shouldn't this only add the action for independent players?

if (isServer) then
{
    _independentPlayers = (playableUnits + switchableUnits) select {side group _x == INDEPENDENT};
    [this, ["Sabotage UAV terminal", { 0 spawn sabotageUav; }]] remoteExec ["addAction", _independentPlayers];
};

sabotageUav = {
    _bluforPlayers = (playableUnits + switchableUnits) select {side group _x == WEST};
    reaper_uav setFuel 0;
    "Someone has sabotaged our UAV comms terminal at the airport.." remoteExec ["systemChat", _bluforPlayers];
    deleteVehicle reaper_uav;
};
#

I'm able to use the action as BLUFOR

#

Also the systemChat message pops up for each Blufor player for some reason?

verbal sleet
#

Hello I am try to use a trigger like a power up in my death race but I can’t seem to figure out how to give the cars the ammo. I figured out the condition part that detects if any vehicle is in the trigger. If anyone has any ideas please let me know. Thanks

sullen sigil
little raptor
dark pecan
#

Thank you! It worked.

#

Sorry for bothering you once again

vagrant skiff
#

so I'm trying to have a trigger delete multiple objects (t1-t8) at once and I'm using this code:

{deleteVehicle _x;}foreach Trigs;```
however it causes an error, saying "deleteVehicle: type=string, expected object" but shouldn't foreach make it so it effectively does deleteVehicle t1; deleteVehicle t2; and and so on?
hallow mortar
#

No. forEach is indeed operating on each element of the array - but each element is a "string", and forEach does not automatically convert strings into variable names (otherwise you could never use it to do things to strings).

#

In other words, your forEach is correct, but the array you are telling it to work on is wrong.
forEach is doing deleteVehicle "t1";, but you need it to do deleteVehicle t1;.

vagrant skiff
#

yeah, it seems changing it to Trigs = [t1,t2,t3,t4,t5,t6,t7,t8]; fixed the issue, thanks for the help

versed belfry
#

Hello again :D
Got a new question. In the example below, the parseSimpleArray will encounter a script error as intended and stop parsing the array.
My question is:
Is there a way to detect the error it gives or be able to tell?
So if the parseSimpleArray runs into something it can't parse, then I exit the script.

_arr = [1, 2, 3];
_arr = parseSimpleArray "[4, 5, 6, player, 7, 9, 10 , {hint "codeblock"}, _something]";
_arr; // Value will be [4, 5, 6]
meager granite
#

scripting commands, code blocks and variables aren't any of these

#

Why do you want that array as a string anyway?

versed belfry
meager granite
#

Letting user input arrays sounds like a wrong design

versed belfry
#

So in the script/function I am running, I would like to know or detect if the parseSimpleArray command ran into anything other of the data types above, so if it did, I know to stop and inform the logged in admin, otherwise if all values are safe, then to use the array in the function.

meager granite
#

🤔

#

My first guess was to turn resulting array back into a string and compare, but user can play around with quotes and spaces so it won't match even if valid

#

Perhaps you can write a regular expression to check?

#

I suck at those to suggest a good one

versed belfry
meager granite
#

The input array

versed belfry
#

I'm not too good with them either but I've already used them to figure out it's an array, not sure how to go any further.

#
params ["_unit", "_importPlanList"];

if (_unit in _importPlanList) then {

    _statement = {
        [
            [true,""],
            "Import PLANOPS plan",
            {
                if _confirmed then {
                    [format["Plan import attempt by: %1 | ID64: %2 | Import text: %3", name _unit, getPlayerUID _unit, _text]] remoteExec ["diag_log", 2, false];
                    private _plan = _text regexFind "/private _data = \[.*\];/";

                    if (count _plan >= 1) then {
                        _plan = _plan regexFind "/\[.*\]/";
                        _plan = parseSimpleArray _plan; 
                    }
                } else {
                    systemchat "Plan Import Cancelled";
                };
            },
            "Import",
            "Cancel"
        ] call CAU_UserInputMenus_fnc_text;
    };
    _action = ["Import Plan", "Import Plan", "\A3\ui_f\data\map\markers\military\marker_CA.paa", _statement, {true}] call ace_interact_menu_fnc_createAction;    
    [_unit, 1, ["ACE_SelfActions"], _action] call ace_interact_menu_fnc_addActionToObject;
};
#

Please keep in mind this is still WiP >_>

meager granite
#

[243896,10070.059095270643,16435.54391209993,"mil_dot","ColorGreen","Alpha",0,1] Is this the typical array user is going to input?

#

Copied from one of your linked messages

versed belfry
meager granite
#

If you know what arrays should be then you can simply validate them by data type and array sizes

#

If validation fails after parseSimpleArray due to bad array or data supplied, then you don't proceed

versed belfry
meager granite
#
private _arr = parseSimpleArray _user_string;
if(count _arr != 3) exitWith {hint "You messed up";};
_arr params ["_vanilla_markers", "_poly_points", "_mod_markers"];
if(_vanilla_markers findIf {
    //...validate each vanilla marker here...
} >= 0) exitWith {hint "You messed up"};
//...etc for other data...
rough dagger
#

Hi .. I wanted to ask the experts about AI disembarking from helicopters that have doors on both sides. My current system has AI cargo exiting the heli one at a time, via one side. Is there a FNC anywhere in circulation that might utilise both doors so the drop-off can be sped up?

cyan loom
#

Hi guys, is there a way using SQF to determine the addon which items in cfgweapons belong to ? i can only really see author which isnt definitive

versed belfry
# meager granite ```sqf private _arr = parseSimpleArray _user_string; if(count _arr != 3) exitWit...

But in that case if the last array of the nested arrays contained an acceptable value first then the 2nd value was wrong it would still result in 3 arrays, now?
so if the _user_string is for example:

_user_string = "[[accepted data here],[accepted data here],[accepted, denied]]";

The result would be:

_arr = [[accepted data here],[accepted data here],[accepted]];

As it would stop once it runs into an error and not just cancel the whole array.

tender sable
hallow mortar
#

It kinda feels like the best way to handle this is with an extension, which can take the initial input and evaluate & validate it in a safe (i.e. not being executed in SQF) context

versed belfry
versed belfry
meager granite
versed belfry
meager granite
#

Hmm, what if you count number of square brackets in original string VS in str of parsed array?

hallow mortar
meager granite
versed belfry
versed belfry
#

Hmmm, will see if I can make it work, thanks a lot for all the help so far.

meager granite
#
  1. Parse array, set valid flag to true.
  2. If ScriptError fires with right error, set valid flag to false
  3. If valid flag is still true on next frame, proceed using array or show an error
versed belfry
meager granite
#

Yeah it should work, up to you though.

#

Personally I don't like increasing EH index counter

versed belfry
meager granite
#

I don't think there is a bad side to it

versed belfry
meager granite
#

Yeah it could

versed belfry
#

Def not an option then

#

Creating a handler returns the index of the handler

#

The remove command accepts an index to remove a specific handler, that could work.

meager granite
#

Nevermind, it might not fire so you need to store it to delete in either case

#

Go through CfgAddons in hopes that weapon is listed in one?

tender sable
versed belfry
split scarab
tender sable
#

You can simplify some of the code. For example: private _arr = parseSimpleArray _user_string; if(count _arr != 3) exitWith {hint "You messed up";}; could be : if (_user_string params ["_array",nil,[[]],[3]]) exitwith {hint "You messed up"};

tender sable
jolly oxide
#

Ok, I wrote some lines to make it compat with CBA and now throws me errors, before that arma did not told me about errors

little raptor
#

use #arma3_config
this channel is for scripting questions and discussion

cyan loom
#

its not listed :(

winged ice
#

Dear ARMA 3 Scripting Community.
I am in the middle of research for using arma 3 scences in my thesis on computer vision.
Currently I am looping in a variety of articles and scripting tutorials that do not cover my request. ARMA 3's possibilities really seem infinite - wow.

Therefore I want to ask the professionals if there is any chance utilizing ARMA 3 like the Github DeepGTAV project does use GTA? (Not the exact same approach, but a chance to generate a screenshot and to retrieve and store the bounding box data in xml or json)

Example on DeepGTAV: https://youtu.be/h3By_ZOdlAc?si=feogaS4g-xLShcuY

Here we present DeepGTAV, a tool to generate synthetic training data for different machine learning tasks from GTAV. DeepGTAV allows to generate data for entity segmentation, object detection, LiDAR object detection, reinforcement learning and many more.

The application of synthetic training data for different object detection tasks is discuss...

▶ Play video
little raptor
versed belfry
#

So I can not compile the array before I know it is safe to do so, hence the event handlers options seems to be safer right now.

south swan
#

as in: it gets executed on putting element into the array, not on accessing it

versed belfry
winged ice
little raptor
#

modding? sorry I don't understand the question meowsweats

winged ice
little raptor
# winged ice DeepGTA uses a mod and c# code to retrieve the information ingame. I am still lo...

ah. yeah you need to make a dll. it can be C# but I recommend C++
I recommend using Intercept: https://github.com/intercept/intercept
it allows you do to native stuff (e.g. you can use libraries for handling JSON) while also having access to scripting features

you probably also want to store the captured screen in a memory buffer instead of writing it to a file (what https://community.bistudio.com/wiki/screenshot does), in which case you need to write your own screen capture code. PrintWindow might work but if not you'll have to capture the D3D11 buffer. idk how that works but looking at open source screen capture software like OBS could give you some clues

I'm not sure what is the most used method for IPC in python (I assume that's what you use for ML stuff), but you can always just use localhost to transfer data between the game and the python code

scenic shard
#
[obj1, obj2] call BIS_fnc_attachToRelative;

this command says "Local Argument" on the wiki, is that in reference to obj1, obj2, or both?

little raptor
#

it makes no sense because attachTo itself says global arg

little raptor
winged ice
little raptor
#

in that case I don't think you need to learn a lot of scripting. most of your task is passing the data to and from the game

winged ice
little raptor
#

they're proxy objects which are not accessible in scripts
typically you can just get the classname of the weapon or backpack using commands such as primaryWeapon and backpack which return strings
if you need their position, you have to do get the bone those objects are attached to, then translate them to world coords

sullen sigil
#

backpack has backpackcontainer

little raptor
#

an example

little raptor
little raptor
winged ice
little raptor
#

it could but you can't call SQF from your Python code directly afaik

queen cargo
#

XPost @cyan loom CfgPatches should contain the class names of every cfgWeapon a pbo introduces
in those cases where it does not, you are fucked and the mod author fucked up

split scarab
winter rose
split scarab
#

That'll do it, thanks :)

#

How tf do you trigger the Fire Module

#

I've made a Trigger and the condition UavSabotaged == true and synced it to the module and I know the Trigger is getting activated but nothing happens

limber thunder
#

Can someone help me with the syntax of remoteExec?
I am trying to execute the following code with remoteExec so that the task is created globally for all players.
The script is then called by the initServer.sqf and is not displayed at the moment. I guess that the task is only created locally and therefore not visible but I am not sure.

This is the code for the task:

tsk = format ["tsk%1", random 100];
[allPlayers, tsk,  ["Hack the watchtower to get information about the position of the opposing players!", "Watchtower", ""], laptop, "ASSIGNED", 99, true, "download", true] call BIS_fnc_taskCreate;
little raptor
#

it doesn't need remoteExec

limber thunder
granite sky
#

allPlayers doesn't have anything in it at that point, maybe?

#

If you want it available to all players then just use true

tender sable
#

replace allplayers with just true

#

what he said 👆

limber thunder
#

okay this works fine
Thanks

wind flax
#

Is there a way to accomplish "deep copies" of a vehicles cargo? For example, if you had a backpack which had items, could you get a full array back of all the items inside the vehicle, and inside of that backpack, and copy it to another container, with all the same items in the backpack?

granite sky
#

I imagine you could, but it's probably a horrible process.

unreal hornet
#

How can I make an AI Artillery unit shoot once every 3 minutes for 45 minutes using Zeus? I'm trying to limit the rate of fire for a 2S1 from RHS but _this setWeaponReloadingTime [gunner vehicle _this, currentMuzzle gunner vehicle _this, 0.03]; isn't working for me. I'm missing something.

pure gyro
#

as for the 45 minutes limit part, just run some sort of timer script, there are a lot out there

unreal hornet
pure gyro
#

okay yeah, so have you figured out how to make it shoot 1 round?

#

just one round when the script gets triggered

unreal hornet
granite sky
#

_artillery doArtilleryFire [_targetPos, _magazineClass, 1];

pure gyro
#

I personally have never messed with artillery scripting tbh, but i think John has got you covered 🙂

granite sky
#

There is not necessarily a solution that includes using the stock Zeus module. That's why we script.

unreal hornet
unreal hornet
granite sky
#

make a loop with a sleep in it.

unreal hornet
#

I'll let you know how it goes EyesShake

granite sky
#

This feels like the least of your problems versus how to get the right variables into the script :P

pure gyro
#

those links should be all you need in order to get the loop working

unreal hornet
#

How does spawn help me? I want an artillery battery to fire once every 3 minutes, not spawn something. blobdoggoshruggoogly

pure gyro
#

for the artillery shooty shooty part

granite sky
#

Spawn makes a thread so that you can do stuff intermittently without obstructing any other code.

#

You can't use sleep in an editor init box, for example.

pure gyro
#

damn john, you're fast 😄

wind flax
granite sky
#

So something like this in the editor init box for the artillery piece:

this spawn {
  while {canFire _this} do {
    _this doArtilleryFire [markerPos "myMarker", "magazineClass", 1];
    sleep 180;
  };
};
#

Obviously you would need a marker called myMarker for the target and you'd need to dig up a suitable magazine class.

unreal hornet
unreal hornet
granite sky
#

No, because sleep only pauses the script. It doesn't have any direct effect on the object.

#

You could do something like that with enableSimulation but it's not a good idea.

#

I guess that might be an option if you really wanted to use the zeus fire support thing, but it might just break it.

#

would look like this:

this addEventHandler ["fired", {
  (_this select 0) spawn {
    _this enableSimulation false;
    sleep 180;
    _this enableSimulation true;
  };
}];
#

probably won't work though.

unreal hornet
#

why can't arma just have a built-in "time between shots" thing, Simplex is really hard to use as well ironically

fair drum
#

If you want it to be ambient, use modules enhanced. It has a artillery module in it. No units needed, all virtual ATM.

#selfplug

#

Oh I see you want Zeus though. NVM.

#

It can be trigger activated and you can call the function directly as well

#

So in effect, you can use it in Zeus, just needs a work around with ZEN

compact warren
#

Hey guys, any ideas why this code isn't working?

// Register a simple keypress to an action
#include "\a3\ui_f\hpp\defineDIKCodes.inc"

mymod_fnc_keyDown = { systemChat "123" };

["MyMod", "MyKey", ["My Pretty Key Name", "My Pretty Tool Tip"], {
_this call mymod_fnc_keyDown
}, {
_this call mymod_fnc_keyUp
}, [DIK_TAB, [false, false, false]]] call CBA_fnc_addKeybind;

I press TAB but the systemChat doesn't show up, display 46 definitely exists, any ideas why this is happening? Launching code from console execVm "asd123.sqf", in game

pulsar pewter
#

@unreal hornet I sent you a friend request. I've been playing with some cool/immersive artillery scripts that I can share.

sullen sigil
#

please ignore how crap the code is:
removed
why is _militaryUniformed undefined inside of the if? im going slowly insane
gave up i just need to rewrite this whole mod

still forum
#

if (true) exitWith {false};
excuse me

#

how about you false instead

#

also that looks like you want it to be a findIf

sullen sigil
#

yes i wrote this ages ago before i knew half of the commands

#

i need to do a rewrite of imposters as a whole i just dont have the time right now

sullen sigil
#

the intention is that if either player's uniform or #uniform are in allmilitaryuniforms it'll go to the next iteration and will only return true if all are found in there

#

i.e either player vest or #vest as well as player helmet or #helmet

still forum
#

but forEach always goes to the next iteration...

#

It returns result of the last one

#

if you want to abort, there is break/breakWith

#

You clearly already knew that continueWith was a thing

sullen sigil
#

i dont think i knew break was a thing

#

im rewriting this once i figure out the best metric for how suspicious something (vest) should be

#

currently thinking inventory space

still forum
#

If you want all to b e true. Then probably do a count and check == 3

sullen sigil
#

nobodys complained about the bug yet so ill just leave it for rewriting

#

if you fancy crying yourself to sleep tonight

#

its really bad

still forum
#

I do not :harold:

sullen sigil
#

like wtf was i thinking here

#

holy shit i add waitandexecutes twice a second if a unit sees you

digital hollow
#

I can't get the z coordinate for particles to have any effect. Am I using it wrong or should I take this to #arma3_feedback_tracker ?

_position = [0,0,10]; // xy change the offset, z doesn't work, particle stays on ground
_particleParams = [
/* Sprite */            ["\A3\data_f\ParticleEffects\Universal\Refract",1,0,1], // File,Ntieth,Index,Count,Loop
/* Animation */            "",
/* Type */                "Billboard",
/* TimerPer */            0.1,
/* Lifetime */            1,
/* Position */            _position,
/* MoveVelocity */        [0,0,0],
/* Simulation */        0, 0, 10, 0, // rotationVel, weight, volume, rubbing
/* Scale */                [10, 0, 0, 0],
/* Color */                [[1,1,1,1], [1,1,1,1]],
/* AnimSpeed */            [0, 0],
/* randDirPeriod */        0,
/* randDirIntensity */    0,
/* onTimerScript */        "",
/* DestroyScript */        "",
/* object */            player,
/* Angle */             0,
/* onSurface */         false,
/* bounceOnSurface */   0,
/* emissiveColor */     [[0,0,0,0]]];

deleteVehicle a_source;
a_source = "#particlesource" createVehicleLocal [0,0,0];
a_source attachTo [player, [0,0,0]];
a_source setParticleParams _particleParams;
a_source setDropInterval 0.01;
sullen sigil
#

i recall having the same issue, ended up having to create helper object to attach to

still forum
#

i memb issu wih patrc z

dreamy kestrel
#

Q: is it possible to optionally include a header file, based on existence? i.e.

#if fileExists('...')
#include '...'
#endif
still forum
#

yes

dreamy kestrel
#

ah that'd be brilliant, cool. thanks...

sullen sigil
#

cant wait for dedmen to see me function overwriting my own functions

dreamy kestrel
sullen sigil
#

what

dreamy kestrel
cyan loom
#

hmm crap thanks

#

non are listed unfortunately

meager granite
fair drum
#

have you considered making your own frame machine sort of like how CBA does it? I know you don't want to use CBA due to dependency, but it might be something to look in to until they create something like this

meager granite
#

Scripting it is of course possible, I'd just prefer the engine side to handle it.

tender sable
#

How would a callNextFrame command help if you need to actually perform something X number of frames ahead? Seems superfluous and easy to handle with a simple counter. Maybe I'm missing something?

meager granite
tender sable
#

How is there a performance increase if the call happens on the next frame anyway? You're scheduling the call. 🤔

#

If it was exactly one frame you could just bit flip with a bool

#

*bit

meager granite
tender sable
#

Use a single bit.

meager granite
#

We're talking about SQF here.

tender sable
#

Engine would have to do the same anyway.

meager granite
#

The less commands you call with SQF, the better. Single basic SQF command is often times slower than whole function done on engine side, that's where bit of performance comes from.

tender sable
#

But if you're delaying one frame or multiple frames?

meager granite
#

You mostly need to do something exactly one frame after, thus the command.

simple trout
wary needle
#

I wanna make items float up like it's zero g. But I can't figure out how. Anyone have suggestions

#

I've been using this script so far

abstract gorge
#

Hey can anyone help im tryna spawn an array of units in a script chatGPT is making with me, getting an error of missing ;

_unitTypes = [
"Athena_B_G_Soldier_SL_F",
"Athena_B_G_RadioOperator_F",
"Athena_B_G_Medic_F",
"Athena_B_G_Soldier_AR_F",
"Athena_B_G_Soldier_TL_F",
"Athena_B_G_Soldier_LAT_F",
"Athena_B_G_soldier_M_F"
];
_groupAlpha = createGroup west;
_infbarracksPos = getMarkerPos "infbarracks";
{
_unit = createUnit [_x, _infbarracksPos, [], 0, "CAN_COLLIDE"];
_unit moveInGroup _groupAlpha;
} forEach _unitTypes;

would appreciate if anyone can explain why this wont work when executed im tryna learn what i can

abstract gorge
#

group_1 = createGroup west;
unitTypes = [
"Athena_B_G_Soldier_SL_F",
"Athena_B_G_RadioOperator_F",
"Athena_B_G_Medic_F",
"Athena_B_G_Soldier_AR_F",
"Athena_B_G_Soldier_TL_F",
"Athena_B_G_Soldier_LAT_F",
"Athena_B_G_soldier_M_F"
];

{
_unit = group_1 createUnit [_x, getMarkerPos "infbarracks", [], 0, "form"];
} forEach unitTypes;

this is what ive ended up with

it works in local exec but not when i try it on an addaction with this addAction ["Spawn Infantry Section", "Scripts\buyunits.sqf", [], 0, false, true, "", ""]; it doesnt show an error, but no spawn of units

hallow mortar
#

Don't use ChatGPT for writing scripts. It does not understand SQF or how Arma works. It is designed to make text that seems believable, and functionality is a second priority at best.

#

For example, "moveInGroup" is not a real command - ChatGPT has invented this because it seems believable, but it does not actually exist in Arma and you can't use it.

abstract gorge
#

in combination with the wiki and youtube ive had a bit of luck when i know whats wrong but yeah theres mostly just bollocks, im guessing its the addaciton thats fucked then since that above is working in local exec?

#

addAction ["Exec the file", "scriptFile.sqf"];

hallow mortar
#

I'm surprised the script itself works on its own; it attempts to use the "form" placement mode for createUnit, which does not exist.
If the addAction appears and can be used, then it should execute the script exactly the same as if you did it from the debug console, provided the script is indeed in a file called buyunits.sqf, in a folder called scripts, in the mission folder.

abstract gorge
#

using that format now, why would local exec work but when i interact with the action nil pois

#

hint "buyunits.sqf executed";
group_1 = createGroup west;
unitTypes = [
"Athena_B_G_Soldier_SL_F",
"Athena_B_G_RadioOperator_F",
"Athena_B_G_Medic_F",
"Athena_B_G_Soldier_AR_F",
"Athena_B_G_Soldier_TL_F",
"Athena_B_G_Soldier_LAT_F",
"Athena_B_G_soldier_M_F"
];

{
_unit = group_1 createUnit [_x, getMarkerPos "spawn1", [], 0, "form"];
} forEach unitTypes; yes and the hint displays aswell but no spawning

warm hedge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
abstract gorge
#

!code
hint "buyunits.sqf executed";
group_1 = createGroup west;
unitTypes = [
"Athena_B_G_Soldier_SL_F",
"Athena_B_G_RadioOperator_F",
"Athena_B_G_Medic_F",
"Athena_B_G_Soldier_AR_F",
"Athena_B_G_Soldier_TL_F",
"Athena_B_G_Soldier_LAT_F",
"Athena_B_G_soldier_M_F"
];

{
_unit = group_1 createUnit [_x, getMarkerPos "spawn1", [], 0, "form"];
} forEach unitTypes;

#

😒

hallow mortar
#

The message generated by the bot explains how to use code formatting. !code is the Discord prompt for the bot to generate the message.

abstract gorge
#

im drownin here save me

hallow mortar
abstract gorge
#

brudda i will record me executing it you mad man

#

dubious of the claim

hallow mortar
#

Please just try it with a mode that actually exists. At the very least, "form" is not doing anything and you lose nothing by fixing it.

abstract gorge
#

well for one the form part came from a human on youtube, chatGPT had "CAN_COLLIDE" in it's place, i don't know what any of these things are, im just explaining whats happening https://www.youtube.com/watch?v=1sfJN9AA-8I thats the vid i copied a section of the description from. thank you for your patience but i aint gunna lie about something working in local exec?????

A simple script to spawn units with a trigger. The units will be in a user made group and use markers as waypoints.

  1. Place your unit

  2. Set up a trigger

  3. Place marker (e.g. spawn1)

  4. Place a second marker (e.g. waypoint1)

  5. Type in the triggers "on activation" field:
    group_1 = creategroup west; enemy1 = group_1 createunit ["b_so...

▶ Play video
warm hedge
#

Firstly, be chill and patient.
Secondly, what exactly is the code for addAction?
Last but not least, don't ask ChatGPT about SQF scripts. As it is even pinned.

hallow mortar
#

Look, there are some optimisations you could make, but if the script is actually being executed (as proven by the hint), the invalid placement mode is the only thing I can see that would prevent it from doing anything at all. I assume the unit classnames are correct, anyway.

#

(and I also assume there is a marker named spawn1)

abstract gorge
#

spawn1 is changed to my own marker but yeah

#

hint "buyunits.sqf executed";
group_1 = createGroup west;
unitTypes = [
"Athena_B_G_Soldier_SL_F",
"Athena_B_G_RadioOperator_F",
"Athena_B_G_Medic_F",
"Athena_B_G_Soldier_AR_F",
"Athena_B_G_Soldier_TL_F",
"Athena_B_G_Soldier_LAT_F",
"Athena_B_G_soldier_M_F"
];

{
_unit = group_1 createUnit [_x, getMarkerPos "spawn1", [], 0, "CAN_COLLIDE"];
} forEach unitTypes;

#

that is what is in the script

#

omg

#

for gods sake

#

sorry guys

#

i had 2 versions of the file open and basically hadnt saved the changes

hallow mortar
#

That'll do it

abstract gorge
#

is can collid the correct thing?

#

thank u for the time man

hallow mortar
#

I would recommend using "NONE" unless you have a very specific (as in millimetres) position. "CAN_COLLIDE" allows the created unit to be placed without regard for other objects occupying the same space.

abstract gorge
#

ah okay thank you

#

its executing fine now

meager granite
# simple trout what is an example of this?

Had plenty over time. For example, if you want to get vehicle smokes created by muzzleEffect scripts when you detect smokes, you can't do it right away from Fired EH, because the script is called after that, so you want to queue a function to be called next frame to get all new smokes created by remote script.

split scarab
#

Anyone able to help me with addAction? I want to add an action to only Independent players on an object but I can only get it to work for all players or no one (this script is in the init field of the object I want the action to work on)

if (isServer) then
{
    {
        if (side group _x == independent) then {
            [this, ["Sabotage UAV terminal", { 0 spawn sabotageUav; }], nil, 6, true, true] remoteExec ["addAction", _x];
        };
    } foreach allPlayers;
};

sabotageUav = {
    uavSabotaged = true;
    reaper_uav setFuel 0;
    sleep 300;
    "Someone has sabotaged our UAV comms terminal at the airport." remoteExec ["systemChat", blufor];
    sleep 300;
    deleteVehicle reaper_uav;
};
warm hedge
#

this is invalid there I think, my first glance says

split scarab
#

Just updated the question, the script is placed in the init field of the object I want the action to work on

meager granite
#

In recent case, I sent a RE from server that is done alongside HitPart report from shooter client, if its done normally without lag the RE arrives 3 frames later, but if recieving client was lagging, both real damage messages and my RE arrive at the same frame, first RE, then damage messages (and HandleDamage fire), but I need it the other way around, so to work around this, I need to always process that RE frame later so it is consistent with non-lagging scenario.

hallow mortar
split scarab
hallow mortar
#

That looks like _independentPlayers is not [correctly] defined

split scarab
#

Oh yeah whoops, I meant to change it to just independent

hallow mortar
#

Also, you could do this more efficiently by operating locally instead of server only; check the side of the local player's group and if correct, add the action locally. This would reduce unnecessary network traffic and the complexity of the code.

split scarab
#

Will test again sorry

abstract gorge
#

please dont yell at me but im trying to set up a currency system of sorts even though im clearly out of my depth. Basically in my init.sqf i have

supplyPoints = 100;

I have a trigger displays the supply points amount with

hintSilent format ["Supply Points: %1", supplyPoints];

I want to make it so the script that contains

hint "buyunits.sqf executed";
group_1 = createGroup west;
unitTypes = [
"Athena_B_G_Soldier_SL_F",
"Athena_B_G_RadioOperator_F",
"Athena_B_G_Medic_F",
"Athena_B_G_Soldier_AR_F",
"Athena_B_G_Soldier_TL_F",
"Athena_B_G_Soldier_LAT_F",
"Athena_B_G_soldier_M_F"
];

{
_unit = group_1 createUnit [_x, getMarkerPos "infbarracks", [], 0, "NONE"];
} forEach unitTypes;

Does not execute if there aren't say a minimum of 20 supply points. and also that when it executes it takes off 20 supply points. Im happy to learn to do it myself but if anyone can even point me in the right direction of how i could learn what i need to accomplish this.

tough abyss
#

could someone help me to restrict the virtual arsenal so only certain classes have certain weapons clothing and so on? if everything works in the end you’ll get a small tip! just dm me if you are interested

split scarab
#

@hallow mortar You happen to know how to activate a Fire Module with a Trigger as well? Cause I can't get it to work.. I know the Trigger is activated cause I get the hint when I use the action and the Fire Module is synced to the Trigger but it doesn't start a fire

hallow mortar
hallow mortar
hallow mortar
split scarab
abstract gorge
#

So ive managed to get it to subract 20 supply points every time you spawn a group, woooooo. but... ffs. im tryna get my head around the if & then stuff

_retVal = if (1 > 0) then { "It's true" } else { "It's false" }; trying to apply this format to my script to essentially get

if (supplyPoints = supplyPoints > 20) then
{
hint "You deployed an Infantry Section";
group_1 = createGroup west;
unitTypes = [
"Athena_B_G_Soldier_SL_F",
"Athena_B_G_RadioOperator_F",
"Athena_B_G_Medic_F",
"Athena_B_G_Soldier_AR_F",
"Athena_B_G_Soldier_TL_F",
"Athena_B_G_Soldier_LAT_F",
"Athena_B_G_soldier_M_F"
];

{
_unit = group_1 createUnit [_x, getMarkerPos "infbarracks", [], 0, "NONE"];
} forEach unitTypes;
sleep 3;
supplyPoints = supplyPoints - 20;
hintSilent format ["Supply Points: %1", supplyPoints];
}
else (hint "You do not have enough supply points!");

Im just abut to test this im scared haha hope ive understood it

#

i got error line 2 type number expected bool, is this something to do with needing it to be a string with str somewhere?

#

please dont feel obliged to help me guys ive been asking so much

split scarab
#

As in, if supplyPoints is 20 or more

abstract gorge
#

if (supplyPoints >= 20) then
{
hint "You deployed an Infantry Section";
group_1 = createGroup west;
unitTypes = [
"Athena_B_G_Soldier_SL_F",
"Athena_B_G_RadioOperator_F",
"Athena_B_G_Medic_F",
"Athena_B_G_Soldier_AR_F",
"Athena_B_G_Soldier_TL_F",
"Athena_B_G_Soldier_LAT_F",
"Athena_B_G_soldier_M_F"
];

{
_unit = group_1 createUnit [_x, getMarkerPos "infbarracks", [], 0, "NONE"];
} forEach unitTypes;
sleep 3;
supplyPoints = supplyPoints - 20;
hintSilent format ["Supply Points: %1", supplyPoints];
}
else (hint "You do not have enough supply points!");

so thank you im entering this and just getting the hint for you dont have enough supply points even though i got 100 supply points showing 😒

#

nah i got it

#

I BLOODY DID thank you so much guys buzzing

#

it take 20 each time until you have zero then no more spawning and the hint

tough abyss
#

could somebody help me to setup restriction the the virtual arsenal?

dreamy kestrel
abstract gorge
#

if (supplyPoints >= 20) then
{
hint "You deployed an Infantry Section";
group_1 = createGroup west;
unitTypes = [
"Athena_B_G_Soldier_SL_F",
"Athena_B_G_RadioOperator_F",
"Athena_B_G_Medic_F",
"Athena_B_G_Soldier_AR_F",
"Athena_B_G_Soldier_TL_F",
"Athena_B_G_Soldier_LAT_F",
"Athena_B_G_soldier_M_F"
];

{
_unit = group_1 createUnit [_x, getMarkerPos "infbarracks", [], 0, "NONE"];
} forEach unitTypes;
editmodule addCuratorEditableObjects [[group_1], true];
sleep 3;
supplyPoints = supplyPoints - 20;
hintSilent format ["Supply Points: %1", supplyPoints];
}
else {hint "You do not have enough supply points!";}

Im not getting any errors when i run this but the new units arent added to the zeus when I deploy them, could it be a mod causing it? units ive already placed and synced with module are assigned correctly though

north rain
#

Would it be possible to disable the option to remove an inventory item (through the inventory UI)? Specifically want to prevent players from removing a facewear item from its slot, preferably w/o preventing access to the inventory itself

abstract gorge
#

still struggling with the above problem 😒 sorry im not knowledgable enough to help you villain

tough abyss
abstract gorge
#

pulling my hair out man

#

please help me 😦 once i get this squad down i can apply it to all my other deployable shit and im a king then

willow hound
abstract gorge
#

im sorry i am clueless

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
abstract gorge
#

// [editmodule, [units group_1, true]] remoteExec ["addCuratorEditableObjects", 2]

#

was a test

#

//
if (supplyPoints >= 20) then
{
hint "You deployed an Infantry Section";
group_1 = createGroup west;
unitTypes = [
"Athena_B_G_Soldier_SL_F",
"Athena_B_G_RadioOperator_F",
"Athena_B_G_Medic_F",
"Athena_B_G_Soldier_AR_F",
"Athena_B_G_Soldier_TL_F",
"Athena_B_G_Soldier_LAT_F",
"Athena_B_G_soldier_M_F"
];
{
_unit = group_1 createUnit [_x, getMarkerPos "infbarracks", [], 0, "NONE"];
} forEach unitTypes;
[editmodule, [units group_1, true]] remoteExec ["addCuratorEditableObjects", 2]
supplyPoints = supplyPoints - 20;
sleep 3;
hintSilent format ["Supply Points: %1", supplyPoints];
}
else {hint "You do not have enough supply points!";}

#

that's not right is it

hallow mortar
#

The ```sqf part, and the corresponding ``` at the end, is what causes code formatting.

abstract gorge
#

im so sorry

hallow mortar
#

// is a comment in SQF.

stable dune
#

Add before ```sqf and to end
```

abstract gorge
#

""sqf
if (supplyPoints >= 20) then
{
hint "You deployed an Infantry Section";
group_1 = createGroup west;
unitTypes = [
"Athena_B_G_Soldier_SL_F",
"Athena_B_G_RadioOperator_F",
"Athena_B_G_Medic_F",
"Athena_B_G_Soldier_AR_F",
"Athena_B_G_Soldier_TL_F",
"Athena_B_G_Soldier_LAT_F",
"Athena_B_G_soldier_M_F"
];
{
_unit = group_1 createUnit [_x, getMarkerPos "infbarracks", [], 0, "NONE"];
} forEach unitTypes;
[editmodule, [units group_1, true]] remoteExec ["addCuratorEditableObjects", 2]
supplyPoints = supplyPoints - 20;
sleep 3;
hintSilent format ["Supply Points: %1", supplyPoints];
}
else {hint "You do not have enough supply points!";} ""

hallow mortar
#

`, not '

stable dune
#

` not '

willow hound
abstract gorge
#
if (supplyPoints >= 20) then
{
hint "You deployed an Infantry Section";
group_1 = createGroup west;
unitTypes = [
    "Athena_B_G_Soldier_SL_F", 
    "Athena_B_G_RadioOperator_F", 
    "Athena_B_G_Medic_F", 
    "Athena_B_G_Soldier_AR_F", 
    "Athena_B_G_Soldier_TL_F", 
    "Athena_B_G_Soldier_LAT_F", 
    "Athena_B_G_soldier_M_F"
];
{
    _unit = group_1 createUnit [_x, getMarkerPos "infbarracks", [], 0, "NONE"];
} forEach unitTypes;
[editmodule, [units group_1, true]] remoteExec ["addCuratorEditableObjects", 2]
supplyPoints = supplyPoints - 20;
sleep 3;
hintSilent format ["Supply Points: %1", supplyPoints];
}
else {hint "You do not have enough supply points!";} ```
#

can you see why im struggling 🤣

hallow mortar
#

Nearly there, you just need to make sure ``` and sqf are on the same line, without spaces, to activate the syntax highlighting

granite sky
#

IIRC it bugs out in some cases anyway, possibly when you add the quotes later.

abstract gorge
#

if (supplyPoints >= 20) then
{
hint "You deployed an Infantry Section";
group_1 = createGroup west;
unitTypes = [
    "Athena_B_G_Soldier_SL_F", 
    "Athena_B_G_RadioOperator_F", 
    "Athena_B_G_Medic_F", 
    "Athena_B_G_Soldier_AR_F", 
    "Athena_B_G_Soldier_TL_F", 
    "Athena_B_G_Soldier_LAT_F", 
    "Athena_B_G_soldier_M_F"
];
{
    _unit = group_1 createUnit [_x, getMarkerPos "infbarracks", [], 0, "NONE"];
} forEach unitTypes;
[editmodule, [units group_1, true]] remoteExec ["addCuratorEditableObjects", 2]
supplyPoints = supplyPoints - 20;
sleep 3;
hintSilent format ["Supply Points: %1", supplyPoints];
}
else {hint "You do not have enough supply points!";} 
granite sky
#

You're missing a semicolon at the end of the remoteExec line.

abstract gorge
#

thank you i shoulda spotted that damn

granite sky
#

Otherwise it should work, assuming that supplyPoints, editmodule and the "infbarracks" marker all exist.

abstract gorge
#

hells yeah the rest works as should and everythings placed and named

#

lets see

north rain
abstract gorge
#

if (supplyPoints >= 20) then
{
hint "You deployed an Infantry Section";
group_1 = createGroup west;
unitTypes = [
    "Athena_B_G_Soldier_SL_F", 
    "Athena_B_G_RadioOperator_F", 
    "Athena_B_G_Medic_F", 
    "Athena_B_G_Soldier_AR_F", 
    "Athena_B_G_Soldier_TL_F", 
    "Athena_B_G_Soldier_LAT_F", 
    "Athena_B_G_soldier_M_F"
];
{
    _unit = group_1 createUnit [_x, getMarkerPos "infbarracks", [], 0, "NONE"];
} forEach unitTypes;
supplyPoints = supplyPoints - 20;
sleep 3;
[editmodule_1, [units group_1, true]] remoteExec ["addCuratorEditableObjects", 2];
hintSilent format ["Supply Points: %1", supplyPoints];
}
else {hint "You do not have enough supply points!";}

this is what im running but sadly the units still aren't editable, im worried maybe it's a mod causing it

#

BOOOOOOOM

#

if (supplyPoints >= 20) then
{
hint "You deployed an Infantry Section";
group_1 = createGroup west;
unitTypes = [
    "Athena_B_G_Soldier_SL_F", 
    "Athena_B_G_RadioOperator_F", 
    "Athena_B_G_Medic_F", 
    "Athena_B_G_Soldier_AR_F", 
    "Athena_B_G_Soldier_TL_F", 
    "Athena_B_G_Soldier_LAT_F", 
    "Athena_B_G_soldier_M_F"
];
{
    _unit = group_1 createUnit [_x, getMarkerPos "infbarracks", [], 0, "NONE"];
} forEach unitTypes;
supplyPoints = supplyPoints - 20;
sleep 3;
[module_zeus_1, [units group_1, true]] remoteExec ["addCuratorEditableObjects", 2];
hintSilent format ["Supply Points: %1", supplyPoints];
}
else {hint "You do not have enough supply points!";}

that was the ticket, name the main zeus module i gave the name of the add objects module

#

thank you so much everyone for your patience and understanding

pulsar pewter
#

We all were beginners with SQF sometime! (Well, except maybe John Jordan, who seems to have been born into it cue the Bane "I was born in the dark, you merely adopted it" clip)

#

/Im still a beginner

sullen sigil
dreamy kestrel
tough abyss
#

Hello I need help from someone to create the feature so clothing, weapons and vehicles are whitelisted to classes. E. g. pilots only can have SMGs and Pilot clothing and fly jets and helis but the rest cant. Same for Engineer that he is the only one who can carry explosive charges and so on for the Virtual Arsenal. We use Xeno69’s Domination game mode!

Just DM me I you'd like to assist

brazen lagoon
#

hey, do you guys think anyones ever made a script that adjusts AI skills based on player performance?

winged ice
dreamy kestrel
# dreamy kestrel Q: about `BIS_fnc_sortBy`, if I want to order by, say, a `CONFIG` `"displayName"...

ARRAY does not seem to work...

_y = [
['c', 1]
, ['b', 6]
, ['b', 3]
, ['b', 4]
, ['a', 2]
];

[_y, [], { _x }] call bis_fnc_sortby;
// expected: [["a",2],["b",3],["b",4],["b",6],["c",1]]
// actual: [["c",1],["b",6],["b",3],["b",4],["a",2]]

default "ascend" order, right, does not sort.
although oddly, "descend" order produces this:

// descending order: [["a",2],["b",4],["b",3],["b",6],["c",1]]

seems rather inverted to me. also does not take first element, then second element, into consideration.
when I provide an algorithm, seems better, i.e. {_x select 0}, orders in the correct expected order.