#arma3_scripting

1 messages ยท Page 594 of 1

high silo
#

I also need to be able to unload them at the other end

#

I could do something similar to this

if ((_veh isKindOf "landvehicle") && (driver _veh == player)) exitWith { 
#

But for air

exotic flax
#

it's all possible;

  • in trigger you can get a list of all units inside it (thisList), so you can filter the player and the heli
  • I'm not an expert on waypoints, but shouldn't be too hard to use HOLD waypoints and only trigger them when a player is in the trigger (and loop over ID's)
#

although you could also have multiple pickup points, so the player has to pickup from multiple helipads which each have it's own AI group

ebon citrus
#

EH "Take" is being fired when you reload. Any ideas?

exotic flax
#

is that a question or statement? ๐Ÿค”

ebon citrus
#

question if i have done something wrong or is the actrion just being handled as taking

exotic flax
#

because I've never seen that behaviour

ebon citrus
#

kk

#

could be CBA?

exotic flax
#

no, CBA only extends on existing EH's, not adding behaviour to it

ebon citrus
#

hold on

copper raven
#

Probably not intended, wouldn't make much sense, as there is Reloaded eh already

ebon citrus
#

it's taking a magazine from something

#

so probably why it fires

exotic flax
#

it would make sense; since you take a magazine from your inventory, although I doubt it's supposed to do that...

copper raven
#

^

ebon citrus
#

yeah, it makes logical sense, but probably unintended

warm hedge
#

Is there any scripts running besides that?

ebon citrus
#

a bunch, i can try it on vanilla

#

just something i noticed

warm hedge
#

Better try it in vanilla just to make sure

ebon citrus
#

yep

#

just launching

#

same result

#

on vanilla

warm hedge
#

Just a mission with only a soldier?

ebon citrus
#

empty stratis map with one ammo bearer

copper raven
#

Wonder if put would fire, if you put the magazine from the weapon back to your inventory ๐Ÿ˜„

warm hedge
#

๐Ÿค”

ebon citrus
#

here's the debug copnsole scripts:

player addEventHandler ["Take", { 
 params ["_unit", "_container", "_item"]; 
 systemChat "take";
}];```
#

no other script is running

#

it's kind of bothersome

#

it's not even that the player is the container and the unit

#

but the unit is a groundweaponholder

#

the container is the player-unit

exotic flax
#

tested on VR, single unit, and it does indeed trigger the magazine loading from dummyweapon.p3d

valid bison
#

Hello, someone can help me ? I want to use "AnimChanged" Event Handler. But they don't detect any animation when i switch weapon. Only when I move. How can I have a detection of the animation when I switch a weapon ? Thanks you.

warm hedge
#

Changing weapon is something different than regular animation so that's why not working in this context; maybe checking the weapon every frame is the way?

ebon citrus
#

isnt there a change weapon eh?

warm hedge
#

IIRC not but might wrong

valid bison
#

No @ebon citrus

#

And i don't want use a while ^^

warm hedge
#

Don't need to use a while, addMissionEventHandler ["EachFrame",{/*yourcode*/}]; is slightly better

valid bison
#

Each frame isn't the same system ?

ebon citrus
#

action EH?

#

switchweapon is an acvtion

#

so you could trigger on all keydown events and if the keydown is for action to switch to antoher weapon, execute the code

warm hedge
#

One can switch weapon without using action menu

valid bison
#

For the moment I'm using "actionkeys". The concern is that I'd like my script to run, once the end of the animation of the change of my weapon.

ebon citrus
#

actionkeys is what i would use

warm hedge
#

Each frame isn't the same system ?
You compare with while? That's a nono

exotic flax
#

but there are a dozen of different keys which could switch a weapon...

ebon citrus
#

dont bind to keys

#

bind to the action

exotic flax
#

there are also a dozen of actions ๐Ÿ˜‰

ebon citrus
#

i remember doing this to check for players opening interrupt menu

valid bison
#

Yes, and i have write all this keys ^^ But that execute my script when I press my key

ebon citrus
#

switch-case

valid bison
#

But i want to execute my script only when i have change my weapon

ebon citrus
#

or if action in array of actions

#

wait until weapon is what you want

warm hedge
#

Bind to the action is a massive no (for me) since you can only assign one EH to the action menu today

ebon citrus
#

not the action menu

#

to key-actions

#

keybinds

valid bison
#

Yes, waitUntil can work

#

I will test that

#

Thanks you ๐Ÿ™‚

ebon citrus
#

waituntil and then oneachframe check until weapon is desired

valid bison
#

Ok, thanks you ๐Ÿ™‚

exotic flax
warm hedge
#

onEachFrame is also a big no because of the same reason, could cause a conflict between scripts; addMissionEventHandler ["EachFrame",{}] is better

Not Fixable
F

ebon citrus
#
When unit reloads it takes current magazine and puts it in uniform or vest or backpack and takes another magazine from those containers, so the magazine changes and the action of putting or getting a mag from a container triggers the EH. Granted that the firing on addprimaryweaponitem is a bit odd, however at this point we are not going to touch it as it could introduce unexpected behaviour and break existing functionality in scripts. AFAIK no tweaks have been done to these EHs for a long long time.```
#

fair enough

exotic flax
#

it's fixable; just would take too much time and effort for something that small

ebon citrus
#

"if it's broken but fixing it breaks other things, dont fix it"

#

it's a feature now

#

might want to add this to Biki on the note for "take" EH?

#

to let people know it fires on reloading aswell

warm hedge
#

Gib a bit

ebon citrus
#

no hurry

#

i jsut didnt find it immediately obvious when i was using it

warm hedge
#

Nah, it's too late, just a sentence before sleep

ebon citrus
#

fair enough

#

also, i used displayAddEventHandler for detecting actions with KeyDown

warm hedge
#

Just to make sure, it happened when a unit reloads right?

ebon citrus
#

one of the params was the action that was executed if i recall correctly

#

yep

warm hedge
#

Okay, consider it done

ebon citrus
#

but not switching attachments

#

anyways, i have to figure something else out

#

might have to override the "take" action from ground-items

high silo
#

So I have managed to make the script only trigger if its a helicopter, thats landed and isnt moving. How do I now tell the AI to get in the heli, I try waypoints in the SQF but nothings happening. I know the scripts running

#

Is it because I haven't referenced the units before?

ebon citrus
#

can you share the code?

warm hedge
#

BIKI updated

ebon citrus
#

cheers

high silo
#

Basically I need to find a way to make AI placed on the map by another script, be commanded by this script.

#

Condition:

call{{_x iskindof "helicopter" && isTouchingGround _x && speed _x < 1} count thislist > 0  }

On Activation:

call{_handle = [(thisList select 0)] execVM "Scripts\JAC\Transport\Task1.sqf";}

Then inside that SQF is:

private ["_veh","_vehType"];
_veh = _this select 0;
_vehType = getText(configFile>>"CfgVehicles">>typeOf _veh>>"DisplayName");

if ((_veh isKindOf "helicopter") && (driver _veh == player)) exitWith { 

hint "bing pot";

};```
#

Inside the QRF is where I need to then order the AI to board the heli thats triggered the condition.

autumn swift
#

Hi I have a question regarding the SQL_CUSTOM protocol in extDB3.
For the normal SQL protocol, you can use the TEXT parameter to make it wrap string datatypes in quotes.
Example: "extDB3" callExtension "9:ADD_DATABASE_PROTOCOL:<DATABASE_NAME>:SQL:<PROTOCOL_NAME>:TEXT"

How can I do the same with SQL_CUSTOM protocol? When I look at the example in the docs, there doesn't seem to be any place to add those parameters:
"extDB3" callExtension "9:ADD_DATABASE_PROTOCOL:<DATABASE_NAME>:SQL_CUSTOM:<PROTOCOL_NAME>:<SQL_CUSTOM_FILENAME>"

Do I have to define this somewhere else?

EDIT: Managed to find the solution. It's enabled by defining OUTPUT=string in the sql custom ini file

spark rose
#
deleteVehicle nearestObject [getMarkerPos "Respawn_West_1", "Campfire_burning_F"];
        "Respawn_West_1" setMarkerPos getPos tester;
        "Campfire_burning_F" createVehicle (tester getRelPos [1, 0]); 
#

wow that's formatted a bit nicer on my screen. anyway, looking for help creating an object directly in front of the player

#

i've tried using "direction", "getDirVisual", "getDir", and now "getRelPos"

#

the object is sometimes off by as much as 30 degrees

uncut rapids
#

What I've done to do this before is you could attach the object to the unit and then detach it right afterwards

#

Personally I don't like doing trig just to create an object lol

#

Some other person prolly has an easier solution but attachTo will work if all you're doing is just putting it in front of the unit

spark rose
#

Hmm that's not a bad idea....

uncut rapids
#

Just obj attachTo [unit,[0,distance,(this one will take testing cause sometimes 0 is in the ground)];

#

Actually wait it's for a campfire right? @spark rose

spark rose
#

yep

uncut rapids
#

I have a script for that lol one sec

#
_obj attachTo [unit,[0,distance,0.3]];
spark rose
#

hm. think i may have to modify it but i think your idea will work

uncut rapids
#

Np, it worked for me when I made my knockoff Squad logi system lol

spark rose
#

yeah it's not bad (i use Bis_fnc_holdActionAdd), but i don't like how (as opposed to how i was doing it) that it doesn't follow terrain well

#

hmmmmmmm

uncut rapids
#

yeah thats the only issue, i kinda forgot that cause my build system has a keybind for changing elevation

spark rose
#
        _pos = tester getRelPos [3, 1];
        createVehicle ["Campfire_burning_F", _pos, [], 0,     "CAN_COLLIDE"]
#

best solution thus far

#

can_collide results in the exact position, but similar to your attachTo and detach method, sometimes the orientation relative to terrain is a bit off

high silo
#

Is there a way you can find out which vehicle just entered a trigger, then get AI to load into said vehicle.

#

I manged to do find out if its a helicopter or land vehicle but its as far as I got

exotic flax
#
_veh = false;
{
   if !(vehicle _x == _x) then {
      _veh = vehicle _x;
   };
} foreach thisList;
winter rose
#

``` ๐Ÿ˜„

#

also, thislist* @exotic flax

exotic flax
#

I'm on a phone... Blame Google ๐Ÿคฃ

#

And no, it's not THE solution, but will help you to get the correct way in your case...

hidden talon
#

does this syntax look correct for the objectsmapper function? I'm getting a "generic error in expression" from the objectsmapper function itself when running this
0 = [TaskManLocations, 0, call (compile (preprocessFileLineNumbers "TaskMan\compositions\tentcamp.sqf"))] call BIS_fnc_ObjectsMapper;

TaskManLocations is a global variable (or atleast it should be, I was told to just leave out the _ prefix that assumedly used when making local variables) i made in another script file that runs execVM on the separate file that contains the objectsmapper line above, the variable contains an array of markers
TaskManLocations = ["loc","loc_1","loc_2", "loc_4"];

bold kiln
#

Can You attach a player to a Geometry point?

tough abyss
#

0 = [TaskManLocations, 0, call (compile (preprocessFileLineNumbers "TaskMan\compositions\tentcamp.sqf"))] call BIS_fnc_ObjectsMapper;

```Parameters:
    position: Position - (Optional, default [0,0]) 
    azimuth: Number - (Optional, default 0) the template orientation 
    objectsArray: Array - created with BIS_fnc_objectsGrabber 
    badChance: Number - (Optional, default 0) must be in range 0..1. Chances of object non-creation for each object ```

`TaskManLocations` is not a position it's an array
#

@hidden talon

#

you want

hidden talon
#

how would I redefine it as an array in that line?

tough abyss
#

i mean you have an array of strings

#

so you'd have to do a bit of conversion on taskmanlocations to get positions out of that

hidden talon
#

oof, that's far beyond me

tough abyss
#

i can help you

#

what is "loc", "loc_2", etc

#

are those actual things or are you using them as placeholders?

hidden talon
#

they're marker names, yeah

tough abyss
#

okay

#

so here's what you'd do

#

to get a position of a marker, you use getMarkerPos

#

since we have an array of these markers, it's impractical to go

_pos1 = getMarkerpos "loc";
_pos2 = getMarkerpos "loc2";
//etc
hidden talon
#

of course, hence why I made an array for them ๐Ÿ˜›

tough abyss
#

instead, what we can use is called a forEach operator

#

well

#

not operator

#

forEach construct is more apt

#

anyways

#

what we'll do, is we'll first assign an empty array for the positions we want to store to be fed into

hidden talon
#

so I would string together a "forEach in array" ish line?

tough abyss
#
_myMarkerPosArray = []```
#

so we have our empty array defined with the variable _myMarkerPosArray

hidden talon
#

is it possible to define that as a global variable, or is it fine to define that multiple times locally in each of my script files where I need to create a composition with the objectsmapper?

tough abyss
#

now we need to put things in that empty array, which is where our forEach construct comes into play

hidden talon
#

or rather one time each for my composition scripts, not multiple

tough abyss
#

i try to avoid gvars wherever possible, if i have a variable that's existent in one script that i need to get into another i'll do everything in my power to just pass that variable along to the new script

#

but if you're just starting out and you want to get your foot in the door, it's OK to use gvars

#

it can just make things sloppy when you end up having a lot, since they all need unique names and can cause problems if you accidentally use the same varname for different things

#

you want to keep your variables in-scope unless you have to take them out

#

anyways, back to your code

hidden talon
#

that's what I was hoping for, i basically have a script file that is ran during the mission, which holds the locations array as a global variable, to make it easier on myself i'd rather define the empty extra array in that single file, instead of having to have it locally in each of my individual composition spawner files

#

and i need to be able to communicate between the file that selects a position, and the composition files

tough abyss
#
myMarkerPosArray = [] //Now a gvar
{
private _newPos = getMarkerPos _x
myMarkerPosArray pushback _newPos
} forEach taskManLocations;```
#

so, i did a few things here and i'll explain each one

#

first i'll explain the forEach construct and how it works

#

forEach is what you want to use when you want to act on many different values within an array

#

like we do in this case, for instance

hidden talon
#

what I assume its doing is going over each element in the original array, and grabbing their positions and storing them in the dummy array?

tough abyss
#

correct

#

and we needed to define that myMarkerPosArray as an empty array, because without it the game would go "what the heck is this" and not know that you wanted to stick these new values in an array

#

so to summarize, forEach will execute code using each element of an array as an element wherever you define it in the construct

#

which leads me nicely into the first line of the actual working of the code itself

#
private _newPos = getMarkerPos _x
high silo
#

Sorry to interrupt your explaining but just quickly encase anyone knows.
Im trying to set the groups variable name when I spawn them in a using a sqf. Anyone know how, I tried a few things but no idea.
This is how I spawn them in:

Spawnteam1 = [[6862.94,1083.6,0], WEST, ["rhsusf_usmc_marpat_wd_squadleader"], [], [], [], [], [], 308.080] call BIS_fnc_spawnGroup;
tough abyss
#

so this is pretty straightforward. i've defined a local variable, _newPos, to be used exclusively within the scope of this forEach construct (since we don't need it elsewhere)

#

@high silo will help you when i'm done with tin, one sec

#

anyways

#

_newPos is a local variable, as distinguished by our underscore in front of it

#

and i actually just amended my code to include private, which is a simple command that tells the game that this variable should only be available in the scope that it's defined in

hidden talon
#

i'm still very fuzzy on scopes, I assumed scopes was basically the equivalent to wether a variable is local and global, but it seems to not be the case

#

i don't want my global variable to be private if private means it's local, when I need to reference it in a separate script

tough abyss
#

private just means it's only accessible within that scope

#

a scope is different from locality in the sense that a scope is an independent part of your code, whereas locality is where the code is being executed in the game

#

anyways, back to the example

#
private _newPos = getMarkerPos _x
myMarkerPosArray pushback _newPos

so we've defined a new variable, _newPos, to temporarily store the value given by getMarkerPos _x

exotic flax
#

For everyone; all the information provided by Vauun is also available on the wiki, or part of any starter programming course online

tough abyss
#

^

#

i will provide helpful links when i'm done

#

now _x is what's known as a 'magic variable'

#

it's a bit special

hidden talon
#

i'm aware of the wiki, I just have alot of trouble with figuring out syntax, very new to this

tough abyss
#

we all start somewhere ๐Ÿ˜„

#

but _x is special because it's representative of the variable currently being operated on in the array provided to forEach

#

so for each time forEach runs

#

it will step through the array you give it

#

and effectively replace _x with whichever value in your array that it's on

hidden talon
#

so _x is only very temporary, until when and if you replace it anywhere else?

tough abyss
#

yes, but you're not replacing it, the game is

hidden talon
#

well, yeah ๐Ÿ˜›

#

as i understand it now, its basically a temporary variable that can be whatever you need it to be

tough abyss
#

yes

hidden talon
#

without having to create a new variable to "take up space"

tough abyss
#

in essence

#

yes

#

basically, this is keeping you from having to manually write out
newPos = getMarkerPos "pos1"
newPos = getMarkerPos "pos2"

#

and then manually putting all that in an array

hidden talon
#

so now i just need to pull _x out of the dummy array in some way, and communicate it to the separate script, assuming that's the entire conversion process

tough abyss
#

nope

#

_x only exists in forEach

#

all it is is a variable

#

you don't need to reference it anywhere

#

the return of our values comes in the next line

#

myMarkerPosArray pushback _newPos

hidden talon
#

oh i see, its already set as the new current variable in the dummy array

#

so i can just use the dummy array

tough abyss
#

one sec there's a house fly that's really bothering me

#

alright there's that problem solved

#

also let me write what this forEach is doing, might make it a touch more understandable

#
// what we have in our SQF
myMarkerPosArray = [] //Now a gvar
{
private _newPos = getMarkerPos _x;
myMarkerPosArray pushback _newPos;
} forEach taskManLocations;

//what the game sees

{
private _newPos = getMarkerPos "loc1";
myMarkerPosArray pushback _newPos;
} forEach ["loc1","loc2","loc3"];
// myMarkerPosArray is currently [[x,y,z]];
{
private _newPos = getMarkerPos "loc2";
myMarkerPosArray pushback _newPos;
} forEach ["loc1","loc2","loc3"];
// myMarkerPosArray is currently [[x,y,z], [x,y,z]];
{
private _newPos = getMarkerPos "loc3";
myMarkerPosArray pushback _newPos;
} forEach ["loc1","loc2","loc3"];
// myMarkerPosArray is currently [[x,y,z], [x,y,z], [x,y,z]];```
#

so while all WE'RE putting into the game is ```sqf
{
private _newPos = getMarkerPos _x;
myMarkerPosArray pushback _newPos;
} forEach taskManLocations;

#

the game sees and does all that additional stuff below

#

and the result is an array of the positions for each marker

#

also i'm bad and forgot my semicolons in the earlier examples

hidden talon
#

that's all making my head hurt to try to interpret, but i think i got the gist of it (mostly at least)

tough abyss
#

exercising your brain is never a bad thing

#

pushback is pretty straightforward - all it does is appends a new value to the end of an array

#

so now that we have our positions from our markers

#

we can do a similar thing for your original code

#
{
0 = [_x, 0, call (compile (preprocessFileLineNumbers "TaskMan\compositions\tentcamp.sqf"))] call BIS_fnc_ObjectsMapper;
} forEach myMarkerPosArray;```
hidden talon
#

how would it know what _x is since it's in a totally separate file?

tough abyss
#

like i said _x only exists within a forEach loop

hidden talon
#

so _x is _x everywhere where there is an _x for that moment?

tough abyss
#

yes, in that forEach construct

hidden talon
#

how does that not cause conflicts with other scripts defining their own _x?

#

or is that where scope comes in

tough abyss
#

well for one you can't assign _x as a variable

#

but yes, it only exists within the scope of your forEach

hidden talon
#

oh i see

#

i think i understand that a bit better now then, _x is not a real variable in that sense, it's not a string, integer or array, etc, and it doesn't change itself into one, except the game sees it as one within the scopes you're using it in

tough abyss
#

yes and you can only use it in forEach afaik

#

as for @high silo

Spawnteam1 = [[6862.94,1083.6,0], WEST, ["rhsusf_usmc_marpat_wd_squadleader"], [], [], [], [], [], 308.080] call BIS_fnc_spawnGroup;
i see you're trying to use an RHS group to spawn, you need to use 3DEN's config editor to actually get what you seek. the game doesn't know what ["rhsusf_usmc_marpat_wd_squadleader"] is. you need to specify a path to a config entry

#

to do so, open your config viewer in 3DEN, (i think it's Tools > config viewer) at the top

#

in the left hand pane, scroll down to cfgGroups

#

expand that

#

and then go find the group that you want to spawn

#

at the bottom there will be a long entry that looks

#

something >> like >> this >> which >> is >> a >> path

#

copy/and past that in parenthesis

#

instead of that array

#

Spawnteam1 = [[6862.94,1083.6,0], WEST, (something >> like >> this >> which >> is >> a >> path), [], [], [], [], [], 308.080] call BIS_fnc_spawnGroup;

high silo
#

Configfile
Missionconfigfile

#

Which one

tough abyss
#

configFile

#

you can specify your own mission configs but i don't think you're doing that

high silo
#

I am not

#

How will I know which is the right one, theres tons

tough abyss
#

How will I know which is the right one, theres tons
you have to click through the cfgGroups entries. they are pretty self-explanatory by name, i think it starts with B / O / I / C (for respective factions) and then it gets more narrow in scope from there

hidden talon
#

thanks, it's claiming _x is an undefined variable, but I'll have a look through the page on it and see if I can't figure it out I guess, thanks for the help so far

tough abyss
#

can you show me your code?

high silo
#

I found RHS but dont know what im looking for directly

#

Its just giving me all the RHS equipment

tough abyss
#

if you single-click on the various group entries and then look in the large, main window it will have a definition in there that's the actual name you see when clicking for groups in the 3DEN editor

hidden talon
#

oh I think it's because i did a whoopsie and left out the curly brackets, i've got another issue with a simple switch where I do the actual random array element selection

tough abyss
#

can't boot up arma right now to show you

hidden talon
#

i'll plop it on pastebin, it's quite alot

tough abyss
#

sure

hidden talon
#

pastebin screwed that line 1 up, don't worry about that

#

getting an error at line 22, etc where I'm trying to select random from a missions array at the bottom

high silo
#

Ohhh I get it

hidden talon
#

it claims the syntax is wrong but i've tried embracing the cases with brackets, then curly brackets, it seemed to work for a time but I'm out of my depth on that I think

tough abyss
#

aha, you're using case wrong but i see why you're making that mistake

high silo
#

configfile >> "CfgGroups" >> "West" >> "rhs_faction_usmc_wd" >> "rhs_group_nato_usmc_recon_wd_infantry" >> "rhs_group_nato_usmc_recon_wd_infantry_team" >> "Unit5"

tough abyss
#

@high silo yep, you got it. though i think you drilled down too deep, remove >> "Unit 5" from the end

high silo
#

I already struck oil?

tough abyss
#

you certainly did, Mr. Pink

high silo
#
_team1 = [[6862.94,1083.6,0], WEST, [configfile >> "CfgGroups" >> "West" >> "rhs_faction_usmc_wd" >> "rhs_group_nato_usmc_recon_wd_infantry" >> "rhs_group_nato_usmc_recon_wd_infantry_team"], [], [], [], [], [], 308.080] call BIS_fnc_spawnGroup;
tough abyss
#
switch (VARIABLE) do
{
    case ANYVALUE1:
    {
        STATEMENT;
        ...
    };

    case ANYVALUE2:
    {
        STATEMENT;
        ...
    };

    ...

    default
    {
        STATEMENT;
        ...
    };
};``` @hidden talon
#

see, case doesn't REQUIRE an integer to work

hidden talon
#

even if I have a limited amount of integers in my array?

tough abyss
#

case will match the value given to it against the variable in parenthesis in switch

#

the variable and values can be anything

hidden talon
#

oh I think i see it now

tough abyss
#

they don't have to be numbers

hidden talon
#

the _objtype already picks a random value doesn't it?

tough abyss
#

sec

#

@high silo close, but you're using [] instead of ()

#

(configfile >> "CfgGroups" >> "West" >> "rhs_faction_usmc_wd" >> "rhs_group_nato_usmc_recon_wd_infantry" >> "rhs_group_nato_usmc_recon_wd_infantry_team")

high silo
#
_team1 = [[6862.94,1083.6,0], WEST, (configfile >> "CfgGroups" >> "West" >> "rhs_faction_usmc_wd" >> "rhs_group_nato_usmc_recon_wd_infantry" >> "rhs_group_nato_usmc_recon_wd_infantry_team"), [], [], [], [], [], 308.080] call BIS_fnc_spawnGroup;
tough abyss
#

yep, you got it

high silo
#

I can wait till your done Vauun ๐Ÿ˜„

tough abyss
#

naw it's fine

#

it's fun flexing my brain

high silo
#

So how do I now define the group name

tough abyss
#

you did already, it's _team1

#

_objType = floor(random(11)); i'm not sure what you're trying to do here though @hidden talon

high silo
#

So why didnt it work before?

tough abyss
#

do you just want a random event to happen?

#

So why didnt it work before?
i mean that function you wrote works, but you may be trying to reference the variable somewhere that variable isn't available

#

it's a local variable so you can only use it in the same file unless you pass it to another

#

(or make it global)

high silo
#

Thats what I need to do ^

#

How I do dat

tough abyss
#

depends on your environment. show me all your code

hidden talon
#

i'm not sure myself, I admit i grabbed the basic switch setup from a reddit post explaining how to spawn pre-made compositions, I had a look at the random wiki page but wasn't sure what the 11 is supposed to be there for, other than possibly adding extra numbers to look for?

#

i believe originally it picked a random composition file to spawn, and may be leftovers I didn't delete from that, since the random mission switch at the bottom is supposed to deal with that, I commented it out and had the switch reference _rndLoc instead like it probably should, and it magically solved the syntax issue - the script isn't quite working out at all though unfortunately, on the + side there are no more syntax issues

high silo
#

Random script is selected to run, giving them a task to land at a LZ pick up the infantry there and transport them.

Units are spawned in "Task1Units.sqf"

_team1 = [[6862.94,1083.6,0], WEST, (configfile >> "CfgGroups" >> "West" >> "rhs_faction_usmc_wd" >> "rhs_group_nato_usmc_recon_wd_infantry" >> "rhs_group_nato_usmc_recon_wd_infantry_team"), [], [], [], [], [], 308.080] call BIS_fnc_spawnGroup;

When the heli lands at the LZ its checked to see if it is a heli, if its come to a complete stop and which heli it is. From there the AI spawned in the other script is then ordered to load in that script. "Task1.sqf":

private ["_veh","_vehType"];
_veh = _this select 0;
_vehType = getText(configFile>>"CfgVehicles">>typeOf _veh>>"DisplayName");

if ((_veh isKindOf "helicopter") && (isPlayer driver _veh)) then { 

  if (team1 distance heli1 < 30) then {
  
    _tra1 = _team1 addWaypoint [[6869.75,1081.69,0],0];
    _tra1 setWaypointType "GETIN NEAREST";

};

};
#

Can I just add this in the "task1units.sqf"

#
publicVariable  = "_team1";
tough abyss
#

i would avoid using publicVariable instead just pass the variable

high silo
#

how ๐Ÿ˜„

tough abyss
#
  • side there are no more syntax issues
    @hidden talon it's the little victories! i've been doing SQF for four years now and i still have trouble sometimes, so "no syntax errors" is cause for celebration to drink sometimes
hidden talon
#

i'm just glad I learned a bit about variables and the magic variable today ๐Ÿ˜› i've been trying myself for a few years, had a hiatus until now when I'm experimenting with random task generation

#

always had issues actually learning though when my native language isn't english, and i'm a bit of a thick head unless there's visual learning

tough abyss
#

i got my start by doing eventhandlers that shot jeeps out of a machine gun

#

i thought that was so amusing i decided i wanted to learn about more than what i could do

#

now i've done things from fully-MP compatible cutscenes to todd howard boss fights to ace-combat styled 20v20 furballs over takistan at the end of an op

#

@high silo to answer your question

hidden talon
#

lmao that's a whole lot of progress for 4 years

tough abyss
#

how are you executing task1units.sqf

high silo
#

It will be randomly using the init.sqf but atm to test locally

tough abyss
#

post init.sqf

#

also be careful about using init.sqf in a multiplayer environment

high silo
#

I havent gotten to coding that part yet, hence locally tested

#

The init.sqf will just exec the main script, which will pick a random script to trigger from a selection I give it. Once a mission is complete it retriggers the main script in a endless loop untill we get bored and stop

tough abyss
#

so wait why have this in separate scripts

#

you can have all this in one script

high silo
#

because its the easiest way for me to do it and understand what im doing

tough abyss
#

you're making more work for yourself tho

#

hold on

#

if you want to define a bunch of different groups that have the potential to spawn

#

you can just stick them all into an array

#

and then select randomly from that array

#

and pass said value into your spawnGroup function

high silo
#

You lost me

tough abyss
#

ye so you can just

#
_groupArray = [
(configfile >> "CfgGroups" >> "West" >> "rhs_faction_usmc_wd" >> "rhs_group_nato_usmc_recon_wd_infantry" >> "my_group_1"),
(configfile >> "CfgGroups" >> "West" >> "rhs_faction_usmc_wd" >> "rhs_group_nato_usmc_recon_wd_infantry" >> "my_group_2"),
(configfile >> "CfgGroups" >> "West" >> "rhs_faction_usmc_wd" >> "rhs_group_nato_usmc_recon_wd_infantry" >> "my_group_3")
];

_groupToSpawn = selectRandom _groupArray;
#

this will randomly select one of those config entries for use in your spawnGroup function

#

so you'd then have something like

#
_team1 = [[6862.94,1083.6,0], WEST, _groupToSpawn, [], [], [], [], [], 308.080] call BIS_fnc_spawnGroup;
high silo
#

That makes sense

#

But that just raises more questions

tough abyss
#

such as?

high silo
#

So I now have randomish units spawning at the pos, I still need to order them to get in the helicopter when it lands close enough to them.

#

And create markers for the pilots to head to.

#

I have a way of telling if the heli is stopped, which heli but I cant order the AI around because they are not defined in that script

rancid basalt
#

Sorry to interrupt, guys, but I have a question that I think should be easy to answer, but I'm having difficulty finding the answer.

I want a script to start when a player walks into a trigger. How do I reference that player? How do I assign them to a variable?

high silo
#

Use a trigger?

rancid basalt
#

Yep

#

"player"?

high silo
#

In the condition:
if (A distance B < number) then { script here };

Or just use a area trigger like the 10x10x10

rancid basalt
#

Ah, so the player is implied and does not need to be explicitly defined?

high silo
#

Depends what you have the trigger set to

rancid basalt
#

When anyone enters zone

high silo
#

In the trigger you can set the size, type activation etc

#

Can set it to Blufor, anyplayer, anybody etc...

rancid basalt
#

I am wanting a player to join a group when they enter the trigger zone, but I do not know how to define the player

#

Or reference them

high silo
#

give the player a variable name in eden when you spawn it

rancid basalt
#

[_unitOne, _unitTwo] join (group player);

#

That's where I am on, I am having difficulty referencing the "_unitOne" when that unit is the player joining a different group

high silo
#

So

[Player21] join (BingPot); 
#

Unitone is the variable name

#

Double click on the player, at the top will be a place where you can assign its variable name

rancid basalt
#

In this case, it will be whichever player enters the zone, so I cannot statically assign it to a specific player

#

I apologize for the noobie questioning. I am extremely new to this.

#

I am a C++ dev, but writing my first scripts in Arma.

high silo
#
if (A distance ZoneA < 6) then { [A] join (BingPot); };
if (B distance ZoneA < 6) then { [B] join (BingPot); };
#

That should work

#

Just do that for every player

#

Probably a easier way

#

But thats how I would attempt it

rancid basalt
#

Great! Thank you. It's something I can work off of, at lease.

high silo
#

Connor here might give you a better way

robust hollow
#

why wouldnt you just execute the trigger on clients and do player in thisList as the condition, and [player] join myGrp on activation?

high silo
#

I see him typing /

robust hollow
#

im not seeing a need to define a distance check for every unit

rancid basalt
#

That sounds like a *great idea. So you just create an array on mission init and work from there, I assume

robust hollow
#

.. no?

#

idk, depends on how you specifically are trying to do it, how i described it the only thing you would need to do in advance is assign a variable to the group so you can reference it.

rancid basalt
#

Ok, thank you. I appreciate the help.

high silo
#

@robust hollow sorry to tag you, but I spent 6 hours trying to work this out but still can't.

I want to spawn a AI squad in one script and assign it's group variable name. So I can then give it a waypoint in another script. Without making it a public variable or running the other script. Any tips?

As atm the other script is saying the group is not defined in its script...

robust hollow
high silo
#

Similar but it didn't actually fix a issue just solved one I already knew how to do

#

Same as this question just re worded as I think i didn't explain myself correctly

robust hollow
#

that is the correct way to assign the variable. is the group created and given a waypoint on the same client?

high silo
#

No it's created on one script, and assigned in another that's my issue

#

But I can't create it and assign it in the same script, as one creates the AI and the other checks to see if the player is close enough for the AI to then climb onboard.

robust hollow
#

not quite what i mean. is it a sp or mp mission?

tough abyss
#

I am working on this problem for a client of mine on Fiverr.
The problem sounds simple but of course that is never the case with code.
We are trying to add a tab to the shop in the warlords addon. In the shop we are looking to add a a section where the players can purchase an airstrike on a location, Done by A.I. We are having trouble finding where in the .pbo file, the code for the shop is. If we did know where the code location was then it would be more simple to add that section to the shop in the warlords interface.
If anyone could help find, or make this happen, then please let me know. If you need more details let me know about that too.

high silo
#

Mp

tough abyss
#

Yes, they play mp

high silo
#

No I was answering Connor

tough abyss
#

oh

robust hollow
#

so i mean is the group created on the server and the waypoint is assigned on the server, or do the two scripts execute on different clients.

#

@tough abyss what pbos have you looked in?

high silo
#

So they are spawned on a server level, but triggered with a player on a client level

#

But they are both in a sqf file

robust hollow
#

and why would you like to avoid a public variable?

high silo
#

Going to be multiple of them and don't wanna increase strain on the server if possible

#

There gonna be repeating every 15mins for about 3-4 hours plus other stuff running at the same time

robust hollow
#

doesnt sound so bad

high silo
#

When I tested it with a public variable it didn't work, unless I was assigning it wrong will have another look then

tough abyss
#

The pbos that we have looked in are the missions_f_warlords

#

that is it

robust hollow
#

try functions_f_warlords.pbo -> \warlords\fn_wlpurchasemenu.sqf

#

idk if thats the right function but it sounds like a shop menu to me

rancid basalt
#

Ah, yes, Warlords. The Warfare lite

Boy do I miss Warfare BE

tough abyss
#

where would I find the warlords file?

robust hollow
#

inside the pbo

rancid basalt
#

You will probably find that inside of the .pbo

tough abyss
#

where in the pbo. Does it need to be opened as a file and not notepad?

robust hollow
#

what? you open it how you normally do

#

same as how you looked at missions_f_warlords

rancid basalt
tough abyss
#

in addons right... because we have been opening it in notepad and looking through the lines of code that are there

robust hollow
#

๐Ÿ˜ฌ

tough abyss
#

I take it theres another way that we have over looked

robust hollow
#

yea. any pbo unpacking tool.

tough abyss
#

oh

rancid basalt
#

I linked it above, but I suppose any would work.

robust hollow
#

that armaholic link is one (though it is outdated)

tough abyss
#

ok

robust hollow
#

though if you are unaware of pbo tools then I'm not sure how much success you're going to have modifying the warlords shop. you shouldnt be modifying it directly in that pbo

tough abyss
#

we havent modified anything. We have just been looking so I think were safe on that one.

robust hollow
#

ok ๐Ÿ‘

rancid basalt
#

Are you just trying to add assets? The wiki documentation details how to do this.

robust hollow
#

We are trying to add a tab to the shop in the warlords addon.

rancid basalt
#

Ah, that's far beyond me.

tough abyss
#

How the heck do I use the fricken Pbo manager. the file icon is just a blank piece of paper.

rancid basalt
#

I wanna say something, but Connor will just destroy any semblance of knowledge I pretend to have.

#

You click the green arrow on the upper left and navigate to the .pbo you want to open

#

Once opened, you right click -> extract the .pbo to a location

tough abyss
#

No im not at that. like downloading the darn thing

#

Like its not an installer.

rancid basalt
#

Ah, yes. It is zipped using 7z

tough abyss
#

yea

rancid basalt
#

I highly recommend 7z for all of your compression and extraction needs ๐Ÿ˜ฌ

#

Think Winrar, but it doesn't make you depressed

tough abyss
#

lol

#

perhaps

rancid basalt
tough abyss
#

what am I opening this file with.

rancid basalt
#

7zFM.exe

#

Take this to PM, Seb. I don't want to clog this channel

tough abyss
#

Yeah ok

vernal venture
#

Can this be cleaned up at all?

this addAction 
[ 
    "<t color='#96afff'>Gear Up</t>", 
    { 
        params ["_null", "_caller"]; 
        _arsGroup = groupID group _caller; 
        switch (_arsGroup) do 
        {
            if( groupId (group player) == "BlackOps") then
            {
                default {[blackops_box, _caller] call ace_arsenal_fnc_openBox}; 
            };
            if( groupId (group player) == "Undercover") then
            {
                default {[undercover_box, _caller] call ace_arsenal_fnc_openBox}; 
            };
        }; 
    } 
];
#

I'm not in game to try it, so I'm not sure from looking at it if it'll even work

robust hollow
#

whats the point of declaring a switch statement if you use an if statement to decide what exists inside it? just scrap the switch all together

vernal venture
#

Fair point. I thought I had to define caller in some way like that.

fair drum
#

so haven't used initPlayerLocal.sqf yet. Can I put any normal .sqf scripting commands in there or do I have do some extra parameter setup or anything.

robust hollow
#

works same as everything else. its only special because it is automatically executed for you.

fair drum
#

mk so if I use the variable player in the initplayer, it only targets the player that connected just then? such as,

if (isServer) then {
    [player, "AfricanHead_03"] remoteExec ["setface", 0, player];
};

or do I have to use playableUnits

robust hollow
#

well.... initPlayerLocal is only going to execute on that player... so unless that player is the host, an isServer if statement is completely useless.

fair drum
#

ok then so I should be able to just do

player setface "AfricanHead_03"

and it will apply that skin to every player that joins the game since player is local in the initPlayerLocal

robust hollow
#

no, because only the connecting player would see the changed face.

#

initPlayerLocal does not execute on all clients every time a player connects. it executes on the client connecting. it is called initPlayerLocal so you can tell it apart from:
init - which executes on the server and players as they connect
initPlayerServer - which executes on the server when a player connects
and initServer - which executes on the server when the mission starts

#

so you would still want to remoteexec setface

fair drum
#

mk... so use initPlayerServer with the remoteExec above. i saw a clause saying avoid using initPlayerServer.sqf so I was trying to avoid that

robust hollow
#

yea

fair drum
#

would I still use the player variable? how would I tell it to modify only that player that connected? would I have to var every playable unit in the mission?

robust hollow
#

it only executes on the connecting player, so you can either use player or _player from params ["_player", "_didJIP"];

fair drum
#

kk ty

robust hollow
#

oops, partially misread ur message. with initPlayerServer player wont work so use the param variable.

#

just read the wiki its all very straight forward ๐Ÿ‘Œ

fair drum
#

thats what i was wondering. so _playerunit

robust hollow
#

yes

fair drum
#

so I will have to do it for a specific unit var as _playerUnit is undefined until mentioned. I don't want to have to var every playable unit though. what about something like:

{[_x, "AfricanHead_03"] remoteExec ["setface", 0, _x]} forEach playableUnits
robust hollow
#

u saying ur going to run that every time a player connects?

fair drum
#

nah just wondering if that would work so I don't have to do something like unit1, unit2, unit3... etc individually

robust hollow
#

whats wrong with _playerunit?

fair drum
#

well i get an error when I use:

[_playerUnit, "AfricanHead_03"] remoteExec ["setface", 0, _playerUnit]

saying its undefined

robust hollow
#

so define it

#

params ["_playerUnit", "_didJIP"];

fair drum
#

I guess I haven't learned that yet

robust hollow
#

........ legit just paste it on the line above the remoteexec

fair drum
#

Oh. Guess I need to look up how params work in the grand scheme of things. It seems obvious to you but I thought it was telling me something else.

winter rose
#

usually, parameters are provided in the _this variable.
params "names" and "filters" elements of an array
if no left-argument is provided, params uses the _this variable

params ["_playerUnit", "_didJIP"];
// is approximately the same as
private _playerUnit = _this select 0;
private _didJIP = _this select 1;
```@fair drum ๐Ÿ™‚
velvet merlin
#

is there a way to trigger MEH Ended also if you quit a mission via ESC menu?

ebon citrus
#

can i attach a variable to a ctrl?

#

it's a string variable, so i could use text, but i need text to display texture

still forum
#

setVariable also accepts a control as argument yes

ebon citrus
#

oh, alright

#

thank you

ebon citrus
#

is there a way to detect if a magazine is for a primary weapon or handgun?

if the answer is crawling the config, i'll do that myself, im just asking if there exists a way

winter rose
#

no command for that afaik

ebon citrus
#

i see

#

im stuck in the config aswell

#

there isnt specificly linking anything

#

i basically need to find out the weapon that uses a specific magazine

#

and i feel like iterating through the whole config is a bit time-consuming

winter rose
#

a magazine can go in many weapons (see "magazine wells" in config)

ebon citrus
#

oh yeah, i forgot this part

#

basically i need to find out if the magazine is for a primary weapon or a secondary

#

but that wont work

#

since a magazine for a pistol can be used in some primary weapons

#

can i find the "first" magazine well a magazine can fit into?

#

might just have to make a list of magazine wells?

#

or make a lsit of magazines

#

i really hate hardcoding

still forum
#

can i find the "first" magazine well a magazine can fit into?
There is no ordering in config like that

ebon citrus
#

can i get A weapon a magazine fits into?

#

just any one

still forum
#

you can parse all weapons, and iterate through all magazines for all weapons and find the ones that fit

ebon citrus
#

that's exactly what i want to avoid, but if need be, yeah

winter rose
#

parse magWells, stop at the first that has the magazine, parse all weapons, stop to the first that can take that magWell

ebon citrus
#

that's so heavy XD

#

would have to parse at mission-start

#

"bake" the config for my kind of use

#

why is legacy arma stuff so hard in arma 3

winter rose
#

(and, no, there is no compatibleWeapons)

ebon citrus
#

yeah, that's good

#

thanks

#

yep, it looks like i'll have to make a list of magazines

#

ok, hey

#

usually, secondary weapon ammo doesnt fit into primary weapons

#

except for the kriss

#

and sting (scorpion evo)

winter rose
#

9mm is a b****, innit

ebon citrus
#

it is

#

but with the mods i'll be running, the magazines wont have cross-compatibility between sidearm and primary

#

i'll just array intersect a list of primary weapon mags and one for secondary weapons

#

and then find in the primary array

#

or make just one for secondary mags

#

and all the rest are either grenades, primary weapons, missiles/rockets or extra

#

yeah, that would work

#

Thanks Lou and ded!

#

hmmm

#

is "weaponClass" the config entry for the weapon name?

#

i cant open the config with the mods loaded and im too lazy to launch without mods ๐Ÿ˜…

#

for foxes den, how do i get the className from the config

#

because there doesnt seem to be any standardized data-name for it

#

i tried _generalMacro

#

but CUP doesnt like that

#

can i jsut use the end of the config?

#

configName

winter rose
#

๐Ÿ”จ

warm hedge
#

Improving a skill be like

ebon citrus
#

i continued my project of writing the arma 2 inventory in arma 3

#

for my arma 2 arma 3 conversion mod/collection

ebon citrus
#

is there a command to remove a magazine from weapon?

#

or will i just delete the weapon and add it back without a magazine ๐Ÿ˜…

#

does removeMagazines also remove the magazine in the weapon?

warm hedge
#

There's no direct command to do it, but setUnitLoadout will do some workaround IMO

ebon citrus
#

mmmh

warm hedge
#

Oh wait a minute...

#

Correction: removePrimaryWeaponItem/removeSecondaryWeaponItem/removeHandgunItem do the thing

ebon citrus
#

nice

#

is there a overflow issue with arma 3?

#

in sqf

#

is it possible?

warm hedge
#

What do you mean?

ebon citrus
#

never mind, weird edits

#

i was wondering because i had some strange values in known variables

#

but it was just windows

#

yep, it works

#

๐Ÿ‘

#

now shower

brave jungle
#

I need to get the classname of a squad from a display name that has been filtered to a faction.

  ("true" configClasses (configfile >> "CfgGroups" >> _side >> _curSelFac >> "Infantry")) apply {
    systemChat str _x;
    lbadd [2102, getText( _x >> "name")];
  };
``` is my current code, basically i'm asking how can I "backtrack" from a displayname, simple loop that iterates with given displayname, or is there a better way?
high silo
#

When im trying to get AI to load into a vechile, is it better to use getpos or getposatl

A = getPosATL heli1;
  
    _tra1 = team1 addWaypoint [A,0];
    _tra1 setWaypointType "GETIN";

brave jungle
#

Example no.2

high silo
#

Im using ATL atm, it moves the AI just right of the heli. I dont understand why.

#

Thats what im reading through now

brave jungle
#

I tend to just play around with the ones that are relevant until they're what I need

high silo
#

Each time I run it they goto the same pos, which is strange and dont get in

brave jungle
#

I would have done team1 addWaypoint [Heli1, 0];

winter rose
#

addWaypoint [heli, 0]

brave jungle
#

If its moving it wont update iirc

winter rose
brave jungle
#

Yeah that ^

high silo
#

Will try that and change the waypoint from GETIN to Load as its going to run on a dedicated server

winter rose
#

โ€ฆwut? what is the difference, dedi or not?

high silo
#

According the the wiki under Get In Nearest "On a dedicated server, an AI unit will only get in vehicles that are empty."

#

So I updated the script, and the AI still move but dont actually get in the helicopter... Idk why. They just crowed around it

#

Maybe its because load only works group to group... Will have to play around

winter rose
#

Get in nearest, not Get in

high silo
#

That doesnt work, thats my issue

winter rose
#

did you attach the waypoint to the vehicle?

high silo
#

They just huddle around the vechile

#

I placed it on the helis pos

#

addWaypoint [heli, 0]

winter rose
#

not enough, I believe

brave jungle
#

Yeah that doesn't attach it

#

ha beat ya Lou

high silo
#

Ya just googled that, reading up on it now

winter rose
#

zdahp ninja'ing meh or i ban u D:

brave jungle
#

Bump on my question ;)

