#arma3_scripting

1 messages ยท Page 670 of 1

cyan dust
#

But I can't quite understand, what the latter '100' means?

cyan dust
#

One more. I'm looking at taw_vd (view distance scripts) and I see "class Initialize", as I understand, it auto-executes its scripts, but I don't want them to be executed on dedicated server. Did anyone resolve this?

little raptor
cyan dust
little raptor
#

it's a scripting command. you can't put it in the config

cyan dust
#

Sorry, only stateTracker is called on Initialize or all of them?

class TAW_VD {
    tag = "TAWVD";

    class Initialize {
        file = "view_distance";
        class stateTracker {
            ext = ".fsm";
            postInit = 1;
            headerType = -1;
        };
            
        class onSliderChanged {};
        class onTerrainChanged {};
        class updateViewDistance {};
        class openMenu {};
        class onChar {};
        class openSaveManager {};
        class onSavePressed {};
        class onSaveSelectionChanged {};
        class autosaveOnMenuClose{};
    };
};
little raptor
cyan dust
little raptor
#

Sorry, only stateTracker is called on Initialize or all of them?
stateTracker is the init (postInit = 1)

little raptor
cyan dust
cyan dust
little raptor
hushed tendon
#

Someone mind helping me fix up my script. The while loop is breaking the rest of the code.

WAG_animalAttack = 
{
params["_ai", "_animal", "_grp"];

[] spawn {
    while{alive _ai} do {
        _targets = ASLToAGL getPosASL _ai nearEntities ["Man", WAG_animalDetectionRange];
        _target = _targets select 1;
        if !(isNil "_target") then {
            for "_i" from count waypoints _grp - 1 to 0 step -1 do
            {
                deleteWaypoint [_grp, _i];
            };
        _wp = _grp addWaypoint [_target, -1];
        };
        sleep 1;
    };
};
};
hushed tendon
#

That good? ^^^

#

nope I forgot the params

little raptor
hushed tendon
#

outside the function?

little raptor
#

do you call the function?

hushed tendon
#

yes

little raptor
#

spawn it instead

#

[blabla] call WAG_animalAttack -> [blabla] spawn WAG_animalAttack

hushed tendon
#

ah

#

Well it works but I now need to exclude other "rabbits" from the target list

little raptor
hushed tendon
hushed tendon
#

Probably a few things wrong with it

vestal hearth
#

Hey all, I'm making a custom faction mod, and I'm bumping into an issue. I have no idea what I'm doing and working from templates and learning as I go.

Issue is that the uniform on the soldiers shows up on the character, but not as an equipped container. In other words: In the inventory the soldier is "naked", but in game it looks like he has his uniform on.

The uniform is from a mod, and the inventory list was exported from ACE arsenal. Other than that, the rifle optics is also missing, but everything else is there.

Does anyone who has experience with this have time, and want to help me with this issue? Much love

crude vigil
#

@vestal hearth That is more of a #arma3_config question but you probably set (cfgVehicles >> yourUnit >> nakedUniform) to your uniform instead of a naked uniform.

vestal hearth
#

Thanks @crude vigil, I'll ask there! I'm quite new to this, so sorry for posting in the wrong group ๐Ÿ™‚

hushed tendon
#

Anyone able to help me make a script that runs privately for every unit in an array. I'm trying to make each unit individually look for the closest enemy unit and run up to them.

#

I have something but it breaks as I don't know how to make it run separately for each unit.

willow hound
#

Please, do share your code ๐Ÿ™‚

hushed tendon
#
[_ai, _animal, _grp] spawn WAG_animalAttack;
WAG_animalAttack = 
{
params["_ai", "_animal", "_grp"];

    while{alive _ai} do {
        private _targets = ASLToAGL getPosASL _ai nearEntities ["Man", WAG_animalDetectionRange];
        private _target = _targets select 1;
        if !(isNil "_target") then {
            for "_i" from count waypoints _grp - 1 to 0 step -1 do
            {
                deleteWaypoint [_grp, _i];
            };
        private _wp = _grp addWaypoint [_target, -1];
        };
        sleep 1;
    };
};
willow hound
#

And what you want is WAG_animalAttack running for several units at once?

hushed tendon
#

I want each unit to pick their own closest target and run up to them

#

but for each ai in the array

willow hound
#

In which array?

hushed tendon
#

_ai is the moving unit
_animal is the rabbit attached to their _ai
_grp is the _ai's group

hushed tendon
#

but there is an AI created for each "C_man_p_beggar_F" placed

willow hound
#

Ah, that's what I was after.

#

Do you have a collection of those available?

hushed tendon
#

What do you mean? Like a few "C_man_p_beggar_F" placed in the mission?

willow hound
#

Or are you dynamically creating them?

hushed tendon
#

If you take a look here [https://pastebin.com/NMh3MAmJ] this is how I'm running the script

 ["C_man_p_beggar_F", "init", {_this call KB_fnc_killerAnimals;}, true, [], true] call CBA_fnc_addClassEventHandler;
wary lichen
#

any ideas for locally execute selectPlayer _unit for current player

willow hound
#

What kind of ideas are you after?

wary lichen
#

any ideas*

willow hound
hushed tendon
#

I'm trying to eventually have it so that when "C_man_p_beggar_F" is spawned it will be replaced by a rabbit that hunts down nearby units and nibbles on their legs

willow hound
#

And with which specific object do you intend to fill the _ai parameter?

hushed tendon
willow hound
#

Well, first we need to retrieve that specific unit then. Have you looked into that?

hushed tendon
#

In JBOY_spawnAnimalAI I am spawning the WAG_animalAttack.

_grp = createGroup civilian;
    _ai = _grp createUnit ["C_Man_1", _pos, [], 0, "FORM"];
    //_ai = createAgent ["C_Man_1", getPosATL player, [], 0, "FORM"];
    //[_ai] joinSilent _grp; 
    [_ai, _animal, _grp] spawn WAG_animalAttack;
willow hound
#

But then you are already running a separate instance of WAG_animalAttack for every AI-Animal-Pair. ๐Ÿ™‚

hushed tendon
#

Should I send you the mission file so you can see the issue?

dusk badger
#

So This code appears to only give me full missiles after it reaches to 1 left I would like to know I I can reaload with 0 missiles left and if possible add a timer between each shoot

Rhea SAM
this addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}] I now is sleep but where do I put it?

willow hound
manic sigil
#

First time testing my year+ coding adventure of a mission in multiplayer environment!

30 Minutes Later

T_T

willow hound
hushed tendon
willow hound
#

Might be able to fix the waypoint position with _grp addWaypoint [getPosASL _target, -1]; (addWaypoint documentation specifically states to use PositionASL if radius is negative).

#

Them targeting each other... you're using nearEntities with "Man" and the AI is of type "Man".

hushed tendon
#

anyway to exclude them?

willow hound
#

Use setVariable to set a little marker variable on them and check for the presence of that variable when selecting a target in WAG_animalAttack.

hushed tendon
#

got it

manic sigil
#

Okay, working down my list...

I think most of it can be solved by switching my 'remoteexec ["execVM",2]s for ["execVM",0], except for the .sqf files I'm executing that will spawn in units, those have to be execVM 2'd so they're only on the server.

#

And a few actors need to have their switchMove turned into a global statement, not just in their init field

hushed tendon
manic sigil
#

The thing I'm not understanding though, is how every CSAT unit I placed has my generic white face o.0

hushed tendon
# willow hound Use `setVariable` to set a little marker variable on them and check for the pres...

Something like

WAG_animalAttack = 
{
params["_ai", "_animal", "_grp"];

    _ai setVariable ["WAG_animalAI", true];
    _selectTarget = 1;  

    while{alive _ai} do {
        private _targets = ASLToAGL getPosASL _ai nearEntities ["Man", WAG_animalDetectionRange];
        [_targets] spawn WAG_checkTarget;
        WAG_checkTarget = {
        params ["_targets"];
             private _target = _targets select _selectTarget;
             if (_target getVariable ["WAG_animalAI", true]) then {
                _selectTarget 1++;
                [_targets] spawn WAG_checkTarget;
             };
        };
        if !(isNil "_target") then {
            for "_i" from count waypoints _grp - 1 to 0 step -1 do
            {
                deleteWaypoint [_grp, _i];
            };
        private _wp = _grp addWaypoint [_target, -1];
        };
        sleep 1;
    };
};
drifting sky
#

Questions. 1) Does addPublicVariableEventHandler fire each and every time the variable it is attached to is changed via publicVariable* functions? 2) Can publicVariableServer set from the server to the server, in the event of a serve and play setup?

winter rose
willow hound
little raptor
#

and don't use execVM

little raptor
manic sigil
#

But they're not setFace'd o.0 They're just regular units, except like 98% of them have my generic face instead of the generic CSAT face.

little raptor
#

Depends how you created them

little raptor
#

that's not valid even in c++

manic sigil
#

These units were simply placed in the editor, and a few edited for equipment but otherwise untouched.

As for changing remoteexec targets, I know it's not going to be that easy, but it's a starting point. It's partially successful, but I know I have a lot of tweaking to do to get it multiplayer ready.

merry mason
#

Sorry it took so long for me to respond lol. I was unable to find the ww2_fnc_findPlayer function sadly.

manic sigil
#

There we go... thankfully, I compartmentalized enough of my coding that switching remote targets is surprisingly working pretty well.

#

Unless I have Matryoshka-layered targeting problems xD

#

Staging .sqf called to all hosts, calls a dialog staging .sqf to all hosts... calls the individual texts to server where they won't display

#

Or, in order to get the staging to work by calling it on the clients, I forget that setFriend is in there and has to be called on the server xD

#

One thing after another

manic sigil
#

Ahh, the extract helicopter spawn is in a script I pushed to the clients... gonna have to pull that one out.

#

Or... it did work and they immediately crashed? o.0 Hmm.

#

New oddity, some units I hideObjectGlobal'd turn to neutral yellow :/

dusk badger
#

this addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 0}] like this? @willow hound

sour tapir
#

Hey, I am trying to set a variable with a numerical value then add/subtract from it. I am unsure of how to do this in arma? For a dedicated server. I am using the variable as a method of counting 'ammo', for example I am trying to do:

TEST123 = 1;
if (TEST123 > 0) then;
// Code here

I have also tried, among variations:

_MyVariable setVariable ["TEST123", 1, true];

These are in sqf files, which are executed with execVM

/// nvm solved i was dense

manic sigil
#

Alright, resolved most of my issues... except that my BIS_fnc_holdActionAdd's are coming up multiples, one per server and client T_T

cosmic lichen
#

How and where are you adding it?

manic sigil
#

That gets a little complicated xD

#

Alright, I have initServer, which calls my Staging.sqf on Server, which calls the Task.sqf on server, which calls the holdActionAdd... wherever, I've tried different interpretations, from 2 to -2.

#

remoteExec ["BIS_fnc_holdActionAdd", 0, IGNITE32];

#

Hrn... should I be scripting it as a Call? I liked the remoteExec version because it was neatly formatted in the wiki.

