#arma3_scripting

1 messages ยท Page 692 of 1

dusky pier
#

Hello, i trying to use SeatSwitched and GetIn event handlers on vehicle,
but as i understand - it works only locally

so to make this event handlers working for all players i need to remoteExec it, right?

unreal scroll
#

@dusky pier If you want some script to be executed for players individually, why not to use SeatSwitchedMan and GetInMan?

spark turret
#

does arma support any kind of shaders?

dusky pier
unreal scroll
#

@dusky pier
BTW, SeatSwitched can be ran only on server, that is recommended for any time-consuming scripts.
About GetIn:

It can be assigned to a remote vehicle but will only fire on the PC where the actual addEventHandler command was executed
So it is ok for server script. Depends on what you want to do with players.

You can also use combinations, like GetInMan for player --> adding GetOut EH for vehicle the player enters --> ...

gaunt mortar
#
_azimuth = player getDir _posPlayer;
_roundedAzimuth = [_azimuth, 0] call BIS_fnc_cutDecimals;```

Is there any way to make this cleaner ? ^^'
unreal scroll
#

@gaunt mortar But getDir returns already rounded value, isn't it? And you can use round instead of call BIS_fnc_cutDecimals

gaunt mortar
#

Well,

_azimuth = player getDir _posPlayer;
        _roundedAzimuth = [_azimuth, 0] call BIS_fnc_cutDecimals;
        openMap false;
        hint format ["Vos alliรฉs son azimut %1", (_roundedAzimuth), "%1"];``` 
gave me something looking like 170.850 ^^'
But that round thing ? just a plain "round (_azimuth)" ?
unreal scroll
#

Yup,

round _azimuth
gaunt mortar
#

Mk. So might as well round it in the hint format part

hallow mortar
#

I have forgotten, does a Killed EH fire if the EH is added somewhere the target is not local to at the time of its death? i.e. if the Killed EH is added on the server only, and the target is local to a client when it dies, will the server's Killed EH fire?

#

I once knew this but apparently not any more

cosmic lichen
gaunt mortar
#

Mh.. when it comes to a bearing, doesnโ€™t make a huge difference right?

#

toFixed will simply remove the decimals where as round will .. well round it, the precision level here is minimal

unique sundial
#

tofixed will round too

gaunt mortar
#

Then is there a better optimization on one of them, or It's tomato tomato

winter rose
#

ez, give us decimal ๐Ÿ˜„

unique sundial
#

what is decimal?

winter rose
#

a C# type for high precision calculation, I don't know much more ๐Ÿ˜„

#

twice the size of a double though

cosmic lichen
real tartan
#

is there limitation how many parallel code can run ? trying to do 10-20 spawns

#

and game is stuck on loading mission

restive leaf
#

Is indeed in Newtons. See the linked Nvidia physX documentation on that page

spark turret
winter rose
spark turret
#

instead i get f*cking floats that loose precision at 6km

tranquil cradle
tranquil cradle
#

Thanks!

real tartan
#

trying to optimize this line

{ [_x] execVM format ["script\run_%1.sqf", faction _x]; } forEach allUnits;

to

TAG_fnc_run_BLU_F = compile preprocessFileLineNumbers "script\run_BLU_F.sqf";
TAG_fnc_run_OPF_F = compile preprocessFileLineNumbers "script\run_OPF_F.sqf";
TAG_fnc_run_IND_F = compile preprocessFileLineNumbers "script\run_IND_F.sqf";
TAG_fnc_run_CIV_F = compile preprocessFileLineNumbers "script\run_CIV_F.sqf";

{ [_x] spawn format ["TAG_fnc_run_%1", faction _x]; } forEach allUnits;

but spawn is expecting code, not string

still forum
#

[_x] spawn (missionNamespace getVariable [format ["TAG_fnc_run_%1", faction _x], {}]);

#

you have a string, but you want the value of the variable of the same name as your string.
getVariable retrieves variable value by name

real tartan
#
TAG_fnc_run_BLU_F = compile preprocessFileLineNumbers "script\run_BLU_F.sqf";
TAG_fnc_run_OPF_F = compile preprocessFileLineNumbers "script\run_OPF_F.sqf";
TAG_fnc_run_IND_F = compile preprocessFileLineNumbers "script\run_IND_F.sqf";
TAG_fnc_run_CIV_F = compile preprocessFileLineNumbers "script\run_CIV_F.sqf";
{ [_x] spawn (missionNamespace getVariable [format ["TAG_fnc_run_%1", faction _x], {}]); } forEach allUnits;
dim terrace
hasty trout
restive leaf
#

Are you trying to do a plane's ejection seat like thing?

hasty trout
#

nope just trying to eject guys out of a helicopter

restive leaf
#

Ah, okay

hasty trout
#

having issues with having them eject anywhere further up than about 0.5 meters. but i think its because i used the wrong getPos

hasty trout
#

hm nope. changed to getPosATL but same thing. the trigger seems to trigger properly at the correct altitude but the eject wont happen until im at a maximum of 1m indicated altitude

#
//diag_log format["ejectSquad called, _this: %1", _this];
private _lz = _this select 0;
private _vehicle = _this select 1;
private _squad = _this select 2;
private _fromTaskId = _this select 3;
private _pilot = driver _vehicle;
private _side = side _squad;
private _squadCmdr = (units _squad) select 0;

deleteWaypoint [_squad,1];

{_x action["eject", vehicle _x]} forEach units _squad;
{unAssignVehicle _x} forEach units _squad;
{_x enableAI "TARGET"; _x enableAI "AUTOTARGET";} foreach units _squad;

private _wp = _squad addwaypoint [_lz,5,1];
_wp setwaypointType "MOVE";

[_squadCmdr, format["%1, please standby as we're getting off.", name _pilot]] remoteExec ['sideChat', _side];

scopeName "main";
while {true} do
{
    scopeName "ejectloop";
//    diag_log format["ejectSquad: ticking %1", _this];
    if (({(_x in _vehicle) && (alive _x)} count units _squad) == 0) then
    {
        // No squad units left alive inside
        [_fromTaskId, "SUCCEEDED" ,true] spawn BIS_fnc_taskSetState;
        breakOut "ejectloop";
    };
    sleep 2;
};

[_squadCmdr, format["%1, everyone is out, you're clear to lift off", name _pilot]] remoteExec ['sideChat', _side];

//diag_log format["ejectSquad done, _this: %1", _this];

Is there anything here that somehow limits the altitude of when to eject?
the sidechat part runs so the script must be running but I do not get why it wont eject unless im at a maximum of 1meter altitude

dim terrace
winter rose
restive leaf
#

Never understood a use for that function either... I mean it only affects the reload after firing the weapon (from Demellion's note) unless you script around that, in which case I guess you can store what it has been changed to???

dim terrace
#

well, I need some easy method to check if tank canon is ready to fire. I'm using animationSourcePhase for it right now and it works there

#

but there is no method to check state of infantry held weapon so I cannot do similar trick there

restive leaf
tough abyss
#

Hey! I have a question. I want to do a little killhouse training where there's actual Ai being spawned after an addaction (with if possible it being repeatable/random pos) so it can be used multiple times.

#

Is there something like this? I obviously can't look at armaholic anymore..

dim terrace
#

mystical person they say!

restive leaf
#

Bohemia Interactive created AI system... subsystem of Dwarden 2.0

winter rose
#

together, we areโ€ฆ the Dadmen ๐Ÿ˜Ž

restive leaf
winter rose
#

omg

#

it's a mod

#

IT EXISTS!!

copper raven
pulsar bluff
#

without a getter you could use proxies like reading the weapon HUD ui (it changes color when ready to fire)

#

maybe figure out what the HUD is using to get โ€œready to fireโ€ state

hasty trout
copper raven
#

i guess you can run selectweapon, read the value of the progress bar, and switch back

slate cypress
#
if ((_this select 0) == 1) then
{    // Run on the HC only
    if !(isServer or hasInterface) then
    {
        execVM "init_HC.sqf";
    };
} else {
    // Run on the server only
    if (isServer) then
    {
        execVM "init_HC.sqf";
    };
};

Why doesn't this work?
I took it from: https://community.bistudio.com/wiki/Arma_3:_Headless_Client
The error: "(" encountered instead of "="

#

it's running in description.ext after following the instructions for "Execute the script via a mission parameter"

#

sqflint seems to have a red underline at the ) == 1) but i don't see any issue

winter rose
slate cypress
winter rose
#

did you put that in description.ext?

slate cypress
#

yes

winter rose
#

that's why

slate cypress
#

?? it says to add the code to the function in description.ext

little raptor
little raptor
slate cypress
#

where do you put it?

little raptor
#

It's a script

little raptor
slate cypress
#

First define a function to be used to run the headless client script file. Here's what it should look like in description.ext:

little raptor
#

Click on function to understand what it means meowsweats

hasty trout
#

is it possible to have an and (&&) within another and?

winter rose
#

&&&&, duh

little raptor
#

wdym?

hasty trout
#

basically just 3 conditions

#

like

#

a && b && c

winter rose
#

yup

little raptor
#

Yes

hasty trout
#

thanks

winter rose
slate cypress
copper raven
#

it should be 1:1 progress bar no?

little raptor
#

I thought you meant actual time meowsweats

winter rose
dark tulip
#

Is there a BI wiki link I'm not seeing or maybe someone can explain this too me.

custom composition A is a truck with items mounted to it. I want to have the ability to "unpack" the truck and it turns into a small camp which would be composition B

I may want to complicate it by having it be a mobile spawn, or medical camp

ideas?

winter rose
#

scripting, yeah

dark tulip
#

Ok, so basically building a script that allows A to turn to B to turn back to A. Time to dig

winter rose
#

createVehicle, getPos (alt syntax), etc ๐Ÿ™‚

dark tulip
#

making more sense to me now. I was looking through a mission pbo someone had this in, and need to focus on his scripts and not his compositions. I was to lazer focused on mimicking what he built when i can just build my own.

coral nest
#

i have a really good idea for a mod thats script based, with attaching and detaching a player to an object through self interactions but i have no idea where to even start. if someone is experienced in making mods please dm me

winter rose
coral nest
#

im just looking for guidance on where to start

winter rose
#

then no DMs, it can happen here ๐Ÿ™‚
see attachTo and addAction to begin with

red rune
#

Hello

#

I'm very new to scripting, but I'm trying to use the BIS_fnc_moduleLightning module in a "Killed" event handler.
Current issue is that the object the lightning hits just gets deleted afterwards

#

I saw that someone else was having the same issue so I guess that's just the way it works, but is there any way around that?

winter rose
#

that might be because you are using it wrongly

#

create an empty object, don't pass the target as first argument

#

@red rune โ†‘

red rune
#

so attach the object to the target and make the lightning hit that object?

winter rose
#

just create something on the target's position yes

red rune
#

that works, thanks

winter rose
#