ebon citrus
#

I dont know if this is true in arma 3, but i recall waypoint under helicopters being set off to to the side in arma 2

#

Move waypoints would always be placed in a circe around the helicopter instead of right under it

exotic flax
#

Get In Nearest
The group will only move to the waypoint if there are any empty vehicles, or vehicles on the group's side with empty seat spaces, that are within about 50m of the waypoint's location.
...
On a dedicated server, an AI unit will only get in vehicles that are empty.

ebon citrus
#

Possibly to make AI not walk under a landing heli

winter rose
#

@brave jungle you can't exactly backtrack precisely, as groups could have a same name (e.g BLUFOR/OPFOR Scout)

brave jungle
#

I feared that too, just not sure how to retain the classname for later use

exotic flax
#

can't you use stuff like lbSetData or lbSetValue as hidden variables?

high silo
#

So im looking at something like this?

    _tra1 = team1 addWaypoint [heli1,0];
    _tra1 setWaypointType "GETIN";
    [_tra1, 2] waypointAttachVehicle heli1;
winter rose
#

private _classPath = _x
lbEntry setVariable _classPath ?

#
_tra1 = team1 addWaypoint [heli1, 0];
[_tra1, 2] waypointAttachVehicle heli1;
_tra1 setWaypointType "GETIN";
```maybe this ^ is better
brave jungle
#

Ugh... more rework of my code :c

#

Didn't think the setData etc

#

so i'll look into it

winter rose
#

you can hopefully store config, yes ๐Ÿ˜‰

exotic flax
#

no idea how it works though... never got into GUI stuff myself that deep...

winter rose
#

backtracking would be awful really ๐Ÿ˜„

brave jungle
#

backtracking would be awful really ๐Ÿ˜„
Yeah in hindsight if it errored it would be catastrophic hah

#

infinite loading screen

high silo
#

So with [_tra1, 2] waypointAttachVehicle heli1; I got a error saying it got a array but expected a group...

#

Will changing the _tra1 to the group fix that?

winter rose
#

@brave jungle

// just kidding, don't try this at home
private _t = time + 10;
private _thread = [] spawn { /* backtrackingCode */ };
waitUntil { time > _t || not isNil "TAG_resultVariable" };
if (isNil "TAG_resultVariable") then {
  terminate _handle;
};
#

@high silo
_tra1 is absolutely not speaking. would you have named it _getInWaypoint, you would get it ๐Ÿ˜‰

high silo
#

Well either way, hes running to the same bush like a moron. And not getting in the heli right next to him.

    _getinwaypoint = team1 addWaypoint [heli1, 0];
    [_getinwaypoint, 2] waypointAttachVehicle heli1;
    _getinwaypoint setWaypointType "GETIN";
``` Better ๐Ÿ˜‰
winter rose
#

