#arma3_scripting

1 messages Β· Page 655 of 1

void panther
little raptor
# void panther https://nopaste.chaoz-irc.net/view/a451f37f#L42
  1. That is a really bad approach. What if more units are created later?

  2. In MP you should use MPKilled
    https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#MPKilled
    and the EH should only be added once

  3. Why do you arbitrarily remove EH id 0? Get the correct EH ID:
    https://community.bistudio.com/wiki/Magic_Variables#thisEventHandler

  4. Some of the commands you're using require special locality handling, for instance:
    https://community.bistudio.com/wiki/removeAllItems
    takes local arguments

void panther
#
  1. I know, want to get this to work first
  2. okay
  3. didn't work what is stated in the documentation. 0 works for now
  4. yeah, the removeAll stuff is flaky
#

this is of course terrible and very bad. that is my first approach of doing things πŸ˜„

#

I am blind man trying to climb a mountain

#

Not sure what you meant by "EH should only be added once" I only add it once for each returned item, or what do you mean?

little raptor
#

It should preferably be only added by the server

void panther
#

Makes sense

quasi sedge
#

What is best perfomance wise method to :
I spawn "Tochka-u" with

this setVehicleAmmo 0;
#

after 2hrs=7200 seconds i want send ammo to tocka-u

#
this setVehicleAmmo 1;
#

my curr implementation

[] spawn {
if (isServer) then
{
    waitUntil {sleep 7200};
    {
    _tochkaU = setVehicleAmmo 1;
    };
};
};
little raptor
candid cape
#

Hi, can I ask a useless question xd?

#

I have to do a function that if you are not "independent" or have a specific SteamID, you cannot do a certain thing

little raptor
#

So what's the question?

candid cape
#

I have the code, but I don't know how to make the

#

or

#

hola =  ["XXX"];
if (!(getplayerUID player in hola) or (side player != independent)) exitwith 
{
      hint "x";
};
#

that's don't work IDK

little raptor
#

missing )

candid cape
#

No, was my mistake writting here

little raptor
#

where do you exec that?

candid cape
#

in a script, the function I want is that if it does not meet the above requirements, it will not create a dialog

little raptor
#

it's fine
I don't know why you say it won't work

#

maybe you're doing it wrong

#

post the full code

candid cape
#

Can I send you to DM?

winter rose
little raptor
#

What is a video supposed to tell me anyway?!
Post the code
No DM

candid cape
candid cape
candid cape
little raptor
#

I already told you that it's correct

#

It doesn't work because you're doing something wrong in the code

candid cape
#

Imagine that this is the whole code. Why is it not working?

exotic flax
#

Called at the wrong time.
Because if THAT is the code, it will work

#

Btw..
You currently say:

  • player is NOT in UID list
  • OR is not independent

So if in the list, or independent, it will show

#

If in the list and independent, it will show.
If not in the list and not independent, it will show

candid cape
#

So, how can I make that if a player is on the list and is not "Independent" then it doesn't hint?

exotic flax
#

By changing the statement to meet that requirement

winter rose
#

if a player is on the list and is not "Independent"
or and

exotic flax
#
if !(getPlayerUID in hola && side player == independent) exitWith {
   hint "you're not on the list or independent";
};
dusky wolf
#

I'm trying to use BIS_fnc_moduleRespawnVehicle to create vehicle respawn sqfs. No matter what I put in parameter 4 (Code) I seem to get an error for either "Local variable in global space" or "Generic error in expression". I've tried using _vehicle (defined in params), _this, _this select 0, newVehicle, and <newVehicle>. Any ideas what to pass? The script works fine when manually placed in the module
https://community.bistudio.com/wiki/BIS_fnc_moduleRespawnVehicle

agile pumice
#

what's the best way to go about checking which way a door opens?

#

In arma3, do all exterior building doors open outwards?

exotic flax
#

Doors are animations within an object, so not really possible to get information from it.
As for exterior doors; usually they open outwards, but not all objects may follow the same "rule".
There's an forum article with the same question and some scripts which may be useful: https://forums.bohemia.net/forums/topic/229618-return-direction-of-a-door/
However I guess the only "perfect" method is to make a list of all the doors of each building and define the direction (and side) it opens.

It may be possible to calculate it based on the animation settings in the configs, but no idea how to identify which door is which.

agile pumice
#

I already know how to identify which door is which

#

I actually was reading this same forum post the other day

exotic flax
#

Main issue is that you don't know how a door is placed in an object, so even if you know which door it is and how it rotates, you still don't know from which position into which direction.
Have seen this question pop-up a couple of times with the same result; nobody knows how to do it reliably.

hallow mortar
# dusky wolf I'm trying to use BIS_fnc_moduleRespawnVehicle to create vehicle respawn sqfs. N...

Have you tried wrapping the code in {} or ""?
Also, as the name implies that function is designed only for internal use by the vehicle respawn module, so it isn't very well documented. You might have better luck spawning the module itself and syncing the vehicle to it.
To understand it better, try finding the function in the editor Function Viewer under Tools, so you can see how it works. Or look up one of many vehicle respawn scripts that aren't designed for internal module use...

dusky wolf
#

I've wrapped it in {} but I haven't tried making it a string with ""
I'm hoping to avoid use of the respawn module itself to make adjustments much easier as it's being maintained in a github repo and merging sqm changes is a pain

hallow mortar
#

I don't mean place it in the editor, I mean spawn it scriptwise using createUnit and...whatever the hell the sync command is

#

synchronizedObjectsAdd

little raptor
# dusky wolf I'm trying to use BIS_fnc_moduleRespawnVehicle to create vehicle respawn sqfs. N...
_init                    = _this param [4,{},[{},[]]];

First of all the init can be both a code ({}) and array (in format [code, params])
Second of all this is how the function executes it:

_initScript = if (typeName _init == typeName []) then
            {
                ([_newVeh,_veh]+(_init select 1)) spawn (_init select 0);
            }
            else
            {
                [_newVeh,_veh] spawn _init;
            };

And you get that error you described for putting any variable name in params/private without starting it with _ (aka local variable)

sudden yacht
#

play = ["videoName.ogv"] spawn BIS_fnc_PlayVideo; trying to play custom video from a mission file. The video is in ogv format. The game just crashes instead. Help....

winter rose
sudden yacht
#

@winter rose thank you

languid oyster
#

I got 2 arrays:
_default = [a,b,b,b,c,c,d];
_current = [a,b,b,c,c,d];
How do I find out, which element is missing in _current?

cosmic lichen
#

@languid oyster Depending on the values inside the array you can use _missing = _array1 - _array2

cosmic lichen
#

["a","b","b","b","c","c","d","f"] - ["a","b","b","c","c","d"] returns "f"

little raptor
#

yeah

#

but I think we should also count every missing element?

#

I don't know which one you meant @languid oyster

cosmic lichen
#

Idk what he wants

slim oyster
#

Count unique elements in arrays and get difference?

languid oyster
#

I am doing a rearm script. I got the problem, that turrets have multiple magazines of same type. My thought: Search the default mag loadout, look the current loadout, compare both.

#

Then slowly add one missing mag after the other. If no mag is missing, search for the one with less rounds than default mag round count, and replace that

cosmic lichen
#

_vehicle setVehicleAmmo 1; does not work in that case?

#

Ah okay

languid oyster
#

It sure does, I wanted more immersion πŸ™‚

slim oyster
#

What about just apply'ing through the loadout mag array and checking status with magazine commands?

#

Can do the timing in the loop

languid oyster
#

hmm, will have a look @slim oyster

little raptor
#

@languid oyster
then do this maybe?

_unique = (_magD arrayIntersect _magD) apply {
    [_x, count _magD - count (_magD - [_x]), count _magC - count (_magC - [_x])]
};

{
    _x params ["_mag", "_cntDef", "_cntCurrent"];
    
    for "_i" from 1 to _cntDef-_cntCurrent do {
        _veh addMagazine _mag;
        sleep 3;
    };
} forEach _unique;
#

_magD is default mags

#

_magC is current mags

languid oyster
#

@little raptor will apply the routine. Let me see, if that works

nova oar
#

hopefully some can help here ive ran out of idea's. im trying to added some Script's to my liberation mission file after following docs for install and lauch for testing i get a error. .CfgSounds: Member already defined. been going at it all day trying to find the issue but no luck

winter rose
nova oar
#

ohhhhh right ill have a look again see if i spot anything πŸ™‚ thank u for fast reply

winter rose
#

note that it might come from an include done twice

nova oar
#

wish the rpt file told me where it was lol its like finding a needle in hay stack

winter rose
#

doesn't it say which entry?

nova oar
#

Yep it doe's think i found what its possibly going on about but now i got to figure i way to sort it.

#

kowning that that erorr was a double up i ended up opening all the main files for the mission and searching everything for cfgsounds and their is a match

cold pebble
#

Is there a way, apart from onToolBoxSelChanged, to find out what selection the user has made on a toolbox? And is there a way to set a toolbox selection via script

upbeat magnet
#

Trying to make the rhsusf_M1238A1_M2_socom_d respawn with the woodland camo. Any idea what I would input in this code for that to happen?


if !(isServer) exitWith {};

