#arma3_scripting

1 messages · Page 523 of 1

next scaffold
#

I would have to try it

high marsh
#

Uhhh, find returns index in array connor

tough abyss
#

@robust hollow wont work, allvariables are all lower case

high marsh
#
private _newArray = _oldArray select {_x find "blah" != -1};
robust hollow
#

@tough abyss so write the search string in lower case?
@high marsh he wants to get vars that start with the string

high marsh
#

Yes, so if it's found. Then it returns the index, if not then it returns -1

#

0 is still a valid index in the array,

tough abyss
#

@high marsh will match whatblah, theblah and fuckblah

high marsh
#

Yes, I understand this.

robust hollow
#

yea, my point is he wants the index to be 0 because thats what it starts with

#

if the string doesnt start with the search term then ignore it

high marsh
#

So you want the first entry in the array? It doesn't make sense.

robust hollow
#

get all the variables in an array which names start with "varName"

high marsh
#

0 based position of the first array element that matches x, -1 if not found

tough abyss
#

so write the search string in lower case? dont have to tell me, but worth mentioning for inexperienced

robust hollow
#

find alt syntax 0 based position of the first sequence of characters that matches x, -1 if not found

#

if the string starts with the search term, it will return 0 and be included in the output array

high marsh
#

that's string find number

robust hollow
#

string find string

#

example 3

high marsh
#

either way, both syntax returns -1 if not found

robust hollow
#

yea...

high marsh
#

¯_(ツ)_/¯

robust hollow
#

idk what ur trying to get at anymore

high marsh
#

the case is more of confusion

tough abyss
#

that's string find number 🤔

high marsh
#

it's 5:30 AM okay..

tough abyss
#

next scaffold
#

lol thank you guys

safe forum
#

is present any analogs of "getUnitLoadout" for containers?

high marsh
#

heh? weaponCargo

long pewter
#

Cant figure out why this script isnt working "UMI_Briefcase_Money_Open" in heli1;

#

Any ideas?

#

I dont think I've ever been so stuck on creating a mission haha

high marsh
#

heli1 isn't an array or an object

#

you need to check for item list in heli

next scaffold
#

are you puting that item in the helo inventory? @long pewter

long pewter
#

Yes @next scaffold

#

Put item in heli > task complete

#

Is what I'm trying to do