no
waypointAttachVehicle takes a waypoint

high silo
#

So this?

    _getinwaypoint = team1 addWaypoint [heli1, 0];
    [team1 , 2] waypointAttachVehicle heli1;
    _getinwaypoint setWaypointType "GETIN";
``` cos if yes it still doesnt work
winter rose
#

have you considered, you know, using _getInWaypoint?

#

๐Ÿ˜„

#

you don't have to number them manually, the engine does that itself
grab the waypoint reference from the addWaypoint, and only use this from there

also, don't blindly copy/paste from the wiki ๐Ÿ‘€

high silo
#

I think I get what you mean

_getinwaypoint = team1 addWaypoint [heli1, 0]; 
waypointAttachVehicle heli1; 
setWaypointType "GETIN";
#

Or am I completely missing it

#

and should just cry in a ditch

winter rose
#

waypointAttachVehicle takes a waypoint
setWaypointType takes a waypoint

#

sooo use the waypoint ๐Ÿ˜„

high silo
#
    _getinwaypoint = team1 addWaypoint [heli1, 0]; 
    _getinwaypoint waypointAttachVehicle heli1; 
    _getinwaypoint setWaypointType "GETIN";
``` **cries** this?
winter rose
#

YESSS yes, that is it ^_^

high silo
#