private _code = {

    params["_veh"];

    _veh removeMagazines "RHS_48Rnd_40mm_MK19_M1001"; //Removes canister ammo from Mk19 variants
    _veh removeMagazines "rhs_mag_100rnd_127x99_mag_Tracer_Red"; //Removes default magzines
    for "_i" from 1 to 8 do {_vehicle addMagazine "rhs_mag_200rnd_127x99_mag_Tracer_Red"}; //Adds n magazines
    _veh loadMagazine [[0], "RHS_M2", "rhs_mag_200rnd_127x99_mag_Tracer_Red"]; //Loads turret magazine
    [_veh, 26] call ace_cargo_fnc_setSpace; //Sets cargo space
    [_veh, 80] call ace_cargo_fnc_setSize; //Sets cargo size
    ["ACE_Wheel", _veh, 4] call ace_cargo_fnc_removeCargoItem;
    [_veh, 2, "ACE_Wheel", true] call ace_repair_fnc_addSpareParts; //Adds spare wheel
    _veh setPlateNumber "1/7 Cav"; //Set plate number

    [
    _veh,
    ["W",1], 
    ["hide_rhino",1,"hide_ogpkover",0,"hide_ogpknet",1,"hide_ogpkbust",0,"DUKE_Hide",1]
    ] call BIS_fnc_initVehicle; //Handles vehicle appearnence```
#

I've tried putting "woodland" here:

["W",1],

but nothing. I'd appreciate any suggestions

eager prawn
#

I'd like to create a "Simunition" script. Simunition is ammunition that is definitely painful, but does not kill - useful for training scenarios. I'm trying to make it ACE compatible, with a specific magazine, so that if you have a specific magazine loaded in your weapon and fire at another player, it knocks them out for a few seconds but does not kill them or otherwise injure them (would be cool if it would include a temporary pain effect from ACE though).

Right now, I've written a cfgPatch to create a new 5.56 magazine variant from RHS, and then I'm also retexturing the magazine orange to indicate that someone is loaded with simunition. I've tried a couple ways to handle the "knockout target but don't hurt them" part of the script, but I'm having difficulty.

#

Would anyone be able to point me in the right direction?

#

My first idea was to have a handleDamage event handler running on each player at all times, which checks to see if the ammunition is simunition or not. If not, it'd just allow damage, and if yes, then it wouldn't allow damage. I ran into two roadblocks - My group has 50-60 people at events and I'm worried an event handler on each of them would cause lag in a heavy firefight when a lot of hits are being taken, and also I could not find a function to determine what type of ammunition you're being hit by.

#

I tried finding a taser script to look at for guidance but it seems like all the taser mod creators have obfuscated or .ebo'd their mods 😬

little raptor
cold pebble
#

Hmm, I was thinking the same however my laptop can’t run ArmA, will have to wait till I’m back at my PC πŸ˜‚

little raptor
little raptor
# eager prawn I'd like to create a "Simunition" script. Simunition is ammunition that is defin...

if you're modding try hit = 0 and indirectHit = 0 for the ammo.
https://community.bistudio.com/wiki/CfgAmmo_Config_Reference
Also the handleDamage EH does return the projectile. So you can find out what you're being hit with
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage

params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
_ammoType = typeOf _projectile;
random bramble
#

Hi all, does anyone how to sequence An Ai Catapult Launch from the USS NImitz while using the CAT shuttle from the Asset Browser

upbeat magnet
random bramble
eager prawn
#

@little raptor thank you! I'll try that

#

I think ACE does overrule the damage handling if I remember correctly though

little raptor
# upbeat magnet I'm in the config window, how do I check it's animationSources/textureSources

It's very obvious. Look at the "tree" on the left. You'll see AnimationSources and TextureSources (you must first navigate here if you don't see them: configFile >> "rhsusf_M1238A1_M2_socom_d")
You can expand those tree items too. Those that have the property source = "user" in them can be customized by you.
Once you have what you want to modify, simply use its config name with BIS_fnc_initVehicle

upbeat magnet
#

Thanks!

little raptor
eager prawn
#

Ahh understood! Thanks!

upbeat magnet
#
    _veh,
    ["Woodland",1], 
    ["hide_rhino",1,"hide_ogpkover",0,"hide_ogpknet",1,"hide_ogpkbust",0,"DUKE_Hide",1]
    ] call BIS_fnc_initVehicle; //Handles vehicle appearnence```
#

I tried >_<

#

I did it! It was supposed to be rhs_woodland ^_^ Thanks again!

thin trail
#

For class names, are wildcards a thing? Like instead of listing all rhs_ i can just have rhs_*?

still forum
#

depends on what you are doing

#

probably not

stable badger
#

hi everybody. I search a solution for get position of an object in a lbadd array.

I explain :
I have a listBox and A mapView.
My listBox set all Object with "Land_Building_exod" classname.
I want, when i click on the object in the lbadd, set the position in my mapView. But I search and i don"t know how to do that :/

tender fossil
#

Is there a way to force AI to drive over a shallow part of a river with a boat that the default AI behaviour refuses to cross?

distant oyster
stable badger
#

Huum explain ?

distant oyster
#

On mission start (if the array of objects is static, say, does not change during the mission):

TAG_selectableObjects = allMissionObjects select {typeOf _x == "Land_Building_exod"}; // instead of allMissionObjects ofc how you return the objects

Display is opened, fill the listbox:

{
  _ctrlListbox lbAdd format ["Building %1", _forEachIndex];
} forEach TAG_selectableObjects;

When another entry is selected, eg via onLBSelChanged

params ["_ctrlListbox", "_index"];
_building = TAG_selectableObjects  select _index;
stable badger
#

My problem is not for add my buildings on the listbox πŸ˜„

#

Here my listBox :

class ListBox: Life_RscListNBox
        {
            idc = 95002;
            sizeEx = 0.041;
            coloumns[] = {0,0,0.9};
            drawSideArrows = 0;
            idcLeft = -1;
            idcRight = -1;
            rowHeight = 0.050;
            x = 0.221176 * safezoneW + safezoneX;
            y = 0.28088 * safezoneH + safezoneY;
            w = 0.112148 * safezoneW;
            h = 0.506 * safezoneH;
            onLBSelChanged = "_this call life_fnc_pmvSelected;"
        };

And My pmvSelected don't execute :/

private ["_control","_selection","_spCfg","_sp"];
_control = [_this,0,controlNull,[controlNull]] call BIS_fnc_param;
_selection = [_this,1,0,[0]] call BIS_fnc_param;


Hint "test";
#

I try just a hint test in my pmvSelected but nothing.
And i can't get an info of my lbadd

#

My OpenDir.sqf do this :

disableSerialization;
createDialog "life_menu_dir";

//chpmv_aut & chpmv_dep
_list = CONTROL(95000,95002);
_pmvAll = [];

{
  _pmvAll pushback _x;
} forEach (nearestObjects [[worldSize/2, worldSize/2],["chpmv_aut","chpmv_dep"],worldSize]);

{
  
  _list lbAdd format ["PVM - %1",vehiclevarname _x];
  _pos = getpos _x;
  _list lbsetData [1,str _pos];
  _list setVariable ["data",_x];
} forEach _pmvAll;

And this working fine

stable badger
#

But i can't have the data, this return always any

little raptor
stable badger
#

Thx, it's work perfect now

#

Go CtrlMapAnimAdd now πŸ˜„

stable badger
#

It working, and now nothing ... Fucking eventHandler.
Just a hint "test"; wont work

exotic flax
#

are you sure the function is setup correctly?

thin trail
#

So, Im trying to check a variable's value but it never returns anything. I'm execting the code on a player (dedicated server) and its returning nothing.
_this getVariable ["HALs_money_funds", 0]

exotic flax
#

how did you set it?

thin trail
exotic flax
#

so why not use those functions instead?

stable badger
#

@exotic flax yes my functions setup properly now. I can have my selectedIndex by LbCursel but not by the params ::

thin trail
#

Tehy arent working either

#

I try running [_this] call HALs_money_fnc_getFunds; and it returns nothing

#

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

(_unit getVariable ["HALs_money_funds", 0])

#

is what its params are from its function file

stable badger
#

_this equal ?

thin trail
#

what?

exotic flax
#

what if you change it to player? perhaps your _this doesn't exist or is something else

stable badger
#

_this return a selectedIndex or something else no ?

exotic flax
#

it should be the unit or player you want to check

thin trail
#

Nope, returning nothin'

#

How do I refer to a player in multiplayer in it?

exotic flax
thin trail
#

Okay [player] call HALs_money_fnc_getFunds; this worked but im only getting the value of my own money.

#

I need to replace player with whatever I need to use for another player

exotic flax
#

in that case you need to get the player object of the other player

#

a bit hard to tell you how without knowing what you want, have and expect

stable badger
#

Yes i know, i've my return @exotic flax But it doesn't work with the param ... I need to use my lbcursel like that :

_dialog = findDisplay 95000;
_list = _dialog displayCtrl 95002;
_sel = lbCurSel _list;
_pmv = _list lbData _sel;
_pos = call compile format ["%1", _pmv];
thin trail
#

I welcome it all Grez. I really need to do this lol

exotic flax
stable badger
#

I try

#

Thx man now it's working perfectly :p

thin trail
#

So uh, how does refering to a player object work?

exotic flax
#

again; without knowing what you want, what you have and what you expect it's not possible to give a single answer on that

thin trail
#

Well I dont know what I really need to tell you. I have a player who isn't me on a dedicated server, Ive got debug console, and all I want is a way to do [<unit>] call HALs_money_fnc_getFunds;

#

Like replace unit with that player.

exotic flax
#

Does the other unit have a variable name?

thin trail
#

No

exotic flax
#

in that case you'll need to loop over all the players, check if it's the one you want, and use the object in that function

thin trail
#

What do you mean loop?

exotic flax
#
{
   if (profileName _x == "Name of player") then {
      hint [_x] call HALs_money_fnc_getFunds;
   };
} forEach allPlayers;
thin trail
#

Wow so I just replace Name of player with their exact name and i get it?

exotic flax
#

btw... you might want to check the wiki on how to do stuff and learn how to script SQF, because you should at least know the basics if you want to make modifications (instead of just Copy&Paste from random sources)

thin trail
#

I do refer sometimes but scripting isn't really my favorite thing in the world lol

exotic flax
#

because this Discord is not to write stuff for free, we help those who at least are trying themselves...

#

and if you don't like scripting, simply don't 🀣

thin trail
#

I know that wasn;t my intent mate I didnt know referring to a person required a script like that lol seemed like an easy thing but apparently not

#

That's why I asked "How" instead of "Can you"

exotic flax
#

there are hundreds of ways to do that, but each one depends on the situation

#

which is why I asked for more info

thin trail
#

Right well thanks for the help. The thing you wrote unfortunately didn't work when I put it into debug console

#

I assume I'll need to find some way to refer to people, or rather just assign all slots a variable name

#

And then figure out how to find what variable each player is under.

solid kernel
# little raptor no

I was thinking about

  1. use unitCapture/unitPlay to manually find path over the shallow part. (drawback: no engine sounds)
  2. use an agent as driver and setDestination with "LEADER DIRECT" as planning mode. (drawback: can't get the boat to go at full speed)
little raptor
solid kernel
#
  1. record a path with unitCapture where you cross it and play it with unitPlay for the AI boat when it comes near the shallow
little raptor
solid kernel
#
  1. agents with setDestination "LEADER DIRECT" will just go directly to the destination disregarding any obstacles (like soldiers getting in to vehicles and walking through walls).
little raptor
#

no they won't

solid kernel
#

I have tested both of those methods they really work. But yes, they are not real pathfinding methods, just best approximations I could come up with.

little raptor
solid kernel
#

It does, just give a destination to the agent and put the agent into a boat. The boat won't go through ground but it will go over that shallow part that the AI would not.

little raptor
solid kernel
#

my follow up questions would be:

#

is there a way to have unitPlay make engine sounds?

#

is there a way to make agents drive at full speed?

little raptor
open hollow
#

I just managed to do this, im not sure how can it be used... but here it is, maybe some one find it usefull

waituntil {!isnull(findDisplay 12) };

//poly = allMapMarkers apply {getMarkerPos _x};
//systemchat str _poly;
//inPolygon polygon
poly = allMapMarkers apply {getMarkerPos _x};

findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",{
    params ["_map"];
    //poly = allMapMarkers apply {getMarkerPos _x};
    private _colorBLU = [0,0.3,0.6,0.5];
    private _colorOP = [0.5,0,0,0.5];
    private _colorIND = [0,0.5,0,0.5];
    _sub = 64;
    _radio = worldSize/_sub;
    _r = (_radio*0.866);
    Puntos = [];
    for "_y" from 0 to _sub do {
        for "_x" from 0 to _sub do {
            if (_y%2==0) then {
                _npos = [2*_x*_r,_y*_radio*1.5,0];
                if (!(surfaceIsWater _npos) && _npos inPolygon poly )  then {
                    Puntos pushBack _npos;
                };
            }else{
                _npos = [(2*_x*_r)+_r,_y*_radio*1.5,0];
                if (!(surfaceIsWater _npos)&& _npos inPolygon poly) then {
                    Puntos pushBack _npos;
                };
            };
        };
    };
    {
            _vertices = [];
        for "_i" from 0 to 5 do {
            _vertices pushBack (_x getPos [_radio,(360/6)*_i] );
        };
        for "_i" from 0 to 5 do {
            _punto_2 = _i + 1;
            if (_punto_2 > 5) then {_punto_2 = 0};
            _map drawTriangle
                        [
                            [
                                _x,
                                _vertices select _i,
                                _vertices select _punto_2
                            ],
                            [0.5,0,0,0.5],
                            "#(rgb,1,1,1)color(1,1,1,0.5)"
                        ];
            };
    }forEach Puntos;
}];
#

https://imgur.com/xD2hbtc

It makes exagonal areas im trying to use it in a dinamic mision im working on it... but yea... fun to code, but no idea where to use it lol

little raptor
real tartan
#

is there an oposite function to BIS_fnc_relPosObject ? #getRelativePositionOfObjectFromSource

winter rose
#

worldToModel something?

open hollow
#

Then I move it all into the event handler to modify the β€œpolygon” in real time using marker on map

slate cypress
warm hedge
#