cosmic lichen
#

The code you posted should work

#

when exactly is it duplicated?

manic sigil
#

The task that calls it doesn't fire until the previous task, getting everyone off a helicopter, completes; and then it hits a waitUntil for the player to get 200m away.

#

But you look at the guy, and see two actions, and they do not interact nicely - he'll heal, then immediately go back into wounded animation.

cosmic lichen
#

Post the script which adds the add action

manic sigil
#
//in initServer:
"Scripts\Staging.sqf" remoteExec ["execVM",0];

//in Staging.sqf
"Scripts\Tasks\T43.sqf" remoteExec ["execVm",0];

//In T43, rescue Ignite32
IGNITE32 disableAI "all";
IGNITE32 switchmove "UnconsciousReviveBody_B";
ignite32 setdammage .4;
Ignite32 allowdamage false;
waitUntil {Vip11 distance IGNITE32 < 250};

//A bunch of dialog, works fine, cut for space -ed

sleep 56;

[East, ["Rescue","Operation1"], ["On approaching IGNITE, a radio signal finally breaks the silence; IGNITE 3-2 confirms that the convoy is under attack, before being wounded. <br/><br/> Locate IGNITE 3-2 and provide medical support", "Rescue", "cookiemarker"], [IgniteMedical] ,1, 1, true] call BIS_fnc_taskCreate;
["Rescue","heal"] call BIS_fnc_taskSetType;

Ignite32Detected = createTrigger ["EmptyDetector", [7146,16423,0]];
Ignite32Detected setTriggerArea [3, 3, 0, true];
Ignite32Detected setTriggerActivation ["ANYPLAYER", "PRESENT", true];

waitUntil {triggerActivated Ignite32Detected};

//More dialog, also works fine - ed

 [
        IGNITE32,
        "Triage",
        "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_reviveMedic_ca.paa",
        "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_reviveMedic_ca.paa",
        "_this distance _target < 3",
        "_caller distance _target < 3",
        {},
        {},
        {T432 = true; Ignite32Triage = _this select 1;"Scripts\Chatlogs\Ignite32.sqf" remoteExec ["execVM", 0];},
        {},
        [],
        6,
        1,
        true,
        false
    ] remoteExec ["BIS_fnc_holdActionAdd", 0, IGNITE32];
#

Ugh, I can never post code without Discord flipping out at me T_T

cosmic lichen
#

Should work

manic sigil
#

I mean, it does work, but the doubling of tasks has me concerned that if played in a proper multiplayer setting, it'll do one action added per client, and that's a mess.

cosmic lichen
#

how are you adding the tasks?

#

Also with taskCreate?

#

Dont remoteExec these

#

"Scripts\Tasks\T43.sqf" remoteExec ["execVm",0];

manic sigil
#

Hrn :x What would be the recommended way, for multiplayer compatibility? Calling on the server?

cosmic lichen
#

BIS_fnc_taskCreate has global effect, meaning it will already be added to all clients

#

only call it on the server

manic sigil
#

Of course x_x it wouldn't happen to be workable to just wrap the tasking scripts in a [xxx] remoteExec ["verb", 2], would it?

#

I'm dreading I already know the answer. Blah.

cosmic lichen
#

What's in the task script?

manic sigil
#

As above; T43.sqf contains the scripts for establishing the scene, waiting until the player is close (which is probably also going to have to change to a trigger, now that I think about it...), running BIS_fnc_EXP_camp_playSubtitles, creating the task, adding the actions, and completing the task with a global variable flip.

cosmic lichen
#

just wrap BIS_fnc_taskCreate in if (isServer)

manic sigil
#

I keep forgetting that's a thing.

#

I'mma doctor this up and see how it goes

azure coral
#

Good evening, I am wondering if anyone can help. We have a private mod we use for the purpose of editing faces/adding tattoo's to the players body. This mod was working completely fine on the server up until recently, and then suddenly no one was able to load into the mission due to this error:

19:55:08 "DW_fnc_unitInit: init B Alpha 3-3:1"
19:55:08 Warning Message: No entry 'bin\config.bin/CfgFaces/Man_A3/whitehead01.identityTypes'.
19:55:08 Warning Message: Size: '/' not an array
19:55:08 Warning Message: No entry 'bin\config.bin/CfgFaces/Man_A3/m_white_15.identityTypes'.
19:55:08 Warning Message: Size: '/' not an array

CC #server_admins, since I believe it may also be relevant here.

cosmic lichen
#

identityTypes property is not defined.

#

Probably a wrong inheritance or so

azure coral
#

Would you mind walking me through it if I grab the code? Just want to make sure I am doing it right, I am rust with SQF

cosmic lichen
#

has nothing to do with sqf

#

it's cpp

azure coral
#

Ty ty

manic sigil
#

@cosmic lichen if isServer may have just been the thing, thanks! ๐Ÿ˜„

cosmic lichen
#

Glad I could help ๐Ÿ™‚

manic sigil
#

Yup, now onto why it's not loading the second action after the first one runs XC

merry mason
#

Is it possible to disable or delete a module with a trigger so it no longer effects the object its synced to?

torpid quartz
#

Trying to set a random bool as true when a trigger is activated, but in a way that it cannot be activated again when other triggers run the same code.

defined in init:
_array = ["TRIG1A", "TRIG2A", "TRIG3A", "TRIG4A"];
triggers activates: 
_random = _array select floor random count _array;
_random = selectRandom _array;
_random=true
then something here to delete _random from the array, not sure i can use "deleteAt" for this

any ideas on what to do with the last line that would delete _random from the array?

#
defined in init:
_array = ["TRIG1A", "TRIG2A", "TRIG3A", "TRIG4A"];

triggers activates: 
_random = _array select floor random count _array;
_random = selectRandom _array;
_random=true
_index = _array find _random
 _array deleteAt _index

how's that looking? I'm not sure if _index = _array find _random is something that would work

little raptor
little raptor
slim oyster
torpid quartz
#

I've got triggers that have the condition of a side being present and a bool needing to be true. So they can't be completed until the book is true.

Im using this so when another trigger is completed It picks a bool at random to be true and thus one of these triggers becomes completable

little raptor
torpid quartz
#

Though I obviously don't want it to set a bool that's already to be true to be true again, but pick one that isn't

little raptor
slim oyster
#

hmm, could just check var status in condition with array of varnames

torpid quartz
#

I don't know how lol. (in reply to making triggers)

slim oyster
#

private _varValue = missionNamespace getVariable [_varName, false]

torpid quartz
#

Plus I need to create 2 in the same place but that place is picked at random

slim oyster
#

you would get _varName from a selectRandom on your array of names

little raptor
torpid quartz
#

I uh, have no idea how. and I also have no idea what you're going on about pizzadox lol

#

hmmm ||thinking hang on||

little raptor
torpid quartz
#

ok yeah that would work if I was only doing it once. but I want to do it for each point, if i did that I multiple times it could create the triggers in the same place it did before

Basically what's happening is 3 capture points are being created randomly 1 after the other.

little raptor
torpid quartz
#

that sounds like my ticket. I just have no idea how to do that lol.

#

um, i'll take a shot i guess and post back here when i get stuck

pulsar bluff
#

@still forum are these new commands "setCombatBehaviour" similar to "setBehaviourStrong" or does the behaviour change according to the group ai logic?

torpid quartz
#

@little raptor

hang on no I don't want to randomly place triggers at defined spots, I need existing ones to activate.
This is briefly what I'm doing

I was guessing i could create triggers with the condition of Blufor not present.
Then have 1 of 3 triggers randomly spawn with these conditions which would make their respected bool true, but if I'm spawning the same trigger just at random locations that wouldn't quite work.

If it could go to 3 potions each with a blufor unit at one, a indi at another, and a civi at the last or something and depending on what unit side it detected when it got there make a certain bool true it could work, but it seems rather crude.

what i'm doing real quick is:

This is a multiplayer gamemode.
There is 3 terminals on a map.
at the start 1 out of 3 triggers would be activated randomly that would create tasks for each team and show (using hide/show) an object with a hold action at the designated terminal.
The hold action would set a bool to be true (eg TRIG1A), once it was completed by either side 2 more triggers at the terminal would now be complete-able, one for each team, they would be something like this, here's Blufor's one.