So it worked but only one got in, so now I have to backtrack and find where I went wrong.

#

Thankyou btw ๐Ÿ™‚

shut shadow
#

Is there any way to check if an item is going to cause a premium content DLC message when attempting to pick it up?

warm hedge
rancid basalt
#

I've got a very broad question, but I would like to modify an Official BIS mission function, and I was wondering how I should go about doing that? Of course I cannot modify the pbo, but can I just rewrite the function locally in description.ext or something like that?

warm hedge
#

You're true

winter rose
#

@rancid basalt you cannot override a BIS function unless you use a mod
you can create a new one if you want.

shut shadow
#

thanks @warm hedge

#

I'm looking for some of the inventory items added by Old Man, I think they may be too recent for this list though, unless I'm typing my classnames wrong

winter rose
#

the list is for A3 v1.98, it should be fine @shut shadow

warm hedge
#

Maybe they aren't listed, suppose aren't restricted tho

rancid basalt
#

@winter rose Alright, thank you. I was, specifically looking to add a menu tab to the Warlords game-mode to add the ability to purchase groups into High-Command. I noticed Jezuro made an edit to Warlords where he added some menu features.

ebon citrus
#

i guess there is no script to remove a magazine with a specific ammo count from a unit's inventory

#

addMagazine takes a parameter for ammount, but removeMagazine doesnt

