#arma3_scripting

1 messages ยท Page 693 of 1

finite imp
#

thank you very much for enlightening me

winter rose
#
{ _x in thislist } count allPlayers > 15;
#
count (allPlayers inAreaArray thisTrigger) > 15;
manic radish
thorn saffron
#

@unreal scroll It is always better to script it "from ground up" not really. Reinventing the wheel just because we don't have access to some commands and functions is something that really irks me in arma. Like, there is no way to access the ballistic computer functions and good luck trying to get anything sensible on your own.
Anyway, you said you edited the ACE script to get the cover script. Could you share with one exactly?

manic radish
red rune
#

thanks

lone zenith
#

hey ho my guys, anyone familiar with extensions?

#

Well maybe it's more of a cpp problem? It seems my dll file doesnt have the appropriate permissions to access another file in the same directory

pliant stream
#

that would be a filesystem permission issue, and not related to the dll itself

lone zenith
#

Yeah... not quite sure, maybe it's the way I'm compiling the whole thing

#

Anyway ArmA crashes with the error status_access_violation

pliant stream
#

that's not a file permission issue, your code has undefined behaviour

still forum
#

attach a debugger and check why its crashing

lone zenith
#

and this in memdump "The thread tried to read from or write to a virtual address for which it does not have the appropriate access"

still forum
#

check in debugger where exactly that happened. Probably somewhere in your code

lone zenith
#

How do I do that?

pliant stream
#

are you using visual studio by chance?

lone zenith
#

Yeah, just found a guide, I'mm a try it out

#

I'm pretty sure I know where it's crashing though

pliant stream
#

start arma
in VS: Debug > Attach to process...
then select arma3.exe or whatever it's called

lone zenith
#

cool doing that rn

unreal scroll
#

@thorn saffron "Anyway, you said you edited the ACE script to get the cover script. Could you share with one exactly?"
As I said, it is deeply integrated into my mod mechanics, and it would be extremely hard for you to adapt it for your mission.
But, you can take a look at VCM_fnc_FindCover function in VCOM mod.

lone zenith
#

"Unhandled exception at 0x0000000000000000 in arma3_x64.exe: 0xC0000005: Access violation executing location 0x0000000000000000."

#

Im not quite sure where I should be looking

#

" GetModuleFileName(GetModuleHandle( TEXT("mydll_x64.dll")),lwpPath, MAX_PATH); " seems to be a problem point

pliant stream
#

you jumped through a null pointer

lone zenith
#

Hmm thing is , the extension works when I load it locally, but when it's uploaded on the workshop I'm getting these errors

pliant stream
#

you could put some breakpoints in your code and step through

#

something is different, you didn't handle it and now your code invokes undefined behaviour

lone zenith
pliant stream
#

well did you check if they're null?

lone zenith
#

Meaning , I'm guessing, that the dll isn't being loaded properly

#

If what is null?

pliant stream
#

the pointers

lone zenith
#

I've outputed the result of the line

#

It does correctly output the file path

pliant stream
#

okay, but presumably afterwards you call LoadLibrary and GetProcAddress?

lone zenith
#

yeah

pliant stream
#

well do you check the return value of LoadLibrary?

#

do you check the return value of GetProcAddress?

lone zenith
#

No, but I am fairly certain they're null

#

I can try to do that real quick

winter rose
pliant stream
#

not really...?

lone zenith
pliant stream
#

there's no #programming

winter rose
pliant stream
#

anyway, your code needs check if those functions are failing and handle the situation

winter rose
#

meh, continue in here for that one ^^

pliant stream
#

you can't assume those calls will always succeed just because they happened to one time on your machine

lone zenith
#

Hmm alright, I can do the error handling part to prevent crashes - but I don't think that will solve the problem of the dll not being read/loaded properly, right?

pliant stream
#

no. one problem at a time

#

use GetLastError to get an error code for a bit of extended error information

lone zenith
#

Well im using the watches on vs19

#

seems give me some good information and indeed the result of loadLibrary is null

pliant stream
#

i expect you'll see ERROR_MOD_NOT_FOUND

#

you can use $Err in for the last error as well

lone zenith
#

so I added a check to make sure the result of LoadLibrary isnt null, and somehow it doesn't crash anymore and it doesn't return null

#

sounds almost like a quantum particle

past gazelle
#
waitUntil
{
scriptDone _handle;
};```
I keep getting an expression error if this part is on the end of a script. The script seems to work fine without it but I have a feeling it should be there to keep things running smooth. Any ideas?
#

(It's a script to do the intro text in the bottom right of the screen)

cosmic lichen
#

What's the error saying?

past gazelle
#

Generic Error in Expression

#

After that the only line is BIS_fnc_camp_showOSD__running = false; which turns off the on screen text (but it's not visible anyway).

#

(I spent a good 90 minutes on it last night including retyping the whole thing looking for misplaced ANSI/UNICODE characters too)

tough abyss
#

Im going through an making my own script to spawn MOODED AI for my dedicated server mission.

Are there any good resources out there to speedup my scripting process?

Im legit writing sqf files and triggers in mission to make stuff work.

astral dawn
copper raven
past gazelle
#

meaning _handle has already completed?

#

It literally just says "Error Generic Error in Expression" in the black error log that pops up on the screen. I tried removing the semicolon after _handle but that didn't change anything...

#

I pulled it from the last post on this page.

copper raven
past gazelle
#

Oh! Okay. Well, this isn't my code but I get the meaning now. Thanks for pointing this out...

tough abyss
#

OK so i wrote up a script using some tutorials and references to wiki and got something to work. I'd like to clean some things up if anyone is willing to help

#

first off, im redefining the createUnit funciton multiple times and adding each one to the creaGroup variable i made

#

ill just post my script

#
group_1 = creategroup [independent, true];  
enemy1 = group_1 createunit ["ModdedAI1", getmarkerpos "AISpawn_1",[],0,"form"]; enemy1 domove (getmarkerpos "AIMove_1");
enemy2 = group_1 createunit ["ModdedAI2", getmarkerpos "AISpawn_1",[],0,"form"]; enemy2 domove (getmarkerpos "AIMove_1");
enemy3 = group_1 createunit ["ModdedAI3", getmarkerpos "AISpawn_1",[],0,"form"]; enemy3 domove (getmarkerpos "AIMove_1");
#

I forget how to make it look like code

past gazelle
#

Looks fine to me, add more {}'s ?

tough abyss
#

yeah so how can i clean this up with an array so i can just have the units together with ocmmas

#

instead of redefining

#

it wants a string in the argument

#

also, how to i make the bot apply the code view to this?

#

ArmaBot?

#

'''?

#

I saw it somewhere but this discord is huge and im searching lol

past gazelle
#

Oh, you mean make it look like code in discord? three ` <<the key left of 1

tough abyss
#

there we go

#

ok, so how can i make the multiple units in an array, then tell all of them to spawn at my "AISpawn_1" then domove to my move waypoint

#

or how can i make this work with a predefined group, that will be easier too

#

and grab the string from the config viewer

#

I know how to get the config view string, need to plug it into the trigger

past gazelle
sinful depot
#

I have question. we can make difference pbo file private override pbo some mod ?

past wagon
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
tough abyss
#

Hey. I tried making a inheritance for a ACE action on a object. But somehow it just refuses to show up. Anybody got any insight?

_action = ["convo", "Coversatie", "", {}, {true}] call ace_interact_menu_fnc_createAction;
[elder1, 1, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToObject;

_action = ["optie1", "Groet Dorpsoudste", "\a3\ui_f\data\igui\cfg\simpletasks\types\Talk_ca.paa", {["convo\convo1.sqf"] remoteExec ["execVM", 2]}, {true}] call ace_interact_menu_fnc_createAction;
[elder1, 1, ["ACE_MainActions", "convo"], _action] call ace_interact_menu_fnc_addActionToObject;

This is inside InitPlayerLocal.

little raptor
#

also why do you use 1?

#

isn't this supposed to be an object action and not a self action?

tough abyss
#

Leopard. I apologize. I indeed overlooked the 0, 1 after the object variable

#

anyone know how to delay the repeat of a trigger within the "On Activation" field?

For example, I have a trigger to go off when a player enters, but I want a delay to prevent it from being spammed if the player hops over the line over and over

#

i tried sleep

#

no worky

little raptor
tough abyss
#

I know now that i tried and failed ๐Ÿ˜ญ

#

Now I just need to figure out how to remove it after use, in a proper way, using:

[elder1, 0, ["ACE_MainActions", "convo"], _action] call ace_interact_menu_fnc_removeActionFromObject;

nets me the result I want, however it throws a 'undefined variable in expression' which I tried circumventing by using _action1 ect but that doesn't help.

#

is the trigger interval something I can set in the on activation field?

tough abyss
little raptor
tough abyss
#

countdown simply delays the units spawning

#

I want to prevent them spawning over and over and over and over by slowing it down

#

say a 5 minute wait period

#

would this work @little raptor

//

_trigger setTriggerInterval 5;
#

but make that as long as needed?

little raptor
#

no

tough abyss
#

ooof

#

๐Ÿ˜„

#

or _this

#

then setTriggerInterval?

little raptor
tough abyss
#

right

#

or whatever length of time i set

little raptor
#

you can't do that with trigger interval then

tough abyss
#

so 5 players dont trip it 5 times

#

make sense

#

I want to spawn say 4 AI (i have that working) but if 5 players enter I dont want 20 AI

nor do i want it to respawn if the player goes back outside, then inside the trigger zone

little raptor
#

you have to implement a timer system:
condition

time - (thisTrigger getVariable ["last_activation", -300]) >= 300

on activation:

thisTrigger setVariable ["last_activation", time];
#

also set the trigger interval to check every 5-10 seconds

tough abyss
#

ah oh so in the Condition box I define time

then add that at the top of my On Activation box

#

ohh ok so that checks it

little raptor
#

in condition you check time

#

in activation you set time

tough abyss
#

it doesnt like that lol

little raptor
#

what?

tough abyss
#

so i have to set "this" in the condition right

#

then add

time - (thisTrigger getVariable ["last_activation", -300]) >= 300
little raptor
#

what? no. it must be exactly what I wrote

#

no this

tough abyss
#

should that - be a =

little raptor
#

no

#

exactly what I wrote

tough abyss
#

I get an error

#

copying and pasting that

#

says Condition:

#

do i need to first define last_activation

little raptor
#

no

#

you copied the wrong code

#

it was missing )