high marsh
#
if("UMI_Briefcase_Money_Open" in (itemCargo heli1) then
{
    //end task
};
safe forum
#

heh? weaponCargo

No, it isnt good idea, because you can hold items on weapons, items in backpacks, etc.

high marsh
#

sure it is, because it's the weapons, not the items

#

not weapons inside of backpacks

#

the command actually doesn't care at all what's inside the backpack

#

you can check that if you want the specific backpack cargo

#

but none of that will be checked

safe forum
#

so, its very strange, that for all time for developing arma, we dont have any command, that can show all gear in a crate propetly. And only in A3 1.58 was created "getUnitLoadout"

high marsh
#

You know what's even stranger? That you can't just use each getter command for each type of cargo

#

there isn't any particular reason to have one

#

because it can be done on your own

tough abyss
#

@safe forum yes, it is very very strange that Arma lacks some essential functionality, not like any other game out there

safe forum
#

@high marsh (getItemCargo _vehicle) + (getMagazineCargo _vehicle) +( getWeaponCargo _vehicle) + (getBackpackCargo _vehicle) not a solution

high marsh
#

it works right? 😃

safe forum
#

it works, but doesnt contain full info about container

high marsh
#

What more info do you even need?

safe forum
#

What I use to collect all info

    private _obj = _this select 0;
    private _disallowedItems = _this param [1,[]];
    private _r = [];
    private _arrr = [];
    private _containersClass = [];
    {
         _x params [
          "_xType",
          "_xObj"
         ];

         private _items = [];
         {
              private _isVest = (_x isKindOf ["Vest_Camo_Base", configFile >> "CfgWeapons"]) || (_x isKindOf ["Vest_NoCamo_Base", configFile >> "CfgWeapons"]);
              private _isUniform = _x isKindOf ["Uniform_base", configFile >> "CfgWeapons"];
              if !(_isVest || _isUniform) then {
                    _items pushBack _x;
              };
         } forEach itemCargo _xObj;
         _items = _items call BIS_fnc_ConsolidateArray;

         private _mags = (magazineCargo _xObj) call BIS_fnc_consolidateArray;
         {
             if (toLower(_x select 0) in _disallowedItems) then {_mags set [_foreachIndex,-1];};
         } forEach _mags;
         _mags = _mags - [-1];

         private _weapons = weaponsItemsCargo _xObj;
         {
             if (toLower(_x select 0) in _disallowedItems) then {_weapons set [_foreachIndex,-1];};
         } forEach _weapons;
         _weapons = _weapons - [-1];

         _arrr pushback [_xType, [_items, _mags, _weapons]];
         _containersClass pushback _xType;
    } forEach everyContainer _obj;
    _r pushback _arrr;
    private _ItemCargo = [] + getItemCargo _obj;
    private _newItemCargo = [];
    {
        if !(_x in _containersClass) then {
            for "_i" from 1 to ((_ItemCargo select 1) select _forEachIndex) do {
                _newItemCargo pushback _x;
            };
        };
    } forEach (_ItemCargo select 0);
    _newItemCargo = _newItemCargo call BIS_fnc_consolidateArray;
    _r pushback [((magazineCargo _obj) call BIS_fnc_consolidateArray),(weaponsItemsCargo _obj),_newItemCargo];
    _r
safe forum
#

As sample, backpack can store any items, and (getItemCargo _vehicle) + (getMagazineCargo _vehicle) +( getWeaponCargo _vehicle) + (getBackpackCargo _vehicle) doesnt save them

#

you need to check every container in container, to save full info

high marsh
#

Wrong one even more so

#

this is the one I was looking for

safe forum
#

I know, how to do it. My first question not about scripting commands, that can help me to make a big function, to save all gear in container. I had asked, is present any solutions in BI scripts\commands like "getUnitLoadout"

high marsh
#

The answer is clear I imagine at this point

austere granite
#

@still forum because i know you use it, does the VS Code SQF plugin have any magic option to open up the biki page for commands?

still forum
#

Dunno. Never tried

high marsh
#

@austere granite No, but there is an extension that does open up biki for highlighted commands

#

It's called SQF Wiki

astral tendon
#

This is in minutes or seconds?

tough abyss
#

Seconds

astral tendon
#

So, that comand works only when the condition is met, not the actually time out to complete it

#

That is a verry miss leading name.

tough abyss
#

You gonna complain about names? modelToWorldVisualWorld?

astral tendon
#

lockIdentity (It dos the oposite)

still forum
#

Would you change it if you worked at BI?

astral tendon
#

Would not even name it like that really.

still forum
#

Well for original naming it's about 19 years too late now 😄

#

And sadly a command cannot be renamed/changed/removed after it was added

astral tendon
#

Or, just make the same kinda of command with a diferent name like setDammage

austere hawk
#

as if that helps...

astral tendon
#

Anyway, how to complete a waypoint by script with out have to delete it?

astral dawn
#

setCurrentWaypoint ?

#

or smth like that, search for currentWaypoint command

upper cliff
#

does anyone know how I'd be able to "lock" the camera while I have cinematic borders enabled? Basically I'm trying to set it so that when the player looks around it's like they double tapped alt instead of rotating the player.

This is what I've got in my init.sqf


[0,0,false] spawn BIS_fnc_cinemaBorder;

Vanguard playMove "Acts_A_M01_briefing";

sleep 2;

titleCut ["", "BLACK IN", 5];

player switchMove "Hubspectator_walk";

sleep 5;

player PlayMoveNow "amovpercmstpslowwrfldnon";```
vague abyss
#

ohla, I have an issue. I want to make gunner optic with a full (non-functional) control panel. So that would look like a controller with a screen in the middle (all texture). The issue is that the game is zooming in on the texture itself. Making the image in the texture smaller lowers the overall qaulity too much and I think its something in the coding. Does anyone have a clue?

earnest ore
#
_zLogic addEventHandler ["CuratorObjectPlaced", {
    params["_curator","_entity"];
    if(_entity isKindOf "AllVehicles") then {
        [group _entity] remoteExec ["AEF_fnc_aiSetSkill", 2, false];
    };
}];```
Say I wanted to cut down on every curator placed object from doing remoteExecs that change skill levels down to only units and vehicles, would the type "AllVehicles" suffice in the above conditional statement?
high marsh
#

@earnest ore I really doubt setting skill on vehicles is going to do anything

#

AI on the other hand

#
_zLogic addEventHandler ["CuratorObjectPlaced", {
    params["_curator","_entity"];
    if(_entity isKindOf "Man") then {
        [group _entity] remoteExec ["AEF_fnc_aiSetSkill", 2, false];
    };
}];
#

I believe it has to do with the gunners skill

velvet merlin
#

was it ever understood why some shortcuts work with addAction, and others dont? (plus it seems to vary based on the situation - say infantry vs vehicle)

high marsh
#

Are you sure you're using the correct shortcut action? Seems to work with all the supported ones for me Kju

velvet merlin
#
    _x addAction ["RESET",{0 = [] spawn TEST_fnc_CreateVehicle;},        nil,1.5,true,true,"ReloadMagazine"];
    _x addAction ["SET WEAPON",{0 = [] spawn TEST_fnc_SelectWeapon;},    nil,1.5,true,true,"SwitchWeaponGrp1"];
    _x addAction ["SET VEHICLE",{0 = [] spawn TEST_fnc_SetVehicle;},    nil,1.5,true,true,"SwitchWeaponGrp2"];
    _x addAction ["SET BOMB",{0 = [] spawn TEST_fnc_SetBomb;},        nil,1.5,true,true,"SwitchWeaponGrp3"];```
#

works as infantry

#

when you get into a vehicle/assign to a vehicle, only ReloadMagazine works

#

as an example

#

you have all these kind of weird situations where some work, and others dont - but different in different situations

high marsh
#

Add them to the player, but add a in vehicle check to the condition

long pewter
#

Is there anyway to make this text that appears on the screen, stay on screen for longer?

[
    [
         ["Mission Complete - Juan Will Return", "<t align = 'center' shadow = '1' size = '0.4'>%1</t>", 15]
    ]
] spawn BIS_fnc_typeText;

velvet merlin
#

@high marsh the actions work fine when executed from the action menu

#

as said ReloadMagazine works too in this context

#

also not the first with this problem. the BIF has a couple of threads on this too

#

unfortunately no solution/insights why its bugged/behaving weird

winter rose
#

@long pewter I think it is said on the wiki page that you can add empty lines to "cheat" about display time

high marsh
#

parseText has this format

#

you can change color and alginment

long pewter
#

@winter rose cheers bro

cold linden
#

anyone any idea how i delete the douple quotion marks from string? Example: ""76561197993746xxx""

still forum
#

cut off start and end

cold linden
#

oO

#

@still forum Thanks, so much ❤

tame portal
#

@upper cliff What exactly is your player doing while he's not supposed to be able to do anything but turn his head?

upper cliff
#

They’re just supposed to be standing there listening to the briefing

tame portal
#

Hm, I think if you play an idle animation on them, they can't turn around anymore

#

just move their head

upper cliff
#

Will I think it’ll probably be easier to just have the briefing as a diary entry rather than a cutscene just because of the way the mission is set up.

winter rose
#

Del and End rotations still apply

tame portal
#

@winter rose Aren't there animations where you can't turn around in anway? The only example I can think of is that silly fighting animation 😄

winter rose
#

That would make briefings awesomely fun

#

You could intercept rotation keys by scripts, or just use a camera

upper cliff
#

Well I think the only animations that you can’t rotate the camera while doing are the ones in the cutscene category

finite dirge
#

Hey there, I have a public variable in a script that sometimes stores an empty array. I get Battleye kicks when this happens. Is there a way to exclude empty arrays in publicvariableval.txt?

thorn saffron
#

Is there any script that "scans" a soldier and gives you a "config" setup for him with weapons, ammo, etc? The ALiVE ORBAT creator gives a bit borked configs

still forum
#

Arma arsenal can export config loadout

#

I think STRG+Export or Shift+Export or some other modifier key

finite dirge
thorn saffron
#

but its not viable for vehicle config, like when you create a new soldier

#

@finite dirge Thanks

still forum
#

I heard the arsenal config export is exactly that. Config for when you create a new solder unit in config

thorn saffron
#

nope, it just gives you script based lodout, that you put in init

still forum
#

Yeah you need to press some modifier key to get the config one

#

(I said that above)

thorn saffron
#

tried different ones, still get the same scripting stuff

still forum
#

We talked about exporting loadouts to get a unit config just 2 days ago in this channel

thorn saffron
#

Thanks

#

pretty good, but it does skip the magazines that are already in the weapons, not that big of a deal, just annoying

tough abyss
#

I think STRG+Export or Shift+Export or some other modifier key ctrl+shift+c

astral dawn
#

it also skips attachments to guns 😦

thorn saffron
#

yeah, you need to add those via new weapon class

#

the missing magazines are a bit more annoying

outer scarab
#

I'm having trouble with this script that spawns a helicopter and an infantry group. The helicopter and infantry SL spawn about 10m in the air - damaging the chopper and killing the SL - while the rest of the units spawn at ground level:

private _pos_Spawn = getMarkerPos selectrandom ["QRF_H1_S","QRF_H1_S","QRF_H1_S"];
Selects one of three markers (All the same for testing purposes)

private _H_AR = [_pos_Spawn, 0, "rhs_mi8mt_vdv", EAST] call bis_fnc_spawnVehicle;
Creates the helicopter, 10m in the air (I don't understand why though)

private _pos_Ispawn = [_pos_Spawn,20,0] call BIS_fnc_relPos; private _I_G = createGroup [east, true]; // explicitly mark for cleanup private _I_U = _I_G createUnit ["O_Soldier_SL_F", _pos_Ispawn, [], 0, "NONE"];
Creates the group and its SL - again, around 10m in the air

private _counter = 0; while {_counter < 12} do { // {_counter < # } - Num units of type to spawn _newUnit = "O_Soldier_F" createUnit [_pos_Ispawn, _I_G]; _newUnit = "O_Soldier_F" createUnit [_pos_Ispawn, _I_G]; _newUnit = "O_Soldier_LAT_F" createUnit [_pos_Ispawn, _I_G]; _newUnit = "O_Soldier_AR_F" createUnit [_pos_Ispawn, _I_G]; _counter = _counter + 4; sleep 2; };
Creates 4 subordinates at a time, all at ground level - despite using the same markerpos as the helicopter and SL

Any ideas?

#

Oh, and private _pos_Ispawn = [_pos_Spawn,20,0] call BIS_fnc_relPos; for the infantry spawnpoint, just so the chopper doesn't crush them

robust hollow
#
//bis_fnc_spawnVehicle L60-67

    case "airplanex";
    case "helicopterrtd";
    case "helicopterx": {
        //Make sure aircraft start at a reasonable height.
        if (count _pos == 2) then {_pos set [2,0];};
        _pos set [2,(_pos select 2) max 50];
        _veh = createVehicle [_type,_pos,[],0,"FLY"];
    };

the spawn script purposely spawns aircraft at least 50m in the air.

outer scarab
#

That explains the helicopter spawning in the air, thanks - I was going to change it to createvehicle once I figure out how. But that doesn't apply to the SL, does it?

#

Since the SL's spawn position is just the markerpos + 20m north

robust hollow
#

🤷

edgy dune
#

is that really what the bis fnc has?

#

i guess I should look at some of those bis functions

outer scarab
#

Yeah, for whatever reason using createvehicle instead of fnc_spawnvehicle for the helicopter fixed both it and the SL spawning in the air. I still have no clue why, but I'm not gonna complain either

tough abyss
#

This is PSA: Do put diag_activeScripts to your watch field from time to time to see if you have some scripts that shouldn’t be there spamming the scheduler

edgy dune
#

oh

#

thats nice

outer scarab
#

How do I create a "SCRIPTED" waypoint through a script?

_EXH1_W1 setWaypointType "SCRIPTED";
_EXH1_W1 waypointAttachVehicle _EX1LZ;
_EXH1_W1 setWaypointTimeout [30,30,30];```

Here, I'm trying to create a "Land" advanced waypoint at the given invisible helipad, and have it take off again after 30 seconds. But I'm not sure how to go about calling the waypoint's script. All I understand is `A3\functions_f\waypoints\fn_wpLand.sqf []` needs to go in there somewhere
scarlet spoke
#

Is there a trick that allows me to assign the curator interface to a virtual spectator unit (Virtual_Spectator_F)?

frigid raven
#

So there are static units and there are patrolling units. Both kinds do have the behaviour SAFE and waypoint type MOVE

#

Any idea how to differ them?

outer scarab
#

It'd help if I read the wiki:
[_EXH1_G, _EX1LZ, LZ_STAR] spawn BIS_fnc_wpLand;

So with this alone, the helicopter will land just fine. However, as far as I can tell this deletes its other (second) waypoint, at least as far as Zeus is telling me. Whether or not that's the case the helicopter will stay on the ground indefinitely. I tried [_EXH1,1] setWaypointTimeout [30,30,30]; but it seemed to have no effect.

round scroll
#

and after it has landed/touched ground, make a timer and add the new waypoints

frigid raven
#

What is a good way to check if an given parameter is a marker?

still forum
#

oof..
I'd say just try calling getmarker* command on it, and see if it returns something sensible

winter rose
#

getMarkerPos "" would return [0,0,0] yep

high marsh
#

Z value is always going to be zero right? So I guess that could work as part of the detection as well

winter rose
#

that or "string" in allMapMarkers btw

high marsh
#

Hmm, is there any way to prevent suspension inducing longer loading times in postInit ? I have a function that sets weather at the start of the mission and cannot use forceWeatherChange until weather sim has started. So in doing so I used waitUntil to make sure the game has started to do so. But this adds at least 10 seconds onto loading time

#
paramWeather = "maas_server_weather" call BIS_fnc_getParamValue;
paramFogValue = "maas_server_fogValue" call BIS_fnc_getParamValue; //main fog value
paramFogDecay = "maas_server_fogDecay" call BIS_fnc_getParamValue; //fog decay
paramFogBase = "maas_server_fogBase" call BIS_fnc_getParamValue; //fog base altitude    
if(isServer) then
{
    switch paramWeather do
    {
        case 1:
        {
            //clear
            diag_log "[MAAS WEATHER]: Recieved input of 1, setting to clear";
            0 setRain 0;
            [0,0] remoteExec["setOvercast",0,"maas_jip_overcast"];
        };
        case 2:
        {
            //partly cloudy
            diag_log "[MAAS WEATHER]: Recieved input of 2, setting to partly cloudy";
            0 setRain 0;
            [0,0.5] remoteExec["setOvercast",0,"maas_jip_overcast"];
            skipTime 1;
        };
        case 3:
        {
            //raining
            diag_log "[MAAS WEATHER]: Recieved input of 3, setting to raining";
            0 setRain 0.75;
            [0,1] remoteExec["setOvercast",0,"maas_jip_overcast"];
        };
        case 4:
        {
            //storm
            diag_log "[MAAS WEATHER]: Recieved input of 4, seting to stormy";
            0 setRain 1;
            setWind[20,20,false];
            [0,1] remoteExec["setOvercast",0,"maas_jip_overcast"];
        };
    };
    0 setFog
    [
        paramFogValue,
        paramFogDecay,
        paramFogBase
    ];
    waitUntil{time > 0};
    forceWeatherChange;
};
winter rose
#

Try a sleep . 001?

#

(I can't read it well, on mobile :x)

#

[] spawn { the last two lines @high marsh

#

So the script will end and then sync

high marsh
#

Isn't it already in scheduled?

winter rose
#

dunno

high marsh
#

I'll try it thz

high marsh
#

@winter rose Works perfectly now, thanks for that. Kind of strange if you ask me lol

#

Although spawn would create a new thread for the changes, instead of halting the entire script.

winter rose
#

I would guess that the "post init" is waiting for the script to end, while it is halted by the waitUntil… else, idk

high marsh
#

Yep, now here is a serious issue that happens if you start the mission too quickly. Everything freezes on the frame that forceWeatherChange tries to compute weather. All sim and control just freezes and will not resolve ever until you quit the mission.

devout stag
#

I want to use playableUnits to get all "playable units" from each of the 4 factions.

#

I was told to use something like {side _x = west} count playableunits

#

but i don't really know what to do with this

high marsh
#
_westUnits = playableUnits apply{side _x isEqualTo west};
_eastUnits = playableUnits apply{side _x isEqualTo east};
#

with count you need the return value to be true in your code, otherwise it just returns the array length

#

apply will modify the array based on the code in the brackets.

#

in this example, if the side is equal to your side that you need. It'll add the unit to the modified array

devout stag
#

Cheers! I appreciate the help. Just needed to do a check to see if any playable units had been placed at all.

high marsh
#

By Zeus?

devout stag
#

Also god I hate isEqualTo lmao but ya know... arma

#

Nah I'm making a check for the eden editor

high marsh
#

isEqualTo is faster than some basic operators ( i believe )

devout stag
#

Basically I'm having a prompt appear asking the user to please add a headless client to their mission.

#

And I want to make sure that the mission maker has placed a playable unit

high marsh
#

You're adding this to a mod correct? Can't check that ingame to any effect, it'll just throw an error saying that there is no players

devout stag
#

because otherwise the virtual faction which is hidden by default will cause an error in the slotting screen

#

oh dw about that let me link you to the file I'm modifying

high marsh
#

Seems fine to me, what do you need changing?

devout stag
#

it throws an error

#

It's not functional in short

high marsh
#

line 30? That's quite literally getting the number of player units and not the objects

#

You don't need to itterate through 0 1 2 3

devout stag
#

line 30 is broken as fuck

high marsh
#
_playables = count playableUnits;
#
if(_count > 0) then
{
    /* code to execute when playable units have been found */
} else {
    /* Gui message about how no playable units have been found */
};
devout stag
#

I need to sort out AI from that count

#

how would I go about doing that

#

sorry quick correction

#

which script command do I use to check if a unit is headless

#

isTypeOf or isKindOf?

high marsh
#
_playables = count (playableUnits apply{isPlayer _x});
#
if(_x isKindOf "HeadlessClient_F") then
{
    //this object is a headless client
};

or if you're looking to execute on local client

if(!hasInterface && !isServer) then
{
    //headless client
};
devout stag
#

This function should only be executed during mission making

#

so I'm guessing local client correct?

high marsh
#

Eh, you could execute the secondary example on the client as they are connecting and then add the client info to a list that's available to the mission

devout stag
#

Oh this functional only happens in the editor

#

It never executes in MP

high marsh
#

Ok, then look at the first example. That'll tell you how many HC's you have in total.

devout stag
#

👍

high marsh
#

Otherwise, if you need the hc count during runtime, use second example

winter rose
#

apply?

devout stag
#

cheers for the assistance

#

now working as intended

winter rose
#
_playables = count (playableUnits apply{isPlayer _x}); // no```

```sqf
_playables = playableUnits select { isPlayer _x }; // yes```
devout stag
#

why select

#

Also I need to use count in order to get the amount

high marsh
#

he needs the count

winter rose
#

won't sqf playableUnits apply{isPlayer _x} return [true, true, false, true, …] ?

high marsh
#

same array length

winter rose
#

so the count will be the same as count playableUnits yes?

devout stag
#

I can just trim false out

winter rose
#

that or count the select

high marsh
#
_playables = count (playableUnits select {!_x isKindOf "HeadlessClient_F"});
#

ultimately he was looking to exclude the headless clients

winter rose
#

yep

devout stag
#
 private _count = 0;
_count = count (playableUnits apply{isPlayer _x && !(_x isKindOf "HeadlessClient_F")});
if(_count >= 1) then {_playableFound = true};
#

this is what I have right now

winter rose
#

but wait, what is it you really want 😆

devout stag
#

I want to check if a playable unit has been placed

high marsh
#

But Lou, use apply and you eliminate forEach and pushBack

devout stag
#

Excluding headless

winter rose
high marsh
#
_justPlayers = allPlayers - entities "HeadlessClient_F";

Aha!

winter rose
#

_justPlayers = allPlayers - entities "HeadlessClient_F"; yep!

devout stag
#

I won't have to worry about dead stuff right

#

idk why I ask lol this is in the editor

still forum
#

If you need count.. Why don't you use count command on the array then??

high marsh
#

this is true? 🤔

devout stag
#

I am?

#
private _count = 0;
private _justPlayers = allPlayers - entities "HeadlessClient_F";
_count = count _justPlayers;
if(_count >= 1) then {_playableFound = true};
still forum
#

the part above. where you used count (x select y)
might aswell just x count y and be done

#

count array >= 1
->
!(array isEqualTo [])

high marsh
#

I like the latter better.

#

Probably faster too?

still forum
#

yes

#

Also if(x) then _var = true...

How about
_var = x
Same result.

#

Why is playableUnits command not an option? only skimmed over the convo

devout stag
#

wut

high marsh
#

the understanding was that headless clients are included in playableUnits ded, is this not the case?

still forum
#

Dunno, never tried. Never actually used playableUnits
Sounds logical though.

devout stag
#

They are

#

I've got it squared away, thanks guys.

#

Currently working on just setting up a mission attribute to ensure that the prompt I was making can be disabled.

tough abyss
#

how do you make primaryWeaponMagazine player; copy to clipboard?

still forum
#

copyToClipboard str primaryWeaponMagazine player

tough abyss
#

ahh thx

#

also is there a way to make an NPC carry specific clothing through cursor target

still forum
#

cursorTarget forceAddUniform "U_B_CombatUniform_mcam";

#

might need to remove old uniform first

tough abyss
#

what about vest?

robust hollow
#

addVest instead of forceAddUniform

queen cargo
#

in case somebody has a debug console currently open, can you check if this is valid in SQF:

private _val = 0xF9;
_val```
robust hollow
#

249

tardy pagoda
#

how does one go about passing on an object from an eventhandler to a user created function?

robust hollow
#

[_object] call myfunc

tardy pagoda
#

for multiple objects it would be like ["_object1", "_object2"] right?

robust hollow
#

[_object1,_object2]

tardy pagoda
#

oohhh

#

gotcha

robust hollow
#

putting them as strings would pass strings

tardy pagoda
#

and to recieve it into a function would you do something like _object = param[0] ?

robust hollow
#

yea. if you have multiple arguments its usually best to use params

#

which would be params ["_object1","_object2"];

tardy pagoda
#

thanks my dude!

queen cargo
#

is __FILE__ printing a path with or without quotations?

robust hollow
#

with

#

ill double check just to be sure though

#

yea, it is in quotations

tardy pagoda
#

so im passing a killed player and killer by '''[_killed, _killer] spawn br3_fnc_handleCash; ''' and then executing this in my function '''params ["_aiKilled", "_pKiller"];
_aiKilledd = params["_aiKilled"];
_pKillerr = params["_pKiller"];
hint format ["Killed By %1", name _aiKilled];'''

robust hollow
#
_pKillerr = params["_pKiller"];```
why?
tardy pagoda
#

i was messing around to try and find a working method

robust hollow
#

that is not it

tardy pagoda
#

ok

robust hollow
#

what are you trying to do? you've shown what ur doing but not what the problem is.

tardy pagoda
#

im trying to display the killers name in a function

robust hollow
#

also for the record, code blocks in discord are done like this
```sqf
<code here>
```

tardy pagoda
#

lol my bad

#

tryin to learn 😃

#

but whenever I kill a player it only gives the player killed name

robust hollow
#
params ["_aiKilled", "_pKiller"];
hint format ["Killed By %1", name _pKiller];```
should be all you need.
#

not even the _aiKilled unless you use it elsewhere

tardy pagoda
#

i do plan on using _aiKilled somewhere else but whenever I kill the player it shows the killed players name regardless of if i do: hint format ["Killed By %1", name _pKiller]; or hint format ["Killed By %1", name _aiKilled];

robust hollow
#

[_killed, _killer] spawn br3_fnc_handleCash;
then _killed and _killer are the same unit.

tardy pagoda
#

im using the bis eventhandler

#

here is the full code: addMissionEventHandler ["EntityKilled", { params ["_killed", "_killer", "_instigator"]; if (isNull _instigator) then {_instigator = UAVControl vehicle _killer select 0}; // UAV/UGV player operated road kill if (isNull _instigator) then {_instigator = _killer}; // player driven vehicle road kill [_killed, _killer] spawn br3_fnc_handleCash; }];

robust hollow
#

🤷 dont see why it wouldnt work.
you will want to add a check to confirm you are the killed unit though, otherwise everyone will get the notification.

tardy pagoda
#

ok, I got it to work by restarting arma 3, it wasnt refreshing my mission folder for some reason. Thanks for all the help @robust hollow

tardy pagoda
#

what is the most efficient way to add elements onto an array in arma 3? im trying to fill an array with created soldiers using a forloop

robust hollow
#

when adding to the end of the array, pushback is good

tardy pagoda
#

ooohhh i thought pushback was only for stacks

high marsh
#

stacks?

tardy pagoda
#

yeah i thought i saw a bis function for stacks in arma 3 and I assumed pushback was for stacks as it is in implementations of c++

robust hollow
#

BIS_fnc_arrayPushStack? thats just the append command.

tardy pagoda
#

ah gotcha, was just glancing through the functions and saw the word stack and push lol, ive been using set for arrays so didnt know about pushback lol

robust hollow
outer scarab
#
if (!isServer) exitWith {};

_randomQRF = selectRandom ["spawnQRFV.sqf","spawnQRFL.sqf","spawnQRFH.sqf","spawnQRFMi.sqf"];

while {true} do 
{
_array = allGroups select {side _x isEqualTo EAST};

    
    {
    _group = _array select _x;
    _leader = leader _group;
    if (behaviour _leader == "COMBAT") then 
        {
            hint "combat detected";
            [_leader] execVM _randomQRF;
            sleep 1;
        }
    else 
        {
            hint "no combat detected";
            sleep 1;
        };
    } forEach group _array;
    hint "cycle";
    sleep 1;
};

I've run out of ideas here, I find this sorta stuff very confusing.
What I'm aiming to do is have the If/Else run for each element of the array before cycling back through the if {true} loop - so as to re-populate the array each cycle. The array is comprised of groups, and I need to execute one of the random scripts on the leader of any it finds that are in combat - passing the leader on to those scripts

#

_group = _array select _x; is almost certainly wrong as is forEach group _array;

still forum
#

```sqf
```
to get proper code highlighting

outer scarab
#

Oh, thanks, I was always wondering about that

still forum
#

group _array that's wrong. group command doesn't take array as argument

#
{
_group = _x;
} forEach _array

like this

#

_x is the element in the array that's currently being iterated over

outer scarab
#

Aaah, thank you

#

Hmm, any idea why _leader is passed as an array its self to the script executed on it, rather than as a unit/object?

still forum
#

[_leader] execVM _randomQRF; because you are passing it as an array

#

you are wrapping it into an array []

outer scarab
#

Oh I'm a dummy

#

It works now, thanks for your help dude!

quartz coyote
#

I'm experiencing trouble with the AI when the FSM is disabled _unit disableAI "FSM"; and they have waypoints. They randomly stop at a waypoint "Move" without any obvious reason. If I reactivate the FSM, then they carry on... Anyone know about this issue ?

tardy pagoda
#

how does one make a variable available throughout sqf file but not others? I'm trying to make a variable _cash available to an "entitykilled" eventhandler

still forum
#

doesn't work

#

What you are imagining of doing is not possible

#

but you can just set a variable onto the entity that you are also adding the entitykilled eventhandler onto

tardy pagoda
#

oh, how would I go about that?

still forum
#

_unit setVariable ["cash", _cash]

and then you can getVariable inside the eventhandler

tardy pagoda
#

wow! thanks mate!

digital hollow
#

Is there an eventhandler for a group having a new waypoint assigned? I want to run code when I use Zeus to give a new waypoint to a VLS.

still forum
#

CuratorWaypointPlaced

digital hollow
#

I was hoping for something less overkill =p I guess a typeOf check isn't that expensive.

keen bough
#

_landVehicleArrayRaw = vehicles inAreaArray landGarage select {_x isKindOf "LandVehicle"} apply {[_x,getPosASL _x,getDir _x]};
Would this be correct? So i have an array of the vehicle, the position and the direction?

#

Update: I could test it now. It works as intended. Sorry for asking 😦 Should've waited until i could test it.

tough abyss
#

It works as intended. You sure? Where are you passing valid areas to inAreaArray? @keen bough

robust hollow
#

i dont see anything wrong with it 🤔

tough abyss
#

You know what landGarage contains?

robust hollow
#

no, but if he says its working then im going to assume its a trigger, marker, location or array of area info.

#

not sure why its a global variable 🤷

tough abyss
#

And if it is array of vehicles?

robust hollow
#

then he probably wouldnt have said It works as intended. because that errors.

tough abyss
#

And if he tries this on stable?

robust hollow
#

what?

tough abyss
#

Errors are suppressed

robust hollow
#

assuming he doesnt have showscripterrors on, the array will always return empty, therefor not working as intended

tough abyss
#

Anyway my question is still valid I want to know where are the valid areas in that expression, you seem to not know that either

frigid raven
#

I have a marker (ellipse) with a size of [200, 200]. Now I want to check if there are entities in this area.

    private _markerPos = getMarkerPos _checkAreaMarker;
    private _markerRadius = (getMarkerSize _checkAreaMarker select 0) / 2; // 200 is the diameter and 100 is the radius?
    private _foundVehicles = _markerPos nearEntities ["Car", _markerRadius];

Would this be right?

still forum
#

looks reasonable

frigid raven
#

best.day.ever

keen bough
#

@tough abyss The code works really as intended. It shows either nothing (when no vehicle is parked in the area of the trigger) or an array of vehicles, followed by position and direction.

tough abyss
#

@frigid raven no, that’s not how you do it

#

You need to grab array of entities either bigger than the area if ellipse or all entities and filter it via inAreaArray to get only entities inside the ellipse

#

Your code might return false positives

#

Unless your ellipse is always a circle then it doesn’t matter

still forum
#

Unless your ellipse is always a circle
It's a ellipse with 200 size on X and 200 size on Y.
Also known as a circle

tough abyss
#

It’s an ellipse and a marker, a user can change a and b placing it

still forum
#

I have a marker (ellipse) with a size of [200, 200]. Now I want to check if there are entities in this area.
He said what size he has

tough abyss
#

Fair enough

#

It is a bit idiotic to select from marker size if you know you have marker 200 x 200 already

frigid raven
#

Ok I see your points here

#

That marker will always be a circle but the diameter is subject to change

#

still always being a circle

lusty canyon
#

is there a way to increase the inventory capacity of an object aside from the class cfg?

winter rose
#

cargo, or unit ? @lusty canyon

lusty canyon
#

unit backpack/vest/uniform

still forum
#

No. Had same question just a couple days ago

#

you might be able to use scripts to force more items into an inventory than actually fit into it.

lusty canyon
#

ok thanks

winter rose
#

you can play with setUnitTrait ["loadCoef", 0.5]
said unit can carry more weight, but the vest won't have more space @lusty canyon

vague abyss
#

Is there a way to change the optic UI scale for custom optic UI's? My texture is more then just a cross. There is way to show it all but that destroys the qaulity of the texture. Does anyone know the solution to this?

next scaffold
#
{if((getPos _x) inArea myTrigger && alive _x) then{
    aliveThings pushBack _x;}
}forEach thingsInArray;

What am I doing wrong here? I get a type error on the getPos part: got string, expected object, location

untold sparrow
#

I'm not sure if this is the correct channel or not, but would anyone happen to know how to make it dark at a certain altitude?

cursive whale
#

I'd look at setAperture/setApertureNew

robust hollow
#

@next scaffold _x is obviously a string then.

next scaffold
#
FAM_vehiculosBlufor = allVariables missionNamespace select {_x find "bluforveh" == 0};
#

this is the array I'm using

#

its content is all the vehicles which variable names start with "bluforVeh". If I type the array name into the debug console it returns [bluforVeh_1]

still forum
#

this is the array I'm using Yes. Strings.
its content is all the vehicles No it's not.
allVariables returns the names of variables.

next scaffold
#

yeah, sorry. I just realized you're both right

tough abyss
#

You don’t need getpos could just pass _x to inArea

next scaffold
#

can I? Well first I got to find out how to take the variable names from string to non-strings(?)

tough abyss
#

missionNamespace getVariable _x

untold sparrow
#

would you happen to have any elaboration on the setAperture...im pretty new to scripting @cursive whale

high marsh
#

Aperature, just like a camera. How much light is taken in

next scaffold
#

@tough abyss thanks! It works 😄

lusty canyon
#

if i check (_vehObject isKindOf "Air") will that be enough to net me all helicopters/planes/uavs? will it also net stuff i dont want like missiles/paratroopers?

still forum
lusty canyon
#

@still forum thanks ive been looking for a browser based config viewer, the in game one is so slow to load

still forum
#

There have been multiple in the past. Sadly they all died through lack of updates.

#

this one is also outdated. For some reason noone can make a open-source/community managed config viewer...

lusty canyon
#

my issue is i want to get a flying veh thats being painted by a uav laser, so far i have:

_laser = objNull;
if ( isLaserOn (getConnectedUAV player) ) then { 
    _laser = laserTarget (getConnectedUAV player);
   _vehTGT = (_laser nearEntities ["Air", 5]) select 0;
};

is there a better way to do this? also the uav thats locked onto a target will sometimes overlead the laser so when i near entity the laser it i get nothing

#

(or is there a way to force the uav to always slew the laser onto the surface of a moving target? i tried anim speed but nothing changed, im thinking the turret cannot rotate fast enough to track a locked target so it always adds too much lead, hence the laser object is lost in outer space)

tough abyss
#

you defined _laser inside a scope, it is undefined outside of it

lusty canyon
#

@tough abyss sorry there is more code before and after i just pasted the important bits (edited)

lost copper
#

Hello everyone! Can anyone help me with ACE3 Mortar system?

tough abyss
#

Ask on Ace Slack maybe?

lost copper
#

@tough abyss sorry, I don't understand what you mean. Can you explain that to me?

astral dawn
#

Slack is a program for chatting like discord

#

and ace developers have a server there

lusty canyon
#

so i spawned 3 ammo objects white flare, white smoke, and IR flare. they are emitting properly i just want to delete them after some sleep or other condition, but they dont want to get deleted and stay until TTL:

_smokeArrStrs = ["F_40mm_White", "F_40mm_CIR", "G_40mm_Smoke"];
_smokeArrObjs = [];
{
    _i = createVehicle [_x, (getPosATLVisual player), [], 0, "CAN_COLLIDE"];
    _i attachto [ player ];
    _smokeArrObjs pushBack _i;
} forEach _smokeArrStrs;
sleep 10;
{ _x setDamage 1; deletevehicle _x; } forEach _smokeArrObjs;

as u can see i tried setdmg and delveh both did nothing

fiery dew
#

hey everybody, I'm looking for some help with a couple simple scripts I just don't know how to get to work on a dedicated server. 1) allow damage false on a chopper object and 2) group moveinCargo chopper variable. the scripts I use in editor work fine, but on a dedi server everything goes to shit for me.

tough abyss
#

both should be executed at proper locality

#

where chopper is local

fiery dew
#

that's the whole thing I'm trying to figure out right now, locality, maybe I'm putting these in the wrong location. Right now I'm throwing them in the object init

lost copper
#

@astral dawn so i can connect to ACE3 Slack chat for free?

astral dawn
#

IDK never used Slack

#

or maybe I did and dont remember 😄 should be free I think

lost copper
#

I didn't work with Slack before and i confused a little 😅

#

Thanks!

next scaffold
wary vine
#

is there a simple way of converting dik code to character

robust hollow
#

as in the key it refers to? keyName code

wary vine
#

ty

#

i can work something out with that

real moat
#

If I do

_array = [
    ["Alpha", getMarkerPos "alpha_mkr"],
    ["Bravo", getMarkerPos "bravo_mkr"],
    ["Charlie", getMarkerPos "charlie_mkr"]
];

Will the result be getMarkerPos result in its own array?
Or should I place the getMarkerPos "mkr" in brackets?

#

(Not connected to any code, just a side question)

#

So the above vs:

_array = [
    ["Alpha", [getMarkerPos "alpha_mkr"]],
    ["Bravo", [getMarkerPos "bravo_mkr"]],
    ["Charlie", [getMarkerPos "charlie_mkr"]]
];

Which is correct?

copper raven
real moat
#

Thanks!

#

Had a feeling

dawn fog
#

which channel would I use for vehicle creation?

young current
#

depends what part of it

dawn fog
#

the actually conversion to in-game

#

no modelling

#

but thanks either way

young current
#

mostly at least

real moat
#

Is there some fancy way to create a couple addActions in a loop? Before I start trying to use a while loop I thought id ask.

north tree
#

is there a chance anyone could help me understand the saveProfileNamespace and maybe help me get a demo script made for me to work off of since there are no tutorials on how to use this, i would appreciate the help. will provide more support for asking this if necessary

#

that or help with how to setup inidbi2 if its easier

tough abyss
#

saveProfileNamespace invokes file write operation that saves the data you stored in profileNamespace onto disk. Otherwise the data is kept in memory. File write is costly therefore it is not performed automatically every time you put something in profileNamespace, however Arma 3 scripted framework does force file write at certain points so you don’t have to do it yourself. You can always force it yourself if you think it is needed.

#

for _i from...do { addAction... How more fancy do you want it @real moat ?

north tree
#

@tough abyss not meaning to sound mean but i got that much from the wiki i was more asking if someone could explain briefly or DM me on how to use it to actually save things. sorry for not being specific, i wanted to avoid a long and drawn out message in the chat.

fleet hazel
#

Guys. Where can I find Task Force Radio for Linux ?

still forum
#

You use the same version as on windows

real moat
#

Can someone please help me understand why this isn't working:

params [
    "_obj"
];

_spawnCarrier = getPos _obj;
"respawn_west" setMarkerPosLocal [
    _spawnCarrier select 0,
    _spawnCarrier select 1,
    _spawnCarrier select 2
];
#

I know that markers dont have a Z co-ord but I saw some guides say that this method works to move the marker.

#

I'd like to put the marker on the carrier deck. My _obj is an invisible helipad on the flight deck.

#

It moves the marker X and Y correctly, but I still get dropped in the water.

still forum
#

why do you take the position apart and then put it back together??

#

setMarkerPosLocal takes AGL. getPos returns AGLS.

#

use getPosASL and ASLToAGL

#

and don't take the array apart just to put it back together immediately that's useless

real moat
#

How do I take the position apart exactly?

still forum
#

why apart?

#

There's no reason to take it apart

real moat
#

Didn't do it consciously.

#

I dont know what I did to "take it apart".
What am I doing to take it apart?

still forum
#

_spawnCarrier select 0

#

You have an array of 3 elements, you are taking each element out seperately, just to put it back into a new 3 element array.
That's nonsense

real moat
#

Okay man, jeeze, thanks.

#

To be honest

#

"respawn_west" setMarkerPos getPos _obj;

#

This is what I had

#

But it didnt work

#

So I got the above from a tutorial video.

still forum
#

Never seen a good SQF tutorial video, that wasn't either horribly outdated, or where the author didn't actually understand what he was doing besides copy-pasting things together that someone else wrote

tough abyss
#

did*

real moat
#

Yea, hence why I have been trying to learn so I dont have to rely on tuts. But yea, I gotta get this thing to work so I resorted to a video.

#

Well Ill take what I had and look up the stuff you mentioned and try again.

tough abyss
#

What is _obj?

real moat
#

Invisible helipad

tough abyss
#

Try setMarkerPos ASLToAGL getPosASL _obj

real moat
#

Object init:

[this] execVM "scripts\spawnOnCarrier.sqf";
#

Okay, trying now

#

Works, many thanks

#

So it was the getPos variant and the conversion that I was unware of. Learning new things all the time. Thanks.

tough abyss
real moat
#

Will do!

#

Since its so short...

#

You guys reckon I should just plop it all in the helipad's init?

#

"respawn_west" setMarkerPosLocal ASLToAGL getPosASL _this;

still forum
#

you could yes

#

but then it would be this not _this

frigid raven
#

is there a way to get rid of these task destination icons?

#

couldn't find a flag to disable them in the framework

digital jacinth
#

so basically you want to have them still in the task briefing menu, but not on the map, right?

frigid raven
#

Yes

#

I like to use the task framework - it's convenient somehow but I don't like their markers

digital jacinth
frigid raven
#

Ah ok ? so destination is it

digital jacinth
#

if it is just the 3d marker that you do not like, there is a bool at the end

frigid raven
#

ah nice man

#

thanks a heap

fleet hazel
#

@still forum Linux dont read dll task force

still forum
#

What are you talking about?

#

linux server? linux port?

fleet hazel
#

@still forum Linux server

still forum
#

Why do you need the dll on a linux server?

fleet hazel
#

Task Force use dll for work.
dll expansion windows. I have Linux Server. I need to Task Force Work!

still forum
#

Yes...

#

Why do you need the dll's on linux?

#

I don't understand why you want them and what that has to do with #arma3_scripting

fleet hazel
#

Without the DLL, will it work?

still forum
#

Sure

fleet hazel
#

I didn't. For what they want? 😃

#

@still forum Thank You

lusty canyon
#

i running a heavy loadout on 10 ai units with setunitloadout, problem is players on the server actually feel the lag as the items are popluated. is there a faster way? what if i just do additem LOCAL ? will ai still respond normally? (like if magazine is local can they still shoot with it and mp clients can see it?)

keen bough
#

I have the problem, that i want to scan for backpack and vest containers in a object (vehicle, moslty) and then scan the backpack(s) for all kinds of items.

But it seems none of the commands i found seem to work and i miss kind of a example to work on. Can anybody help me out with an example eventually?

keen bough
#

I actually found an example ^^ Just took me over 1 hour to find :3 I selected the wrong container ^^

keen bough
#

-.-

#

This never happend.

trail hinge
#

if anyone's available, i would love some help on how to make a scenario where four units have objectives to kill each other, FFA style, and if any of them kill a guy, the objective to kill that specific guy is completed for the killer and cancelled for everyone else (those who didn't get the kill)

keen bough
#

Hmm. When i clean up the inventory within a vehicle, it seems there are invisible objects left behind. I cant click anything within inventory of vehicle but it fills up more and more space. Any idea which may cause this?

dim token
#

Any ideas why markers name-prefixed with "_USER_DEFINED", created globally or locally, cannot be deleted from the map like other normal map markers?

dim token
#

Oh joy. If you have another non-"user defined" marker on the exact same position, that marker masks the user defined one even if it isn't visible on the map. 🤔

tough abyss
#

Wiki page implies you can delete user marker @dim token

#

Or do you mean player cannot delete one if it was added with script? Your question is vague

robust hollow
#

i read it as "why cant players delete markers created with createMarker?" and "You cant delete player created markers if a createMarker marker is on top of it". thats just my guess tho 🤷

tough abyss
#

@lusty canyon setUnitLoadout is expensive so if you run it on multiple units at once that is expected

dim token
#

Connor is correct.

#

What's the best strategy for making a specific group of AI (say pilot/gunner in a gunship) better able to spot infantry, without spoon-feeding them information about that infantry via reveal? I'm perfectly happy to adjust the target infantry's properties to make them easier to spot, but I don't want the gunship to have "impossible" (no line of sight possible, out of range, etc.) information about those units.

tough abyss
#

Personally I think what we did with CF_BAI/detect is the way to solve it. Ultimately it uses reveal but it is based on a whole range of factors and worksaround the issues with the games fundamental issue with spotting that was introduced fairly recently that shortened the range dramatically.

dim token
#

Can you give me a brief outline of your algo or can you just point me to your source?

dim token
#

Perfect! Thanks.

tough abyss
#

There is a decent description on our website, steam and the forums if you just want the high level of everything taken into account

dim token
#

Pretty interesting stuff, thanks for linking. A worthy pursuit.

keen bough
#

Which would you prefer to script?
A) You equip yourself within an full ace arsenal and run through a payment-trigger and the cost of the items you have equipped are automatically withdrawn from the money-variable or

B) A Shop Menu where you can buy items directly and they are put into a container or

C) Do everything over 'addAction' for a'really old style' of shop?

tough abyss
#

A)

still forum
#

A

keen bough
#

Yep, i came to that conclusion too. Its more work but totally worth it. Its not that hard as well ^^ just a lot to type XD

#

But instead of running through the payment trigger, you just exit the shoptrigger. Basically: Enter the trigger, your current equipment gets saved in the database under your name. You leave the trigger and you pay everything that you have extra on you (like more magazines, weapon attachements and so on)

tough abyss
#

yeah, connecting payment trigger with database saving is good

keen bough
#

can i initialize a variable as simple array like _blep = [[]]; and then post there my loadout from my soldier? Like _boop = loadout from that gut _blep = _boop;?

still forum
#

Yes. Variables can be set to values.

#

No idea what you are asking besides that

tough abyss
#

_boop will ovewrite _blep when you assign to _blep

#

no idea what you want to do

keen bough
#

sweet. I want to get a units loadout when they enter the shop, save that up in the database, let them do their thing and when they leave, the new items they got, will be tested with the old ones and then they have just to pay for things that they had bought anew.

#

all with the comfort of the sweet ace arsenal

tough abyss
#

still no idea what this has to do with _boop and _blep

keen bough
#

i have to initialize the inidbi2 database entry somehow, because i use that one. And the unit loudout are a lot of arrays

#

normally i initialize for a category like weapons with [[name],[amount]] but with the unit-loadout... its very weird array

swift crane
#

when I'm using command join grpNull - my unit start turning North. Is this a bug?

#

how can I remove unit from a group without turning?

keen bough
#

does the whole group turn? are they doing something or just standing?

swift crane
#

unit that had been removed from the group just turning.

tough abyss
#

probably turning into direction of default formation. Try to add _unit setformdir getdir _unit; right after joining grpnull

#

yeah works

restive cedar
hollow thistle
#

With Arma 3 v1.92 an alternative syntax is added allowing to specify clipping type to be used we're on 1.90 aren't we?

#

You would need to use dev branch for that.

robust hollow
#

i've noticed a few 1.90 pages say 1.92 🤷

restive cedar
#

ok thanks

brave jungle
#

In CBA settings, the logged in admin cannot change any setting, no matter what mission file is used. Is there any back-end files you need to adjust or is it something simpler?

still forum
#

if settings are forced by a userconfig/config then you cannot change them in interface, because you wouldn't be able to save them

brave jungle
#

Thought as much

#

Cheers

fleet hazel
#

guys. How to make the night lighter?

still forum
#

play at full moon night

fleet hazel
#

@still forum And how to make the night was always a full moon?

still forum
#

Look into a calendar that shows moon phases

#

And choose a date that has full moon

fleet hazel
#

@still forum Thanks friend!

winter rose
tender fossil
#

Aren't marker variable names defined in editor global variables?

#

I defined two markers in editor (added variable names to them) but when I try to access those markers from script, it complains about undefined variable

still forum
#

markers are strings

#

are you sure your name is a variable, and not just the markername?

tender fossil
still forum
#

🤔
Maybe the Variable part of that is just wrong

#

try to just use it as the marker name

tender fossil
#

I'm trying to access it like this:

_areas = [tuna1, tuna2];

{
...
} forEach _areas;
still forum
#

marker names are strings

tender fossil
#

So how do I access them then? o.O

still forum
#

using the marker commands

#

which all take marker names as strings

tender fossil
#

Ah, I see

#

Omg, I see why it didn't work now. I used markers in my own mission while the original one had triggers instead of markers

tender fossil
#

Is there a way to determine how large an object is in the field of vision of player/unit?

#

I know you could get it working in hacky ways but just wondering if there's some direct way to retrieve the info

#

The script should take into account if player is using eg. rangefinder or binoculars, ie. it should retrieve the actual size of the target object in player's FOV

digital hollow
#

boundingBox and worldToScreen maybe

tender fossil
#

Thanks for the tip @digital hollow! 😃 A bit of googling revealed that KK has kind of done this already:

KK_fnc_trueZoom = {
    (
        [0.5,0.5] 
        distance2D  
        worldToScreen 
        positionCameraToWorld 
        [0,3,4]
    ) * (
        getResolution 
        select 5
    ) / 2
};
tender fossil
#

This is part of my init.sqf:

onEachFrame {


    hintSilent format [
        "CURRENT ZOOM: %1x, \n Soldier position on screen: %2 \n Distance between soldier and civ: %3 \n Currently recognized units: %4",
        round (call KK_fnc_trueZoom * 10) / 10, call soldierWTS, call distanceSoldier, call playersInRange
    ];

    frameNumber = frameNumber + 1;
};
#

This is function playersInRange:

playersInRange = {

    if (frameNumber > 0) then {
        deleteMarker "playersRecognizedInArea";
    };


    _playersRecognizedInRadius = call KK_fnc_trueZoom * 60;

    _playersRecognizedInArea = createMarkerLocal ["playersRecognizedInArea", getPos player];
    _playersRecognizedInArea setMarkerText "";
    _playersRecognizedInArea setMarkerSize [_playersRecognizedInRadius, _playersRecognizedInRadius];
    _playersRecognizedInArea setMarkerDir 0;
    _playersRecognizedInArea setMarkerShape "ELLIPSE";

    _players = allUnits; // just for testing, for production use this instead: allPlayers - entities "HeadlessClient_F";
    _playersInRange = _players inAreaArray _playersRecognizedInRange;

    _playersInRange
};
still forum
#

nil

tender fossil
#

Shouldn't it show [] then?

still forum
#

no

#

nil of type array

#

inAreaArray returns nil

#

maybe because _playersRecognizedInRange is nil

tender fossil
#

Ah, I changed the variable name and forgot to edit the latter part

still forum
#

createMarkerLocal fails if name is duplicate I think

#

oh.. or that

tender fossil
#

Yay! It works now 😄

keen bough
#

There is a command that compares things to have the same things in two different arrays to get the new one only with the things that both have in common.

Maybe i oversaw it but is there a command to compare what is NOT in common and get a list of the things that puts all the things not in common into a new array?

hollow thistle
#

arr3 = (arr1 + arr2) - (arr1 arrayIntersect arr2)
should give you only things that are either in arr1 or arr2. But It will remove duplicate values too.

keen bough
#

Ah, sounds good! I gonna give it a test (i will compare two unit loadouts - if you know i will fail beforehand, tell me before i write my script XD)

hollow thistle
#

This will only work for shallow arrays.

tough abyss
#

You can always pushBackUnique to avoid duplicates

keen bough
#

so probably not for more complex arrays than the one i get with the unitloadout @hollow thistle ?

hollow thistle
#

If you have arrays in array it's not shallow array anymore. So yes, it won't work.

keen bough
#

dang. So probably i have to write a bigger script for comparing these two arrays haha ^^ thought so already.

#

why cant i just say
if player buys shit, pay the shit, let em play 😄

tough abyss
#

You said it

mortal yoke
#

anyone can confirm keyframe animation system is broken since the last update?

#

😑

#

preview in 3den works, in game objects just dont move along

#

same code was working before

#

Cant believe I wasted all that time tweaking my curve 🙄

mortal yoke
#

ok, well.. disabled mods and it works (kind of).. only if I start the timeline manually OR set it to loop fml i'm just dumb. its not bugged.

keen bough
#

can i break "[] spawn"? I mean, disable it when i dont need it anymore?

#

or can i ignore it since i wont have thousands of scripts running. I would say, probably just a bunch up to at max a hundred, maybe.

queen cargo
#

uhm ... wut?`

keen bough
#

i mean, break/disable a running spawn

keen bough
#

ARGH i overscrolled XD

burnt cobalt
#

If a player uses the 'take control' option while being the gunner of an AI controlled helicopter - can that state be returned?

tough abyss
#

Release control you mean?

burnt cobalt
#

The state where the player is gunner and driver/pilot at the same time

tough abyss
#

Or you want event handler?

burnt cobalt
#

Hoping to avoid eventhandlers if possible

#

i was hoping that _unit == driver _vehicle and _unit == gunner _vehicle would both return true but they don't of course, makes sense

burnt cobalt
#

I'm trying to return if the gunner is currently the pilot or not - in a perfect world something like:
player has not taken controls: effectiveDriver _vehicle == driver _vehicle
player has taken controls: effectiveDriver _vehicle == player

tough abyss
#

Is it possible to create a vehicle without using createVehicle?

craggy hound
#

Does anyone know of a way to increase a vehicle's top speed? I have a boat I would like to go a little faster.

tough abyss
#

@craggy hound setVelocity but I only know how to make it so that you can set a vehicle speed with cursor, I do not know how to change the speed within the actual vehicle.

#

cursorTarget setVelocity [0, 0, 125];

craggy hound
#

ty

tough abyss
#

That makes them go up

#

0, 0, 0 stops them in place

#

Mess around with that, Idk how to mess around with speed inside the vehicle though

#

Is it possible to create a vehicle without using createVehicle?

queen cargo
#

Uhm... Wut? @tough abyss

tough abyss
#

@queen cargo Do you not get what I'm saying? How do you create a vehicle without using the createVehicle command

#

*Spawn a vehice

queen cargo
#

Reread what you just said, and then try to actually ask a question one can answer

tough abyss
#

So it's not possible? Or do you want to be a dick?

north tree
#

ill ask before spending the next hour looking for it and not finding it but, what would i have to do in order to have a script in the initserver.sqf refresh in order to have it effect AI which i have placed down mid mission via zues?

high marsh
#

add the entity placed event handler to the curator

north tree
#

im sorry? i that one might be out of my expertise/ understanding.

high marsh
#

add it to the init field of your curator object

north tree
#

ok ok i see what you ment, and i reread my msg and relised that i fracked up i ment is there a way to have a script set to refresh/ rerun after a set period of time in order to include units placed by zues. and if i use https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Curator then how would i have to integrate it into the script?

keen bough
#

If i am correct, you could spawn a scheduled script with while and sleep in it, to detect placed units on the map and give them the proper handlers. At least, that was the way i could imagine it but i am not a reliable source with scripting since i am not perfect with arma scripting.

#

Was anyone forseeing the time of 'getUnitLoadout' and got every single position with its function (like select 0 select 0 is the main weapon)?

high marsh
#

You see what I posted above? That's the solution, use the curator event handlers.

#

use weaponState or primaryWeapon to return primary weapon of a unit

keen bough
#

I am scripting a huge comparing shop script where i get a units loadout completely and put everything in order to be checked 😃 The unitLoadout command gives a static array, and i wrote down already most of the positions - yet i wonder if anyone came up with an already pre-done list

#

i am missing launcher select 1/5 - i cannot figure out what this position stands for.

high marsh
tough abyss
#

@tough abyss yes it is possible

tough abyss
#

@tough abyss I've sent a friend request, please accept it

#

Thanks but I’m not looking for new friends

#

Ok, that's fine

proper sail
#

dont know why you wouldnt want to use createvehicle

west grove
#

hey folks. quick question. i need to know if a player is looking at a certain point. i'm pretty sure i've seen a function for that already once, but i can't remember.

#

anyone got a clue?

#

i can't just run cursortarget or similar, because the point is.. well.. invisible

#

so i figured just checking if the player is facing that direction, in combination with a range check should do the trick as well

still forum
#

getPos point vectorDiff eyePos player -> matches roughly cameraViewDirection of player

#

maybe swap eyepos and point pos out.

west grove
#

thanks! i'll check it out

tough abyss
west grove
#

oh yeah, that's the one i used ages ago

#

works perfect. thanks

quartz coyote
#

Hi
I'm struggling with a localise and a format. Can't find much on the biki about it...

player addAction [localize format ["STR_ACTION_WEAPONONBACK",(primaryWeapon player)], {player forceWalk true; player action ["hideWeapon",player,player,101]},[], 1, false, true, "", "currentWeapon player != '' && vehicle player == player"];```
```SQF
<Key ID="STR_ACTION_WEAPONONBACK">
                <Original>%1 on back</Original>```
#

I can't get my %1 to be (primaryWeapon player)

winter rose
#

format [localize "str_ddd", firstElement]

#

also, what if the player changes weapon ;-)

quartz coyote
#

perfect, working !

#

i'll deal with that kind of thing after 😄

#

I'm trying to understand 1 thing after another 😄

lost copper
#

Hi everyone! I have a problem with static weapons. I can add magazine to turret by addMagazineTurret command, but player need to reload this magazine manually by menu. How i can reload turret by command or script?

copper raven
#

Not possible afaik

lost copper
winter rose
#

remove/add weapon maybe? should load the magazine in the added "weapon"

lost copper
#

@winter rose every time i add new magazine to turret i should remove and add turret weapon?

winter rose
#

no, after adding them all

#

unless you add them only when the other is empty

lost copper
#

I'm working with mortar, i will add shells one by one 😅

#

But it's works, @winter rose

winter rose
#

magazines of shells right?
ok. if you tell us more about your use case, we may have a better solution 🙂

lost copper
#

Yes, magazines with one ammo in them. Your solutions works, but i worried about perfomance in the game.

winter rose
#

add all the magazines of the same type you want, then remove/add the weapon, this should do

#

if you had a magazine with more than 1 ammo (I guess) we could have used setAmmo

lost copper
#

In current variant of system player add one magazine with one round. And player can't add more magazines, only after shot.

tough abyss
#

https://community.bistudio.com/wiki/loadMagazine doesn't work in A3? why question mark? It should work

lost copper
#

@tough abyss i try to use this command with my turret and it didn't do anything.

tough abyss
#

How did you use it

lost copper
#

@tough abyss

_mortar = mortar_2b14;
_magazine = "ACE_1Rnd_Mortar_HE_2b14_0";
_mortar addMagazineTurret [_magazine,[0]];
_mortar loadMagazine [
    [0], 
    _mortar weaponsTurret [0] select 0,
    magazinesAmmo _mortar select 0 select 0
];
tough abyss
#

You are trying to get magazine name from empty mortar?

lost copper
#

@tough abyss Cause it already have magazine. I add it by addMagazineTurret command and try to reload it.

tough abyss
#

Does mortar have a gunner?

#

Is it mp or sp?

lost copper
#

MP, mortar can have a gunner or not (in the moment of adding magazine).

tough abyss
#

You have to have gunner and I suppose you also need to check that turret is local

lost copper
#

I think if i find a solution - i will solve a problem with locality.

#

For now only solution of @winter rose works for me:

remove/add weapon maybe? should load the magazine in the added "weapon"
tough abyss
#

The solution is loadMagazine command that has rules of usage, if you don’t follow them it might not work as intended

lost copper
#

Now i test this command in single player, use standart turretPath, weaponName from config and classname of magazine, which already added in mortar (cause i can reload it from action menu and fire after reloading). And loadMagazine didn't work!

I try to use this command on other static turrets. Maybe i do something wrong.

lost copper
#

@tough abyss i test loadMagazine on vanilla static 12.7 mm HMG, it didn't work

tough abyss
#

Tried reload vehicle player?

lost copper
#

works perfect, but it's not what i want to do 😩

tough abyss
#

Then I don’t understand what you want to do

#

Irgendein deutscher Scripter hier?

#

Nein

lost copper
#

Ok, try to explain my idea. I works with ACE 3 mortar system, i want to adapt them for RHS mortars. I create my own ammo, create my own magazines, own weapons and so on. In ACE3 mortar shooting looks like:

  1. Loader takes mortar magazine from ammo box. This magazine contains one mortar shell.
  2. Loader by ACE action add this magazine to mortar. In ACE3 it based on CBA EH (in them i see this code "_static addMagazineTurret [_magazine,[0]];").
  3. After loading first magazine loader can't add more magazines into mortar before anyone fires from mortar.
  4. When mortar loaded, shooter (it's can be a loader or other player) can sit on shooter's slot and fire this round.
    So this system works perfect, i can reload and fire mortar by my magazines, by there is a problem. If i firstly load one type of magazine, and shoot from mortar, other type of magazine didn't load automaticaly, only manual by shooter. And if magazine added to turret but not loaded - 3rd article become broken 😩.
    That is why i want to reload mortar after adding magazine to them by script. Deleting and adding weapon to turret after any reload works but i think that is not good for MP.
#

Sorry that i don't explain all problem at once.

tough abyss
#

So why reload command is no good?

lost copper
#

because when loader adds magazine, shooter slot can be empty

tough abyss
#

That’s fine addmagazineturret reloads mortar regardless if gunner present or not, you just need to remove empty magazines forcefully before that

lost copper
#

How i can check empty magazines?

tough abyss
#

@tough abyss Englisch bitte

lost copper
#
Deutscher Scripter gesucht, bitte per PN anschreiben!

German Scripter wanted, please write via PM!

tough abyss
#

Dont need to check just remove mortar removeMagazinesTurret ["8Rnd_82mm_Mo_shells", [0]];

lost copper
#

@tough abyss so about empty magazines. How i can detect it?

#

Ooo, ok. I try in now.

tough abyss
#

you can see all magazines with magazinesAllTurrets

lost copper
#

@tough abyss works with removeMagazinesTurret. Thanks for your help! 🥃 🥃 🥃

tough abyss
#

How to spawn vehicle without using createVehicle?

young current
#

you cant

#

createvehicle is the command to as the name implies to create a vehicle

winter rose
#

createSimpleObject, if we stretch it a bit

dusky pier
#

is possible to remove refuel action from fuel trucks?

copper raven
tough abyss
#

@winter rose Ty, will test out later

dusky pier
#

@copper raven ty, i will try

#

as i understand setFuel - for vehicle fuel tank, but setFuelCargo - for refuel truck cargo

copper raven
#

yup

dusky pier
#

if 0 - fuel truck can't refuel another vehicles

tough abyss
#

In theory

dusky pier
#

willing check on practice 😄

dusky pier
#

working nice

#

when getFuelCargo return 0 - scroll on all vehicles disabled. And you can't refuel from that fuel truck

dense idol
#

I am attempting to make a intro scene for my terrain (for the main menu). I copied the example that is posted on the BI Wiki but instead of using the camera position I copied, it just shows the 3rd person perspective of the character placed. How do I get it to show the camera position I copied?

winter rose
#

did you create a camera?

dense idol
#

["InitDummy",["Vacant",[3789.36,4009.8,10.1264],98.2004,0.75,[-2.56602,3.3384e-006],0,0,485,0.3,1,1,0,1]] call bis_fnc_camera;

winter rose
#

and where did you put this line?

dense idol
#

    {
        ["InitDummy",["Vacant",[3789.36,4009.8,10.1264],98.2004,0.75,[-2.56602,3.3384e-006],0,0,485,0.3,1,1,0,1]] call bis_fnc_camera;
        setviewdistance 2000;
    },


] call BIS_fnc_initWorldScene;

#

initintro.sqf

tough abyss
#

It has syntax error

dense idol
#

},

#

I see

#

Got it, thanks boys

dim token
#

Any idea why a mechanized squad (crew commander is group leader) refuses to actually move to the next waypoint after an unload waypoint? Everyone except the crew disembark, but they just sit around despite the grouper leader issuing the move order for the next waypoint.

#

Let me guess, driver has to be the group leader or things break with vehicles? Doesn't seem to matter in this case at least.

swift crane
#

I'm using switchmove on the player in mp mission. When player moves or pressing rmb - animations ends.. I dont want it to end because of the player inmput. What should I do?

tough abyss
#

Disable player input

swift crane
#

but I want to save possibility for the player to cancel animation in scroll action menu

tough abyss
#

Open display, player control will be switched to it

#

Or dialog

#

Whatever doesn’t let you move

keen bough
#

If i am correct, i can make single picked players to any side i want if i put them in the respected group. Like "Hey, you're in a civillian car" boom, player is now civillian. Am i kind of correct?

tough abyss
#

You can join player to different group on different side

keen bough
#

So, i just have to have the four sides ready. My standard, which is resistance, then a red, blue and a civ one. Am looking for kind of a direction. Can i check if a respective player is still in line of sight to an enemy?

tough abyss
keen bough
#

thanksies!

#

sweet, i wanna work on two projects. Bit of diversity. Shop is slowly going, i think i got it ready to test in two to three weeks followed by a very basic vehicle based undercover script that orients itself towards reality (i actually do research stuff that seems not so important) But it is very very hard to see a person in a car, moving at over 15 km/h (9 mp/h)

#

<stares at antistasi where people know that you're the resistance miles away just by feeling the air humidity> 😄

#

Do vehicles have a 'base side' so i could "easily" check if the vehicle is west/east/civ/independet vehicle? Or do i have to make it manually?

waxen tendon
#

escape char?

keen bough
#

hrm. You have any example i can look at?

dim token
#

Empty vehicles are civilian side by default. They will take on the side of whomever has occupied the vehicle. That "new" side remains for a short time even after the occupants have left the vehicle.

keen bough
#

empty vehicle - i knew that, yes. Hmm. So i have do a manual list for (all) the vehicles to give them practically a side, so, when a player enters a bmp, he will be seend by all others as 'east'

dim token
#

I could be mistaken but I don't think you can override the vehicle's side specifically without changing the side of the group the vehicle belongs to. You have to assign the vehicle to a group on the side with which you want the vehicle to be identified. I'm fairly certain this group has to be the same group as the occupants.

keen bough
#

its more or less a constant check script that checks my vehicle database. If a player is in a certain vehicle, their side will be changed to the respected side of the editor-side of the vehicle (like, bmps are east side, hemtt are westies and so on) Its not really hard to do but... eh, quite some typing work haha ^^

#

and the vehicle takes automatically the side of the player entering.

dim token
#

It seems like my problem is the AI pathfinding and not anything specific to the unload waypoint type. The next waypoint in question is on a wooded hill, and if they are issued move orders anywhere in the tree line, they just freeze up at that point.

keen bough
#

tried to teleport them a bit? Sometimes they unfreeze (at least for me) and move again.

dim token
#

Worth a shot. It seems like the pathfinding routine is choking on the amount of trees in this area or something like that. I'd expect the AI to refuse the move order if they didn't think they could travel there. Instead, they just sit there, as if contemplating how to get where they need to go.

keen bough
#

Hmmm, i get my ai always into woods. Eventually also try out shorter waypoints. Cant tell if that may help but i guess worth a shot. AI is still struggling with lot of things ^^ So we have to give them slight pushes into the right direction hehe ^^

dreamy kestrel
#

hello any KP Liberation folks here? I am looking for a scripting way to add the ACE Arsenal menu interaction to the Supply Box? really to shift from the scroll wheel menu option altogether, clear out the Supply Box contents, that sort of thing.

keen bough
#

Do you just want a full arsenal? @dreamy kestrel ?

high marsh
#

Why do you need a new thread for it?

keen bough
#

you could write it all in the init box as well, or with a trigger, or with a simple ace interaction. Various ways to do it. Sounded like that the box should be cleaned up regulary - i would automate it :3

tough abyss
#

What is the command to find the vehicle that you are currently in?

#

I want to mess around with setVelocity

robust hollow
#

vehicle player or objectParent player

tough abyss
#

@robust hollow Thank you, it's working, I can control my velocity in the car. But is there a way to go forwards where the player (me) is looking, because the values are static and take you to the same point unless you change them yourself

robust hollow
#

thats where the vehicle is facing tho

tough abyss
#

@robust hollow Ty, that's exactly what I needed

keen bough
#

392 vehicle placed and with a script saved... yeah. My initial thought was "how hard can it be, making a list writing the names by hand" ...

west grove
#

oi fellas. quick question again, because i'm feeling really stupid today. i have a script that spawns particles around vehicle player. now the thing is, if i switch to a drone... i'm not vehicle player anymore, thus the effect isn't following me. anyone got an idea for simple workaround?

#

is there something like "current camera" or somesuch?

proper sail
#

dont know about arma 3, maybe you could check for a dialog?

#

If you are in drone mode, a dialog might exist

west grove
#

that wouldn't really work, because i'd also need the position of the drone

#

i mean i could just check to what object the player is connected to

#

that would probably do it

#

it wouldn't work for generic cameras, etc. though, but maybe i can totally ignore that

robust hollow
#

cameraOn might work

proper sail
#

I don't really understand, do you want to transfer the particle effect from the player onto the drone?

west grove
#

yes, the particles are to follow whatever the player sees

#

e.g. sand storm stuff

still forum
#

you have already been informed about the #rules and which one you violated yesterday. I'd recommend you have a read before you violate again.

west grove
#

for some reason i really can't make the target commands work

#

reveal, dotarget, commandtarget and yet... the gunner is pointing to god knows where

#

it worked a couple years ago, but now it's either broken or something changed and i dont know what

#

i mean, how hard can it be to have the gunner move his weapon at any point? very, apparently.

west grove
#

yup, just trying it on a sitting helicopter and game logics all around it, dotarget and dowatch mean nothing to it

#

lol even if i create a laser target, it just won't point at it

#

maybe i should just script the bullets.

young current
#

are you trying to command a gunner that is part of a group?

#

not sure if those commands work if the gunner has a group leader

west grove
#

it worked once. maybe it changed. i'll test it.

young current
#

put just a gunner in the vehicle

#

that should confirm it

west grove
#

i had him join an empty group

#

thing is, dotarget seems to work... if the object is like right in front of it. so i assume they won't target, because for some reason they cant "see" it. but even using reveal 4 on it doesn't change that.

#

i'm pretty sure this stuff happened around the time we got the sensor overhaul

#

now everything is weird won't work as before

#

i'm just really curious why there aren't more posts about this on the forum. either i'm the only one who wants a vehicle to target something in the distance... or i'm the only one who does it wrong.

tough abyss
#

@winter rose createSimpleObject made he vehicle bit it was not drivable, i need it to be drivable

#

Any ideas

still forum
#

Reaper if your sole purpose is to get around battleye script filters, then I recommend stopping now.

tough abyss
#

Nope, my server i filter the createVehicle command to spawn vehicles

#

@still forum

still forum
#

If it's your server, why not remove the filter then? or execute your script serverside where the filter doesn't apply

tough abyss
#

You can?

still forum
#

Well yes.. createVehicle is not disabled by default

digital hollow
#

@west grove animateSource Example 2 is exactly how to animate turrets.

west grove
#

yeah, i was thinking about manually adjusting the turrets, but to me that seems to be quite overkill

#

i would constantly have to calculate the values just so the turret points at where it should

#

jesus, just two years ago, you'd use dotarget and the vehicle did exactly that

digital hollow
#

What vehicle are you trying to control? mabye try putting the target on datalink

west grove
#

kajman

digital hollow
#

Try putting it on datalink reportRemoteTarget assuming it's far away

winter rose
#

@tough abyss is it working as you want then?

west grove
#

@digital hollow can't get it to work

#

now i'm thinking.. i could just switch to guided missiles.

#

but again, no luck 😄 god damnit

west grove
#

trying my luck with spawning and BIS_fnc_DirTo now, but yeah, obviously that won't work out, because it's not taking the up/down rotation into account

#

or maybe it is and i'm just stupid, what do i know

#

5 hours of wasted time, i'm dying

#

at this point i'm considering to record a flight path, shoot manually, adjust everything to fit the results and be done about it

winter rose
#

you should work with vector yes for 3-dimensional movement

west grove
#

yeah, i hate working with vectors. usually BI already has a function for everything, but in this case probably not

#

i'm recording a flight path now. who knows, maybe it'll look better anyway

winter rose
#
private _vectorDifference = getPosASL obj2 vectorDiff getPosASL obj1;
_directionalVector = vectorNormalized _vectorDifference;``` you should be able to work something out? we're here to help 😃
west grove
#

usually i am, but i'm crunching on this project for 4 days now from morning to evening, and i'm at a point now, where i'm feeling it 😄

#

it's a "do something in 7 days"-thing, and i only have 2 days left

#

2 and a half or so

#

that's why it is even more painful having to spend hours on stupid stuff like "make a vehicle hit something"

brave jungle
#

_Stratis_Airbase_Units_Array = []; 
_script = { 
 { 
  if (side _x == west) then { 
   _x enableSimulation false; 
   _Stratis_Airbase_Units_Array pushBack _x; 
  }; 
 } forEach thisList; 
}; 
waitUntil {scriptDone _script}; 
missionNamespace setVariable ["Stratis_Airbase_Units", _Stratis_Airbase_Units_Array];

Error scriptDone: type code expected script

I must not see it...

still forum
#

scriptDone takes a script

#

not a piece of code

#

script is a script handle that spawn returns

#

also you are never actually executing your _script

#

I assume you'd want to do that

brave jungle
#

Oh of course, missing spawn ahah

still forum
#

Even if you spawned your _script though that wouldn't make any sense in combination with the waitUntil

brave jungle
#

because it delays anyway

still forum
#

you might aswell not spawn and not waitUntil and not put your script into a variable and just run it directly. same result

#

yes

brave jungle
#

Alright

#

Cheers

still forum
#
private _Stratis_Airbase_Units_Array = thisList select {
    if (side _x == west) then { 
        _x enableSimulation false; 
        true
    } else {false}
};
missionNamespace setVariable ["Stratis_Airbase_Units", _Stratis_Airbase_Units_Array];

And here is the whole script in a shorter and slightly faster variant.

#
private _Stratis_Airbase_Units_Array = thisList select {side _x == west};
{_x enableSimulation false} forEach _Stratis_Airbase_Units_Array;
missionNamespace setVariable ["Stratis_Airbase_Units", _Stratis_Airbase_Units_Array];

And even smaller. but probably slower

#
private _Stratis_Airbase_Units_Array = thisList select {
    private _res = side _x == west;
    _x enableSimulation !_res; 
    _res
};
missionNamespace setVariable ["Stratis_Airbase_Units", _Stratis_Airbase_Units_Array];

Or maybe this 🤔

#

But at that point one might aswell just

Stratis_Airbase_Units = thisList select {
    private _res = side _x == west;
    _x enableSimulation !_res; 
    _res
};
tough abyss
#

@winter rose I would like it to be drivable

#

Can't do this with createSimpleObject?

winter rose
#

no. as @still forum said, createVehicle is made to… create vehicle. if the server is yours and you can run the script server-side, as you say, it should be no problem.

#

TL;DR: use createVehicle; if you can not, tell us why

tough abyss
#

Kk, will just use createVehicle

winter rose
#

👍

prime fox
#

Hey there, I have just tried to create a mission where the npcs have dialogue and speak to the player. I have gotten all the scripts to work with the correct callsigns however, as soon as they are grouped, the names will get mixed up. So for example, lets say Jack says, "hello". Instead of the name Jack being next to it, it is replaced with Brandon's name (another group member). I have tried different solutions and i am not too keen on getting them to speak on group chat because then their names are just numbers. Any advice would be much appreciated.

winter rose
#

maybe setName could help. Using kbTell?

lofty spear
#

hi. i try to use diag_captureSlowFrame . Install profiling build from steam, got profiling label in launcher. when try to execute diag_captureSlowFrame ['total',0.003]; gor error:
23:54:42 Error in expression <diag_captureSlowFrame ['total',0.003];>
23:54:42 Error position: <['total',0.003];>
23:54:42 Error Missing ;
any idea what i'm doing wrong?

keen bough
#

when i try to get the player's vehicle he's riding i still get the player. I use for testing this:
_blah = vehicle (_list select 0);

#

Got it.
_vehicle = ((typeOf (vehicle (_playerList select 0))));

keen bough
#

Hm, i cant figure out why i cant set a selected players side/group. I used allplayers, picked a spot (array 0, because, just me for now and testing) and tried to put me in in the east-group:

hqEast = createCenter east; (just to be sure)
playerEast = createGroup [east,false];
_playerList = allPlayers - entities "HeadlessClient_F";
_thePlayer = _playerList select 0;
_thePlayer joinSilent playerEast;
Throw me a generic expression error. I tried many different ways now.

keen bough
#

... got it ... again. Forgot i needed an array -.-

still forum
#

@lofty spear you didn't launch the profiling version of the game.
No matter what the label in launcher says ^^

young spade
#

Could someone possibly help me with using a trigger to drive a function.

I want a trigger to spawn this function -- nothing more than trigger a screen message.

["message on the screen",3,5,8] spawn BIS_fnc_EXP_camp_SITREP;

but defining the trigger action as,

m = ["show message on the screen",3,5,8] spawn BIS_fnc_EXP_camp_SITREP;

(obviously) isn't correct... I get an error with using 'call' instead of 'spawn' too.

still forum
#

obviously? why obviously?

#

and yeah some functions need to be spawned

tough abyss
#

why does the "modelToWorld" function seem to be inherantly offset from my player using simple code??

s2 = player modelToWorld [0, 1, 0];
s3 = player modelToWorld [1, 0, 0];

_fuel = createVehicle ["VR_Area_01_square_1x1_yellow_f", s1, [], 0, "NONE"];
_fuel = createVehicle ["VR_Area_01_square_1x1_yellow_f", s2, [], 0, "NONE"];
_fuel = createVehicle ["VR_Area_01_square_1x1_yellow_f", s3, [], 0, "NONE"];```
still forum
#

Well for one modelToWorld returns world coordinates. createVehicle takes PositionATL.
Also createVehicle doesn't necessarily place at the position you give it
Because it tries to place vehicles as such as they won't collide.

tough abyss
#

What functions would you use if you were to make a grid of 1x1 vr shapes there?

#

getpos is kinda weird because of the heading parameter

still forum
#

Add _fuel setPosWorld s1 after each of the createvehicles

#

that forces it onto the correct pos

tough abyss
#

Sweet, I understand. Thanks bro

still forum
#

Also you might want to use modelToWorldVisualWorld as that includes rendering interpolation and will be more accurately matching what you see.
Whereas modelToWorld accurately matches what Arma sees internally

tough abyss
#

I’ll be real with you I don’t understand the visual methods.

#

However if you suggest using that I will play with that method

still forum
#

Arma only updates positions once a position update comes in

#

The visual version interpolates the position between the last known, and the assumed future position

#

non visual version the player teleports around. In the visual he moves smoothly

tough abyss
#

Alright, I can see how that is useful. I believe that I do understand what you're saying, I appreciate your responce, let me play with the visual methods so I can understand better.

tough abyss
#

-- Additional question,

I'm trying to pull variable name of trigger on activation
_trg setTriggerStatements ["{typeOf _x == 'CargoNet_01_box_f'} count thislist > 0", "_vname = name this; hint _vname;", "hint 'off'"];

_vname = name this; hint _vname; well - that's clearly not what I need, any solutions there?

proper sail
#

if you do a publicvariableclient directly from client to client. Will it be P2P or will the server still regulate that traffic

still forum
#

you cannot turn object into variable name really

#

You can try str this and hope the result is what you want. Which will only work if vehicle var name is set, and I don't know if triggers even support that

tame portal
#

@proper sail should still go through the server

proper sail
#

alright thanks

#

Im just wondering, because the Headless client on A2 is not server binary. So to reduce some network traffic i was thinking to directly pubvar from hc to client. But if it still passes through the server i guess it will not have any benefit

nocturne basalt
#

hi guys. Im executing a killed script in my Eventhandler which works nicely with pre-placed units, but they wont trigger on units placed by Zeus. Anybody know whats going on here?

this only happens on dedicated servers btw

still forum
#

where does your eventhandler get added?

nocturne basalt
#

in cfgvehicles

#

killed = "_this execVM '\WHwalkers\warhound\scripts\killed.sqf';";

#

@still forum I have an hit EH that do trigger though.

still forum
#

🤔 confusing
Maybe zeus placed units are a different classname?

nocturne basalt
#

hmm

#

can I check if an object is spawned by zeus?

still forum
#

there is a curator object create eventhandler that you need to add to the zeus logic

#

afterwards though.. Don't think so

#

maybe check allVariables on the object and see if zeus sets some variables on spawn

nocturne basalt
#

ok ty

hushed minnow
#

hello, a quick question of style:

// this?
waitUntil { !isNull player };

// or this?
waitUntil {
    !isNull player
};
winter rose
#

first

#

eventually, not isNull player for verbosity

digital hollow
#
// or this???
waitUntil
{
    !isNull player;
};
winter rose
#
// ok, you asked for it
waitUntil

{

    !!!isNull player // notice no semicolon

};```
#
@player == player``` in SQS 😄
hushed minnow
#

So lou, is that your style for all statements with {}

winter rose
#

waitUntil { }; one-lined if the condition is easily readable

else

waitUntil {
       condition1
    && condition2
    && condition3
};```
hushed minnow
#

I'm formatting legacy code, so i have to make a decision for the 'proper' style

winter rose
#

I prefer the Allman style:

command
{
}```to the other style

command {

}```generally, but for some commands I can make an exception

ruby breach
#

I started with the former, and then eventually came to prefer the latter

winter rose
#

heretic!

hushed minnow
#

im guessing that rule of "Whichever you choose is fine, just be consistent" is in effect?

dusk sage
#

What do you think

#

Nobody is going to arrest you

digital hollow
#

Although some may make a mission for their unit to arrest you.

hushed minnow
#

How about this line

if (hasInterface) then { execVM "misc\gps_marker.sqf";};
#

I don't need the inner ;?

dusk sage
#

Whatever floats your boat

#

1 byte won't sink the Titanic

hushed minnow
#

Okay, but I don't need the inner semi colon if its just one statement?

dusk sage
#

If it's the end of the scope

#

You can have as many statements in there as you want, the last won't need a semi colon

winter rose
#

but still, sexier/more pro if you do add it :3

lusty badge
#

Soooo there a script lurking out there in the land of c++ , im looking for a script where if someone goes outside of my map , the user will have “X” amount of time to get back inside in map otherwise theyll die and respawn ..... there anything like that out there that i can use?

tough abyss
#

@lusty badge like the Warlords gamemode?

lusty badge
#

Idk ive never seen warlords gamemode tbh

#

Basically would act as a boarder between the map terrain and the edges ... idk how to put it in words but its the area outside the map

#

Like if u pull up the map u wont even see ur position it’d be a back area

#

Black*

tough abyss
#

Go to official server and try it, if you go into a zone you are not allowed to be in you will see a countdown appear and you will die if it reaches 0

lusty badge
#

Yeah exactly

#

Thats litterly exactly what im looking for

slow isle
#

I cant find anywhere how to spawn a jdam which blows up on trigger

#

can someone give me the script

keen bough
#

Scenario: East-Player sits in vehicle.
What i want: How can i make every other player be able to get into the vehicle too, without changing their faction?

winter rose
#

maybe setCaptive the crew @keen bough

keen bough
#

Thanks, i will look into this

keen bough
#

Sadly, not really usable with my system. But since its a coop-setting i use a non automated system for my concealment.

swift crane
#

is there command to check - what is inside the Variable?

next scaffold
#

getVariable

swift crane
#

i dont get it how it works.
example: i have variable Car

#

how getVariable will help to check what is inside

next scaffold
#

you have a variable named “Car” and want to know the value of that variable, right?

swift crane
#

yes

next scaffold
#

Well it depends on what you want to do with that value

#

You could just print it with systemChat Car

#

What kind of data are you storing in that variable?

swift crane
#

oh yeah, i forgot that i can just use chat

#

thx

swift crane
#

how can i change color of smoke?
emitter = "#particlesource" createVehicle ([100,100]);
emitter setParticleClass "MediumSmoke"; //"MediumSmoke"
emitter attachTo [car, [0,3.5,0.3], "car"];

robust hollow
#

if BIS_fnc_moduleEffectsSmoke is anything to go by, you'd be doing something like this:

_emitter setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal_02",8,0,40,1],"","billboard",1,_particleLifeTime,[0,0,0],[0,0,2*_particleSpeed],0,0.05,0.04*_particleLifting,0.05*_windEffect,[1 *_particleSize + 1,1.8 * _particleSize + 15],
        [[0.7*_colorRed,0.7*_colorGreen,0.7*_colorBlue,0.7*_colorAlpha],[0.7*_colorRed,0.7*_colorGreen,0.7*_colorBlue,0.6*_colorAlpha],[0.7*_colorRed,0.7*_colorGreen,0.7*_colorBlue,0.45*_colorAlpha],
        [0.84*_colorRed,0.84*_colorGreen,0.84*_colorBlue,0.28*_colorAlpha],[0.84*_colorRed,0.84*_colorGreen,0.84*_colorBlue,0.16*_colorAlpha],[0.84*_colorRed,0.84*_colorGreen,0.84*_colorBlue,0.09*_colorAlpha],
        [0.84*_colorRed,0.84*_colorGreen,0.84*_colorBlue,0.06*_colorAlpha],[1*_colorRed,1*_colorGreen,1*_colorBlue,0.02*_colorAlpha],[1*_colorRed,1*_colorGreen,1*_colorBlue,0*_colorAlpha]],
        [1,0.55,0.35], 0.1, 0.08*_expansion, "", "", ""];
long hatch
#

hi, i was try to make a "modular" function for loadouts to be used by my Unit. But i struggle in a Problem, maybe someone can give me a hint. The New function won't work, but no errors at all, even the debug console gave a "true" back. Before i was try using this, i was use a similar function but without the camo pattern switch, which was work flawless.

code https://pastebin.com/RGpNhi9r

in my description.ext i have

// Functions
class CfgFunctions {
    class pb21 {
        class loadouts {
            file = "core\fnc\loadouts"
            class bundeswehr{};
            class loadoutActionsBW{};
        };
    };
};

class Params {
    class Camotype {
        title = "Uniform Typ";
        texts[] = {"Flecktarn", "Tropentarn"};
        values[] = {0, 1};
        default = 0;
    };
};
#

And please be fair, i am a beginner in scripting ^^ 😄

robust hollow
#

what do you mean when you say it wont work?

long hatch
#

It won't assign the Loadout

robust hollow
#

it sets the variables and rank before it?

long hatch
#

yes

#

it first sets ACE3 Traits, the the Rank after that the Uniform Camo pattern then the setUnitLoadout command

robust hollow
#
private ["_uniform1","_uniform2","_headgear1","_headgear2","_headgear3","_vestLeader","_vestMedic","_vestRifleman","_vestGrenadier","_vestMarksmen","_vestMachineGunner","_backpack1","_backpack2","_backpack3","_backpack4"];

add this above your _camoType == 0 if statement defining those variables, or change the way that works so you can use params instead maybe (only because private array is slow).

#

all those variables are nil in the function scope because theyre only defined in the if scope.