#

looks like i'll have to write my own function for removing loadout-elements

exotic flax
#

Remove all, add whatever you need ๐Ÿค”

ebon citrus
#

i was expecting embed, but i guess that's disabled for a reason

#

or...

#

setloadout

#

im just going to write a function that gets loadout, removes whatever is needed and sets loadout

exotic flax
#

getloadout -> modify array -> setloadout

ebon citrus
#

exactly

#

but in function form

#

because it's a repetitive task

#

not really a question

#

just something i found curious

#

wouldn't be hard to do, engine-side

exotic flax
#

Get and set loadout are actually functions in Arma ๐Ÿคฃ

ebon citrus
#

i guess there is no script to remove a magazine with a specific ammo count from a unit's inventory

#

addMagazine takes a parameter for ammount, but removeMagazine doesnt

exotic flax
#

magazinesDetail gives a list of magazines with ammo count, although afaik it's not possible to remove by ID.
Although you could see how many have x amount ammo, and then remove (or not add) that amount of new magazines

ebon citrus
#

is there a wildcard parameter in sqf?

#

i need to find a an array inside an array

#

but one of the members of that array is unknown, but irrelevant

still forum
#

no

#

findIf

ebon citrus
#

fair enough

#

yeah, that works

#

just not as clean

winter rose
#