tough abyss
#

yeah i fixed it lol

#

just noticed

#

ima change to 15 seconds to test it

little raptor
tough abyss
#

300 seconds right?

little raptor
#

gives it a default value if undefined

#

yes

tough abyss
#

right

#

i changed to 15 to test it

#

i should see the effect after 15 seconds but not before

#

lol it just triggered immediately before i got there

#

I have the sound to let me know

#

now its triggering every 15 seconds and im not in the trigger area

little raptor
#

change it to:

this && {time - (thisTrigger getVariable ["last_activation", -300]) >= 300}
tough abyss
#

ill try now ty

#

just crashed lol ill see if that was related or just a regular crash

#

you got a better script that uses an array vs what im doing....the hard way

#

im defining each unit separetly

#

heres what i got which is working but i want to clean it up

#
group_1 = creategroup [independent, true];  
enemy1 = group_1 createunit ["ModdedAI1", getmarkerpos "AISpawn_1",[],0,"form"]; enemy1 domove (getmarkerpos "AIMove_1");
enemy2 = group_1 createunit ["ModdedAI2", getmarkerpos "AISpawn_1",[],0,"form"]; enemy2 domove (getmarkerpos "AIMove_1");
enemy3 = group_1 createunit ["ModdedAI3", getmarkerpos "AISpawn_1",[],0,"form"]; enemy3 domove (getmarkerpos "AIMove_1");
#

I tried slapping the 3 different units in an array, but it wants a string

little raptor
#

why do you use global variables?

tough abyss
#

cuz im a fukin noob lol

#

this will be on a dedicated server so whatever is best

little raptor
#
_group = creategroup [independent, true];  
{
  _unit = _group createunit [_x, getmarkerpos "AISpawn_1",[],0,"form"]; 
  _unit domove (getmarkerpos "AIMove_1");
} forEach ["ModdedAI1", "ModdedAI2", "ModdedAI3"]
tough abyss
#

and the true variable should delete them if i read correctly right?

little raptor
#

true deletes the group when it's empty

tough abyss
#

perfect, need to prevent resource hogging

little raptor
#

it doesn't delete units

tough abyss
#

right

#

i have a cleanup thing in my options im pretty sure

little raptor
tough abyss
#

i think its working

#

yup every 15 seconds while im in the zone

#

i think a 5 min delay should be good, plenty of time to grab the objective and roll out, or stay and deal with AI over and over

little raptor
tough abyss
#

im sitting in and it goes off every 15 seconds

little raptor
tough abyss
#

if i make the timer long enough itll work just fine

#

i want my players to deal with threats when they move to zones

#

my server is a warlord server blue vs red with green AI frustrating both sides

#

๐Ÿ˜„

#

only crappy part, i cant make green retake zones..

#

in warlord

late jacinth
#

I want to destroy 3 tanks and once all three are destroyed it will complete the task. I know for one !alive _unit works but what about for all three? thanks

tough abyss
late jacinth
#

I was close in my attempts... lol. that worked. thank you

quick venture
#

Does anybody know any documentation or use of BIS_fnc_moduleUnlockArea? Specifically how to use it.

Wiki just has "example needed" in every field.

#

It's the Eden module that allows for a Zeus to place objects inside of a sector afaik, like the one in the official Seize, Defend or Control gamemodes

little raptor
# quick venture Does anybody know any documentation or use of `BIS_fnc_moduleUnlockArea`? Specif...

just read the function:

_logic = _this select 0;
_units = _this select 1;
_activated = _this param [2,true,[true]];

if (_activated) then {

    _curator = objnull;
    _areas = [];
    {
        if (triggertype _x != "" && triggertype _x != "NONE") then {
            _areas set [count _areas,_x];
        } else {
            if (_x call bis_fnc_isCurator) then {
                _curator = _x;
            };
        };
    } foreach (synchronizedobjects _logic);

    {
        [_curator,position _x,(triggerarea _x select 0) max (triggerarea _x select 1)] call bis_fnc_curatorAddEditingArea;
    } foreach _areas;
};
little forum
#

Hey,

Does anyone know of a way for a multiplayer server to clear bodies every 5 minutes, so I am not playing with my friends at 15 FPS most of the time?

little raptor
#

but yeah you can do it

#

I think there are premade scripts too

cosmic lichen
#

Just use the garbage collection

little raptor
#

oh right the game has garbage collection meowsweats

little forum
cosmic lichen
#

Mission Attribute โ†’ Performance

little forum
cosmic lichen
#

Yes

#

It's handled by the engine then.

mighty vector
#

hmm...can anyone explain what BIS respSpecShowFocus exactly does?

cosmic lichen
#

What is that? A function?

manic radish
#

was going to illustrate that with an image but it seems I cant, but I think its the bit in the centre of the screen when you have a unit selected in spectator mode

cosmic lichen
#

Changing these variable has no effect for me. Dunno what they are for

distant oyster
livid wagon
#

Hi all, having an issue with a function I'm making. (I apologise in advance for not being very good at this)
The issue is that _vehicle removeMagazine _magazine; is removing that magazine class from the vehicle's turret ammunition, rather than the vehicle cargo / inventory as is wanted. Is there any way to remove the mag from the cargo rather than the turret?
Even if turret empty and mags of that class in the cargo, they are not removed. Any help much appreciated thank you!

livid wagon
#

I guess I need a removeMagazineCargoGlobal as the clearMags will remove all mags stored rather than just one, of a specific class. As far as I can see that doesnt exist

#

unless I need to store all the magazines in the cargo in an array, edit that to remove one of the specific type, and add the edited array back in, but that seems extremely difficult and long winded

#

this will have problems with half empty mags though right?

#

I guess I can use addMagazineAmmoCargo, Do you think it is possible to store, manipulate, and then re-add an array containing each magazine class, number, and ammo count?

past gazelle
#

If I wanted to create a script to occasionally A. make sure all vehicles are locked and B. make sure all AI's backpacks are locked... would running it off init.sqf with a sleep timer be a sane way to do so?

#

Single Player mission

astral dawn
#

but it's better to do it like this:

0 spawn {
  while {true} do {
  sleep 1;
  ...  
};
};
past gazelle
#

Where? in init.sqf or an hpp file linked off it?

#

I guess WHERE is my main question...more than how..

astral dawn
#

well, I do not remember if the game waits till your init.sqf is done, anyway it's better to not block whole init.sqf just for your loop.

#

I suggest that you put the code above into init.sqf

#

init.sqf is not required to have any .hpp files attached to it

past gazelle
#

oh right, so SPAWN it from init.sqf, ok I think I understand.

astral dawn
#

yes

past gazelle
#

(not execute within)

little raptor
#

lockInventory has local effect, and takes global arg

#

so it must be in initPlayerLocal.sqf

#

setVehicleLock takes local arg, and has global effect

#

so it must be in initServer.sqf

astral dawn
#

yes but he said that he has a Single Player mission

past gazelle
#

I'll keep the multiplayer tips in mind. Appreciate it.

winter rose
#

hardly appreciated

๐Ÿคญ

austere hawk
#

could be a tongue breaker:
_object getvariable ["bis_fnc_objectside_side",side _object] inside bis_fnc_objectside

exotic tinsel
#

Is there a way to prevent AI Fighter Pilots from landing?

austere hawk
#

afaik they land if they are out of fuel, damaged, or out of weapons. So if you make sure those 3 things never happen, they wont land

manic sigil
#

I think he meant its a tongue twister in the guise of a script :p

#

Taking a poetic liberty like

austere hawk
somber radish
#

Roast me! (a good burn is a good teacher).

Tally_Fnc_DesignateInfType = {
params ["_Unit"];

        If ((typeOf _Unit IsEqualTo "B_T_Recon_Exp_F")         or
            (typeOf _Unit IsEqualTo "O_T_Recon_Exp_F")         or
            (typeOf _Unit IsEqualTo "I_C_Soldier_Para_8_F")) 
            exitWith {[_Unit] call Tally_Fnc_Operator_Equipment_Attributes};

        If ((typeOf _Unit IsEqualTo "B_soldier_LAT_F")         or
            (typeOf _Unit IsEqualTo "O_Soldier_LAT_F")         or
            (typeOf _Unit IsEqualTo "I_E_Soldier_LAT_F")) 
            exitWith {[_Unit] call Tally_Fnc_AT_Soldier_Equipment_Attributes};

        If ((typeOf _Unit IsEqualTo "B_Patrol_Soldier_MG_F") or
            (typeOf _Unit IsEqualTo "O_G_Soldier_AR_F")         or
            (typeOf _Unit IsEqualTo "I_G_Soldier_AR_F")) 
            exitWith {[_Unit] call Tally_Fnc_MachineGunner_Equipment_Attributes};

        If ((typeOf _Unit IsEqualTo "B_Sniper_F")             or
            (typeOf _Unit IsEqualTo "O_Sniper_F")             or
            (typeOf _Unit IsEqualTo "I_Sniper_F")) 
            exitWith {[_Unit] call Tally_Fnc_Sniper_Equipment_Attributes};

        If ((typeOf _Unit IsEqualTo "B_soldier_AA_F")         or
            (typeOf _Unit IsEqualTo "O_Soldier_AA_F")         or
            (typeOf _Unit IsEqualTo "I_Soldier_AA_F")) 
            exitWith {[_Unit] call Tally_Fnc_AA_Soldier_Equipment_Attributes};

        If ((typeOf _Unit IsEqualTo "B_Soldier_universal_F")         or
            (typeOf _Unit IsEqualTo "O_G_Soldier_universal_F")         or
            (typeOf _Unit IsEqualTo "I_G_Soldier_universal_F")) 
            exitWith {[_Unit] call Tally_Fnc_Soldier_Equipment_Attributes};
sleep 0.5;
hint "UnitType not specified";

};
willow hound
#