Blufor present "this && TRIG1A && !TRIG1GC" triggers. (so when blufor present, trig 1 is active, trig 1 hasn't been captured by indepent)

Once one of those triggers is completed this would start all over again by at one of the remaining terminals.

#

so yeah,
trying to set a random bool as true, but in a way that the same bool cannot be set as true again and another remaining bool is picked when the same code runs.

#
defined in init:
array = ["TRIG1A", "TRIG2A", "TRIG3A", "TRIG4A"];

triggers activates: 
Trandom = selectRandom array;
Trandom=true
index = array find Trandom
array deleteAt index

so got rid of _ to make it all global, turned _random into Trandom since i assume random is an actual command.
I guess this doesn't work since TRIG1A in the array doesn't count as a bool or something that can be set to true, hmm.
I could define TRIG1A and etc as bools in the init, but then somehow comparing the string i pulled out of the array against the bools to check which one to make true, whew need to look at the wiki more.

#

wait scratch all of that.

I could set pos a civi to 1 of 3 location randomly, and at each location have a trigger that set's off what I need to.

copper raven
#
//init somewhere
TAG_triggerVars = [...];


if (TAG_triggerVars isEqualTo []) exitWith {};

missionNameSpace setVariable [TAG_triggerVars deleteAt floor random count TAG_triggerVars, true];

?

#

then remove the variable from the array if it gets activated by itself

torpid quartz
#

@little raptor how would you delete specific elements after using them? as far as i can tell it was the same thing i was trying to figure out last time before we figured out it was all bad haha.

allSpawnPos = [ [4783.464,6112.624,3.453],[4728.515,6154.601,4.023]]; 
randomPos = selectRandom allSpawnPos;
CIVI1 setPos randomPos;
<part that deletes the element that randomPos is currently using so CIVI1 can't be teleported back there>;
cosmic lichen
#
array = [1,2,3,4,5]; 
test = selectRandom array; 
array = array - [test]; 
array
``` @torpid quartz
torpid quartz
#

array = array - [test];

whew baby that's what we're looking for!
I'm still trying to wrap my head around what sharp's code but I appreciate it.

copper raven
#

it selects a random var from the array, and sets its value to true

cosmic lichen
#

missionNameSpace setVariable [TAG_triggerVars deleteAt floor random count TAG_triggerVars, true];
Variable needs to be string

copper raven
#

and it's also deleted from the array

torpid quartz
#
allSpawnPos = [ [4783.464,6112.624,3.453],[4728.515,6154.601,4.023]]; 
randomPos = selectRandom allSpawnPos;
CIVI1 setPos randomPos;
allSpawnPos = allSpawnPos - [randomPos];

@cosmic lichen ?

copper raven
#

it is string

cosmic lichen
#

try it

torpid quartz
#

will do

#

Yup it worked

#
int:
allSpawnPos = [ [9019.032,10213.902,0],[9035.497,10220.25,0],[9005.021,10208.504,0]]; 

in the triggers:
hint "trig (trig number) active";
randomPos = selectRandom allSpawnPos; 
CIVI1 setPos randomPos; 
allSpawnPos = allSpawnPos - [randomPos];

in the initial trigger:
randomPos = selectRandom allSpawnPos; 
CIVI1 setPos randomPos; 
allSpawnPos = allSpawnPos - [randomPos];

#

beautiful.

Thanks @copper raven @cosmic lichen @little raptor.

Not the way I was originally thinking of doing this, but teleporting a civi around to set off triggers in random order certainly works haha.

#

had each trigger on a 1 second delay that popped a colored smoke grenade to make sure

cosmic lichen
#

Why not directly activate the triggers randomly?

torpid quartz
#

I would love to and it's what I was trying to do first but got stuck when i figured out the strings in the array are not the same as the bools i needed to activate

#

so

defined in init:
array = ["TRIG1A", "TRIG2A", "TRIG3A", "TRIG4A"];

triggers activates: 
Trandom = selectRandom array;
Trandom=true
index = array find Trandom
array deleteAt index

wouldn't work

cosmic lichen
#

Why strings?

torpid quartz
#

but this does so i'm cashing out

cosmic lichen
#

triggers are objects, the var names are references to those triggers

torpid quartz
#

oh wait, i don't need "", damn

#

so i should have the triger vars in the array, and then just have the trigger var pulled out = true or?

cosmic lichen
#

no

copper raven
#

that's literally what i suggested you to do, have some variable in trigger condition, e.g actualCondition || tag_trigger1_forceActivate, then use the code i sent you to activate those variables randomly

#

tag_triggerVars = ["tag_trigger1_forceActivate", "tag_trigger2_forceActivate", "tag_trigger3_forceActivate"] #arma3_scripting message

cosmic lichen
#

Question is, do you actually need the triggers when you are scripting anyway?

#

what do those triggers do?

torpid quartz
#

they're synced to hide/show and create task modules plus also set a bool to true

cosmic lichen
#

sounds more like something you should script instead of working with triggers.

torpid quartz
#

probably, but this was hard enough to get working.
if I do something like this again i'll give it a got but I'm tapping out of this fight for now

cosmic lichen
#

okay

torpid quartz
#

again thanks for the help though, array = array - [test]; was a life saver

sacred slate
#

can some one tell me where the bracket is missing? i don't get it.

nul = [
    recoFob,
    [
        ["B_HMG_01_A_F", 2],
        ["B_GMG_01_A_F", 2],
        "B_CargoNet_01_ammo_F",
        "B_supplyCrate_F",
        "Box_T_NATO_Wps_F",
        "Box_T_NATO_WpsSpecial_F",
        "Box_NATO_WpsLaunch_F",
        "Box_NATO_Ammo_F",
        "Box_NATO_AmmoOrd_F",
        "Box_NATO_Grenades_F",
        "Box_NATO_Support_F",
        "Box_NATO_Equip_F",
        "Box_NATO_Uniforms_F",
        "Box_NATO_AmmoVeh_F",
        "Land_RepairDepot_01_green_F",
        ["CamoNet_BLUFOR_open_F", 3],
        "Land_HBarrier_01_tower_green_F",
        "Land_HBarrier_01_big_tower_green_F",
        "Land_BagBunker_01_small_green_F",
        ["Land_HBarrier_01_big_4_green_F", 4],
        ["Land_HBarrier_01_line_3_green_F", 6],
    ]
] execVM "R3F_LOG\USER_FUNCT\auto_load_in_vehicle.sqf";


nul = [recoFob] execVM "R3F_LOG\USER_FUNCT\init_creation_factory.sqf";
cosmic lichen
#

There is none missing

#

there is a "," too much

sacred slate
#

yes thx!

willow hound
wicked fulcrum
#

I got a question about MP and benefit of using CBA Events vs. remoteExec.

I have been playing around trying to make some custom zeus modules as a clientside mod, and have gotten a bit stuck on understanding what functionality needs executing on only server vs. all clients. I want the mod to work on dedicated servers.

I read through ZEN's zeus modules to learn and found they use the CBA event system to execute code server-side. I have been trying to use [] remoteExec ["function", 2, false]; so far. Is there an benefit of using the CBA events over remoteExec? The different CBA events seems to fit with the different JIP and execution target options with remoteExec anyway.

If I use setPlateNumber and deleteVehicle can I then run it on sever with remoteExec and the server will automatically "sync" the changes to all clients? Or would it be my responsibility to ensure the scripts would be executed on all clients? (Have trouble figuring out what should be executed where for proper display/sync). I can see on wiki that HideObjectsGlobal should work globally itself when executed on server while setPos seems to be able to get triggered locally, but still sync automatically? (Or should that be server too?)

winter rose
#

deletion is "obviously" JIP-friendly

#

(and can be made from any machine btw)

gleaming imp
#

Yahoo ๐Ÿ™‚ guys is there a command how to open bomb/missile bay doors? I am trying to add ShowVehicle blackfoot with bay doors open

winter rose
wicked fulcrum
gleaming imp
robust hollow
#

copytoclipboard str animationnames this

manic sigil
#

Okay, new plan... start a new Staging.sqf, stick it full of my server-side .sqfs, things that spawn units or need to execute on the server etc, and call it from InitServer onto the server instead.

Or... does InitServer have to complete before the mission begins? Or could it be used to stage events instead? o_o

#

And the units that I'm HideGlobaling turning yellow is kinda throwing off one of my waitUntils, though I could work around it :/

gleaming imp
#

@robust hollow @winter rose thank you guys for help ๐Ÿ™‚

manic sigil
#

Okay, it's not that I'm hiding them... these units just start as Empty side o.0

cold pebble
#

When did Lou become green? ๐Ÿ‘€

#

congrats btw

cold pebble
#

Might be useful

#

It doesn't have to complete before mission begins tho

manic sigil
#

That's what I needed to know... got it in my head that the init files run through entirely when the mission loads, so they'd be useless for staging out the mission.

#

And solved my empty units debacle, seems 'dostop units this' in the init field of the leader wasn't the best choice xD

winter rose
winter rose
cold pebble
#

๐Ÿ˜„

manic sigil
#

Hrn... I'm creating a trigger that detects AnyPlayer, and I know the only player - myself - is far enough away that it shouldn't activate, but it is doing so immediately on creation. :/

tough abyss
#

gestures not working when I try to call them, no errors or anything attempting to do while {alive x3} do { x3 playGesture "GestureCeaseFire"; sleep 2; }

warm hedge
tough abyss
#

huh weird

#

Thanks

#

also, how bad is it to constantly use global variables instead of local ones

#

I feel like that's going to screw me some day

warm hedge
#

Depends on the context

dusk badger
fair drum
cosmic lichen
#

also, how bad is it to constantly use global variables instead of local ones
Global vars are not a big deal. Public variables are though

verbal saddle
#

The only issue with global variables is accidentally overwriting them.

#

Both from your own content and other's content also running.

willow hound
merry mason
wicked fulcrum
#

Wiki says hideObjectGlobal has to be called on server only. I assume it meant I could call it with [_hideTObjs] remoteExec ["function", 2, false]; as that should execute it on the server. But I see no changes on the client calling it. RPT from the server just gives this output:

17:59:36 Setting invalid pitch 0.0000 for L Charlie 1-4:1 REMOTE
17:59:36 Server: Object 8:3 not found (message Type_320)
17:59:36 Server: Object 8:4 not found (message Type_279)
17:59:36 Unit 8:4 not found, cannot update

Have I misunderstood how "server-side" works?

little raptor
wicked fulcrum
#
rmTree = {
    params ["_posAGL", "_radius"];    
    private _hideTObjs = [];
   
    { _hideTObjs pushBack _x } foreach (nearestTerrainObjects [_posAGL,["TREE", "SMALL TREE", "BUSH"],_radius]);
    { _x hideObjectGlobal true } foreach _hideTObjs;
};
[_posAGL, _radius] remoteExec ["rmTree", 2, false];

Tested with a unit position and hardcoded values for pos and radius. Mainly trying to hide trees. (the function naming is only for testing, I know it should probably use "tag_fnc_name" for good practice)

little raptor
#

Use hideObject instead

wicked fulcrum
#

hmm okay. It does work in SP and hosted-servers though?

#

I'll try hideObject instead.

little raptor
#

You have to execute it globally

#

I mean the function you created

wicked fulcrum
#

yeah. I get that for hideObject I need to use JIP and target of 0 for remoteExec for global execution. Wanted to use the hideObjectsGlobal as it was created for MP and did the JIP/sync for me, or so it claims ๐Ÿ˜‰

zenith edge
#

what'd be the quickest way to replace AI voices with with animal noises, overriding sound classes and replacing sound file paths?

fair drum
#

now that is a different request lol

zenith edge
#

just want to do something silly, and have all the AI making silly sounds

little raptor
zenith edge
#

mmmm, i have to replace all them don't i

little raptor
#

If you just want some sounds like pain and stuff you can use event handlers

fair drum
#

you "could" do something like mute the AIs radio protocol then create a function that does a random sound class with say3d or playsound3d

winter rose
zenith edge
#

yea i suppose mute them and play at random times or when interacting with them

#

would be fastest

fair drum
#

that's what i did for taunts one time

zenith edge
#

so setSpeaker "novoice"

#

and what else

#

or is that enough

fair drum
#

i'd disable radio protocol as well

#

disableAI

zenith edge
#

speaker might be enough, testing it atm

#

yea, setspeaker stopped all AI voices as far as I can tell

lunar matrix
#

can any one help

#

i am trying to make mode for players kill zombies

#

and here what i did

fair drum
#

omg delete that and use pastebin

lunar matrix
#

?

#

what do i need to do ?

fair drum
#

no one is going to read that format

winter rose
lunar matrix
#

so now copy the URL ?

fair drum
#

yup

#

after you save it

lunar matrix
#

thanks

#

i am trying to make logfile for players kill zombies

#

and i got problem please let me know

fair drum
#

im not familiar with this language

lunar matrix
#

oh ok thanks

fair drum
#

someone else probably is. what is it?

lunar matrix
#

C

#

in the pbo file

winter rose
#

@lunar matrix Arma does not take C

fair drum
#

sqf my dood

lunar matrix
#

so its not the same as DAYZ

winter rose
#

nope

fair drum
#

nope, dayz uses enfusion right? which is like C#?

lunar matrix
#

dam

hushed tendon
#

Question what is defined as "Man"?

fair drum
lunar matrix
#

lol

little raptor
#

A "robot" in simple terms

fair drum
little raptor
#

Anything that can move by animations

hushed tendon
#

Hmm, so I found my issue then.

lunar matrix
#

thanks for the help

little raptor
finite sail
#

Man is about a fifth of the way down the page

little raptor
hushed tendon
#

Now I just need to figure out the other

#

The problem is that all the AI (rabbits) are not picking their own target to follow.

#
WAG_animalAttack = 
{
params["_ai", "_animal", "_grp"];

    _ai setVariable ["WAG_animalAI", false];
   
    while{alive _ai} do {
        private _targets = ASLToAGL getPosASL _ai nearEntities ["CAManBase", WAG_animalDetectionRange];
        private _target = { if !(_x getVariable ["WAG_animalAI", false]) then { breakWith _x; }; } forEach _targets;
        if !(isNil "_target") then {
            for "_i" from count waypoints _grp - 1 to 0 step -1 do
            {
                deleteWaypoint [_grp, _i];
            };
            private _wp = _grp addWaypoint [_target, -1];
        }else{
            for "_i" from count waypoints _grp - 1 to 0 step -1 do
            {
                deleteWaypoint [_grp, _i];
            };
        };
        sleep 0.2;
    };
};
dreamy kestrel
#

hello, I need to know, when Arma stops responding and it falls into black screen territory, locks up my entire Windows session, what can this be? a recursive call? seems to be occurring as I approach an aggressive AI infested sector. AI needs to be dialed back somehow? maybe a recursive call going on? any way to possibly profile that, I think this was mentioned earlier as well. Thank you!

little raptor
little raptor
#

also why do you use waypoints?

#

just use doMove/moveTo

hushed tendon
little raptor
hushed tendon
#

No it's an invisible AI. A rabbit is attached to them tho simulating a running rabbit

#

Kinda like the ravage rabbits

dreamy kestrel
little raptor
#

I didn't mean like all the mods. Those that are "trusted" are fine

dreamy kestrel
fair drum
#

with a module. do i need to have isDisposable = 0 in order for it to fire on a syncedEntity when it respawns?

little raptor
#

not signed

#

but made by professionals

#

even a kid can sign the mod

#

it doesn't mean anything

#

signature is simply used to ensure that the same mod is being loaded in MP

dreamy kestrel
#

okay fair enough, the ones that are loaded are:

CBA_A3
KP Ranks
Personal Arsenal
Enhanced Movement
Advanced Urban Rappelling
Advanced Towing
Advanced Sling Load
DUI - Squad Radar
3den Enhanced

Disposition towards these?

#

As I said these are pretty commonly used, I do not see a problem with these.

fair drum
#

try it and see if it works. if it doesn't keep taking more off

dreamy kestrel
#

@fair drum thanks. let's put it this way, what is in question right now is not these mods. I am working on a mission mod that is showing black screen freeze issues as I begin to engage enemy AI sectors.

#

just wondering how I could begin to profile that.

#

my only recourse at the moment is to at minimum sign out of Windows and try again, worst case poke it in the eye and force a shutdown.

finite sail
#

black screen freeze? you are saying the screen goes completely black?

dreamy kestrel
#

yes, and Windows will not relinquish control other than the Arma 3 black screen, even while Alt+Tabbing

finite sail
#

you can alt tab?

dreamy kestrel
#

^^ NO

fair drum
#

if you are working on config files, usually an error there causes a freeze

dreamy kestrel
#

define "working with". I am in the middle of verifying HUD overlays. they seem to be working by and large. the issue arises when I approach enemy AI sectors.

#

so, I think the issue is not in these configs or the supporting scripts at the moment

finite sail
#

gut instinct says this isnt a scripting issue

dreamy kestrel
fair drum
#

how many groups total in the game?

#

and are you doing any scripts that spawn group data type at all?

dreamy kestrel
#

re: groups, not sure, but I can check

fair drum
#

288 groups per side in arma 3 max

dreamy kestrel
#

that particular aspect of the mission/mod is new to me

#

288 copy that, I will check, thank you

fair drum
#

so if you have 288 individual units in their individual groups, you messed up

finite sail
#

that wont cause problems like those that are being observed

dreamy kestrel
#

and unit max?

fair drum
#

no unit max, just group max

hushed tendon
#
WAG_animalAttack = 
{
params["_ai", "_animal", "_grp"];

    _ai setVariable ["WAG_animalAI", false];
    
   
    while{alive _ai} do {
        private _targets = ASLToAGL getPosASL _ai nearEntities ["CAManBase", WAG_animalDetectionRange];
        private _target = { if !(_x getVariable ["WAG_animalAI", false]) then { breakWith _x; }; } forEach _targets;
        if !(isNil "_target") then {
            _ai moveTo getPosATL _target;
        };
        sleep 5;
    };
};
#

The AI (rabbits) aren't moving.

dreamy kestrel
#

okay dokay then appreciate the feedback, these are some clues

hushed tendon
#

What did I mess up?

finite sail
#

oh.. wait.. units per group

#

nevertheless, exceeding the max number of groups just means nothing more spawns, theres no error of any indication its broken

little raptor
little raptor
hushed tendon
little raptor
#

also like I said use doStop and moveTo.
not moveTo alone

hushed tendon
hushed tendon
#

No it seems to work. Except their targeting system is still off. I pulled their target away, they ran by the closest guy and went to the second closest.

hushed tendon
#

It seems like they are picking the farthest unit in the radius.

#

oh

hushed tendon
little raptor
#

sortBy

#

bis fnc

fleet stirrup
#

Hey! in the documentation for the animate command (https://community.bistudio.com/wiki/animate) it mentions that animateSource is better optimised for multiplayer. Does anyone know what these optimisations are? As a dev for a mod that HEAVILY uses animations I would love to take advantage of whatever optimisation it is as much as possible.

winter rose
dusk badger
cold mica
#

any chance the sqfbin site could be pinned?

#

something like that.

winter rose
#

If your SQF sample is more than a few lines, please post it to https://www.sqfbin.com/ and paste the link in the channel with a description, thanks

little raptor
#

discord is better

winter rose
little raptor
#

I hardly ever look at something if it has a link

cold mica
#

Now we just need a simple bin for cpp files. perfect for #arma3_config

little raptor
cold mica
#

theyre more to reference it instead of pasting the same explanation over and over again.

winter rose
#

works well with the ```sqf example actually

winter rose
fleet stirrup
opal sand
#

Hey guys, using the following script play an .ogv video file (via trigger [repeatable] radio echo), on a screen (few screens, each screen playing a different video but only one plays)? (maybe one goes white, then back to black);

Note:

  • each screen, video all have their own name (e.g screen1, screen2,video1_screen1.ogv, etc);
with uiNamespace do { 
    _tv = missionNamespace getVariable "screen1"; 
    _tv setObjectTexture [0, "filepath\video1_screen1.ogv"]; 
    1100 cutRsc ["RscMissionScreen", "PLAIN"]; 
    _scr = BIS_RscMissionScreen displayCtrl 1100; 
    _scr ctrlSetPosition [-10,-10,0,0]; 
    _scr ctrlSetText "filepath\video1_screen1.ogv"; 
    _scr ctrlAddEventHandler ["VideoStopped", { 
        (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1; 
    }]; 
    _scr ctrlCommit 0; 
};
with uiNamespace do { 
    _tv = missionNamespace getVariable "screen2"; 
    _tv setObjectTexture [0, "filepath\video2_screen2.ogv"]; 
    1100 cutRsc ["RscMissionScreen", "PLAIN"]; 
    _scr = BIS_RscMissionScreen displayCtrl 1100; 
    _scr ctrlSetPosition [-10,-10,0,0]; 
    _scr ctrlSetText "filepath\video2_screen2.ogv"; 
    _scr ctrlAddEventHandler ["VideoStopped", { 
        (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1; 
    }]; 
    _scr ctrlCommit 0; 
};

TEMP EDITs

  • : the "" wasnt issue ingame, message amendment, had to edit text for sensitivity
  • added an extra field, to give more understanding
    Can anyone please advise? ๐Ÿ˜„
winter rose
#

you might need to create another displayCtrl, one for each video

#

otherwise you simply change the texture of the same control, unloading the rest

opal sand
winter rose
#

1100
1101
1102โ€ฆ

opal sand
sacred slate
#

how do i do: _mytaskcount = currentTasks teamMember _totalRunning;

winter rose
sacred slate
#

i like to count the total number of tasks

winter rose
merry mason
#

Is it possible to somehow find the code for a waypoint?

opal sand
winter rose
opal sand
winter rose
winter rose
winter rose
merry mason
#

I am a bit confused with that.

opal sand
winter rose
#

โ€ฆnever thought of factoring your code?

opal sand
merry mason
#

@winter rose I just put waypointstatments [groupname, 1]?

#

And it will give me what I want?

winter rose
#

feed it the waypoint you want

cobalt igloo
#

I have been playing around with ORBATS and found this: [missionconfigfile >> "CfgORBAT" >> "3Squ","mil_destroy", [1,0,0,1], 1.2,1.2,45] call BIS_fnc_ORBATAddGroupOverlay; which will apparently change the marker to signify that the unit has been killed but I have no idea where to put this to make it work and the wikis look like Minecraft enchanting table because I have little experience with this kind of stuff. Any Suggestions?

winter rose
# opal sand done a quick google to brief me, but no, wouldnt know how to factor my code and ...

try this, unsure it works because of maybe the same control is used; if it does not, I will try something else

with uiNamespace do {

    private _tvFunction = {

        params ["_tvName", "_video", "_layer"];

        _tv = missionNamespace getVariable _tvName;
        _tv setObjectTexture [0, _video];
        _layer cutRsc ["RscMissionScreen", "PLAIN"];
        _scr = BIS_RscMissionScreen displayCtrl _layer;
        _scr ctrlSetPosition [-10,-10,0,0];
        _scr ctrlSetText _video;
        _scr ctrlAddEventHandler ["VideoStopped", {
            (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
        }];
        _scr ctrlCommit 0;
    };

    [pcs1, "a3im1pv\a3im1pv_pcs1.ogv", 1101] call _function;
    [pcs2, "a3im1pv\a3im1pv_pcs2.ogv", 1102] call _function;
    [pcs3, "a3im1pv\a3im1pv_pcs3.ogv", 1103] call _function;
    [pcs4, "a3im1pv\a3im1pv_pcs4.ogv", 1104] call _function;
    [pcs5, "a3im1pv\a3im1pv_pcs5.ogv", 1105] call _function;
};
opal sand
winter rose
#

good reflex to stop instead of forcing ๐Ÿ˜‰

opal sand
merry mason
#

@winter rose Do keep [groupone, 1] or replace group one with the group name of the squad that has the waypoint?

winter rose
winter rose
opal sand
merry mason
winter rose
winter rose
merry mason
#

Figure out how it works.

#

Oh nvm

#

sqf

#

@winter rose Where would I find an sqf?

opal sand
# winter rose yep when you can't figure it, when you don't know what you do anymore, drop it, ...

well that makes sense* tbf, give yourself a breather, and a kit-kat lol, i heard alot about this 90 min on, 15 min off rule, apparently our brain can only fully focus for up to 90 min, after that, focus quality, keeps dropping, a 15 min break, ensures increased productivity over a sustained period of time, of up 9.5 hours, its quite good tbf, it works, but still need to adapt it fully, easy to get lost in work and go over the 90 min mark

merry mason
#

Like this is what is inside the box script inside a waypoint that came with a mod. WW2\Core_f\WW2_System_Curator_F\waypoints\fn_wpParadrop.sqf Where would I find it origin.

winter rose
merry mason
#

Inside the files?

winter rose
winter rose
opal sand
winter rose
# opal sand lmao notes taken, rubber duck method lol?

(seek pomodoro method too)

rubber duck is: talking to someone/something to explain the problem you face
by saying it out loud, it forces you to conceptualise every item of the chain and consider everything in details
and usually the "oooh wait I figured it out" moment arises

merry mason
winter rose
merry mason
#

What do I edit a pbo with? Could I just use notepad?

hushed tendon
merry mason
#

Could I just execute this inside of the innit? ```WW2\Core_f\WW2_System_Curator_F\waypoints\fn_wpParadrop.sqf

hushed tendon
#

I'm getting errors with getPosATL and !alive when I added ```sqf
private _target = [[_targeted], [], {_ai distance _x }, "ASCEND"] call BIS_fnc_sortBy;

it looks like their expecting an object now with the addition of selecting the closest of the ``_targets``.
```sqf
WAG_animalAttack = 
{
params["_ai", "_animal", "_grp"];

    _ai setVariable ["WAG_animalAI", false];
   
    while{alive _ai} do {
        private _targets = ASLToAGL getPosASL _ai nearEntities ["CAManBase", WAG_animalDetectionRange];
        private _targeted = { if !(_x getVariable ["WAG_animalAI", false]) then { breakWith _x; }; } forEach _targets;
        private _target = [[_targeted], [], {_ai distance _x }, "ASCEND"] call BIS_fnc_sortBy;
        if !(isNil "_target") then {
            doStop _ai;
            _ai moveTo getPosATL _target;
        };
        for [{private _i = 0}, {_i < 11}, {_i = _i + 1}] do {
            if (!alive _target) exitWith {};
            sleep 1;
        };
        sleep 1;
    };
};
hushed tendon
#

oh that just sorts it

#

I understand now

wary hill
#

A bit of silly question: how do I place my marker on empty marker position + 100m on X axis I forgot syntax rules w/ brackets ๐Ÿ˜•
myMarker1 = createMarker ["genMrkName", getMarkerPos "emptyMrk1"];

hushed tendon
winter rose
winter rose
hushed tendon
winter rose
#

before even sorting, saving steps

hushed tendon
#

oh that's a better way to do it

opal sand
merry mason
#

How would I delay a modules activation?

fair drum
#

are you making a module or using one?

merry mason
#

using

fair drum
#

just sync a trigger to it and put your activate condition in there

hushed tendon
#

Someone mind giving this a look over?
https://www.sqfbin.com/hupahogixusikazanimo
Rabbit movement and targeting is fine now but they all have the same target. I'm trying to get each rabbit to follow their own target.
(Also this will be MP and ran on a dedicated server so if you could proof that as well I'd appreciate it)

#

Each rabbit has their own AI that they are attached to for movement

fair drum
#

so apparently multiple modules of the same type share module logic?

#

cause i have variables that i bound to the logic of a module but if I place 2 modules of the same type with different values, one of them overwrites the other, even though the module i'm pulling into a local script space

merry mason
#

lol

fair drum
#

its jason borne

merry mason
#

If I just wanted it to enable after a unit reached a waypoint

fair drum
#

yeah sure. make the trigger condition something like... !(isNil "wp1"). then in the waypoint attributes go down to on completion area and put wp1 = true

merry mason
#

What about syncing it to the waypoint

fair drum
#

yeah you sync that to the module itself

#

no i mean

merry mason
#

with the thing called waypoint activation?

fair drum
#

you dont have to sync the waypoint if you do it that way

#

the waypoint activation is to skip that waypoint if its tied to a trigger

#

so doesn't apply to your case

merry mason
#

So for it to activate when it reaches a waypoint just put !(isNil "mywaypoint") Then where would I put the boolean statement?

fair drum
#

that is a boolean statement

merry mason
#

I mean the one that changes the boolean

#

my bad lol

fair drum
#

click a waypoint and go to waypoint expression

#

under "on activation" put mywaypoint = true

oblique arrow
#

Hey peeps is it possible to use connectToServer with a url?

#

It seems to only work with an actual ip

hushed tendon
#

That my script?

#

Looks different

#

I also still haven't been able to get each rabbit to target their own unit

little raptor
merry mason
fair drum
#

waypoint

merry mason
#

and should I set the trigger to repeatable?

fair drum
#

no

hushed tendon
fair drum
#

unit will walk to waypoint, causing a completion, completion makes mywaypoint = true, trigger picks up that mywaypoint is no longer nil and fires your connected module

little raptor
#

for fun

hushed tendon
merry mason
fair drum
#

yes

merry mason
#

And to disable it just set the presence to false

fair drum
#

no don't touch that

merry mason
#

Thank goodness I didn't do that lol.

fair drum
#

i feel like you have given me incomplete info on what you want to do if you are wanting things to "disable"

merry mason
#

Is it even possible to disable a module in eden?

hushed tendon
#

@little raptor You mind helping me with the targeting part for the rabbit? The only thing wrong is that each rabbit runs to the same target even if they have a closer one.

fair drum
#

depends if its considered a disposable module

merry mason
#

How do I know if it is or not?

fair drum
#

here we go... why do you want a module "disabled"

#

what was your entire plan with this

little raptor
#

you don't do that

hushed tendon
merry mason
#

So I have this ai commander mod and it seems to be giving the troops orders which causing the transport plane they are suppose to drop out of to land for some odd reason. So I want to enable the module once the plane drops off the troops for sure so then it can enable and give the troops orders instead of messing up the transport plane waypoints.

hushed tendon
little raptor
#

maybe because they each have that unit as closest

hushed tendon
merry mason
#

Not even sure if its possible to do but I am just trying to find a solution to this issue. I have tried a few other ways but they didn't seem to work so I'm trying this one but now I'm not even sure if this one will work.

fair drum
#

you over complicated it

#

just go back to what i told you

#

actually, i have no idea what this ai commander mod is going to do

#

so the solution might not even work

merry mason
#

Its called NR6.

#

What was it you told me again?

hushed tendon
fair drum
little raptor
#

that's not what my script does at least

little raptor
merry mason
little raptor
#

I mean the sort part

#

not the error

hushed tendon
little raptor
#

it's the same wrong script

#
private _targeted = { if !(_x getVariable ["WAG_animalAI", false]) then { breakWith _x; }; } forEach _targets;
            private _targetsSorted = [[_targeted], [], {_ai distance _x }, "ASCEND"] call BIS_fnc_sortBy;
#

this is wrong

hushed tendon
#

Mind explaining what is wrong?

little raptor
#

you just pick one guy (_targeted) put it in an array and sort it

hushed tendon
#

Oops. So I have to essentially switch them around?

little raptor
#

I don't know what you mean by switching around.
something like this will suffice:

_targets = ASLToAGL getPosASL _rabbit nearEntities ["CAManBase", 20];
                _targets = [_targets, [], {_x distance _rabbit}, "ASCEND", {!isNull group _x}] call BIS_fnc_sortBy;
hushed tendon
#

Switched around to this

WAG_animalTargeting = 
{
params["_ai", "_animal", "_grp"];

    _ai setVariable ["WAG_animalAI", false];
    _animal setVariable ["WAG_animalAI", false];
   
    while{alive _ai} do {
        private _targets = ASLToAGL getPosASL _ai nearEntities ["CAManBase", WAG_animalDetectionRange];
        if !(isNil "_targets") then {
            private _targetsSorted = [[_targets], [], {_ai distance _x }, "ASCEND"] call BIS_fnc_sortBy;
            private _targeted = { if !(_x getVariable ["WAG_animalAI", false]) then { breakWith _x; }; } forEach _targetsSorted;
            private _target = _targetsSorted select 0;
            
            doStop _ai;
            for [{private _i = 0}, {_i < 110}, {_i = _i + 1}] do {
                if (!alive _target) exitWith {};
                _ai moveTo getPosATL _target;
                sleep 0.1;
            };
        };
    };
};

Right?

little raptor
#

no

#

what are you even doing?! meowsweats

hushed tendon
#

idk even know at this point

little raptor
#
 private _targetsSorted = [_targets, [], {_ai distance _x }, "ASCEND"] call BIS_fnc_sortBy;
            private _target = { if !(_x getVariable ["WAG_animalAI", false]) then { breakWith _x; }; } forEach _targetsSorted;
#

that's it

hushed tendon
#

brain is fried

hushed tendon
little raptor
#

where did you even get the second line?

#

didn't you write it yourself?

#

that's what gets the target

hushed tendon
#

uhhmeowsweats Had some help

little raptor
hushed tendon
#

ohhhhhh

#

@little raptor They don't move now notlikemeowcry

hollow lantern
#

is there a way to optimize this snippet so it works on any angle?

comment "Return array of numbers for setVectorDirAndUp";
vectorPos = [vectorDir (get3DENSelected "object" select 0), vectorUp (get3DENSelected "object" select 0)]; copyToClipboard (str (vectorPos));```
I have an attached object which faces a specific direction because the plane faces that way. For getting the results needed I had to set the angle of the plane to 0 because otherwise I would have gotten weird numbers out of the attached object. 

So the question is, if you can counter this so that the starting point of the calculation doesn't need to be zero. Or that it adds/subtracts the angle difference
little raptor
hollow lantern
#

yeah but it calculates based on Z being 0. If I have a object (e.g. plane) and I place some other object there and rotate it so it looks nice when I attachTo it later, then the plane must be facing north (0) in order for the command above to work correctly on that second object

#

otherwise the values it gets out are based on 0 and rotate the object in weird ways if the base object (plane) was not facing north

little raptor
#

I have no idea what you want in the first place blobdoggoshruggoogly

tough abyss
#

Hey im wondering if anyone could help me real quick with an audio issue, Im trying to get an audio file to play i set up in my config, and i set it up on four different objects. I had the first trigger play it from a small object and it works great, but as soon as i change the variable name of ONLY the object its playing from and in the code it refuses to work for the other ones.

tough abyss
#

wait one, sorry im getting it together

little raptor
#

also post it with syntax highlighting when you do
see the pinned messages

hushed tendon
#

@little raptor You know what's wrong? I've looked it over a few times but I don't know why the rabbits won't move

WAG_animalTargeting = 
{
params["_ai", "_animal"];

    _ai setVariable ["WAG_animalAI", false];
    _animal setVariable ["WAG_animalAI", false];
   
    while{alive _ai} do {
        private _targets = ASLToAGL getPosASL _ai nearEntities ["CAManBase", WAG_animalDetectionRange];
        if !(isNil "_targets") then {
            private _targetsSorted = [_targets, [], {_ai distance _x }, "ASCEND"] call BIS_fnc_sortBy;
            private _target = { if !(_x getVariable ["WAG_animalAI", false]) then { breakWith _x; }; } forEach _targetsSorted;
            
            doStop _ai;
            for [{private _i = 0}, {_i < 110}, {_i = _i + 1}] do {
                if (!alive _target) exitWith {};
                _ai moveTo getPosATL _target;
                sleep 0.1;
            };
        };
    };
};
little raptor
#

wait you did

#

nvm

#

but the flow of your code is wrong

#
for [{private _i = 0}, {_i < 110}, {_i = _i + 1}] do {
                if (!alive _target) exitWith {};
                _ai moveTo getPosATL _target;
                sleep 0.1;
            };
        };
```![meowsweats](https://cdn.discordapp.com/emojis/707626030613135390.webp?size=128 "meowsweats")
#

what?

tough abyss
#

@little raptor

Trigger code:

portal say3D "one"

Description.ext code

    class CfgSounds
{
    sounds[] = {};
    class one
    {
    name = "one"
    sound[] = {"sound\one.ogg", 100,1};
    titles[] = {};
    };

}
hushed tendon
little raptor
#

plus it's your own fault that it doesn't work:
if !(isNil "_targets") then {

hollow lantern
# little raptor I have no idea what you want in the first place <:blobdoggoshruggoogly:748124048...

https://i.imgur.com/eBFy8M1.png This sums it hopefully up. The drawing shows to planes. One is facing north, the other is not. The green triangle on the planes represents a rotated object that will later on be attachedTo the plane.
If my code above is used while the plane is facing north and thus the rotation of the object is relative to Z being 0 then all is OK. If the plane however faces any other direction, then the rotation of the object is relative to the current nun-null Z of the plane and the code above does not work.

little raptor
#

I still don't understand what the result should be?

#

and what do you want to do with it that it's wrong?

hollow lantern
#

the coordinates array on the "second" plane are wrong. Basically I could always rotate any "plane" to 0 before using the code above. and then rotate it back.
So I kinda just wanted to see if there is a optimization available that would remove the need for rotating back to 0

little raptor
little raptor
tough abyss
little raptor
#

@hollow lantern
do you want the vectors in plane's model space?

tough abyss
#

same thing for the subsequent 3 trigger/object combos

hollow lantern
tough abyss
little raptor
hollow lantern
#

eh yes, seems like it

little raptor
little raptor
tough abyss
#

I am so infuriated at the moment, I forgot that the player's status of existence is measured from the feet/unit icon position and my trigger was elevated only slightly above this point

#

it works fine now

little raptor
#

to check just put a systemChat in them:

systemChat "trigger1 activated!";
tough abyss
#

Sorry for wasting your time

little raptor
#

ok

#

np

hushed tendon
#

@little raptor I found the issue. Something is wrong with _target

#

I don't know what is wrong with it tho

hushed tendon
#

that's gone

little raptor
#

_targets -> _target

#

that's all you had to change

hushed tendon
#

meowfacepalm I overthought it bigtime

hollow lantern
#

@little raptor perfect, works like a charm, Thanks.
End-Product is then:

comment "Return array of numbers for setVectorDirAndUp relative to the base objects position.";
vectorPosRel = [(get3DENSelected "object" select 0) vectorWorldToModel vectorDir (get3DENSelected "object" select 1), (get3DENSelected "object" select 0) vectorWorldToModel vectorUp (get3DENSelected "object" select 1)]; copyToClipboard (str (vectorPosRel));``` if anyone wants it.
copper raven
#

comment command meowsweats

little raptor
hollow lantern
#

it's a helper command only used in a debug console

#

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

copper raven
#

// works in debug console afaik

little raptor
#

yes

#

plus you might as well use a string literal

#
"Return array of numbers for setVectorDirAndUp relative to the base objects position.";
hollow lantern
#

since it is nothing special anyways that gets used 24/7

hushed tendon
#

@little raptor _target isn't working even with that change in _ai moveTo getPosATL _target;

hushed tendon
#

_targets -> _target

little raptor
#

what else

hushed tendon
#

Here

WAG_animalTargeting = 
{
params["_ai", "_animal"];

    _ai setVariable ["WAG_animalAI", false];
    _animal setVariable ["WAG_animalAI", false];
   
    while{alive _ai} do {
        private _targets = ASLToAGL getPosASL _ai nearEntities ["CAManBase", WAG_animalDetectionRange];
        private _targetsSorted = [_targets, [], {_ai distance _x }, "ASCEND"] call BIS_fnc_sortBy;
        private _target = { if !(_x getVariable ["WAG_animalAI", false]) then { breakWith _x; }; } forEach _targetsSorted;
            
        doStop _ai;
        if !(isNil "_target") then {
                if (!alive _target) exitWith {};
                _ai moveTo getPosATL _target;
        };
        sleep 1;
    };
};
#

prob my fault

little raptor
#

I told you to remove that for

#

and you need only one doStop

#

no need to put it in the loop

#

you can put it there if you want

#

won't make that much of a difference

hushed tendon
#

alright

little raptor
#

also use agents instead of AI

hushed tendon
#

? Like _agents instead of _ai?

#

But there still is the problem with _target

#

I tried this and it worked

_ai moveTo getPosATL player;
little raptor
little raptor
#

because the animal is targeting the AI (essentially targeting itself)

hushed tendon
little raptor
little raptor
hushed tendon
#

The agents were the ones walking around?

little raptor
#

noone walked around

#

the whole system was simulated

#

I used a custom velocity system for the rabbits

#

the agents were simply used for path generation
plus I attached the rabbits to the agents

hushed tendon
#

Makes sense why they were sliding around when they turned

#

๐Ÿ˜ญ ๐Ÿ˜ญ ๐Ÿ˜ญ ๐Ÿฅณ ๐Ÿฅณ ๐Ÿฅณ IT WORKS!!!!

#

FINALLY!!!

#

@little raptor Thanks for the huge amount of help you gave me

little raptor
#

np

hushed tendon
#

Now to a part of the code that I actually know how to do. I think

tiny wadi
#

Does BIS_fnc_recompile work for code in a server addon? I assume if it does it'd only work if filepatching is enabled

little raptor
#

it requires allowFunctionsRecompile = 1;

#

and afaik it doesn't work in config.cpp

#

only mission functions

fair drum
#

i need... a downside to always having a mine/ied jammer always on. any ideas?

slim oyster
#

battery simulation

fair drum
#

oooh and the battery can explode

slim oyster
#

your CQ didn't put the batteries in the freezer so they only charge to 40%

torpid pewter
#

if(A3E_Param_Weather==0) then {
0 setovercast 0;
forceweatherchange;
};

if(A3E_Param_Weather==1) then {
0 setovercast 1;
forceweatherchange;
};

if(A3E_Param_Weather==2) then {
0 setovercast 1;
0 setrain 1;
forceweatherchange;
};

if(A3E_Param_Weather==3) then {
0 setovercast 1;
0 setfog 1;
forceweatherchange;
};

I have this simple script that runs on the server that changes weather and can be adjusted in the parameters. I'd like to have one more random parameter that selects from this list, so I can have a random weather start. How do I do this?

slim oyster
#
private _weatherParam = if (A3E_Param_Weather isEqualTo 4) then {
    floor random 3
} else {
    A3E_Param_Weather
};
switch _weatherParam do {
    case 1: {
        0 setovercast 1;
    };
    case 2: {
        0 setovercast 1;
        0 setrain 1;
    };
    case 3: {
        0 setovercast 1;
        0 setfog 1;
    };
    default {
        0 setovercast 0;
    };
};
forceWeatherChange;
young storm
#

[[2001, 12, 31, 23, 59], true, true] call BIS_fnc_setDate;
So uh how do i make it say 6 hours later not years later..lol and keep it day or late arvo?

waxen tendon
#

is armake2 still the best builder or are there newer stuff

torpid pewter
# slim oyster ```sqf private _weatherParam = if (A3E_Param_Weather isEqualTo 4) then { flo...

Thank you, I knew there was a simple way to do it and I've seen these kinds of scripts before, but I'm still mostly limited to smashing scripts together until they work.

One thing I noticed however is that it looks like the floor random 3 should be floor random 4 since the random command is not inclusive. I confirmed that with some testing. I tried putting just 2 switches and floor random 2 and it never picked the case 2. Only case 1 and default were selected.

young storm
#

@finite sail does this give me the 6 hours later screen?

finite sail
#

no

cosmic lichen
#

BIS_fnc_setDate

young storm
#

Im using a trigger n need it to cover up stuff spawning/make it immersive

young storm
cosmic lichen
#

That's the one with the 4 hours later

finite sail
#

the six hours later thing is a video you can play from

#

the game

young storm
#

Uhhh

#

I see i think

#

I was just hoping someone can give me the full code to put in the trigger

#

Cuse i dont understand scripts

young storm
finite sail
#

the examples on fnc_setdate cover most of twhat you need

young storm
#

Ah

warm hedge
#

Just spend some effort to read the article

cosmic lichen
#

We can help, but we cannot read for you

young storm
#

Wait so i just get rid of it all in the brackets n put a single number?

cosmic lichen
#

Read the examples

#

and test it

young storm
#

[[4], true, true] call BIS_fnc_setDate; ig?

#

Ah okay

#

I read but idk if i understand lol

#

Am not able to comprehend high skill stuff like scripts

finite sail
#

[4, true, true] call BIS_fnc_setdate

young storm
#

Ohh!

#

Thank you so muchWaaaaa

finite sail
#

example 2 on that wiki page skips in hours

cosmic lichen
#

example 2 updated, with comment

finite sail
#

just add true true for global execution and the fancy transition

young storm
#

Ah i feel so dumb

#

Thanks guys!!

finite sail
#

oo, well played @cosmic lichen

young storm
#

Oh you did edit it

#

Damn aha

finite sail
#

[0, true, true] call BIS_fnc_setdate

#

dont do that lol

young storm
#

What does that do

#

O.o

#

Crash the server?

cosmic lichen
#

It never fades back

#

in

finite sail
#

yep lol

cosmic lichen
#

oh it does

#

but it takes time

#

and doesn't display anything

young storm
#

Ok never do that got it

#

Lol

finite sail
#

to get 30 minutes, you have to send 0.51

#

if you send 0.5, it shows 29 minutes

cosmic lichen
#

30/60

#

ah yes

#

I need to update the page again

finite sail
#

ah yes, 30/60 is accurate

#

ive never used this... might shoehorn / plot device it into my mission

#

lol

young storm
#

Ooh ok

#

Thanks again guys!

harsh vine
#
//initServer //
Sav1 = createVehicle ["Land_Tablet_02_sand_F", getMarkerPos  _marker1, [], 1, "none"];
sav2 = createVehicle ["Land_Tablet_02_sand_F", getMarkerPos  _marker2, [], 1, "none"];

//initPlayerLocal//
while {true} do{
{
if (player distance _x < 20) then {
[_x, ["tract", 20, 1]] remoteExec ["say3D", 0, true];
};
} forEach [sav1,Sav2];
sleep 6;
};
#

It only plays the sound for the hosted pc, but when i join on another pc it doesnt work.
I use initServer so it only spawn (createvehicle) once and not duplicates .
Is it possible to get it to work with all clients ??

cosmic lichen
#

First of all, use say3D 2nd syntax. It got a range with it.

#

from say3D [sound, maxDistance, pitch, isSpeech, offset]

winter rose
#

and second of all, do not set JIP to true

cosmic lichen
#

why even remote exec in initPlayLocal.sqf?

winter rose
cosmic lichen
#
initServer.sqf
publicVariable "sav1";
publicVariable "sav2";

//initPlayerLocal//
while {true} do
{
  {
    _x say3D ["tract", 20]
  } forEach [sav1, Sav2];
  sleep 6;
};```
harsh vine
#

i knw about the distance ...if a player is less than 20 meters away from the device, then it will play the sound .I only did that so it doesn't contentiously play the sound ...might lower fps maybe idk ๐Ÿ™ˆ

#

thanks again๐Ÿ‘

cosmic lichen
#

i knw about the distance ...if a player is less than 20 meters away from the device, then it will play the sound .I only did that so it doesn't contentiously play the sound ...might lower fps maybe idk ๐Ÿ™ˆ
Could be, no clue how the engine handles it.

manic sigil
#

Creating vehicle not working.

Pull the section of script out, run it in the debug console.

Still not working.

Remove vehicle name.

Works, but crew doesn't teleport in... because the vehicle doesn't have a name.

Return name.

Works as intended x_x

#

... but it didn't update the name? o.0 Buh.

exotic flax
#

wut?

warm hedge
#

ERROR: No info's given; No answer is returned.

winter rose
#

@manic sigil code plz
Also check createVehicle's wiki page

manic sigil
#

Sorry, trying to cram this in before work x_x
InitServer >>> "Scripts\ServerStaging.sqf" remoteExec ["ExecVM", 2];

Taru = createVehicle ["O_Heli_Transport_04_covered_F", getMarkerPos "TaruMarker3", [], 0, "FLY"];
Hydra1 assignasDriver Taru;
Hydra2 assignasturret [Taru, [0]];
Hydra3 assignasturret [Taru, [1]];
Hydra1 moveInDriver Taru;
Hydra2 moveInTurret [Taru, [0]];
Hydra3 moveInTurret [Taru, [1]];
Taru setdir 230;
#

If I run it in the debug console as Server, it works fine-ish, but doesn't name the vehicle.

#

Well, doesn't globally name the vehicle.

harsh vine
cosmic lichen
#

We all started there ๐Ÿ˜„

grand nebula
#

Hows it going! Been fighting with this issue all morning and i'm at the end of my wit, so im here ๐Ÿ˜† Any help is appreciated!

Issue: Building a Stomper follower drone which works well, however i want to add props to the back of the drone, which attach fine, however the Drones AI gets confused and can drive correctly anymore.

I have tried the following to make the items no collided or stop AI from seeing them but no config i put together has worked;

drone disableCollisionWith object; 
[drone,object] remoteExecCall ["disableCollisionWith", 0, object];

Im using these objects for testing;

B_UGV_01_F (drone)
HLC_AK_ammobox (box)

And for anyone interested this is the end product im hoping to get working - #screenshots_arma message

Any clues?

winter rose
grand nebula
#

object is just the "var" name, i was using box as the name

#

Only thing i'm running is a script to call the AI to my position which works fine without the objects attached

winter rose
grand nebula
#
[this, drone] call BIS_fnc_attachToRelative

Running on each of the attached objects

winter rose
#

no issue with this

grand nebula
#

Was getting issues with the almost exact same setup

#

2 seconds and ill see if i get the same

#

how are you telling the ai to move?

#

just with wp?

winter rose
#

yep

grand nebula
#

Ok so, yes it does drive but compare one with no objects and there is a massive diffrence

#

For example the one i linked to just drives in circles cause it keeps seeing things it trys to avoid

#

You will notice also that a drone with stuff attached wiggles as it drives but one without will go in straight lines

#

May be easier to see while its following you

test addAction ["Follow",{_drone = drone10;

while{ alive _drone && alive test } do {   
       _drone doMove position test;   
       sleep 2;   
};}]

Using that in the players init, and replace the drone10 with the name of the drone will get it to follow you

#

I assume it was the hit boxes of the items but if you have any other suggestions to make them function like they do unladen i'd be happy to have literally any suggestions at this point

winter rose
#

0 issue with that

winter rose
grand nebula
#

I kinda ruled the script out in my head as I had no issues with it on the unladen drone

#

Will give it a go when I get in

#

Can you try clipping some objects into the front and sides of the vic your using

#

See if that causes the issues

winter rose
#

same same

grand nebula
#

lol

#

wtf then

#

๐Ÿ˜†

winter rose
#

the "every two seconds" move maybe

grand nebula
#

Ye testing with that atm

#

So weird

grand nebula
#

Thats wat it does for me

#

No clue why

#

๐Ÿ˜†

#

Try an AAF Supply box on the nose

#

for me the thing only backs up

winter rose
#

create a minimalistic repro

grand nebula
#

Ok so longer time defo helps, i'll work on the script to improve it. Very much apprecated

#

One step closer to robo dog

proven charm
#

Hey I'm trying to write a script that checks how much of an object is visible above ground (in height) but my script is inaccurate

#

the script:

#

// cb is object being used here
_wpos = cb modelToWorld (boundingCenter cb);

_bbr = boundingBoxReal cb;
_elevation = _wpos # 2; // Should be center of the obj

_height = abs (((_bbr select 1) # 2) - ((_bbr select 0) # 2));

_aboveGround = _elevation + (_height / 2); // result is inaccurate

hint format["%1 -- ( %2 ) -- ( %3 )", _wpos, _elevation, _aboveGround ];

#

anyone know what I'm doing wrong?

valid abyss
#

Hello, i have a script were it would check if someone has been killed using the EntityKilled event handler and it would display a little message with titleText, the only problem is that it would display the message to every player on the server instead of just the killer, does anyone know why?

       
params ["_killed", "_killer", "_instigator"];       
       
if (isPlayer _killer AND side group _killed isEqualTo east or isPlayer _killer AND side group _killed isEqualTo west or isPlayer _killer AND side group _killed isEqualTo resistance or isPlayer _killer AND side group _killed isEqualTo civilian) then       
{  
    titleText ["<t size='2' font='EtelkaNarrowMediumPro'>You have reached Level 1!</t>", "PLAIN DOWN", -3, true, true];        
};```
exotic flax
#

if you add that script on all clients, all clients will execute that script when someone gets killed

#

so adding _killer == player to the if statement should fix that

#

however, since your if statement is a mess it will most likely not work

opal sand
cosmic lichen
#

(isPlayer _killer AND side group _killed isEqualTo east or isPlayer _killer AND side group _killed isEqualTo west or isPlayer _killer AND side group _killed isEqualTo resistance or isPlayer _killer AND side group _killed isEqualTo civilian
???

#
if (isPlayer _killer AND side group _killed in [east, west, independent, civilian])
#

although, the side check is redundant @valid abyss

tough abyss
#

I have a quick question, google hasnt been terribly helpful. How do I disable the music on the mission complete screen?

wary lichen
#

How to end mission locally for current player

tidal ferry
#

What scripting language is Arma based on?

wary lichen
tidal ferry
#

Huh, neat

valid abyss
cosmic lichen
#

@valid abyss What side does a zombie have?

valid abyss
cosmic lichen
#

Agents can have sides too

#

You can also use

!isAgent teamMember _killed;
#

Instead of the side check

valid abyss
#

Thanks

full furnace
#

So i'm wondering on where I could be going wrong.
I've been trying to make get an animation to work on all players at the start of the mission in a multiplayer mission.
I thought I could get away with using

sleep 43.86;``` in the unit Init.  But doesn't want to work
cosmic lichen
#

put it in the initPlayLocal.sqf

full furnace
#

so I make a sqf called initPlayLocal.sqf and it should run at the start of the mission?

#

would i have to change the "player" or is that fine

tough abyss
#

does anyone know how to disable the end mission music? I just want the UI card that shows up

fair drum
tough abyss
#

I dont know how to do that :/

fair drum
#

time to learn ma boi

tough abyss
#

thank you ๐Ÿ™‚

full furnace
#

@cosmic lichen ?

cosmic lichen
#

player is ok

#

initPlayerLocal.sqf goes in the root of your mission

full furnace
tough abyss
#

it wont end the mission at all now

#

the documentation said to put the endmission type in the _endType string

cosmic lichen
#

Did you actually read the params doc?

fair drum
tough abyss
#
addMissionEventHandler ["Ended", {
    params ["_endType"];
}];

I just kinda replaced things that I had

#

i dont know

fair drum
#

so the params command in this is creating a private variable (exists only in the {} code block) that is pulling in the arguments that the engine is feeding it. In this case, when the mission ends, the engine sends out a argument of what end type was chosen and feeds it to this addmissioneventhandler script. therefore, we want to keep the params command untouched as its giving us information to work with if we choose to.

tough abyss
#

ah okay, gotcha

fair drum
#

because we can do something like...

addMissionEventHandler ["Ended", {
    params ["_endType"];

    if (_endType == "end1") then {blah blah blah};
}];

so it allows us more control over what we want

#

so you keep everything as is. but we want to add your code underneath the params area

tough abyss
#

understood

fair drum
#
addMissionEventHandler ["Ended", {
    params ["_endType"];

    //code here notice its still inside the {}
}];
#

so try that now

tough abyss
#

addMissionEventHandler ["Ended", {
    params ["_endType"];

    playMusic "";
    BIS_fnc_endMission;
}];
fair drum
#

partially. remember this event only occurs when the game ends. so you can't give the game ending command within it or it will never fire

#

so you need to send that outside of this handler

tough abyss
#

oh I understand now, I trigger the endmission and then under this

#

this triggers on the event

#

gotcha

cosmic lichen
tough abyss
tough abyss
fair drum
#

If you have ace enabled, fadeMusic won't work unless you disable it's automatic hearing volume control.

tough abyss
#

oh I do have ace

fair drum
#

Let me see if I can remember it...

ace_hearing_disableVolumeUpdate = true

tough abyss
#
"MEZ" call BIS_fnc_endMission;
addMissionEventHandler ["Ended", {
    params ["_endType"];

    0 fadeMusic 0;
    ace_hearing_disableVolumeUpdate = true;
}];
#

i feel like i did something wrong, I will go look up how to properly do the fademusic

fair drum
#

you got to do the ace disable before the fade music

tough abyss
#

I swear my other coding experience just decides to not exist when I do arma scripting lmao

tough abyss
fair drum
#

and you also have to call the event handler before you stop the mission...

#

otherwise it doesn't exist when the mission ends = no trigger

tough abyss
#

I thought it had to be called after it did the thing

#

okay

fair drum
#

you should have a trigger that is the end mission, and the mission event handler goes in an init logic box or init.sqf

#

think of an event handler as a constant loop that is checking for things. if that loop doesn't exist before you end the mission, how is it going to know that the mission ended?

tough abyss
#

true. alright

compact maple
#

Hi. What is the most efficient way to develop and debug a new mission (which include a server-side) ? Rebooting everything when changing one line of code is boring /:

fair drum
#

for configs? gotta reboot afaik. for scripts you don't have to, you can call stuff directly in game

compact maple
#

No configs, just scripts. But calling them in console is not very convenient, you can't paste comments, there is no indent etc. I would like to just Ctrl+S my file and test it in game, it is possible ?

#

in console *

fair drum
#

you can paste comments with @little raptor's tool i believe

compact maple
#

Oh my god nice tool dude

#

wtf

#

@cosmic lichen Thanks,but why does it says that filePatching is for unpacking data in arma 2 lol ?

cosmic lichen
#

Allow the game to load unpacked data. For more info see CMA:DevelopmentSetup (since Arma 3 1.49+).

compact maple
#

I mean the link more info

#

there is only a section for arma 2

#

there is nothing about arma 3

cosmic lichen
#

Because the biki is a mess

compact maple
#

oh

cosmic lichen
#

What applies to arma 2 mostly applies to arma 3

compact maple
#

Alright

#

will check if there are others docs for the filePatching thing

fair drum
tough abyss
fair drum
#

do this

#

remove the event handler

#
["MEZ", true, true, false, true] spawn BIS_fnc_endMission
#

instead of your current end mission

tough abyss
#

so

["MEZ", true, true, false, true] spawn BIS_fnc_endMission

instead of

"MEZ" call BIS_fnc_endMission;
fair drum
#

yes

tough abyss
#

@fair drum you are a legend, thank you. I'll go research what each parameter does now lol. Thanks ๐Ÿ™‚

proven charm
hearty hound
#

I'm trying to get guys to move into specific cargo seats of trucks when they get created but for some reason they never end up in the right seats. They always seem to go to the next available seat and not the specified one. Here's what I have:

_truck1 = [ [getMarkerPos "tankMarker", -30, markerDir "tankMarker" ] call BIS_fnc_relPos, markerDir "tankMarker", "O_Truck_02_transport_F", _truckgroup] call BIS_fnc_spawnVehicle;
_truck1 = (_truck1 select 0);
player assignAsCargoIndex [_truck1, 8];
player moveInCargo _truck1;```
Any thoughts? Killzone Kid's comment here seems to imply I'm doing it correctly: https://community.bistudio.com/wiki/moveInCargo
proven charm
#

sqf player moveInCargo [_truck1,8];

#

try that

hearty hound
#

that returns this

#

oh nvm

#

I dont know how to read

#

sameish problem though:

#
player assignAsCargoIndex [_truck1, 8];```
copper raven
#

sqf...?

#

there is no operator sqf

proven charm
#

sorry about the "sqf", didnt mean to include it ๐Ÿ™‚

hearty hound
#

so I guess the "correct way" on the biki is not actually the correct way then

#

or one of the correct ways anway

#

that worked though. Thank you!

proven charm
#

two syntax, you just pick the one you need

hearty hound
#

the second one doesn't actually do what it says it does though. Talking about the bottom comment on it

proven charm
#

ah I see. must be old comment then...

distant oyster
#

assignAsCargo only applies to AI

#

uuhh i think?

hearty hound
#

it's for AI. I was just using myself to test because it was quicker than having to look around the interior of a BMP which is what I originally started on but then decided to make sure it wasn't the problem of the modded BMP by using a base game truck

fair drum
#

message lou and see if you can get a note on the wiki page if it truely only works for AI

fair drum
#

so I have two arrays:

private _jamUnits = [ bunch of objects ];
private _mines = [ bunch of objects ];

i'm trying to get it to take each mine and iterate each jamUnit or vis versa. So I have two iterations happening at the same time. I tried a stacking forEach but the commands I was placing on the inner array were firing on the outer array. Any ideas?

little raptor
#

or maybe a short sample

fair drum
#

well its gotten a little better now... this is my current thing... working on getting a way to get simulation back on after they leave the distance area. I'm trying to avoid spawning scripts on every unit or mine and just let the server handle it going through arrays.

[_moduleLogic] spawn {

    params ["_moduleLogic"];

    private _units = _moduleLogic getVariable ["module_units", []];
    private _range = _moduleLogic getVariable ["range", 50];
    private _explode = _moduleLogic getVariable ["explode", false];
    private _classes = _moduleLogic getVariable ["module_mine_classes", []];

    while {true} do {

        private _nearMines = [];
        {
            _nearMines pushBackUnique (nearestObjects [_x, _classes, _range]);
        } forEach _units;
        {
            if (_explode) then {
                _x setDamage 1;
            } else {
                _x enableSimulationGlobal false;
            };
        } forEach _nearMines;
        sleep 1;
    };
};
#

i changed to doing mine classes rather than mine objects initially

little raptor
#

_nearMines is an array of array of objects

#

and you didn't need to create a separate array for it

fair drum
#

this was the original

{
    _vehicle = _x;
    {
        if (_x distance _vehicle <= _range) then {
            if (_explode) then {
                _x setDamage 1;
            } else {
                _x enableSimulationGlobal false;
            };
        };
        if (_x distance _vehicle > _range) then {
            _x enableSimulationGlobal true;
        };
    } forEach _mines;
} forEach _units;

with the variables defined outside of it, but I knew this was wrong

little raptor
#

either way, nearestObjects is a slow command

fair drum
#

kinda get the idea of what I'm trying to do though then?

little raptor
#

yeah

#

this is the slightly faster (and error free) version of your code:

[_moduleLogic] spawn {

    params ["_moduleLogic"];

    private _units = _moduleLogic getVariable ["module_units", []];
    private _range = _moduleLogic getVariable ["range", 50];
    private _explode = _moduleLogic getVariable ["explode", false];
    private _classes = _moduleLogic getVariable ["module_mine_classes", []];

    while {true} do {
        {
            {
              if (_explode) then {
                _x setDamage 1;
              } else {
                _x enableSimulationGlobal false;
              };
            } forEach (nearestObjects [_x, _classes, _range]);
        } forEach _units;
        
        sleep 1;
    };
};
fair drum
#

ah so i was on the right track, just had some command issues then

little raptor
#

although I'm not sure why you're doing the enableSimulationGlobal

fair drum
#

vehicle jamming module, its running only on the server so that's why global

little raptor
little raptor
fair drum
#

it looks like it prevents it exploding if run over, but still allows for defusing

#

at least when I messed with it yesterday

little raptor
#

if you're in control of everything ditch the loop

#

use an "event handler"

fair drum
#

cause my vehicle distance is always changing as the vehicle drives around

little raptor
fair drum
#

module has an option to tick that when the jammer vehicle gets in range, that it actually just ruptures the mine instead of disables it

#

kinda simulating a focused RF attack

wicked fulcrum
#

Is there a way to get the current curatorLogic/object of the one using a zeus-module? I'm using ZEN to register custom zeus modules and it provides the selected _pos and _unit but I can't seem to find a way to get the current curator object that used the module. I can get all curators with the allCurators but not sure how to check and get which one "I am" when I am zeus and calling the module.

wicked fulcrum
#

ugh. Stupid me. Didn't realise player returns the current player object..... Thanks!

tiny wadi
sacred slate
#

i am quite a starter scripter. can some one help with that please?


// mybox is the variable of a B_T_Truck_01_box_F in the editor

_mybox = mybox;

{
  
    _x addweaponCargoGlobal ["launch_I_Titan_short_F", 1];    
    _x addMagazineCargoGlobal ["Titan_AT", 5];   

    _x addweaponCargoGlobal ["launch_I_Titan_F", 1];    
    _x addMagazineCargoGlobal ["Titan_AA", 3];    

    _x addBackpackCargoGlobal ["B_Carryall_mcamo", 2]; 

    _x addMagazineCargoGlobal ["ATMine_Range_Mag", 2]; 

    _x addMagazineCargoGlobal ["SatchelCharge_Remote_Mag", 2]; 

    _x addMagazineCargoGlobal ["16Rnd_9x21_Mag", 5]; 

    _x addItemCargoGlobal ["Rev_darter_item", 1];
    _x addItemCargoGlobal ["ToolKit", 1]
  
} foreach _mybox;

robust brook
#

@sacred slate ```sqf
private _boxObject = mybox;
private _lootTable = [
["launch_I_Titan_short_F", 1],
["Titan_AT", 5],
["launch_I_Titan_F", 1],
["Titan_AA", 3],
["B_Carryall_mcamo", 2],
["ATMine_Range_Mag", 2],
["SatchelCharge_Remote_Mag", 2],
["16Rnd_9x21_Mag", 5],
["Rev_darter_item", 1],
["ToolKit", 1]
];

{
_x params ["_xItem", "_xCount"];
_boxObject addItemCargoGlobal [_xItem, _xCount];
} forEach _lootTable;

fair drum
#

_x params ["_blah", "_blah"] is the best

little raptor
#

you don't need any params

#

_boxObject addItemCargoGlobal _x

tidal ferry
#

Quick quick quick, is there a script to add all Zeus modules to player?

#

Need it urgent

little raptor
#

I think you can only have 1

fair drum
#

1 game master then you can have a couple of side kicks i think

little raptor
#

yeah but 1 per player

#

add all Zeus modules to player

tidal ferry
#

No no, we already have the Gamemasters but thhey don't have moduels enabled

#

We know the fix but we're mid-mission

violet gull
#

Are there any code editors with customization like Notepad++ for Android smartphones? I've been using regular note taking apps and they suck lol

fair drum
#

oh so they just don't have modules like "heal" or "teleport" and that stuff

little raptor
#

(note: server exec)

#

@tidal ferry allCurators gives you the list of all modules

tidal ferry
#

Amazing, legendary, thanks

#

Going to try it

#

Okay, so allCurators fetches the logics

#

Any way to fetch the Zeus players?

#

Can't fenagle it atm, juggling missionmaking

little raptor
#

there's no such thing as zeus players

#

you mean Zeus slots in lobby?

copper raven
#

allPlayers select { !isNull getAssignedCuratorLogic _x }

#

?

little raptor
#

that's all of them! ๐Ÿ˜„

copper raven
#

๐Ÿค”

little raptor
#

they don't have any zeus assigned (apparently)

#

hence the problem

fair drum
#

if ace is enabled, they can change a setting that allows for zeus creation mid game by either admin player, or open all, etc

#

would show up in the radial menu

little raptor
#

if you gave them names in mission editor, try:

_p = allPlayers select { !isNull getAssignedCuratorLogic _x } apply {[_x, vehicleVarName _x]}
```and find the one which was the Zeus thing
tidal ferry
#

yeah, Logics are zeus1, zeus2, zeus3

#

Jugglign this and improvising with what we have

little raptor