if it is a "pair", there are the findInPair functions

ebon citrus
#

sadly it's 3

#

3 elements

#

yeah, it works well

high silo
#

Me again... Im trying to spawn random group at a random location. It works but they keep spawning in the same location each time I execvm the sqf. Anyknow know if a script thats been execvm once it gives the same results every time?

#
_locationArray = [
    ([6864.03,1092.65,0]),
    ([7307.99,744.952,0]),
    ([7441.67,849.606,0]),
    ([7389.13,456.576,0]),
    ([7591.29,340.919,0]),
    ([7888.78,434.569,0]),
    ([7759.82,517.202,0]),
    ([7593.39,690.979,0])
    ];

_locationToSpawn = selectRandom _locationArray;
#

Thats how im picking a random one.

#

Does it save the location once picked unless restarted?

ebon citrus
#

assuming container to remove item from is unit's uniform

params["_unit","_className","_count","_container"];

_unitLoadout = getUnitLoadout _unit;

switch ( toUpper _container ) do {
            case "UNIFORM": {
                _uniform = (_unitLoadout select 3);
                _uniformItems = (_uniform select 1);
                _index = _uniformItems findIf {_x select 0 == _className && _x select 2 == _count};
                _item = (_uniformItems select _index);
                _item set [1, (_item select 1)-1];
                _uniformItems set [_index, _item];
                _uniform set [1, _uniformItems];
                _unitLoadout set [3, _uniform];
                _unit setUnitLoadout _unitLoadout;
                systemChat "dropped";
                
            };
            case "VEST" : {
            
            };
            case "BACKPACK" : {
            
            };
    };