Must be local. No point to make it global

fresh wyvern
#

Anyone know how to trigger this one when an infantryman on foot uses thermal vision?

if (currentVisionMode player == 2) then
{
    setViewDistance 300;
    setObjectViewDistance 300;
};

While this one here is triggered when using thermal in a vehicle?

if (currentVisionMode player == 2) then
{
    setViewDistance 3000;
    setObjectViewDistance 3000;
};
fringe yoke
#

How can I tell if a vehicle has an engine, collision lights, flaps, etc?

plain creek
#

Is there a good tutorial about spawnable visual effects for Arma 3? And is it possible to create an orbital laser effect from base game effects? (Think of it as big a glowing line)

fringe yoke
fringe yoke
#

That's the default state, doesn't actually tell you if they exist or not

hallow mortar
#

Can you check what actions a vehicle has by default? (Can't look at config myself ATM) if so you could check that for references to collision lights as usually there's a toggle action for them

open hollow
#

https://imgur.com/23Wlgt2
well, i optimized the code, still use the points as global variable son can change the color from the polys mid mission via script (also to generate the grid only once, and not on each frame)

#

#define RADIUS worldSize/64
#define r RADIUS*0.86


/* makes the poit grid to draw the hexagons
    .        .        .        .        .        .        .
.        .        .        .        .        .        .        .
    .        .        .        .        .        .        .
*/
private _points = [];
for "_y" from 0 to 64 do {
    for "_x" from 0 to 64 do {
        if (_y%2==0) then {
            _points pushBack [2*_x*r,_y*RADIUS*1.5,0];
        }else{
            _points pushBack [(2*_x*r)+r,_y*RADIUS*1.5,0];
        };
    };
};

//Filter points
data  = [];
{
    _color = [0,0.3,0.6,0.5];

    //Markers only on Land
    if !(surfaceIsWater _x) then {
        data pushback [_x,_color]
    }else{
        for "_i" from 0 to 5 do {
            _rpos = _x getPos [worldSize/64,60*_i];
            if !(surfaceIsWater _rpos) exitwith {data pushback [_x,_color]};
        };
    };
}foreach _points;

//Execute this locally on the player
waituntil {!isnull(findDisplay 12)};
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",{
    params ["_map"];
    // Hexagon Draw taking points as input, can be modificated and polys change
    {
        _x params ["_pos","_color"];
        _vertices = [];
        for "_i" from 0 to 5 do {
            _vertices pushBack (_pos getPos [worldSize/64,60*_i] );
        };
        for "_i" from 0 to 5 do {
            _punto_2 = _i + 1;
            if (_punto_2 > 5) then {_punto_2 = 0};
            _map drawTriangle
                [
                    [
                        _pos,
                        _vertices select _i,
                        _vertices select _punto_2
                    ],
                    _color,
                    "#(rgb,1,1,1)color(1,1,1,0.5)"
                ];
            };
    }forEach data;
}];

#

this will be more eficient with hasmaps πŸ˜„

quasi sedge
#

TLAM launch script, all works great, but does it performance-wise? g10 g20 is bots, g1 g2 is VLS's

sleep 10;
1 = g1 spawn {
    _vls = _this;
    {  
    _vls setWeaponReloadingTime [gunner _vls, currentMuzzle gunner _vls, 0];
        west reportRemoteTarget [t1, 30];  
        t1 confirmSensorTarget [west, true];
        _vls fireAtTarget [t1, "weapon_vls_01"];
        uiSleep 3.1; 
    } forEach [t1,t1,t1,t1,t1,t1];
    deleteVehicle g10;
    deleteVehicle g1;
};
2 = g2 spawn {
    _vls = _this;
    {  
    _vls setWeaponReloadingTime [gunner _vls, currentMuzzle gunner _vls, 0];
        west reportRemoteTarget [t1, 30];  
        t1 confirmSensorTarget [west, true];
        _vls fireAtTarget [t1, "weapon_vls_01"];
        uiSleep 2.5; 
    } forEach [t1,t1,t1,t1,t1,t1];
    deleteVehicle g20;
    deleteVehicle g2;
};
open hollow
#

it will be executed only once... so not a big hit

quasi sedge
#

yep, just cosmetics before start of the game

open hollow
#

maybe deleting the misile after 5/10sec so dont explode can be useful

#

but still

#

cruice misiles dont make a big hit lol

quasi sedge
quasi sedge
#

if missile explode far away from players, that's definitely costs server time, esp with playerCount over 220

little raptor
open hollow
# quasi sedge how?

this should work

_vls addeventhandler ["fired",{
 [_this select 6 ] spawn { 
  sleep 5;
  deletevehicle (_this select 0);
}}];
#
if !(isserver) exitwith{};
g1 addeventhandler ["fired",{
 [_this select 6 ] spawn { 
  sleep 5;
  deletevehicle (_this select 0);
}}];

sleep 10;
1 = g1 spawn {
    _vls = _this;
    {  
    _vls setWeaponReloadingTime [gunner _vls, currentMuzzle gunner _vls, 0];
        west reportRemoteTarget [t1, 30];  
        t1 confirmSensorTarget [west, true];
        _vls fireAtTarget [t1, "weapon_vls_01"];
        uiSleep 3.1; 
    } forEach [t1,t1,t1,t1,t1,t1];
    deleteVehicle g10;
    deleteVehicle g1;
};

g2 addeventhandler ["fired",{
 [_this select 6 ] spawn { 
  sleep 5;
  deletevehicle (_this select 0);
}}];
2 = g2 spawn {
    _vls = _this;
    {  
    _vls setWeaponReloadingTime [gunner _vls, currentMuzzle gunner _vls, 0];
        west reportRemoteTarget [t1, 30];  
        t1 confirmSensorTarget [west, true];
        _vls fireAtTarget [t1, "weapon_vls_01"];
        uiSleep 2.5; 
    } forEach [t1,t1,t1,t1,t1,t1];
    deleteVehicle g20;
    deleteVehicle g2;
};```
#

use that on init server if you dont want a spam of missiles lol

open hollow
little raptor
#

I think the hashmap might be even slower πŸ€”

still forum
#

hashmap would be slower

#

hashmap over network is basically two arrays

open hollow
#

:c

plain creek
#

Is it possible to make a spotlight source, that looks like a laserbeam?

west grove
#

i'm trying to use the new setObjectScale on Land_ClothShelter_02_F but it doesnt seem to work

#

first thing i noticed is that using setObjectScale on a non-simple object will crash the game

#

so i figured.. why not transform the object into a simple object first and then run setObjectScale on it ... but the problem is, i seem to be too stupid to get a pointer

still forum
#

non-simple objects only works in eden editor

#

and is broken in current dev branch

west grove
#

ok, i guess that explains the crash

#

what do you mean with "only works in 3den editor" -- where else would it work?

#

ok, managed to get it to work. quite a hassle.

grim wing
#

can someone help me, not sure why this is not working

_WhiskeyClasses = ["Whiskey_Lead", "Whiskey_Pilot"]; 
_WhiskeyCount = "_WhiskeyClasses" countType units player`
still forum
#

Ah else.
Well singleplayer/multiplayer for example

quasi sedge
agile pumice
#

can someone help me get an accurate door angle that's relative to world space?

    _posAxis = _building selectionPosition format ["Door_%1_axis", _doorNum];
    _posPlayer = _building worldToModel (ASLToAGL getPosASL player);
    //_return = false;

    _doorAngle = _posTrigger getDir _posAxis;
    _doorAngle = [_doorAngle, 0] call BIS_fnc_cutDecimals;*/

I did some testing on a building with doors facing north/south, and the angle read 270 even though the doors opened in 2 different directions

#

I'd like a result where the angle reads positive and negative

dusky pier
#

Hi, i made a mission with enemy AI's (OPFOR side).
In editor - they works good, they shoot me when i walk near, but in multiplayer - is not works. They just looking at players, but don't shoot them.

I made settings with setFriend (before creation group), but nothing is changed

{
    east setFriend [_x,0];
    _x setFriend [east,0];
} forEach [west,civilian,independent];

Maybe i doing something wrong?

little raptor
little raptor
little raptor
dusk badger
#

_crate = _this select 0;
["AmmoboxInit",[_crate,false,{true}]] spawn BIS_fnc_arsenal;