I'm updating the wiki at the same time

coral nest
#

is there a way to search for vehicle/helicopter objects within say 2 metres and then attach the player to it

#

idea would be
scrollwheel>search 2m for nearest vehicle> attach to vehicle

winter rose
#

yes, see e.g nearestObjects

halcyon hornet
#

How can you disable user movement/rotation when in an animation without disabling all simulation/input?

winter rose
#

override WASD and setDir, or set a locking anim, orโ€ฆ

tough abyss
#

With Armaholic being down, can someone send me GF Holster Script version 2.0 and GF Earplugs Script version 2.2?

boreal spindle
#

When a mpmission is loading whats the first file name to load the scripts?
init.sqf?

#

(the main script file)

modest nova
leaden haven
# tough abyss With Armaholic being down, can someone send me GF Holster Script version 2.0 and...

Earplugs code. Put this in initPlayerLocal.sqf

waitUntil {!isNull(findDisplay 46)};
(findDisplay 46) displaySetEventHandler ["KeyDown","_this call keyspressed"];
keyspressed = {
    _keyDik = _this select 1;
    _shift =_this select 2;
    _ctrl = _this select 3;
    _alt = _this select 4;
    _handled = false;
    switch (_this select 1) do {
        case 207: {
            if (soundVolume == 1) then {
                2 fadeSound 0.1;
                titletext ["Earplugs in.", "PLAIN DOWN"];
            } else {
                2 fadeSound 1;
                titletext ["Earplugs out.", "PLAIN DOWN"];
            }
        };
    };
    _handled;
};

Press End for Earplugs.

unique sundial
hasty trout
#

is there a way to make ai gunners a bit more aggressive and willing to fire? having issues with door gunners in a helicopter not opening fire unless im loitering for quite some time within moderately close range of enemy infantry, even if those infantry have opened fire at the helicopter way before the doorgunners fire back

slate cypress
hasty trout
#

sog pf is running

#

spawning them with createVehicleCrew

slate cypress
#

I don't know if sog pf changes AI behaviour but I wouldn't think so.

Have you tried use createVehicleCrew to spawn a vanilla asset in order to see if its something to do with setting AI awareness?

hasty trout
#

i can try it on a vanilla asset but i reckon its just that the default behavior isnt quite as aggressive as id like. i just think itd make sense if they at least would open fire against infantry actively firing against the helicopter

slate cypress
#

Have you changed game difficulty to recruit by any chance?

#

I have mine on regular

hasty trout
#

ill see if i might have changed it

hasty trout
#

while im at it, having minor issues with this:

//diag_log format["spawnCrewAction called, _this: %1", _this];
private _vehicle = _this select 0;
private _caller = _this select 1;
private _returnValue = [];
private _group = group _caller;
private _tmpGroup = createGroup civilian;
_returnValue = [ _vehicle, _tmpGroup, false, typeof _vehicle]; createVehicleCrew _vehicle; _vehicle deleteVehicleCrew driver _vehicle;
// a bit of twiddling to get the units to the correct side
_returnValue joinSilent grpNull;
_returnValue joinSilent _group;
deleteGroup _tmpGroup;

//diag_log format["spawnCrewAction returning: %1", _returnValue];
_returnValue

units spawn in properly but for some reason the only spawned in unit that appears to be added to the players group is the copilot. if done in a heli with 2 door gunners for example they will spawn in but they do not appear to be added to the players group, at least they do not show up in the group bar at the bottom of the screen. any ideas?

little raptor
#

_returnValue joinSilent grpNull;
wat?

winter rose
#
private _vehicle = _this select 0;
private _caller = _this select 1;
// replace by
params ["_vehicle", "_caller"];
little raptor
#

_returnValue = [ _vehicle, _tmpGroup, false, typeof _vehicle];
again, wat?

hasty trout
#

its an addaction tied to a vehicle

winter rose
hasty trout
#

in another sqf :p

_vehicle = _this select 0;
_vehicle setDamage 0;

_vehicle remoteExec ["removeAllActions", 0, "rmall" + (_vehicle call BIS_fnc_netId)];
[_vehicle, ["Spawn crew", { _this remoteExec ["spawnCrewAction", _this select 0]; },nil,1.5,true,true,"","true",5,false,"",""]] remoteExec ["addAction", 0, "addcrew" + (_vehicle call BIS_fnc_netId)];
[_vehicle, ["Remove crew", { _this remoteExec ["deleteCrewAction", _this select 0]; },nil,1.5,true,true,"","true",5,false,"",""]] remoteExec ["addAction", 0, "removecrew" + (_vehicle call BIS_fnc_netId)];
winter rose
#

โ€ฆ I am going to be sick

hasty trout
#

: D

#

any idea though why only copilot end up in players group?

little raptor
#

I have no idea what on earth the rest of it is meowsweats

hasty trout
#

shouldnt i at least do deleteGroup _newGroup; there? or is it deleted by moving them to the group of the caller?

little raptor
#

just use vehicle

little raptor
#

but it won't hurt

#

added

hasty trout
#

okay. just used to doing stuff in wc3 editor and if you dont delete basically everything you ever create it ends up with massive memoryleaks

hasty trout
#

does a players/servers difficulty settings override a scenarios or does a scenarios setting override the servers/players?

little raptor
#

latter

hasty trout
#

if you spawn in an AI with max skill but the players difficulty option has skill on lowest which one ends up being used?

#

ah thanks

slate cypress
hasty trout
#

nope. im gonna just set the skill on the units in editor and see if that helps

#

@little raptor is this correct when it comes to setSkill on the ai units created in the previous thing you helped me with?

{_x setSkill 1} forEach units _group;
#

sorry for the vemvaresompinga

hasty trout
#

thanks

hasty trout
#

ah that helps, thanks again

safe crane
#

so i have set up a target range and i want to reset targets at a greater range what input would i change to increase target range reset?

#

sorry i am noob at scripting

hasty trout
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
safe crane
#

confusion

#

no clue f

little raptor
hasty trout
#

Having some issues with onPlayerRespawn.sqf
It runs correctly first time player spawns (on mission start).
On first player respawn after being killed it does not run correctly.
If player is killed again it does run correctly.

#

so for some reason on the first player death it doesnt seem to run onPlayerRespawn.sqf after respawning

spark turret
#

thats almost impossible

hasty trout
#

yeah i have no idea why its happening

spark turret
#

are you sure you dont have an error aborting your script?

#

checked rpt?

hasty trout
#

yeah

hasty trout
#

i really dont understand this. i changed respawnOnStart to 1 just to see what would happen and then you spawn without the stuff in onPlayerRespawn.sqf working (addAction for example) but if you kill yourself and respawn again it works

#

its just the first respawn that doesnt work correctly for whatever reason

#

is there something wrong with my onPlayerRespawn.sqf? Seems unlikely since it works fine on any respawn except the first one.

player addAction ["<t color='#FFFF00'>Request mission</t>", { {[player] call spawnPlayerTask;} remoteExecCall ["bis_fnc_call", 2] },nil,10 ];
little raptor
hasty trout
#

so _newUnit instead?

little raptor
hasty trout
#

should i just swap "player" to _newUnit? that gives me a undefined variable in expression _newunit

torpid pewter
#

I'm trying to play a certain animation when a player has certain weapons equipped and i got it working for primary, secondary, and launcher, however I'm having trouble figuring out a way to do it with no weapon.

Here's my current code:

//Crouched
        if ((currentweapon player == (primaryweapon player)) and (stance player != "PRONE")) then {
            player playMove "AinvPknlMstpSlayWrflDnon_medicOther";
            };
        if ((currentweapon player == (secondaryweapon player)) and (stance player != "PRONE")) then {
            player playMove "AinvPknlMstpSlayWlnrDnon_medicOther";
            };
        if ((currentweapon player == (handgunweapon player)) and (stance player != "PRONE")) then {
            player playMove "AinvPknlMstpSlayWpstDnon_medicOther";
            };
            
        //Prone
        if ((currentweapon player == (primaryweapon player)) and (stance player == "PRONE")) then {
            player playMove "AinvPpneMstpSlayWrflDnon_medicOther";
            };
        if ((currentweapon player == (handgunweapon player)) and (stance player == "PRONE")) then {
            player playMove "AinvPpneMstpSlayWpstDnon_medicOther";
            };

There doesn't seem to be a command for no weapon equipped and if I try to do something like

if ((currentweapon player == "") and (stance player != "PRONE")) then {
            player playMove "AinvPknlMstpSlayWnonDnon_medicOther";
            };

It loops the animation multiple times when I try to run it with no weapon. It works fine in all other cases.

hasty trout
coral nest
#

trying to add an ace interaction to a deployed rappeling rope so you could technically rappel from outside the vehicle, any idea on how to do this?

willow hound
#

@hasty trout This ...