passed arguments are ["_unit","_className","_count","_container"]
where _unit is the unit, _classname is the className of the magazine, _count is the amount of rounds in the magazine and _container is the inventory-item. HAVE NOT CONFIGURED VEST AND BACKPACK YET

high silo
#

Nevermind, its picking at random each time. But its the marker im using the check thats not working. Nevermind ๐Ÿ˜„

still forum
#

Does it save the location once picked unless restarted?
it can't

ebon citrus
#

Ded, can you check if my code is stupid?

#

it works ๐Ÿคทโ€โ™‚๏ธ

#

but im not confident

still forum
#

looks pretty annoying to read

ebon citrus
#

i hate not being able to array[index][index]

winter rose
still forum
#

_uniformItems set [_index, _item]; useless
_uniform set [1, _uniformItems]; useless
_unitLoadout set [3, _uniform]; useless

ebon citrus
#

what?

still forum
#

code is too short to need sqfbin

ebon citrus
#

ok, im coming from C

still forum
#

same thing in C

ebon citrus
#

not...

#

wait...

#

so it returns a pointer?

still forum
#

every variable in SQF is a reference to a value

ebon citrus
#

i thought it returns a copy of the array

#

not a pointer to the array

#

is there a copyarray?

still forum
#

+_array

ebon citrus
#

so thsi would return a copy of an array?

_item = ((_uniformItems select _index)+[]);```
still forum
#

no

#

thats...

#

looks like a syntax error

#

and thats not what i posted

ebon citrus
#

yep

#

dont get stuck on that

still forum
ebon citrus
#

edited the opriginal post

#

wopuld that return a copy of the array?

still forum
#

still a stupid way to do that

#

it would result in a copy

#

but thats not what I wrote

ebon citrus
#

_item = (+(_uniformItems select _index));

#

yes, because i wrote it

still forum
#

weird, and inefficient.. but yeah

ebon citrus
#

would that do the trick?

still forum
#

if _item is an array then outside + will copy less

#

yeah. but outer parenthesis not needed

ebon citrus
#

does it matter in performance?

still forum
#

but in your code snippet above, I see no reason to copy

ebon citrus
#

yep

still forum
#

does it matter in performance?
parenthesis no

ebon citrus
#

i jsut wanted to know what was the syntax for copy

#

thanks for the quick lesson

#
_uniform = (_unitLoadout select 3);
                _uniformItems = (_uniform select 1);
                _index = _uniformItems findIf {_x select 0 == _className && _x select 2 == _count};
                _item = (_uniformItems select _index);
                _item set [1, (_item select 1)-1];
                _unit setUnitLoadout _unitLoadout;
                systemChat "dropped";```
#

better?

#

dont focus on the systemchat

#

that's jsut for debug

still forum
#

+[] please don't

ebon citrus
#

yes, i saw that

#

it escaped

#

syntax error

still forum
#

that is for concatenating two arrays, the copy is a side effect

ebon citrus
#

and i typed it there by accident

#

corrected

#

it was unintentional edit

still forum
#

that'll work.
you could do
_uniformItems = _uniformLoadout select 3 select 1

#

to shorten it

ebon citrus
#

yep

#

i can do (_uniformItems select _index) set [1, (_item select 1)-1]; aswell?

#

or is that too unreadable

#

it would save me one variable

still forum
#

no, _item would probably be undefined in your snippet

ebon citrus
#

oh yeah

#

i need that

#

good eyes

still forum
#

