#arma3_scripting

1 messages · Page 518 of 1

tough abyss
#

makes sense

#

I don’t think it would come to that, it would be ambiguous before you need to worry about copy and reference. Gonna try to add ++string straight up, expecting it to fail

queen cargo
#

i will just stop talking to you about this right now 🤦

tough abyss
#

Whatever dude

#

I suppose you can have 3 unary ++ with higher precedence than unary + so that ++STRING is resolved first and ++NUMBER and ++ARRAY to duplicate chained unary + for those types to avoid errors. Super ugly but might work

#

Or just add one ++ANYTHING with higher precedence, a bit better

tall dock
#

I feel that I'm going crazy over those score eventhandlers...
I'm using a "Killed" eventhandler in an environment with a headless client on a dedicated server. This eventhandler basically does nothing but writing in chat when it gets attach to something and when it gets triggered, also it returns false so nobody gets any scores.
This EH gets activated for every player on missionstart on the server, also every player adds it remotely on the server to itself when the player respawns.
This is working absolutely fantastic when I try this on a self hosted environment or on a dedicated server without any headless client.

But as soon as I start the mission with an HC connected (which handles all enemy AI's), the EH goes haywire and sometimes triggers, sometimes not.
When I run around as soldier and kill AI's, it seems to somehow trigger fine, but when I'm inside any vehicle, it sometimes detects kills, but on ~70-80% of all kills the EH doesn't trigger at all, even though I got kills & score added. When I exit said vehicle and kill an AI unit, it triggers again.
What? How? Do I need to add it to the HC? Any other thing I am missing?

astral dawn
#

Does anybody have any idea why arma ungroups my units sometimes when they enter a vehicle?

marble musk
#

I'm trying to link Objects/Spawns to a invis object, so that if Invis object is present, one side (Opfor) spawns, but if not present Blufor spawns.. but i can't actually figure out how to do that.

#

Is there a better way to do this?

#

trying to make it so objects and spawns basically swap sides/locations for every new mission/run or something like that

high marsh
#

have the script decide which side to use, collect the spawned units in an array. Delete given units when you want to switch

marble musk
#

can you give more information on that? Atm trying to do this via in game Presence of Condition and a Invis object, unless i have to do via script?

high marsh
#

You don't HAVE to, but you can do it via script.

#

Not sure how that would work in a trigger, especially since you would need to keep checking for the units

#

If not, just send it to scheduler.

#

Every time a unit is created, feed it to a variable that the script can use or make a loop to catch the created ones

#

Also, I'm not sure how a invisible object would help you. Unless you were using it as a getter/setter for the current side spawning

robust hollow
#

why not use random? avoid the use of an object and spawn probability.

high marsh
#

That's what I mean

tough abyss
#

@tall dock try using MPKilled without any remote exec malarkey

#

Or use mission’s EntityKilled

#

You might be doing something wrong with Killed but it could take time to figure out what for no added benefit while there are better tools for the same job avaiable

#

I got this from the wiki, but it says generic error on the first line

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
    _line = format ["%1 killed By %2", name, _killed, name _instigator];
    [_instigator, _line] execVM "RewardMoney.sqf";
}];
robust hollow
#

show error from rpt