Use CfgFunctions instead of Tally_Fnc_DesignateInfType = { ... };.
The if-statements are a prime usecase for a switch:

switch (typeOf _unit) do {
  case "B_T_Recon_Exp_F";
  case "O_T_Recon_Exp_F";
  case "I_C_Soldier_Para_8_F": { [_unit] call Tally_Fnc_Operator_Equipment_Attributes; };
  case "B_soldier_LAT_F";
  case "O_Soldier_LAT_F";
  case "I_E_Soldier_LAT_F": { [_unit] call Tally_Fnc_AT_Soldier_Equipment_Attributes; };
  case "B_Patrol_Soldier_MG_F";
  ...
  default { ["Unexpected unit type (%1)", typeOf _unit] call BIS_fnc_error; };
};
crude vigil
somber radish
#

Is Switch faster than if ?

crude vigil
#

It is faster to write

#

for sure

willow hound
#

@little raptor would have something to say about that ๐Ÿ˜„

somber radish
#

lol

#

Thanks for the feedback btw!

distant oyster
somber radish
#

like that?

distant oyster
#

maybe some more additional info:

["UnitType (%1) not specified", typeOf _unit] call BIS_fnc_error;
``` this will show an error on the bottom of the screen and also log to rpt
somber radish
#

Oh, Nice!

#

how do I retrieve the rpt?

willow hound
#

!rpt

wicked roostBOT
#
Arma RPT

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

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

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

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

somber radish
#

Ooh so if is faster

#

nice good to know

#
_result = call {
    if (false) exitWith {};
    if (false) exitWith {};
    if (true)  exitWith {};
    if (false) exitWith {};
    if (false) exitWith {};
};                            // 0.0032 ms

_result = switch (true) do {
    case (false): {};
    case (false): {};
    case (true) : {};
    case (false): {};
    case (false): {};
};                            // 0.0047 ms
winter rose
#

don't forget that it is wrapped in a call, so exitWith only exits that scope ๐Ÿ˜‰

fair drum
#

its faster, but its so ugly. i use hashmaps now

winter rose
#

depends on what you want, too
using a hashmap for switch cases with value โ†’ code is dang ugly (but most likely more performant)

still forum
#

as usual, benchmark your code.

#

replacing a switch/case with like 2 or 3 values with a hashmap, might result in slower code

winter rose
#

and don't over optimise, too

#

readability > one-time performance

pulsar bluff
#

might he just wants to feel trendy

dreamy kestrel
# somber radish Roast me! (a good burn is a good teacher). ```sqf Tally_Fnc_DesignateInfType = {...

I dislike the term, but here goes. If you prefer the data driven approach...

params [
  ["_unit", objNull, [objNull]]
];

private _unitClass = typeOf _unit;

private _tallies = [
  [
    { _this in ["B_T_Recon_Exp_F", "O_T_Recon_Exp_F", "I_C_Soldier_Para_8_F"]; }
    , { _this call Tally_Fnc_Operator_Equipment_Attributes; }
  ]
  , [
    { _this in ["B_soldier_LAT_F", "O_Soldier_LAT_F", "I_E_Soldier_LAT_F"]; }
    , { _this call Tally_Fnc_AT_Soldier_Equipment_Attributes; }
  ]
  , [
    { _this in ["B_Patrol_Soldier_MG_F", "O_G_Soldier_AR_F", "I_G_Soldier_AR_F"]; }
    , { _this call Tally_Fnc_MachineGunner_Equipment_Attributes; }
  ]
];

private _selected= _tallies select { _unitClass call (_x#0); };

_selected params [
  ["_tally", [], [[]]]
];

_tally params [
  "_0"
  , ["_onTally", {}, [{}]]
];

[_unit] call _onTally;

Of course, if you wanted to invert the control a bit, you could have the functions return boolean on success/failure, and each of them do their own class name filtering internally.
Good luck!

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

private _onTallyAttribs = [
  { _this call Tally_Fnc_Operator_Equipment_Attributes; }
  , { _this call Tally_Fnc_AT_Soldier_Equipment_Attributes; }
  , { _this call Tally_Fnc_MachineGunner_Equipment_Attributes; }
];

private _talliedAttribs = _onTallyAttribs select { [_unit] call _x; };

_talliedAttribs params [
  ["_retval", false, [false]]
];

_retval;
real tartan
#

can I bother someone who have all DLC's to run this code for me? and send me output? thank you

private _allFaces = (configfile >> "CfgFaces" >> "Man_A3" ) call BIS_fnc_getCfgSubClasses;
{ diag_log format ["_face: %1", _x] } forEach _allFaces;

private _faceIdentityTypes = [];
{
    _faceIdentityType = getArray ( configfile >> "CfgFaces" >> "Man_A3" >> _x >> "identityTypes");
    { _faceIdentityTypes pushBackUnique _x; } forEach _faceIdentityType;
}
forEach _allFaces;
{ diag_log format ["_type: %1", _x]; } forEach _faceIdentityTypes;
lucid monolith
#

so i found this here piece of code that lets me turn any object into an ACRE2 rack radio, but would anyone happen to have enough knowledge about how ACRE works to make it have the speakers active immediately instead of me running to it and manually turning it on from the radios settings?

[variablename, ["ACRE_VRC103", "Upper Dash", "Dash", false, ["external"], [], "ACRE_PRC152", [], ["intercom_1"]], false, {}] call acre_api_fnc_addRackToVehicle;```
#

looking to use the system for loudspeakers in a zeus op, so it would be something of an inconvenience to have to run over to each one and turn the speakers on manually at mission start

#

oh, also having the radios tuned into something other than channel 1 would be neat, but i can just have people not use channel 1 if its not possible

hoary halo
#

is there any way to prevent AI teammates from drowning via scripting? They always seem to dive 500m deep before mounting a boat

somber radish
lucid monolith
unreal scroll
spark turret
#

lol yeah

hoary halo
hoary halo
wicked fulcrum
#

anyone knows how the circle for zeus firesupport is created so its only visible for zeus? I have tried using _obj = createSimpleObject ["\a3\Modules_F_Curator\Ordnance\surfaceMortar.p3d", _pos]; to create it. And it does correctly scale and show in the world, but it shows for everyone, also players. (makes sense as its global).

Haven't been able to figure out how the default firesupport modules use it to only show for zeus'.

unreal scroll
#

@wicked fulcrumcreatevehiclelocal?

wicked fulcrum
#

wait. I am being stupid. createSimpleObject has a local option as a third parameter

wicked fulcrum
lucid monolith
#

you could use !isNull (getAssignedCuratorLogic <unit>) to check whether the player is a zeus, and hide the object if theyre not

wicked fulcrum
#

I think the local instance on createSimpleObject which I missed will do what I need. Need to test with some players tomorrow.

That could also be an option, to do local hide for clients not zeus, but as the object is created by one (zeus) client, and then synced I am not sure how feasible that would be.

#

Thanks for the ideers! ๐Ÿ™‚

austere hawk
#

If i have a config path (aquired via BIS_fnc_turretConfig) , for example
_path= configFile >> "cfgVehicles" >> "SomeVehicleClass" >> "Turrets" >> "SomeTurretClass";
How do i get just the last "element" (so in this case "SomeTurretClass") as string? Is there a simple command for that, or do i have to convert that path to string and pluck it apart manually?

copper raven
#
private _hierarchy = configHierarchy _path;
configName (_hierarchy select count _hierarchy - 1)
austere hawk
#

thanks

copper raven
#

wait, isn't that just configName _path? XD

#

@austere hawk oops, sometimes i just think too far

austere hawk
#

๐Ÿ˜„ cheers. i cache the result anyway so it wouldnt have made a big deal... just didnt want to pluck apart the string <.<

pulsar bluff
#

anyone with experience scripting vectors?

#

Trying to script "wobble"

#

Player holding iPad in front of them , currently the model looks 2D because it is fixed

#

I want it to wobble slightly, to provide 3D depth

#

so some vectordir/vectorup/linearconversion stuff

exotic tinsel
#

Does the "Respawn" eventhandler get removed on unit Killed?

copper raven
#

no

slate cypress
#

Is there a more efficient method of only allowing admins to enter 3rd person view other than waiting for the player to switch cam and then switch it back for them?

exotic tinsel
exotic tinsel
# copper raven no

would you happen to have alink to a list of what does and does not get removed on killed?

copper raven
#

nope

#

but the majority is persistent

exotic tinsel
#

cool thanks.

ocean orchid
#

Is there a way for me to get the init of an object that a mission maker set in 3den but during the scenario?

quartz coyote
#

Which is best for the network:

  • Client setting a public variable?
  • Client doing a remoteExec to the Server only?
    Logic would tell me it's the remoteExec but I've learned to be careful with how Arma 3 actually works ๐Ÿ˜„
winter rose
#

but usually remoteExec, if you can avoid publicVariable*

quartz coyote
#

Ah ! That suits my need ! Thanks

#

Ah no it doesn't actually

#

because I want to use player setVariable ...

quartz coyote
winter rose
#

๐Ÿ˜„ ok

cosmic lichen
#

Best for network is it to not use it meowtrash

quartz coyote
#

Related question:
I'm trying to _x getVariable "lastLoadout"; on my server.
To publish each players loadout to the Server only would this work ?
player setVariable ["lastLoadout", getUnitLoadout player]; publicVariableServer "lastLoadout"

cosmic lichen
#

setServerVariable function

winter rose
#

but you can add a true] to it, too

cosmic lichen
#

If server only, then this probably

winter rose
#

true dat

quartz coyote
#

Ah nice !

cosmic lichen
#

OH WAIT

#

setVariable works as well

winter rose
#

2

#

forgot about that ๐Ÿ˜„

cosmic lichen
#

ME TOO xD

#

I was like: "There should be a sqf command for that"

winter rose
#
player setVariable ["lastLoadout", getUnitLoadout player, 2]; // server only
cosmic lichen
#

Might be worth a note @lou?

winter rose
#

also, "FLASH_lastLoadout" ๐Ÿ‘€ prefix your vars ๐Ÿ˜‰

winter rose
quartz coyote
winter rose
#

I mean, there is no real security risk ๐Ÿ˜ฌ

cosmic lichen
#

If I can create a variable with any prefix

#

Then something is wrong anyhow

quartz coyote
#

Number - The variable is set only on the client of given owner (clientOwner) id, or if id is negative, the variable is set on every client except the given one
Ok so 2 is the client ID of the Server right ?

cosmic lichen
#

0, isn't it?

winter rose
#

0 is everyone

cosmic lichen
#

No wait

winter rose
#

2 is server

cosmic lichen
#

yeah right.

winter rose
#

@cosmic lichen here โ˜• ๐Ÿ˜„

#

I'm all for the mission maker to be able to name his variables as he wants, but not for mods or framework makers ofc

cosmic lichen
#

I am not doing that much mp stuff, pardon me =/

winter rose
#

make Eden Editor MP then :p

quartz coyote
#

ok cool, that was actually my first idea but I got really confused about the description. Can you guys improve the description or add an other example to the wiki ?

cosmic lichen
winter rose
#

unfortunately ๐Ÿ˜”

#

meh, it's too late in A3 lifetime now. let us use it just the two of us โค๏ธ

cosmic lichen
#

Sure!

tough abyss
#

Hi, Today i was in a zeus game where there were functional base stuff, like, A person with a full arsenal and a vehicle spawner, and a ''Pylon editior'', i was wondering if someone got these scripts?

cosmic lichen
#

Could be the Zeus Enhanced mod, not sure

tough abyss
#

it was vanilla

winter rose
#

GOM pylon script I believe

tough abyss
#

Any idea the script?

winter rose
#

nope

#

check mission's credits

quartz coyote
#

In ARGO there is a command called clearKillConfirmations that will delete all kill feed messages.
Is there anything that would do the same thing in Arma 3 ? hand made maybe ?

still forum
#

there is no way to remove chat messages after they are shown

winter rose
#

clearRadio ๐Ÿ˜

#

hue hue
(but you can show them again with / and page up iirc)

still forum
#

you could use the chat message eventhandler and build your own

cosmic lichen
#

argo has its own commands notlikemeow

still forum
#

wuht? clearRadio clears the chat?

#

what kinda name is that ๐Ÿ˜„

cosmic lichen
#

yes

winter rose
#

like clear history

winter rose
cosmic lichen
#

I see work incoming

winter rose
#

well, humโ€ฆ since it's dead, we may, y'knowโ€ฆ dust it under the carpet? ๐Ÿ˜„

cosmic lichen
#

Yeah, let's not start with putting that on the biki

#

It going to be a rabbit hole

winter rose
#

one day when we have nothing more to do ๐Ÿ‘ผ

cosmic lichen
#

โšฐ๏ธ

quartz coyote
worn elm
#

Hi looking for a simple line that will teleport a player into any position of a vehicle. I understand how to do it via a trigger but I'm trying to do it via a flag pole or any other object. I know the 2 elements I need but a bit unsure how to combine them.

this addAction ["Teleport", {player setPos (getPos boat)}];

player moveInAny boat;

#

nvm figured it out

past gazelle
#

"I'll just...." 3 hours later

glossy pine
#

why with lbSetText the text of the list doesn't get updated and with lbSetTextRight it gets updated?

austere hawk
austere hawk
#

for something that feels more like actual "shocks" you could do some function blending. Take a damped oscillation https://en.wikipedia.org/wiki/Damping#Damped_sine_wave
as starting point. But then to make it look less jerky (the jump fom t= -0.00001 to t=0 will look bad). Instead you might rather want something like this: (shitty drawing)
for a smoother transition between "unshocked state" and "shock start"

Damping is an influence within or upon an oscillatory system that has the effect of reducing or preventing its oscillation. In physical systems, damping is produced by processes that dissipate the energy stored in the oscillation. Examples include viscous drag (a liquid's viscosity can hinder an oscillatory system, causing it to slow down) in me...

thorny gull
#

hello, i am having some troubles with a teleport script

jade acorn
#

hey, I'm trying to make a cutscene where player sits in the drivers seat, but it's steered automatically, so he can just watch what's happening, but I have no idea how to make the vehicle drive with player in it. Is it even possible? I thought about using keyframes but to me it seems like definitely too much work for a cutscene so short. Maybe creating a camera directly in the head of the player, but I'm worried about 3D sound bugs because of the truck moving and camera not exactly being "in" the car in terms of Arma physics.

#

any suggestions besides simply recording everything and implementing as a video?

thorny gull
#

but even punching in the coordinates for a person standing there, on the platform will cause the player to teleport way into the air

#

i think its an issue with the water, does anyone know how to fix it?

crude vigil
jade acorn
crude vigil
jade acorn
#

okay, and how about making the vehicle drive other way than through waypoints? I'd like to make it not stop on every waypoint, so will UnitCapture/UnitPlay work in this case?

thorny gull
#

can anyone help me with my teleportation problem?

robust tiger
thorny gull
#

ah ok

crude vigil
# jade acorn okay, and how about making the vehicle drive other way than through waypoints? I...

If you are willing to record it, that is a solution but vanilla one does not save animations(and imo unitCapture feels quite cheap because it is a "recorded player movement"). Alternatively you can use setDrivePath if you do not want to bother with recording the path(It gives quite a good amount of ability no matter onroad/offroad, I usually tend to be happy with the outcomes of it). If you do not want to bother with anything, I suggest setting waypoints at the middle of one way roads (this way they do not slow down while calculating next waypoint pathing, most people tend to put waypoints at intersections which driver ai ofc wants to slow down specifically)

wide prairie
#

How would I go about getting the muzzle position of a units weapon? Tried using

(player selectionPosition ["Konec hlavne", "Memory"])

But it returns [0, 0, 0]. The player is a vanilla ammo bearer holding a MX rifle if that helps.

spark turret
#

there is weaponPos iirc? look up eyePos, see if theres one for weapons too

wide prairie
#

I did a quick googled and didn't find an answer other than one or two forum posts where the author was recommended to use selectionPosition. Even believe one of the forum posts was from like 2010 or 2011

jade acorn
crude vigil
wide prairie
#

I have an alternative which is just having a Fired EH where I get the position of the projectile. Not great but it get's the job done for what I am doing. Just wished there was a better solution.

crude vigil
crude vigil
wide prairie
frosty cairn
#

How do I make a script select a group who was just spawned in with a function without giving them a variable name?

willow hound
#

@frosty cairn What function? BIS_fnc_spawnGroup?

frosty cairn
#

Mmhm @willow hound

#

Sorry, should have specified, am tired.

willow hound
frosty cairn
#

How do make it use the return value?

#

Uhm, okay, I'll show you what I got here, it'll be easier to understand I think.

#
for "_i" from 1 to _randomLimit do {
//Bis_fnc_sqawn here
//select the group somehow here
//addWaypoint here
};
little raptor
willow hound
#

Ah, very simple:

for "_i" from 1 to _randomLimit do {
  private _group = [...] call BIS_fnc_spawnGroup;
  _group addWaypoint [...];
};
frosty cairn
#

Wouldn't it throw out a error saying that the "_group" already exists and stop?

little raptor
#

plus it's not like eden

frosty cairn
#

I see.

willow hound
#

Variables can be reassigned and overwritten.

little raptor
#

even if it was a global variable it'd just overwrite it

frosty cairn
#

Out of curiosity, what does the "private" actually do?

#

I have seen it used a bunch, but never really understood what it does.

little raptor
#

to give you a short version:
local variable = variable that is only visible to the current script
private variable = variable that is only visible to the current scope

frosty cairn
#

Ah, okay, understood.

little raptor
#

so every private variable is a local variable

but not the other way around

little raptor
frosty cairn
#

Well, uhm...

#

Well, I guess I might not know what a scope is.

little raptor
frosty cairn
#

I assumed as much.

little raptor
#

it's not technically correct tho

#

even a script you write is "wrapped in {}"

#

but you don't see it

frosty cairn
#

as in its confined to it's .sqf or...?

copper raven
frosty cairn
#

so uhm, a question
is
_smth = here code
the same as
private smth = here code
?

copper raven
#

no its not the same

little raptor
#

also the second one is just wrong

#

_smth is a local variable

#

private _smth is a private variable

copper raven
#

they technically act the same way(if not defined at all), but the first assignment can be a lot slower(if it is defined in upper scopes)

little raptor
#

well let's not focus on "slower" just yet...

#

(also it's not that much slower; depends on scope depth)

copper raven
#

free perf you're losing though ๐Ÿ˜„ like i said, if you can use private, just use it

little raptor
#

@frosty cairn
I guess this example will clear it up:

_x = 1;
if (alive player) then {
  _x = 2
};
_x //_x is 2

vs:

_x = 1;
if (alive player) then {
  private _x = 2
};
_x //_x is 1
frosty cairn
#

Ah, okay.

copper raven
#

that's almost identical to what i linked too

frosty cairn
#

{
private _x = 2
};
so in those brackets, will _x be 2?

little raptor
frosty cairn
#

Yeah, okay, now I get it.

willow hound
#

Unless you get unlucky and happen to stumble into a situation where it does actually matter, scopes beyond global and local are not really all that important, you can go a long way (and then some) without them ๐Ÿ™‚

little raptor
# frosty cairn Yeah, okay, now I get it.

anyway, the rule of thumb for beginners is: always use private, unless you have a reason not to (e.g. the first example where I wanted _x to actually change, i.e become 2 if player is alive)

frosty cairn
#

In the brackets, that is.

little raptor
#

if you mean:

private _x = 1;
if (alive player) then {
  _x = 2
};
_x //_x is 2

then no. _x is 2

#

the _x in the brackets is the same _x

frosty cairn
#

And it will return 2, because it's not a private variable?

little raptor
#

the _x in the brackets is the same _x

frosty cairn
#

_x, that is.

#

Right, okay.

#

I think I get it now.

#

Thanks a lot @little raptor @willow hound @copper raven .

brazen lagoon
#

kind of a silly idea

#

how hard would it be to show a PiP screen on the respawn screen?

#

or, hell. how hard would it be to pop open the arsenal and let a player edit their loadout in that before spawning in

#

i guess I do kind of want to avoid combat barbie with this mission

#

so i might just not have an arsenal normally

fair drum
#

also, for coop missions, it really is best to use premade loadouts to stop barbie

brazen lagoon
#

yeah that's probably the best way to do it

#

i was hoping to allow them to do it in the respawn menu

#

but that might not be easily possible

fair drum
#

or what you do is make the first objective time sensitive, so they can just straight up lose if they barbie too long

#

and no, you can't do it in the respawn menu unless you create your own respawn menu (which you can, then you create a respawn template using onPlayerKilled and onPlayerRespawn)

outer fjord
#

What is the most MP friendly way to move a simple object from 1 point to another via transition? Like basically fake it's moving.

real tartan
#

can you walk in Blackfish or Xi'an ? Want to use them as stationary vehicles to jump from ... possible ?

warm hedge
#

No

sage dawn
#

is there any way to eject a dead body from a destroyed vehicle? it seems like when a unit becomes a dead body and when a vehicle becomes destroyed, there's not a whole lot you can do with either and they don't behave like normal objects

warm hedge
#

Doesn't moveOut do the job?

sage dawn
#

I tried it with a player body, didn't work

#

it seems to sometimes work with ai bodies

warm hedge
#

How about setPos solution?

sage dawn
#

setPos on the body?

warm hedge
#

Yes, I believe setPos on a soldier makes him get out from the vehicle, so worth a try IMO

little raptor
sage dawn
#

I'm pretty setPos does not force someone out of a vehicle

#

oh it was?

#

cool

little raptor
#

Not out yet tho

warm hedge
#

2.06?

little raptor
#

Yeah

warm hedge
#

Mhm

sage dawn
#

is it in the dev branch?

little raptor
#

Not sure. Check the changelog on the forums.
You can use deleteVehicleCrew

#

Or is it also not released yet?

sage dawn
#

I don't want to delete the body, I want to get them outside of the vehicle

#

I need the body to still be present

little raptor
sage dawn
#

to do what?

little raptor
#

threw the body out as soon as it is dead

sage dawn
#

but how?

little raptor
#

moveOut

sage dawn
#

moveOut on a player body doesn't seem to work

little raptor
#

maybe it will if you do it as soon as it's dead

sage dawn
#

I did try it with a killed EH but it didn't work

little raptor
#

ok notlikemeow

sage dawn
#

but also it is kind of a special case here, I'm doing it to a body after that player has technically already respawned

#

which might throw a wrench in that

little raptor
#

Well then technically it's not the player anymore

#

Anyway, I'll check dev branch later.

#

You can also check the wiki

#

It says the version with which the new command was released

#

(it's a new syntax: unit moveOut vehicle)

sage dawn
#

oh yeah there is a new syntax

#

I didn't notice that

#

2.05.147802 is the current version isn't it?

#

I will try it with the new syntax

#

or I guess 2.05 is not the current one

#

I'll try it on dev branch then

little raptor
#

Yeah

#

It's not out yet

#

It's in 147819

#

current is 147802

#

So it'll be available in the next dev branch update

sage dawn
#

I'll try it when it's out then

little raptor
#

@sage dawn what if you used switchMove?

#

Like this:

_body switchMove "amovpercmstpsraswrfldnon";
_body playMoveNow "amovpercmrunsraswrfldf"
#

(I typed this on phone, so there might be errors)

cosmic lichen
#

You did what? notlikemeow

little raptor
#

I know the animation names, if that's what you mean! ๐Ÿ˜›

cosmic lichen
ripe sapphire
#

yo bros init.sqf doesnt fire for JIP players right ?

#

only for everyone present at the briefing screen?

cosmic lichen
#

it does

ripe sapphire
#

it says Executed when mission is started (before briefing screen)

cosmic lichen
#

sorry

#

Didn't have my coffee yet

#

WAIT

#

Stop confusing me

ripe sapphire
cosmic lichen
#

Don't look at single player

ripe sapphire
#

hmm i see

#

so to make a script run only for player present at start of the game, i will have to remoteExec script from initserver.sqf right?

cosmic lichen
#

Let me check

#

no leo ๐Ÿ˜„

cosmic lichen
#

It has a parameter that tells you if a player JIPed or not

little raptor
cosmic lichen
#

I think they said we should post in discord server channel

little raptor
#

yeah I forgot meowsweats

ripe sapphire
#

wouldnt it be easier to just remoteExec from initserver?

cosmic lichen
#

no

#

perhaps easier, but worse in regards of performance

ripe sapphire
#

i c i c

#

so

if (isNil _didJIP) then { execVM "intro.sqf" };
#

something like that?

cosmic lichen
#
if (_didJIP) exitWith {};
#

_didJIP is true or false. Just exit the script if it's true.

ripe sapphire
#

ah ok got it

#

another thing, you know how once the game starts after the briefing screen, players load into the game at different times, how do i hold a script execution until every player has loaded in and ready to play?

#

cause some missions in the workshop was able to achieve that (at start of game theres a hint saying waiting for players..)

cosmic lichen
#

But I've never done something like this so I can't help you really

ripe sapphire
#

ok i'll try to experiment, thanks for your help!

drifting portal
#

Is there a way to get the classname of the explosion of civilian zamak fuel?
Maybe its possible through the means of an eventhandler? But which one?
(It has a long burning fire ball effect thats why I want it)

quartz coyote
#

Hello all
Do you guys know if the behaviours that are disabled with the disableAI command are re-enabled when a player respawns?
For example, I want to use player disableAI "CHECKVISIBLE" but don't know if I only need to do it once in the player init or on each respawn.

quartz coyote
tough abyss
#

Anyone ever mess with setting up custom loot boxes to request via the warlord request menu? I want to setup various weapon packs to give my players "upgrades" they can buy using the CP system.

Also, how can I script out the parachute spawn of an item in the warlord request? I dont want my aircraft to drop from the sky but rather appear in front of the player, or at a predefined location, such as an airstrip.

#

next question

Does anyone have a good configurable NPC vendor and/or loot script I can use? Something I can setup the specifics but the mechanics are already done. I've found some stuff bit alot points to dead armaholic links...

drifting portal
#

is there a way to play this effect using a command?

 explosionEffect = "FuelExplosion";

I used ```sqf
_source01 = "#particlesource" createVehicleLocal getPos amongus;
_source01 setParticleClass "FuelExplosion";

#

but it didn't work

little raptor
drifting portal
#

I just need to make it appear

#

is too confusing for me lol

#

this?

little raptor
drifting portal
#

thanks

digital vine
#

Hey guys, trying to get a custom zeus module to work, so far I have the following cpp file

#define _ARMA_

class CfgPatches
{
    class Demsoft6MD_ModuleResupply2
    {
        units[] = {"Demsoft6MD_ModuleResupply2"};
        requiredVersion = 1.0;
        requiredAddons[] = {"A3_Modules_F"};
    };
};

class CfgFactionClasses
{
    class Supports;
    class Demsoft6MD_Supply: Supports
    {
        displayName = "Resupply (Air Drop)";
    };
};


class CfgVehicles {

    class Logic;
    class Module_F : Logic {

        class ArgumentsBaseUnits {
            class Default;
            class Edit;                    // Default edit box (i.e., text input field)
            class Combo;                // Default combo box (i.e., drop-down menu)
            class Checkbox;                // Default checkbox (returned value is Boolean)
            class CheckboxNumber;        // Default checkbox (returned value is Number)
            class ModuleDescription;    // Module description
            class Units;                // Selection of units on which the module is applied
        };

        class ModuleDescription {
            class AnyPlayer;
            class AnyBrain;
            class EmptyDetector;
        };
    };

    class Demsoft6MD_ModuleResupply2 : Module_F
    {
        mapSize = 1;
        author = "Demsoft";
        vehicleClass = "Modules";
        category = "Supports";
        side = 7;

        scope = 2;                // Editor visibility; 2 will show it in the menu, 1 will hide it.
        scopeCurator = 2;        // Curator visibility; 2 will show it in the menu, 1 will hide it.

        displayName = "Resupply (Air Drop)";    // Name displayed in the menu
        icon = "";                // Map icon. Delete this entry to use the default icon
        picture = "";
        portrait = "";

        function = "moduleResupply2";            // Name of function triggered once conditions are met๏ปฟ
        functionPriority = 1;    // Execution priority, modules with lower number are executed first. 0 is used when the attribute is undefined
        isGlobal = 2;            // 0 for server only execution, 1 for remote execution on all clients upon mission start, 2 for persistent execution
        isTriggerActivated = 0;    // 1 for module waiting until all synced triggers are activated
        isDisposable = 0;        // 1 if modules is to be disabled once it's activated (i.e., repeated trigger activation won't work)
        curatorInfoType = "RscDisplayAttributeModuleResupply2";    // Menu displayed when the module is placed or double-clicked on by Zeus

        class ArgumentsBaseUnits : ArgumentsBaseUnits {
            class Units : Units
            {
                property = "Demsoft6MD_ModuleResupply2_Units";
            };
        };
        class ModuleDescription : ModuleDescription
        {
            description = "Resupply (Air Drop)";
            sync[] = {};
        };
    };
};

class CfgFunctions
{
    class Demsoft6MD
    {
        class Supports
        {
            file = "Demsoft6MD_ModuleResupply2\functions\fn_moduleResupply2.sqf";
            class moduleResupply2{};
        };
            };
};
class cfgMods
{
    author = "Demsoft";
};
#

Trying to execute the following

if (isServer) then 
{
    params [["_position", [0,0,0],[[]],3],["_attachedObject", objNull, [objNull]]];
    _position = _this select 0;
    _h = _position param [2,0];
    _h = _h + 75;
    _position set [2, _h];
    _box = "B_CargoNet_01_ammo_F" createVehicle [0,0,0];
    _box setPosATL _position; 

    parachute_1 = "B_parachute_02_f" createVehicle [0,0,0];
    parachute_1 setPosASL (getPosASL _box);
    _box attachTo [parachute_1, [0,0,0]];

    clearItemCargoGlobal _box;
    clearWeaponCargoGlobal _box;
    clearMagazineCargoGlobal _box;

    {
    //Current Result is saved in variable _x
    _box addMagazineCargoGlobal [primaryWeaponMagazine _x select 0, 5]; 
    } forEach allPlayers;

    _smoke = "SmokeShellRed" createVehicle [0,0,0];
    _smoke attachTo [_box, [0,0,0]];
}

It shows in the Zeus Menu, but does not execute the Script, help? ๐Ÿ™‚

little raptor
#

Also did you check to make sure the function is defined properly?

#

@digital vine oh wait, your function name is incorrect

digital vine
cosmic lichen
#

function = "moduleResupply2";
Pretty sure it needs to be TAG_fnc_moduleResupply2

#

Basically the name that is displayed in the Functions Viewer

#

function = "myTag_fnc_moduleNuke";

#

Yeah, it even says so in the example.

#

Also don't name your parachute parachute_1

little raptor
#

You might wanna choose a shorter tag. DemsoftM6D? meowsweats

cosmic lichen
#

It's a module, TAG your variables

digital vine
#

R3vo and/or Leopard20 would you be available to teach me your wisdom in a quick vc?

little raptor
#

I'm on mobile so I can't

cosmic lichen
#

Just ask what you need to know. Might be interesting for others too

digital vine
#

Ok, so starting with the 100% basic for it to be called TAG_fnc_moduleResupply2 what must I do?

#

Sort got pushed into the deepend with a lot of this stuff, so a lot of the basic stuff went straight over my head im afraid

cosmic lichen
#

After that you should know what functions are and how to create them.

digital vine
#

Thank you

#

Might have more Q's shortly

#

Right so if I did the following

class CfgFunctions
{
    class Demsoft6MD
    {
        class Whatever
        {
            class moduleResupply2 {file = "whatever.sqf";};
        };
    };
};

It should return Demsoft6MD_fnc_moduleResupply2?

#

which I can then call? with just a call command

little raptor
#

Yes

#

Pick a shorter tag if you can meowsweats

digital vine
#

So to save my given example, if I was to change

class CfgFunctions
{
    class TAG
    {
        class Supports
        {
            file = "Demsoft6MD_ModuleResupply2\functions\fn_moduleResupply2.sqf";
            class moduleResupply2{};
        };
            };
};



to


class CfgFunctions
{
    class TAG
    {
        class moduleResupply2
        {
            file = "Demsoft6MD_ModuleResupply2\functions\fn_moduleResupply2.sqf";
                    };
            };
};

It should work (if the scripting gods are on my side)?

little raptor
#

when did we even talk about this?

digital vine
#

To return as TAG_fnc_moduleResupply2

#

?

little raptor
#

you shouldn't use TAG

#

and you also need a category

digital vine
#

Then in function I define the function used?

digital vine
digital vine
little raptor
#

still

class CfgFunctions
{
    class TAG
    {
        class moduleResupply2
``` this is incorrect
little raptor
digital vine
little raptor
digital vine
#

thank you, think I have it now, just going to try it out

#

riiiight, to continue to be a burden, I am having the following error display on game start-up "Script Demsoft6MD_ModuleResupply2\functions\fn_moduleResupply2.sqf" Not found

#

My pathing looks correct and I have also corrected the CfGFunctions to

class CfgFunctions
{
    class Demsoft6MD
    {
        class Supports
        {
            file = "Demsoft6MD_ModuleResupply2\functions";
            class moduleResupply2{};
        };
            };
};
digital vine
#

Demsoft6MD_ModuleResupply2.pbo

little raptor
digital vine
#

Affirm

little raptor
#

what do you use to pack the pbo?

digital vine
#

and the sqf inside is fn_moduleResupply2.sqf

#

Addon Builder

little raptor
#

set it to Demsoft6MD_ModuleResupply2

digital vine
#

as in the pbo file name?

little raptor
digital vine
#

done

little raptor
digital vine
little raptor
#

@digital vine it's empty

#

you must specify what files to include

#
*.p3d;*.paa;*.sqf;*.fxy;*.xml;*.bisurf;*.rvmat;*.h
digital vine
#

hmm... I haven't touched that setting and have done things in the past, let me re-adjust :/

digital vine
little raptor
digital vine
#

the error it is throwing is that it is expecting an object, rather than array

little raptor
little raptor
#

I'm not sure where you got it from

digital vine
digital vine
dreamy kestrel
#

Q: re: bitwise... what are BIS_fnc_encodeFlags and BIS_fnc_decodeFlags actually doing? I'm not sure I see the pattern there...

little raptor
robust tiger
#

So I have a funny code that gives me an error in the debug console even if I wrap it in a function. It's a check if all array elements are duplicates. It works if there are all duplicates. If there is a separate value, it does not return anything, and when I put the return value there at the end of the exitWith, it gives an error.

private _arr = [1,1,1,2]; 
private _i = 0; 
private _start = _arr select 0; 
private _return = true; 
for[{_i = 0},{_i<count _arr},{_i=_i+1}]do 
{ 
 if((_arr select _i)!=_start)exitWith 
 { 
  _return = false; 
  _return; // <-- without this: no value is returned; with: gives an error
 }; 
};
_return;

The error:

19:24:19 Error in expression <oleExpressionResultCtrl",   
   controlNull]) ctrlSetText str ([nil] apply {[] call (_>
19:24:19   Error position: <ctrlSetText str ([nil] apply {[] call (_>
19:24:19   Error ctrlsettext: Type Bool, expected Control
19:24:19 File A3\functions_f\Debug\fn_debugConsoleExec.sqf..., line 25

It seems to break out to the debug console function (?). It works fine if I just use if(...)then{break} or foreach instead of a for-loop. To my knowledge, the exitWith should escape the for's scope, right? I have already verified the integrity of files and I'm only running vanilla.

dreamy kestrel
#

here's my use case, I can get an array of what is bits that are set using BIS_fnc_bitflagsToArray. what I could really use is a reverse operation.

little raptor
cosmic lichen
#

What about arrayIntersect to check for duplicates

little raptor
robust tiger
cosmic lichen
#

Ok

little raptor
dreamy kestrel
#

ok I think I see, thank you

robust tiger
little raptor
#

I said change the for

#

there are two versions of for

#

you're using the "stupid" one

#
for "_i" from 0 to count _arr - 1 do 
#

that should do it

robust tiger
little raptor
#

the wiki already tells you not to use that one meowsweats

robust tiger
#

where?

little raptor
#

it will soon โ„ข๏ธ

ripe sapphire
#

Yo bros if i want to execute a script if a certain condition is false instead of true then this is how to do it right:

If (condition) then {} else {execVM โ€œscript.sqfโ€};
pliant stream
#

if !(condition) then { ... };

robust tiger
ripe sapphire
#

Thanks

wide fulcrum
#

Hey, im trying to script a group of AI to run as a platoon in a square route [theyre in PT Uniforms and its supposed to be a "Platoon Run"] i cant figure out how to get the run animation to play while they move and get them to not just either stand there stupid or immediately try to move into formation before running to the waypoints, i dont usually script and im really pulling my hair out

#

also is there a better place to learn scripting than the bohemia wiki because its kind of useless even for someone familiar with code like me

crude vigil
wide fulcrum
#

its just not working, ive only ever scripted arma via the simple anims fnc and like i defined the entire Composition as a variable then fed said variable to the fnc which is activated via a player present trigger but it still wont work idk whats wrong with it at all

tough abyss
#

Does anyone have access to the script that goes through all openabe doors in a mission and locks/unlocks them?

crude vigil
astral dawn
wide fulcrum
#

i cant find a similar code to make a group of units run in formation

#

[myUnit, [getMarkerPos "wp1", getMarkerPos "wp2", getMarkerPos "wp3"]] call BIS_fnc_scriptedMove;
is the script im trying to use

#

instead of myunit i have the groups variable

crude vigil
#

if it is a groups variable, then you are clearly using wrong type of data for that as the unit has to be an object and not a group.

#

hence it is not working

wide fulcrum
#

so i need to have each man defined as a variable? and list all the variables for the script

#

you define the individual soldiers as objects right? for armas purposes?

crude vigil
#

yes, individual soldiers are each an object.

#

But you said you want to move a platoon (multiple groups in a formation) right?

wide fulcrum
#

its one big unit just bc its AI i didnt break it into squads or anything

crude vigil
#

one big unit? So it is just one group?

wide fulcrum
#

yep

#

all alpha 1-1

crude vigil
#

then you shouldnt need a function at all. By default, groups always walk in formations unless explicitly separated, or in combat mode.

wide fulcrum
#

yeah but there isnt a "cube" formation with the one guy on the outside just combat formations

crude vigil
#

(even in combat, by default , they tend to hold formation)

#

So you want a different formation from provided?

wide fulcrum
#

yeah

#

im sorry i sound like an idiot lmao

#

ive never touched arma scripts before

crude vigil
#

nope, you want something, you just gotta work for it

astral dawn
#

you can't create custom formations by script as I know

crude vigil
#

well, you can of course keep spamming orders to units to maintain formation but yeah it would be really painful haha

wide fulcrum
#

can i stream my screen in a chat for you or something? i have like 50 bohiwiki tabs open and 5 youtube videos and nothing is working

#

all the videos only show how to use like standing anims

crude vigil
#

you would basically get a group leader's location and continuously doMove each soldier of the formation relative to leader's position.

wide fulcrum
#

but does domove work for a running anim>

#

i thought it just makes them play the anim in place

#

so theyd be jogging in one spot

crude vigil
#

doMove is a command to order a unit to move, animation is unrelated

wide fulcrum
#

ok, let me try that, thanks for the help.

crude vigil
# wide fulcrum ok, let me try that, thanks for the help.

No worries, but I wouldnt say making such custom formation would be worth the pain. But in case you want to do it:
You would first get leader position,
get relative positions for each unit from leader position, then order each unit of the group to these said locations, and you would need to do this constantly for each unit. (then you would also need to tell them to stop cos otherwise they ll try to return to formation etc)
https://community.bistudio.com/wiki/doMove
https://community.bistudio.com/wiki/doStop
https://community.bistudio.com/wiki/worldToModel
https://community.bistudio.com/wiki/modelToWorld
https://community.bistudio.com/wiki/while
https://community.bistudio.com/wiki/forEach
https://community.bistudio.com/wiki/units
should get you started ^^"
Or

You can create a custom formation but that would require modding and I believe you want to do this for a mission so it is a no go without creating a mod.

ripe sapphire
jade acorn
#

question regarding triggers - is there any difference between:
a) Activation: Any player present
and
b) Activation: BLUFOR present with Condition: player in thisList?

Because I get the same output and I'm not sure if it means these are the same things with different approach or one is more "optimized" than another

#

I mean any other difference than the one activating for any player and the second one only for blufor player

unreal scroll
#

I'm looking for an effect of plane crash - it should looks like a smoke pillar with a large fireball.
Wasn't able to find anything similar even on fuel trucks.
Does anybody know such effects?

digital vine
# little raptor you're doing this: ```sqf params [["_position", [0,0,0],[[]],3],["_attachedObjec...

Hi, me again, been tearing my hair out wrt, went away did lots of learning and still none-the-wiser.

This is what I've settles on so far

if (isServer) then  
{ 
    params [["_position", [0,0,0]],["_attachedObject", objNull]]; 
    _position = _this select 0; 
    _h = _position param [2,0]; 
    _height = _h + 75; 
    _position set [2, "_height"]; 
    _box = "B_CargoNet_01_ammo_F" createVehicle [0,0,0]; 
    _box setPosATL _position;  
 
    parachute_1 = "B_parachute_02_f" createVehicle [0,0,0]; 
    parachute_1 setPosASL (getPosASL _box); 
    _box attachTo [parachute_1, [0,0,0]]; 
 
    clearItemCargoGlobal _box; 
    clearWeaponCargoGlobal _box; 
    clearMagazineCargoGlobal _box; 
 
    { 
    _box addMagazineCargoGlobal [primaryWeaponMagazine _x select 0, 5];  
    } forEach allPlayers; 
 
    _smoke = "SmokeShellRed" createVehicle [0,0,0]; 
    _smoke attachTo [_box, [0,0,0]]; 
}

But still returns an error with regards to line 7. How would one correctly work this?

little raptor
#

I think if you look at some vanilla modules you'll see

#

I don't remember off the top of my head

#

but the first param is obviously the module object itself

#

don't remember the rest

#

e.g.:

params ["_module", ........];
#

you might be able to find info on this on the wiki

digital vine
little raptor
unreal scroll
#

@digital vine Thanks. It is not a problem for me to add a fuel vehicle add use it's effects. The problem is the effect itself, it doesn't look like a fuel explosion at all ๐Ÿ™‚ So I'm looking for something more adequate. It should be up to 10 meters tall, I think.

digital vine
brazen lagoon
#

Any suggestions for placing 3D markers?

#

kind of want something like battlefield objective markers

little raptor
brazen lagoon
#

gotcha. I assume drawIcon3D means I'd have to do it all myself?

little raptor
brazen lagoon
#

right but with the one on frame eventhandler

#

I might just do it with tasks, and only show the nearest few objectives

#

oh, tasks are global

#

is it possible to change some of these attributes locally?

#

I suppose you could just assign the tasks to specific players

little raptor
brazen lagoon
#

@little raptor i wanted to only show 3D markers to players if they were within a km of the marker

little raptor
#

idk I think that's a difficulty settings?

#

but you can't set the visible distance. it just shows for some time and then hides meowsweats

#

if you want to fully customize it you might want to use drawIcon3D then

brazen lagoon
#

@little raptor oh ok. yeah I might just place down text on the map for right now and then use drawIcon3D later

brazen lagoon
#

is there any way to place just text on the map?

#

not a marker, just text

wide fulcrum
#

dumb question, i cant save my file as a .ext, what kind of file does .ext stand for? does notepad++ not support it?

#

@brazen lagoon Use a show/hide module synced to a trigger that hides all objects in the trigger zone

#

and then a second that shows it when they get within a km

warm hedge
#

description.ext aka config uses an exclusive language. You can use some like language highlighter like cpp

wide fulcrum
#

is cpp something i need to download?

warm hedge
#

Npp had builtin cpp (aka c++) highlighter

wide fulcrum
#

does the armatools cfgconvert tool work?

warm hedge
#

?

wide fulcrum
#

the arma 3 tools window

#

it has a tool called cfgconvert

#

im just trying to get a description.ext file to actually read so i can import a sound for a mission

warm hedge
#

I think I get what you mean. Description.ext doesn't require to convert/binarize/anything to run but just a text file with custom file extension

quaint oyster
#

When a while {} do {}; is launched within a [] spawn { }; on a specific unit, does that while loop delete when the player no longer exists?

wide fulcrum
#

so just name the file .ext?

warm hedge
#

Description.txt to Description.ext, yes

wide fulcrum
#

ok then i messed up somewhere else

#

because it says "cannot find (soundname)" when i hit the trigger

warm hedge
fair drum
#

anyone know off hand what variable ace medical uses to store the triage tag color selection?

wide fulcrum
#

that a question for the ace forum

#

like go to aces discord i think the guys that make it have one

fair drum
#

most of the fellas are on here regularly

quaint oyster
fair drum
#

why not just while {alive player} then

wide fulcrum
#

do either of you know how to add sounds to a mission

quaint oyster
fair drum
fair drum
quaint oyster
# fair drum yes how do you want them used

currently i'm having it executed one time on login, then when they're in a car either driving or passenger seat, the script when the vehicle is above 10mph or below triggers godmode on vehicle and passengers, that part works, but my concern is if the player keeps loggin in, will it clog up resources.

fair drum
quaint oyster
#

Probably should...

fair drum
#

yeah it eliminates a whole scheduled loop

wide fulcrum
#

an AI is the source of it is a say3d command [R21, "USMCa"] remoteExec ["say3d"];

quaint oyster
#

leme see if i have my old attempt with the EH

quaint oyster
#

oh wait i forgot, my confusion was the in trying to make it trigger when the vehicle reached a speed. I was using the getin EH and getout EH

wide fulcrum
#

i already did that, its still cant find the sound

quaint oyster
#

i think its why i defaulted to the while

fair drum
fair drum
wide fulcrum
#

class CfgSounds {
sounds[] = {};

class USMCa {
    name="USMCa";
    sound[]={"sound\USMCa.ogg",21,1};
    titles[] = {};
};

};

#

and its saved as the .ext

quaint oyster
#

a variable?

fair drum
wide fulcrum
#

the volume is causing it to not find the sound? how? that wasnt something i even considered

quaint oyster
fair drum
quaint oyster
fair drum
#

but 21 is REALLY loud, no need

#

5 is already blaring

wide fulcrum
#

yeah, its really frustrating trying to learn to script arma lol

fair drum
#

playSound "USMCa";

quaint oyster
#

my bad not literally private

#

i forgot that was a thing in arma

#

meaning just the _godmodedvehicle vs a godmodedvehicle

fair drum
#

the event handler's code block is a different scope, so that's a no

wide fulcrum
#

Sound USMCa not found

quaint oyster
#
if(!isServer) exitwith {};
player addEventHandler ["GetInMan",{
  _godmodedvehicle = [] spawn {};
}];

player addEventHandler ["GetOutMan",{
terminate _godmodedvehicle;
}];```
wide fulcrum
#

no dice on either way i tried it

fair drum
quaint oyster
#

F

wide fulcrum
#

i have the desc and sound folder saved to C:\Users\James\OneDrive\Documents\Arma 3\mpmissions\ODST%20Base.Tembelan

fair drum
#

send me the whole description.ext file

#

actually, just send me the whole mission file

wide fulcrum
#

that IS the whole file

fair drum
#

oh

wide fulcrum
#

theres the .sqm but i havent messed with it

quaint oyster
#

i haven't been reading all of the issues you were having @wide fulcrum , but make sure your audio is the correct format too.

wide fulcrum
#

its a .ogg

fair drum
#

and your structure is:

missionFolder
  mission.sqm
  sounds
    USMCa.ogg
  description.ext
quaint oyster
#

did ya use a proper converter tho? I had a wonky program that literally just renamed them to .ogg claiming it converted stuff, it was my problem a few years ago.

fair drum
#

his issue is the file isn't found, thats a config issue first and formost

quaint oyster
#

ahhh

#

Just thought of something. Couldn't I do a spawn with the while in it, then have a waituntil that checks if the player exists then terminates it all within one spawn?

#
_script = while { } do { };

waituntil {player gone};
terminate _script;
};```

something like this
#

NVM i see terminate only works with spawns

#

Any reason something like this wouldn't work?

while { } do { };
};
waituntil {player gone};
terminate _script;```
fair drum
#

use _thisScript

quaint oyster
#

is that a magic variable or something?

#

akin to _this for example?

#

ahh i see it is

#

so reading that, that should function then from within itself right

wide fulcrum
#

is there a way to delay the activation of a script from when the trigger is activated

fair drum
#

if I were to use these macros in something basic, like a mission rather than a mod/addon, what is it going to use for its name though?

wide fulcrum
#

what is the name of the command to make a unit turn to face a specific direction

fair drum
#

instantaneous? setDir

#

just head? unit lookAt (unit getRelPos [distance, direction])

wide fulcrum
#

i want them to turn that direction and then go to attention i know domove but how do i tell them to turn first

copper raven
wind hedge
#

Quick questions guys, what is the current difference between:

#
player setHit ["body", 0.9]; ```
#

And

#
player setDamage 0.9; ```
winter rose
#

the first one only hits the body, not all selections

wind hedge
#

Won't hint str (damage player) also return 0.9 for the player setHit ["body", 0.9]; command?

winter rose
#

maybe, but if you check head damage, it will be different

wind hedge
#

And how does setDamage distribute damage to all selections?

#

Also, doing a "player setHit ["body", 1]; " will kill the player right?

winter rose
winter rose
wind hedge
#

I will test both now

#

Ok, so doing a setHit "Body" of 0.9 and then checking via "damage player" returns 0

#

But "player setHit ["body", 1];" does kill the player

#

It is weird that the "damage player" command is not connected to the particular damage of such important part as the Body! ๐Ÿค”

winter rose
#

it is connected to the "" part of the damage iirc

#

but you die when head or body or spine gets > 0.95 dmgโ€ฆ again, iirc

wind hedge
#

I wonder why does "" exists? "setDamage 1;" could just be the same as "player setHit ["body", 1]; " instead of complicating things... I mean if you die it will always be due to damage to a body part and not a magical ""

#

I guess that was done because Arma originally was meant to be a vehicle simulator and so it treated units as vehicles... weird

warm hedge
#

Not entirely sure the context is but IIRC there's some damage config values in CfgVehicles entry. Might worth a look

wind hedge
#

I am trying to accomplish a rational Damage EH

wide fulcrum
#

if i have the trigger activation set to this && player in thislist would i need to have this && player not in thislist in the deactivation to make it repeatable?

wide fulcrum
#

Does anyone know the anim name for turning around

fair drum
fair drum
wide fulcrum
#

nvm, i just used domove

#

its less janky

#

now im trying to have a trigger change the side of an AI when it is activated

#

it seems like its something no one has managed to figure out

copper raven
#

create the group on the target side, and join the unit into it

wide fulcrum
#

i want it to happen mid mission and i used the private creategroup thing bohemiawiki reccomends and it failed

copper raven
#

what thing?

wide fulcrum
#

private _eastGroup = createGroup east;
[(the unit)] joinSilent _eastGroup;

#

it didnt work at all

copper raven
#

should

wide fulcrum
#

private _eastGroup = createGroup east;
[Ga1, Ga2, Ga3] joinSilent _eastGroup;

#

Ga are the units variables

#

does it not work for multiple Ai

copper raven
#

have you confirmed that the code runs at all?

wide fulcrum
#

how would i do that

fair drum
#

you made sure it's a .sqf file this time not a .sqf.txt again? haha

wide fulcrum
#

it runs if i use it in the esc menu

#

but not on the trigger

#

and yes @fair drum lol

copper raven
#

so, then you should be looking at the trigger's setup, not fixing code that doesn't even run

wide fulcrum
#

ok

#

i dont get why the trigger isnt firing im using the same conditions as all my other player activated triggers

#

it just isnt running

#

also... how do i get audio to stop playing if the character it is attached to is dead? for voice lines etc

copper raven
#

what are you using to play it?

wide fulcrum
#

just this && player in thisList

copper raven
#

this is the boolean of the trigger activation condition

#

so if that evaluates false, the trigger won't fire, regardless of player being inside it's area

wide fulcrum
#

the trigger activation is also player present

#

alt, i use BLU present

wide fulcrum
#

also, where should i store arrays? in the desc? or do i just add a game logic?

copper raven
#

an init file?

#

what kind of arrays, just some constant data?

wide fulcrum
#

its a buch of arrays of variable names to save space in triggers

#

so instead of putting domove and then listing 20 guys i can just say domove (array)

copper raven
#

mp or sp?

wide fulcrum
#

MP

copper raven
#

you could store them in initServer.sqf

wide fulcrum
#

ok

#

im delving ever deeper down the arma rabbithole

copper raven
#

im implying that the locality of the AI units never change, and that your doMove triggers are run serverside

#

otherwise initPlayerLocal.sqf

wide fulcrum
#

the AI unit is preplaced in the mission and the Domove trigger triggers on Blu present and the command line in this && player in thisList

#

so i think

#

i dont understand what you mean by locality but i hope that helps

copper raven
#

if its player hosted its fine, but on dedicated it will fail

wide fulcrum
#

when making the array i just use Array = [(variables in array)];

#

or do i need to add Private _ to it

#

all of the examples on the wiki have private first but i dont understand its usefulness?

#

it seems like an added parameter

copper raven
#

if an identifier is prefixed with a _, it means that a variable is local to the script(otherwise global), and private means private to the scope where it's assigned

#

so you don't want it to be local if you're gonna be using that variable outside that script(i.e triggers like you currently are), that means you should be using a global variable

wide fulcrum
#

so i just name it regularly

#

got it

#

i dont need to list it as globalvariable or publicvariable

copper raven
#

public variable is something a lot different from those two

#

there is no "listing", there is only one modifier, private

private _privateLocalVariable = 0;
_localVariable = 0;
globalVariable = 0;
#

you don't write

global myGlobalVariable = 0;
#

no _ means GLOBAL

#

except in cases like this in init field, this is actually a local variable there

wide fulcrum
#

so in Init.sqf i have RunningODST = ["R1", "R2", "R3", "R4", "R5", "R6", "R7", "R8", "R9", "R10", "R11", "R12","R13", "R14", "R15", "R16", "R17", "R18", "R19", "R20", "R21"]; where RunningODST is my array to be used by the triggers to run their code instead of having to type all those numbers 5 times

#

R* being the Object Variable

copper raven
#

that's an array of strings

#

they don't evaluate to an object, if that's what you're expecting

wide fulcrum
#

ok, now im lost, how do i store the variables in the array? lose the ""?

copper raven
#

you don't "store variables in the array", you store values

#

so as you said, R1...Rn are objects, then get rid of the quotes

wide fulcrum
#

ok, now i can just refer to the array instead of all the individual objects in my trigger?

copper raven
#

yes

wide fulcrum
#

thanks

#

i also havent figured out how to get it to run one animation for a given time and then switch to another without using multiple triggers

#

i know the sleep function exists but i dont know how to use it properly

#

my current trigger now reads {_x disableAI "anim"; while {alive _x} do {_x playmovenow "AmovPercMrunSnonWnonDf"}} foreach [RunningODST]; [R21, "USMCa"] remoteExec ["say3d"];

copper raven
#

sleep just suspends the script for +- time specified

wide fulcrum
#

i want it to sleep for the time it takes to run that code and then play the pushup anim

copper raven
#

[RunningODST]

#

why foreach one element?