whether you get rid of _uniformItems or _items... not much difference`
besides that _items is much more useful

ebon citrus
#

anyways, thank you lots

#

i would totally not have noticed that pointer-related mistake

#

is the effect of addMagazineAmmoCargo global?

#

im blind

#

it is...

#

can i get a hammer?

#

@exotic flax magazinesAmmo seems more useful than MagazinesDetail for scripting

#

magazinesDetail seems more about string representation, giving you an easy way to display magazine info for the user

#

magazinesAmmo gives an array with 2 elements per magazine, one for the classname and one for the ammo count

uncut rapids
#

yes and if you want more detail, ie location of magazine in containers (uniform,vest,backpack) and whether its loaded or unloaded in a weapon you could use magazinesAmmoFull which comes in handy sometimes, idk what your end goal is tho

ebon citrus
#

my end goal is convoluted and useless

#

i.e. Arma 2 inventory in Arma 3 ๐Ÿ˜…

uncut rapids
#

understood

#

been a while since I've played A2 I cant even remember the UI if I tried lol

ebon citrus
#

still need to move the pistol magazines to the pistol-bar

#

whole backpack is unfuctional

#

need to do that

#

im just fixing stuff with the main inventory still

uncut rapids
#

that looks pretty good though

#

im assuming the map, compass, etc would go on the bottom boxes?

ebon citrus
#

yep

#

the allignment still needs work, it's just there to be close

uncut rapids
ebon citrus
#

๐Ÿ˜…

#

all planned out

#

there is just a lot of script that needs to be written to handle all kinds of edge-cases

#

but it's progressing

#

why? Idk, im pissed that i couldnt finish it a few months ago and gave up

#

now im back

uncut rapids
#

i feel that

ebon citrus
#

but yeah, i handled that issue already

astral dawn
#

:O
Arma preprocessor deletes commas from a string passed as macro argument?!

#define STUFF(text) [text]
STUFF("Hello,,, 123")

If I preprocess it, I get this:

[""Hello 123""]
plain current
#

Macro arguments may be composed of any characters, as long as they do not contain a comma (because commas are used as argument-delimiters).

astral dawn
#

Jesus Christ... (this atop of all other problems with this preprocessor)

plain current
#

Have fun ๐Ÿ˜‰

astral dawn
#

(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

#

Spent so much writing my beautiful framework for managing text to meet this in the end

plain current
#

Note however that although the macro gets resolved properly, the comma gets removed from the String *(probably a bug)*.

astral dawn
#

I know but I don't want to have missing , in my texts. Any workaround for this?

plain current
quaint ivy
#

Yo, its a bit easier for me to ask here than to search so: If I have a variable that represents an object or a marker, and I delete that object/marker, does the variable automatically get deleted after some time because it's value is nil?

astral dawn
#

No, variable will become objNull for the object case

#

isNull

#

but not nil

#

marker reference is just a string, when you delete marker the variable will remain in its previous value (string)

#

regarding my problem: another idea - make string not part of macro

quaint ivy
#

So to get it deleted, do I manually have to nil it?

astral dawn
#

you should, but if you are using global variables, you should rethink if you really need them

#

perhaps you can just ignore this issue, unless you are having 1000s of such variables, and in this case it gets quite interesting, why would you have it like this

ebon citrus
#

right is 0

#

can i not compare numbers with != ?

astral dawn
#

generic error ๐Ÿ˜„

#

you can

#

are you sure it's 0?

ebon citrus
#

yep

#

wait

quaint ivy
#

_right has to be a number

astral dawn
#

:DD

ebon citrus
#

it's not a number

#

it's a string

quaint ivy
#

lol

ebon citrus
#

if(_left != "0")

#

fixed

#

XD

#

i forgot that you cant set numbers into a listnbox

quaint ivy
#

@astral dawn Im working on a system that can create random missions. With such a system i need a good cleanup script. My cleanup script works perfectly when it comes to automatic detection of enemies that should be deleted, however I'm looking for a way to pass additional garbage to it. My issue comes from the fact that the missions are completed trough a trigger so I need a way to pass this variable on trigger activation.

ebon citrus
#

fixed a dupe-glitch in my inventory

astral dawn
#

@astral dawn Im working on a system that can create random missions. With such a system i need a good cleanup script. My cleanup script works perfectly when it comes to automatic detection of enemies that should be deleted, however I'm looking for a way to pass additional garbage to it. My issue comes from the fact that the missions are completed trough a trigger so I need a way to pass this variable on trigger activation.
You should consider using OOP for this
|| i must hide myself, the hate for OOP is incoming||

ebon citrus
#

if the target had no gun, but you had a gun, the game would swap your gun to the target but retain a copy with you because the target's gun was none-type

brave jungle
#

I'm looping to add each config path for each squad via a list box selection (was talked about earlier today here, got busy) via:

_squadArray = "true" configClasses (configfile >> "CfgGroups" >> _side >> _curSelFac >> "Infantry");
  {
    lbadd [2102, getText( _x >> "name")];
    lbSetData [2102, _forEachIndex, _x];
  } forEach _squadArray;

then simply attempting to extract via lbData and using the lbCurSel , however it returns as "" meaning lbSetData isn't working, anyone used this command before and can shed some light on it?

plain current
#

lbSetData only takes strings as the data

brave jungle
#

So it does...

#

Ha

ebon citrus
#

lnb > lb

#

fight me in a civil manner which wont involve any arguments or flaming/trolling

#

armleft๐Ÿ‡ฑ๐Ÿ‡ณ๐Ÿ‡งarmright

plain current
ebon citrus
#

is in case sensitive with strings?

cunning crown
#

In think so

ebon citrus
#

time for toUpper

cunning crown
ebon citrus
astral dawn
#

are you redoing arma 2 inventory?

ebon citrus
#

yep

astral dawn
#

cool

#

but you could take arma 2 inventory from arma 2 I think?

#

or is it hardcoded?

ebon citrus
#

i think it is

#

and you couldnt

#

because some of the stuff arma 2 inventory evidently relies on is not present in arma 3

#

and it's not a for the end goal

#

it's for the journey

tough abyss
#

Suggestion for that Inventory would be to change the colors and thatโ€™s it would looks amazing with different colors

#

Ik itโ€™s based on Arma 2 colors but yeah just a suggestion

ebon citrus
#

you can change the colors, that's not an issue

tough abyss
#

Yeah ik

ebon citrus
#

well, you cant change the background

#

but colour stuff is still to come

tough abyss
#

Why?

ebon citrus
#

the very very background is a static image

#

because i couldnt get the arma 2 cut corners in arma 3

tough abyss
#

Oh ok

ebon citrus
#

everything else but the corners is a ctrl

#

and the filter-list

cunning crown
#

because i couldnt get the arma 2 cut corners in arma 3
You can just create images for these cutted corner ^^

ebon citrus
#

yeah, but that would defeat the purpose

#

im pretty sure you can change the colour still

#

arma 3 can tint pictures in controls? irhgT?

#

well, will have to look into it at a later date

#

there's a lot visual-wise that's still WIP

astral dawn
#

arma 3 can tint pictures in controls? irhgT?
As I recall, yes

#

like markers

ebon citrus
#

mmmh

cunning crown
#

I'm pretty sure that it can recolor a blank white picture so yeah probably

ebon citrus
#

im tackling the backpack-code next

#

the backpack or the description box

#

either one

#

๐Ÿคทโ€โ™‚๏ธ

#

i need to change the scrollbar of the inventory to the arma 2 one aswell

#

non-issue, i've done it before

cunning crown
#

Imo, the best is to do that brown rectangle with the cutted corner an image and the rest just static things, then you can recolor it easily (if you want)

ebon citrus
#

yeah, youre right

#

but that's visual stuff

#

i need to adjust the alpha and the fonts aswell

#

but im doing the stuff that actually matters first

#

this inventory wont allow you to change uniforms, vests, hats etc. either

#

and it probably wont work with all uniforms out-of-the box

#

since you need to configure the uniforms to have sick inventory capacity

#

but im including modded uniforms with it

#

arma 2 dealt inventory capacity in slots. Arma 3 deals in weight

#

so either i have to change all item weights... or i can make the uniform inventory huge

#

not a difficult one

#

you wont be able to overfill the slots, though

#

and if you want a magazine to take more than 1 slot, you need to configure it with the mod

#

unfortunately

#

i'll probably configure all vanilla-items

#

but modded items will be up to you

#

i'll work through all the modded items in cup etc. as i have time

#

and make them into compatibility patches

#

that's the plan, atleast

ebon citrus
#

the backpack is weird

#

hmmm

#

might do it in my own way

#

i dont like hardcoding it

#

i'll see to improving it later

#

and i know

warm venture
#

Alright so im trying to make it so SWAT can use UAVs on my server. I set their character slots to UAV operators, which is fine if they go up and "hack" the uavs, then it gives them control to them (even though they are spawned in by the altis life vehicle buying system), but I want to know what code runs when you say to "Hack UAV" so I can make it automatically happen when they buy one

ebon citrus
#

ummm...

#

check the script that's attached to the action?

warm venture
#
if (typeOf _vehicle == "B_UAV_02_F") then {
    player connectTerminalToUAV _vehicle;
};
#

I'm doing this, but it doesnt seem to do anything..

restive leaf
#

Do they have a UAV terminal sided with the UAV in question?

#

They also have to have it equipped when the command is run

warm venture
#

Yes, NATO uav terminal.

#

if I spawn it through infistar then hack it, it works

#

through infistar, I need to spawn it then hack it, then it works fine. If I hack one spawned by altis life's vehicle system, I cant take controls but I can connect to it..

restive leaf
#

Oh, don't know anything about Altis Life...

warm venture
#

my code looks fine though?

exotic flax
#

Nothing wrong with that piece of code, but can't tell how bad the rest is...

warm venture
#

well the rest is all stock.

exotic flax
#

Arma 3 stock? Or some Life framework stock?

#

And which side is SWAT? NATO, OPFOR, INDEP?

#

(since it's not A3 vanilla)

tough abyss
#

@exotic flax the tonic framework

ebon citrus
#

is there a way to detect if a display is destroyed by ESC. Im having no luck with onDestroy

sahInvEh = (findDisplay 5730) displayAddEventHandler ["Destroy", {
            systemChat "closed";
            (findDisplay 5730) displayRemoveEventHandler ["KeyDown", sahInvEh];
        }
];```
#

@warm venture player is a local variable

#

are you running this code in server-environment or client-side?

warm venture
#

On the server, in a client script.

#

the server references the player by "player"

ebon citrus
#

it cant

#

player only exists on clients

warm venture
#

_vehicle setVariable ["vehicle_info_owners",[[getPlayerUID player,profileName]],true];

#

thats in the altis life script.

ebon citrus
#

player is the player object

warm venture
#

it works fine in all other aspects

ebon citrus
#

where is this running?

winter rose
#

it works fine in all other aspects
so the script is client-side ๐Ÿ˜„

warm venture
#

fn_vehicleShopBuy.sqf on altis life 5.0

#

@winter rose As I said, its running on the server, in a client script.

#

its not a mod.

winter rose
#

"running on the server, in a client script" makes absolutely no sense

warm venture
#

the file is on the server

winter rose
#

"scenario script, executed client-side" maybe more

ebon citrus
#

you'll have more help on the Altis life discord or whatever

warm venture
#

they're worthless

ebon citrus
#

this is way too much context to explain

#

i see

warm venture
#

player connectTerminalToUAV cursorTarget; running that through debug on local doesnt work

ebon citrus
#

is the terminal already connected?

#

If UAV is already connected to another terminal, this new connection will fail.

#

check the return

warm venture
#

its not connected to anything

ebon citrus
#

if it returns false,then the UAV is already connected

#

try isUAVConnected

warm venture
#

if (isUAVConnected cursorTarget) then {hint "Connected";};

#

doesnt hint, so shouldnt be

ebon citrus
#

hey

#

do you have spyglass or whatever?

warm venture
#

Its disabled

ebon citrus
#

it might be filtering the command

#

or BE filters

warm venture
#

even filtering it when run from a script?

ebon citrus
#

it's local

#

if youre running it from the client, then YEAH

#

isnt that obvious?

#

make sure it's not being filtered out

warm venture
#

do be filters go in battleye/launch or just battleye

ebon citrus
#

ask altislife discord

#

i dont mess with that stuff

#

or ask someone smarter here

#

๐Ÿ˜…

restive leaf
#

Most of whom also don't mess with that stuff ๐Ÿ˜‰

ebon citrus
#

there's a time and place for everything

warm venture
#

isnt it universal? for epoch, exile, wasteland

ebon citrus
#

in the same way that linux is universal with windows

#

bad example

#

but the context is too much

#

someone who does not work with the framework will have a hard time just getting up and saying what's wrong with it

#

but im suspecting it's BE filters

#

or spy-gass

#

no offense to tonic

warm venture
#

all the offense

ebon citrus
#

that's what it likes you to think

#

yeah, profanity is bad

warm venture
#

deleted it so i dont get another warning for saying a naughty word on an 18+ game

ebon citrus
#

16*

#

arma 3 is only pegi 16

#

i dont know how

warm venture
#

11 year olds these days swear more than adults.

ebon citrus
#

it has cussing, blood, extreme violence and spiders

warm venture
#

spiders

restive leaf
#

Which is completely irrelevent to a policy on what is acceptable in a company discord...