#arma3_scripting

1 messages Β· Page 554 of 1

covert inlet
#

Its scripting 🀷 it works if you do it right
I stopped doing it this way ages ago and just did it via a crates mod and BAF logistics
its's ACE_bloodIV_500 btw

empty tartan
#

is there a version of countSide allPlayers that counts player that are waiting to be revived too. Because their side is set to CIV?

tough abyss
#

count civ side?

empty tartan
#

if I need all Players on WEST side, also those who are waiting to be revived?

frozen knoll
#

@empty tartan have you tried playersNumber ... it counts slots selected per side

empty tartan
#

ah thanks

#

also i think i could have used side group _player, because the group stays WEST. (could not have used playerSide, because this happens on the server)

frozen knoll
#

πŸ‘

rough dagger
#

Hi, I am trying to build an MP slingloading mission. I am trying to track when a certain box is being slingloaded by the player's heli, but not having much luck. This is what I am using:

#
    vehicle player addEventHandler ["ropeAttach", {
        params ["_object1", "_rope", "_object2"];
        if (_object2 == "C_IDAP_supplyCrate_F") then {
            systemChat "attached";
            testSling = true;
        };
winter rose
#

typeOf

rough dagger
#

ah ..

#

I will try that .. thank you

spice axle
#

If I want to add a scripted helicopter waypoint to land somethere, what do I need to do?

I tried

private _wp1 = super_31 addWaypoint [getPos helipad_1, -1];
    _wp1 setWaypointScript "A3\functions_f\waypoints\fn_wpLand.sqf";

But this results in a hover over the landing zone

winter rose
#

setWaypointType "LAND" @spice axle

spice axle
#

It will not work, as the setType results in no movement of the helicopter

tame lion
#

how can I get a units individual group member ID? Ex: Alpha 1-1:2, the second unit in the group would return that as a string.

winter rose
#

then create another MOVE waypoint before

spice axle
#

I found a for me better working method but thanks

swift merlin
#

I want the player to walk along a path like in this intro where they can control the head but I control the speed they move at

#

I already have triggers set up for the voices to play (im going to play it as a radio transmission not a second ai moving with the player)

#

Basically i have someone briefing the player via custom audio that plays and I want to ensure that the PC doesnt move too fast and trigger additional voices before the first one finishes

mint kraken
#

I am getting an error, not sure what I am doing wrong

disableSerialization;
params [
["_mode", "Initialize", ["Initi>
 2:40:40   Error position: <params [
["_mode", "Initialize", ["Initi>
 2:40:40   Error Params: Type Nothing, expected Array
 2:40:40 File modules\nemesis\scripts\fn_camera.sqf [Sandbox_nemesis_fnc_camera], line 148

disableSerialization;
params [
    ["_mode", "Initialize", ["Initialize"]],
    ["_params", [], [[]]]
];
still forum
#

the second argument you passed when calling fn_camera, was not an array

#

it was nil

mint kraken
#

oh ok, will check it out. Thanks!

warm iris
#

Does anybody know of a script that exists (or how I would create such) in which I can have a random unit (nonplayer) stood there, where you can load preset loadouts from such unit on the scroll/interaction menu.

still forum
#

tons of these exists

#

you can create one by just clicking "export" button in arsenal

warm iris
#

Really? I cant particularly find the keywords to find such

tough abyss
#

["open", true] call bis_fnc_arsenal

warm iris
#

Thats for arsenal. I'm moreso looking for the following as a thing:

"Get Rifleman" -> Loads a preset Rifleman Loadout without going into Arsenal. Just insta give

still forum
#

yes

#

you can export a script from arsenal using the export button

#

which will do that

warm iris
#

Okay, so how would I attach that in script to a unit?

still forum
#

for that

#

just need to let it execute a script file

warm iris
#

Okay I shall give it a go

spiral zealot
#
clearItemCargo this; 
clearMagazineCargo this; 
clearBackpackCargo this;

this addWeaponCargoGlobal["rhs_weap_aks74u", 2];
this addWeaponCargoGlobal["rhs_weap_rpg7", 1];

this addMagazineCargoGlobal["rhs_30Rnd_545x39_7N6M_AK", 40];
this addMagazineCargoGlobal["rhs_rpg7_PG7VL_mag", 6];
this addMagazineCargoGlobal["rhs_rpg7_OG7V_mag", 3];
this addMagazineCargoGlobal["rhs_100Rnd_762x54mmR_7N26", 5];
this addMagazineCargoGlobal["rhs_10Rnd_762x54mmR_7N14", 15];
this addMagazineCargoGlobal["rhs_mag_9x18_8_57N181S", 20];
this addMagazineCargoGlobal["rhssaf_mag_brd_m83_white", 10];
this addMagazineCargoGlobal["rhs_mag_rgn", 10];

this addItemCargoGlobal["ACE_fieldDressing", 30];
this addItemCargoGlobal["ACE_elasticBandage", 30];
this addItemCargoGlobal["ACE_quikclot", 30];
this addItemCargo["ACE_packingBandage", 30];
this addItemCargoGlobal["ACE_epinephrine", 30];
this addItemCargoGlobal["ACE_morphine", 30];
this addItemCargoGlobal["ACE_adenosine", 15];
this addItemCargoGlobal["ACE_atropine", 15];
this addItemCargoGlobal["ACE_bloodIV", 10];
this addItemCargoGlobal["ACE_bloodIV_500", 15];
this addItemCargoGlobal["ACE_bloodIV_250", 15];
this addItemCargoGlobal["ACE_tourniquet", 10];
this addItemCargoGlobal["ACE_personalAidKit", 2];
this addItemCargoGlobal["ACE_surgicalKit", 2];
this addItemCargoGlobal["adv_aceCPR_AED", 1];
this addItemCargoGlobal["ACE_Canteen", 20];
this addItemCargoGlobal["ACE_MRE_BeefStew", 20];
this addItemCargoGlobal["ACE_EntrenchingTool", 1];
this addItemCargoGlobal["ACE_bodyBag", 10];
this addItemCargoGlobal["ACE_wirecutter", 1];
this addItemCargoGlobal["ACE_SpottingScope", 1];
this addItemCargoGlobal["ToolKit", 1];```

this is my inventory script for my vehicle, and it works fine, but it duplicates whenever someone joins the server.
#

so 10 bandages turn to 50 when 4 people join my server

#

i have no idea why this is happeing, and i want the amount to remain fixed to what i set it to be. any solutions?

random crescent
#

The init box gets executed for every player. Wrap it in a if (isServer) then { ... }

spiral zealot
#

i dont understand, could you please dumb it down for me?

#
{
clearWeaponCargo this; 
clearItemCargo this; 
clearMagazineCargo this; 
clearBackpackCargo this;

this addWeaponCargo["rhs_weap_aks74u", 2];
this addWeaponCargo["rhs_weap_rpg7", 1];

this addMagazineCargo["rhs_30Rnd_545x39_7N6M_AK", 40];
this addMagazineCargo["rhs_rpg7_PG7VL_mag", 6];
this addMagazineCargo["rhs_rpg7_OG7V_mag", 3];
this addMagazineCargo["rhs_100Rnd_762x54mmR_7N26", 5];
this addMagazineCargo["rhs_10Rnd_762x54mmR_7N14", 15];
this addMagazineCargo["rhs_mag_9x18_8_57N181S", 20];
this addMagazineCargo["rhssaf_mag_brd_m83_white", 10];
this addMagazineCargo["rhs_mag_rgn", 10];

this addItemCargo["ACE_fieldDressing", 30];
this addItemCargo["ACE_elasticBandage", 30];
this addItemCargo["ACE_quikclot", 30];
this addItemCargo["ACE_packingBandage", 30];
this addItemCargo["ACE_epinephrine", 30];
this addItemCargo["ACE_morphine", 30];
this addItemCargo["ACE_adenosine", 15];
this addItemCargo["ACE_atropine", 15];
this addItemCargo["ACE_bloodIV", 10];
this addItemCargo["ACE_bloodIV_500", 15];
this addItemCargo["ACE_bloodIV_250", 15];
this addItemCargo["ACE_tourniquet", 10];
this addItemCargo["ACE_personalAidKit", 2];
this addItemCargo["ACE_surgicalKit", 2];
this addItemCargo["adv_aceCPR_AED", 1];
this addItemCargo["ACE_Canteen", 20];
this addItemCargo["ACE_MRE_BeefStew", 20];
this addItemCargo["ACE_EntrenchingTool", 1];
this addItemCargo["ACE_bodyBag", 10];
this addItemCargo["ACE_wirecutter", 1];
this addItemCargo["ACE_SpottingScope", 1];
this addItemCargo["ToolKit", 1];
}```
#

this isnt working

still forum
#

Sure that isn't working

#

thats also not what he told you to do

hollow thistle
#

Syntax error

still forum
#

Can't just leave away part of the solution you're given and then expect it to still work

spiral zealot
#

oh, im missing then

#

now only the host (me) can see whats inside

#

everyone else is complaining that the inv is empty

random crescent
#

addItemCargoGlobal

tough abyss
#

No wrap it in if (local this) then {...}

high marsh
#

Why? Is the inventory updated for every unit?

tough abyss
#

what?

high marsh
#

What's the cost for using the global variant

tough abyss
#

~ $300

austere granite
#

#350

hot kernel
#

how do I say,

[1,2,3] select any;
or
[1,2,3] select all;
ruby breach
#

And what do you mean "all"? Just use the array?

hot kernel
#

no, that's what I mean! perfect thanks!

tough abyss
#

[1,2,3] select all;

[1,2,3] select [0, 3]
#

Best way to keep the time set as the same over and over again? (Want it to keep it day).
This is what I have so far:

fn_time.sqf:

while {true} do {
sleep 5;
skipTime 1;
sleep 5;
_date = date;
_date set [3, (_date select 3) - 1];
setDate _date;

sleep 20;
};

executed on the server. Thanks in advance!

#

why?

#

Don't want night time

#

Doesn't that just accelerate the time? I don't want it to get to night time at all

#

it is a multiplier

#

you can make 1 hour last as 10 hours

#

or 10 hours as 1 hour

#

how long your server is up

#

It could even be 24/7

#

no arma server runs for this long

#

you will need to restart eventually

#

It's not exactly my server so idk when it restarts, I could ask tho.

#

but if you slow your time 10 times, this is what 0.1 multiplier will do, you can run 240/7

#

that should be more than enough, thank you

hot kernel
#

@still forum , any comments, concerns or scathing indictments?

east_grp =["O_soldier_AR_f","O_soldier_AR_f","O_soldier_AT_f","O_heavyGunner_f","O_soldier_AT_f"];
west_grp =["B_soldier_AR_f","B_soldier_AR_f","B_soldier_AT_f","B_heavyGunner_f","B_soldier_AT_f"];

Destination=[baseMark1, baseMARK1, baseMARK2, baseMark3];


MMF_fnc_soldiers=
{
params ["_spawnLOC", "_spawnNUM", "_spawnSide", "_typeUnit", "_spawnState", "_goTo", "_applyIR"];

_grpCount = _spawnSide countSide allUnits;
if (_grpCount <20) exitWith {
new_grp =[ getPos _spawnLOC, _spawnSIDE, _typeUnit, [],[],[],[],[_spawnNUM, 0],180] call BIS_fnc_spawnGroup;
    lead_grp=leader new_grp;
    new_grp setBehaviour _spawnState;
    new_grp allowFleeing 0;
    new_grp deleteGroupWhenEmpty true;
    _wp = new_grp addWaypoint [(getPos _goTo), 0];
    _wp setWaypointType "hold";
if (applyIR==1 && _spawnSide==WEST) exitWith {{ IRLight = "NVG_TargetC" createVehicle [0,0,0]; _x removeMagazine "B_IR_Grenade";
    IRLight attachTo [_x, [0,-0.03,0.07], "LeftShoulder"];} forEach units new_grp;};
    };
};

[baseMARK1, 1, WEST, west_grp, "SAFE", Destination select 1, 1] call MMF_fnc_soldiers;

Otherwise how am I gonna keep track of and delete all those IR lights when the unit dies?

still forum
#

you are using global variables in places where you REALLY should use local variables

#

also please fix your indentation. there is a forEach and I have no idea where it starts its a total mess

#

and why do you use applyIR global variable, while you have a _applyIR local variable?

#

for removing the IR lights, maybe setVariable onto the unit, and add a killed eventhandler

hot kernel
#

@still forum , "places where you REALLY should use local variables" may I have an example?

random crescent
#

new_grp for example. do you really want to know what was in that variable after you called that function?

hot kernel
#

oh, okay, yes I probably do in many cases

#

need the name

#

in the mission script the group would often (but not always) receive a new name for later reference

random crescent
#

whatt about IRLight

hot kernel
#

it only needs to be deleted

random crescent
#

you create a light for every unit

#

why do you need that in a global variable

hot kernel
#

it isn't supposed to be global, I've edited it now

#

that was a mistake

random crescent
#

for new_grp, you should return the group instead if you want to keep it. that would be a lot cleaner.

still forum
#

oh, okay, yes I probably do in many cases
I assume you'll spawn more than one group, in which case new_grp gets overwritten

hot kernel
#

yes, I know that, I can name new_group after creation to something else if neccessary

still forum
#

then use a local variable and do the same with that?

#

if you are in scheduled and maybe spawn multiple groups at once, the variables might overwrite eachother while the script runs

#

which is total nonsense

hot kernel
#

so the mission script is scheduled but the scripts are not

#

my mission script is a bunch of calls

still forum
#

_grpCount should have private keyword
_wp too
lead_grp you don't use that variable in your code

hot kernel
#

that's to select the leader in the mission script

#

here's an example of the old mission script, I plan to replace the single calls with array calls (using params like we discussed)

if (scene_Type==5) exitWith {

    if (scene_State==1) exitWith {

        currentMARK=baseMARK1;
        player call MMF_fnc_stripITEMS;
        playIntro=3;
        []spawn MMF_fnc_intro;
        spawnState=0;
        spawnNUM=4;
        baseMARK1 call MMF_fnc_soldierWEST;
        baseMARK1 call MMF_fnc_coverTRAP;
        baseMARK2 call MMF_fnc_soldierEAST;
        baseAREA2 call MMF_fnc_soldierEAST;
        scene_state=2;
sleep 1;
        systemChat "Defend the Base!";
sleep 4;
        systemChat "WAVE 1 INCOMING";
        waveNUM=1;
        };
still forum
#

you are mixing global and local variables together which looks like you might've made a mistake. Which you actually did with "applyIR"
I'd say split them apart, use local variables. And just explicitly set the global at the end, so that its clearly visible that its intended

hot kernel
#

yeah, applyIR was a mistake, I fixed that.

#

so at the end newGroup=_grp?

still forum
#

ye

#

maybe also add a comment explaining what its for. In case you come back to your script in 2 years

hot kernel
#

this script will come with documentation

#

better?

MMF_fnc_soldiers=
{
params ["_spawnLOC", "_spawnNUM", "_spawnSide", "_typeUnit", "_spawnState", "_goTo", "_applyIR"];

private _grpCount = _spawnSide countSide allUnits;
    if (_grpCount <20) exitWith {

       _grp =[ getPos _spawnLOC, _spawnSIDE, _typeUnit, [],[],[],[],[_spawnNUM, 0],180] call BIS_fnc_spawnGroup;
        _grp setBehaviour _spawnState;
        _grp allowFleeing 0;
        _grp deleteGroupWhenEmpty true;
        private _wp = _grp addWaypoint [(getPos _goTo), 0];
         _wp setWaypointType "HOLD";
        newGroup=_grp;
        leadGroup=leader new_grp;
        if (_applyIR==1 && _spawnSide==WEST) exitWith {
            { IRLight = "NVG_TargetC" createVehicle [0,0,0]; _x removeMagazine "B_IR_Grenade";
    IRLight attachTo [_x, [0,-0.03,0.07], "LeftShoulder"];} forEach units _grp;
        };
    };
};

This way I can say something like,

waitUntil {!alive leadGroup}; call bis_fnc_endmission;
still forum
#
MMF_fnc_soldiers=
{
    params ["_spawnLOC", "_spawnNUM", "_spawnSide", "_typeUnit", "_spawnState", "_goTo", "_applyIR"];

    private _grpCount = _spawnSide countSide allUnits;
    if (_grpCount <20) exitWith {
        private _grp = [getPos _spawnLOC, _spawnSIDE, _typeUnit, [], [], [], [], [_spawnNUM, 0], 180] call BIS_fnc_spawnGroup;
        _grp setBehaviour _spawnState;
        _grp allowFleeing 0;
        _grp deleteGroupWhenEmpty true;
        private _wp = _grp addWaypoint [(getPos _goTo), 0];
        private _wp setWaypointType "hold";
        newGroup = _grp;
        leadGroup = leader _grp;
        if (_applyIR==1 && _spawnSide==WEST) then {
            {
                _IRLight = "NVG_TargetC" createVehicle [0,0,0];
                _x removeMagazine "B_IR_Grenade";
                _IRLight attachTo [_x, [0,-0.03,0.07], "LeftShoulder"];
            } forEach units _grp;
        };
    };
};

yes

hot kernel
#

@still forum Thanks for your help

MMF_fnc_soldiers=
{
params ["_spawnLOC", "_spawnNUM", "_spawnSide", "_typeUnit", "_spawnState", "_goTo", "_applyIR"];

private _grpCount = _spawnSide countSide allUnits;
    if (_grpCount <20) exitWith {

       _grp =[ getPos _spawnLOC, _spawnSIDE, _typeUnit, [],[],[],[],[_spawnNUM, 0],180] call BIS_fnc_spawnGroup;
        _grp setBehaviour _spawnState;
        _grp allowFleeing 0;
        _grp deleteGroupWhenEmpty true;
        private _wp = _grp addWaypoint [(getPos _goTo), 0];
         _wp setWaypointType "HOLD";
        newGroup=_grp;
        leadGroup=leader new_grp;
        if (_applyIR==1 && _spawnSide==WEST) exitWith {
            { 
                       IRLight = "NVG_TargetC" createVehicle [0,0,0];
             _x removeMagazine "B_IR_Grenade";
            IRLight attachTo [_x, [0,-0.03,0.07], "LeftShoulder"];
            } forEach units _grp;
        };
    };
};
still forum
#

you just ignored all the minor corrections I posted πŸ€”

strong shard
#

how to disable auto-ejection of players from vehicle which will explode soon?

#

allowCrewInImmobile - not work, disableAI - not work, behavior - not work, only agents works?

still forum
#

running any mods?

strong shard
#

no, vanila

#

blufor apc - marshal

#

setHitPointDamage ["hithull", 1] -> all players will disembark, except agents

young current
#

set them unconscious

strong shard
#

player must be able to disembark manually (press V, or eject action)

#

need to disable this "auto-eject" behavior

young current
#

are they in a group?

strong shard
#

one-man group

young current
#

Not sure if you can disable it

#

I mean when you desrtroy the vehicle with set damage 1 there is no more places to sit

strong shard
#

it has sits, and i can even GetIn to this vehicle before its explode

#

this behavior does not work on agents, but it requires too many additional scripts (Inventory, Actions and etc)

young current
#

agents are simpler things, they have no behaviour if I remember right

#

so just to make sure

#

you are talking about player characters, not AI controlled characters?

strong shard
#

yes, about players, but this behavior also works on AI with disableAI "ALL"

young current
#

what purpose is this for?

#

I mean what is it that you want to happen exactly?

strong shard
#

when vehicle takes a lot of damage enough to explode, players should not "auto-eject", because explode happen with delay and players can run away

#

but they should be able to do it manually

young current
#

is the driver player?

strong shard
#

no matter, player can be driver, gunner, commander or in cargo

covert inlet
#

Is that even a vanilla behaviour for players.... it is for AI but player?
Unless it's something ACE disables

strong shard
#

yes its works on any unit (AI and player on AI) except agent

young current
#

are you absolutely sure @strong shard that you got no mods on

#

if I set marshal to setdamage 1 it just explodes

#

instantly

strong shard
#

setHitPointDamage ["hithull", 1]

young current
#

alright that works. and seems like its automated command as you said

#

so likely you cant alter this behaviour

#

its likely somewhere in the behaviour FSM

strong shard
#

ok, thanks, will try to transfer players to agents

winter rose
#

unless you lock the vehicle, or maybe setUnloadInCombat?

#

I said maybe because it is clearly not sure it is related. but locked vehicle might work

astral dawn
#

What's the best way to get the class name of a unit's backpack without items?
For instance a unit has a "B_AssaultPack_rgr_Repair" backpack which is pre-filled with some items, its parent class is "B_AssaultPack_rgr" which is I want to get

winter rose
#

sub-string it :p
IDK, I think some get parent config command/function exists

strong shard
#

@winter rose we try this - not work, lock - player should be able to manually get out

winter rose
#

you could trick it by adding a "dismount" action, but that's all I can bring to the table

astral dawn
#

@winter rose bis_fnc_basicbackpack seems to do its job

winter rose
#

noice!

astral dawn
#

Yeah actually it iterates the parent classes until it find one without items, right how I was going to do it...

astral dawn
#

Is it possible to create a local infantry unit?
Or actually, whole problem I am solving: I spawn a unit, initialize its loadout from a 3rd party script, then I read its loadout with SQF functions like vest, backpack, primaryWeapon and similar, after which I delete the unit. Maybe I could somehow replicate the same with a dummy object or whatever? Creating the unit for that looks like a waste of resources for me.

hot kernel
#

@still forum ,"you just ignored all the minor corrections I posted"
Not on purpose, I thought I got 'em all.

#

the only thing I missed that I can see is making _grp private

#

we're moving on anyway... πŸ˜„

rough dagger
#

Hi again, I return with more questions (apologies). I am working on an MP mission based around slingloading (amongst other things). I'm having some issues with the ropeAttach and ropeBreak EHs. When testing live (on the server), I am getting systemChats that establish that my scripts are firing (based on a simple addAction). However the EHs do not fire from within the script. I was wondering if I need to store the EH code in a specific place..? I thought I could just embed them in the script, but no dice.

#
vehicle player addEventHandler ["ropeAttach", {
    params ["_object1", "_rope", "_object2"];
    if (typeOf _object2 == "C_IDAP_supplyCrate_F") then {
        // systemChat "attached";
        "attached - testSling = true" remoteExec ["systemChat", 0, true];
        testSling = true;
        vehicle player removeEventHandler ["ropeAttach", 0];
    };
}];
hot kernel
#

@rough dagger apologizing for a pleasant introduction, you'd be a great Canadian

rough dagger
#

When testing this in local MP (just on my machine), I was getting 4 hits ("attached") when I picked up a crate, so I found that removing the EH straight away sorted that issue out. But I still cannot understand what I am doing wrong in the MP setup

hot kernel
#

I'm not sure about the syntax on your EH though, sorry

rough dagger
#

fair play - I struggle with this stuff

#

But, it did all seem to work fine on my local machine

astral dawn
#

Maybe the EH runs only on the machine where it is added to the object?

hot kernel
#

if it works well locally that's a good start!

astral dawn
#

But I think you are running it on player's machine?

hot kernel
#

good question for the forum and people love slingload topics anyway

rough dagger
#

I am testing first on my local machine, then when it works I upload it to my server..

#

people love slingload topics anyway really hahaha

hot kernel
#

don't ask me why...

astral dawn
#

However the EHs do not fire from within the script.
What do you mean...
I was wondering if I need to store the EH code in a specific place..?
A specific place like what? 🀷 Your code looks fine, you can addEventHandler and pass a { ... code ... } to it directly. Or you can pass a global variable which resolves to code.

rough dagger
#

Thanks Sparker - what I meant was that the EH is part of the code: scripts\missions\slingloading.sqf

#

but should any EH be 'housed' for lack of a better term in initPlayerLocal or something? Or initServer? Or should it not really matter?

astral dawn
#

Most important, you attach the EH to an object, and the object must exist by that time

#

So what do you actually attach the EH to? It looks like you must attach it to helicopter, right?

rough dagger
#

right .. so I call the script when sitting in the heli, and the EH is attached to the vehicle I am in - I realised that if I triggered the script (as it is) without being in a heli, nothing would happen, so I made sure I am in a heli when the script is run, so the EH has a landing zone so to speak

mint kraken
#

I have a camera controlled by a keyhandler and a dialog over it. There is 1 issue, I have a search bar and backspace doesn't work anymore. I think it has to do something with the key handler. Any way to make backspace work like normal?

SOLVED: Make so backspace returns false

astral dawn
#

Ok so what's the problem with your event handler again? It doesn't work on a dedicated server?

rough dagger
#

correct (sorry that wasn't clear)

astral dawn
#

When do you run the addEventHandler code?

#

And on which machine? on player's machine? are you sure?

rough dagger
#

when sitting in the MH6, via addAction

astral dawn
#

Ok so it's player's machine πŸ€”

#

well just try to do a diag_log from the event handler to see if it's even being executed

#
vehicle player addEventHandler ["ropeAttach", {
    params ["_object1", "_rope", "_object2"];
    diag_log format ["ROPE ATTACH: %1", _this];
    };
}];
rough dagger
#

will do, thank you.

#

This is the full code, btw:

#
_slingContent = [14418,16150];
deleteMarker "slingContent"; 
_spawnArea = createMarker ["slingContent", _slingContent];
_spawnArea setMarkerShape "ELLIPSE";
_spawnArea setMarkerColor "ColorGreen";
_spawnArea setMarkerSize [100, 100];
_spawnArea setMarkerAlpha 0.9;

slingMission1 = true;

if (slingMission1) then {
    "slingMission 1 is live" remoteExec ["systemChat", 0, true];
    _pos = [14791.5,16620.3];
    deleteMarker "sling1"; 
    _targetArea = createMarker ["sling1", _pos];
    _targetArea setMarkerShape "ELLIPSE";
    _targetArea setMarkerColor "ColorRed";
    _targetArea setMarkerSize [100, 100];
    _targetArea setMarkerAlpha 0.9;
    vehicle player addEventHandler ["ropeAttach", {
        params ["_object1", "_rope", "_object2"];
        if (typeOf _object2 == "C_IDAP_supplyCrate_F") then {
            // systemChat "attached";
            "attached - testSling = true" remoteExec ["systemChat", 0, true];
            testSling = true;
            vehicle player removeEventHandler ["ropeAttach", 0];
        };
    }];
    vehicle player addEventHandler ["ropeBreak", {
        params ["_object1", "_rope", "_object2"];
        if (_object2 inArea "sling1") then { 
            vehicle player removeEventHandler ["ropeBreak", 0];
            "nice drop - in tha zone - slingLoad points added" remoteExec ["systemChat", 0, true];
            RGG_slingLoadScore = RGG_slingLoadScore + 1;
        } else {
            "no good - try again" remoteExec ["systemChat", 0, true];
        };
    }];
};
still forum
#

removeEventHandler ["ropeAttach", 0]; you are assuming noone else will add that handler. but you don't know that

#

C_IDAP_supplyCrate_F how can the player be inside a supplyCrate?

astral dawn
#

it's _object2 == supplycrate

still forum
#

πŸ€”

rough dagger
#

^^ the item I am slingloading

still forum
#

ah I just don't know how that EH works πŸ˜„

#

I'd say ropeAttach is a local EH. local to the vehicle attaching the rope?

#

without reading the wiki that is

astral dawn
#

I assume it's local but he said that he's running addEventHandler locally on player's PC through addAction

still forum
#

yeah well "vehicle player addEventHandler" is deffo local

rough dagger
#

Not sure if this is relevant, but the wiki does not state local or global? Maybe I am misreading this though

still forum
#

for some EH's it does

#

for others just noone researched it

rough dagger
#

right

astral dawn
#

Yes if it doesn't state something it doesn't mean that something is true or false, more likely something is unknown

rough dagger
#

It is one of the newer ones I guess

#

OK, I'll diag_log and see what that shows

#

nice one guys, I appreciate the help and interest πŸ™‚

astral dawn
#

you know you can debug that thing with the debug console without restarting the server and re-pbo-ing the mission file?

rough dagger
#

there are many things about this I do not know, that is deffo one of them X)

#

thank you

astral dawn
#

Do you have CBA? It has a debug console which is actually useful

rough dagger
#

I've not used that. It is loaded, for some mods, so I can check that out. By the way, I am not PBOing my mission, I'm just loading the files to FPT (is that wrong??)

astral dawn
#

You know about the debug console, right?
You must put this into your description.ext to enable it for everyone:
enableDebugConsole = 2;

#

FPT? You mean FTP?

rough dagger
#

sorry, typo yes πŸ™‚

#

and I normally just log in as admin for debug, but makes sense to change that - good tip

astral dawn
#

Hmm but you export the mission from the editor, right?

rough dagger
#

I copy the mission file and related script files across from my local machine to my FTP server, then start the server to test the code.

#

My understanding was that if you test locally, even in MP (through the editor), you are actually testing as the server, so anything that works on your local machine even in 'MP', is not a true reflection of realty - as I am finding out lol

astral dawn
#

That's correct, an arma with interface can be a client or a server or both

#

so when you test by hosting an MP game you are both client and server

rough dagger
#

right

astral dawn
#

so you can debug the server's perspective of the game

#

I do it like this to save time:
Launch two armas from the launcher with different profiles
One arma hosts the mission from the editor
Another arma joins as client
Can debug both server and client view of the mission

#

If client and server side code is decoupled good enough then it should work fine with that

rough dagger
#

very nice workflow .. ArmA devving takes ages to process, so any workflow tips are very much appreciated πŸ™‚

astral dawn
#

Yes, that way you just change code, restart the mission from editor, without making a .pbo

#

and transfering files and doing other stuff...

rough dagger
#

makes sense. I have not tried your system, as I was not aware you could log in twice (i.e. a second client). I'll give that a try, that will save 'a lot' of time X)

astral dawn
#

Yes just make a second profile through the game start menu, then in launcher parameters find the 'Profile' parameter

rough dagger
#

sweet!!!

#

ta mate, gonna get on that ^^^ and also research diag_log - I have heard of this but never used it

astral dawn
#

πŸ€” diag_log is better then logging into chat, because there is a known bug when chat stops being displayed at all 😒 in multiplayer

rough dagger
#

ok .. this MP stuff brains my damage

astral dawn
#

Can also filter messages, etc

tame lion
#

So I'm having an issue with passing a variable while having disableSerialization enabled and disabled all at the same time. For whatever reason, it is passing a nil value instead of the object its suppose to pass. Anyone have a similar issue?

frozen knoll
#

no problem... how are you passing it and how is it defined before u pass it

tame lion
#

nevermind, I figured it out. I simply got rid of the with uiNamespace do around it. That seems to have worked

#

i figured it might have something to do with a namespace switch and it being a local variable in both scopes, the calling and function that received it

merry arrow
#

Hey all, have any of u used the survivable crashes mod? I have two problems with it and would like to maybe change it. But i need help

#

One problem (the biggest one) is that ai straight up dissapear on a crash

#

the second is that the heli bounces on crash. Any fix for these?

astral dawn
#

How do I intercept an event when a player drags an inventory item from an external container(not from his own inventory) onto the ground?

#

Neither Take nor Put event handlers get triggered, or are they supposed to be called but it's a bug?

bitter lark
#

What would I do to make a trigger only activate for a player if a specific unit is still alive.

edgy dune
bitter lark
#

@swift merlin I'm sorry you don't approve of my question. None of the answers on google helped because I'm inexperienced, but I eventually got it to work.
For anyone curious, my issue was I had

if (alive dad) then ["Rebel", "Vadim, NO!"] spawn bis_fnc_showsubtitle;
^Unit name
The solution was I didn't have the {} around the my subtitles, so I was receiving syntax errors. I thought I had made a mistake somewhere else and was asking for help because of it. Sorry.

bitter lark
#

I needed the trigger thing for that, but I found a work around.

tough abyss
real tartan
#

how do I get bool value from description.ext ? is it possible to retype it to BOOL ?

class CfgCustom 
{
    class first 
    {
        isEnabled = true;
    }
}

_isEnabled = [missionConfigFile >> "CfgCustom" >> "first", "isEnabled", false] call BIS_fnc_returnConfigEntry;

this only return Array, String or Number - Attribute value

ivory lake
real tartan
#

@ivory lake that also return only Array, String, Number or nil

ivory lake
#

iirc generally 'bools' in configs are just 0 or 1 anyway

still forum
#

!issuewarning @swift merlin crossposting

lyric schoonerBOT
#

Done.

austere silo
#

i have 1 question: is there a script to change the mission parameters live like during a game? if its technicly possible?

young current
#

what kind of mission parameters?

still forum
#

parameters from slot selection.
no.
But the mission scripts proably copies the settings into global variables, which you can edit.

austere silo
#

yea

#

this is what i meant

#

so the global variables u can edit live during game? who does it work. do i need a script what is overwriting that?

still forum
#

NameOfVariable = newValue done.

#

variables are set by scripts yes

austere silo
#

ok thanks a lot

harsh sphinx
#

Is there any way through script to open the normal action menu? showCommandingMenu is great for everything else, but I need a way to bring the scroll wheel menu up.

young current
#

I dont think there is

harsh sphinx
#

oof

young current
#

why do you need it?

harsh sphinx
#

I'm trying to add a 'Backspace' that goes back to the normal scroll menu, since the submenu is available directly from there.

young current
#

I dont quite understand?

harsh sphinx
#

I have a flow with commanding menus.

#

It's not the end of the world if I can't it would've just helped with the flow.

young current
#

by scrollwheel menu you mean the useraction list right?

harsh sphinx
young current
#

so what is this submenu you have

#

and why is it in there?

edgy dune
#

@tough abyss ah thank you, that name of that function is not what I thought it would be 🀷

velvet merlin
#

is diag_fps and family meaningful on the server to judge the performance/quality state of the server?

still forum
#

few fps == bad performance.
Same as on clients

winter rose
#

Nothing, you can die with less damage than 1

still forum
#

just do *101 instad of 100 or so πŸ˜„

merry arrow
#

Hey all, have any of u used the survivable crashes mod? I have two problems with it and would like to maybe change it. But i need help
One problem (the biggest one) is that ai straight up dissapear on a crash
the second is that the heli bounces on crash. Any fix for these?

exotic tinsel
#

We have a bug on our server where for some reasons task dont show up on the map when spawned in. it only happens everynow and then. but the only way we can fix it is to restart the server. any advice on what would cause tasks to stop showing up for everyone on the server?

astral dawn
#

any advice on what would cause tasks to stop showing up for everyone on the server?
BI's task system is kind of unreliable

obsidian violet
#

hey guys, connot get a clear answer on the forums and my tests does not really work out so asking here in hope for a quick answer.

how can I get the following to work?
_hour returns any.

KLT_fnc_skiptime = {

params ["_type"];
_type remoteExec ["skipTime"];


if (_type == 1) then {_hour = "Hour";} else {_hour = "Hours"};
[ 
 [ 
  [format ["%1 %2 Later",_type,_hour], "<t align = 'center' shadow = '1' size = '1' font='PuristaBold'>%1</t><br/>"]
 ], 
 safeZoneY + safeZoneH / 1.3,
 safeZoneY + safeZoneH / 1.2 
] spawn BIS_fnc_typeText;

};

if I run this from the debug it works perfectly fine..

_hour ="test";
_type = 1;
[  
 [  
  [format ["%1 %2 Later",_type,_hour], "<t align = 'center' shadow = '1' size = '1' font='PuristaBold'>%1</t><br/>"] 
 ],  
 safeZoneY + safeZoneH / 1.3, 
 safeZoneY + safeZoneH / 1.2  
] spawn BIS_fnc_typeText; 

Thanks

totally unneccesary but wtf xD

winter rose
#

@obsidian violet private "_hour"

obsidian violet
#

hmm, within the if statement?

winter rose
#

No,just above the if. That or sqf private _hour = ["hours", "hour"] select (_type == 1);

#

Also, your variable "_type"… the name is not helpful at all

obsidian violet
#

_type will be amount of hours to skip so a simple value. why wouldnΒ΄t that be helpful?

winter rose
#

Because how in hell is it a "type"?

#

_hours or _hoursToSkip or _skipDuration idk, but something else

obsidian violet
#

oh do you mean the name of it haha, well thats true, I can change the name when I get it to work πŸ™‚

winter rose
#

use my second code instead of your if and you should be good. Also, always private your variables on declaration.

obsidian violet
#

Wilco!! Thanks πŸ™‚ πŸ˜‰

tame lion
#

So I'm trying to learn how to make a proper headcam script, and I know that requires the use of all the vector related commands in order to make it work proper. I was wondering if anyone had a guide on how to use all the different vector commands and what not?

exotic flax
#

@tame lion well, I found that CBA_fnc_headDir is a good start, however it doesn't have vertical direction

#

I have been playing with retrieving that, but it is far from reliable

#

the hardest part is attaching an object to the head/helmet, because it's a "static" position relative to the spine, so it doesn't move correctly

#

of course, for a camera, you could simply place an invisible object in front of the head (ASLToAGL eyePos player) which acts as a camera, and then calculate where the player is looking at (eyeDirection player)

astral dawn
#

Doesn't attachTo let you attach something to head?

tame lion
#

I've tried using attachTo for head placement. It doesn't exactly rotate properly with head

exotic flax
#

the head point is a fixed point, and doesn't move with the head

#

eyePos is the closest thing to a position of the head with movement

#

I guess this is a good place to start:

onEachFrame
{
    _beg = ASLToAGL eyePos player;
    _end = (_beg vectorAdd (eyeDirection player vectorMultiply 100));
    drawLine3D [ _beg, _endE, [0,1,0,1]];
};

From here you can calculate the Pitch/Yaw/Bank from _beg and _end

errant patio
#

https://i.imgur.com/poFJTSD.png is it possible to get more info than this for the errors that appear at the bottom of the screen? Nothing shows up in my rpt logs :/

still forum
#

look at the source of the bis func mentioned

stuck lodge
#

Trying to make an addon that allows the player to knock themselves out. I made two SQFs one that adds an action and another that knocks the player out. I got it to work in a mission but not as an addon.

sleep.sqf
player addAction ["Sleep", "sleep.sqf"];

knock_out.sqf
[player, true, 8, true] call ace_medical_fnc_setUnconscious;

Should I go to #arma3_config ? I've been at it for a while and at a loss on how to get the SQFs to run.

still forum
#

CfgFunctions in your config.cpp.
You want the addAction in a postInit

stuck lodge
#

So am I barking up the right tree with this in the config.cpp

class Extended_PostInit_EventHandlers { class CAManBase { class CAManBase_Init { init = "[_this] execVM 'knock_out.sqf';"; }; }; };

with

requiredAddons[] = {"ace_medical","cba_events"};

at the beginning?

still forum
#

execVM filepath is wrong

#

you need to use properly prefixed path. with pboprefix

stuck lodge
#

so 'scripts\knock_out.sqf'

still forum
#

no

#

also not a correct prefix

#

do you know what a pboprefix is?

stuck lodge
#

sadly no

still forum
#

How do you pack your mod pbo?

stuck lodge
#

The Arma 3 addon builder

still forum
#

in the options of it you can configure the prefix

#

if you have a "scripts.sqf" directly next to your config.cpp in your pbo.
Then the final path will be
prefix\scripts.sqf
for prefix you should pick something unique, usually the same as the pbo filename

high marsh
#

disregard, I have found a method.
I bascially created a new camera, attached the camera to the object. Object controls work fine and everything works fine. Although there is for whatever reason a massive amount of stutter.

stuck lodge
#

Ugh, I'll continue tomorrow, I figured out that it wasn't copying the SQFs to the PBO and I had to manually add the file type... Way more confusing then just doing it in a mission.

tame lion
#

@exotic flax I've actually tried that example script. It's close, however it pants the camera in the center of the head. That's why i was thinking there might be a way with vector modification to somehow replicate a modelToWorld type effect off of the head

#

Only other thing i could think of is if it's possible to hide part of a model (eg: the "head" selection of the body) while the helmet cam is active

#

Unfortunately, the command hideSelection only seems to workon simple objects

fringe yoke
#

Can setVehicleReportRemoteTargets be used on infantry?

#

I want to be able to use it with the regular infantry laser designator

#

For use with the datalink system

winter rose
#

try and tell us!

fringe yoke
#

I've read that it can, but it didn't work for me

harsh sphinx
#

Is there any way of retrieving a zoom level set via ctrlMapAnimAdd? Generally just getting the zoom level of a CT_MAP control. ctrlMapScale achieves this πŸ™‚

exotic flax
#

@tame lion I've tried as well to attach an object to the head (or in my case helmet) which would move correctly based on head movement. However, since the head doesn't has it's own position and direction, this doesn't work.
And hiding the head is also tricky... because it would mean the unit wouldn't have a head at all (because it's by the object, not only though PiP)

tame lion
#

Yah but if i could hide the head only locally on the client using the interface, that could somewhat help. I'm not building it as a hud element, only as part of a dialog that covers almost the wholescreen

exotic flax
#

with an attached camera it would make sense to also see a part of the head/helmet

#

but with a virtual camera it would make more sense to just place it in front of the head and then have the same direction as the units eyes

tame lion
#

Yeah at this point I'm just trying to find a means to an end

hot kernel
#

what would the syntax be if I wanted to replace ""SAFE"" with something like "behaviour group this"?

_wp setWaypointStatements ["true", "[this, ""SAFE""] call mmf_fnc_patrolNAV;"];
#

it's just this,

_wp setWaypointStatements ["true", "[this, "behaviour this"] call mmf_fnc_patrolNAV;"];
#

nope, just this,

_wp setWaypointStatements ["true", "[this, behaviour this] call mmf_fnc_patrolNAV;"];
exotic flax
#

if terrain coords are correct, and you set the correct date/time, it should give the correct moon

velvet merlin
#

well it used to with OFP yes

#

but it seems the code is no longer correct

#

from what i can tell A3 touched it to integrate it for simulWeather

#

which may broke it

exotic flax
#

so use the utils command and find the date with the correct moon πŸ˜‰

velvet merlin
#

yeah checking atm

#

says 17th

#

night is still pitch black 😬

exotic flax
#

I don't have the map, so can't tell what is wrong...

winter rose
#

setApertureNew

exotic flax
#

but I do know that moons are present in Arma and do work correctly... perhaps it's the wrong time, or the terrain is not optimized for it

velvet merlin
#

optimized?

#

@winter rose will try

#

the prob is when there is still some sunlight AI is still crazy with spotting

#

aka incompatible to spec ops night mission design

winter rose
#

setSkill spotting πŸ™‚

#

you can make them blind as bats this way

velvet merlin
#

what value would you suggest?

winter rose
#

I really don't know, you would have to fiddle with it

spice axle
#
"foo" in "foobar";
``` should that return true? It results in a script error
astral dawn
#

It should, if your arma version is above 1.95.146032

#

needle in haystack (Since Arma 3 v1.95.146032)

spice axle
#

Yeah i read that too

#

ah we are still on 1.94 right?

spice axle
#

Is there a way to set the turret direction?

carmine maple
#

@spice axle
You can get the current roation with something like:
_vehicle AnimationPhase "MainTurret"
it should be possible to set the direction with:
https://community.bistudio.com/wiki/animate
_vehicle animate ["MainTurret", 0.5, true];
havent tested it, so no guarantee it works

spice axle
#

Will test it give me a mom

#

MAybe I'm doing something from but I tested several things and nothing happend

carmine maple
spice axle
#

I don't know. It is not working for me ok I found my problem, it is working now, thanks

jolly wolf
#

Hi, I'm going to apply this http://www.armaholic.com/page.php?id=33618 script. And I'm basically copying what I heard on my homepage. However, it is not known what variables the editor applies to the map. The basic mission pack is the Ghost - Enemy Assault.

spice axle
#

It doesnt matter how the markername is called it just have to be the same as here

[player,"MarkerNameFromEDITOR",20] spawn zlo_fnc_CreateZone;//[PLAYER,MARKERNAME,RADIUS]
#

@jolly wolf but I'm not sure if that was your question

jolly wolf
#

Marker - Properties [parameter name] May I fill in here?

spice axle
jolly wolf
#

oh thank

#

be inactive...

mortal wigeon
#

How does one control the degree to which the "Zoom In" etc. keys zoom?

exotic flax
#

I don't think you can... perhaps through some ui event handler and custom scripts, but I bellieve it's hardcoded

young current
#

It's configured in weapons/turrets optic config. Not really controllable beyond that.

acoustic abyss
#

Hi everyone. I have a complete beginner question. How do I display the output of commands of my debug console?

My situation: I am trying to find the type and category of an object. Commands such as typeOf and BIS_fnc_objectType are the obvious answer, but executing them locally in a debug console shows no output. How do I do this?

winter rose
#

typeOf cursorObject @acoustic abyss

acoustic abyss
#

@winter rose Thankyou! But, I don't know the shortcut key to opening up debug console and local execution, so couldn't use cursorObject. I am now using :

hint str [ foo ] ;

-when I am playtesting the mission. But this is a pathetic workaround. How do I normally get the output of " foo " in the editor screen?

grave stratus
#

does a command with global effects will execute for every player connecting to the server?

#

using isServer wont make it work in a dedicated server

#

im refering to createVehicle btw

still forum
#

The shortcut to open debug console is "Esc"
If the console is enabled at all that is

#

does a command with global effects will execute for every player connecting to the server?
no. It means the result it creates is visible for every player

tough abyss
#

Hello guy, IΒ΄ve been trying to make a video. Can we help me anyone? Can I add this intro video to exile server? Thank you for your responses.

quasi gyro
#

I have been trying to figure this out for some time....
I have ran and tested these lines in debug console and know that they work. I need help creating a script to loop through an array of x,y and radius and then have it execute when the server starts.

_location=[5789.38,10383.6];  
_radius=50;   
_terrainobjects=nearestTerrainObjects [_location,[],_radius]; {hideObjectGlobal _x} foreach _terrainobjects;

how would I go about this

still forum
#

loop through an array? forEach

#

{
_x params ["_location", "_radius"];
<...>
} forEach [[[5789.38,10383.6],50], [[5789.38,10383.6],50]]

quasi gyro
#

yes loop through an array one like this.

private  _locations=[[5789.38,10383.6],[5724.87,10404.2],[5793.5,10421.4],[5759.32,10444.9],[5798.47,10468.9],[6895.849,7453.282],[6895.849,7453.282],[5822.715,10783.907],[5830.870,10187.938],[5845.938,10223.338],[5840.145,10143.083],[5876.150,10186.08],[5878.213,10210.816],[4985.84,11373.3],[4961.61,11323.8],[5755.97,10696.4],[5755.66,10717],[5755.51,10731.1],[5479.933,9977.303],[5469.477,9947.218],[5761.33,10628.7],[5730.21,10625.1],[4676.46,9315.29],[3875.18,9667.09],[5836.25,10830.8],[5938.71,10645.7],[5835.59,10545.3],[5805.89,10579.7],[4634.15,9265.12],[4712.04,9263.93],[4054.704,9105.791],[9877.941,13536.048],[4048.31,8318.89],[4073.25,8294.63],[6921.5,7584.5],[8262.4,11990.3],[8356.62,11957.9],[5935.47,11051.4],[5948.38,10987.6],[5922.09,10983.3],[5922.09,10983.3],[5918.39,10993.2],[5918.39,10993.2],[5763.97,10586],[5756,10567.3]];
still forum
#

where does radius come from? thats not in there

#

that would be

{
_location = _x;
...
} forEach _locations;

queen cargo
#

Just finished my XML parser

median abyss
#

When trying to addAction to a player, how can I add it to the player (I'm trying to do it in a remoteExec from the server right now)?

astral dawn
#

When trying to addAction to a player
how can I add it to the player
By adding it to the player πŸ€”

#

I mean pass player as object which will get the action added

median abyss
#

I just assumed that the player object would get interpreted on the server, then sent as the "wrong" object to the user. Testing rn πŸ˜‰

still forum
#

"player" doesn't exist on a server, the comand returns objNull

#

From the serverside there is no "the player"

astral dawn
#

best would be to add a function which will be run locally on a player's computer and add the action to player

#

From the serverside there is no "the player"
except if server is also client*

still forum
#

assuming your remoteexec looks like [player, [...]] then yes. that doesn't work.
Server will make player command return objNull, which means youre trying to add action to objNull

#

You can either just remoteExec "call" or.. you can manually find the target object that you want out of allPlayers

median abyss
#

will the player object in allPlayers be the same across connected clients?

still forum
#

yes

median abyss
#

Great, I'll give that a try! πŸ˜„

lavish hamlet
#
if (!isServer) exitwith {};


rdfInf = {
_infSpawns = selectRandom  ["inf1","inf2","inf3","inf5","inf6"];

_squad =[getMarkerPos _infSpawns,EAST, (configfile >> "CfgGroups" >> "East" >> "rhs_faction_vdv" >> "rhs_group_rus_vdv_infantry" >> "rhs_group_rus_vdv_infantry_squad")]; //call BIS_fnc_spawnGroup;

//[_squad, getmarkerpos, 1000] call BIS_fnc_taskPatrol;
};

[rdfInf] remoteExec ["rdfInf",2];

Any hints on why this isen't working.

still forum
#

the call is commented out

lavish hamlet
#

lol. i just saw that too

still forum
#

why is your remoteExec passing a COPY of the function as argument to a function?

lavish hamlet
#

im trying to spawn a inf grp on a dedicated server.

still forum
#

Your function doesn't take any arguments. Thus you also shouldn't pass any to remoteExec

lavish hamlet
#

through a add action

median abyss
#

It worked! Big thanks!

#

@lavish hamlet Might this be what you're looking for?:
// all clients will have their ammo set to 1 for their current weapon
{player setAmmo [primaryWeapon player, 1];} remoteExec ["bis_fnc_call", 0];
So in your case:
rdfInf remoteExec ["bin_fnc_call", 2];

still forum
#

rdfInf remoteExec ["bin_fnc_call", 2]; no on 3 levels.
1st its BIS_fnc_call, not bin.
2nd use "call" instead of the old bis func.
3rd just remoteExec the function. remoteExec ["rdfInf", 2]
atleast that should work too. Not sure if it's really limited to CfgFunctions only

median abyss
#

So, it's stupid. But does it work? (Out of curiosity)

still forum
#

what works? If you correct the bin/bis typo, your code works yes

median abyss
#

Oh, didn't even realize that there was a typo. But cool, thanks

still forum
#

but its very inefficient

#

you are always going the redirect via the bis fnc, which means it also has to spawn the script and add it to the scheduler.
and you are always sending the content of the script function over the network, every time you call it

median abyss
#

Yeah, I see no practical use for it. Other than possibly for testing πŸ™‚

median abyss
#

Is there a way to make a script local to the server, and thus never sent to the client? (To reduce network traffic)

#

Creating the script outside the mission (server root folder) and then including it using "\path\to\script.sqf" ?

astral dawn
#

Only as a server-side addon

#

You can't include anything not from a .pbo

#

Except if you enable file patching as a startup aprameter

#

I would say that your idea is quite good but pointless in the modern world, when we have abundance of bandwidth and our code weighs like... kilobytes?

still forum
#

but sometimes you don't want people to see your code

#

network traffic reduction not worth it. But if you want to hide it then different story

astral dawn
#

Ah sorry I have misread it, he says never send it to client

#

I was thinking about a different thing πŸ™„ sorry

still forum
#

your responses seem valid to me tho

median abyss
#

So a server side addon would do the trick then

#

Agreed

quasi gyro
#

@still forum I have a second array to get the radius. sorry I fell asleep with the gf.

still forum
#

you can use _forEachIndex variable, inside the loop to know at which index you are

#

and use that to select from your radii array

quasi gyro
#

okay so i have this

private  _locations=[[5789.38,10383.6],[5724.87,10404.2],[5793.5,10421.4],[5759.32,10444.9],[5798.47,10468.9],[6895.849,7453.282],[6895.849,7453.282],[5822.715,10783.907],[5830.870,10187.938],[5845.938,10223.338],[5840.145,10143.083],[5876.150,10186.08],[5878.213,10210.816],[4985.84,11373.3],[4961.61,11323.8],[5755.97,10696.4],[5755.66,10717],[5755.51,10731.1],[5479.933,9977.303],[5469.477,9947.218],[5761.33,10628.7],[5730.21,10625.1],[4676.46,9315.29],[3875.18,9667.09],[5836.25,10830.8],[5938.71,10645.7],[5835.59,10545.3],[5805.89,10579.7],[4634.15,9265.12],[4712.04,9263.93],[4054.704,9105.791],[9877.941,13536.048],[4048.31,8318.89],[4073.25,8294.63],[6921.5,7584.5],[8262.4,11990.3],[8356.62,11957.9],[5935.47,11051.4],[5948.38,10987.6],[5922.09,10983.3],[5922.09,10983.3],[5918.39,10993.2],[5918.39,10993.2],[5763.97,10586],[5756,10567.3]];

private _radi=[50,20,30,50,20,20,20,30,30,30,10,20,8,50,20,20,20,20,5,10,20,20,50,99,15,40,50,20,35,25,100,20,50,50,100,100,50,50,25,10,5,5,45];

if (count _locations != count _radi) exitWith { hint "invalid grid" };

{
    private _location = _x;
    private _radius = (_radi select _forEachIndex);

    {hideObjectGlobal _x} forEach (nearestTerrainObjects [_location,[],_radius]);
} forEach _locations;

A) Will this work
B) Where would I execute this to have it run once on server startup before anything loads on the map

still forum
#

initServer.sqf

quasi gyro
#

with execVM correct

still forum
#

or preInit in CfgFunctions with isServer check

#

no

#

execVM will execute later

#

if you don't want to use cfgfunctions

#

use call compile preprocessFile "file.sqf"

quasi gyro
#

i dont mind if its more efficient i just dont know how

still forum
#

call compile.. in initServer.sqf should work fine enough

quasi gyro
#

okay

#

ill test

#

and does that code above check out by your eyes

still forum
#

Oh I thought I answered that. apparently I didn't

#

looks good to me πŸ˜„

#

Maybe look at

#

if you wanna check it out. I'll leave now o7

quasi gyro
#

cya

quasi gyro
#

@still forum no go went about it with the call compile and the nearest terrain objects are not hidden will try with cfgFunctions

young current
#

Ive noticed some objects might not work with hiding

lavish hamlet
#

im back πŸ™‚ when i run this ```sqf
if (!isServer) exitwith {};

rdfInf = {
_infSpawns = selectRandom ["inf1","inf2","inf3","inf5","inf6"];

_squad =[getMarkerPos _infSpawns,EAST, 5] call BIS_fnc_spawnGroup;

[_squad,getmarkerpos "patrol", 1000] call BIS_fnc_taskPatrol;
};

remoteExecCall ["rdfInf",2];

through an addaction on a laptop on the server it wont work. but if i copy the code the the debug console and run on server it works..  could someone point me in the right direction ?
faint oasis
#

i have a question ? i'm in the tank i press "T" for assign a target and when i use the "assignedTarget" i don't see the target but if go to the order menu and i assign manually the target it work so why when i press "T" in a tank i don't see the assigned target ?

astral tendon
#

Any fix?

exotic flax
#

see answers of that same topic...

astral tendon
#

None of they help, since I dont have CBA in this mission.

exotic flax
#

well, CBA is the only way to change the squad names in the lobby

stuck lodge
#

@exotic flax Did you ever figure out how to use XEH after respawn?
Because I currently have my addon working but when I respawn my Action is no longer available.

exotic flax
#

yes, at least it's now working as I wanted πŸ˜‰

#
// config.cpp
class Extended_Respawn_EventHandlers {
    class CAManBase {
        class onPlayerRespawn {
            respawn = "_this call TAG_fnc_onPlayerRespawn";
        };
    };
};
// fn_onPlayerRespawn.sqf
params ["_unit", "_corpse"];

[_unit, _corpse] spawn {
    params ["_unit", "_corpse"];
   // execute code
};
true
#

the extra spawn in the sqf is needed, because the script runs at the same time as the unit got created; so it should wait for that

stuck lodge
#

Thanks chief I'll give her a try and work from there

exotic flax
#

although for actions (like player addAction []) a postInit should be enough, since it will trigger the moment an unit is created (included respawning)

stuck lodge
#

IDK, I tried it and when I respawned I lost the Action

grave stratus
#

@astral tendon put @squad name in the role description on the squad leader. something like 1: Squad Leader@Corpsmen , This will change the initial squad name (e.g. Alpha 1-1) to Corpsmen in the multiplayer lobby, you don't even need to change the Alpha 1-1 group name

astral tendon
#

@grave stratus I dont have CBA on that mission, it does not work.

grave stratus
#

oh.then i dont know

frosty stratus
#

Is there a script command I can use to open a vehicles inventory in the normal dialog?

copper raven
#

@lavish hamlet because server doesnt know anything about that function until you define it serverside

brazen smelt
#

I'm having another dumb moment. What is the way to reference an object that I called the script on? (Ex. A script that creates a whitelist for an arsenal)

#

Currently I have it setup as:

[bftarsenal, _bftarray] call ace_arsenal_fnc_addVirtualItems;
bftarsenal addAction["<t color='#2ecc71'>Open Arsenal</t>", {[bftarsenal, player, false] call ace_arsenal_fnc_openBox;},[],1200, true, true, "","true", 2,false,"",""];
#

But obviously, can't have multiple objects named as bftarsenal.

lavish hamlet
#

@copper raven so if i definere the fnc in serverinit.sqf then i Will be able to Call the fnc from an addaction from a Client and it Will run server side ? Im at work so cant test it πŸ™‚

still forum
#

remoteExecCall
@lavish hamlet you sure you want unscheduled? But I guess debug console is unscheduled too, so that should work.

sudden yacht
#

Hello all. Im using an event handler. "FiredNear"... Anyways ive looked for awhile now. I want to have it create a group for passengers. Then force them to leave that vehicle. The problem im having is how do define the passengers or cargo? Everything i try seems ill without result.

lavish hamlet
#

@still forum i really dont know πŸ™‚ but in this case i need to be able to spawn 4 kind of targets on a tranings map that is closed to my community.

carmine maple
#

@sudden yacht Just get all the people that are in cargo: https://community.bistudio.com/wiki/fullCrew
eg.

{
    if(!isNull (_x select 0) && (_x select 1) == "cargo") then {moveOut (_x select 0);};
} forEach (fullCrew _vehicle);
round scroll
#

@carmine maple would using the alternate syntax with filter of "cargo" be easier? can't test it now, but fullCrew [_vehicle, "cargo", false] might make the if not needed. Can't test right now, just read the wiki page on fullCrew

safe forum
#

Is animateSource works with simple objects?

winter rose
#

try and thy shalt see!

round scroll
#

is there a way to read out the radar targets from a vehicle? Or do I have to loop over allVehicles and check knowsAbout?

#

or rather nearTargets? I'm thinking about writing an awacs script for Sabre's E-2 and Unsung E-2

winter rose
round scroll
#

thanks, gonna try that

lavish hamlet
#

I need some help! I've tried everything but im still not able to get ai to spawn on a dedicated server using an addaction. any help would be greatly appriciated. everything work when its local but as soon as i try to get the server to run the functions nothing happens.

winter rose
#

what exactly do you do?

lavish hamlet
#

Description.ext


onLoadName="RDF Trænings Map";
onLoadMission="RDF Trænings Map";

respawn = 3;
briefing=0;
debriefing=0;
enableDebugConsole = 1;
EnableAI =0;

class CfgFunctions
{
   #include "RifleTargets\cfgfunctions.hpp"
};

class CfgRemoteExec
{

   class functions {
   mode = 2;

       class rdf_Jtac_fnc_infspawn {
       allowedTargets = 2;
       };
       class rdf_Jtac_fnc_armorSpawn {
       allowedTargets = 2;
       };
       class rdf_Jtac_fnc_lightArmorSpawn {
       allowedTargets = 2;
       };
       class rdf_Jtac_fnc_vehicleSpawn {
       allowedTargets = 2;
       };

   };
};

initserver.sqf

rdf_Jtac_fnc_infspawn        = compile preprocessFileLineNumbers "scripts\RDF_Jtac\infSpawn.sqf";
rdf_Jtac_fnc_armorSpawn      = compile preprocessFileLineNumbers "scripts\RDF_Jtac\armorSpawn.sqf";
rdf_Jtac_fnc_lightArmorSpawn = compile preprocessFileLineNumbers "scripts\RDF_Jtac\lightArmorSpawn.sqf";
rdf_Jtac_fnc_vehicleSpawn    = compile preprocessFileLineNumbers "scripts\RDF_Jtac\vehiclespawn.sqf";

infspawn.sqf

//if (!isServer) exitwith {};

rdfInf = {
_infSpawns = selectRandom  ["inf1","inf2","inf3","inf5","inf6"];

_squad =[getMarkerPos _infSpawns,EAST, 5] call BIS_fnc_spawnGroup;

[_squad,getmarkerpos "patrol", 1000] call BIS_fnc_taskPatrol;
};


remoteExecCall ["rdfInf",2];```

vehiclespawn.sqf  
```sqf
 if (!isServer) exitwith {};

_vehspawn = selectRandom ["veh1","veh2","veh3","veh5","veh6"];

_vehicle = [getMarkerPos _vehspawn,0,"rhs_uaz_open_vmf", EAST] call BIS_fnc_spawnVehicle;

[_vehicle select 2, getmarkerpos "patrol", 1000] call BIS_fnc_taskPatrol;```
winter rose
#
remoteExecCall ["rdfInf",2];```only works if the other machine also knows the function
lavish hamlet
#

then i change rdfinf to rdf_Jtac_fnc_infspawn the line i have in the initserver.sqf ?

#

and this is the addaction part ```sqf
removeAllActions rdfjtac;

rdfjtac addAction ["Spawn Infantry",rdf_Jtac_fnc_infspawn];
rdfjtac addAction ["Spawn Vehicle", rdf_Jtac_fnc_vehicleSpawn];
rdfjtac addAction ["Spawn Light armor", rdf_Jtac_fnc_lightArmorSpawn];
rdfjtac addAction ["Spawn Armored", rdf_Jtac_fnc_armorSpawn];

winter rose
#

quickfix, put ```sqf
rdfInf = {
_infSpawns = selectRandom ["inf1","inf2","inf3","inf5","inf6"];

_squad =[getMarkerPos _infSpawns,EAST, 5] call BIS_fnc_spawnGroup;

[_squad,getmarkerpos "patrol", 1000] call BIS_fnc_taskPatrol;
};in `initServer.sqf` and in `infspawn.sqf` only putsqf
remoteExecCall ["rdfInf",2];```

still forum
#

rdfjtac addAction ["Spawn Infantry", {remoteExecCall ["rdfInf",2]}];
or maybe
rdfjtac addAction ["Spawn Infantry", "remoteExecCall ['rdfInf',2]"];
no time to read wiki

lavish hamlet
#

the quickfix did nothing. 😦

still forum
#

if you manually execute the remoteExec on your client in the debug console with local exec. Does that work correctly?

#

what does rdf_Jtac_fnc_infspawn contain?

lavish hamlet
#

rdf_Jtac_fnc_infspawn = compile preprocessFileLineNumbers "scripts\RDF_Jtac\infSpawn.sqf";

#

so before lou's fix it was the infspawn.sqf script.. now it just contains the remoteexeccall part

still forum
#

doesn't tell me what it contains

#

so its just
rdf_Jtac_fnc_infspawn = {remoteExecCall ["rdfInf",2];}
essentially?

lavish hamlet
#

yes after i moved the rest of the spawn script to initserver.sqf.

still forum
#

didn't answer my question above whether remoteExec manually works

lavish hamlet
#

it works.. rdfjtac addAction ["Spawn Infantry", {remoteExecCall ["rdfInf",2]}];
or maybe
rdfjtac addAction ["Spawn Infantry", "remoteExecCall ['rdfInf',2]"]; bot of em.

still forum
#

so your issue was rdf_Jtac_fnc_infspawn then

#

Yes.. obviously

#

initserver.sqf
only runs on server.
rdf_Jtac_fnc_infspawn is only set on server.
But all your actions are on client

astral tendon
#

Anyone recomends a stand alone vanila script for pylons?

finite dirge
#

Sure, just spawn a RoadCone_F

#

Or a RoadCone_L_F and attach a lightpoint to it ABlobHaha Maybe even loop it!

astral tendon
#

What?

exotic flax
#

I believe he means dynamic loadouts πŸ˜‰

still forum
#

Can't recommend a script. But I can recommend the wiki pages required to write one

finite dirge
#

I believe he means dynamic loadouts
That was my joke, yes.

astral tendon
#

I already know those wiki pages, is just that I don't have the time to work it, or even the knowledge to do a good public script, I already got roasted enough about my bad scripting.

still forum
#

I only know of the ACE UI

exotic flax
#

tbf... doing a single Google search already gave me 3-4 different scripts/mods which have a custom loadout system

#

on the first page...

still forum
#

Oh. Well then.

astral tendon
#

Some of they are quite old posts from the forum, so I would like to know from the community about a good one that is also updated and used in public servers.

still forum
#

Why updated?

#

If it works, there is nothing to update

jaunty ravine
#

Anyone know of a way to get an insignia on a soldier's left arm in multiplayer?

winter rose
#

get*

jaunty ravine
#

Alright, now here's another question: How do I depending on a characters variable name assign them a unit insignia?

finite dirge
#

What do you mean by " depending on a characters variable name"?

A switch of str player could do it if you just mean a list per name.

exotic tinsel
#

when i create a task in the eden editor do i have to assign a variable name to prevent issues with armas task framework? its for a multiplayer server. my tasks stop spawning for some reason after a few tasks or half dozen spawn. the task id is set and its always unique. so m49_task_1 for task ids.

jaunty ravine
#

I solved it:

if (vehicleVarName player == "Troop_Medic") then {[player, "CTRG15"] call BIS_fnc_setUnitInsignia};```
grave stratus
#

how do i delete every object in an array i got by using BIS_fnc_objectsGrabber? because it detects it as an array, not vehicle.

if (isServer) then {
    
    _objectsArray = [
        ["CraterLong",[227.18,-103.525,-0.0641394],135.155,1,0,[-1.94189,-0.815603],"","",true,false], 
        ["CraterLong",[230.895,-107.867,-0.0767827],136.893,1,0,[-2.33426,-0.482941],"","",true,false], 
        ["CraterLong",[235.338,-112.971,-0.237772],135.085,1,0,[-7.26152,-1.80381],"","",true,false]
    ];
    
    [[9889.314,9661.053], 0, _objectsArray, 0] call BIS_fnc_objectsMapper;
    
    _objectsArray spawn {
        sleep 1;
        waitUntil { (["Task_001_02"] call BIS_fnc_taskState) == "SUCCEEDED" };
        {deleteVehicle _x} forEach _this;
    };
};
still forum
#

_objectsArray doesn't contain any objects

#

I guess use nearestObjects at the coordinates?

#

BIS_fnc_objectsMapper returns an array, but you never use the return value?

grave stratus
#

well the objects returned by BIS_fnc_objectsMapper are in .p3d file format

still forum
#

objects can't be in p3d file format

#

that sentence doesn't make sense

grave stratus
#

i've tried it using copytoclipboard, it returns the objects .p3d file name

finite dirge
#

You can't copy the object directly to the clipboard.

grave stratus
#

oh

#

thats why it returns something like this? [249766cc900# 355688: cncblock.p3d,249766cfc60# 355689: cncblock.p3d

still forum
#

That.. is an array of objects

grave stratus
#

yes, i know

#

i wanted to delete every objects in that array

still forum
#

objects turned into strings

finite dirge
#

Yep, debug names for objects is what you get because you are outputting strings.

still forum
#

you already have the correct code for that. forEach and deleteVehicle

grave stratus
#

ah okay

#

i gave a variable name to the BIS_fnc_objectsMapper and use forEach to that instead of the array from BIS_fnc_objectsGrabber and it works

#

i didnt know that i cant directly copy and objects to the clipboard

#

that's why i didn't try it

#

πŸ˜“

#

thanks guys

#

πŸ‘

still forum
#

!issuewarning @jolly wolf crossposting

lyric schoonerBOT
#

Done.

outer fjord
#

When messing with coordinate space for the AttachTo command, is there a easy debug or way for me to get the places I need via just attaching and moving in the editor? I would like to show progress of equipment being loaded into a truck, but I'll be using a lot of boxes.

young current
#

perhaps some getpos main object, getpos attached object offset calculation

outer fjord
#

I couldn't quiet get the exact points but eyedballed it enough to offset decently

#

My next question is, how can I stop a plane at a certain point in it's Taxi? I tried disabling both MOVE and PATH AI on waypoint.

#

Or does it have to be the vehicle I need to disable these and not the pilot?

young current
#

might need some setvelocity shenannigan. planes dont have much in the way of brakes I think

#

engine off perhaps

#

and stop command on pilot

round scroll
#

I never got AI manned planes to taxi the way I want in arma 3, gave up on it and scripted it

#

on the awacs functionality queried earlier, the targetsQuery command seems to like to get the pilot, the plane itself seems to know nothing on targets πŸ™‚ (driver _awacs) targetsQuery [objNull, sideUnknown, "", [], 0]

wary vine
#

anyone know a clean way of sorting a list of vehicle classnames into categories ? (Helicopter / Car / Tank , etc)

spice axle
#

You could do something like a switch Statement with a isKindOf and then the base Helicopter, car, ...

#

@wary vine

wary vine
#

isKindOf is Object based right ?

spice axle
#
switch (true) do {
    case (_x isKindOf "BaseCar"): {
        _arrayCars pushback _x
}}
#

Im just on the phone but in this direction

#

There is a syntax error but yes

wary vine
#

yeah, isKindOf is object based.

#

im looking for it through an array of classnames.

spice axle
#

ah ok sorry haven’t read this Part

wary vine
#
private _types = [
    ["Tank", []],
    ["Truck_F", []],
    ["Car", []],
    ["Unknown", []]
];

("(getNumber(_x >> ""scope"")) isEqualTo 2" configClasses (configFile >> "CfgVehicles")) apply 
{
    private _parents = ([_x, true] call BIS_fnc_returnParents);

    private _first_index = _types findIf {(_x select 0) in _parents};
    private _type = if !(_first_index isEqualTo -1) then 
    {
        ((_types select _first_index) select 1) pushBackUnique (configName _x);
    } else 
    {
        ((_types select ((count _types)) - 1) select 1) pushBackUnique (configName _x);
    };
};

copyToClipboard str _types;

``` this works, to an extent, i just have be careful what order I put the types in.
#

otherwise, tanks will be in "Car"

exotic flax
wary vine
#

again, object based, its pretty annoying there is no default function that I know of that gets the vehicle category from a classname, like the editor does

astral dawn
#

How does editor understand the object category actually?

wary vine
#

I don't know, probably engine based./

exotic flax
#

it's a variable in the class

wary vine
#

I have scanned through the config, and couldn't see anything that stood out.

astral dawn
wary vine
#

hmm

exotic flax
#

however, that will also include all custom categories

wary vine
#

but where does EdSubcat_Cars get its string from ?

#

maybe stringtable

exotic flax
#

nope... it's also a config

#

simply read the second link to understand how those work

wary vine
#

hmm, this might work for me slightly better, thanks πŸ™‚

exotic flax
#

but if you just want to get a list of all cars, tanks, planes, etc. it would make more sense to use BIS_fnc_objectType, because that will check the vehicle itself through its simulation type

wary vine
#

Yeah, i needed it via classname though, not object. unfortunatly.

exotic flax
#
_myType = "B_MRAP_01_F" call BIS_fnc_objectType;

see example of BIKI page

#

isKindOf even works for both (objects and string)

#

just because it has the word "object" in it doesn't mean it only accepts objects... it usually means it returns the object (as a string)

wary vine
#
lega_fnc_pShop_sortVehicles = 
{
    params [
        ["_vehicle_array", [], [[]]]
    ]

    private _sorted_array = [];

    _vehicle_array apply 
    {
        if (_x params [
            ["_classname", "", [""]],
            ["_id", -1, [0]]
        ]) then 
        {
            private _vehicle_type = _x call BIS_fnc_objectType;
            private _type_index = _sorted_array findIf {(_x select 0) isEqualTo _vehicle_type};

            if !(_type_index isEqualTo -1) then 
            {
                ((_sorted_array select _type_index) select 1) pushBack _x;
            } else 
            {
                ((_sorted_array select _type_index) select 1) pushBack _x;
                _sorted_array pushBack [_vehicle_type, [_x]];
            };
        };    
    };

    _sorted_array;

};

``` something like that should be a bit better then.
#
private _sorted_array = [
    [
        ["vehicleclassname", databaseid],
        ["vehicleclassname", databaseid],
        ["vehicleclassname", databaseid] .....
    ]
] call lega_fnc_pShop_sortVehicles;
exotic flax
#

why not store the vehicle type in a custom list or even database? makes it way easier to control

scarlet rain
#

Hi all, I am trying to start a script when a player connects via mission eventhandler player connected. How would I properly reference the connected player (and pass this on into the script, so a script can recognize his position on the map?

#

the params are: "params ["_id", "_uid", "_name", "_jip", "_owner", "_idstr"];"

exotic flax
#

well... if I'm correct that triggers before someone is actually in-game, so it's not attached to an unit

scarlet rain
#

hm oh ok

#

i tried to waituntil the player spawned in with: waituntil {lifeState _player != "DEAD-RESPAWN"};

exotic flax
#

it would make more sense to use an init or respawn event handler which has the entity available, which should be a player

scarlet rain
#

_player stands for ID, UID Name, tried a couple

#

but yeah it seems that MEH is the wrong way

exotic flax
#

you could always set a variable to the mission namespace and the moment someone gets in-game retrieve that value and put it on the player

#

although all those params can also be retrieved at a later stage, so a bit useless (unless you want to prevent someone from getting in-game)

scarlet rain
#

I think i ll completely change the approach

#

i am spawning in loot based on a players position Y. once the player moved X away from Y, old loot is deleted and new loot at new position Y is spawned

#

old position Y and the previously affected lootarea gets an area marker as blacklist - so no new loot will spawn there for a while, and if 2 players are nearby, this should avoid too much loot spawn at the same place.

#

i execute this script on the client only

#

but the array of "blacklist" areas where no loot should spawn was ofc not available to other clients

#

i think i ll just add this blacklist area array as public variable

#

so all clients feed their blacklist areas into the same public variable

#

and access the same for blacklist area checks

exotic flax
#

why not handle it by the server?
If a player enters an area, spawn loot at n points.
If more players get in the area, ignore spawn (unless last spawn was n minutes ago).
If no player is in area, and loot has been there for n minutes, remove loot.

#

and each area has a maximum amount of points which may contain loot

scarlet rain
#

i wanted to let the server handle it indeed

#

thats why i looked into the mission eventhandler player connected

#

in order to start that lootspawn loop for every player

#

but the spawning of loot should be relative to the players position, and be continuously spawning

#

so if i manage to start the script from the server for all players, the blacklist marker issue is solved, as the blacklist array is created on the server and only the server needs to read it

exotic flax
#

most loot systems work by having a marker at the loot locations (eg. city) and the moment a player gets close to it, it will spawn in stuff

#

that's why on the old DayZ mod the server would sometimes lag when you entered one of those areas πŸ˜‰

scarlet rain
#

sure thats one approach of course

#

in the larger context of my project that would not be an ideal solution however

exotic flax
#

that's something I can't decide πŸ˜‰

scarlet rain
#

hence my approach to base the loot economy on player position. so the mod (the project) can be used on any terrain

#

anyway - got two ways to approach it and will give it some more thought;)

#

thanks for the feedback!

exotic flax
#

you're welcome, that's what this discord is about

exotic tinsel
#

can someone point me in the direction of how to loop through all CfgVehicles to spawn 1 of every sides infantry? ive......got.....an.....idea

young current
#

is the idea worth the time explaining the thingy for you πŸ˜›

exotic flax
#
{
   _x createVehicle [0, (5*_forEachIndex)];
} foreach ((configfile >> "cfgvehicles") select { _x isKindOf "Man"});

something like this (not tested)

exotic tinsel
#

@exotic flax thx ill start with that.

#

The idea is, im tired of having to figure out what things are and are not for what side because arma doesn't provide a full proof way for each uniform, gun, helmet, etc. It would be great if we/I had a scrip that placed every unit for each side, then looped through their load out for primary, rpg, uniform, helmet, what ever else an spit out an array for me. i can do all of that easy except knowing how to spawn 1 of every type of MAN for just one side. Then ill post it and we can all use it everytime they release some DLC. unless someone was kind enough to do this already.

exotic flax
exotic tinsel
#

yeah duh, do you want to read each one. no thanks quick script and run go get a cupa and array is waiting for your when your done. copy paste to your framework and now you know what stuff belongs to each side.

exotic flax
#

and even the classnames will say which side it belongs to (B = Bluefor, O = Optfor and I = Independent)

exotic tinsel
#

for uniforms?

exotic flax
#

yup

#

U_B_CombatUniform_mcam

#

of course, there are also items which are not tied to a side...

exotic tinsel
#

so you want to write a script after writing down all the diff variances in armas naming conventions. na mate this is simpler.

exotic flax
#

huh? how is it simpler to A) read the wiki and B) read the classname

#

not to mention... in scripts it's even easier... just use side

#

or better; get into the editor and it's already separated by side

exotic tinsel
#

you options require tons of time, the point of the script is you write it once and share. just hope on single player run it your done.

exotic flax
#

like gear is not side specific, so you won't be able to retrieve that anyway

exotic tinsel
#

i need a complete list of side for every item with out knowing how arma does everything. they are all right there on the units.

#

excatly mate. but we all know there are hats and helmets we dont want to some players wearing in the AO.

#

nvm all good it got it

exotic flax
#

and uniforms and backpack only have side specific ones due to the items inside

sharp grotto
#

Iam stupid and can't figure this out, maybe someone here can solve this problem or give me a tip 😡

Problem starts at line 87.
https://pastebin.com/QXqmcUF5

exotic tinsel
#

how do i get the sea-level for a position returned by BIS_fnc_findSafePos so i can teleport a player that is in the ocean to the ground level with out dying. this is way harder than i thought it would be.

random crescent
#

ATLtoASL

frozen knoll
#

@sharp grotto is there a [upgradeObject] in your sql_custom file ?

#

whats your rpt show

#

and your extDB logs?

#

also obviously to differentiate between the 2 when you set _IsExileOnly = false; is there a [upgradeObject_Wood] in your sql_custom file ?

exotic tinsel
#

@random crescent
here is my code. if they are in the water, they die when brought back to land.

private _safeloc = [_markerpos, 1, 10, 2, 0, 0, 0] call BIS_fnc_findSafePos;    
_player setpos _safeloc;
winter rose
#

funny. vanilla ?

exotic tinsel
#

@winter rose huh?

winter rose
#

Vanilla = base game, no mods @exotic tinsel

exotic tinsel
#

do you know how to help me? how do i get the z for a x,y pos? so they dont teleport in to the ground.

cosmic kettle
#

The code you provided works as intended.

#
private _markerpos = (getMarkerPos "myMarker");
private _safeloc = [_markerpos, 1, 10, 2, 0, 0, 0] call BIS_fnc_findSafePos;     
player setpos _safeloc;
exotic tinsel
#

yes, but when i execute it on a player who is in the water they die when sent back to land. how do i prevent that?

cosmic kettle
#

You can disable player damage when you do. As I said, I am executing it without dying here.

frozen knoll
#

what if you allowDamage false: then setpos then allowDamage true;?

#

oh just wrote that then it showed me stickies msg

cosmic kettle
#

Also @exotic tinsel Lou asked if you're playing vanilla, because mods can influence this.

exotic tinsel
#

well should have made that more clear

#

@winter rose no mods

cosmic kettle
#

From now on, whenever people ask if you're playing vanilla, you can safely assume this is why.

winter rose
#

Once you know the term Vanilla, it's crystal clear @exotic tinsel.

Strange behaviour from the game then, I have never had that

exotic tinsel
#

well because of the sarcasm and some times hostility in the channel here against noobs, its hard to know if i was being called vanilla, @winter rose we have talked about this, i know you understand.
and your message was "funny. vannilla?" so sometimes hard to tell when im just being made fun of here.
im tabbing out of channel to go debug this.

winter rose
#

No sarcasm intended, also I have hostility against noobs (a.k.a people not knowing what they do but "knowing more than you"), but I welcome and help newbies, be sure of that.

cosmic kettle
#

None of us meant this in a bad way, you'll get to know the souls that do and don't after a while.

winter rose
#

(…being called "vanilla" is a sexual insult at most πŸ˜‹)

exotic tinsel
#

i was executing this script from the server. sending it to the client to be executed made it work with out death.

#

dont know why but its fixed

winter rose
#

Noice

proud carbon
#

Hey what is the Command to find the AI piloting a helicopter?

winter rose
#

@proud carbon driver

proud carbon
#

Pilot = driver Heli?

winter rose
#

yes

proud carbon
#

Thanks man πŸ˜‰

still forum
#

Didn't know you could call a human "vanilla" learn something new every day.

queen cargo
#

as long as you do not mean "serve the human with vanilla" you should be fine i guess 🀷

#

vanilla humans then also are probably humans without modification πŸ€”

#

without tatoos for example

#

as that would be a retexture mod πŸ˜„

winter rose
#

I am then physically vanilla, no bodymod, no tatoo, no jewels, just some natural tan πŸ˜›

grave stratus
#

you vanilla!

winter rose
astral dawn
#

So which of those meanings do you mean

hollow thistle
#

boring πŸ‘€

winter rose
#

Which I am extremely, or not at all πŸ˜„
depends on how much you love these dad jokes

hallow mortar
#

I'm trying to have a soldier in the back of a medical HEMTT for scenery purposes. The problem: this soldier will not stop dismounting the vehicle as soon as the mission starts. I've set up setUnloadInCombat (not that the vehicle is in combat anyway), and the soldier has its AI disabled, and the vehicle is locked. Are there any other commands I'm missing that could help?

hallow mortar
#

and the soldier has its AI disabled
Already done. Still dismounts on mission start.

#

The vehicle is already set to Locked in the editor.

exotic flax
hallow mortar
#

disableAI is already set to "ALL" which should include FSM. The unit is already set to Careless.

#

I'm working on trying createAgent right now. Luckily I can read things people have already written.

#

the unit is clearly receiving the disableAI, as it stops animating as soon as it finishes getting out of the vehicle

#

and, you know, disableAI is literally the only thing in the unit's init field so I'm not sure what issues there could possibly be

#

Creating an agent and moving it into the cargo works.

half inlet
#

I've got a question regarding the HandleDamage EH - the wiki page states that, with HandleDamage,
Only the return value of the last added "HandleDamage" EH is considered.

so if I understand this correctly, if I add two EHs onto a unit, only the return value of the second EH will matter? meaning I can return any damage value I want in the first EH, and it wouldn't matter?

winter rose
#

yes.

half inlet
#

see, now I'm a little concerned - the theory (being that the last EH overrides all) doesn't seem to apply when put into practice in my test

#

I have a unit that I'm adding a simple HandleDamage EH onto, which always returns 0 (which should make the unit invincible)

#

however, the ID returned for the EH is 1, meaning there is already one other EH present on the unit before mine - which shouldn't be a problem, since the last EH should be the one that matters

#

unfortunately this isn't the case; my unit still takes damage

#

if, however, I run _unit removeAllEventHandlers "HandleDamage"; prior to adding my EH, the unit becomes invincible...

#

worth noting, I am using the dev branch (v1.97.146056)

#

does anyone know what could be causing this?

#

hm... turns out ACE3 was somehow responsible for it

#

HandleDamage works fine without it

still forum
#

ACE should add a handleDamage EH after yours

#

not before

#

EH id being 1, doesn't mean there are no EH's after yours

exotic flax
#

and ACE always returns 0 because it has its own damage handling

half inlet
#

thing is, I'm adding my EH ~1 second after spawning the unit to give other mods/scripts a chance to add their own EHs first, thus hopefully making mine last

#

and the other weird thing is, if I clear all HandleDamge EHs immediately before adding mine (so still ~1 second after spawning the unit), my EH works properly, implying that the issue was something added before my EH

#

I'm not sure what to make of this though

exotic flax
#

I use the following in the init of an unit:

[_unit] spawn {
    params ["_unit"];

    // wait for ACE to set the EH's
    sleep 1;

    // disable "all" HandleDamage event handlers (required to bypass ACE)
    _unit removeAllEventHandlers "HandleDamage";
    _unit setVariable ["ace_medical_HandleDamageEHID", nil];

   // add custom HandleDamage event
};
half inlet
#

yeah that's basically what I just tested with ACE, and that did the trick

#

the other solution is not using ACE, but that's an even worse approach (because I want to use the mod)

#

however what I want to know is why ACE's HandleDamage EH is behaving in such an odd way... I mean it's essentially ignoring the usual EH rules, in that it bypasses custom EHs that were added afterwards

#

can anything be done to fix that?

exotic flax
#

it's not ignoring it, it simply doesn't output any damage

#

and all damage is handled by the ACE injury system

half inlet
#

then why can't I add an EH onto the unit after ACE and return a custom damage value there? shouldn't that override ACE's HandleDamage EH, or am I missing something?

exotic flax
#

ACE's EH adds damage to it's own injury system, and then returns 0 for the next EH (or engine)

#

so any modifications after ACE are useless since damage is already set

half inlet
#

oh, by "after" I mean having my EH added after ACE added its EH, which in turn should mean (still going off the wiki description) that my EH, being the last, is the one that dictates the returned damage - instead of any EH before mine

exotic flax
#

but ACE doesn't use the vanilla damage system

still forum
#

I thought each EH gets the original value

#

not them cascading behind eachother

half inlet
#

aha, now that is what I was thinking

random crescent
#

The HandleDamage EH is inherently broken, which is why it behaves weirdly in ACE.

half inlet
#

I thought they cascaded, that would make more sense for mod compatibility (imo)

exotic flax
#

but even then... if ACE medical gets in play the amount of damage doesn't matter anymore... because you're already wounded

still forum
#

Them cascading is probably a bug. Some other EH's don't do that

half inlet
#

I'll need to do some proper testing, because I'm fairly convinced the modified damage that one EH returns isn't the same damage that another EH will receive

exotic flax
#

HandleDamage should return the (modified) damage so it can cascade

half inlet
#

to me it seems like currently every EH gets the original damage value, which would explain why ACE bypasses my EH

#

yeah, "should" is the word here πŸ˜„

exotic flax
#

ACE simply ignores it because it uses its own damage system; so no matter what you do, you will always have ACE wounds unless you reduce/remove damage before ACE EH triggers

half inlet
#

that's precisely what I was trying to achieve

exotic flax
#

If code provided returns a numeric value, this value will overwrite the default damage of given selection after processing. Return value of 0 will make the unit invulnerable if damage is not scripted in other ways (i.e using setDamage and/or setHit for additional damage handling). If no value is returned, the default damage processing will be done. This allows for safe stacking of this event handler. Only the return value of the last added "HandleDamage" EH is considered.

half inlet
#

I'll give it another test and if it turns out to be bugged, then I guess I'm just shit out of luck

#

what I'm gathering from the wiki is:

        EH 0            EH 1            EH 2
    (added first)                    (added last)

    >>----------->>----------->>----------->>----------->> order in which EHs were added
                HOWEVER:
    <<-----------<<-----------<<-----------<<-----------<< order in which EHs execute```
#

and by that logic, if EH2 sets the damage to any specific value - let's say 0 - then it would make sense for EH1 and EH0 to receive the modified value (in this case, 0) rather than the original damage value

#

but again, I'm only speculating here, I still haven't tested this

#

okay, yeah, it appears to pass the original damage on to the next EH rather than the modified one... this sucks

exotic flax
#

then the EH script doesn't return a value

half inlet
#

I don't think that's the issue, since my EH runs first

#

it's the fact that stacked EHs don't pass the modified damage value to one another, even when returning a value

#

kinda seems like a poor design choice to me

still forum
#

what I'm gathering from the wiki is:
nah, shouldn't.
its a for loop. from 0 to array length

jaunty ravine
#

Alright, once again I have found a speed bump: The unit insignia (patch) on the left arm disappears after respawning the second time. It works fine on the first respawn but after that there's no insignia again.

winter rose
#

Don't die, EZ

#

"normal" respawn, or revived, or another scripted framework?

jaunty ravine
#

Normal

#

Manual respawn if that is of interest.

winter rose
#

I admit I don't know. Vanilla ?

jaunty ravine
#

No, I'll test that right now though.

#

Using only CBA and ACE I can replicate the issues.

#

Same with pure vanilla.

#

I suppose it might be worth mentioning that the only way I was able to keep the insignia after respawn was by having the same insignia with two different class names.

#

This is both my initPlayerLocal.sqf and onPlayerRespawn.sqf:

if (groupId (group player) == "Alpha 1-1") then {[player, "AQ"] call BIS_fnc_setUnitInsignia};```
`AQ` is from description.ext.
dusk sage
#

I admit I don't know. Vanilla ?

Not even been 12 hours since your last insult, you monster @winter rose

winter rose
#

I live however I want!! πŸ˜„

median abyss
#

When using moveTo on a spawned agent, is it normal for the unit to just charge away towards the north? (Both spawned and issuing moveTo on the server)

#

(Ambient life, disabled the default AI)

#

Tried to setDir on the unit, noticed that it's running forward, not just to the north.

astral tendon
#

How to change the value inside of array? like

_array = ["one","two"];
(_array select 1) = "zero";
_array
```;
I want to make "two" become "zero";
finite dirge
#

set

astral tendon
#

thanks

jaunty ravine
#

Anyone got any ideas on how to make a unit insignia permanent, i.e. stay after respawn?

winter rose
#

use the respawn EH ?

tough abyss
#

respawn EH or onPlayerRespawn.sqf I'd say

jaunty ravine
#

It turned out I was experiencing a ArmA moment where I have to use both Respawn EH and onPlayerRespawn.sqf but with different class names in those files. (I have a mod with the insignias and also have them defined in description.ext)

gusty wind
#

does anyone know how to save byte with sqf to file

astral dawn
#

Only through addons

#

Well, you can save those through diag_log

#

but only to the .rpt file

tiny wadi
#

Is it possible to draw a 3d polygon?

#

I know 3d line is

young current
#

I dont think that is possible

#

unless you fill it with loots of lines

#

or if you mean like just the edges then that can be drawn with lines

#

you just have to calculate each point and linve between them

tiny wadi
#

Right yeah, I could do a bunch of lines intersecting to represent a plane

random crescent
#

You can create a map control with everything hidden (ShackTacs HUD uses that for example) and draw a polygon on there.

velvet merlin
exotic flax
#

I guess created in "Expressions of Eden Editor scenario attributes are called" and initialized in "Modules are initialized", so before initServer.sqf

#

unless you place them with scripts, then it should be direct (after a single frame)

velvet merlin
#

and does undefined trigger conditions break now/in 1.96?

still forum
#

I'd say module initialization too. But you'd really need to test that I'd say

#

Why would they?

#

undefined var in trigger should be same as before

velvet merlin
#

my last test of that mission was a year ago
there is a tank group linked to the first WP with a GV as true condition (aka to move on)
the GV is only set via init.sqf and spawn in another script

#

it appears the trigger breaks/wont get activated once the GV turns true later in the mission

winter rose
#

is it set to false in init.sqf?

velvet merlin
#

not yet. thats why i am asking

winter rose
#

First time it checks and there is an error because it is not defined, it won't retry after

#

Is it a publicVariable?

still forum
#

!issuewarning @cobalt charm crossposting

lyric schoonerBOT
#

Done.

velvet merlin
#

@winter rose no error, SP

winter rose
#

From experience I would say the trigger fires 0.5s after mission start

velvet merlin
#

as it turned out, its not an init order issue, but only one of the four AI tanks of the group starts to move 😬

tough abyss
#

anyone know a good way to know what weapon the pilot from a vehicle is using

#

weaponState and currentWeapon wont work sometimes

finite dirge
#

wont work sometimes
What do you mean?

tough abyss
#

for example if i'm plane it works just ok

#

but if i'm in a dual seat helicopter it only works if there is a gunner

winter rose
#

weaponTurret or other *Turret command @tough abyss

finite dirge
#

*weaponsTurret

You could probably use assignedVehicleRole to get the turret path of your unit but it may need to be run on the server.

tough abyss
#

oki doki will try thatr

median abyss
#

Is there any easy way to fill all of the cargo seats of a heli that's airborne?

high marsh
#

what do you mean "fill" them?

median abyss
#

Put units in every seat

astral dawn
#

Sure, iterate all cargo seats, createUnit, moveInCargo, etc...

median abyss
#

Just succeeded using that method πŸ˜‰

#

Thanks

astral dawn
#

(alt syntax)

#

np

jaunty ravine
#

How do I depending on a player's UID assign an object texture? Currently my code looks like this:

_uidPltCO = getPlayerUID Platoon_CO;
if (playerUID == _uidPltCO) then {player setObjectTexture [3,"Patches\OEF-CP_Karlsson_2LT.paa"]};```
`playerUID`was just a shot in the dark and doesn't actually exist.
rough dagger
#

I was looking for some advice about MP. I currently have this as a simple distance check, and works ok in SP (I accept it is probably not best practice..):

#
someBoolCheck = false;
while {true} do {
  _posAthira = getMarkerPos "AthiraMilBase";
  _metersAthira = player distance _posAthira;

  if ((_metersAthira <500) && (!someBoolCheck)) then {
    hint "you are roughly 500m away";
    // some other code 
    someBoolCheck = true;
  };

  sleep 20;
};
#

If I wanted to run this in a true MP setting, how would I apply this check to all players?

#

Would I add a link to this script via initPlayerLocal?

hot kernel
#

how do I make this right?

waitUntil {sleep 3; player getVariable ["scoreBLUE", 0] > 99 or player getVariable ["scoreRED", 0] >99};
#

I can see it's clearly the or that's wrong but why?

tough abyss
#

{sleep 3; ((player getVariable ["scoreBLUE", 0] )> 99) or ((player getVariable ["scoreRED", 0]) >99)};

#

maybe?

hot kernel
#

@tough abyss , yeah that's totally it, thanks!

winCOND=[]spawn{waitUntil{sleep 3; ((player getVariable ["scoreBLUE", 0] )> 99) or ((player getVariable ["scoreRED", 0]) >99)}; systemChat format ["%1", player getVariable ["scoreBLUE", 0]];};
velvet merlin
#

any way to detect if you have blackscreen from cutRsc and family?

velvet merlin
#

{_x assignAsCargo t34_1;} forEach units group this; {[_x] orderGetIn true;} forEach units group this;"
AI wont get in if you as player (GL/effective commander?) are in said vehicle - this used to work BI 😐

jaunty ravine
#

@wraith cloud Thanks! Works perfectly!

proud carbon
#
            _wp4 = (group _Pilot) addwaypoint [getPosATL _LZnew, 0];
            _wp4 setWaypointType "UNLOAD";
            _wp4 setWaypointStatements ["true", "_HeliS land 'LAND';"];```
#

for some reason my Heli wont land on the USS freedom. the code above is what used to work in a previous script. could someone assist please?

tough abyss
#

In Arma II how did people remotely execute code like we do now with BIS_fnc_MP and remoteExec?

still forum
#

With BIS_fnc_MP

#

publicVariable/addPublicVariableEventHandler

bitter lark
#

So, say I want to have a specific player with the variable name "engineer" and I wanted said player to climb a radio tower where a trigger is at. How would I make it to where when the Engineer is standing in the trigger, he gets a hold user action to repair it (which just activates a trigger progressing the mission.), but if the engineer leaves the trigger area he loses the prompt?

winter rose
#

addAction, removeAction

burnt cobalt
#

hi there - is there a way to use setVelocity on units that are dead or unconscious? (i think it's basically just that ragdoll is on)? I'd like to script units being blown out of a bunker, but I can only apply setVelocity once the uit has fallen to the ground

winter rose
#

Hum, no it should work - maybe put them slightly above ground level @burnt cobalt

half inlet
#

(continued from #arma3_config)

@velvet merlin I'm not sure how useful this will be to you, but my code for getting vehicles unstuck is:

// If the vehicle has been stuck reversing at <3km/h for a while, give it a forward boost
if (_speed < _stuckSpeed and {_speed > -_stuckSpeed}) then {

    if (_time - _lastMoveTime > _delayUntilStuck and {isTouchingGround _veh}) then {
        _lastMoveTime = _time;
        _unstuckSpeed = [10, -10] select (_unstuckSpeed > 0);
        _forceMul = getMass _veh / 100;
        _centerOfMass = getCenterOfMass _veh;

        for "_i" from 5 to 20 do {
            _speed = speed _veh;
            _veh addForce [_dirVeh vectorMultiply ((_unstuckSpeed - _speed) * _forceMul * _i), _centerOfMass];
            sleep 0.02;
        };
    };
} else {
    _lastMoveTime = _time;
};```

*(edit: fixed the indentation)*
#

with

private _delayUntilStuck = 2;        // in seconds - how long a vehicle may be stuck in reverse before we give it a push
private _stuckSpeed = 3;        // in km/h - if the vehicles moves slower than this speed, we consider it as "stuck"
#

ngl, it's quite ugly, and the numbers are rather imperical (they're the result of lots of trial and error, so not much logic behind them), but it works

#

the comment at the top isn't 100% accurate either anymore, since it will either apply forward or backwards force (it alternates between the two)

velvet merlin
#

@half inlet thanks! why addForce instead of setVelocity? also why the 15 repetitions - needs to create enough sustained force?
and do you run this scheduled/unscheduled and per vehicle, or one global loop?

half inlet
#
  • addForce because setVelocity would allow a kart to push a tank out of its way πŸ˜›

  • 15 repetitions because, from my testing, that seemed like a high enough amount to get the vehicle going, but not too much so as to impede the AI in its driving/steering routine

  • the script runs in scheduled environment (as otherwise sleep wouldn't work) and is "attached" to the vehicle

#

also, the reason for the seemingly random loop indexes is because I use _i as a force multiplier inside the loop, to act as a linear buildup for the force's strength

#

think of it as a function in the form y = ax + b

velvet merlin
#

@half inlet the main design question is how to check the state for all vehicles continuously
people here usually recommend unscheduled and one loop for all vehicle (rather per vehicle) - once necessary you can still spawn a "thread" for the addForce

#

little optimization idea:

  • _forceMul and _centerOfMass one could also cache per (vehicle) type
  • one only needs to update the _lastTime once it gets too slow, and only once its in this state, one needs to reset if again above the threshold
half inlet
#

oh, for sure, this snippet of code is still just a draft in its current stage, one that I'm going to revisit in the future (once I fixed some of the more important issues)

#

it's also part of a bigger script that handles the vehicle's driving using setDriveOnPath, and it needs to run frequently (about 3 times per second) to do its job properly, so I decided to do it in a scheduled environment

#

I'm not expecting to have more than a dozen vehicles using this script at any given time (on average it's more like 3 to 4 vehicles), so performance wise it's not a big concern (yet πŸ˜› )

round scroll
#

is there a way to spawn a Module from a menu in Eden tools? create3denentity or some such?

#

oh, was easier than I thought: e = create3DENEntity ["Logic", "uns_ModuleCarpet", getPos player];

#

how do I get the pos for the current center view of the player in Eden?

#

screenToWorld [0.5, 0.5] was just a quick google away, sorry for the noise

plain urchin
#

is there any check i can do to see if there is music playing? im trying to make it so there is tense music playing when player group is safe/aware behaviour, and combat music when they go to combat behaviour, and when the behaviours revert, the tense music starts playing again

round scroll
#

question on updating a setVariable'd variable in a module in Eden - how do I get the UI of the module to show the new value of the variable. The following code works in debug console, but the module still shows the old variable value for bomb in the UI: sqf e = create3DENEntity ["Logic", "uns_ModuleCarpet", screenToWorld [0.5, 0.5]]; systemChat str (allVariables e); systemChat str (e getVariable "bomb"); e setVariable ["bomb", "flip"]; systemChat str (e getVariable "bomb");

#

e.g. the last systemChat prints flip, with the UI showing uns_bomblauncher_dl, the default

#

probably the setVariable is the wrong approach for persisting a change in the module in eden?

glad kindle
#

Anybody know if there is a way to switch

#

who can access a uav terminal

#

I want my Indie guys to be able to access the VLS thru the terminal

#

but seems to be hard find

winter rose
#

yes, in a way.

glad kindle
#

Awesome

#

any idea

glad kindle
#

that helps

#

do you think this would

#

unit enableUAVConnectability [uav,true];

#

would UAV in that case be the name of the UAV

#

Okay thanks

#

I think i got it

#

unit enableUAVConnectability [uav,true];

#

would be "this enableUAVConnectability [VLSU,true];

#

nvm

#

didnt work

#

I donno cant figure it out

#

unit enableUAVConnectability [uav,true];

#

where would I put that

#

one which unit

#

on

#

the vls or the guy

#

or in like initserver

glad kindle
#

Welp

#

well if anybody knows how to make UAVs controlled by any faction let me now

#

nvm I did it

#

This is the code I used ran thru an addaction sqf

#

player remoteControl gunner UAV1;
gunner UAV1 switchCamera "Internal";

#

and now my prob is I wont lock onto indie lasers

winter rose
#

Because it is still west

#

Make West friendly to Indep, should work

glad kindle
#

but they are the enemy

#

ill find another way around it

#

I could just make a remote designator accessible with the VLS

#

from nato

oblique arrow
#

cant you just make the VLS indep?

glad kindle
#

not as far as I know

oblique arrow
#

try deleting the blufor VLS crew and putting in indep drone crew

glad kindle
#

through code?

#

what is the code or what could I call the little loading animation

#

you know the circle

#

for force respawn and in some campaign missions

#

whats that called if I wanna find the code for it

oblique arrow
#

Not through code, in the editor

#

One sec lemme try it

glad kindle
#

not sure I can just grab a drone crew in the editor

#

or delete it

#

on a vehicle you can hover over the guys symbol and delete

#

but no such thing on a uav

grizzled spindle
#

Is there much difference performance wise between sending data via: addPublicVariableEventHandler and remoteExec'ing?

astral dawn
#

It's unlikely/unknown, but doing so with remoteExec is always better in terms of functionality

#

Unless it's some trivial data which is read-only on client

#

Although... if you are just doing remoteExecCall which will only setVariable somewhere inside, well, it's a few more SQF commands

tiny wadi
astral dawn
#

@tiny wadi Just use AGLToASL on its output

#

Or do you mean that it has problems above water?

tiny wadi
#

Well the command returns 0 for elevation regardless of where you click is the main problem

#

I want similar function to how the Eden editor can still place an object in space even if you don’t click on the terrain

still forum
#

get view direction from eyes, and just use math to get position in whatever distance you want

#

cameraViewDirection, eyePos, vectorMultiply

#

Land_Pallet_F ?

astral tendon
marsh storm
#

does it matter where I execute missionNamespace setvariable [foobar];

#

i.e. do I explicitly need to execute that on the clients and the server in my script or is a variable in missionNamespace automatically updated across all machines?

winter rose
#

@marsh storm the command has local effect; if you create a mission variable, you can broadcast it with publicVariable

marsh storm
#

@winter rose thanks!

astral tendon
#

any exemple on copy and paste customizations to another vehicle?

winter rose
#

wat

astral tendon
#

I have a Angara that has a black texture with camo net and nother that has has default configuration, I want to copy the customization of the black Angara and pass to the default Angara, how to do it?

winter rose
#

maybe from the Eden edit menu, Ctrl+C / Ctrl+V? IDK

astral tendon
#

in game?

winter rose
#

ye

astral tendon
#

this is how im doing now

{ 
    { 
            _VehicleLoadout = [_x,""] call BIS_fnc_exportVehicle;
            _x setVariable ["Loadout",_VehicleLoadout];
            [_x] call RTG_fnc_VehicleSafeSpawn; 
            Private _code = {
                _Loadout = ((_this select 0) getVariable "Loadout");
                (_this select 0) call compile _Loadout;
                _VehicleLoadout = [(_this select 0),""] call BIS_fnc_exportVehicle;
                (_this select 0) setVariable ["Loadout",_VehicleLoadout];
                [(_this select 0),(_this select 1)] call RTG_fnc_VehicleSafeSpawn;
                }; 
            Private _value = _x getVariable "bis_fnc_modulerespawnvehicle_data"; 
            _value set [3,_code]; 
            _x setVariable ["bis_fnc_modulerespawnvehicle_data",_value]; 
    } foreach (synchronizedObjects _x); 
     
} foreach (allMissionObjects "ModuleRespawnVehicle_F");

It works, but I was said that call compile is evil and bad, so I would like other alternative.

astral tendon
#

its does not uses the same array as BIS_fnc_getVehicleCustomization

winter rose
#

then IDK

still forum
#

if you have a loadout script as text, then you need to call compile to execute it

#

Sometimes there is no alternative

grizzled spindle
#

This may sound like a stupid question but... If I have a file with lots of functions, for example:

Function1 = {
    //Do stuff
};
Function2 = {
    //Do stuff
};
Function3 = {
    //Do stuff
};```

How do I 'load' that file, do I need to compile it or anything or is including it into the cfg functions enough?
digital hollow