{[player] call spawnPlayerTask;} remoteExecCall ["bis_fnc_call", 2]
```... should be ...```sqf
[player] remoteExecCall ["spawnPlayerTask", 2]
```... not just for readability but also because the argument `player` is resolved on the server in the first version of the expression (see https://community.bistudio.com/wiki/remoteExecCall#Example_5).
hasty trout
#

thank you

#

๐Ÿ‘

dusky wedge
#

Hello everyone, is there any way to stop ctrlCommit?

tough abyss
#

does the nearestObject function retrieve objects that have been hidden via a hideTerrainObjects marker?

real tartan
#

getting tasks from mission, wtf BIS

private _maybeTasks = (allVariables missionNamespace) select {(_x find "@") == 0 && {_x find ".0" == (count _x) - 2}};
tidal ferry
#

Question

#

Is it possible for me to define a global variable from config?

#

Like, a truly accessible global variable, not just something I'd need to retrieve from getVariable

still forum
#

You can register a preInit Eventhandler that sets the variable. But without CBA you can only run script files there

#

What's your usecase? Maybe there's a better way?

tidal ferry
#

Yeah that actually would work just fine tbh

tidal ferry
still forum
#

Yes CfgFunctions.
But that's not config only as it needs a script file too. Don't know what your constraints are

gleaming oriole
#

Can somebody recommend a task and briefing framework that works on dedicated server and JIP?

cyan dust
hasty trout
#

i have a unit called "posMan" and i am creating a unit at the position of posMan:

private _newPos = getPos posMan;
"vn_b_men_sog_13" createUnit [_newPos, _groupTaxi,"",0.6, "CORPORAL"];

However posMan is standing on the roof of a building but the created unit ends up at the bottom floor of said building. Any help would be appreciated

#

using position posMan instead of _newPos had same result

copper raven
#

create unit at [0,0,0], then setpos after

hasty trout
#

would I need to turn each created unit into some sort of named variable in that case in order to setPos on it?

copper raven
#

no, use primary syntax

hasty trout
# copper raven no, use primary syntax

I dont see under the first Syntax part in that wiki how that would work. been scratching my head over this for a bit.
I mean I understand that under Example 1 i could then setpos on _unit but wouldnt that mean I am creating a variable for each unit i create before I can move it?

copper raven
#
_groupTaxi createUnit ["vn_b_men_sog_13", [0, 0, 0], [], 0, "NONE"] setPosASL getPosASL posMan;

edited, mb on the grp

willow hound
hasty trout
#

thanks sharp! you're the best

#

if i wanted to also make this unit a colonel would it look like this:

_groupTaxi createUnit ["vn_b_men_sog_13", [0, 0, 0], [], 0, "NONE"] setPosASL getPosASL posMan; setUnitRank Colonel;

or does the ; after posMan screw that up?

#

maybe it also needs to define the unit? _this setUnitRank Colonel;?

copper raven
hasty trout
#

ah yeah makes sense

copper raven
#

the reason i told you to use the main syntax of the createUnit is because that particular syntax returns the actual unit handle, while the one you were using, doesn't. you can use it and pass the init "code" string, but it'll be slower, + you gotta use format for that

coral nest
#

how would i calculate the distance from the player to a specific object class

#

i want to do this player distance "UK3CB_BAF_Merlin_HC3_18" but i cant**

willow hound
#

Are you interested in the distance to a single specific object of that class or are you interested in the distance to the nearest object of that class?

hasty trout
# copper raven ```sqf private _unit = _groupTaxi createUnit ["vn_b_men_sog_13", [0, 0, 0], [], ...

if i were to spawn another unit and wanted it close to that one without being literally on top of it, more like a spread out squad, would this work?

private _sog16 = _groupTaxi createUnit ["vn_b_men_sog_16", [0, 0, 0], [], 0, "NONE"]; 
_sog16 setPosASL [(getPosASL sog13 select 0)+random [1,2,3], (getPosASL sog13 select 1)+random [1,2,3], (getPosASL sog13 select 2)];
_sog16 setUnitRank "PRIVATE";

with the previous one being private _sog13

#

that should put it within 1-3 meters on x and y from sog13?

copper raven
hasty trout
#

oh wow thats a lot cleaner

hasty trout
hasty trout
#

then again i dont think that returns the distance just which is closest. maybe you can check the distance to the first thing in the array? not sure

coral nest
#

ive looked at that, but i have no idea how to put a class on that

hasty trout
# copper raven ```sqf _groupTaxi createUnit ["vn_b_men_sog_13", [0, 0, 0], [], 0, "NONE"] setPo...

here comes the tricky part though. i spawn a bunch of riflemen based on the amount of free seats in the vehicle.

    for "_i" from 1 to (_cargoSeats - 2) do
    {
        "vn_b_men_sog_05" createUnit [_newPos, _groupTaxi,"",0.5, "PRIVATE"];
    };

i cant just change this to something like

    for "_i" from 1 to (_cargoSeats - 2) do
    {
      private _sog05 = _groupTaxi createUnit ["vn_b_men_sog_05", [0, 0, 0], [], 0, "NONE"];
              _sog05 setPosASL (getPosASL sog13 vectorAdd [random[1,2,3],random[1,2,3],0])
              _sog05 setUnitRank "PRIVATE";
    };

because i reckon each spawned units need its own "private _name" ?
ideally the getPosASL would use sog13 on the first one and for each run of the loop the next one has its position based on the previous.

willow hound
# coral nest ive looked at that, but i have no idea how to put a class on that

You can get something going like so:

private _nearMerlins = nearestObjects [player, ["UK3CB_BAF_Merlin_HC3_18"], 1000];
private _nearestMerlin = _nearMerlins # 0;
private _distance = player distance _nearestMerlin;
```Warning: Because I am lazy, this code can't handle it when there is no object of the class within 1000 meters.
copper raven
#

because i reckon each spawned units need its own "private _name" ?
no

hasty trout
#

ah so i can just run the loop with no problem then?

copper raven
#

yes

placid sequoia
#

I'm trying to have different ACE Arsenals for different roles. I found an example online of how to do this, but I can't seem to get it to work. It shows no errors in the rpt, but it's also not adding the ace arsenal to the object. I have an object in the mission named arsenal_1 and then in initplayerlocal I have [arsenal_1] execVM "scripts\Arsenal.sqf"; . Arsenal.sqf is as follows: https://www.sqfbin.com/porawiyomuqulazaxaqi

copper raven
#

is arsenal_1 defined?

#

check it just to make sure, i don't see any errors in the code, also might be worth checking if initBox usage is correct

#

also you should omit the switch or that if chain, because you're basically checking against same values

hasty trout
#

_sog05 setPosASL (getPosASL |#|sog16 vectorAdd [random[1,2,3],random[1,...
Error Undefined variable in expression: sog16

    if (_cargoSeats > 1) then
    {
    private _sog16 = _groupTaxi createUnit ["vn_b_men_sog_16", [0, 0, 0], [], 0, "NONE"]; 
        _sog16 setPosASL (getPosASL sog13 vectorAdd [random[1,2,3],random[1,2,3],0]);
        _sog16 setUnitRank "PRIVATE";
        _sog16 setSkill 0.5;
    };

    for "_i" from 1 to (_cargoSeats - 2) do
    {
        private _sog05 = _groupTaxi createUnit ["vn_b_men_sog_05", [0, 0, 0], [], 0, "NONE"];
        _sog05 setPosASL (getPosASL sog16 vectorAdd [random[1,2,3],random[1,2,3],0]);
        _sog05 setUnitRank "PRIVATE";
        _sog05 setSkill 0.6;
    };
placid sequoia
copper raven
hasty trout
#

i dont see how it looks any different than how sog13 looks and theres no error regarding that

copper raven
#

where do you define sog16?

#

and also, sog13 is probably undefined too, the popup error message is probably hidden by the later-error

hasty trout
#

this is at the top of the sqf file

private _spawnPos = _this select 0;
private _sog13 = "";
private _sog16 = "";
private _sog05 = "";

isnt this defining them?

copper raven
#

_sog16 is different from sog16

#

one is a local variable, the other is a global variable

copper raven
round scroll
#

I'm trying to get some screenshots for editor preview, but I get no classes with this call: ```sqf
[nil, "all", [],[],[], ["uns_nva_m56"]] spawn BIS_fnc_exportEditorPreviews;

#

config viewer shows configfile >> "CfgVehicles" >> "uns_nva_m56"

hasty trout
# copper raven `_sog16` is different from `sog16`

oh there we go, thanks!

now i bumped into this.

_sog05 setPosASL (|#|getPosASL _sog16 vectorAdd [random[1,2,3...
Error getposasl: Type String, expected Object.

is this:

_sog05 setPosASL (getPosASL _sog16 vectorAdd [random[1,2,3],random[1,2,3],0]);

supposed to be

_sog05 setPosASL [getPosASL _sog16 vectorAdd [random[1,2,3],random[1,2,3],0]];

?

copper raven
#

you're trying to get position of a string, that's not how it works

hasty trout
#

i dont see how im doing it differently from the example

player setPos (getPos player vectorAdd [0,0,10]);
copper raven
# round scroll I'm trying to get some screenshots for editor preview, but I get no classes with...
//--- Get the list of affected objects
_cfgVehicles = "
    getnumber (_x >> 'scope') == 2
    &&
    {
        getnumber (_x >> 'side') in _sides
        &&
        {
            _class = configname _x;
            _isAllVehicles = _class iskindof 'allvehicles';
            (_allVehicles == 0 || (_allVehicles == 1 && _isAllVehicles) || (_allVehicles == -1 && !_isAllVehicles))
            &&
            {
                (_allMods || {(tolower _x) in _mods} count (configsourcemodlist _x) > 0)
                &&
                {
                    (_allPatches || {(tolower _x) in _patches} count (configsourceaddonlist _x) > 0)
                    &&
                    {
                        (_allClasses || {(tolower _class) in _classes})
                        &&
                        {
                            !(gettext (_x >> 'model') in _restrictedModels)
                            &&
                            {
                                inheritsfrom _x != _cfgAll
                                &&
                                {
                                    {_class iskindof _x} count _blacklist == 0
                                }
                            }
                        }
                    }
                };
            }
        }
    }
" configclasses (configfile >> "cfgVehicles");
_cfgVehiclesCount = count _cfgVehicles;

that's basically the selector for the cfgVehicles

#

should look more into that function yourself, i'm sure you can find the cause for it not working

copper raven
hasty trout
copper raven
#

a variable is a reference to some value

#

you assign a string there

#

then you run getPosASL on it

hasty trout
#

ah so if i update private _sog16 for example within an if/for etc it wont be visible outside of that statement?

#

i thought that was just for if its defined or not

copper raven
#

it will be, unless you do a private assignment again

#
private _a = 5;
call {
  private _a = _a + 1;
  systemChat str _a; // 6
};
systemChat str _a; // 5
#

if you omit private inside call, the second systemChat would print 6 aswell

hasty trout
#

ah

#

o yeah i think its working now

#

maybe i can be done feeling stupid for the day

placid sequoia
copper raven
#

ye i didn't mean command print

#

use diag_log or something similar

brazen lagoon
#

I'm trying to use sunday revive, but when a player is revived they get stuck in 3rd person + die seemingly randomly after some time. I thought this was because the bleedout function was still running but I had it hint when it calls setDamage 1 and it doesn't seem to get to that part of the script, so I don't really know what the issue is. Anyone got any ideas for debugging?

brave jungle
#

I see there is a curatorGroupPlaced EH, is there a curatorGroupDeleted EH? Wiki says no but want to ensure its non-existent. Is it delt under another EH instead?

copper raven
#

use curatorObjectDeleted

#

and check the count of the units

#

and if that's not the case, there is no other way for the curator to delete groups(unless there is some other script, i.e module being used, but then it doesn't make sense in this context)

coral nest
#

what script can i use to disable player collision with a helicopter

copper raven
coral nest
#

i have player disableCollisionWith

#

but then what other param do i use?

#

can i put a object class at the end?

copper raven
#

you put the helicopter object ๐Ÿ˜„

coral nest
#

sorry can i have like a example

#

if i wanted to use the ghost hawk

copper raven
#

player disableCollisionWith _ghosthawk ?

coral nest
#

i can just call its class name?

copper raven
#

no

coral nest
#

so whats that _ghosthawk?

copper raven
#

the helicopter object

coral nest
#

so i would have to make the var for the heli "ghosthawk"?

copper raven
#

alx_ghosthawk would be more correct

#

global variables should have tags

coral nest
#

im so confused

copper raven
pulsar solar
#

i have a question, how would you make the AI respawn after they die. it could work when a "Killed" event handler goes off the game would recreate the same unit and delete the old one. you see I am try to make a firing range and I want for there to be some ai's as some targets so the players can see how there gun would act like in the field. making them not move and not doing friendly fire would be helpful too. also I not very good at coding.

tepid vigil
# coral nest im so confused

In the editor (i am presuming you have the ghost hawk placed down in the editor) you can double click the ghost hawk to open the attributes. From here you can type player disableCollisionWith this; into the init field to disable collision

copper raven
#

you will also have to handle locality changes

#

(if there will be any)

coral nest
#

ill try that, but i will probably need it to change at a specific time

tepid vigil
#

([OT_allTowns,[],{random 100},"DESCEND"] call BIS_fnc_sortBy); can somebody tell me what {random 100}does to the sort? I cant figure it out

copper raven
#

its actually just an array being shuffled here

pulsar solar
tepid vigil
copper raven
#

it just generates a random number from 0 to 100 for every value in the array, and sorts using that value

pulsar solar
#

could you explain what these lines of code do and how they work, then I have something to start with

#

_unit = group player createUnit ["B_RangeMaster_F", position player, [], 0, "FORM"];

#

"B_RangeMaster_F" createUnit [position player, group player];

little raptor
pulsar solar
#

thanks

little raptor
coral nest
#

im trying to define a variable as what the player it looking at

#

so when this is executed

#

cursorTarget = var its not working?

#

forgive me if im being stupid

tepid vigil
#

_var = cursorTarget

coral nest
#

its still spitting out errors

tepid vigil
#

do you have a semicolon at the end like so _var = cursorTarget;

coral nest
#

ahem

#

whoever decided semi colons were ever a good idea

little raptor
coral nest
#

by making a new line

#

or commas

#

or anything but

#

smelly colons

little raptor
coral nest
#

they should be shorter!

#

fat basta-

#

im just very annoyed ive sat here for 27 minutes trying to fix the fact i didnt have semi colons

little raptor
coral nest
#

:(

#

just keep beating that dead horse

winter rose
proper sail
#

you can use commas

#

as end of line instead of semicolon

little raptor
#

๐Ÿคซ

winter rose
proper sail
coral nest
#

why cant coding just be like,,, code does what i think it should do

proper sail
#

createvehicle,

coral nest
#

and you guys made a whole game with semi colons?

#

i feel bad for you

proper sail
#

yeah the whole game is 1 semicolon

little raptor
coral nest
#

i can do like

#

print "hello world"

little raptor
#

and semicolons are used in almost all programming languages

coral nest
#

well i dont like them!

proper sail
#

maybe we dont like u

coral nest
#

:(

restive leaf
proper sail
#

๐Ÿค

coral nest
#

its gotten to the point where im just swapping around vars in my code hoping that it will work

tepid vigil
#

just give us the code

coral nest
#

its really weird

#

this is mine right

#

focus on the attach/detach stuff

#

and this is from a mod called ZEN

little raptor
wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
coral nest
#

yeah wait

#

so this is mine

#

is the important bit

#

the problem is the detach and attach

little raptor
coral nest
#

it works fine

#

ohh

little raptor
#

it should be colored

#

no need to delete it meowsweats
just edit your message

coral nest
#
myaction = ['Attach','Stand Ready','',{player attachTo [cursorTarget];standing = True ;},{private _intersects = lineIntersectsSurfaces [getPosASL ACE_player, getPosASL ACE_player vectorAdd [0, 0, 2], ACE_player];
(_intersects select {_x#2 isKindOf "UK3CB_BAF_Merlin_Base"}) isNotEqualTo []}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions"], myaction] call ace_interact_menu_fnc_addActionToObject;

myaction = ['Detach','Get Up','',{detach player; standing = False;},{standing}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions"], myaction] call ace_interact_menu_fnc_addActionToObject;```
#

sorry just wanted to get it right

#

so its pretty simple, it just attaches and detaches a player to a heli

#

when i tested this i used a zen module to test the idea of it and it worked flawlessly everytime

#

but with my one, when i detach my head bumps up into the celing of the heli and it goes boom

#

this is the one from ZEN

#
#include "script_component.hpp"
/*
 * Author: mharis001
 * Zeus module function to attach an object to another.
 *
 * Arguments:
 * 0: Logic <OBJECT>
 *
 * Return Value:
 * None
 *
 * Example:
 * [LOGIC] call zen_modules_fnc_moduleAttachTo
 *
 * Public: No
 */

params ["_logic"];

private _object = attachedTo _logic;
deleteVehicle _logic;

if (isNull _object) exitWith {
    [LSTRING(NoObjectSelected)] call EFUNC(common,showMessage);
};

// Detach object if currently attached
if (!isNull attachedTo _object) exitWith {
    detach _object;

    [LSTRING(ObjectDetached)] call EFUNC(common,showMessage);
};

// Get object to attach to
[_object, {
    params ["_successful", "_object"];

    if (!_successful) exitWith {};

    curatorMouseOver params ["_type", "_entity"];
    if (_type != "OBJECT") exitWith {};

    if (_object == _entity) exitWith {
        [LSTRING(CannotAttachToSelf)] call EFUNC(common,showMessage);
    };

    private _direction = getDir _object - getDir _entity;

    _object attachTo [_entity];
    [QEGVAR(common,setDir), [_object, _direction], _object] call CBA_fnc_targetEvent;

    [LSTRING(ObjectAttached)] call EFUNC(common,showMessage);
}, [], LSTRING(ModuleAttachTo)] call EFUNC(common,selectPosition);
#

im just trying to work out what zen did differently

#

its something to do with the detach

little raptor
unborn drum
#

Hello friends! I've got a super basic script that fully ACE heals somebody when they enter a trigger. Its set to TYPE: none, ACTIVATION: BLUFOR, ACTIVATION TYPE: Present. Its also set to repeatable. It doesn't seem to always work though. Is there a way to make it simply check for players inside the trigger, and if they are, run the script every 5 seconds until there's nobody left in the trigger? Alternatively, would it be easier to just give a scroll option to "activate" the heal script?
If you respond, please @ me. Thanks!

little raptor
#

which has nothing to do with your issue

coral nest
#

well actually

#

it might

coral nest
#

because when i was testing that was the one difference, i would be put in the direction the heli is facing with mine, but with ZENs it didnt

#

is that the only difference?

little raptor
#

yes

coral nest
#

how would i implement a object direction thingy into mine?

fleet stirrup
#

Is it known that the turretOwner command doesn't seem to work on the driver's turret ([-1])? In my hasty debugging that seems to be it but I am not sure

little raptor
coral nest
#

can i check it with you in a sec

#
myaction = ['Attach','Stand Ready','',{private _direction = getDir player - getDir cursorTarget;[QEGVAR(common,setDir), [player, _direction], cursorTarget] call CBA_fnc_targetEvent; ace_hearing_disableVolumeUpdate = true; 0 fadeSound 0.05; player attachTo [cursorTarget];standing = True ;},{private _intersects = lineIntersectsSurfaces [getPosASL ACE_player, getPosASL ACE_player vectorAdd [0, 0, 2], ACE_player];
(_intersects select {_x#2 isKindOf "UK3CB_BAF_Merlin_Base"}) isNotEqualTo []}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions"], myaction] call ace_interact_menu_fnc_addActionToObject;```
#

so this?

little raptor
#

no

#

use setDir

coral nest
#

oh

#

how?

#
myaction = ['Attach','Stand Ready','',{private _direction = getDir player - getDir cursorTarget;[setDir [player, _direction], cursorTarget] call CBA_fnc_targetEvent; ace_hearing_disableVolumeUpdate = true; 0 fadeSound 0.05; player attachTo [cursorTarget];standing = True ;},{private _intersects = lineIntersectsSurfaces [getPosASL ACE_player, getPosASL ACE_player vectorAdd [0, 0, 2], ACE_player];
(_intersects select {_x#2 isKindOf "UK3CB_BAF_Merlin_Base"}) isNotEqualTo []}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions"], myaction] call ace_interact_menu_fnc_addActionToObject;```
#

that?

little raptor
coral nest
#

sorry

little raptor
#

no need for CBA_fnc_targetEvent at all

coral nest
#
myaction = ['Attach','Stand Ready','',{private _direction = getDir player - getDir cursorTarget;[setDir [player, _direction], cursorTarget]; ace_hearing_disableVolumeUpdate = true; 0 fadeSound 0.05; player attachTo [cursorTarget];standing = True ;},{private _intersects = lineIntersectsSurfaces [getPosASL ACE_player, getPosASL ACE_player vectorAdd [0, 0, 2], ACE_player];
(_intersects select {_x#2 isKindOf "UK3CB_BAF_Merlin_Base"}) isNotEqualTo []}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions"], myaction] call ace_interact_menu_fnc_addActionToObject;```
little raptor
#

and don't spam the code in every message
just edit it

coral nest
#

im jus tryna make sure its like 100%

#

bc im now getting errors :(

#

generic error?

tough abyss
#

Hey guys, quick question. How would I stop a player on MP from sprinting and force Walking in a certain area?

coral nest
#

...

#

it was ai

#

the ai were flying the helicopter up and killing me

tough abyss
little raptor
tough abyss
#

i can still run etc in the trigger when i have this in it

little raptor
tough abyss
tough abyss
#

I have two objects in game called armoryGuy, armoryGuy2

Im trying to addAction both without making two lists of addactions in my Init.sqf file, However its not working. What am i doing wrong?

private arsenal = [armoryGuy, armoryGuy2];

arsenal addAction ["this is a test",""];
copper raven
#

private global assignment is invalid

little raptor
tough abyss
little raptor
tough abyss
#

ahhhh

#

thankyou

dreamy kestrel
#

Q: I am trying to load a prisoner into a transport cargo position. He is animated in an atease (cuffed) position. _unit moveInCargo _vehicle loads him, then he hops back out... ๐Ÿค•

#

do I need to perhaps switch their animation first?

dreamy kestrel
#

working out the bits of the commanding menu. I don't know what this is...

20:59:23 Item description - list of shortcuts expected as an item #2: ["Stop Unloading",9,"",-3,[["expression","[player, false] call KPLIB_fnc_captives_showUnloadTransportMenu"]],"1","1"].
20:59:23  - in user menu description 'KPLIB_captives_unloadTransportMenu', item #9: [["Unload...",false],["Unload Karim Zakhilwal",[2],"",-5,[["expression","[player, '35e96748ecf6b61858e726cadb283bc5'] call KPLIB_fnc_captives_onUnitUnloadOne"]],"1","1"],["Unload Akbar Ghafurzai",[3],"",-5,[["expression","[player, 'e988c18a1f1bfb297e282f3847c4a7a8'] call KPLIB_fnc_captives_onUnitUnloadOne"]],"1","1"],["Unload Hasan Khalili",[4],"",-5,[["expression","[player, 'ba27b4d877675b66c6c8b6983f0cc3e3'] call KPLIB_fnc_captives_onUnitUnloadOne"]],"1","1"],["Unload Haikal Noori",[5],"",-5,[["expression","[player, 'dee8f8f798ba114715a89ed39fb6ba69'] call KPLIB_fnc_captives_onUnitUnloadOne"]],"1","1"],["Unload Basharat Amin",[6],"",-5,[["expression","[player, 'dea8f74b11b58728a5a85ba99e09d357'] call KPLIB_fnc_captives_onUnitUnloadOne"]],"1","1"],["Unload Abdul-Qadir Siddiqi",[7],"",-5,[["expression","[player, '428443778f668aba8e72ee84b2d927d6'] call KPLIB_fnc_captives_onUnitUnloadOne"]],"1","1"],["Unload Akbar Anwari",[8],"",-5,[["
dreamy kestrel
#

also, it kinda works... but it is there a way to refresh the commanding menu without it going away on an "executed cmd" (?)

leaden haven
#

setobjectscale works sort of on dedicated server, but it spawned full size objects as well as the proper tiny ones. I was running the code locally? How do I fix this? Thanks.

dreamy kestrel
placid sequoia
placid sequoia
placid sequoia
fair drum
#

Wiki 502 Bad Gateway (โ•ฏยฐโ–กยฐ)โ•ฏ๏ธต โ”ปโ”โ”ป

upper gazelle
#

same ๐Ÿ˜”

fair drum
#

i should download the whole wiki for offline

red rune
#
thor addEventHandler ["Killed",
{

    _batt = "Land_Battery_F" createVehicle position thor;
    [thor,nil,true] spawn BIS_fnc_moduleLightning;


}];

Is my usage of position thor here correct? It doesn't create the object at the exact position

#

*sometimes it does

sharp grotto
#

_batt = createVehicle ["Land_Battery_F", position thor, [], 0, "CAN_COLLIDE"];

red rune
#

that spawns it about 20m in the air before it falls to the ground

fair drum
fair drum
red rune
#

alright, I'll have to wait until the wiki is back up, I'm new to this :P

#

thank you

fair drum
#

what is thor?

red rune
#

just a codename for an overcharged zombie that is now basically evil thor

fair drum
#

thats not what I asked. is thor an object? is its position off the terrain? etc etc

red rune
#

oh it's a unit

#

like

#

infantry unit

#

it is on the ground

fair drum
#

and you want to spawn this "battery" at its feet in front of him?

red rune
#

yes

fair drum
#

ill write something after this warthunder match

red rune
#

okay thank you

fair drum
red rune
#

going to use it on MP

#

but I am testing on SP

#

is that an issue?

fair drum
#

no, just changing the way i write it

red rune
#

ah ok

spark turret
#

how is it broken?

cosmic lichen
#

I think the biki was down tonight

hasty trout
#

how comes even with hotLZChance being 0 sometimes the createEnemySquads is called?

private _enemies = [];
private _lzhot = false;

if ((random 1) < hotLZChance) then
{
    _lzhot = true
};
private _lzAA = false;
if ((random 1) < AAChance) then
{
    _lzhot = true;
    _lzAA = true;
};
private _taskType = "meet";
if (_lzhot) then
{
    _taskType = "defend";
    _enemies = _enemies + ([_lzLocation, _lzAA] call createEnemySquads);
};
still forum
#

well if AAChance is not zero....
it sets lzhot to true

hasty trout
#

oh

#

yeah i see that now

#

thanks ded

#

would this solve it?

if (_lzhot = true) then
{
    if ((random 1) < AAChance) then
    {
        _lzhot = true;
        _lzAA = true;
    };
};
winter rose
#
if (_lzhot = true) then

// becomes
if (_lzhot == true) then

// or
if (_lzhot) then
hasty trout
#

ah

cosmic lichen
#

Don't even list the intermediate step ๐Ÿ˜„

#

just _lzhot, forget anything else

hasty trout
#

so would this solve it?

#
if (_lzhot) then
{
    if ((random 1) < AAChance) then
    {
        _lzAA = true;
    };
};
cosmic lichen
#

no need to set _lzhot to true again

hasty trout
#

true

coral nest
#

so ive finished my script, but i now want to put it into modformat. rn i just have a script designed to run on init.sqf, how do i go about putting this into a mod

glossy pine
#

Its there a easy way to copy the lists of a listbox to another listbox?

dreamy kestrel
dreamy kestrel
#

works famously

fair drum
#

why would I ever want to use the GVAR macro?

GVAR(frog) = 12;
// In SPON_FrogDancing component, equivalent to SPON_FrogDancing_frog = 12
#

like why not just use the normal variable system?

#

just trying to understand more about CBA macros and why they exist

austere granite
#

you having a whole bunch of modules made by different authors and making sure you're not using overlapping variable names

dreamy kestrel
#

or 'text as script' scenarios for that matter, conditions, callbacks and such

#

another rub is that, you are talking about source level #include "..." access. unless you have access to those modules' source code, probably a non-starter as well.

copper raven
dreamy kestrel
#

it's about trade offs. I think it can be a useful technique. however, you trade off readability traceability for flexibility, especially translating between logs and the source. are the gains better than the losses? I'd say 'it depends'.

#

if you spend a lot of time intra-module, then yes, it is probably worth it. if you spend time inter-module, meh, debatable. exercise discretion.

copper raven
#

i'd say that the code is more readable with the GVAR macros IMO, ofc if you understand the concept of CBA components/the structure of them

dreamy kestrel
#

yep, bit of a learning curve, that too. macros do not behave sometimes quite as 'expected', in languages with similar concepts.

#

I do happen to use that approach more frequently today, but like I said, the intra-versus-inter-module caveats all depend.

dreamy kestrel
#

Q: trying to understand, when I _unit moveInCargo _vehicle, that unit loads, then gets punted back out again. seems consistent for each unit in question, happens one time, it seems, one time only. I seem to be able to load them again without difficulty. also, it is curious that the vehicle 'remembers' the position in which a unit was loaded.

#

the hypothesis I currently have is whether it is a playMove or switchMove thing. they are loading from an 'atease' position, i.e. captured or zip tied. they punt back out in a weapon ready stance, no weapon of course, captives module having stripped them of backpacks, weapons, etc.

#

I tried I think setting the animation prior to loading, but does not seem to help at all.

coral nest
#

i have this in my config.cpp but its spitting out errors

#
class CfgFunctions {
    class HelicopterRappel {
        class AlexxCategory {
            class init {
                file = "\WHR\init.sqf";
                postInit = 1;
            };
        };
    };
};
#

path is addons>WHR>init.sqf

#

can anyone help?

dreamy kestrel
#

that does not help either. unit still gets punted out.

dreamy kestrel
#

another data point if it helps...
moveInCargo rejection does not seem to route events through any 'GetIn', 'GetInMan' or 'GetOut', 'GetOutMan' event channels either.
how do I know that, because I have a 'GetOutMan' event wired to the vehicle which re-animates player into the captured or zip tied position when that is correct.

little raptor
#

the best way to avoid this bug is to move the unit a second time (moveOut first, then move in)

dreamy kestrel
real tartan
#

any recommendation for editor with updated autocomplete/syntax for SQF ? I am using vscode + sqf language 2.0.3, but it seems not updated so considering to switch to something up to date

dreamy kestrel
real tartan
dreamy kestrel
#

I don't know of any. for most things it works pretty well, for core stuff it is okay, but there are a few oddities, and some recent niceties are not well supported if at all. it is OS, so fork it, perhaps?

dreamy kestrel
#

or perhaps a waitUntil { isNull objectParent _unit; } prior to the next one?

#

phew, seems awkward, but 'better'...

// _this: [_unit, _vehicle], provided by action menu event handler
_this spawn {
  params [
    ["_unit", objNull, [objNull]]
    , ["_vehicle", objNull, [objNull]]
  ];
  private _cargo = [_vehicle, "cargo", true] call KPLIB_fnc_core_getVehiclePositions;
  //                    include empty: ^^^^
  private _cargoIndex = _cargo findIf { isNull (_x#0); };
  if (_cargoIndex >= 0) then {
    _unit moveInCargo _vehicle;
    waitUntil { sleep 0.1; !isNull objectParent _unit; };
    moveOut _unit;
    waitUntil { sleep 0.1; isNull objectParent _unit; };
    _unit moveInCargo [_vehicle, _cargoIndex];
  };
};
#

are there better ways to handle that without the blinking or stuttering? disable sim on the unit perhaps?

austere hawk
#

have you tried to work with assignAsCargo stuff, before doing the moveIn?

dreamy kestrel
dreamy kestrel
austere hawk
#

No role assignment -> group commander defaults to ordering unit to getout immediately.

#

assignVehicle (or something i forgot) may also help - registering the vehicle in the group for usage

dreamy kestrel
#

the goal here being a reasonable facsimile loading and unloading captive units. they should not be operating autonomously by any stretch.

#

hmm, also, at least the reference code I have does not invoke assignVehicle, so the issue cannot be 'that', per se. or there is another workaround in store.

sonic linden
#

quick question about a door opening condition:

condition = "((this animationSourcePhase 'Door_1_sound_source') == 0) && ((this getVariable ['bis_disabled_Door_1', 0]) != 1) && (cameraOn isKindOf 'CAManBase')";```
i am not sure about the last part `(cameraOn isKindOf 'CAManBase')`
can AI open the door with this condition on it ?
winter rose
#

nope

#

but AI may not be using those actions, IDK

sonic linden
#

okay, so i am better off without it

civic locust
#

Okay so I have a bunch of backpacks from S&S modpack that are being treated by TFAR as long range radios, which shouldn't be. how does one go about fixing that?

finite imp
#

Hey guys ๐Ÿ™‚ Simple question. I want to trigger the "hide/show" module if players walk into several zones. Mainly as a safety net so no players can see certain vehicles spawning.

I've placed down a hide module to hide the objects at mission start, which is working fine and as intended.

I've placed a few triggers around the general area with the intention, if someone enters the trigger zone, the objects get "shown" and activate their simulation.
What I've placed into the triggers is this:

Condition: 
this

On Activation:
this setVariable ["convoy",true,false];

I've then placed another trigger (non-area) and synced it to the "show" module which un-hides the objects. Into the "show" trigger I've put this

Condition:
convoy;

But, alas, its not working. Probably a pretty simple mistake. Anyone know what it is? Thank you lots ๐Ÿ™‚

copper raven
#

you're assigning a variable into trigger's namespace, then trying to get it off of missionNameSpace

finite imp
silent prairie
#

Anyone know a simple script that attaches (sling loads) cargo to a AI helicopter from the gecko? The Sling Loading module is broken.

fair drum
#

gecko? boneappletea! Its "get go" lol.

copper raven
#

you can also give indices, i.e neis_convoy1...n and use them accordingly

finite imp
#

Or should the condition then just be "convoy;"

copper raven
#

no in that case, you just use convoy

finite imp
#

Alrighty! Thank you very much

copper raven
#

the trigger scope is missionNameSpace, what convoy=true; does is just missionNameSpace setVariable ["convoy", true], and statement convoy; gets the value, just like missionNameSpace getVariable "convoy", what you're doing right now with this setVariable ["convoy",true,false]; is setting convoy to true in trigger's namespace, then you run convoy;, but that variable is undefined in that namespace(because its missionNameSpace, not said trigger's)

finite imp
#

Alright. Got it. Thank you! ๐Ÿ™‚

potent depot
#

Anyone know of a way to get the classname of a group via script? Usual methods for units and vehicles dont appear to support groups.

copper raven
digital rover
#

A group once created has no relation to the class of the group config that it belonged to, it's now just a collection of units.

You could perhaps get an array of the units in the group then iterate over the entire groups config trying to match the arrays but that'd be sloooow

copper raven
#

you can create your own spawngroup function, and save a variable into group's namespace

#

the other method is what Sebster said

potent depot
#

Ok, yeah that pretty much aligns with what I assumed. Thank you both.

proper niche
#

Did you ever find an answer for this?

opal turret
#

Negative.

proper niche
#

damn, thanks for responding

opal turret
#

All good mate. If you ever find a solution let us know!

proper niche
#

will do

pulsar bluff
#

is calculatePath event handler still having the known double-execution bug?

#

For some unknown reason, the "PathCalculated" Event Handler is fired twice, first with calculated path and second with array consisting of 2 elements, which are identical and are equal to the end point. See Example 3 & 4 for a workaround.

pulsar bluff
#

with agent spawned manually we cannot adjust the behaviour profile

#

safe/aware/combat/stealth etc

little raptor
#

except give it a move order

pulsar bluff
#

:\

pulsar bluff
#

it could have been a useful command

#

the way its implemented is trash

lilac heath
#

Hi!!, I have a doubt.

#

If I am going to use an onEachFrame EH forcing it to execute only every X time. I shouldn't be using an on each frame but a while loop with a sleep, right?

winter rose
#

onEachFrame means what it says indeed

lilac heath
#

yep, but my question is more about what I should be using. I understand that the OnEachFrame does not make sense if then I am going to force it not to execute always, right?

winter rose
#

Correct

if the exact precise timer does not matter, loop + sleep

lilac heath
#

ok, thx

astral dawn
#

on the other hand, if you run a scheduled script with a loop which sleeps, just any scheduled script then scheduler can rip the execution of your spawned script

#

I'd prefer to do it with onEachFrame

spark turret
#

Also i would assume it causes less isssues when the game lags, if you use a framecall event dependent code instead of a constant loop

winter rose
#

every frame check
vs
loop + sleep?

hmm

pulsar bluff
#

per frame evaluation has higher cpu burden than less frequent eval (scheduled loop + sleep)

#

general principle is to evaluate/execute code as infrequently as possible while still getting the job done

#

per frame eval should just be another tool in the toolbox , right beside scheduled loops.

#

i think we got rid of the PFH religion here a few years ago

flint topaz
#

Okay so I am trying to make a song loop until all hostiles in the trigger area have been killed however im trying to ensure it won't reenable the loop when they are all dead as currently im testing with just a while {true } loop

little raptor
flint topaz
#

there will be units in other areas of the map

#

so i'd prefer to check the triggerLoop section (As well i presume it's more efficent)

#

but yeah that was the idea

little raptor
flint topaz
#

ohh sorry

#

Still learning this syntax used

#

can a findIf statement have 2 checks

#

alive & opfor for example

cosmic lichen
#

yes

cold pebble
#

Yea, using &&

flint topaz
#

just like java good to see

#

Is there any good documentation on this or is it mostly just learnt through others?

flint topaz
#

ahh thank you that top one if very useful

graceful pewter
#

Hi, can someone please tell me how to add a simple text overlay to an item that appears when the player approaches it? Just to be clear, I want the player to stand near something and the text to show.

#

thanks

little raptor
#

use a loop to detect when the player is close

graceful pewter
#

or maybe add a scrollwheel action that doesn't do anything?

little raptor
little raptor
#

if you want an action, just use an action

graceful pewter
#

I want an action that doesn't do anything (if that makes sense)

little raptor
#

it doesn't

graceful pewter
#

I just want the player to be able to read the info about the object: look at object, scroll down, read the text

#

what's the simplest way to do that?

#

(thanks for your help, btw)

little raptor
#

@graceful pewter Here's an example of what you can do with drawIcon3D

I guess this is not what you meant?

patent lava
#

change the text styling so it looks different from the other scroll wheel items

graceful pewter
little raptor
#

but some objects are still not possible

#

(iirc)

graceful pewter
#

no, it's a physical object (ie. a box)

#

do you know the script for adding the scroll option?

tough abyss
#

.. a very dumb question perhaps, but I'm trying to spawn an Ai in a mp enviroment, and I'm using this which is in a script

"B_RangeMaster_F" createUnit [setPos [26878.9,24296.8,0.780428], _groupAlpha];

But it keeps telling me missing ] although I would think its closed correctly..?

tough abyss
#

I'm taking my way with setpos ain't working?

little raptor
#

also you're using createUnit wrong

#

also don't use that syntax

little raptor
tough abyss
#

Thanks. And sorry for bothering

little raptor
warm iris
#

Heyo, wondering if anyone has a simple script going for pop-up targets, where they staydown (nonpop=false, already in init.sqf) where I can attach an action to an object to re-pop up the targets

wicked fulcrum
#

Is there a way to more easily see the hierarchy of item classes? Especially when other mods are included? Lets say I want to remove the radio from a unit. I can do

_unit unassignItem "ItemRadio";
_unit removeItems "ItemRadio";

However TFAR specific radios like "TFAR_anprc152_6" has to use their own name as they seemingly don't fall into the overall "ItemRadio" category. This seems to be the same with other items like laser designator and nightvision.

I am trying to see if there is a way to get the majority of the different variations without having to add the string of each single variation. I thought they would have some base-game class they were inheriting from I could target, but I can't seem to find if that is the case?

still forum
#

I am trying to see if there is a way to get the majority of the different variations without having to add the string of each single variation.
not really

little raptor
still forum
#

its probably easier to just check what items the player has, and then check if they inherit from the class you want

little raptor
#

otherwise, look at the item's slot info in config
if it's radio, remove/unassign

still forum
#

Pretty sure TFAR radios inherit from ItemRadio

wicked fulcrum
#

Yeah, what I feared Dedmen.

Yeah, might be the better way around to get unit loadout and check the items that way.

Dedmen, hmm, just tested it by doing _this unassignItem "ItemRadio"; on a unit with the TFAR 152 SR radio. Its still in the slot.

still forum
#

TFAR also iterates through all your items in your inventory

little raptor
wicked fulcrum
#

Cheers for the quick answer though! Helped me get ideas how to deal with it.

still forum
#

Dedmen, hmm, just tested it by doing _this unassignItem "ItemRadio";
unassignItem takes a classname

wicked fulcrum
#

oh

still forum
#

not a parent class of some item.

#

only one specific classnames that has to be an exact match

wicked fulcrum
#

faceplam

#

gotcha

wicked fulcrum
#

Thanks for the quick help btw! ๐Ÿ™‚

unreal scroll
#

Is findEmptyPosition broken?
I've preloaded the area with findEmptyPositionReady [0, 200] and trying to find an empty position:

_pos findEmptyPosition [50,200,_vehtype];

And it returns nothing for any area. If I decrease the radius to 25 and below, it works.

wicked fulcrum
#

Dedmen, question about TFAR. Do you remember of the top of your head if its possible to set a LR backpack to not work anymore? I know I can set variable on a unit to make it unable to use the radios, but I was interested in simulating disabling the current LR backpack worn by the unit. While still making it possible to find a new LR backpack and equipping which would then work.

Been looking through the TFAR functions, and I don't really see a way of "disabling" a LR on a per-radio basis. I thought about changing the LR radio-code to random value, so there would be no comms or simply replacing the LR backpack with a non-LR backpack as alternatives.

red rune
#

How can I delete a projectile a few seconds after it's been shot? (grenade out of a GL in this case)
I've been trying for a while, this doesn't seem to work (I'm pretty new to scripting)

{
_x addEventHandler ["Fired",
{
    private _projectile = (_this select 6);
    
    if (_projectile isEqualTo "F_HuntIR") then
    {
        _this spawn {
            sleep 2;
            deleteVehicle _projectile;
        };
    };
    
}];
} forEach allPlayers;

I don't think it even goes into the if statement

wicked fulcrum
#

Not sure if you can pass the _projectile as _this and have it inside the spawned execution like so. I would probably make sure to pass it.

        [_projectile] spawn {
            params ["_projectile"];
            sleep 2;
            deleteVehicle _projectile;
        };

If you are unsure if it gets into the if sentence, add a systemChat "inside if" or diag_log and check your .rpt file. Can be handy to see how far it comes. ๐Ÿ™‚

red rune
#

I checked using hint inside the if statement, it did not print out anything

#

so the current issue is that the if statement isnt working :c

#

double checked for spelling, tested another projectile

wicked fulcrum
#

checked it fires the eventhandler correctly? So it prints out your hint if you put it before the "if"? You could try to print out the _projectile before the if, to see if the event handler fires correctly and if the projectile is correctly given.

red rune
#

huh projectile name is different

#

"ace_m1070_armed.p3d"

#

I don't really get it. I used if (_projectile == ... in a HandleDamage EH and it worked fine.

wicked fulcrum
red rune
#

testing in a bit

#

_ammo does return F_HuntIR

#
{
_x addEventHandler ["Fired",
{
    private _ammo = (_this select 4);
    private _projectile = (_this select 6);
    
    if (_ammo == "F_HuntIR") then
    {
        [_projectile] spawn {
            params ["_projectile"];
            sleep 2;
            deleteVehicle _projectile;
        };
    };
    
}];
} forEach allPlayers;
#

this works

#

so in HandleDamage, _projectile is a string, in Fired, it's an object

#

and here I was trying to compare an object to a string, which obviously doesn't work :P

#

thanks for the help

brazen lagoon
#

anyone know of a standalone script like the antistasi vehicle spawner?

#

like, that will spawn a vehicle in and then let you move it around by having it attachto'd the player, and then spawn it for real once the player has selected a good location?

novel delta
#

bit of an odd question,

#

is there any way to turn a UAV turret into a enterable vehicle?

little raptor
#

as in making a player actually get in the turret seat?

pulsar bluff
#

huh?

#

Added: setServerEventHandler and getServerEventHandler script commands, as well as a serverNamespace script command

still forum
still forum
#

KK's, haven't looked into what they do

#

I think they are for the server.cfg eventhandlers like onHackedData

little raptor
#

oh. ok thanks

wicked fulcrum
bitter stone
#

I'm currently looking at implementing a system for aircraft crew (pilot/co-pilot only at this stage) whereby I'd like the pilot to be running a drawIcon3D command in a Draw3D Event Handler, drawing an icon based on where the co-pilot is looking, and continually updating until the co-pilot performs an action. I'm good for most of the script, but being the good little SysAdmin I am, I'm seeking advice on the best method to communicate that pos between co-pilot & pilot. Should the co-pilot just set a variable and the pilot client retrieves that variable? I don't particularly want to flood client bandwidth so looking for suggestions from those more learned than I. TIA.

astral dawn
#

I would check if arma already natively synchronizes where everyone is looking at first of all ๐Ÿค”

#

although I guess you need not direction but the position on the ground, right?

#

I think in that case it's fine to set variable on copilot periodically with a global flag, and use remoteExec to send 'events' from copilot to pilot when the copilot pushes the button or does something

bitter stone
#

Yeah, will need pos on ground (probably using worldToScreen on the co-pilot side).

astral dawn
#

although it would be quite a waste to setVariable publically on the copilot if only the pilot needs that data, in that case you can remoteExec something on pilot's machine directly I think

bitter stone
#

That's what I was thinking, and doing it say every 0.1 or 0.2sec or something like that. I don't particularly want to flood anyone's (or everyone's) connection. Am wondering what would be an acceptable rate.

astral dawn
bitter stone
#

Though it's just a pos array I'd transmit. Not like huge amounts of data. The pilot client would process the pos from there.

astral dawn
#

I don't remember how remoteExec works exactly, I think it sends data to server first, and then to the target machine?

little raptor
#

that way there's no need for remoteExec

bitter stone
little raptor
#

you can also use lineIntersectsSurfaces, but that one's slower and you probably don't care about the little diff anyway (since you're in the air)

#

ofc, if you don't scale the icon, you don't even need the intersect (drawIcon3D shows the icon the same size no matter how far it is from you, unless you manually scale the size)

bitter stone
#

Brilliant info, thanks so much @little raptor. Yeah not needing to draw the icon at scale, so reduces the calc slightly.

little raptor
#

yep

_p1 = eyePos _copilot;
_p2 = _p1 vectorAdd (getCameraViewDirection _copilot vectorMultiply 1000);
//drawIcon3D @ ASLtoAGL _p2
winter rose
#

camera to world 0.5, 0.5?

little raptor
winter rose
#

tru

#

but I wonder about getCameraViewDirection

little raptor
#

aG

winter rose
#

yes, for AI most likely

#

I don't know what kind of info is sync'ed for player units

little raptor
#

(at least it should be)

winter rose
#

eyeDirection maybe?

little raptor
#

I think it had some problem (I don't remember what it was)

winter rose
#

but yeah, I would kinda be wary about this player-controlled camera thing, test to be sure

(and btw if you get more knowledge, please share for the #community_wiki ofc ๐Ÿ˜‰)

astral dawn
#

@bitter stone Not many people know but you can launch two armas through launcher with different profiles, then use one as server and another one as client. Also make sure you use -nopause option which is also available through launcher. Then you can easily test how good everything works.

little raptor
#

@winter rose oh right I think it was the head's actual direction
As you know your head doesn't rotate after some point but you can still see behind you

#

That's why eyeDirection is not a suitable option

#

(that's just what I remember tho. I'll test when I launch the game)

bitter stone
#

@astral dawn thanks for the hint! I usually just use my laptop but was putting that off as I'd need to do a full Workshop download before I could start. Ugh!

astral dawn
#

If you decide to go with remote execution of code, a good optimization is to send update only when data has changed. Previous remoteExecs are guaranteed to arrive by the game.

bitter stone
hollow thistle
hollow thistle
#

It's quite new.

little raptor
#

but it uninstalls them doesn't it?

#

like the DLCs?

hollow thistle
#

Yeah, that's the point.

little raptor
#

I thought you could disable updating!

#

oh nice. it shows the size!

#

but it's wrong! ๐Ÿ˜„
it looks to be the download size; or maybe the one reported on the workshop

bitter stone
hollow thistle
#

Before that feature was introduced when I wanted to run arma on my ultrabook I've been manually downloading arma via steamkit/steamcmd :D

#

And mods too. That was annoying.

crude vigil
hollow thistle
#

yeah, here

crude vigil
#

It synchronizes across pcs when you unsubscribe ?

hollow thistle
#

no, it should not.

#

You do not unsubscribe here, you disable that certain item on that PC.

crude vigil
#

oh okay, so where do u exactly disable the item?

#

that part I missed ๐Ÿ˜…

hollow thistle
#

?

#

in the place you mentioned.

cosmic lichen
crude vigil
#

Define disabling here, you mean unticking right?

#

When I untick here, it syncs on my 2nd pc as well?

hollow thistle
crude vigil
hollow thistle
#

hmm, that sucks then. It was not doing that when I've been testing it for the first time on my notebook. Maybe it was too slow to send it ;d

#

I've not opened steam on it ever since.

crude vigil
#

I knew it was too good to be true. But still it is good to temporarily disable entries without forgetting which ones are there.

#

One day, hopefully we will have it too

pure blade
#

is there a way to increase the radioChannelCreate limit?

winter rose
#

no

cosmic lichen
#

You answered the question yourself. It's a limit

pure blade
#

there are also limits that you can change ^^

little raptor
#

but I'm wondering. why is it so small? ๐Ÿค”

winter rose
#

I'd assume reasons

ripe sapphire
#

yo bros what commands do you use to succesfully create AI convoy that moves in formation like the mission "Moral FIber" of the east wind campaign?

real tartan
#

how to check if class has no properties (empty class) in description.ext ?
note: I can't check for specific property, they can be different for each class

real tartan
austere granite
#

what are you trying to search for? ๐Ÿ˜„

winter rose
#

my answer remains yes ๐Ÿ˜„

real tartan
winter rose
#

no; that's not what you want.

What do you want to do with the other classes?

austere granite
#

count (configProperties [_root, "true", true]) == 0 probably, but still its unlikely this is what you actually should be doing ๐Ÿ˜„

real tartan
winter rose
#

ยฏ_(ใƒ„)_/ยฏ

fleet lotus
#

Hey guys, super newb here!

I would like to know if there's a log where I can see the events and triggers that happens during gameplay or after playing... is that possible? thanks for reading!

winter rose
#

not really!

fleet lotus
#

OK, thanks!

turbid zenith
#

Hey all, I have a mobile respawn point, but I would like for it to have a different respawn timer, is there any documentation/examples you can point me towards?
PS. I am noob at scripting, so a direct example would be nice, looked at this https://community.bistudio.com/wiki/setPlayerRespawnTime, but I have no clue how to actually implement it for a single respawn point.

wicked fulcrum
cosmic lichen
#

probably ag/eg

#

But not sure without testing

distant oyster
cosmic lichen
#

Also good idea to use the -debug parameter

#

Adds even more logging

wicked fulcrum
# cosmic lichen probably ag/eg

Fair R3vo. I'll work with that assumption and when I do later tests on dedicated server I'll see if it holds up. Thanks for the reply ๐Ÿ™‚

cosmic lichen
wicked fulcrum
#

ah, will do.

wind hedge
#

Any idea on why this creates the light but not the fire:

#
0 = this spawn { 
 private _pos = _this modelToWorld [0,0,0]; 
    private _light = "#lightpoint" createVehicleLocal _pos;  
    _light setLightDayLight true;  
    _light setLightColor [5, 2.5, 0];  
    _light setLightBrightness 0.05;  
    _light setLightAmbient [5, 2.5, 0];
    _light setLightAttenuation [3, 0, 0, 0.6]; private _fire = "#particlesource" createVehicleLocal _pos; _fire setParticleParams [ 
 ["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 10, 32], "", "Billboard", 
 0, 1, [0, 0, 0.25], [0, 0, 0.5], 1, 1, 0.9, 0.3, [1.5], 
 [[1,1,1, 0.0], [1,1,1, 0.3], [1,1,1, 0.0]], 
 [0.75], 0, 0, "", "", _fire, rad -45];
  }; _fire setParticleRandom [0.2, [1, 1, 0], [0.5, 0.5, 0], 0, 0.5, [0, 0, 0, 0], 0, 0]; 
_fire setDropInterval 0.03; ```
little raptor
wind hedge
fleet lotus
little raptor
distant oyster
wind hedge
astral dawn
cosmic lichen
wind hedge
#

The "Smoke" module on EDEN has a "wind effect" param, how do I access that for any other particle?

cosmic lichen
#

isn't it a particle parameter?

fleet lotus
wind hedge
cosmic lichen
#

Rubbing

#

Because that's what it does, it rubs against the wind ๐Ÿคฃ

wind hedge
cosmic lichen
#

The biki knows...

leaden haven
#

I wish Arma 3 had a menu for customizing airplane loadout in-game. GOM script is outdated and does not work. We really need an updated one.

kindred hamlet
#

Hi all,
Situation:
trying to get some vehicles to withstand more dmg e.g. taking less dmg from a missile.

Issue:
However when using the HandleDamage, if the vehicle gets hit by an ammo doing >1 (>100 %) dmg the vehicle is already destroyed before the event handler can be executed.

Is there any other way to set this up or increment the hit point on those certain vehicles?

little raptor
#

you're probably running some other mod that's interfering with your EH

kindred hamlet
copper raven
#

you can only have number, string or boolean in the array

#

rest doesn't work

ripe sapphire
#

yo bros what program do you need to open fsm?

warm hedge
#

Arma 3 Tools, FSM Editor

ripe sapphire
#

thank you pol

sacred slate
#

is there a download of all scripting commands for offline times?

warm hedge
#

For when BIKI's down?

copper raven
#

web archive maybe

warm hedge
#

supportInfo might helps you

copper raven
#

or that yeah

leaden haven
#

Use Visual Studio Code, it has contextual info about scripting commands when you hover over it when editing code. That will also help.

copper raven
#

most plugins are outdated though

crude needle
fair drum
#

@little raptor in your debug console's config viewer, is there a way to if I say, filter by "fire", to scroll through all config names containing "fire"? Instead of it just homing on the first one it finds?

fair drum
#

yeah

little raptor
#

did you type it into the top left search bar?

fair drum
#

yes, but it only goes to the first one it finds and I can't move to the next class name that contains fire such as "Land_Fire_%"

little raptor
#

oh right. I've fixed it. It's just not released yet
you can try the Config Search option instead. It's slower, but if you search in a specific class it'll be faster

what do you want to search? and where?

fair drum
#

thats just an example. just looking for a fast way to cycle through all the class names of what I would "think" a specific building would have in it without looking through all of the CUP documentation.

little raptor
fair drum
#

didn't realize there was the config search option, thats my bad for not looking through all the menus

little raptor
#

it's ok.
I think I explained in more detail in the PDF manual

sonic linden
#

hi, how can i open the Debug console in the main menu ?

little raptor
warm hedge
#

Why would you need to?

sonic linden
#

i wanted to find out how i can change the intro mission of the background in the main menu
there are some profNamespaceVars like tanoa_intro1_reloads_false 0

warm hedge
#

Just look at CfgMissions

#

And/or CfgWorlds

#

There's no point to open in the main menu whatever

sonic linden
#

i want to change the preview of the editor button background image

cosmic lichen
sonic linden
#

i already set this up and when ever i was first playing the map and go back to main menu it shows up but my goal would be that it shows up at the first game start

#

is change -world= launch param the only way ?

warm hedge
#

Or maybe modify the script whatever doing main menu controlling things

graceful pewter
past gazelle
#

I'm working on a single player(no squad) ALiVE mission which takes place at the same time as Game Over does in the story plot. I was thinking it'd be cool to have a mission where you can go anywhere on the map, pulling maps off dead solders for intel, and collecting chemlights as a proof-of-kill token. Thus I'd need a script to remove chemlights from bodies that aren't killed by the player and one that 'takes maps placed in box and counts them...'

Are there any scripts like this already made?

#

Also, looting objects from NATO dead NATO forces gets you shot, as does wearing CSAT uniforms, etc...keeping the player from abusing equipment...

winter rose
#

addAction, removeMagazine, etc ๐Ÿ™‚

past gazelle
#

I'd have to enter that per every soldier though?

winter rose
#

you could, but you can script that for existing/created units

little raptor
past gazelle
#

Can you URL an example? I've done C coding, I'm just not sure how to do a check on...bodies I guess...

#

Also I kinda wanna do it right and not run something that's gonna kill Arma's state engine...

cosmic lichen
#
units east apply 
{
  _x addAction
  [
      "title",
      {
          params ["_target", "_caller", "_actionId", "_arguments"];
      },
      nil,
      1.5,
      true,
      true,
      "",
      "true", // _target, _this, _originalTarget
      50,
      false,
      "",
      ""
  ];
};
little raptor
cosmic lichen
#

This one gets me every time

cosmic lichen
little raptor
#

I mean there isn't any "pre-dead" bodies right?

#

if there isn't, you can just use a killed event handler

#

one that 'takes maps placed in box and counts them...'
so you "collect" maps and put them into a box?

#

Are there any scripts like this already made?
I don't crawl the internet for scripts so idk, but what you asked is pretty easy to make if you know any sqf

cosmic lichen
#

Yeah, good thing to get started with sqf.

past gazelle
#

Maybe it'd be easier to remove all chemlights/maps and add them back on player-kill?

#

Actually..yeah ok, I'll just look for a friendly-fire end mission script and start with that...

#

Maybe rather than chemlights I could change it to dogtags/military IDs...I'm not military but I'm guessing that would have value to intelligence ops...

past gazelle
#

oh, "don't bury the survivors?" ๐Ÿ™‚

#

Ahh I see, yeah it would be a killed event handler...

red rune
#

I wanna play a sound and attach it to an infantry unit. Which sound command do I use?

#

I tried playSound3D but the sound stays at the initial position, can't seem to make it follow the unit

cosmic lichen
#

Did you try say3D?

red rune
#

Trying it right now, sound isn't playing

#

Do file directories not work?

#
_this say3D "RAS\environment\RAS_ancients.ogg";
austere hawk
#

how do you script a waypoint of "join" / "getin" type properly - sure you can setWaypointType, but how do you set the join/getin target to a group/vehicle?

red rune
#

Can I not do it during the mission by executing a code with Zeus Enhanced?

red rune
#

ye I tried that, but I can't attach it to an object

#

won't change its position

distant oyster
#

ah I should read all messages

red rune
#

:P

#

I could use the zeus play sound module and attach that to the object, but unfortunately the sound file itself is low volume.

distant oyster
#

and description.ext is out of question completely? because that seems like the only less complicated option

red rune
#

Not the owner of the server :P

distant oyster
#

then how do you have access to the sound file?

red rune
#

I unpacked the mod folder and found the directory

distant oyster
#

there could be a sound class defined in the global sounds config. try the config viewer and look in CfgSounds for the filename

#

configFile >> "CfgSounds"

#

anyway gotta go for a few hours. good luck and maybe someone else can help you further :)

red rune
#

Thanks ๐Ÿ‘‹

somber radish
#

Can someone tell me why this works?

Tally_Fnc_CheckDir = {
/* this function checks the relation of direction between an object (_Attached_OBJ) that is attached to another (_Anker_OBJ)*/

Params ["_Attached_OBJ", "_Anker_OBJ", "_TargetDir"];
_Attached_OBJ setDir _TargetDir;
Private _ReturnValue = false;
Private _CurrentDir = ((floor GetDir _Attached_OBJ) - (floor GetDir _Anker_OBJ));
private _DirLow   = (_TargetDir -5);
private _DirHigh  = (_TargetDir +5);

if (_CurrentDir < -1) then {_CurrentDir = ((_CurrentDir - _CurrentDir) - _CurrentDir)}; // why on earth this works I have no idea, but it inverts the number in sqf?????

if     ((_CurrentDir == _TargetDir) or
    ((_CurrentDir > _DirLow) && (_CurrentDir < _DirHigh)))
    
then {_ReturnValue = true};


_ReturnValue};

I am particularly refering to the algorythm that inverts the number

_CurrentDir = ((_CurrentDir - _CurrentDir) - _CurrentDir)
#

((-180) - 180) - 180 = -540

#

but in SQF I get 180

#

WHYYYY?

little raptor
#

-180 - -180 - -180

somber radish
#

oooh

#

lol

#

๐Ÿคฃ ๐Ÿคฆโ€โ™‚๏ธ

little raptor
somber radish
#

((-90) - (-90)) - 90 = 90?

little raptor
somber radish
#

So when u attach an object in mp

#

it doesnt always fire

#

so to check that it actually has done what it was told to

#

and set the dir

#

I wanted

#

I use this to check if the dir is the wanted dir

#

however

little raptor
somber radish
#

sometimes the dir returns negative

#

which is why I neded an invert fnc

somber radish
little raptor
somber radish
#

% operator?

#

ah

#

precentage of

little raptor
#

modulus

little raptor
little raptor
#

also the wiki does say that

somber radish
#

I do

#

But MP its buggy / laggy when dealing with an attached object

little raptor
#

Multiplayer:
use _attachedObj setPosASL getPosASL _attachedObj after setDir to synchronise set direction over the network

somber radish
#
{
params ["_Object", "_Elevation"];
_Object setpos [(getpos _Object select 0),
                (getpos _Object select 1),
                _Elevation]}
little raptor
#

I mean not "wrong wrong".
it'll work.
but it's slow

#

you can do it faster:

_pos = getPosASL _object;
_pos set [2, _elevation];
_object setPos _pos;

(I don't recommend using setPos/getPos tho; unless you actually know why you're using them)

somber radish
#

oh ok

tribal onyx
#

I'm trying to wrap my head around remoteExec.
So, let's say this is the normal command

[side _buyer, "Base"] sideChat _msgString;

what would that command look like with remoteExec?

little raptor
#

(2nd message from the top)

hot kernel
#

how to determine who used a radio trigger?

somber radish
little raptor
hot kernel
#

it does not, empty array

#

technically only a player can use the radio trigger, so just use player?

little raptor
hot kernel
#

otherwise if thislist is empty, the answer is "NO"? ๐Ÿ˜„

little raptor
little raptor
tribal onyx
little raptor
# tribal onyx Yeah thanks, I got it to work based on that sticky ๐Ÿ‘ So you added at the end a...

Is this to reduce network load?
well in this case the code doesn't have much of an impact.
the server is dedicated so it can't display the message to anyone. so there's no point in executing the code on the server too.
if dedicated it would be called once on ever player, and on the server which again would call it a second time on every player?
no, it would execute for everyone once. (including the server)

tribal onyx
#

I haven't delved into headless clients since I thus far didn't have need for them. But I wonder using this example, would this still technically display the message to headless clients?

little raptor
#

I don't know of a good way to avoid running on the headless clients.
but you can just make a function and remote exec that. the function should start like:

if (!hasInterface) exitWith {}; //dedicated; or headless
manic radish
#

how do you start a keyframe animation when a condition is met?

little raptor
#

you could probably recreate the keyframe modules using a script when the "condition is met"

manic radish
thorn saffron
#

Is it possible to get the AI to seek cover using scripts? Like easily, rather than scripting it from ground up. The danger combat mode is not all that good for that

unreal scroll
#

"Is it possible to get the AI to seek cover using scripts?"
If it is all about cover where an AI can fire back - depends on your find cover algorithm. If you have a good one, then use it to move AI units to needed positions. Otherwise it is better not to touch AI, and only to help it - like using smoke.
If it is about just finding a cover, like when artillery incoming, then it is easy enough to move units to building position. Or, if you have a good algorithm from the very first case - use it ๐Ÿ™‚
I don't know such algorithms, and even it is, it should be very resource hungry and buggy.

From my own large experience in making sp/coop modes, with very limited AI options: you don't really need a very complex AI to create good interesting missions. The player experience is very subjective, he almost never examine an AI behaviour for a long time.
For example, if you need enemy units to react adequately on shelling their base, let them to get to cover, to smoke their position, and fire back at you. Even the AI can't actually spot you, you can always be reveal by script - this is what I use. Then make them to attack you position under cover of artillery. Yes, it is not so easy to implement such behaviour tree, but for complex missions it is the only way for you to be sure it works as intended.

thorn saffron
#

I wish we could trigger orders via scripts. The "Take Cover" order is pretty much exactly what I'm looking for, but for some odd reason we cannot call whatever function that order triggers.

winter rose
unreal scroll
#

@thorn saffron
Actually modders can do it.
For example, I took ACE script and reworked it for my garrison units:
https://youtu.be/RztmiJ7dPbU

thorn saffron
#

Like easily, rather than scripting it from ground up.

unreal scroll
#

It is always better to script it "from ground up" ๐Ÿ™‚
Like, authors don't even know, how it should work for you.
As for me, key questions was:

  • For which units it should be used? How about units that are far away from you? I'm using radio control for AI, so they need to be in range.
  • In what conditions they need to move to cover? It is not the best idea to move them during the intensive firefight.
  • Where to look for cover exactly? If those are buildings - of which type it should be? It is not good to "take cover" in tents or on watch towers ๐Ÿ™‚
  • When they should leave it, with what conditions?
    And so.
manic radish
finite imp
#

Heyho ๐Ÿ™‚
I'm trying to implement a trigger in my mission that fires only if a certain amount of players are inside the trigger field. Because I can only test it myself, I dont know if the trigger works.

My Condition inside the trigger is

count allPlayers > 15;

Does this work? Just a heads up, cannot test it myself

manic radish
#

count allplayers will give the total number of players on the server

#

I think this might work

count (allplayers in this) > 15;
finite imp
manic radish
finite imp
manic radish
#

my version

#

your version will activate the moment there are more than 15 players on the server

finite imp
#

ah, nice.