tough abyss
#
{
params ["_killed", "_>
 1:18:54   Error position: <["EntityKilled",
{
params ["_killed", "_>
 1:18:54   Error Generic error in expression```
robust hollow
#

not sure why it would error there 🤷

#

ur format is wrong tho

#

format ["%1 killed By %2", name, _killed, name _instigator];

#

name, _killed

tough abyss
#

oh shit

#

that was the error

robust hollow
#

didnt think it would recognize an error like that until the event fired 🤔

tough abyss
#

Why not? name, is a compile error

#

Why it pointed to params is weird though, unless that message was from another run

robust hollow
#

it pointed to the start of the addmissioneventhandler array

#

Error position: <["EntityKilled",

tough abyss
#

Ah yeah didn’t notice it

tough abyss
#

I shortened it because it doesn't seem to be getting the names. It keeps saying noVehicle for the instigator

addMissionEventHandler ["EntityKilled",
{
    params ["_unit", "_killer","_instigator"];
    hint format ["%1 was killed by %2", name _unit, name _instigator];
    [_instigator] execVM "RewardMoney.sqf";
}];
robust hollow
#

Worth noting that instigator param is objNull during road kill.
does that apply to you?

tough abyss
#

Nope, just shooting guys

#

Error: no vehicle to be exact

#

and doing this returns Guy killed Guy (same names)

addMissionEventHandler ["EntityKilled",
{
    params ["_unit", "_killer","_instigator"];
    _unit globalChat (format ["%1 was killed by %2", name _unit, name _killer]);
    [_killer] execVM "RewardMoney.sqf";
}];
robust hollow
#

do they actually have the same names?

tough abyss
#

Negative

robust hollow
#

are they the same object?

tough abyss
#

I would add eventKilled or whatever it is to each AI, but they're dynamically spawned via Ravage, so I'm not sure how I'd go about that

#

are they the same object how? I can kill 5 guys and each one will say "Martinez killed Martinez" or "Astorios killled Astorios" or whatever

robust hollow
#

have you considered adding logs to see where things go wrong?

tough abyss
#

I was hoping the event worked as it's explained on the wiki lol

robust hollow
#

soooo... thats a no?

tough abyss
#

of course not

#

zeus is myself

"unit O Alpha 1-3:1 : killer - O Alpha 1-3:1 : instigator - <NULL-object>"
 2:20:21 WARNING: Function 'name' - O Alpha 1-3:1 has empty name
 2:20:21 WARNING: Function 'name' - O Alpha 1-3:1 has empty name
 2:20:21 "unit O Alpha 1-3:1 : killer - zeus : instigator - zeus"
 2:20:21 WARNING: Function 'name' - O Alpha 1-3:1 has empty name
robust hollow
#

unit O Alpha 1-3:1 : killer - O Alpha 1-3:1
same dude?

frigid raven
#

suicide aye?

tough abyss
#

Shouldn't be, unless he killed himself somehow

#

_killer is getting the actual killer at least, I don't NEED the names, the whole point was to give money for kills and that seems to be working now

frigid raven
#

could not exaclty look into your exact issue tho - just suggesting stuff

tough abyss
#

Wait, the money thing is only working on dogs for some reason

#

If you setdamage kill the unit it would obviously have instigator null

#

actually it works on all animals

#

Unless you set shotparents

#

I'm not setting anything, I'm shooting em

#

Other scripts might do that, using mods?

frigid raven
#

stop shooting dogs pls

tough abyss
#

ACE, Ravage, RHS

#

Well ace is known for fucking with engine killings so no surprise here

#

Ahhh yeah, I should've known

#

I gotta turn in for the night anyway, hopefully I can figure it out after some sleep

simple olive
#

Hey, if anyone's around and has some time, I've got a little issue - I'm attempting to have a MP mission start with a bit of ambient chatter from some friendly AI. If I'm understanding it correctly it needs to be ran per-machine for it to show up so I have this placed in the missions init.sqf:
["localchat.sqf","BIS_fnc_execVM",true,true ] call BIS_fnc_MP;
The external sqf it's calling is basic: a few sleep commands between sideChat commands set to the soldiers via variable. Once I run the mission to test it though, the radio messages never show up. Any ideas why?

spark turret
#

tested in MP?

simple olive
#

Running off MP directly in the eden editor doesn't have it show up either. Im' assuming uploading it to my group's dedicated would provide a similar result.

#

I'm not certain if it applies here, but the ai soldiers might need Vanilla A3 radios equipped to speak on sidechat is something I stumbled across, I think?

spark turret
#

You want them to have radio chat or face to face chat?

#

say3d works fine in my experience

winter rose
#

DONT use BIS_fnc_MP , once and for all

simple olive
#

Noted. I'll try to find a way around it, I'm sure there's a much simpler option I'm just missing.

winter rose
#

HowTo:
1/ execVM the script on the server only
2/ in the script, use remoteExec

spark turret
#

^

simple olive
#

Alrighty, thanks!

last rain
#

I have random 3
How to convert? [1, 2 , 3] in [red. blue, green]
and select my random?

tall dock
#

Damn I shouldn't write stuff here when I'm tired. When asking about the "Killed" eventhandler, I actually meant the "handleScore" EH 🙄
This is the one that's not working when a HC is connected. For other stuff I'm actually using the entityKilled EH and that one is working fine

winter rose
#

@last rain

selectRandom ["red", "blue", "green"];
// or
["red", "blue", "green"] select (floor random 3);```
tall dock
#

So, any idea why a "HandleScore" EH would not trigger correctly on a server with a conntect HC?

last rain
#

@winter rose ["red", "blue", "green"] select (2); - it is "blue"?

winter rose
#

it's green; do _rnd -1 then

#

0, 1, 2, not 1, 2, 3 😉

last rain
#

@winter rose

["red", "blue", "green"] select (test);``` it is true?
winter rose
#

I wrote it: floor random 3 will return 0, 1 or 2

#

random 3is from 0 included to 3 excluded

#

@last rain

tough abyss
#

@last rain ```sqf
private _index = selectRandom [0,1,2];
["red","blue","green"] select _index;

brave jungle
#

Got an array of objects only. Do I use isNull or objNull if the element doesn't exist?

tough abyss
#

You can't do _x == objNull anyway so you have to use isNull(_x).

#

objNull is not equal to anything, including itself objNull == objNull is false.

#

There is more too it so it is worth a read on the wiki for the two items but I suspect isNull is what you are looking for to test the individual elements.

brave jungle
#

Alright will take a proper look, cheers

tough abyss
#

isNull _x

spark turret
#

i have a very basic question, in a for "_i" from 0 to 1, does it exectue once or twice?

last rain
#

How to forcibly move the player's map to the desired position in the beginning?

ruby breach
#

@spark turret twice

#

Technically execute once, loop twice. But I know what you meant.

tough abyss
#

mapAnimAdd mapAnimCommit @last rain

austere granite
#

Are there any (scripted) events that would trigger on a player living a mission in all scenarios? That means in editor preview restarting, SP, MP, etc. Whether it's end, or just leaving halfway.

vestal crow
#

Is there a script that toggles AI's NVGs down so I can take a screenshot of them?

tall dock
vestal crow
#

is there one where it toggles them on? like down? I tried the action one and they just stay up

last rain
#

@tough abyss it is not work 😦

tough abyss
#

Then you have to give more details what you are trying to do

#

@vestal crow maybe disable fsm on the ai and then force nvg. Should prevent them from auto detecting day/night and put htem back on, I think.

frigid raven
#
        _commander addAction [localize "str.coopr.aar.action.commander", { call coopr_fnc_deliverAfterActionReport }, [], 1.5, true, true, "", _aarActionCondition, 3];

The given function is automagically called with _target and _caller params in this case. Will the same work when using

 { remoteExec ["coopr_fnc_deliverAfterActionReport"]} 

Or do I have to make it explicit in this case like

 { [_target, _caller] remoteExec ["coopr_fnc_deliverAfterActionReport"]} 
quartz oracle
#

_ammo = magazines _this;
type array, expected object
am i stupid or something i cant figure out what im doing wrong pls help

frigid raven
#

_this is an array

tough abyss
#

_this select 0?

quartz oracle
#

nope still the same error

frigid raven
#

Aye - _this is the parameter array

quartz oracle
#

_ammo = magazines _this select 0;

tough abyss
#

do hint str _this what does it show

frigid raven
#

If the first parameter is an Array as well then... you need to make another _this select 0 select 0

tough abyss
#

_ammo = magazines (_this select 0);

frigid raven
#

Ah yea that might work

quartz oracle
#

_ammo = magazines (_this select 0); doesnt work

#

hint str _this
gives out
[[bis_o1,bis_o1]]

tough abyss
#

why 2 objects

#

_ammo = magazines (_this select 0 select 0); then

#

Pretty sure you dont need arrays that deep

quartz oracle
#

_handle = [_this] execVM "Mortar.sqf" is in an vehicle respawn module

frigid raven
tough abyss
#

so _this is already [obj,obj], you can just do this:

_handle = _this execVM "Mortar.sqf"

and inside script

params ["_obj1", "_obj2"];
_ammo = magazines _obj1;
quartz oracle
#

so obj1 is now the object the respawn module respawn _

#

?

tough abyss
#

dunno what params respawn module passes, [old unit, new unit]?

#

then _obj1 will be old unit

tough abyss
#

This seems to be working with ACE, just need to differentiate between animals and humans

addMissionEventHandler ["EntityKilled",
{
    params ["_unit","_killer","_instigator"];
    _killer = if (_unit == _killer) then {
    _unit getVariable ["ace_medical_lastDamageSource", _killer];
    } else { _killer };
    diag_log format ["unit %1 : killer - %2 : instigator - %3", _unit, _killer,_instigator];
    _unit globalChat format ["%1 was killed by %2", name _unit, name _killer];
    [_killer] execVM "RewardMoney.sqf";
}];
silent pewter
#

Anyone looking for work?

tough abyss
#

What kind of work?

silent pewter
#

Scripting

#

Trying to get more on my life community

#

Similar to A3PL

astral tendon
#

What does ACE do with the killed event handle? it seems it does not fires if the vehicle was not killed by script

#

this is on a dedicated server

silent pewter
#

Yes

#

I’m looking for someone experienced

#

I have one guy that is experienced but he needs help

#

Pm me

#

If interested

tough abyss
#

Not sure, but it's working for me

silent pewter
#

Oh my apologies @tough abyss

quartz oracle
#

can i somehow check if an element of an array exist without getting an error if it dont exist ?

            {
                marker = createMarker[str _i, getpos (_PlayerList select _i)];
            }
            else 
            {
                deleteMarker str _i;
            };```
because i getting errors here
(error zero divisor)
#

also can i check if somethink is not true. somethink like
if(marker select _i != nil) then
?

#

because i got errors when i tried this and i havent found anythink in the web

tough abyss
#

if (!isNil {marker select _i}) then ...

#

if not nil

quartz oracle
#

thx

tough abyss
#

or even better check that element exists
if (_index < count _array) then {_array select _index} element exists

quartz oracle
#

ok thanx

#

now have the next error at marker = createMarker[str _i, getpos (_PlayerList select _i)];
it says 0 elements provided, 3 expected

tough abyss
#

_PlayerList select _i doesnt exist

quartz oracle
#

im confused
i do _PlayerPos = GetPos (_PlayerList select _i); hint str _PlayerPos; and i get a position at the hint and a error (the position is changen when im walking so i think its my position)

ebon ridge
#

Any ideas on how I can stop a unit dismounting a vehicle? I ordered via allowGetIn and orderGetIn, and they do get in to their assigned vehicles, then after a few seconds one of them dismounts.

quartz oracle
#

btw it says undefined variable in _playerPos

ebon ridge
#

My current code is like this (paraphrased):

private _newGroup = createGroup (side unit);
_newGroup setSpeedMode "LIMITED";
_newGroup setBehaviour "CARELESS";
_newGroup setCombatMode "GREEN";
[unit] joinSilent _newGroup;
unit disableAI "AUTOCOMBAT";
unit setSkill ["courage", 1];
unit setSkill ["commanding", 1];
unit assignAsDriver _vehicle;

[unit] allowGetIn true;
[unit] orderGetIn true;```
loud python
#
#define radio_global  0
#define radio_side    1
#define radio_command 2
#define radio_group   3
#define radio_vehicle 4
#define radio_direct  5
#define radio_system  6
disableChannels[] = {
  {radio_global, false, true},
  {radio_side,   false, true}
};

Is there anything obviously wrong with that? For whatever reason it doesn't do anything

winter rose
#

@loud python (really) random thought but have you tried without underscores?

loud python
#

technically underscores should be ok, but I guess there's no harm in trying 😉

winter rose
#

I think too, I am just not that aware of configs and macros
maybe it's the fact it is between brackets that it doesn't like… I can't help you more 😐

quartz oracle
#
{
    _PlayerCount = count allPlayers;
    _marker = [];
    while {true} do 
    {
        _i = 0;
        
        sleep 2;
        _PlayerList = allPlayers;
        
        sleep 2;
        
        while {_i <= _PlayerCount} do 
        {
            if (_i < count _marker) then
            {
                deleteMarker str _i;
            }
            else 
            {
            _PlayerPos = getPos (_PlayerList select _i);
            hint str _PlayerPos;
            _marker = createMarker[str _i, _PlayerPos];
            };
            _i = _i + 1;
        };
        
    };
};```
it says  `error undefined variable in expression: playerpos`
but the hint is giving somethink out
```_PlayerPos = getPos (_PlayerList select _i);
            hint str _PlayerPos;
            _marker = createMarker[str _i, _PlayerPos];```
please help
robust hollow
#

are you selecting an index outside of the array length?

winter rose
#

issue:
_marker = []
_marker = createMarker
if (_i < count _marker) then

robust hollow
#

that would make it nil

#

assuming this is just a playermarkers script you could use a draw event and not need to handle moving/deleting markers

ruby breach
#

There's also the fact that he's pulling the number of players, waiting a bit, and then using allPlayers which is gonna break if someone connects or disconnects

winter rose
#

jup

quartz oracle
#

i want to set markers on the player position a bit delayed

winter rose
#

delayed from what?

tough abyss
#

Generic error in this...not sure where

addMissionEventHandler ["EntityKilled",
{    
    params ["_unit","_killer","_instigator"];
    
    //diag_log format ["unit %1 : killer - %2 : instigator - %3", _unit, _killer,_instigator];
    _killer = if (_unit == _killer) then {
    _unit getVariable ["ace_medical_lastDamageSource", _killer];
    } else { _killer };
    
    if (_killer isPlayer) then {
    switch (_unit isKindOf) do {
        case "CAManBase": {_amount = 5; _killer globalChat format [" killed %1!", name _unit];};
        case "LandVehicle": {_amount = 25; _killer globalChat " destroyed a vehicle!";};
        default {_amount = 1; _killer globalChat format ["%1 hunting bonus!", name _killer];};
    };
    [_killer,_amount] execVM "RewardMoney.sqf";
    };
}];
robust hollow
#

(_killer isPlayer)

#

(_unit isKindOf)

tough abyss
#

Not following, is the switch nested in there incorrectly?

robust hollow
#

isPlayer has no left argument

#

iskindof has a left and right argument

tough abyss
#

Ohh I see what you mean about the switch

robust hollow
#

isplayer is unary, argument goes on the right. iskindof is binary, has an argument on each side

quartz oracle
#

_PlayerPosList = getPos allPlayers;
i want to get the position of every player in a array but this doesnt work, how can i do this ?

robust hollow
#

allPlayers apply {getpos _x}

winter rose
#

ninja'd

tough abyss
#

Obviously this isn't right, still a generic error

if (isPlayer _killer) then {
        _kind = _unit isKindOf;
        switch (_kind) do {
            case "CAManBase": {_amount = 5; _killer globalChat format [" killed %1!", name _unit];};
            case "LandVehicle": {_amount = 25; _killer globalChat " destroyed a vehicle!";};
            default {_amount = 1; _killer globalChat format ["%1 hunting bonus!", name _killer];};
        };
    [_killer,_amount] execVM "RewardMoney.sqf";
robust hollow
#

_unit isKindOf

#

iskindof has a left and right argument

#

iskindof is binary, has an argument on each side

winter rose
tough abyss
#

How do I get the kind?

winter rose
#

typeOf, iirc

tough abyss
#

Jesus christ

#

Yeah I see isKindOf returns a bool

robust hollow
#

@quartz oracle to further expand on the draw event i mentioned before, you could do something simple like this so it still shows a delayed position and you dont need to delete old markers.

tag_updateTick = -1;
tag_currentPositions = [];
tag_nextPositions = [];

findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",{
    params ["_ctrlMap"];
    
    if (diag_tickTime >= tag_updateTick) then {
        tag_updateTick = diag_tickTime + 4;
        tag_currentPositions = +tag_nextPositions;
        tag_nextPositions = allPlayers apply {getPos _x};
    };
    
    {
        _ctrlMap drawIcon [
            "", // icon path 
            [1,1,1,1],_x,
            24,24,0,"",1,0,"TahomaB","right"
        ];
        false
    } count tag_currentPositions;
}];

is a bit cleaner, but whatever works for you 👍

quartz oracle
#

ill try it thanks

#

can i get an icon list somewhere ?

winter rose
#

the wiki yes

quartz oracle
#

a link maybe i cant find it ?

robust hollow
#

https://pastebin.com/0HFSzGk8
\a3\ui_f\data\map\vehicleicons
im not sure how many of those work as those names, wiki just says thats how it works. If you dont like any of those icons you can use any image, just use the full path to it
eg:
\a3\ui_f\data\map\markers\handdrawn\dot_ca.paa

green dust
#

Hey I was wondering if anyone knows how to make a zeus module make an object execute a script?

tough abyss
#

@quartz oracle allplayers is dynamic array it changes and do the count changes

#

It can change even between frames but you have seconds of sleep for no apparent reason

quartz oracle
#

i alreadz changed that

tough abyss
#

What's wrong with this one?

if (isPlayer _killer) then {
        if (_unit isKindOf "CAManBase") then {_amount = 5; _killer globalChat format [" killed %1!", name _unit];};
        if (_unit isKindOf "LandVehicle") then {_amount = 25; _killer globalChat " destroyed a vehicle!";};
        if (!(_unit isKindOf "LandVehicle") && !(_unit isKindOf "CAManBase")) then {_amount = 1; _killer globalChat format ["%1 hunting bonus!", name _killer];};
        [_killer,_amount] execVM "RewardMoney.sqf";
    };
robust hollow
#

is there an error?

quartz oracle
#

@robust hollow how long is the delay between each call (and how long does it need do set the first marker) also can i change the delay and if yes, how ?

robust hollow
#

the event itself is called on every draw. basically every frame.
tag_updateTick = diag_tickTime + 4; is the line that sets the delay, like that it has a 4 second delay

#

so itl draw the position icon on every draw, but the positions only update every 4 seconds, using the position from 4 seconds ago)

#

thats how i understood what u were going for anyway

tough abyss
#

_amount is not being passed apparently

robust hollow
#

_amount is not defined outside the if scopes?

quartz oracle
#

i wanted to do somethink that show the position of all player every few minutes with a bit delay so i wont get too boring with not many player

tough abyss
#

Yeah, it's not, I'll fix that

quartz oracle
#

i cant see the marker / draw / whatever

robust hollow
#

give me a min to write up another snippet

quartz oracle
#

btw i just pastet it in and commented my old code with /* oldcode */ hope thats right

robust hollow
#
tag_updateTick = -1;
tag_drawTick = -1;
tag_positions = [];

findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",{
    params ["_ctrlMap"];
    
    if (tag_updateTick != -1 && {diag_tickTime >= tag_updateTick}) then {
        tag_updateTick = -1; // disable updating until after next draw
        tag_positions = allPlayers apply {getPos _x};
    };
    
    if (diag_tickTime >= tag_drawTick) then {
        // icons are drawn for 10 seconds before fading out
        private _elapsed = diag_tickTime - tag_drawTick;
        // start fading out at 8 seconds, finish at 10
        private _iconSize = linearConversion[8,10,_elapsed,24,0,true];

        {
            _ctrlMap drawIcon [
                "\a3\ui_f\data\map\markers\handdrawn\dot_ca.paa", // icon path 
                [1,0,0,1],_x,_iconSize,_iconSize,0,"",1,0,"TahomaB","right"
            ];
            false
        } count tag_positions;

        // set next update tick after icons have faded out
        if (_elapsed > 10) then {
            tag_drawTick = diag_tickTime + 120; // 2 mins
            tag_updateTick = tag_drawTick - 5; // 5 seconds before next draw
        };    
    };
}];

@quartz oracle something like this should work. gets positions 5 seconds before drawing, draws for 10 seconds and then has a 2 minute delay until next draw.

quartz oracle
#

thx ill try it

tough abyss
#

I see remoteExec wants a number, would clientOwnerID work?

params ["_unit","_amount"];

if (isPlayer _unit) then {
"format ['%1 added to account!',_amount]" remoteExec [systemChat, _unit];
customCover_credits = customCover_credits + _amount;
};
robust hollow
#

owner is the number is wants, yes.

#

that system chat should be in a string

#

remoteExec ["systemChat", _unit];

tough abyss
#

Oh ok

robust hollow
#

also that will literally print
format ['%1 added to account!',_amount] to the targets chat

tough abyss
#

do I need to format it separately?

#
_string = format ['%1 added to account!',_amount];
"_string" remoteExec ["systemChat", _id];
robust hollow
#

format['%1 added to account!',_amount] remoteExec ["systemChat", _id];

quartz oracle
#

@robust hollow does the drawicon already exist because i cant see it
also i hope it is right that i put it in init.sqf

robust hollow
#

it does exist, just keep in mind it only draws once every 2 mins so perhaps lower that number while ur testing

quartz oracle
#

ive lowered it to 10 sec

#

i hope

#

tag_drawTick = diag_tickTime + 10; // 2 mins

robust hollow
#

👌

quartz oracle
#

how can i change the time of how long it drawing it _

robust hollow
#

if (_elapsed > 10) then { change the 10 to whatever you want

then also change the first two numbers here to mark the fade out time. like this is starts fading out at 8 seconds and ends at 10
private _iconSize = linearConversion[8,10,_elapsed,24,0,true];

quartz oracle
#
_DelayTime = 5;
_IconStayTime = 10
_IconFadeTime = 2```

```if (_elapsed > _IconStayTime) then {
            tag_drawTick = diag_tickTime + _UpdateTime; // 2 mins
            tag_updateTick = tag_drawTick - _DelayTime; // 5 seconds before next draw
        };    ```

```        private _iconSize = linearConversion[_IconStayTime - _IconFadeTime, _IconStayTime,_elapsed,24,0,true];```
#

id like to have every changable variable at the top to easely change them without much searching

#

hope ive done it right

#

@robust hollow ill go off for today if you have anthink for me send me a friend inv

robust hollow
#

they cant be local variables because the event runs in a new scope every time it fires

quartz oracle
#

@robust hollow ok ive send you a friend inv pls let talk tomorrow because im really tired right now bye

iron sand
#

How can I get scripts

#

I kinda want them so I can improve my zeus if

#

Zeusing

rose hatch
#

Does isMultiplayer return true on apex campaign solo mode? I have a sneaking suspicion it does...

#

Oh, never mind. Checked wiki and I believe I'll have to use isMultiplayerSolo...

glad timber
#

Is it possible to block access to buttons on the main menu? Im working on changing up the main menu like Arma-Life did.

primal dagger
#

May I ask how to add virtual Earplugs to a server without making people use a client mod?

robust hollow
#

"virtual Earplugs" as in a keypress toggle?

high marsh
#

fadeSound w/ keybind and use the key press to increase fadeSound step if you want to adjust the intensity in which the sound is faded.

#

displayAddEventHandler has a event handler called "keyDown" you can use for this

robust hollow
#
#include "\a3\3den\ui\dikcodes.inc"

findDisplay 46 displayAddEventHandler ["KeyDown",{
    params ["","_key","_shift"];
    if (_shift && {_key == DIK_H}) then {
        private _soundVolume = soundVolume - 0.25;
        if (_soundVolume == 0) then {_soundVolume = 1};
        1 fadeSound _soundVolume;
        titleText [format["Sound adjusted: %1%2",_soundVolume*100,"%"],"PLAIN DOWN"];
        true
    };
}];
high marsh
#

Connors got it

tough abyss
#

Is there a way to remove the addAction for "holster weapon" from a Ravage scenario? RemoveAllActions removed the looting action apparently

high marsh
#

find the action id

tough abyss
#

So rip into Ravage? Is there any way to get the id in game or through debug?

tough abyss
#

that should do it, thanks

high marsh
#

:+1:

thorn wraith
#

OK, am I losing it, or what?

#

how does this have any nils in it?

thorn saffron
#

Is it possible to change thermal vision contrast via scripting? For some reason my last MP session had thermals be almost useless because the contrast between hot and cold was so jacked up that you could only see hotspots and nothing else at all. It was like that for multiple different vehicles and scopes.
I checked in the editor afterwards and it worked fine there

digital plover
#

Is online protection available for my own mod?

For Example;
I write a code to the config file of the my mod.
Can this code take a list from a url? http://www.domain.com/playeruids.txt
And players not in the playeruids.txt list cannot use mode.

Possible ?

robust hollow
#

yes. personally I'd find using an extension to load the list the nicest way to do it, but you probably couldnt get it whitelisted by battleye.

tough abyss
#

@thorn wraith you are interpreting it wrong, it is the first _lpointer that is undefined and so the diag_log is ignored, it is the one assigned after selectRandom that is printed

thorn wraith
#

nope, there's the full array of inputs above the logs, and the full array of outputs below

tough abyss
#

Yes

#

Define/assign to _lpointer before switch and all will workout

thorn wraith
#

it's defined above as

    _main = ["","","","","","","","","","","",""];
    _main params ["_pointer", "_silencer", "_scope","_bipod","_hgpointer", "_hgsilencer", "_hgscope","_hgbipod""_lpointer", "_lsilencer", "_lscope","_lbipod"];

They all pull from the same array.

tough abyss
#

Make a pastie and give me the link

thorn wraith
#

I rewrote it as set[], it 's possible it didn't like the params command somehow

tough abyss
#

Everything is possible if you don’t show half of the code

#

Make a repro

thorn wraith
#

(the "" in _return I added just to check if I'm even reading the right value)

robust hollow
#

,"_hgbipod""_lpointer",

#

no , between

#

line 4

thorn wraith
#

...well, that's 2 hours of my life I'll never get back.

#

thanks.

robust hollow
#

👍

tough abyss
thorn wraith
#

I actually did. Or, rather, I needed a "nil" value, while still writing down the var in the cfg. I'll replace it with "empty" or "none" or something probably.

robust hollow
#

it would make a lot more sense if that was a switch instead of all those if statements.

(_module # _i) params ["_itemName","_itemArray"];
if ((_itemArray # 0) != "nil") then {
    switch _itemName do {
        case "pointer":{_pointer = selectRandom _itemArray;};
        case "silencer":{_silencer = selectRandom _itemArray;};
        case "scope":{_scope = selectRandom _itemArray;};
        // all the other names
    };
};
thorn wraith
#

it originally was, I switched it to see if it changes anything. It's now case "pointer":{ _main set [0, selectRandom (_itemArray)];};

#

since they're fixed pos anyway

robust hollow
#

could probably simplify it further to an apply

[["pointer",[""]],["silencer",[""]],...] apply {
    if ((_x#1#0) == "nil") then {""} else {selectRandom(_x#1)}
};
quartz oracle
#

@robust hollow

PE_DelayTime = 5;
PE_IconStayTime = 10;
PE_IconFadeTime = 2;

i made them global variables is it better now ?

astral tendon
#

Do you guys know what ACE does to the killed event handle? it does not fire when a vehicle is destroyed normaly by a explosive but fires when is killed by script like cursorobject setdamage 1.

still forum
#

@robust hollow and get the text list off the ctrl (im pretty sure u can?) afaik you can't

robust hollow
#

aww 😦

#

@quartz oracle your doing something wrong, i tested it before pasting the snippet here.

#

perhaps try adding a waituntil the map ctrl exists before adding the event

austere granite
#

dedmen is correct

#

no ctrlText for htmlLoad ones

tough abyss
#

Probably a good thing. htmlLoad for URLs is a hack

quartz oracle
#

how can i do it ? @robust hollow ?

astral tendon
#

Is the killed event handle effected by ownership like vehicles?

still forum
#

ace cookoff does things

astral tendon
#

How?

still forum
astral tendon
#

🙄

astral tendon
#

Well, seems like I figured, does not seems to be ACE problem, the Killed event handle is effected by locality, if a player get in and out of a vehicle the ownership changes and the killed event handle does not fire on the server once the vehicle was destroyed, it was fixed by changing to mpkilled

#

Maybe that deserve a note? though it is needed a vanila test to ensure that.

fleet hazel
#

Guys what should I use? parseSimpleArray or call compile

#

What's faster?

still forum
#

parseSimpleArray is faster

#

and call compile causes a memory leak. So don't ever use that

fleet hazel
#

@still forum Thanks

tough abyss
#

And safer

fleet hazel
#

@still forum @tough abyss But in mod Exile file loading ```
private ["_code", "_function", "_file"];
{
_code = "";
_function = _x select 0;
_file = _x select 1;

_code = compileFinal (preprocessFileLineNumbers _file);

missionNamespace setVariable [_function, _code];

} forEach
[
["TestClient_session_requestReceived", "code\TestClient_session_requestReceived.sqf"]
];```
use compileFinal

still forum
#

yes

fleet hazel
#

Is there a memory leak?

still forum
#

exile does stupid crap. We already know that

#

that string create there will stay in memory forever

#

That compiled function is supposed to stay forever though. so not really

fleet hazel
#

@still forum I can use compileFinal without the threat of memory?

still forum
#

no

tough abyss
#

Wait Exile writes result into a file?

fleet hazel
#

no

tough abyss
#

If that file doesn’t change there is no leak and it might be fast now but when cache is removed it will be a drag

ebon ridge
#

Hey sorry to ask again, I didn't get any response:
How can I ensure units stay in the vehicles I ordered them into with the following code?
Or alternatively what reasons are there that they would suddenly dismount again after a few seconds?

private _newGroup = createGroup (side unit);
_newGroup setSpeedMode "LIMITED";
_newGroup setBehaviour "CARELESS";
_newGroup setCombatMode "GREEN";
[unit] joinSilent _newGroup;
unit disableAI "AUTOCOMBAT";
unit setSkill ["courage", 1];
unit setSkill ["commanding", 1];
unit assignAsDriver _vehicle;

[unit] allowGetIn true;
[unit] orderGetIn true;```
tough abyss
#

Try giving them more courage

ebon ridge
#

More than 1?

tough abyss
#

Oh I see you did

#

The fucking biki is down again, this is trolling

ebon ridge
#

Cos that is up for me

tough abyss
#

Try setFleeing or whatever it is called

ebon ridge
#

Okay I will try thanks, although they don't actually flee, they just dismount and stand next to the vehicle.

#

And in fact they get back in once they are ordered to move.

#

I have setAllowDismount [false, false] on all vehicles as well :/

tough abyss
#

There might be other commands and biki is down for me you must be very lucky

ebon ridge
#

I am

drowsy axle
#

Does anyone know where I can find the trench building sqf for ACE3. I'm looking to make an extension to add a new trench object.

drowsy axle
#

Thank you!

#

What's the best way to handle ace extensions?

#

Because just editing the file won't do, unless I want to make a fork of the whole of ace. I'd just like to add new buildable trenches.

still forum
#

just add new ace interactions in the config that I linked

#

Just CAManBase self interactions

drowsy axle
#

Okay. Would you be able to break this down for me, so that I could reference a vanilla asset. Say the Apex Trenches. model = QPATHTOEF(apl,ace_envelope_big4.p3d);

still forum
drowsy axle
#

What about the p3d wouldn't the object just be the same? Or would the actual reference of the classname change the model used?

still forum
#

Inside the interaction you tell it which classname to spawn

#

and it will then spawn that classname

drowsy axle
#

The interaction being a different file correct?

still forum
#

your own config

#

of your own mod

drowsy axle
#

Are there any prerequisite files that I would need in my config?

still forum
#

What does ACEX sitting have to do with ACE trenches?

#

No you don't need anything special. Just CfgPatches with requiredAddons properly set up, like any other mod

drowsy axle
#

Okay thanks.

#

Where are GVAR's defined?

#

CSTRING(DigEnvelopeSmall) is this meant to have all uppercase? unlike GVAR(digEnvelopeSmall)

still forum
#

it's just a macro

#

ace_trenches_digEnvelopeSmall is the result

drowsy axle
#

ah okay great

#
class GVAR(digTrenchForest) {
                    displayName = "Dig Forest Trench";
                    condition = QUOTE(_player call FUNC(canDigTrench));
                    //wait a frame to handle "Do When releasing action menu key" option
                    statement = QUOTE([ARR_2({_this call FUNC(placeTrench)},[ARR_2(_this select 0,'Land_Trench_01_forest_F')])] call CBA_fnc_execNextFrame);
                    exceptions[] = {};
                    showDisabled = 0;
                    //icon = QPATHTOF(UI\icon_sandbag_ca.paa);
                };```
#
class Land_Trench_01_forest_F: BagFence_base_F {
        author = "Capwell";
        displayName = "Forest Trench";
        descriptionShort = "Forest Trench from APEX";
        model = QPATHTOEF(apl,ace_TrenchForest4.p3d);
        scope = 2;
        GVAR(diggingDuration) = 30;
        GVAR(removalDuration) = 22;
        //GVAR(noGeoClass) = "Land_Trench_01_forest_F_NoGeo";
        GVAR(placementData)[] = {2,3,0.35};
        GVAR(grassCuttingPoints)[] = {{0,-0.5,0}};
        ACE_TRENCHES_ACTIONS;
        class EventHandlers {
            class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {};
        };
    };```
still forum
#

"CSTRING(DigTrenchForest)" That won't work, macro's don't get resolved in double quoted strings

#

You have to manually replace all the macros

#

GVAR(noGeoClass) = "Land_Trench_01_forest_F_NoGeo"; did you create that model?`probably not, leave it out

drowsy axle
#

I'll comment it out.

#

Changed above.

still forum
#

You have to manually replace all the macros
All of them

#

the QUOTE's and GVAR's and FUNC's

drowsy axle
#

oh the GVAR's

#

Okay.

still forum
#

not really? why?

drowsy axle
#

Well cannot find any defines on any of these words..

drowsy axle
#

Okay. so i've read about CSTRING's and there need for placement in a stringtable.xml but I cannot find where they are defined in said file, in ace.

still forum
#

You don't need to use stringtable for that if you don't need translations

#

normal text is also good enough

drowsy axle
#

but that's where the actual string is defined, whether for translation or not.

still forum
drowsy axle
#
class ace_trenches_digTrenchForest {
                    displayName = "Dig Forest Trench";
                    condition = "_player call ace_trenches_canDigTrench";
                    //wait a frame to handle "Do When releasing action menu key" option
                    statement = "[{_this call ace_trenches_placeTrench},[_this select 0,'Land_Trench_01_forest_F']] call CBA_fnc_execNextFrame";
                    exceptions[] = {};
                    showDisabled = 0;
                    //icon = QPATHTOF(UI\icon_sandbag_ca.paa);
                };```
#
 class Land_Trench_01_forest_F: BagFence_base_F {
        author = "Capwell";
        displayName = "Trench - Forest";
        descriptionShort = "Trench - Forest";
        //model = QPATHTOEF(apl,ace_TrenchForest4.p3d);
        scope = 2;
        ace_trenches_removalDuration = 22;
        //ace_trenches_noGeoClass = "Land_Trench_01_forest_F_NoGeo";
        ace_trenches_placementData[] = {2,3,0.35};
        ace_trenches_grassCuttingPoints[] = {{0,-0.5,0}};
        ACE_TRENCHES_ACTIONS;
        class EventHandlers {
            class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {};
        };
    };```
#

Yeah. I missed the GVAR

still forum
#

and the quotes

#

and the ARR_2

#

ARR_2 you can just remove if you resolve the quote.

drowsy axle
#

Okay

#

Changed

still forum
#

ACE_TRENCHES_ACTIONS

#

guess you can just copy that from the trenches CfgVehicles

iron sand
#

Anyone know what the player base address is?

still forum
#

what?

#

Explain?

iron sand
#

There’s the player base address like the area around the player

#

Then the head address that stuff

still forum
#

I have no idea what you are talking about

tough abyss
#

No one has

iron sand
#

So around the player or AI there is a address that’s the location of the player you use it for aim bot

#

I am just trying to finished my menu so I can add cool shit to Zeus

still forum
#

location of the player? you mean like

iron sand
#

Yes

#

Yes thx

tough abyss
#

you use it for aim bot 🤔

iron sand
#

Naaa I need it for other stuff to

#

I am making a menu that will help me zeus so I can add custom skins to the vehicles

tough abyss
#

I dont care

iron sand
#

Or make a nuke for a mission

#

You asked lol

tough abyss
#

I didnt

iron sand
#

Ok bye

tough abyss
#

I hope forever

iron sand
#

That’s nice

tough abyss
#

I'm not nice to hackers and cheaters

iron sand
#

Um I am using for the right reasons though

upper cliff
#

hey can someone help me out? When I load my mission into the eden editor it gives me an error with a path to my description.ext and then line 1: '.': '{' encountered instead of '='
Here's whats on the description

{
    sounds[] = {};
    class kam1
    {
        name    = "kam1";
        sound[]    = {"\dubbing\kam1.ogg", db - 100, 1.0 };
        title    = "Kamino to Broadway, shots fired!";
    };
    class kam2
    {
        name    = "kam2";
        sound[]    = {"\dubbing\kam2.ogg", db - 100, 1.0 };
        title    = "Requesting support, Broadway do you copy? Over.";
    };
    class br1
    {
        name    = "br1";
        sound[] = {"\dubbing\br1};.ogg", db - 100, 1.0 };
        title    = "Kamino, Broadway, we read you, wait one.";
    };
};```
ruby breach
#

sound[] = {"\dubbing\br1};.ogg"

upper cliff
#

fixed it and it still shows up

still forum
#

looks like something is binarized that shouldn't be

tough abyss
#

fixed it and it still shows up save/reload mission from editor

velvet merlin
#

are mouseEnter/mouseExit only one time with scripted controls, or broken in general, or only broken for some control types?

#

Adanteh had the same problem 1.5 years back

#

supposedly 1-2 guys got it to work in here

#

forum/google search doesnt turn more on this

upper cliff
#

restarted the whole game and it still showed up

lofty spear
#

how to check, when unit wait for revive?

'INCAPACITATED' == lifeState _unit

is it correct?

void ivy
#

is there an equivalent to "(driver _vehicle) isEqualTo player" to find whether someone is the copilot in an aircraft?

void ivy
#

Hmm, I was having dns issues with getting onto bohemia so I couldn't see that search result but now it works.

#

Thanks @robust hollow

shadow sapphire
#

Yeah, forums and wiki being down slowed my work this morning tremendously!

#

Could someone show me how or link me where to figure out how to add stuff to the custom command menu (0,9 in game)?

tough abyss
#

Would this work to remove this action?

{
if (player actionParams _x (select 0) == "Holster Weapon") then {
removeAction _x};
} forEach actionIDs player;
robust hollow
#

no

#

(select 0) wrapping this in parentheses means select has no array to select from
removeAction _x thats not how removeAction works

tough abyss
#
{
if (player actionParams (_x select 0) == "Holster Weapon") then {
player removeAction _x};
} forEach actionIDs player;
robust hollow
#

no

#

_x is a number, not an array.

tough abyss
#
if (player actionParams _x select 0 == "Holster Weapon") then {
#

Seems to have worked

robust hollow
#

action params can return nil

#
{
    private _params = player actionParams _x;
    if (!isNil "_params" && {(_params#0) == "Holster Weapon"}) then {
        player removeAction _x;
    };
} forEach actionIDs player;

something more like this would be ideal i think

tough abyss
#

It's for this one very specific action

#

And it doesn't look like it bugs out if the action isn't in there already

robust hollow
#

sure, but its not uncommon for actionParams to return nil, so if you're sorting through to find your action and you encounter a nil action first, itl error without proper checks for it.

tough abyss
#

Ahh gotcha

edgy dune
#

so i have a variable defined as such

_mySound = createSoundSource ["rocket_idle", position _unit, [], 0];
``` which basicly all it does is create a sound. This part works. What im having issues with is checking if `_mySound` is undefined or not. Ive used `isNull` and `isNil` but neither work and instead I get an error saying `_mySound` is undefined, this is wat I am doing
```sqf
if(isNull _mySound) exitWith {};

and I tried

if(isNil _mySound) exitWith {};
robust hollow
#

isNull is the way to go. if the source isnt created for some reason the command returns objNull.

you will need to paste a full snippet of that code (including everything between the creation and isnull check) because that on its own should work fine.

edgy dune
#

okay ill try that real quick checking agaisnt objNull

robust hollow
#

what? why?

#

my point was isNull should cover createSoundSource being unsuccessful. to check if an object is objNull you use isNull like you have already.

edgy dune
#

oh okay I thought u ment the command returns objNull

#
_idleEffect = createSoundSource ["rocket_idle", position _unit, [], 0];
_idleEffect attachto [_unit,[0,0,0]];

[_unit] spawn namenai_fnc_jump;

waitUntil 
{
    sleep .005;((isTouchingGround _unit))
};


if(isNull _mySound) exitWith {};


detach  _idleEffect;
deleteVehicle _idleEffect;
playSound3D [_soundLand, _unit, false, getPosASL _unit, 6, 1, 0];

``` thats what I got inbetween creating the sound and detecting if it exists, afik I dont see anything that would effect it
robust hollow
#

it does, so it shouldnt be nil unless you set it to nil afterwards. the point being isNil will always be false

#

_idleEffect = createSoundSource ["rocket_idle", position _unit, [], 0];
(isNull _mySound)

#

_idleEffect -> _mySound

edgy dune
#

ahhhh ooofff, lemme try that

#

ah okay it works now 👍, thank you @robust hollow

tough abyss
#

isTouchingGround dont use, better check the height from position

tall dock
#

What are the odds that BI will fix a bug in an eventhandler if I report it with a reproducable testmission? Less than 12 months? 😏

edgy dune
#

@tough abyss the reason why I use istouchingground is cause Im making a jump script, like predator/crisis style, and I want to be able to land on buildings or even floating stuff. Is there something better?

#

and so if I place a VR block say 100 meters up, itTouchingGround still detects when I land on the VR block

surreal vapor
#

Does anyone know of a way to get the Field of View of the current camera, in degrees or radians?

#

I see that you can set it with camSetFov but I don't see a camGetFov or equivalent

cursive whale
errant jasper
#

Quick sanity question: You can not publicVariable _localVariables right? I mean what scope would it even be put into.... ?

winter rose
#

@errant jasper cannot indeed

errant jasper
sturdy cape
#

Well you could just say globalvar = _localvar; in the script then public it.no?

errant jasper
#

Sure.. Was just wondering about what I saw above.

digital jacinth
#

could just do this

missionNamespace setVariable [_varName, _func, true];
crystal schooner
#

How would you be able to return backpack weapons as displayname formats?

radiant egret
#

You mean weapons in the backpack ?

crystal schooner
#

Yes

minor lance
#

Hello!

#

Anyone knows how to set the second fade color in a selected item of a listbox?

#

"lbSetSelectColor" sets the first color

crystal schooner
#

@radiant egret you got any idea?

radiant egret
#
_backpackContent =  backpackItems player;
_allWeapons = weapons player;
_backpackWeapons = [];
{
  if(_x in _allWeapons)then {
    _backpackWeapons pushBack _x;
  };
}forEach _backpackContent;
systemChat  str _backpackWeapons;
tough abyss
#

How do you run anything as displayname format?

radiant egret
#

sry i forgot

crystal schooner
#

Yes

#
_Primary = "No Primary Weapon";
_Secondary = "No Secondary Weapon";

if (!(primaryWeapon cursorTarget == "")) then {
_Primary = ((configFile >> "CfgWeapons" >> primaryWeapon cursorTarget >> "displayName") call BIS_fnc_GetCfgData);
};

if (!(handgunWeapon cursorTarget == "")) then {
_Secondary = ((configFile >> "CfgWeapons" >> handgunWeapon cursorTarget >> "displayName") call BIS_fnc_GetCfgData);
};

_Action = format [
"
Suspect Name: %1<br/>
Primary Weapon: %2<br/>
Secondary Weapon: %3
",
name cursorTarget,
_Primary,
_Secondary,
"Header",true,true
] spawn BIS_fnc_guiMessage;
austere granite
#

he just wantsgetText (configFileetc etc

crystal schooner
#

This how i got it atm

#

I just need to get one for backpack displaying their weapons if they have any

austere granite
#

((configFile >> "CfgWeapons" >> handgunWeapon cursorTarget >> "displayName") call BIS_fnc_GetCfgData)
plus what skullfox said

#

you should be able to figure it out with that

radiant egret
#
_backpackContent =  backpackItems player; 
_allWeapons = weapons player; 
_backpackWeapons = []; 
{ 
  if(_x in _allWeapons)then { 
    _backpackWeapons pushBack [_x,getText(configfile >> "CfgWeapons" >> _x >> "displayName")]; 
  }; 
}forEach _backpackContent; 
systemChat  str _backpackWeapons;
#

return an array [classname,"displayname"]

crystal schooner
#

Ye, i see. But is it possible to get it in the format like the script i sent above so it will shows all weapons in backpack as displayname?

#

Right now it returns as Bakpack Content:["arifle_MX_GL_F"]

radiant egret
#

Use ```sqf
getText(configfile >> "CfgWeapons" >> weaponClassname >> "displayName");

to return the displayname
crystal schooner
#
_Primary = "No Primary Weapon";
_Secondary = "No Secondary Weapon";
_backpackContent =  backpackItems cursorTarget; 
_allWeapons = weapons cursorTarget; 
_backpackWeapons = []; 

if (!(primaryWeapon cursorTarget == "")) then {
_Primary = ((configFile >> "CfgWeapons" >> primaryWeapon cursorTarget >> "displayName") call BIS_fnc_GetCfgData);
};

if (!(handgunWeapon cursorTarget == "")) then {
_Secondary = ((configFile >> "CfgWeapons" >> handgunWeapon cursorTarget >> "displayName") call BIS_fnc_GetCfgData);
};

{ 
  if(_x in _allWeapons)then { 
    _backpackWeapons pushBack [_x,getText(configfile >> "CfgWeapons" >> _x >> "displayName")]; 
  }; 
}forEach _backpackContent; 

_Action = format [
"
Suspect Name: %1<br/>
Primary Weapon: %2<br/>
Secondary Weapon: %3<br/>
Backpack Content: %4
",
name cursorTarget,
_Primary,
_Secondary,
_backpackContent,
"Header",true,true
] spawn BIS_fnc_guiMessage;
#

I've done that but it displays as classname on the guiMessage

tough abyss
#

Show where are you using _backpackweapons in guiMessage?

crystal schooner
#
_Primary,
_Secondary,
_backpackContent,
tough abyss
#

What’s that

crystal schooner
#

The gui message

tough abyss
#

And how _backpackweapons is related to that?

crystal schooner
#

Its not

#

But now that i am using it

#

it return ["arifle_mx_f","MX 6.5 mm"]

tough abyss
#

Obviously each element is array of 2

crystal schooner
#

Ye is it possible to get it to a string with just Mx 6.5 mm

tough abyss
#

You don’t know how to select element you want from array?

crystal schooner
#

Ehhh

#

not really

tough abyss
#

And why are you pushing array into _backpackweapons instead of just the name? Are you copy pasting chunks of code in hope something might work?

crystal schooner
#

It got sent by Skullfox

#

Got it working now

crystal schooner
#

I have an issue with BIS_fnc_guiMessage when i use it with format, i dont get a cancel button and a header. I just get the text and ok. ```
_Action = format [
"
Suspect Name: %1<br/>
Primary Weapon: %2<br/>
Secondary Weapon: %3<br/>
Launcher: %4<br/>
Backpack Content: %5
",
name cursorTarget,
_Primary,
_Secondary,
_Launcher,
_backpackweapons,
"Seize Objects","Seize Objects","Cancel"
] spawn BIS_fnc_guiMessage;

radiant egret
#
_Action = [
  format[
    "
    Suspect Name: %1<br/>
    Primary Weapon: %2<br/>
    Secondary Weapon: %3<br/>
    Launcher: %4<br/>
    Backpack Content: %5
    ",
    name cursorTarget,
    _Primary,
    _Secondary,
    _Launcher,
    _backpackweapons
  ],
  format[
    "Header"
  ],
  true,
  true
] spawn BIS_fnc_guiMessage;

@crystal schooner

crystal schooner
#

@radiant egret TY!!

red linden
#

Ok now its not like 3am

#

Can anyone maybe provide some insight into a cfgSound issue?

solemn steppe
#

How am I supposed to choose which class I'm overwritting since I can't choose it ? There is no argument for it.

radiant egret
#

@red linden Post your problem, cant guess it from here, im no magician, if config related -> #arma3_config

red linden
#

So I dont have any scripting to show because I have had this issue with 4 seperate versions of the script calling it, honestly I think this might be more of a general issue than script related

#

Essentially I have this old mission I'm bringing up to date and my sounds are working in editor both in SP and MP, but on our server I either don't hear them from the source model or they can be heard if your like 3 feet from the source and no further

#

Moving a step away just cuts it out entirely

#

I've used everything that can call my sounds and they all have this issue

#

This mission worked a while back, then after my break from Arma something must have changed idk

#

The sounds are accurately described in the description.ext file, its just when I move the mission onto our server the issue arises

radiant egret
#

which command you use to play the sound and post the cfgsounds parts

vagrant mango
#

Hey yall. So Im going about making a mission intro that plays some music in the background as the players fly into an insertion (takes about 2 minutes or so). I use fadeMusic to fade their music volume to an acceptable level so the music is hearable but doesn't kill their ears. Looking around I was hoping to find a function to fade the effect volume but I cannot seem to find something of the sort? Is there one and its just oddly named?

radiant egret
#

?

vagrant mango
#

That's the one I was using. I was looking for something to fade the effects sound. But I think fadeSouns may actually be it.

#

fadeSOund

#

Shit. fadeSound

#

I was thinking it would be something like 'fadeEffectSound' or something of the sort.

#

So my search-fu failed me.

frigid raven
#

Still having a hard time with this script.
What I want to achieve is that EVERY player who is WEST should trigger the onActivation when he enters the area.
If any player leaves the area onDeactivation should be triggered.
This should happen for every player interacting with the trigger.
At the moment the trigger gets only activated but never deactivated. I assume this is happening because when a player leaves the area and there are still other players inside the area it will not trigger deactivation. Can anybody tell me how to achieve an activation/deactivation for every single player?

    _desertionTrigger setTriggerActivation ["WEST", "WEST D", true];
    _desertionTrigger setTriggerStatements ["this",
                                            _onActivation call coopr_fnc_codeAsString,
                                            _onDeactivation call coopr_fnc_codeAsString];
#

meh just realized WEST D means if something is detected by west

#

fucks sakes

winter rose
#

@frigid raven try a local trigger with "player" that rings the server on deactivation? Unless there are AI

#

else, go script

frigid raven
#

aye

tough abyss
#

How do I get rid of these extra quotes? This is from my RPT

13:53:56 "[""ItemWatch"",""ItemMap""] - ItemWatch,ItemMap"

and this is the code

params ["_distractionObject", "_objectPos", "_typedropped"];
_distractionList = _distractionObject splitString ",";
diag_log format ["%1 - %2",_distractionList, _distractionObject ];
if !(_typedropped in _distractionList) exitWith {};
naive fractal
#

I have a "deleteIfEmpty" set to 0 on my magazine, and I have an empty magazine in my backpack. If I run "magazinesAmmoFull", it's not listed unless it's in the current weapon. Is there a workaround, as I would like to get the ammo details etc. of all the players magazines, including empty ones?*

tough abyss
#

You can have empty magazines? I thought they disappeared when empty?

naive fractal
#

There's a config option for CfgMagazine to disable that behaviour (although, it still gets deleted on reload swapping the mag, so I have an EH adding empties for that occasion).

tough abyss
#

Didn't know that

tough abyss
#

@tough abyss add text before format

diag_log text format ["%1 - %2",_distractionList, _distractionObject ];
#

I mean in the actual code, I don't care about the log.

#

you cant

#

it is a string of a string

#

Oh, I need _distractionList and_distractionObject to look similar. I'm trying to get the items from "distractionObject" (which is a text input parameter, so> ItemMap, ItemWatch <and separate them into an array of objects

astral dawn
#

I wonder, maybe there is an easy way to know how many bytes my remoteExec causes to be sent to the server?

naive fractal
#

For anyone that cares, you can get the information of a players empty magazines via (magazinesAmmoCargo uniformContainer player) + (magazinesAmmoCargo vestContainer player) + (magazinesAmmoCargo backpackContainer player), plus some extra stuff for their current weapons.

tough abyss
#

@naive fractal Is there a way to set deleteIfEmpty globally?

naive fractal
#

You could probably override CA_Magazine and add it to that, but that might have some unintended side effects. Other than that, not really, no.

tough abyss
naive fractal
#

Doesn't return empty magazines except for the one that's loaded (if there's one).

tough abyss
naive fractal
#

I think that person is simply adding an empty magazine on reload to the inventory, given that the known issue is that they'll cease to exist upon the object being placed elsewhere. I don't have that issue with the config entry in conjunction with the reload EH script.

tough abyss
#

you are right

naive fractal
#

Best guess, could be wrong - the behaviour might have been fixed since they posted that.

tough abyss
#

Are you trying to do the same thing Bosenator? Just keep empty mags in the inventory?

#

Because my unit would be all over that

naive fractal
#

I'm extending the ACE repack for my group to add loose ammo/switching ammo between magazines. Most notably for us as a British group we have only 5.56 in 90s, and .303 (for the most part) in WW2, so it'd be nice to switch around ammo in a pinch.

tough abyss
#

Interesting

still forum
#

@errant jasper variables in mission namespace can be made up of any character, they might aswell start with _.
So technically you could have a _airfieldArray in missionNamespace that you can retrieve with getVariable.
It's still retarded code though, don't make the same mistake.

compact maple
#

Hello guys, I am working with ace3.
I would like to disable the option to take a wheel from a vehicle.
Do you know how can I do that ?

ebon ridge
#

Why would a variable defined like so:
x = (allMapMarkers select { _x find "airport" == 0 }) sort true; give undefined variable error a few lines later when run on server but not in single player? If I define x =['blah', 'blah'] instead it doesn't have the error on the server.

#

Never mind! sort doesn't work like that, it doesn' return anything it sorts in place.

robust hollow
#

sort doesnt return a value

#

it modifies an existing array

x = [1,2,0];
x sort true;
x; // [0,1,2];
#

😦 didnt scroll down to see ur last message

ashen warren
#

hi there, So i am taking over a dead script that still works 100% called mood jukebox. I was able to make the mod standalone for offline but could not get it to actually start on a multiplayer session (even if i am hosting in lan) Is there anyway to get this to work. I can post the handler scripts that are used. To be clear, I believe this mod was originally used as a map script to start then use the mod part as a custom music holder for the user if this make sense. I basically put in a init.sqf script in the mod folder to make it work.

#

in the config.cpp

#
{
 a3_Post_Init = "a3_Post_Init_Var = [] execVM ""a3\init.sqf""";
};```
#

in the init.sqf

#

nul = ["A3"] execVM "a3\scripts\MoodJukebox\main.sqf";

#

idk if this is coded for offline only to have this start. would i need it to have something like "if server" or something in the init.sqf file?

#

any input would help

#

thanks

ashen warren
#

i can read code and sort of understand it but I have no idea what I may be looking for?

robust hollow
#

Extended_PostInit_EventHandlers subsection i assume. ur class doesnt match the setup it shows

ashen warren
#

i guess im confused to what you said

robust hollow
#

look at the Extended_PostInit_EventHandlers example and see how it is different to yours

ashen warren
#
    class My_post_init_event {
        init = "call compile preprocessFileLineNumbers 'XEH_postInit.sqf'";
    };
};```
#

this one right

#
    class My_post_init_event {
        init = "call compile preprocessFileLineNumbers 'a3\init.sqf'";
    };
};```
#

so that would be corrected maybe?

robust hollow
#

you will want to change the class name My_post_init_event, but assuming the init doesnt need to be scheduled, that should work fine.

ashen warren
#
    class Start_Jukebox {
        init = "call compile preprocessFileLineNumbers 'a3\init.sqf'";
    };
};```
robust hollow
#

give it a go

ashen warren
#

ok ill replace this and try

#

nope still offilne only

#

would some server like init need to be made?

robust hollow
#

idk. entirely depends on how ur mod works.

ashen warren
#

this was orignially a map script where the init.sqf was in the map file but i placed it in the mod folder directory. would that cause a conflict?

robust hollow
#

maybe.

ashen warren
#

i can send the mod via google drive link if you want to take a look. If you really feel like it. I do not want to over step any bounaries

robust hollow
#

not really overstepping boundaries to have someone else look through ur mod. that being said, no i dont want to.

ashen warren
#

the execte handlers are just nul = _this execVM "filepath" in the main.sqf that is mentioned in the init.sqf line

radiant egret
#

?

ashen warren
#

@radiant egret what part was confusing?

radiant egret
#

Nvm

ashen warren
#

I guess I kinda am forgetting about something here maybe

ashen warren
#

maybe I add in this line

#

if hasInterface && not isServer

#

just using this as example from a different script

#
call compile preprocessFileLineNumbers "Engima\Civilians\Common\Debug.sqf";
if (isServer) then {
    call compile preprocessFileLineNumbers "Engima\Civilians\Server\ServerFunctions.sqf";
    call compile preprocessFileLineNumbers "Engima\Civilians\ConfigAndStart.sqf";
};```
robust hollow
#

do you even know what the problem is? adding some checks hoping locality is the issue doesnt sound like much of a plan when you dont know the problem. i suggest you add logs in ur files to see what executes and what doesnt. then u can start to narrow down the problem from there.

ashen warren
#

im looking at this script as a map script since the INIT was "supposed" to be placed in the map folder.

#

I cannot execute the jukebox script directly from the config

#

I have already established that it will only bring up errors or not start if I tried to run it from there.

#

just how I am understanding this mod.

#

I will state this that I am a person with maybe a lack of understanding of how arma distinguishes its scripts and server scripts. in my mind right now I see that when looking at other scripts, they are using maybe 2 different identifiers like the example up above. I am wondering if i have to do the same thing in a way that will allow a script to fire if it looks like it is supposed to run if it is on a server or not when using the if (isserver) like identifier.

#

if this makes sense

#

and it is sort of my conclusion for the past year

#

or idea

#

didn't mean to sound like im hostile.

#

nope it doesn't work. ill just leave this on the backburner

#

thanks for your time

upper cliff
#

alright I'm trying to make something for a mission where the player activates a trigger, the screen fades to black, and when it fades back in, they're in a different place, how would I go about doing that?

robust hollow
#
// trigger activates
"tag_fadeToBlack" cutText ["","BLACK OUT",1];
uisleep 1;
player setpos _newPos;
uisleep 1;
"tag_fadeToBlack" cutFadeOut 1;
radiant egret
upper cliff
#

for _newPos should I put the x y z coordinates or the grid number?

robust hollow
#

xyz

upper cliff
#

it says type "number, expected Nothing"

robust hollow
#

paste the error

upper cliff
#
uisleep 1; 
player setpos getPos [10313, 9126, 0]; 
uisleep 1; 
"tag_fadeToBlack" cutFadeOut 1;```
robust hollow
#

thats not the error... anyway try putting nil on the line after cutfadeout

young current
#

ymm

#

why setpos getpos??

#

makes no sense

#

you feed the coordinates to the setpos

upper cliff
#

because I know nothing about scripting

young current
#

you must read the wiki pages for the commands

robust hollow
young current
#

it makes it a lot easier

cyan gull
#

Hey guys, Im getting an error, it says ==:type bool, expected number, string, not a number....

private ["_patrolGroup"];
private ["_guard"];
private ["_baseGroup"];

_patrolGroup = leader patrol;
_baseGroup = leader base;
_guard = leader guard;

_contactInfo = _patrolGroup targetKnowledge _guard;
                    //under here 
if (_contactInfo select 1 == true) then
{
    _baseGroup reveal _guard;
}```
robust hollow
#

cant compare bools using ==

cyan gull
#

===??

robust hollow
#

and in your case you dont need to compare bool, just do _contactInfo select 1. if it is true, then it is returning true anyway

cyan gull
#

im totally new to sqf and arma scripting, closest thing is im learning javascript

#

ohh ok

#

omg wow yeah that was it thank you so much haha

upper cliff
#

oh sorry I misunderstood, the error message is "On Activation: Type Number, expected nothing"

robust hollow
#

yea, so fix that misuse of getpos, and add a line at the bottom that says nil. string cutFadeOut number returns a number so i would like to think thats what the issue is.

upper cliff
#

so "tag_fadeToBlack" cutText ["","BLACK OUT",1]; uisleep 1; player setpos (player modelToWorld [10313, 9126, 0]); uisleep 1; "tag_fadeToBlack" cutFadeOut 1; nil;?

robust hollow
#

(player modelToWorld [10313, 9126, 0]) surely you dont mean that.
player setpos [10313, 9126, 0]; is most likely what you're after.

#

and yes, that nil is correct

upper cliff
#

still the same error

robust hollow
#

aww. ok give me a sec

#

i assume people usually get around this by calling a function or file instead of putting the actual script in their activation field. so you could do that or just wrap the code in a call like this:

call {
    [] spawn {
        "tag_fadeToBlack" cutText ["","BLACK OUT",1];  
        uisleep 1;  
        player setpos [10313, 9126, 0];  
        uisleep 1;  
        "tag_fadeToBlack" cutFadeOut 1;
    };
};
upper cliff
#

cheers

tall dock
#

When I use a structured text, is there a way to define the color as parameter, so the color is depending on that variable? Or do I need to switch between different texts with fixed colors?

robust hollow
#
private _color = "#FF0000";
format["<t color='%1'>text</t>",_color];
tall dock
#

That easy? Nice, thank you very much!

velvet merlin
#

what situations you usually dont want this to trigger? (including ACE)
waitUntil {(inputAction "DefaultAction" > 0) }
(like while in map, commanding mode, etc)

compact maple
#

Hey,
private _query = "";
do the same thing than
private ["_query"];
?

robust hollow
#

first one initialises the variable in that scope and sets a value to it, second one only initialises it. first one is usually (always?) faster and so recommended.

still forum
#

first one is 100% faster than the second

#

Have just seen this:

private ["_contactInfo"];
private ["_patrolGroup"];
private ["_guard"];
private ["_baseGroup"];

That's just stupid, if you are already using the array variant you might aswell use an array with more than 1 element

And if you set all the values right after that, might aswell use the keyword.

compact maple
#

Thank you for answering.
Dedmen told me one day than I should use the first case, but it didnt work, I first did this :

private _query = "";
switch (_side) do {
    case west: {_query = format ["blablabla'", blablabla params];};
};
_queryResult = [_query,1] call DB_fnc_asyncCall;

But, this, is working :

private ["_query"];
switch (_side) do {
    case west: {_query = format ["blablabla'", blablabla params];};
};
_queryResult = [_query,1] call DB_fnc_asyncCall;
robust hollow
#

why not let query be defined by the return of the switch then?

still forum
#

should work exactly the same, you must be doing something else wrong then

compact maple
#

Nope I didnt change anything but this, with many tries

still forum
#

and yeah private _query = switch (_side) ... might be easier

compact maple
#

Thanks, didnt think I could do this that way

still forum
#

same as forEach and if/then it returns the last value

compact maple
#

yup

ornate prairie
#

does anyone know a way to make ai use their bipod?

velvet merlin
#

is there a way to get an AI gunner to apply doSuppressiveFire when you are inside the vehicle, or does being effectiveCommander stop anything?

ebon ridge
#

Hey, anyone know how can I auto format sqf in Visual Studio Code? The SQF extension doesn't appear to support it, I can't find any extension that does. I'm wondering if there is a non SQF extension that could do it maybe?

edgy dune
#

like spacing? try Shift + Alt + F

ebon ridge
#

Yeah but that only works if there is a formatter for the language right?

#

However I did just convert spoody online one to a VS code extension while waiting for an answer here 😃 I will ask them if I can share it.

edgy dune
#

nah that should work regardless, that Shift + Alt + F fixes like the spacing and braces around if thats wat u want, try it

#

@ebon ridge

quartz coyote
#

Hello all

#

can you exit a forEach with an exitWith ?

tough abyss
#

Sure

quartz coyote
#

cool thanks

copper raven
ebon ridge
#

@edgy dune Nah I get "There is no document formater for 'sqf'-files installed." There is no reason it should just work, VSCode has no idea of the syntax of the document unless you tell it, loads of languages don't use curly braces, or use them to mean something else.

#

But if you say it definitely works for you then I am interested how!

spark turret
#

got a problem, i have a static UAV terminal script that give the player the possibility to control drones. problem is, when you close the terminal after flying the drone, the noise of the drone stays with you. Any sugesstions?

edgy dune
#

Oh u get that when u try to shift+alt+f? Huh it works for me and vs code sees it as sqf, maybe i have something installed. I dont remember what tho

ebon ridge
#

I installed every SQF extension (Arma Dev, SQF Language 1.0.6 and 0.8.1, SQFLint) now and still no auto format! Would love to know what extension you have!

velvet merlin
ebon ridge
#

I got permission to share the vscode extension I wrote, but it is a bit redundant if one of the common ones already does it :/ I will ask in tool makers as well, thanks.

quartz coyote
#

Hello !
Is there an existing array that would define "allPlayersButMyself" ?

still forum
#

existing array?

#

you mean a command that returns that? no

quartz coyote
#

variable

#

okay so how would I acheive such ?
I'd want a forEach to apply to allPlayers (exept me)

still forum
#

forEach (allPlayers - [player])

quartz coyote
#

oh.

#

as simple as that

#

hadn't event thought about it

#

I'll try

#

thanks

#

that didn't solve my issue so it probably isn't the problem ^^

#

@still forum
if (allPlayers - [player]) returns []
Why does this work :
if ((allPlayers - [player]) != []) then {...};

still forum
#

doesn't make sense, and that doesn't work.

#

!= doesn't take array

high marsh
#
_allPlayersButYourselfBlah = count(allPlayers - [player]);
if(count _allPlayersButYourselfBlah == 0) then
{
    
};
digital hollow
#

You can't use = to compare arrays. Use isEqualTo

quartz coyote
#

Aaaaah.... true i'd forgotten !

#

can't remember what you said Dedmen about you can't == 0 you need to replace 0 by nil or something right ?

#

because 0 is considered as "false"

high marsh
#

isNil

quartz coyote
#

ah

#

got it half right

still forum
#

No, I think you tried to tell me that in the past and I told you it was wrong ^^

quartz coyote
#

?

#

@high marsh

_allPlayersButYourselfBlah = count(allPlayers - [player]);
if(count _allPlayersButYourselfBlah == 0) then
{
    
};```
Isn't working. It tells be _allPlayersButYourselfBlah is a number and it expects array or config
still forum
#

yeah

#

count returns a number. Trying to execute count on a number again doesn't work

high marsh
#

OH

#

Typo

still forum
#

also isEqualTo is faster 😉

#

Like Ampersand already said and linked to

high marsh
#
if(_allPlayersButYourselfBlah isEqualTo []) then
{

};
quartz coyote
#

thanks @digital hollow
if ((allPlayers - [player]) isEqualTo 0) then
is working

still forum
#

what

#

no it's not

#

wtf

high marsh
#

isEqualTo 0
should be
isEqualTo []

tough abyss
#

You are not excluding headless clients

tough abyss
#
if ({} isequalto {}) then {...
#

🤦

ashen frigate
#

How might one disable scroll menu actions available inside a vehicle? The don't show up in the actionIDs on the player or the vehicle. They seem to be from a mod's config.bin. Any ideas?

#

I'm a programmer but unfortunately pretty clueless with Arma scripting still

tough abyss
#

No easy way

ashen frigate
#

ah ok, thanks. Is there a way I can overload the function the action executes? They are all one-liners which call the same function with different arguments

robust hollow
#

you can have a function do different things depending on the arguments it receives, no proper overloading though.

ashen frigate
#

So no way to intercept a call like this? Alright, thanks for the help!

robust hollow
#

pretty sure the actions are defined in a config, so you might be able to hide/remove them with a mod, but thats getting into #arma3_config territory

tough abyss
#

You can intercept with a special event handler but any mod can add own and overwrite yours and the information it returns is not comprehensive. But if you want to waste some time no one can stop you, check inGameSetUIEventHandler

ashen frigate
#

Yeah, sounds like it's going to be more work than it's worth, but I'll take a look

ashen warren
#

@robust hollow I was able to figure out the issue with my script not firing on a multiplayer session

#

the main init line for initializing had to be in brackets with if (hasInterface) then and then all the other execVM lines had to be coded if (isMultiplayer) then {}; else {}

winter rose
#

then {} else {};*

ashen warren
#

I guess next step is to have the script restart after a player dies.

#

currently I have the multiplayer being executed with this execVM

#
    {nul = [_x] execVM "a3\scripts\MoodJukebox\stress.sqf"} forEach (playableUnits + vehicles);
}```
#

would this reenable this script with a scriptdone statement?

#
    {nul = [_x] execVM "a3\scripts\MoodJukebox\stress.sqf"} forEach (playableUnits + vehicles);
    waitUntil { scriptDone script_handler };
}```
winter rose
#
private _myScript = compile preprocessFileLineNumbers 
"a3\scripts\MoodJukebox\stress.sqf";
while { true } do
{
    { [_x] spawn _myScript; } forEach (playableUnits + vehicles);
    waitUntil { scriptDone script_handler }; // what is script_handler?
};
robust hollow
#

compile "a3\scripts\MoodJukebox\stress.sqf" -> compile preprocessFile "a3\scripts\MoodJukebox\stress.sqf"

winter rose
#

woops

ashen warren
#

i guess I am confused. Would script_handler be _myScript in that example?

tough abyss
#

anyone good at making a pbo for a standalone mod?

edgy dune
#

technically its as simple as right clicking and selecting make pbo with pbo manager if u have that installed

#

but if u wanna make a mod

#

u make a folder called like myMod and then a folder inside called addons and then inside that the folder u wanna make a pbo so for example something like scriptLibrary

#

so
myMod>addons>scriptLibrary

#

i would link something that says how to make a mod but ehhh, idk any links 😦

tough abyss
#

well what I'm trying to do is just make a pbo i can host on workshop which has textures and sound for a mission

#

myMod<addons<scriptLibrary.pbo?

cloud thunder
#

Any ideah why
(get3DENSelected "marker") select 0

#

returns a selected/highlighted marker name in editor but,

#

getMarkerPos ((get3DENSelected "marker") select 0)

#

returns [0,0,0] as if the marker does not exist?

cosmic lichen
#

Maybe because the marker is not yet created and cannot be detected by getMarkerPos

#

((get3DENSelected "marker") select 0) get3DENAttribute "Position"; should work

cloud thunder
#

ooooooh, yes. Nice one @cosmic lichen , Thank you!

cosmic lichen
#

You're welcome

astral dawn
#

Is there a way to stop all simulations and totally everything in multiplayer?
I need to implement a custom save system of the whole game world (GTA-like, so save only important things) (into profileNamespace for instance) but for that I'd prefer the game world to not change state of the variables I want to save 🤔 🤔
Maybe I should save all data unscheduled? How is that going to look in MP when server freezes for many seconds?

robust hollow
#

could save sections of data at a time instead of everything in one go? spread out the impact a bit.

still forum
#

How is that going to look in MP when server freezes for many seconds? just multiple seconds desync for every player

astral dawn
#

Guess it's not so bad then? I think it's the way to go 🤔 I would rather have the server send events like 'done 10% saving', 'done 50% saving', I wonder if remoteExec sends data immediately or after the unscheduled scripts are done firing?

tough abyss
#

What data are you saving?

astral dawn
#

So let's say there are N outposts all over the map, every outpost has an array of soldiers it has, not all outposts are spawned ofc because there are no players/enemies nearby.
I'd prefer units to not die at least so that the array with units doesn't get screwed by multiple scripts accessing it 🤔
If I were making a video game I guess I'd just stop it for the time of saving and show a banner for player 'wait till I save your game bro' but here I can't do that in MP

#

I'm pretty sure Alive had to solve similar problems... maybe I can check how they did it

#

Anyway, does anybody know if remoteExec(Call) sends stuff right now or queues it for sending and does it some time later? I remember I have read it somewhere but can't remember where 😦

radiant egret
#

I was bored and checked out the function viewer, found this

call BIS_fnc_effectFiredLongSmoke

😂

inner haven
#

Anyone have any information on how I can post from arma to a rest api?

still forum
#

With a Extension

inner haven
#

Is there any currently out there that I could take a look at?

radiant egret
#

theres a nodejs extension

inner haven
#

Oh shit so there is, thanks for that

tough abyss
#

call BIS_fnc_effectFiredLongSmoke the fastest and most efficient function in the library no doubt

fleet hazel
#

Guys.

#

As me in game hide selection?

#

For homes do selectionNames cursorObject. Received array use this way:

cursorObject hideSelection  [_x, true];
}forEach ["door_6","door_3","door_1","door_5","door_2","door_4","damt_1","door_handle_1","door_handle_2","door_handle_3","door_handle_4","door_handle_5","door_handle_6","glass_1_hide","glass_2_hide","glass_3_hide","glass_1_unhide","glass_2_unhide","glass_3_unhide","glass_4_hide","glass_5_hide","glass_6_hide","glass_7_hide","glass_8_hide","glass_4_unhide","glass_5_unhide","glass_6_unhide","glass_7_unhide","glass_8_unhide","glass_9_unhide","glass_9_hide"];```
#

But it doesn't work(

pale depot
#

cursorObject hideSelection [_objects, true];```

Try that?
still forum
#

I didn't understand a single word. And no that doesn't work, command doesn't take array of selections

pale depot
#

feelsbadman

fleet hazel
#

@pale depot dont work

pale depot
#

@fleet hazel What are you trying to use this for?

fleet hazel
#

@still forum We need to hide the selections for the house.

still forum
#

glass_1_hide that looks more like a animation, not a selection

fleet hazel
#

@still forum I got the list with the command selectionNames cursorObject

tough abyss
#

Use on simple object with hideSelection

tough abyss
#

Are the format of config.cpp and descriptions.ext the same?

robust hollow
#

yea, theyre both configs.

tough abyss
#

So would renaming a descriptions.ext be acceptable?

robust hollow
#

well... if it isnt called description.ext then the mission wont load it. if a mod config.cpp isnt called that or config.bin (for rapified configs) the mod config wont load.

tall dock
#

I could need a little hint in the right direction:
I'm currently creating a "Kill summary" text for players in the UI. Basically pretty easy with an "entityKilled" EH and it works fine so far.
But how would one approach a summarized vehicle kill with several units inside, where the vehicle and each unit are seperate kill and thus trigger the EH several times as well?
I thought of appending the units + killtime into an array and then display for example all kills in between 0.2 seconds into one message. But that would need some loop watching the array constantly, right?
Is there a more efficient way to do this? Maybe kills spawn a 3 second loop and before that one starts, it checks if another loop was already created and then just use that one instead? And every new kill just extends the loop so I don't need to loop all the time?
(I'm not really out of ideas, but also not trying to invent the wheel again. So if somebody already knows a better way, it would be greatly appreciated)

marble flare
#

How can I make a marker in eden editor that tell me the dept of the water as the name from where the mark is at?

tall dock
#

@marble flare _depth = ((ASLToATL getMarkerPos "markerWater") # 2); "markerWater" setMarkerText format["Depth: %1",_depth];
Try that

robust hollow
#

you would want atltoasl wouldnt you? water depth would be atl 0z

marble flare
#

That works, but need to copy and paste the marker throughout the map probably about 500 times

#

so the name can't be unique

tall dock
marble flare
#

😬

#
"_USER_DEFINED #" setMarkerText format["Depth: %1",_depth];} forEach allMapMarkers```
#

Closest I got

ruby breach
#

If I remember correctly, he was trying to pull the eden attribute, which may be of use for what you're trying to do

tough abyss
#

anyone see any issues with my config.cpp? I have tried it but it doesn't seem to work whilst in game using sqf playsound "Airdrop_Plane_sound2";

class CfgPatches
{
    class SlaysRavageResources
    {
        name = "Slay's Resource Pack";
        author = "Slay No More";
    };
    };

class CfgSounds
{
    sounds[] = {};
    class Airdrop_Plane_sound2
    {
        name = "Airdrop_Plane_sound2";
        sound[] = {"SoundZ\plane_fly_over_2.ogg",1};
        volume = 1.0;
range = 50;
    };
};```
tall dock
#

@marble flare { private _markerName = [_x, 0, 10] call BIS_fnc_trimString; if (_markerName == "markerWater") then { private _depth = ((ASLToATL getMarkerPos _x) # 2); _x setMarkerText format["Depth: %1m", round _depth]; }; } forEach allMapMarkers;

#

Place this into any init and just drop lots of markers with "markerWater_1" etc as name on the map

#

If those are not editor placed but user defined, you have to manipulate the string a bit more, splitString should do the trick then

marble flare
#

Freakin perfect...now to figure out how to convert it to fathoms 😉

#

Thanks a ton!

tall dock
#

np, had fun trying that myself 😃

pale depot
#

I'm utilizing the BIS_fnc_holdActionAdd function, I'm trying to make it so when the action is completed, it deletes 2 effects placed in Eden. Here is what I've got:

 this, 
 "Put out fire", 
 "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", 
 "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", 
 "_this distance _target < 5", 
 "_caller distance _target < 5", 
 {}, 
 {}, 
 {deleteVehicle ((nearestObjects [player, ["Module_F"], 10]) select 0)}, 
 {}, 
 [], 
 12, 
 6, 
 true, 
 false 
] call BIS_fnc_holdActionAdd;```

My objects are `ModuleEffectsFire_F` and `ModulePersistentSmokePillar_F`. I've tried putting these in and it did not work.
tough abyss
#

@tough abyss where did you see volume and range properties used like that? AFAIK they should be part of the sound property value

#

@tall dock what? use playsound Airdrop_Plane_sound2; You removed “ and this somehow should solve the problem? All you did was you passed undefined variable to playSound command

tough abyss
#

@tough abyss not sure honestly

#

What you mean you just invent things randomly?

tough abyss
#

yeah kinda

#

In this case can you invent us some inventory commands as well please? Quite a few essentials are still missing. Appreciate it.

tough abyss
#

xD

cursive whale
#

Anyone got a tidy code snippet to return the intersection of two arrays?

robust hollow
cursive whale
#

that's more of an arrayAggregate

#

i mean return an array which contains elements common to both

robust hollow
#

Intersects array1 with array2 returning array of unique common elements.

cursive whale
#

oh, right, do'h, misread, thx

robust hollow
#

👍

cursive whale
#

what i wouldn't give for System.Linq...

queen cargo
#

you can write your own library @cursive whale
or, if you actually talk about the object related stuff, use one of the numerous "alt languages" out there

#

or: write a C# extension

cursive whale
#

If I ever needed to deal with really large arrays I might but it's probably not worth the overhead (not to mention time) for the garden variety PITA manipulations (right now i just want a crew list with commander, then driver first).

queen cargo
tough abyss
#

i just want a crew list with commander, then driver first

[commander veh, driver veh]

here you go

cursive whale
#

cheers, but i need the other crew also (ideally [commander, driver, gunners, cargo]). done now it's just a bit awkward dealing with arrays when I generally get to use linq.

astral dawn
#

Some guys which are sort of cargo are actually turrets

#

I mean the FFV seats, it's really annoying

cursive whale
#

yeah, I'm just going to pushback whatever it returns as Gunner _veh then append the balance however it comes

astral dawn
#

Yeah gunner should be one of the main turrets
So to sum it up, there are only three pure kinds of seats
Driver
Turret with turret path
Cargo with cargo index
Commander is a role rather than a specific seat 🤷 I think because he is actually a turret

tough abyss
#

are actually turrets they are both

astral dawn
#

Are you sure? So I can assign a guy as cargo index to an FFV seat too?

#

Yeah indeed, that's what I get if I get into a HEMTT FFV cargo seat and execute this: fullcrew (vehicle player)
[[B Alpha 1-1:1 (Sparker),"Turret",7,[0],true]] - cargo index 7, turret path [0]
[[B Alpha 1-1:1 (Sparker),"Turret",15,[1],true]] - cargo index 15, turret path [1]
But if I look at an empty HEMTT truck and do this: copytoclipboard str (fullcrew [cursorObject, "cargo", true]), that's what it returns:
[[<NULL-object>,"cargo",0,[],false],[<NULL-object>,"cargo",1,[],false],[<NULL-object>,"cargo",2,[],false],[<NULL-object>,"cargo",3,[],false],[<NULL-object>,"cargo",4,[],false],[<NULL-object>,"cargo",5,[],false],[<NULL-object>,"cargo",6,[],false],[<NULL-object>,"cargo",8,[],false],[<NULL-object>,"cargo",9,[],false],[<NULL-object>,"cargo",10,[],false],[<NULL-object>,"cargo",11,[],false],[<NULL-object>,"cargo",12,[],false],[<NULL-object>,"cargo",13,[],false],[<NULL-object>,"cargo",14,[],false],[<NULL-object>,"cargo",16,[],false]]
So it says, there are NO cargo seats with cargo index 7 and 15, what is going on here?

#

And if I go back into FFV seat and do this copytoclipboard str (fullcrew [vehicle player, "cargo", true]) it returns same array as above ^

tough abyss
#

You might want to read fullcrew page on wiki then

astral dawn
#

I don't get it, is cargo index only compatible with moveInCargo? What about assignAsCargoIndex?

tough abyss
#

which cargo index

#

there are 2

#

one for use with action one with cargo comands

#

assignAsCargo should take the same index as moveInCargo I suppose

astral dawn
#

This command: https://community.bistudio.com/wiki/assignAsCargoIndex has only one syntax
The fullCrew return value [<Object>unit,<String>role,<Number>cargoIndex (see note in description),<Array>turretPath,<Boolean>personTurret] has only one cargo index too
Where are there two kinds of cargo index you are talking about? I don't get it

tough abyss
#

Not sure worth discussing it until you read fullcrew page on biki where it is explained

astral dawn
#

Oh you mean this one unit action ["getInCargo", targetVehicle, positionNumber]
positionNumber is a specific cargo position index number
LOL

#

So there is 'cargo index' and 'cargo position index number', I get it now 😄

fleet hazel
#

Guys. How can I determine the length of a value?

ebon ridge
#

@fleet hazel What type of value?

winter rose
#

the one returned by the car script

tough abyss
#

@fleet hazel count

astral dawn
#

Maybe he means magnitude of a vector? vectorMagnitude for that
Or by length he meant absolute value of a number? Then there's abs

fleet hazel
#

@ebon ridge @tough abyss number 1634984189

ebon ridge
#

What kind of length?

fleet hazel
#

@ebon ridge Yes

ebon ridge
#

Not sure if being subtly trolled...

#

or language barrier

fleet hazel
#

@ebon ridge I need to do 1634984189 work [1,6,3,4,9,8,4,1,8,9]

ebon ridge
#

ahh

#

length of string representation

fleet hazel
#

Yes. and then team count I know the length

ebon ridge
#

count (format ["%1", number])

fleet hazel
#

How to make this format?

tough abyss
#

@fleet hazel count str 5677654

ebon ridge
#

that is nicer

fleet hazel
#

@tough abyss count str 5677654 output 12

tough abyss
#

But with large numbers it won’t work because of scientific notation

fleet hazel
#

And there are 7 numbers

ebon ridge
#

or because of float imprecision

tough abyss
#

Ok do count (5677654 tofixed 0)

fleet hazel
#

And how do I choose 0 and 1 elements of this number?

tough abyss
#

Select

#

(5677654 tofixed 0) select 0

fleet hazel
#

error send me

tough abyss
#

Post your code

fleet hazel
#

I use the debug console

#

There is no result

tough abyss
#

So post what you put there

fleet hazel
#

(5677654 tofixed 0) select 0

tough abyss
#

What error says?

fleet hazel
#

22:43:49 Error in expression <(5677654 tofixed 0) select 0>
22:43:49 Error position: <select 0>
22:43:49 Error General error in expression

#

toArray(5277654 tofixed 0)

#

select element and toString

ebon ridge
#

(5677654 tofixed 0) select [0, 1] maybe

fleet hazel
#

@ebon ridge OOoo yes this WORK!

#

Thanks guys.

ebon ridge
#

[0, 1] is start and length, so use [1, 1], [2, 1] etc to select each individual character

fleet hazel
#

@ebon ridge Thanks. I know more now!

tough abyss
#

Ah yeah of course substring

frigid raven
#

Who was missing me?

#

Heyyyyyyyyyyyyy

#

yeah I thought so...

#

🚶

tough abyss
#

New command addMEGAzine

still forum
#

@tough abyss if you wanna test perf of cache vs nocache, cache is removed now on RC

tough abyss
#

I will wait for the next dev, if it is gone it is gone, no one will change that now

digital plover
#

How to call mod.cpp in the pbo files ?

still forum
#

can't

violet gull
#

I've noticed that some playActions, when executed server-side, are global (Such as "SitDown") but others seem to not be. In this case, I'm trying to use switchAction instead and the AI looks like he's either just standing or gets frozen in a walking animation.

#

I'm trying to avoid the use of remoteExec because it doesn't always execute when I need it to (Slow / incorrect order)

tough abyss
#

try to playMove it

#

or playAction it, whichever works

fleet hazel
#

Guys. I have 2 requests.
How can I combine 2 queries into 1?

SELECT name FROM players WHERE playerid = '76561198052742683
';```
#

The result of the first query should be used in the second.

still forum
#

the second query doesn't use a house pid

#

trying to use something that's not used, doesn't make sense

fleet hazel
#

@still forum I need to get the name of the owner of the house.

still forum
#

well then you need to look for that in your database

#

I have no idea about your database layout

fleet hazel
#

All columns exist. I'm having trouble creating the request.
The first request I make is to check the availability of the house, and the second is the name of the owner of the house. Separately, everything works. Need 2 requests to do 1.

still forum
#

Well noone here can help you without knowing your database.

#

So guess you have to figure it out for yourself

tough abyss
#

Oh the pain of sending manual sql queries via sqf 😂

#

I almost enjoy watching people suffering when they refuse to use stored procedures

warm spade
#

i don't use sql that often but why is it "SELECT houses.pid FROM houses" and not "SELECT pid FROM houses"

#

SELECT pid, name FROM houses, players WHERE pos = '[3592.63,13081.3,0.128579]' AND classname = 'Land_i_House_Big_02_V1_F' AND playerid = '76561198052742683'; this should work @fleet hazel

fleet hazel
#

@warm spade Empty set

warm spade
#

@fleet hazel sry forgot to read the second part of your question.... something like this should check if the player id is linked to the house. SELECT houses.pid, name FROM houses, players WHERE pos = '[3592.63,13081.3,0.128579]' AND classname = 'Land_i_House_Big_02_V1_F' AND playerid = '76561198052742683' AND playerid = houses.pid; didn't tested it tho

#

assuming pid is short for playerid

fleet hazel
#

the pid is in the building table and the playerid is in the players

#

this dont work(

tall dock
#

Is there a way to update or remove a BIS_fnc_textTiles spawned text from screen? Or is there any other way to show a simple text on screen with a changable variable in it?

robust hollow
#

you can try running the function again, not sure if it works similar to bis_fnc_dynamicText which does replace the active text. other options are titletext and cuttext. use format to add ur variable into the string.

tall dock
#

Just found ctrlCreate ["RscStructuredText", -1] , maybe that'll work

lapis rivet
#

Hello, Does anyone know where to find A3 Apex classnames with pics? i can find class names but no pics of each one so i dont know which is which.. ( after clothing/vests mainly ) thank you!

young current
#

the virtual arsenal is probably the closest thing

austere granite
#

Any ezpz way to created a scripted "missionEnd" event?

#

missionEvent for Ended doesn't seem to trigger

#

Check CBA and unless my eyes are tricking me, don't see one in there either

#

Basically just need it when someone exits a mission (Leave preview from 3den, leave an MP mission (even if it still keeps running for others) etc.

burnt cobalt
#

is there a way to determine the 'center' of an airport/airfield? ilsPosition gives the edge of the runway and nearestLocations does not seem to reliably give results

cursive whale
burnt cobalt
#

HA! that's not ideal but MILES better than anything I tried so far

#

thank you @cursive whale

cursive whale
#

most welcome (i enjoy your videos), probably leave out the runway and average just the taxiway

marble thistle
#

Is there a way to fix it that remoteExecs wont arrive once the user tabs out without -nopause?

astral dawn
#

if there is no way, you'd probably have to implement an acknowledgement mechanism, but I hope there is a way

cursive whale
#

anyone know if there's a way to define a RscControlsGroup as initially hidden (to be revealed when required using ctrlShow)?

tough abyss
#

You can move it off screen

#

Does ctrlShow not work?

cursive whale
#

Was worried about seeing the group momentarily but if I ctrlShow false as soon as the display exists then you never see it, so all good.

tough abyss
#

I think there is a config param you can set so it is created hidden

cursive whale
#

would love to find it (the better way) but nada so far, will keep looking

tough abyss
#

Tried show = false; ?

cursive whale
tough abyss
#

I think it was added in A3

#

Can’t remember

cursive whale
#

show = 0;

tough abyss
#

Maybe

cursive whale
#

Works, thanks.

unreal scarab
#

Hi All !

I am pretty bad in script and even less on that of arma!
So for a specific mission I have to randomly spawn 1 ammoBox on one of 5 possible positions.
I think for example put traffic cones and replace randomly by a ammoBox but I can not do it.
Any Ideas?

digital hollow
#

Probably easier to just make the one box and move it to where you need. _box setPos selectRandom [_pos1, _pos2, ...];

lean estuary
#
18:59:44 Server: Object 109:572 not found (message Type_93)
18:59:44 Server: Object 144:602 not found (message Type_93)
18:59:44 Server: Object 34:17 not found (message Type_93)``` Any idea what might be causing this?
#

On a dedi server with 100 people, this spams the logs

still forum
#

clients sending messages about objects that don't exist anymore

young current
#

possibly client uses mods that server does not have

tough abyss
#

Object deleted but server is not updated

random estuary
#

@lean estuary totally normal, to hide, them append your startup CMD with -noLogs

jolly tendon
#

Does anyone have an experience with creating a custom function library? I've never done it before and i'm having a little trouble
This is what i have and its throwing script takitest\functions\fn_HP_fnc_countGarrison not found

robust hollow
#

is your file called fn_HP_fnc_countGarrison.sqf?

jolly tendon
#

Weird my screenies aren't working

#

no, my files are HP_fnc_countGarrison, etc

robust hollow
#

you can paste an image link, it just wont expand in chat unless you're special

jolly tendon
#

Ah ok

robust hollow
#

k, that is wrong

#

HP_fnc_countGarrison will compile to function HP_fnc_HP_fnc_countGarrison

#

so i assume ur files are named like fn_countGarrison.sqf?

jolly tendon
robust hollow
#

change them all so instead of HP_fnc_ they start with fn_. then in the config replace class HP_fnc_ with class (no prefix).

jolly tendon