_nvgoggles = [
"False"

_availableHeadgear = [
"True"
];

_availableGoggles = [
"True"
];

_availableUniforms = [
"True"
];

_availableVests = [
"True"
];

_availableBackpacks = [
"True"
];

_availableweapons = [
"True"
];

_availablemags = [
"True"
];

_availableaccs = [
"True"
];

[_crate,((backpackCargo _crate) + _availableBackpacks)] call BIS_fnc_addVirtualBackpackCargo;
[_crate,((itemCargo _crate) + _availableHeadgear + _availableGoggles + _availableUniforms + _availableVests + _availableaccs)] call BIS_fnc_addVirtualItemCargo;
[_crate,(magazineCargo _crate + _availablemags)] call BIS_fnc_addVirtualMagazineCargo;
[_crate,((weaponCargo _crate) + _availableweapons)] call BIS_fnc_addVirtualWeaponCargo;

#

can someno take a look and tell me if it has sense

agile pumice
#

@little raptor the trigger point is at the center of the door, so using getdir with the axis is how the angle is determined. But that angle is only relative to the door itself

little raptor
little raptor
dusk badger
#

wich one?

agile pumice
#

very top, by Lou

#

@little raptor I need to detect if the axis is on my left and the handle is on my right, what's a mockup of that code look like?

#

I'm not sure which vector math to use

little raptor
#

@agile pumice if you want _doorAxis and _doorTrigger to be on either side (not necessarily one left and other right):

((player getRelDir _doorAxis) - 180) * ((player getRelDir _doorTrigger) - 180) < 0
dusk badger
#
/* _crate = _this select 0;
["AmmoboxInit",[_crate,false,{true}]] spawn BIS_fnc_arsenal;


_nvgoggles = [
    "False"

_availableHeadgear = [
    "True"
];

_availableGoggles = [
    "True"
];

_availableUniforms = [
    "True"
];

_availableVests = [
    "True"
];

_availableBackpacks = [
    "True"
];

_availableweapons = [
    "True"
];

_availablemags = [
    "True"
];

_availableaccs = [
    "True"
];


[_crate,((backpackCargo _crate) + _availableBackpacks)] call BIS_fnc_addVirtualBackpackCargo;
[_crate,((itemCargo _crate) + _availableHeadgear + _availableGoggles + _availableUniforms + _availableVests + _availableaccs)] call BIS_fnc_addVirtualItemCargo;
[_crate,(magazineCargo _crate + _availablemags)] call BIS_fnc_addVirtualMagazineCargo;
[_crate,((weaponCargo _crate) + _availableweapons)] call BIS_fnc_addVirtualWeaponCargo; */
hint "good!";
#

like this?

little raptor
#

why did you comment it out?

#

remove /* */

dusk badger
#

oh...

dusky pier
little raptor
dusk badger
#
_crate = _this select 0;
["AmmoboxInit",[_crate,false,{true}]] spawn BIS_fnc_arsenal;


_nvgoggles = [
    "False"

_availableHeadgear = [
    "True"
];

_availableGoggles = [
    "True"
];

_availableUniforms = [
    "True"
];

_availableVests = [
    "True"
];

_availableBackpacks = [
    "True"
];

_availableweapons = [
    "True"
];

_availablemags = [
    "True"
];

_availableaccs = [
    "True"
];


[_crate,((backpackCargo _crate) + _availableBackpacks)] call BIS_fnc_addVirtualBackpackCargo;
[_crate,((itemCargo _crate) + _availableHeadgear + _availableGoggles + _availableUniforms + _availableVests + _availableaccs)] call BIS_fnc_addVirtualItemCargo;
[_crate,(magazineCargo _crate + _availablemags)] call BIS_fnc_addVirtualMagazineCargo;
[_crate,((weaponCargo _crate) + _availableweapons)] call BIS_fnc_addVirtualWeaponCargo;
hint "good!";
#

this means is alright, right?

little raptor
#

syntax wise it seems so
logically no

#

not "true" "false"

dusk badger
#

so %All for all classes, Null for no classes and classnames for specifics

little raptor
#

there is no such thing

#

At least not that I know of

#

you must specify all classnames

#

no need to copy paste them tho

dusk badger
#

ok let me read those

#

thank you

little raptor
#

np

#

@dusk badger for example to get all mags:

_availableMags = "getNumber (_x >> 'scope') == 2" configClasses (configFile >> "cfgMagazines");
dusky pier
dusk badger
#
_availableweapons = "getNumber (_x >> 'scope') == 2" configClasses (configFile >> "CfgWeapons");

so for weapons will be this one, and the all I have to do is add the to a crate via BIS_fnc_addVirtualItemCargo

fresh wyvern
#

Hi, is there any eventhandler for using thermal or looking through a scope?

verbal saddle
# grim wing can someone help me, not sure why this is not working ```sqf _WhiskeyClasses = [...

_WhiskeyClasses is a variable, "_WhiskeyClasses" is a string, those two things are not the same.
Assuming that Whiskey_Lead & Whiskey_Pilot are available class types you'll need to check for each one separately, e.g ("Whiskey_Lead" countType units player) + ("Whiskey_Pilot" countType units player), but you can do one better by going through the array of units once, and checking them against both, rather then going through the array twice.

private _WhiskeyClasses = ["Whiskey_Lead", "Whiskey_Pilot"]; 
private _WhiskeyUnits = [];
{
  private _unit = _x;
  // Go through each item in the classes list and check to see if the unit is one of them,
  // findIf stops once one of the items returns true, so if the unit is a Whiskey_Lead,
  // we don't need to check if they are a Whiskey_Pilot.
  if (_WhiskeyClasses findIf { _unit isKindof _x } > -1) then
  {
    // This unit is either a Whiskey Lead or Whiskey Pilot
    _WhiskeyUnits pushBackUnique _unit;
  };
} foreach units player;

// If you want an array of units which are either whiskey lead or pilot
_WhiskeyUnits

// If you want the number of units that are either whiskey lead or pilot
count _WhiskeyUnits
timid niche
#

Are there no setItemCargo/setItemCargoGlobal commands?

winter rose
#

add*? @timid niche

timid niche
#

Well then I would have to add all items one by one

winter rose
#

… no?

timid niche
#

rly?

winter rose
#
myCrate addItemCargoGlobal ["itemMap", 50]```
timid niche
#

yes but storing multiple items

#

Can't do

myCrate addItemCargoGlobal [["itemMap", 50], ["ItemWatch", 20]]
#

So would have to do a loop

winter rose
#

forEach yeah

still forum
#

loop da woop

timid niche
agile pumice
#
_selectionPosition = _building selectionPosition [format["door_%1",_doorNum], "Geometry"];
_worldPos = _building modelToWorld _selectionPosition;

Can someone help me find the center position of a door? Getting the point this way doesn't return the center of the door, but rather a corner.

#
_selectionPosition = _building selectionPosition format["door_%1_trigger",_doorNum];
``` works but only for doors with that memory point (a3 buildings)
gloomy musk
#

Hi everyone, I"m struggling to get the hang of scripting... I'm trying to make a simple script that changes a flag texture with an addaction but I can't tell where my syntax is wrong?

flag1 addAction ["Blufor Capture", setFlagTexture "\A3\Data_F\Flags\flag_blue_CO.paa"];```
agile pumice
#

your missing the first param

#

flag setFlagTexture texture

#

flag1 setFlagTexture is what you want

gloomy musk
#

ah, I thought I didn't have to define it since I was specifying

#

that makes more sense, thank you!

exotic flax
#
flag1 addAction ["Opfor Capture", { (_this select 0) setFlagTexture "\A3\Data_F\Flags\flag_red_CO.paa"}];
flag1 addAction ["Blufor Capture", { (_this select 0) setFlagTexture "\A3\Data_F\Flags\flag_blue_CO.paa"}];
gloomy musk
#

Why select0?

agile pumice
#

params ["_target", "_caller", "_actionId", "_arguments"];

#
target (_this select 0): Object - the object which the action is assigned to
caller (_this select 1): Object - the unit that activated the action
actionId (_this select 2): Number - activated action's ID (same as addAction's return value)
arguments (_this select 3): Anything - arguments given to the script if you are using the extended syntax
exotic flax
#

the script part has 4 parameters, and you want the first one (the target, which is the object the addAction is attached to)

gloomy musk
#

ohhhh okay

#

so if I wanted it to also play a hint saying the flag had changed colors, would I add that after setFlagTexture?

exotic flax
#

yup, within the {}

cosmic lichen
#

With remoteExec though

exotic flax
#

setFlagTexturehas global effect

the command executed where unit is local effect of the command will be global and JIP compatible.

gloomy musk
#

so I'd want to do like
flag1 addAction ["Blufor Capture", { (_this select 0) setFlagTexture "\A3\Data_F\Flags\flag_blue_CO.paa"; remoteExec ["hint Blufor have captured point 1", 0] }];

#

I wasn't sure about the "" in remoteExec

#

sorry if this is a dumb question

exotic flax
gloomy musk
#

I did, I was going by use 1
[] remoteExec ["someScriptCommand", targets, JIP];

fair drum
#

question, a fsm can only travel in one direction and its the direction that returns true first correct?

tough abyss
#

Hi guys. Is there anyway I can add one insignia on the right shoulder as possible already but also one on the left?
eg. I want to apply 1 insignia on left and another on right.
I tried google and everything but couldn't find any answer

fair drum
exotic flax
warm hedge
#

Also, no crossposts dude

fair drum
#

any way to spawn a heli at full engine revs?

#

without it being placed in the air

warm hedge
#

setVehiclePosition and setPos workaround

fair drum
#

alllllrighty

fluid wolf
#

Ok ok, I have an odd question. is there a way to do something like getObjectTextures (uniform player); to figure out specific textures making up a uniform in order to see if say, an armband on a uniform is a seperate texture that can be applied onto another uniform with a different armband?

warm hedge
#

getObjectTextures player

#

Or check config

fluid wolf
#

I did getobjecttextures player but it wasn't pulling what I expected, though maybe I wa slooking at it incorrectly. Seemed like it was just giving me the textures for the face, rather than for the uniform I was wearing

#

all else fails yea i can try to find it in the configs but I was hoping I could pull this easier this way

warm hedge
#

No. It will return the uniform's textures

fluid wolf
#

OH yes it does. Apparently only if i go through the arsenal to grab it though for... some reason. Or maybe I was just glitching out. Regardless, I got it! Thank you

little raptor
little raptor
gloomy musk
pine solstice
#

when i am making my mission pramas can i use decimals for the values?

little raptor
winter rose
pine solstice
#

i thought so thank you

brave jungle
#

BIS_fnc_startLoadingScreen is global or local?

cosmic lichen
#

local

brave jungle
#

Cool ty

brave jungle
#

Trying to keep targets down in MP:

//not adding the rest, but the forEach works.
_x addEventHandler ["HitPart", {
  (_this select 0) params ["_target"];
  _target animate ["terc", 1];
  systemChat "hit";
}];

Target stays down in SP but not MP, I'd imagine this has been asked before

#

EH works too, the object that execs sees hit everytime, but even for them the target wont stay down

#

nvm found out its the variable "BIS_poppingEnabled"

little raptor
#

it's missing ]

brave jungle
#

//not adding the rest

#

did a bogged copy paste πŸ˜„

winter rose
#

clooose your EH @brave jungle :p

brave jungle
#

Done

winter rose
#

and use -showScriptErrors flag πŸ˜„ will save you some headaches!

spark turret
#

how can i slingload a crate by script? with having the helo pick it up, just kinda magic attach it to the helo.

exotic flax
spark turret
#

thanks πŸ‘

dusky pier
#

Hi, trying to bring work my multiplayer mission with enemy AI's, but have a problem with AI.

They don't attack players.
(works only in editor...)

I though - problem in CombatMode, Behaviour, Formation or setFriend - changed them, but problem is still not solved :\

Maybe you had same problem with AI, or i doing something wrong?
Thank you!

exotic flax
#

Which sides are the players and AI?

sinful flame
#

Im so looking forward to the new enfusion engines scripting

dusky pier
#

players used all 4 sides, but ai's spawned on eastside. East players can't enter to the area with ai's

sinful flame
#

Does any one know what language it will be or if there are any guides on it yet?

exotic flax
exotic flax
dusky pier
exotic flax
#

you can't change the status of civilians

dusky pier
#

hm, but _civilian addRating -10000; probably will fix that

exotic flax
#

Everyone is friendly toward civilians. Civilians AI have a total impunity and can kill any enemy without retaliation (same as captive units).

#

so the civ may be shot, but won't shoot back

little raptor
dusky pier
#

i used there civilian and independent - for players, so if i have AI's on east side - i can make player on civilian slot - like a renegade for AI, or i understood something wrong

spark turret
#

how do i find out which crates can be airlifted and which cant?

#

also could i maybe force them to be airlifted?

exotic flax
#

I believe an object needs slingLoadCargoMemoryPoints in the config, and the weight shouldn't be beyond what the vehicle can lift.

#

canSlingLoad is afaik the only way to check that

#

although you could check some mods which add custom implementations of slingloading to see how they handle it

spark turret
#

or i attach my crates to an invisible quadbike.

#

but canSlingLoad looks good πŸ‘

#

b_supply_crate_f for anyone interested can be slingloaded (seems to be the only one). thats a big box packed in a green blanket

exotic flax
hallow mortar
#

You can probably hack it with ropeCreate commands if you really want to make it work with something that's not otherwise slingloadable. It won't work quite the same as regular slingloading, though.

fresh wyvern
#

Anyone who know how to add params to this eventHandler?

addMissionEventHandler ["PlayerViewChanged", {
    params [
        "_oldUnit", "_newUnit", "_vehicle",
        "_oldCamera", "_newCamera", "_uav"
    ];
}];
exotic flax
#

Those are the only params available in that EH, so if you need more info you'll need to retrieve it with the data you have in there (eg. attach data to unit, or use missionNamespace)

fresh wyvern
#

ok thank you

hallow mortar
#

There's an upcoming change that will allow you to do some more things with all missionEHs:

Since Arma 3 v2.03.147276 it is possible to pass additional arguments to the EH code via optional param. The arguments are stored in _thisArgs variable
but not yet.

spark turret
#

any suggestion on how to tell if a helo is under heavy fire?

#

i want a condition to abort my supply drop.

fresh wyvern
#
this addEventHandler ["AnimChanged", {
    params ["_unit", "_anim"];
        if (currentVisionMode player == 2) then
        {
            setViewDistance 300;
            setObjectViewDistance 300;
        };

        if (currentVisionMode player == 0) then
        {
            setViewDistance -1;
            setObjectViewDistance -1;
        };        
    }
];

Anyone who know why these animations doesn't trigger the funktions?

winter rose
#

which animations?

fresh wyvern
# winter rose which animations?

I figured it out !! πŸ˜„

I added

player addEventHandler ["AnimChanged", {
    params ["_unit", "_anim"];
        if (currentVisionMode player == 2) then
        {
            setViewDistance 300;
            setObjectViewDistance 300;
        };

        if (currentVisionMode player == 0) then
        {
            setViewDistance -1;
            setObjectViewDistance -1;
        };        
    }
];

to the mission "init.sqf" file πŸ˜„

winter rose
#

yyyes, but does being immobile and switching vision mode work?

#

I believe animChanged is "when changing human anim/posture" not lowering/raising NVGs

fresh wyvern
#

correct! I have not found an event handler for NVG/TI...

winter rose
#

maybe a loop and a waitUntil…?

fresh wyvern
#

good idea but I try to figure out a way to do it without an high performance script.

winter rose
#
while { alive player } do
{
  waitUntil { sleep 0.1; currentVisionMode player == 2 };
  setViewDistance 300;
  setObjectViewDistance 300;

  waitUntil { sleep 0.1; currentVisionMode player != 2 };
  setViewDistance -1;
  setObjectViewDistance -1;
};
```?
little raptor
#

But neither of them is 100% reliable

fresh wyvern
exotic flax
#

Not entirely sure; but perhaps it's possible to trigger a UI event (onLoad, onUnLoad) in case the NVG overlay is actually a configured UI element

#

I know this would work with ACE NVG's, but no idea how this is handled in vanilla

fresh wyvern
unique sundial
#

wiki page

exotic flax
spark turret
#

im trying to make a helicopter land and then afterwards, do other things. bis_fnc_wpLand says on its wiki side:
https://community.bistudio.com/wiki/BIS_fnc_wpLand
Return Value:
Boolean
but:

        _handle = [_grp, getPos _airport, _airport] spawn BIS_fnc_wpLand;
        waitUntil {
            sleep 5;
            systemChat str ["helo landed: ",_handle];
            _handle
        };

throws "handle is type script, expected boolean".
is there no vanilla WP for landing which i can check if its compelted?

fresh wyvern
# unique sundial wiki page

Is it this you are thinking about?

_id = addMissionEventHandler ["EachFrame", { systemChat str [_thisArgs, time] }, [time]];

Basically what I am looking for is a trigger and not a script which checks if a change has occurred.

unique sundial
#

you mean like making event handler for any event you can think of? no you cannot do this then

hallow mortar
exotic flax
#

but that would still require coding around whatever you want to catch as an event

winter rose
tough abyss
#

Sorry!

#

Hi. I'm new to Arma 3 coding and would appreciate help. So here is the randomizeWeapon script; https://sqfbin.com/unuzukiharulacazasuc. How can I call this script in the configVehicles to make my unit either for example get an AK or M4? I only need to know how to call it and how to write. Help would be highly appreciated. Cheers!

pseudo kernel
#

[_this, "Rifles"] call cfp_fnc_randomizeWeapon;

#

That's how you call function.

tough abyss
#

yes but how do I define which weapons I want to be randomised?

winter rose
tough abyss
#

until now, I did like this with gear; ```sqf
randomGearProbability = 80;
headgearList[] = {"SP_M1Helmet_Iran",0.25,"SP_M1Helmet_Tan",0.45,"SP_M1Helmet_GrayDim",0.20,"SP_M1Helmet_Green",0.15,"iri_headgear_desert_camo_helmet", 0.30};

pseudo kernel
#

to much alco

tough abyss
#

and I called it like this; ```sqf
[_this] call CFP_main_fnc_randomizeUnit;

#
init = "if (local (_this select 0)) then {_onSpawn = {_this = _this select 0;sleep 0.2; _backpack = gettext(configfile >> 'cfgvehicles' >> (typeof _this) >> 'backpack'); waituntil {sleep 0.2; backpack _this == _backpack};if !(_this getVariable ['ALiVE_OverrideLoadout',false]) then {_loadout = getArray(configFile >> 'CfgVehicles' >> (typeOf _this) >> 'ALiVE_orbatCreator_loadout'); _this setunitloadout _loadout;[_this] call CFP_main_fnc_randomizeUnit; [_this, "Rifles"] call cfp_fnc_randomizeWeapon; [_this, 'USP_PATCH_IRN_ARMY_GROUND_FORCES'] call BIS_fnc_setUnitInsignia;reload _this};};_this spawn _onSpawn;(_this select 0) addMPEventHandler ['MPRespawn', _onSpawn];};";
};

#

So like this?

#

how can I define which weapons I want to be randomised?

#

cheers btw for the help guys.

pseudo kernel
#

All items are defined in config.

tough abyss
#

I see buddy. I may sound retarded but I have not the knowledge like you guys. So far I have been using this with the randomisedUnit things and defined it like this; ```sqf
randomGearProbability = 80;
headgearList[] = {"SP_M1Helmet_Iran",0.25,"SP_M1Helmet_Tan",0.45,"SP_M1Helmet_GrayDim",0.20,"SP_M1Helmet_Green",0.15,"iri_headgear_desert_camo_helmet", 0.30};

pseudo kernel
#

Yep

tough abyss
#

really?

#

Thank you so much going to try right now since I think I already did this and was unsuccesful

#

but gonna give it another try,

pseudo kernel
#

But, you posted RifleList. While example at code, uses RiflesList.

tough abyss
#

Must be it. Gonna give it a try. Much love to you sir.

#
error undefind variable in expression: rifles
#

console. When I place the unit down.

winter rose
#

you mixed quotes up, see highlighted code above

tough abyss
#

cheers, gonna give it a try.

#
error undefined variable in expression: cfp_fnc_randomizeweapon
winter rose
#

this function is apparently not defined πŸ€·β€β™‚οΈ

tough abyss
#

but the script I send?

#

Isn't it defined there?

thin trail
#

ay stupidly simple question that i cant for the life of me find, what's the function that makes that pop up Hold down Space to Interact called?

winter rose
thin trail
#

Perfect thanks. Also house is the best show ever

tough abyss
#

check this @winter rose

#

sorry man I don't want to sound annoying or so. I am pretty new to this as I said.

winter rose
#

the function file exists, but the CfgFunctions must be defined somewhere

fair drum
#

this is a picture of my mission flow FSM so far... is this allowed? I'm trying to have a mainline and then a bonus objective line. https://imgur.com/a/nrJgqsE

i know i can't link two conditions together and that a state will progress only once through whichever line shows true first

tough abyss
winter rose
scarlet flume
#

what command do i use to detele somethink when tiggered, and what one to disable?

winter rose
#

PS: you can add a magnetic grid in the options, so FSM tiles are well aligned πŸ˜‰

fair drum
winter rose
winter rose
fair drum
#

its annoying that it only goes down one line. is there a way to do a "or"?

winter rose
#

well that's the yellow things

fair drum
#

or rather "and" i mean

winter rose
#

well, you can have two conditions in one diamond

#

use variables?

fair drum
#

yeah let me mess around with it some more. i used to do big switch do files for things but I want to learn this since its better apparently

scarlet flume
#

sorry i have a map marker that i would like to be deleted when the tigger is triggered

tough abyss
#

Holy crap my brain just melted reading that wiki. I'm going to dig around more. Cheers for the help this far man. Seems to complicated for a newbie like me. I'm going to dig around.

fair drum
#

no way to get the FSM to go down two lines simultaneously/independently is there?

#

actually, will a state box fire every time that a link comes back to it? or only fire the first time?

scarlet flume
#

thanks

tough abyss
winter rose
#

seems not.

tough abyss
#

Sorry lol. But I just noticed this;

#
/* ----------------------------------------------------------------------------
Function: CFP_fnc_randomizeUnit)
Description:
Randomizes a units weapon and gear loadout based on config
#

This function, I am already using;

#
[_this] call CFP_main_fnc_randomizeUnit;
#

and as above it I can randomize a units weapon

winter rose
#

the file is the function's content.
the game does not know about this file

tough abyss
#

so this is a totally new question. How can I randomize weapon using this function. Throw the other script in the trash that I was asking about. Since I already am using this function to randomize gear and is implented and working, I only need to know how to define how I need to write code for which weapons to randomise. Here is the script; https://sqfbin.com/munigogunojakikoviye

winter rose
tough abyss
#

no, my english might be trash so you must have been misunderstanding. This function/script is working so far and randomises units vests, uniforms, headgear and facewear. It also offers weapon randomisation but how can I call it?

#

for the e.g gear part I called it like this;

#
        //Vests
        vestList[] = {
            "V_TacVest_khk", 0.35,
            "CFP_Tactical1_ACRDesert", 0.12,
            "CFP_Tactical1_3ColorDesert", 0.12,
            "SP_Tactical1_Tan", 0.10
#
        //Rifles
        riflesList[] = {
            "CUP_arifle_G3A3_modern_ris_black", 0.70,
            "CUP_arifle_M16A2", 0.40
        };
little raptor
#

that's not even a call

tough abyss
#

Hi Leopard. But it is working and randomises my vests, uniforms, headgear and facewear already.

#

I just have problem adding the randomisation of weapon.

fair drum
#

@winter rose How about something like this? Would this make sense with FSM logic? Mainly concerned about the children of "Transformers Destroyed". https://imgur.com/a/Rfml6ge

little raptor
#

I mean it's not a function call
And where are you even using that

#

That seems like a config modifcation

tough abyss
#

CfgVehicles

fair drum
#

If you are trying to apply the randomization to any unit that spawns, why don't you use CBA's unit init function and then call the script from there?

winter rose
#

you can also simplify the end by having assault loss/win on Dead Commando

tough abyss
#

It is from CFP mod who has a lot of scripts, including this and I'm just editing a faction of it to fit scenarios.

fair drum
#

I want the win condition to be separate from the objective conditions. the win condition becomes more probable as you complete objectives

#

im just concerned about the transformers destroyed. will that go down two lines at once?

#

or will it only pick one

#

nvm. it threw so many errors its silly hahaha... too many in conditions and out conditions on everything. guess its not possible that way

tough abyss
#
#define GEAR_CATEGORIES ["uniform","headgear","facewear","nvg","vest","backpack","speaker","insignia"]

#define WEAPON_CATEGORIES ["rifle", "handgun", "launcher", "grenade", "explosive"]
#

If it helps understanding...

#

from the .sqf

fair drum
#

this is so much easier if you just write your own basic randomizer script then call it on unit's init event handler as they spawn

tough abyss
#

I see fam. But I am really new to this so I have almost no knowledge. Just the basics.

little raptor
#

private _cat = format ["%1List",_x];

#

#define WEAPON_CATEGORIES ["rifle", "handgun", "launcher", "grenade", "explosive"]

#

that's literally it

fair drum
#
params ["_unit"];

private _helmets = [blah, blah, blah];
private _vests = [blah, blah, blah];
//etc

removeallitems _unit;
removeallassigneditems _unit;
//etc etc

_unit addvest selectRandom _vests;
//ect ect

then you call it using the CBA unit init event handler

fair drum
tough abyss
#

looking into it.

#

@fair drum Yeah lol I just started studying python courses imfao. Only that and HTML5 knowledge.

fair drum
#

the thing is learning the logic behind stuff. i only know .sqf right now but my CS friends say that .sqf is a garbage language and that it will be easy to pick up the others since .sqf has taught me the logic behind coding.

tough abyss
#

the thing that @little raptor wrote is for a new .sqf or editing the already existing one?

fair drum
#

he had posted something for the existing one i think

little raptor
#

all you have to do is take

#

"rifle", "handgun", "launcher", "grenade", "explosive"

fair drum
#

let me see if i can dig into my old stuff when i was learning and send you some things to go off of.

tough abyss
#

Cheers @fair drum, @winter rose and @little raptor

little raptor
#

@tough abyss Also you have to define them under randomWeaponProbability in config

scarlet flume
#

if you can with whats in the game, how would i make a intel acquire mission?

tough abyss
#
randomWeaponProbability = 100;
riflesList[] = {"CUP_arifle_G3A3_modern_ris_black",0.70,"CUP_arifle_M16A2",0.40};
#

So like this?

little raptor
#

I said under it meowsweats

twilit field
#

Hello there, I have little question about triggers in MP and calling some commands.
I have player with name u1, trigger created in editor and its set with on activation: u1 addMagazine "30Rnd_556x45_STANAG" Everything looks fine in SP and in MP when trigger is not server only. But if I set trigger as "server only" than no magazine is added. But command addMagazine have "arguments global" and "effect is global". Why it doesnt work?

little raptor
#

@tough abyss

class CfgVehicles {
  class Blabla
  {
    class randomWeaponProbability {
      rifleList[] = {"CUP_arifle_G3A3_modern_ris_black",0.70,"CUP_arifle_M16A2",0.40};
    };
  };
};
tough abyss
#

sorry lol my english is trash

tough abyss
#

cfgVehicles?

#

oh

#

wait

little raptor
#

@tough abyss wait no

#

I read the script wrong

tough abyss
#

oh

#

lol

little raptor
#

it goes like this

twilit field
little raptor
#

@tough abyss what you wrote was correct:

randomWeaponProbability = 100;
rifleList[] = {"CUP_arifle_G3A3_modern_ris_black",0.70,"CUP_arifle_M16A2",0.40};
tough abyss
#

you are talking about the fnc_randomizeUnit.sqf right?

#

ok

#

testing it rn

#

much love bro

#

no homo

little raptor
winter rose
twilit field
#

ok, I didnt expect that command can have different effect for different syntax... ok

#

I tried it and its correct... u1 addMagazine ["30Rnd_556x45_STANAG",30]; work if its called on server... interesting

tough abyss
#

Okay. One step further! Now when I place units down they spawn with no weapon at all, in a "weapon holding" pose.

#

but no error codes thank god.

#

I can see the HK3 in the hands and quickly disappear after placing unit down in the editor.

winter rose
#

and do not doubt me ever again πŸ˜„

tough abyss
spark turret
#

so i tested AI like a year ago and came to the conclusion that they dont really hear vehicles. seems like their ability to know a helo is approaching is pure LOS.
any suggestion on what knowsabout value is good for feeding the AI the info "theres a helo coming somewhere north"?

little raptor
#

use reveal

#

for air

spark turret
#

yeah but how much? 1 ?

little raptor
#

yeah 1 should be enough

#

4 means they know exactly where it is

#

the higher, the more accurate

spark turret
#

alright, trying that tomorrow.

tough abyss
#

@little raptor last question. You know?

little raptor
#

no

tough abyss
#

aight cheers for all the help m8

hollow lantern
#

whats responsible for making an empty vehicle somewhat hostile? I have a BTR-80A from a mod that for some reason even though it is empty gets targeted by AI units. They don't shoot but still target the vehicle unless there is an actual enemy around. Even tried a simple this setCaptive true; but that didn't change anything

scarlet flume
#

how to set an mission end, to be disabled untill the objective is completed and how to set it to require all players that are alive?

#

to be in area

tough abyss
#

yep the units inventory gets empty when placing the units down. If someone found the solution, pm me. Cheers.

fair drum
hollow lantern
#

now it did

little raptor
#

yeah that

hollow lantern
#

ah I see

little raptor
hollow lantern
#

cost = 40000; threat[] = {1,0.6,0.6};
for the vehicle

#

I see

#

I mean it makes sense to me if the vehicle is occupied, however it is a empty vehicle from the beginning. Guess I just have to live with it then

little raptor
winter rose
scarlet flume
#

thenk you so much

true frigate
#

Hey there! Im trying to get an artillery gun to fire at a target, but randomly. My SQF File apparently has a generic error in line 3, but i cant figure it out.

_rounds = 10; 
while {_rounds>0} do { 
    _dir = round random 360; 
    _dis = round random 150;
    _tgt = target1 getRelPos [_dis, _dir]; 
    gun1 doArtilleryFire[_tgt,_ammo,1]; 
    _rounds = _rounds - 1; 
    sleep 5;
};```
#

its probably a very simple fix honestly, but im quite new to scripting

#

I believe generic error means spelling or such?

winter rose
#

where is that code?

true frigate
#

In the mission folder, next to my mission.sqm

#

Its a .sqf file

#

Ignore me, its working now. πŸ˜‚
im very confused, my arma has been like this since yesterday, something says its wrong, i just reopen the mission and it works first try

little raptor
true frigate
dreamy cave
#

So I want to make it so that when a player steps over a trigger it gives a certain enemy a weapon, I know the give weapon command I just need help telling the trigger who to give the weapon to

agile pumice
#

does the respawned event handler fire for first spawns?

exotic flax
#

Yes, as long as the respawn settings are correct in description.ext

dreamy cave
#

I got a generic error upon activating my tigger

#

opfor addWeapon "hlc_Pistol_M11";

#

thats the trigger upon activatio

#

n

#

I'm trying to make it give a certain soldier a weapon

#

nevermind got it working

#

Is it possible to make a weapon spawn with a mag already in it?

#

Using scripts

warm hedge
#

Use addMagazine before addWeapon

dreamy cave
#

Alright, and for addMagazine do I have to define what to add the magazine to?

#

Because if I did wouldn't it not work considering it's trying to give a magazine to something that is not yet spawned

#

Because I'm trying it so that the magazine is in the weapon when it spawns, making it where the civilian does not have to load it

spice axle
#

Yeah just add the magazine in the uniform or vest or backpack first

#

And then add the weapon

dreamy cave
#

I did, but the magazine doesn't come loaded in the pistol already

#

They would have to load it, giving blufor way too much of a window to react

spice axle
#

Alternatively u can use addWeaponAttachment or something similar called. It does work for magazines too.

dreamy cave
#

alright, so how would I define what to add the attatchment to?

#

Could I just put it after addWeapon?

spice axle
#

Im sry addWeaponItem

#

The Macros are WEAPON_RFM is the weapon classname WEAPON_RFM_STUFF is a string array of attachment classnames

#

_x is the Variable for the Loop of apply over the array

dreamy cave
#

Alright so weapon_rfm is the weapon id name and the weapon_rfm_stuff is the attatchment id name

spice axle
#

It is a array of weapon attachments ids

Just remove the loop. This is only a example

#
yourSoldierVarName addWeapon "yourWeaponClassname";
yourSoldierVarName addWeaponItem ["yourWeaponClassname", "yourMagazineClassname"];
dreamy cave
#

alright, thank you so much

cerulean cloak
#
while {true} do
    {
        private _objtarget = missionNamespace getVariable [format ["targ_n_%1", random [1, 3, 6]], objNull]; 
        
        (gunner light_north) dotarget _objtarget;
        
        sleep random [5, 10, 15];
    };

I've got a searchlight light_north that I want to pan around a series of targets (rocks) targ_n_1 through targ_n_6. The script runs without errors but the light stays still.
What have I done wrong here?

hallow mortar
#

That method of target selection seems a bit weird to me, personally I would use selectRandom from an array of targets, but I don't think it would cause a problem

surreal peak
hallow mortar
#

there is an upper size limit but whoever wrote that didn't know exactly what it was

warm hedge
#

AKA you make an object bigger than certain size (50m?) will destroy the collision and such

winter rose
#

70m iirc

surreal peak
#

ah OK, and im reading this correctly, you cant move these objects once you have set the scale because they wil reset in size?

surreal peak
#

ahhhh so moving means actually getting inside and moving it like that, thought it meant if it moved at all, in hindsight that makes sense

still forum
#

setPos setVectorDirAndUp and such might reset scaling

surreal peak
#

why does attachTo not reset the scaling? Internally, is it not doing essentially the same thing?

still forum
#

its not no

#

attachTo stores rotation relative to parent vehicle

surreal peak
#

ah OK

languid oyster
#

I would like to 'construct' a hint from an array, with each element separated by a line break. This

hint formatText ["%1%2%3%4%5%6%7", "Units on the way:", lineBreak, "A", lineBreak, "B", lineBreak, "C"];

should be turned into something like this:

_unitsEnRoute = ["A", "B", "C"];
hint formatText ["%1%2%3%4%5%6%7", "Units on the way:", 
    { 
        lineBreak, _x
    } foreach _unitsEnRoute
];

Is this somehow possible?

warm hedge
#

Also you can use multiple %1 %2 %3 or whatevers, no need to put the same variable multiple times

languid oyster
#

Ok guys, many thanks, will have a look and work out a solution. But be warned. If it do not make it, I'll be back.

nocturne bluff
#

Don't forget CfgNotifications

cosmic lichen
#

Yes, much nicer than a hint

random bramble
#

Right I'm using Hold Action in eden Enhanced, i'm using an Assembled Device as a nuke that i want to disarm if the action is completed and i want it to explode it the sequence is interrupted whats the code for that please ?

slate cypress
#
_pipCam attachTo [player, [-0.05, 0.1, 0.1], "head", true];

I want to use the followBoneRotation feature but it's not working. Whether it is set to true or false, it doesn't rotate with the head. Is this a bug or am I using it wrong?

still forum
#

Are you on RC branch?

random bramble
still forum
#

Or dev?

slate cypress
random bramble
#

the device*

still forum
#

Should work then think

#

is "head" really valid?

#

try "pilot"

slate cypress
#

No rotation

still forum
winter rose
#

^rotation

still forum
#

Well dunno. I guess that should work

dreamy cave
#

Is there a way I can have a trigger make a civilian go into the "Surrender" state when activated?

slate cypress
#

Make sure the trigger is running on the server only and not globally.

slate cypress
still forum
#

Well I know it works on RC

#

because we use it in Art of War

dreamy cave
#

But would it make someone who is already a civilian put their hands up?

#

I just need a trigger that makes a civilian put their hands up when activated

slate cypress
slate cypress
dreamy cave
#

Thanks for the help but I couldn't get it working, I just used an animation trigger instead

slate cypress
dreamy cave
#

Ah

still forum
#

dev branch is newer than RC

dreamy cave
#

So if I try it with an opfor unit it should trigger the animation?

slate cypress
slate cypress
dreamy cave
#

Is there a way I can easily change a civilian to the opfor team without having to make an opfor unit look like a civ?

slate cypress
#

You can also just create a group with createGroup and use the side as east

#

Then joinSilent into that new group

smoky rune
#

Is there any way to disable outlining/focusing on custom RscText control?

dreamy cave
#

Ok so I put the trigger as "enemy1 setCaptive true;"

#

And when activated did nothing

fair drum
#

If its already on the civilian side, setting it as captive won't do anything. If you are using a civilian unit you need to have it join an opfor group

dreamy cave
#

I tried it with an opfor unit, still nothing

fair drum
#

What is your activation set to

#

On the trigger

dreamy cave
#

BLUFOR

fair drum
#

If you are using a opfor unit and you only want that unit to trigger it and have it stated in the condition box then you have to use Anybody and present for it to fire.

dreamy cave
#

No, I want it so when I or a teamate walk through the door, the civilian or opfor member will put their hands up

#

However

#

When using an animation

#

switchMovee

#

Once the unit is detained or taken prisoner, the animation continues

fair drum
#

Use the action command with surrender.

#

Send me a pic of your whole trigger menu you've done so far

dreamy cave
#

So how would I put that in?

#

The surrender thing

hallow mortar
#

I don't know where the conception has come from that setCaptive puts the unit in a surrender animation. It never has, nor is such a function described on its wiki page.

slate cypress
# dreamy cave So how would I put that in?
// Assuming the civi is civi1...
civi1 action ["Surrender", civi1];

It appears that setCaptive simply sets the unit's side to civilian so that other units do not fire on it. If you don't put the unit into the surrender action, the unit will not be restrained so it is free to walk/run away.
Use setCaptive on units which are not already civilians.

fair drum
#

solved privately for him. he was using ACE and needed the ace function for their surrender instead

winter rose
#

@slate cypress idk

fair drum
#

I did but rather deleted it because its the morning and it would have came out wrong. don't worry about it.

dreamy cave
#

Is there a way I can make a civilian target BLUFOR? I have tried setting their mode to combat and open fire, but they just point the gun and don't do anything.

#

And they don't track the BLUFOR target either.

hallow mortar
#

make them into an OPFOR by joining them to an OPFOR group

cosmic lichen
#

@hallow mortar See the examples on this page

hallow mortar
#

that was one of the examples on that page, which is why I said it

slate cypress
dreamy cave
#

a bit confusing

#

Yeah

#

I tried that

cosmic lichen
#

Ah sorry, I mentioned the wrong guy πŸ™‚

dreamy cave
#

Couldn't get it work

slate cypress
#

send your code

dreamy cave
#

I don't understand the east and west things

#

It had a bunch of x and y values

cosmic lichen
#

use blufor and opfor then πŸ˜„

dreamy cave
#

I tried that, but in this mission i need them to be civilian, and the only other option would be to change very single opfors loadout and make them look like a civilian

#

Which would be very tedious

cosmic lichen
#

Use 3den Enhanced's copy loadout feature πŸ˜›

#

But anyway, the example on the biki should work and is very straightforward

dreamy cave
#

Yeah, but I can't use the same civilian, and would prefer to not flood my saved loadouts with 20+ civilian kits

hallow mortar
#

legitimately, post the code you were using to join them to a group that didn't work

#

it should work and we can troubleshoot it

dreamy cave
#

I didn't make any, I know it sounds very lazy but I am genuinely confused by it

#

i have zero scripting experience

cosmic lichen
#

You have your civilian unit, we call it CIV_SOON_TO_BE_BLUFOR

#

private _eastGroup = createGroup east;
[CIV_SOON_TO_BE_BLUFOR] joinSilent _eastGroup;

#

done

dreamy cave
#

private _eastGroup = createGroup east;

Where would this go?

hallow mortar
#

exactly the same place as the rest of the code, presumably in the On Activation field of your trigger

dreamy cave
#

Alright

#

Got an error

#

private _eastGroup = createGroup east;

enemy2 joinSilent _eastGroup;

#

Thats the exact code

hallow mortar
#

you have to include the []

dreamy cave
#

Alrighty

#

Ok so no erros, however their still not targeting me

hallow mortar
#

things inside [] are Arrays, essentially lists of things. If you have more than one unit, you can put them in the same array to do them at the same time, e.g. [enemy2,enemy3] (not all commands accept Arrays, some commands require Arrays, so check first)

cosmic lichen
#

in the debug console, execute sqf side enemy2;

#

see if it worked. Should be east now.

dreamy cave
#

It showed civ at the bottom

#

Still didn't target me

hallow mortar
#

Add this line to the end of the On Activation field of your trigger:
hint "trigger activated";
and try again

cosmic lichen
#
private _eastGroup = createGroup east;
[enemy2] joinSilent _eastGroup;
side enemy2; ```
Alternatively, restart the preview and execute this in the debug console.
#

If it returns "EAST" then it worked.

dreamy cave
#

Yeah it shows its being activated

#

nothing

cosmic lichen
#

Are you sure your unit is called "enemy2"?

dreamy cave
#

Hold on yeah it shows east

hallow mortar
#

it must be otherwise the previous test wouldn't have returned civ

#

Well if your trigger is activating, and the code in your trigger works otherwise, but the code doesn't work when you put it in the trigger....I can't see what's going wrong.

dreamy cave
#

So there is no code that can just change the civ to the opfor team?

slate cypress
#

@still forum I managed to get it working after verifying game cache. Is the camera supposed to be rotated at an angle on the y axis? I noticed that when followBoneRotation is set to false, it's straight. When set to true, it becomes wonky.

hallow mortar
dreamy cave
#

Is there anything I need to do extra to make the East group a hostile group to BLUFOR, to the point where they will fire at any blufor?

exotic flax
#

use setFriend

#

although works for all units in that side

still forum
hallow mortar
#

You should only need to do that if you've previously made OPFOR friendly to BLUFOR for some reason

#

by default they are as enemy as they can get

dreamy cave
#

Ok I finally got it working

#

private _eastGroup = createGroup east;
[_civilian] joinSilent _eastGroup;

I'm not sure if you pointed it out to me but if you did I am extremely sorry for wasting your time, that command I put up top was ment to be put in the debug, for some reason it wasn't working in the trigger.

#

Yeah it just doesn't seem to want to work in the trigger.

slate cypress
still forum
#

don't mind

hallow mortar
cosmic lichen
#

This works

slate cypress
fresh wyvern
#
player opfor addEventHandler ["GetIn", {
    params ["_vehicle"];

Anyone who knows if this eventHandler only triggers when an opfor player is entering a vehicle?

#
player addEventHandler ["GetIn", {
    params ["_vehicle"];
        if (player == opfor) then {
        [
            "I_LT_01_AA_F"
            ["Indep_03",1],  
            ["showCamonetHull",1] 
            ] call BIS_fnc_initVehicle;}
    };
];

Basically what I want is to change the animation(skin/look) of the vehicle when an opfor player enters the "I_LT_01_AA_F"

slate cypress
#
player addEventHandler ["GetIn", {
    params ["_vehicle"];
        if (playerSide == opfor) then {
        [
            "I_LT_01_AA_F"
            ["Indep_03",1],  
            ["showCamonetHull",1] 
            ] call BIS_fnc_initVehicle;}
    };
];
#

@fresh wyvern

fresh wyvern
slate cypress
#

np πŸ˜„

fresh wyvern
# slate cypress np πŸ˜„

Some how I still don't get the animation to trigger..

This code work so I know that the animation is right.

_veh="I_LT_01_AA_F"createVehicle(player modelToWorld [-8,0,0]); 
[ 
 _veh, 
 ["Indep_03",1],  
 ["showCamonetHull",1] 
] call BIS_fnc_initVehicle;

However i get an error when I apply the this line the code above:

            ["Indep_03",1],  
winter rose
fresh wyvern
winter rose
#

then what is your error; you say it works then it doesn't. which one works, which one does not?

fresh wyvern
#

Perhaps I should add

"I_LT_01_AA_F"

to params swapping out "_vehicle"?

this addEventHandler ["GetIn", {
    params ["_vehicle", "_role", "_unit", "_turret"];
}];
winter rose
#

I don't know what you are trying to do πŸ€·β€β™‚οΈ

tough abyss
fresh wyvern
winter rose
#

then if type of _vehicle is not that, exit the script

#

or
only add that event to vehicles of such type πŸ˜„

fresh wyvern
#

like:

this addEventHandler ["GetIn", {
    params ["_I_LT_01_AA_F", "_role", "_unit", "_turret"];
}];
winter rose
#

No

#

_vehicle will be a (object) reference to the entered vehicle

wind hedge
#

Guys, would this work:

#

_list = player nearEntities ["agentObject", 50];

#

I am trying to detect all the agent units near the player (50 radius)

little raptor
#

But anyway, even if there was, your method is wrong

winter rose
#

agents select { _x distance player < 50 };

little raptor
#
agents select {teamMember _x distance player < 50}
winter rose
#

might be more accurate yes

little raptor
#

@winter rose @wind hedge I meant agent meowsweats

#
agents select {agent _x distance player < 50}
#

agents returns team members meowsweats
I got it backwards πŸ˜…

winter rose
#

agents is stoopid

random bramble
little raptor
#

that's not even valid

#
["task1", "SUCCEEDED"] call BIS_fnc_taskSetState;
little raptor
spark turret
#

Does hideObject disable its simulation?

little raptor
#

kinda

#

it doesn't disable the simulation but the object can no longer interact with the world (the world doesn't see its lods)

#

(e.g. they float in the air, they pass thru objects, etc.)

spark turret
#

So theres no way to slingload an invisible crate?

little raptor
#

make an invisible crate?

#

or find a helper object that can be slingloaded
and can become invisible with obj setObjectTextureGlobal [0,""]

spark turret
little raptor
#

Yeah

#

Did you try setObjectTextureGlobal?

spark turret
#

@real tartan habe you tried the no texture approach?

little raptor
#

maybe it works on some vanilla crate

real tartan
#
// private _helper = createVehicle ["CargoNet_01_box_F", [0,0,0], [], 0, "NONE"];
_helper setObjectMaterialGlobal [0, "\a3\Structures_F\Data\Windows\window_set.rvmat"];
    { _helper setObjectTextureGlobal [_forEachIndex, ""]; } forEach getObjectTextures _helper;
#

this does not work

#

ah, that object does not have hiddenSelections

little raptor
#

@real tartan @spark turret
I recommend you try one of these:

  1. Make a new vehicle inherited from this:
    configFile >> "CfgVehicles" >> "Slingload_01_Base_F"
    and set scope = 1 (the current one is not accessible, because of scope = 0)
  2. Try other vehicles like the quadbike
little raptor
#

that's the easiest way :/

real tartan
#

PaperCar would be perfect, but it does not have slingLoadCargoMemoryPoints

spark turret
#

That means either modding a crate or script attach ropes to the heli

little raptor
#

this kinda works

private _helper = createVehicle ["B_Quadbike_01_F", getPos player, [], 0, "NONE"]; 
{ _helper setObjectTextureGlobal [_forEachIndex, ""]; } forEach getObjectTextures _helper;
#

but it has shadows meowsweats

spark turret
#

Meh i think thats something i could live with

little raptor
#

Also you can see the headlights from the front (but not visible from the back) 🀣

wind hedge
#

Featured specifically for use with the Old Man mini-campaign/scenario, a variant of the Mine Detector exists in the form of the Drone Detector.
It cannot be equipped outside of the scenario without scripting commands, and is functionally identical to regular Mine Detectors. Its main purpose in Old Man is to detect suicide UAVs that patrol the outskirts of large military bases throughout Tanoa; as such, it has a much wider scan range of 200 metres rather than 15.

#

How can I access this Drone Detector?

little raptor
#

Spoiler alert * meowsweats

#

I haven't played OldMan yet notlikemeow

winter rose
wind hedge
#

Yeah but what I care about is the 200 meters radius

winter rose
real tartan
spark turret
#

Maybe there some big cargo cobtainer thats slingloadable. Use this like ViV transport?

#

Or you attach the thing yiu wantto transport and hide it. Wheb dropped, crate gets deleted, thing unhidden

#

Like it "gets packed" for transport

little raptor
# wind hedge How can I access this Drone Detector?

If you've already played that much, then just play that scenario and use the debug console to get its class name
Or look in old man files
Or keep adding/searching thru all vanilla items one by one until you find it

wind hedge
#

class DroneDetector

#

I will try to use that later when I am on my home computer

hollow lantern
#

@little raptor just FYI: debugged the issue from yesterday. Was ACE.
Thanks for the insights. I may commence silence now LUL

dreamy cave
#

How would I go about making a trigger activate a series of move markers for a certain ai?

hollow lantern
#

sync them via "Waypoint activation"

#

or in the waypoints condition field put triggerActivated nameOfTrigger

little raptor
tough abyss
little raptor
#

there was more iirc

tough abyss
#

params ["_unit"];

//Remove all items and clothing from _unit 

removeAllWeapons _unit;

//Weapons
private _weapons = ["CUP_arifle_G3A3_modern_ris_black","CUP_arifle_M16A2"];

//Add random weapons 

private _weaponClass = selectRandom _weapons;
private _magazine = _weaponClass select 1;
private _weapon = _weaponClass select 0;
_unit addWeapon _weapon select 0;
_unit addMagazines [_magazine,5];
_unit addPrimaryWeaponItem _magazine;

};  
little raptor
#

or just create your own function and remove removeAllWeapons _unit;

tough abyss
#

how about this I have worked one?

little raptor
#

won't work

#

private _magazine = _weaponClass select 1;
private _weapon = _weaponClass select 0;

#

don't just randomly copy paste stuff

#

understand what they do

tough abyss
#

😦

#

True.

#

By worked on I mean removing some coding and cleaning it a bit.

#

so all I can do is remove ```sqf removeAllWeapons _unit;?

little raptor
#

Probably
Depends what that other function that it called does
[_unit, _x] call FUNC(randomizeWeapon);

tough abyss
#

Sure. Gonna dig in and do some testing. Cheers.

tough abyss
#

Maybe that will clarify things for both of us.

little raptor
#

once the weapon slots are filled, any further addWeapon commands are ignored.

tough abyss
#

this is regarding the last sqfbin link/script yes?

tough abyss
#

Okay. So I have come to an conclusion to just create a own small script to randomize weapons. At the same time I will get more knowledge about all. Any tips or tricks before I dig in and stop annoying the hell out of you lol. I

#

However what is confusing is that the script is from CFP and they have faulty scripts as seen now. (No. I am not doing retarded things with their stuff, just editing one of the faction to modernise it for scenario singleplayer purposes)

little raptor
tough abyss
#

cheers! I found this on a forum; ```sqf
private _weapon = selectRandom ["CUP_arifle_G3A3_modern_ris_black","CUP_arifle_M4A1"];

[_this,_weapon,8] call bis_fnc_addWeapon;

#

seems pretty simple. If this also isn't faulty lol.

#

It will add either the G3A3 or M4 rifle with 8 mags.

little raptor
fathom rapids
#

hi guys

#

can someone tell me why this is not removing the inventory of my vehicle?

#
params ["_veh"];
_HQ = [West,"HQ"]; // do not touch this!

// array of marker names
// Make sure you place an empty marker with the name of the below positions
private _markers = ["Logistics_Spawn"];

{
    private _position = getMarkerPos _x;
    private _radius = ((markerSize _x) # 0) max ((markerSize _x) # 1);
    private _vehicles = (_position nearEntities 20) select {_x isKindOf "LandVehicle" && !(_x isKindOf "CAManBase")};

    {
        //Clear Vehicle
        clearWeaponCargo _Veh;
        
    } forEach _vehicles;

} forEach _markers;
#

i wish to write a script to add ammo to the vehicle but first i have to empty it. Thought this would have worked but nothing is happening

tough abyss
#

I think I have figured out the problem. I just only need to know how I need to write the code in the Init field of the unit(CBA Event Handler) when the script says this; ```sqf
Examples:
(begin example)
[_this, "Rifles"] call cfp_fnc_randomizeWeapon;
(end)

#

the working gear randomise script says this if you want to compare: ```sqf
Examples:
(begin example)
[_this] call cfp_fnc_randomizeUnit;
(end)

winter rose
fathom rapids
#

so how do i clear everything

#

does not even remove the weapons

#

as there is still an MX in there

winter rose
#

are you sure _vehicles is not an empty array?

#

also, clearWeaponCargo has a local effect

fathom rapids
#

my vehicle is inside the marker zone

winter rose
fathom rapids
#

says vehicle_0

#

whats that mean?

#

is that good

#

or is it saying it cannot see any vehicles

little raptor
#

_veh is not defined

#

to clear everything use the similar commands for other stuff (removeXXXCargoGlobal)

little raptor
#

yeah that

winter rose
#
clearBackpackCargoGlobal
clearItemCargoGlobal
clearMagazineCargoGlobal
clearWeaponCargoGlobal
scarlet flume
#

so im trying to make a mission, so the end is a tigger linked to a end scenario, and im trying to implement "allPlayers inAreaArray myLocation;" code form the wikia

fathom rapids
little raptor
#

there is no remove

#

use clear

tough abyss
little raptor
#

there's nothing wrong

#

unless you call it wrong

tough abyss
#

I place the units down and this error shows.

scarlet flume
#

its not working what am i doing wrong

#

do i put that code in an area module or tigger?

fathom rapids
#

so how do i define the vehicle that is in the marker zone?

little raptor
fathom rapids
#
params ["_veh"];
_HQ = [West,"HQ"]; // do not touch this!

// array of marker names
// Make sure you place an empty marker with the name of the below positions
private _markers = ["Logistics_Spawn"];

{
    private _position = getMarkerPos _x;
    private _radius = ((markerSize _x) # 0) max ((markerSize _x) # 1);
    private _vehicles = (_position nearEntities 20) select {_x isKindOf "LandVehicle" && !(_x isKindOf "CAManBase")};

    {

clearWeaponCargoGlobal _x;
clearItemCargoGlobal _x;
        
    } forEach _vehicles;

} forEach _markers;
#

still wont work

tough abyss
#

and this is the init code part; ```sqf
class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers_base{};
class ALiVE_orbatCreator
{
init = "if (local (_this select 0)) then {_onSpawn = {_this = _this select 0;sleep 0.2; _backpack = gettext(configfile >> 'cfgvehicles' >> (typeof _this) >> 'backpack'); waituntil {sleep 0.2; backpack _this == _backpack};if !(_this getVariable ['ALiVE_OverrideLoadout',false]) then {_loadout = getArray(configFile >> 'CfgVehicles' >> (typeOf _this) >> 'ALiVE_orbatCreator_loadout'); _this setunitloadout _loadout;[_this] call CFP_main_fnc_randomizeUnit; [_this, 'Rifles'] call CFP_main_fnc_randomizeWeapon; [_this, 'USP_PATCH_IRN_ARMY_GROUND_FORCES'] call BIS_fnc_setUnitInsignia;reload _this};};_this spawn _onSpawn;(_this select 0) addMPEventHandler ['MPRespawn', _onSpawn];};";

little raptor
little raptor
# fathom rapids still wont work

I told you to do this
_position nearEntities _radius
also use systemChat str _vehicles to make sure it's actually picking up something

fathom rapids
#

thing is that i have this code working on a mission i did using ace. I created crates and had them loaded into the vehicle. Worked fine. Now i wish to do it with out ace so i am stripping those bits out and instead of having the items being placed into crates and the crate loaded, just put the items straight in. This was my ace code which worked just fine.

#
// Place the following in the init line of the object you wish to spawn from.
//this allowDamage false; this addaction ["Request Ammo Crate", "scripts\crateSpawn\crate_ammo.sqf"];

params ["_crate"];
_HQ = [West,"HQ"]; // do not touch this!

// array of marker names
// Make sure you place an empty marker with the name of the below positions
private _markers = ["Logistics_Spawn"];

{
    private _position = getMarkerPos _x;
    private _radius = ((markerSize _x) # 0) max ((markerSize _x) # 1);
    private _vehicles = (_position nearEntities 20) select {_x isKindOf "LandVehicle" && !(_x isKindOf "CAManBase")};

    {
        //Spawn Box
        private _crate = "Box_NATO_Ammo_F" createVehicle _position;

        //Clear Box
        ClearWeaponCargoGlobal _crate;
        ClearMagazineCargoGlobal _crate;
        ClearItemCargoGlobal _crate;
        ClearBackpackCargoGlobal _crate;

        // fill crate with our junk
        _crate addMagazineCargoGlobal ["7Rnd_408_Mag", 5];
        _crate addMagazineCargoGlobal ["30Rnd_65x39_caseless_mag", 25];
        _crate addMagazineCargoGlobal ["10Rnd_762x54_Mag", 15];
        _crate addMagazineCargoGlobal ["100Rnd_65x39_caseless_black_mag", 10];
        _crate addMagazineCargoGlobal ["200Rnd_65x39_cased_box", 6];
        _crate addMagazineCargoGlobal ["130Rnd_338_Mag", 10];
        _crate addMagazineCargoGlobal ["HandGrenade", 10];
        _crate addMagazineCargoGlobal ["SmokeShell", 6];
        _crate addMagazineCargoGlobal ["SmokeShellGreen", 6];
        _crate addMagazineCargoGlobal ["1Rnd_HE_Grenade_shell", 6];

        // Add to ACE cargo
        [_crate,1] call ace_cargo_fnc_setSize;
        [_crate,_x,true] call ace_cargo_fnc_loadItem;
    } forEach _vehicles;

    // lets people know stuff happened
    Systemchat "Your Ammo Crate has been loaded.";

} forEach _markers;
little raptor
scarlet flume
#

a tigger linked to a end scenario module

little raptor
fathom rapids
#

i know, i started basic and was making sure the code was running before continuing. Starting with just emptying the vehicle

little raptor
fathom rapids
#

nope

#

it emptied the crate

little raptor
#

it wasn't a question

fathom rapids
#

i now want it to empty the vehicle in the zone and then allow me to customise the cargo i want loaded the same as i did with the crate idea

#

but vanilla arma doesnt work with crates too well so i have to resort to the vehicle inventory

hallow mortar
#

someone could correct me on this, but as far as I know crate and vehicle inventories are functionally identical

#

because crates are vehicles

winter rose
tough abyss
#

Type Array, expected code.

#

Someone could explain?

hallow mortar
#

it means one of the parameters/arguments you gave to the command was an Array, when it was looking for a piece of code

tough abyss
#

Cheers.

fresh wyvern
fresh wyvern
#

Anyone who knows how to change this script so that the vehicle a player enters into changes its present animations for new animations instead of spawning in a new vehicle with the new animations?

player addEventHandler ["GetInMan", {
    params ["_unit", "_role", "_vehicle", "_turret"];
        _veh = createVehicle ["I_LT_01_AA_F",position player,[],0,"NONE"];
        [
            _veh,
            ["Indep_03",1], 
            ["showCamonetHull",1]
        ] call BIS_fnc_initVehicle;
    }
];
fresh wyvern
fresh wyvern
# slate cypress np πŸ˜„

Thanks for the help. It worked when swapping eventHandler "GetIn" for "GetInMan" and when referring to the right prams "_vehicle"

player addEventHandler ["GetInMan", {
    params ["_unit", "_role", "_vehicle", "_turret"];
        if (playerSide isEqualTo opfor) then {
        [
            _vehicle,
            ["Indep_03",1], 
            ["showCamonetHull",1]
        ] call BIS_fnc_initVehicle;}
    }
];
obtuse quiver
#

Hemlos, i have a problem with say3d

class CfgSounds
{
    sounds[] = {};
    
    class music1
    
    {    
        name = "music1";
        sound[] = {"\sounds\oggetto.wav", 1, 1, 500};
        titles[] = {};
    };
    
    class music2
    
    {
        name = "music2";
        sound[] = {"\sounds\machecazzo.wav", 1, 1, 600 };
        titles[] = {};
    };

        class music3
    
    {
        name = "music3";
        sound[] = {"\sounds\agente1.wav", 1, 1, 600 };
        titles[] = {};
    };

    class music4
    
    {
        name = "music4";
        sound[] = {"\sounds\maniinaltrocringe.wav", 1, 1, 600 };
        titles[] = {};
    };
};```
music1 and music3 are working
not the other ones tho
on activation:
a1 say3D [ "music4", 1000, 1];
#

@ me no problem

tough abyss
#

sorry to ask but is there any way to link sub classes in a class to an external sqf ?

exotic flax
#

what do you mean?

#

#include "filename"

#

although this is more a #arma3_config question instead of scripting

#

yes

tough abyss
# exotic flax yes

and the file path would I need need to add the full path from root of pbo or just the file name if it is in the same subfolder of the sqf rile ?

exotic flax
#

can be both

dreamy cave
#

I know this is an easy question but I've watched so many videos and can't seem to get it, I want a trigger to make a helicopter come and land in a field, then wait for me and some other people to get in before going on, how would I do so?