#arma3_scripting

1 messages ยท Page 760 of 1

worthy light
#

That could work

open fractal
#

why set up placeholders

#

I can say I donโ€™t know for certain if this will apply to everyone connecting or only the first person to fill that slot

#

But itโ€™ll work to set up your function and you can run a different check if you need to later

worthy light
#

I was customising the loadouts in the editor so it was just easier to setup the players as placeholders.

open fractal
#

this doesnโ€™t make sense

#

what place do you need to hold

ebon citrus
#

When removeWeaponCargoGlobal ?

worthy light
#

Hmm how can I make it make sense... It's going to be 4 players. I know who they are... In the editor I can set those up and make them playable right.. and give them all a loadout.. I mean "placeholder" as in this.. the players.. template... i dunno what to call it

open fractal
#

playable units?

worthy light
#

Yeah

open fractal
#

just call them that

worthy light
#

soz

open fractal
#

does your mission have respawns?

worthy light
#

Yeah, on the place they died, just set that in the editor preferences.

#

It's just the first connection of the player to the playable unit where I want to throw them in a vehicle or something and bring them to a location.

stone hornet
#

Hey guy i have another issue, i have set up premade loadout for each role, when they spawn all is good and they have their weapons and equipment but when they respawn they dont have their weapons.

i am using 3den editor and have this in my description.ext:
respawnOnStart = 0;
respawnTemplates[] = {"MenuPosition"};
respawn = "BASE";

any thoughts?

granite sky
stone hornet
#

fixed it, cheers for pointing me in the right direction, sorry again for all of these questions

rough summit
#

Hey guys, rn im try write simple zone capture script...But, im not good in sqf and need help with my code ๐Ÿ˜„

private _captureTimer = 900;
private _flags = [flag1,flag2,flag3];

{
    if ((player distance _x) < 200) then {
        while {uiSleep 5; (player distance _x) < 200} do {
            private _allNearPlayers = _x nearEntities ["Man", 200];
            private _nearEnemies = [];

            for "_i" from 0 to (count _allNearPlayers - 1) do { 
                if (side (_allNearPlayers select _i) != side player) then {
                    _nearEnemies pushBack _x;
                };
            };

            if (count _nearEnemies == 0) then {
                if (_captureTimer != 0) then {
                    _captureTimer = _captureTimer - 5;
                } else {
                    private _newFlagOwner = 4;

                    switch (side player) do {
                        case West: { _newFlagOwner = 1; };
                        case East: {  _newFlagOwner = 2; };
                        case Independent: {  _newFlagOwner = 3; };
                        default { _newFlagOwner = 4; };
                    };

                    _x setVariable ["flag_owner",_newFlagOwner, true];
                };
            };
        };
    };
} forEach _flags;
#

So, my question is. When im try using _x in foreach, how i need mark _x here?

_nearEnemies pushBack _x;
wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
rough summit
#
private _captureTimer = 900;
private _flags = [flag1,flag2,flag3];

{
    if ((player distance _x) < 200) then {
        while {uiSleep 5; (player distance _x) < 200} do {
            private _allNearPlayers = _x nearEntities ["Man", 200];
            private _nearEnemies = [];

            for "_i" from 0 to (count _allNearPlayers - 1) do { 
                if (side (_allNearPlayers select _i) != side player) then {
                    _nearEnemies pushBack _x;
                };
            };

            if (count _nearEnemies == 0) then {
                if (_captureTimer != 0) then {
                    _captureTimer = _captureTimer - 5;
                } else {
                    private _newFlagOwner = 4;

                    switch (side player) do {
                        case West: { _newFlagOwner = 1; };
                        case East: {  _newFlagOwner = 2; };
                        case Independent: {  _newFlagOwner = 3; };
                        default { _newFlagOwner = 4; };
                    };

                    _x setVariable ["flag_owner",_newFlagOwner, true];
                };
            };
        };
    };
} forEach _flags;
rough summit
little raptor
#

also just use forEach

rough summit
#

forEach in forEach?

little raptor
little raptor
#
{
    if (side group _x != side group player) then {
         _nearEnemies pushBack _x;
    };
} forEach _allNearPlayers;
little raptor
#
_nearEnemies = _allNearPlayers select {side group _x != side group player};
rough summit
#

wow

rough summit
#

will these two variables be confused in the strings?

#
            private _nearEnemies = _allNearPlayers select {side group _x != side group player};
#
                    _x setVariable ["flag_owner",_newFlagOwner, true];
#

In first message _x is every guy

little raptor
#

no

rough summit
#

in second _x is every flag

little raptor
granite sky
#

(and private, so they don't overwrite the parent scope)

little raptor
#

_x is private to its own scope

#

basically a forEach loop is like doing this:

for "_forEachIndex" from 0 to count _array - 1 do {
  private _x = _array select _forEachIndex;
}
#

if there's another _x outside this scope it won't be seen (at least not through the _x identifier)

rough summit
#

Ok, thanks for help

little raptor
rough summit
#
(player distance _x) < 200
little raptor
rough summit
#

im give 2 arguments
string "TaskSucceeded"
and array with 2 elements["", "Test"]
But fnc didn't work...

little raptor
rough summit
#

local hosted

#

and single too

little raptor
#

-2 means skip the server

#

so it never shows for you

#

never use -2

rough summit
#

-2 means every client

little raptor
#

no

rough summit
#

-2 means every client but not the server

little raptor
#

yeah

rough summit
#

Wiki info

little raptor
#

you just answered your own question

rough summit
#

Lol, ok

little raptor
#

-2 means every client but not the server

rough summit
#

Yeah, 2 work fine

little raptor
rough summit
#

I thought that in order for the function to be on all clients, it is not necessary to transfer it to the server

little raptor
#

in order for the function to be on all clients, it is not necessary to transfer it to the server
every message in MP always goes through the server

#

with -2 you just tell the server to not execute the code for itself

hallow mortar
#

-2 would work when using a dedicated server, because then the server isn't the same as your client, and as a server with no visual display it doesn't care about notifications. However, it causes problems in locally-hosted games (like the Editor MP preview) because the server is also a client. You could use -2 if you were absolutely certain it would only ever be run in a DS-hosted game, but that's a dangerous assumption to make, and of course it makes it hard to test the mission.

rough summit
# little raptor rn you're both a client and a server

so, i don't know why, but when im going to flag position nothing happens

private _captureTimer = 30;
private _flags = [flag1,flag2,flag3];

{
    while {uiSleep 5; (player distance _x) < 200} do {
        private _capturingFlag = "";

        switch (_x) do {
            case flag1: { _capturingFlag = "1"; };
            case flag2: { _capturingFlag = "2"; };
            case flag3: { _capturingFlag = "3"; };
            default { _capturingFlag = "" };
        };

        ["TaskAssigned", ["", format ["Capture of flag number %1 has begun",_capturingFlag]]] remoteExec ["BIS_fnc_showNotification", [0, -2] select isDedicated];

        private _allNearPlayers = _x nearEntities ["Man", 200];
        private _nearEnemies = _allNearPlayers select {side group _x != side group player};

        if (count _nearEnemies == 0) then {
            if (_captureTimer != 0) then {
                _captureTimer = _captureTimer - 5;
            } else {
                private _newFlagOwner = 4;

                switch (side player) do {
                    case West: { _newFlagOwner = 1; };
                    case East: {  _newFlagOwner = 2; };
                    case Independent: {  _newFlagOwner = 3; };
                    default { _newFlagOwner = 4; };
                };

                _x setVariable ["flag_owner",_newFlagOwner, true];
                [_x] spawn ddd_fnc_fetchFlagOwners;
            };
        } else {
            systemChat "Enemy is near, capturing blocked";
        };
    };
} forEach _flags;
#

before this im try this version, but this didn't do any too

private _captureTimer = 30;
private _flags = [flag1,flag2,flag3];

{
    if ((player distance _x) < 200) then {
        private _capturingFlag = "";

        switch (_x) do {
            case flag1: { _capturingFlag = "1"; };
            case flag2: { _capturingFlag = "2"; };
            case flag3: { _capturingFlag = "3"; };
            default { _capturingFlag = "" };
        };

        ["TaskAssigned", ["", format ["Capture of flag number %1 has begun",_capturingFlag]]] remoteExec ["BIS_fnc_showNotification", [0, -2] select isDedicated];

        while {uiSleep 5; (player distance _x) < 200} do {
            private _allNearPlayers = _x nearEntities ["Man", 200];
            private _nearEnemies = _allNearPlayers select {side group _x != side group player};

            if (count _nearEnemies == 0) then {
                if (_captureTimer != 0) then {
                    _captureTimer = _captureTimer - 5;
                } else {
                    private _newFlagOwner = 4;

                    switch (side player) do {
                        case West: { _newFlagOwner = 1; };
                        case East: {  _newFlagOwner = 2; };
                        case Independent: {  _newFlagOwner = 3; };
                        default { _newFlagOwner = 4; };
                    };

                    _x setVariable ["flag_owner",_newFlagOwner, true];
                    [_x] spawn ddd_fnc_fetchFlagOwners;
                };
            } else {
                systemChat "Enemy is near, capturing blocked";
            };
        };
    };
} forEach _flags;
little raptor
#

forEach has to be inside the while

#

not outside

rough summit
little raptor
#

also stop pinging me for everything

rough summit
#

ok

little raptor
rough summit
#

U suggest add one more while?

granite sky
#

How often are you running this routine?

rough summit
#
while {uiSleep 1;true} do {
  {....}forEach _flags;
};
little raptor
#

swap the position of the while and forEach

rough summit
#

But now script runs every 5 secs, when player stay in zone

#

And i don't know how handle it ๐Ÿ˜„

wind flax
#

If you use playSound3D from an action, is there any reason why it wouldn't play for all players?

valid abyss
#

is there any way to turn out an ai gunner and make him shoot his turret?

coarse dragon
#

Is there a way to pause the gameplay during Text messages with a black screen?

valid abyss
#

That pretty much pauses the game

#

{
_x enableSimulation true;
} foreach allUnits

coarse dragon
#

Then change to True at the end.

valid abyss
coarse dragon
#

๐Ÿ˜†

#

Thank you

tranquil jasper
noble zealot
#

Can i usesqf player remoteControl _anotherPlayer; switchCamera _anotherPlayer;?

#

The _anotherPlayer will lose control over his player?

open fractal
#

no

noble zealot
#

What will happens? ๐Ÿ˜ฎ

#

I will just spect the other player without any control?

winter rose
#

it will not work (but the switchCamera iirc)

limpid charm
#

Hi, how can i disable editing objects for moderator in zeus scenario? I tried

[[], {
  _modLogic = (allCurators select { str _x == "bis_curator_1" }) # 0;
  _modLogic removeCuratorEditableObjects [(entities ""), true];
}] remoteExec ["spawn", 2];
``` but no effect
noble zealot
#

๐Ÿ‘

limpid charm
#

could spawn be an issue here?

fair drum
#

since there is no need for scheduled environment, you can just use call. or the best way is to create a function then remoteexec that function

limpid charm
#

thanks, but it doesn't work with call as well

fair drum
#

well that's just the start...

#

remove all the remote executing and stuff and make yourself a script that works first, then worry about the MP component

limpid charm
#

but zeus is MP scenario

fair drum
#

i mean when you are testing it locally

#

why are you trying to select the specific curator? are you having other curators in the match?

limpid charm
#

i am testing it with local server and 2 game clients

tranquil jasper
#

the best way is to create a function then remoteexec that function
isn't this a little circumstantial

fair drum
tranquil jasper
#

also removeCuratorEditableObjects is server execute only

limpid charm
#

thats why i remoteExec with option 2

tranquil jasper
#

why not just...run the code from initServer

limpid charm
#

because i want dynamicaly call this

fair drum
#

are you sure _modlogic is even storing anything with your str filter? I don't think its going to grab what you want it to

tranquil jasper
#

then yeah in this case it's probably best to create a function or code variable then use remoteExec to execute it, not broadcast code

limpid charm
#

i want zeus to be able to remove editing ability from moderator if he wants so

#

yeah, there is a real curator in _modLogic

fair drum
limpid charm
#

ok, but it will not help me with my issue

fair drum
#

chill, i'm testing some stuff

limpid charm
#

as far as i understand in zeus scenario there are 2 default curators. Zeus curator has "bis_curator" name and moderator curator has "bis_curator_1" name

fair drum
#

so I did it just fine.

make 3 game master modules and name them what you want. make your zeus logics and give them variables. give those variables to the game master under owner (DO NOT SYNC THEM - I used bis_cur_1 as my variable name).

#
// init.sqf
if (isServer) then {
    bis_cur_1 removeCuratorEditableObjects [entities "", true];
};

// or initServer.sqf
bis_cur_1 removeCuratorEditableObjects [entities "", true];

// Or whatever you named your affected gamemaster module (I named mine bis_cur_1)
#

if you want to call it whenever:

[bis_cur_1, [entities "", true]] remoteExec ["removeCuratorEditableObjects", 2];
#

so for the default zeus scenarios, just use the variable names that you already figured out

native slate
#

would anyone be able to help me with adding ace actions to the seats of a vehicle?

#

all the actual ace documentation seems to be down right now

limpid charm
#

i never tried make it in editor

fair drum
#

which in that case, use your bis_curator_1

limpid charm
#

yeah, thats a default scenario. you can start server and select this gamemode

acoustic abyss
#

I'd like to give players an option to (re)spawn into their own plane when they select a specific respawn position. Making the vehicle (createVehicle) and putting the player in as driver (moveInDriver) is the easy part. But how do I activate this code?

At the moment I have made a very expensive solution using a trigger placed around the respawn position. But can I somehow package this into an eventhandler, for when the player selects this specific respawn point?

acoustic abyss
tranquil jasper
#

if ((_this # 0) distance2D coords < 20)

acoustic abyss
#

That's a major improvement over a trigger in terms of performance; thank you! Can't help though but think I'm missing some obvious way of identifying the chosen respawn position.

tranquil jasper
#

maybe

if ((_this # 0) distance2D (getMarkerPos "myRespawnMarker") < 20)
acoustic abyss
#

Yeah I get the gist of your code is to take the 2D distance as condition. I guess that's plenty fast, and requires no network traffic, so should suite fine.

fair drum
#

are you using the in game "MenuPosition" for the respawn? if so I have a work around

acoustic abyss
#

I'm complaining that I'm missing a more clever solution. Really actually just pointless. Let me try out your solution.

tranquil jasper
#

There doesn't seem to be a way to return what marker you respawned on from the reading I'm doing, but this is an area I haven't explored very much

#

so the only thing I can think of is just a distance check

acoustic abyss
#

Cool. Appreciate the honest feedback, not to mention fix.

fair drum
#

if you use the built in respawn menu, you can return the string value of the respawn location the player selected

tranquil jasper
#

I'd be interested to see that workaround Hypoxic

fair drum
#

I have to find it... its buried here somewhere

#

found it

private _ctrlListbox = uiNamespace getVariable "BIS_RscRespawnControlsMap_ctrlLocList"; 
private _currentSelected = _ctrlListBox lbText lbCurSel _ctrlListBox;
tranquil jasper
#

so I'm reading the bohemia functions

#

There is a uiNamespace variable that doesn't seem to get cleaned up after respawning

#
_list = uiNamespace getVariable "BIS_RscRespawnControlsSpectate_ctrlLocList";
//_curSel = if !(lbCurSel _list < 0) then {lbCurSel _list} else {0};
_curSel = (lbCurSel _list) max 0; //<--- shorter, easier to understand, probably more performant
_metadata = ["get",_curSel] call BIS_fnc_showRespawnMenuPositionMetadata;

I'm willing to bet the marker name would be contained in _metadata somewhere

#

So I guess put this in the respawn event handler then just..die, and see what happens

_list = uiNamespace getVariable "BIS_RscRespawnControlsSpectate_ctrlLocList";
//_curSel = if !(lbCurSel _list < 0) then {lbCurSel _list} else {0};
_curSel = (lbCurSel _list) max 0; //<--- shorter, easier to understand, probably more performant
_metadata = ["get",_curSel] call BIS_fnc_showRespawnMenuPositionMetadata;
systemChat str _metadata;
copyToClipboard str _metadata;
#

Or you could just get the text directly from the control like @fair drum's example oof lol

#

so that was a waste of some time lol

fair drum
#

nothing is ever a waste of time if you learned something lol

tranquil jasper
#

I suppose not...anyway...back to antistasi heheh

acoustic abyss
#

Well that is educational on uiNameSpace usage. Always intimidated me.

Probably because I don't get basics like: how do I set the correct azimuth of a plane and its velocity upon respawn? Because at the moment my spawn planes fly hilariously northward whilst facing my preferred direction. I've tried setDir and setVectorDir. Do I really have to setVelocity? Or is there some part of createVehicle I didn't get?

fair drum
#

creating a vehicle just creates something static. you'll have to add some velocity to the vehicle so that it has time to start its engines and stuff. otherwise it will just fall out of the sky until its engines spool up

acoustic abyss
#

Oh yes, I should add that I included the parameter "FLY" in createVehicle

#

But that seems to orient the plane directly North. I'm trying to get it to face (and travel) to another azimuth.

tranquil jasper
#

You can just use setVelocityModelSpace to do the trigonometry for you

fair drum
#

you'd set the direction, then add velocity along the vehicle's model Y axis I believe

acoustic abyss
#

Yeah okay, so I need to add another line to specify velocity. Thanks gents.

tranquil jasper
#

either that or you'll be breaking out sin and cos

#

so setVelocityModelSpace is much simpler lol

little raptor
tranquil jasper
#

also don't be scared of BIS weird coding...uiNamespace is just a different namespace like any other...it was some dev's choice to store an entire listBox in that variable rooooolf

little raptor
tranquil jasper
#

Just wanna throw out there that ^ is true of BIS functions as well which is how I was answering the previous question

little raptor
tranquil jasper
#

tbh I'd argue that there's not a lot of difference in uiNamespace and missionNamespace, at the least

little raptor
#

There are
uiNamespace

  1. is persistent through game session
  2. is not serialized
  3. can store ui elements directly without need to deserialize them
  4. Cannot be broadcast
#

Their only similarity is being able to store variables

#

Which is the job of a namespace in the first place

orchid stone
#

is there a command/function like nearobjects that accepts an area array [50,50,1,false] and returns all objects inside?

#

trying to write a script that aggressively removes debris from a rectangular area

tranquil jasper
#

virtually none of the commands accept a rectangular area, you'll have to create your own

orchid stone
#

inareaarray does, but requires me to know the objects ahead of time

tranquil jasper
#

maybe you should just do nearest objects then iterate over everything checking if it's InArea

plush belfry
#

I was wondering how I would be able to check if the default value of a variable has changed, what I mean is,


//eventually the default value gets changed
met = 2

//I wanna try and activate something repeatedly when this value is changed from its default
met = 4
//so every time met changes and its not the value 0, I want to trigger something using a condition in a trigger```
orchid stone
#

was thinking that. just get the max diameter, then iterate over each object

#

might try that and test performance. thanks for the sanity check

#

jesus just had to google hypotenuse for the first time in decades. damn you 5th grade math

tranquil jasper
#

just keep in mind if you're going to do some list trimming using a distance check that using the distance to the outer bounds of the square will cut off the corners, so you'll need to use the distance to the corner

#

oh, yeah, looks like you realized that

orchid stone
#

good lookin out though

#

thanks man

tranquil jasper
#

as long as it's a square area you should be able to use sqrt(2(s/2)^2)

#

where s is length of one side

orchid stone
#
{
   _area = _x getvariable ["objectArea",[50,50,1,false]];
   _sidea = (_area # 0);
   _sideb = (_area # 1);        
   _radius = sqrt((_sidea^2) * (_sideb^2))

   //nearobjects and delete blah blah
} foreach _cleaners;
#

close enough!

#

every time i post code it fails miserably, so just forcing the failure now

#

and there it is... missed the ;

#

and the math is wrong

#

boom, perfect all fixed and working now!

tranquil jasper
#

If you start using VS Code some guys have written SQF linters

orchid stone
#

i do. using SQF lanuage by Armitxes

#

i'll try a few others. this one doesn't appear to give me reminders for line endings

#

works beautifully otherwise

tranquil jasper
cold mica
#

Is there a way to schedule execution? I want to call a function every 30 real life minutes or 1 in-game hour.

tranquil jasper
#

also having too many scripts can make it so it's a long time before they get another turn, ie not guaranteed to be perfect for timekeeping. I mean, even with the inaccuracy it's probably good enough, but if you want to be really safe you can do something like this:

_time = time + (60 * 60);
waitUntil {time > _time};
cold mica
#

Where would I put it? I assume I would fill my init.sqf with a bunch of waitUntils

tranquil jasper
#

well you could use almost exactly the same code that I posted for the other guy, of course it all depends

_time = time + (60 * 60); //use this if the function shouldn't run until the next run
_time = time; //use this if the function should be called immediately
while {true} do {
    waitUntil {time > _time};
    _time = time + (60 * 60);
    call myFunction;
};
cold mica
#

That will probably work. I was wondering if there are any other solutions that avoid while loops

pulsar bluff
#

some of us run one main mission loop to handle infrequent/scheduled events

#

the time spent fretting about one while loop is time wasted

#

what you dont want to do is rely on while loops laterally (like, having a new one for each task)

little raptor
#

//so every time met changes and its not the value 0, I want to trigger something using a condition in a trigger
if you're the one changing it, you know where and when you're doing it. you don't need loops or triggers

coarse dragon
#

Why won't this work?

Bob sideChat "blah blah";
sleep 5;
Bob sodeChat "meow";

warm hedge
#

sodeChat?

coarse dragon
#

sidechat meowsweats

#

its spelt correct in the init

warm hedge
#

Then that's why. Object init doesn't accept sleep

coarse dragon
#

a AI is considerd a object?

warm hedge
#

What? Yes

coarse dragon
#

anyway to get it to work?

warm hedge
#

Use spawn

coarse dragon
#

[] spawn ]?

warm hedge
#

I think you know how to do that, yeah

coarse dragon
#

I had a feeling

#

Hmm

#

It just says. On activation. And it's blank

warm hedge
#

That's a traditional bug. Use _nil = [] spawnas prefix

coarse dragon
digital wasp
#

can anybody help me? i need to change reload time (time between you can fire) to 4 seconds on a mk41 vls. i tried using setWeaponReloadingTime but it says i need to also list a gunner but it doesnt have one. im confused

warm hedge
#

Yes it does. You can get via gunner command IIRC

digital wasp
#

mk41 setWeaponReloadingTime [gunner mk41, currentMuzzle (gunner mk41), 4];?

warm hedge
#

Ye

digital wasp
#

well it doesn't work for me

#

im operating mk41 via uav terminal

#

is that the problem?

warm hedge
#

setWeaponReloadingTime uses 0-1 range

digital wasp
#

how can i set it to 4 seconds then?

#

is 0 start point of relaod and 1 is when it's completed?

warm hedge
#

Also I don't think you're understanding it properly in the first place. It "resets" the phase between a bullet and a bullet, not "set"

digital wasp
#

so if original time is 16 seconds i need to mk41 setWeaponReloadingTime [gunner mk41, currentMuzzle (gunner mk41), 3/4]; to make it 4 seconds?

warm hedge
#

0 is completed

digital wasp
#

so 1/4?

warm hedge
#

So you need to use the command everytime the VLS shot, not only once

#

Ye 1/4

manic sigil
#

The wiki has an example for boosting RPM

#
unit addEventHandler ["Fired", {
    _this # 0 setWeaponReloadingTime [_this # 0, _this # 2, 1/3];
}];
coarse dragon
#

{
_x enableSimulation false;
} foreach allUnits

was using this for my Cut scene but makes all the troops who are hidden with the Hide/show modules invisible

digital wasp
warm hedge
#

unit must mk41

digital wasp
#

so like this?

warm hedge
#

Think so

digital wasp
#

and where do i put it? in init of the mk41?

#

works brilliant, thanks

warm hedge
#

That'd work. Not good for MP tho

digital wasp
#

put in in init of the gun

digital wasp
warm hedge
#

Init does run the code for every players even JIP player

digital wasp
#

oooooooh

#

so what should i do?

warm hedge
#

Use isServer as well

digital wasp
#

so

if (isServer) then {
mk41 addEventHandler ["Fired", { 
 mk41 setWeaponReloadingTime [gunner mk41, currentMuzzle (gunner mk41), 1/4];
}];
};```
warm hedge
#

Sounds fine

digital wasp
#

okay, thanks

coarse dragon
#

is there a way to get all AI and players Selected for this code?

{
_x enableSimulation false;
} foreach allUnits

warm hedge
#

allUnits does?

coarse dragon
#

{
allUnits enableSimulation false;
} foreach allUnits

#

like that?

warm hedge
#

Waht

coarse dragon
#

wot

warm hedge
#

Your first code already does it

#

And latter wrong

coarse dragon
#

it breaks all my hidden troops keeps them invisiable

warm hedge
#

enableSimulation doesn't show/hide someone. What are you expecting?

coarse dragon
#

that when i pass the trigger i set for them for them to become visable

warm hedge
#

_x hideObject false instead

coarse dragon
#

wont that make everything visable at once?

warm hedge
#

What

winter rose
#

visible*

coarse dragon
#

ok ive 3 sets of groups. in there own layers. with Hide/Show and a trigger set up to show the groups

#

_x hideObject false

will that make them all visible at the same time.

digital wasp
#

im not an expert but maybe something like

{
   _x hideObject false;
} foreach units group1; 
``` can work?
#

and then for 2 other groups the same thing

#

idk

coarse dragon
#

4 groups are at different trigger stages .

digital wasp
#

im confused. what are "trigger stages"?

coarse dragon
#

Ya go into a trigger and group 1 will be shown and ya attack em then so on

digital wasp
#

i see

#

so like 4 triggers and 4 groups

#

oh and is it mp or not

coarse dragon
#

Both

digital wasp
#

uh

#

well you need to

{
   [_x,false] remoteExec ["hideObject"];
} foreach units group1; 
#

so then in will unhide it globally

#

for mp

#

can anybody who knows more than me in coding confirm?

coarse dragon
#

Interesting I'll have a stab at that cheers

warm hedge
#

No need to remoteExec just hideObjectGlobal

copper raven
#

might still require remoteExec, as it needs to be executed on the server

warm hedge
#

Ah tru

coarse dragon
#

I'm just doing it differently now

digital wasp
#

hey, i have a question. how do i make a SAM fire with a scipt?

tranquil jasper
#

kind of vague

digital wasp
#

already figured it out

#

next question; how do i disable uav's autonomy on teh start of the mission

#

uav setAutonomous false?

tranquil jasper
nocturne canopy
#

Anyone know the _ammo class names for the ACE Hand flares?
The ones that return on a "Fired" Event Handler are "ACE_G_Handflare_Red" however when I try to spawn one with createVehicle it spawns the model but the flare does not actually go off. The magazine classname ("ACE_HandFlare_Red") has also been tried however it does not spawn anything with createVehicle.

granite sky
#

I would guess it's doing an object replacement after a few seconds like with the IR chemlight.

#

hmm, no. Maybe you just have to setDamage 1 the thing?

nocturne canopy
digital wasp
#

how to randomise a subtitle?

coarse dragon
#

๐Ÿค”

digital wasp
#
rand = random 1
if (rand == 0) then { first subtitle } else { second subtitle };
``` something like this would work for 2 subtitles?
little raptor
#
_subs = ["a", "b", "c"];
_sub = selectRandom _subs
#

also why do you use a global var for rand? meowsweats

digital wasp
#

and how would i make the subtitles appear?

little raptor
#

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

digital wasp
little raptor
#

there's a BIS fnc iirc

pastel pier
#

I fixed my key bindings not working unless required. But this overrides other key bindings. Making them not activate. For example binding shift+forward button in my mod stops me from moving my camera around fast in Eden. Do i need to file a ticket or is there something i might be doing wrong?

little raptor
digital wasp
little raptor
#

what's the function?

#

i have the command
that's a function, not a command

digital wasp
#
[  
  ["Speaker 1","Text 1",0], 
] spawn BIS_fnc_EXP_camp_playSubtitles;
little raptor
digital wasp
#

why the local variable

#

im just new to coding, wanna know

little raptor
#

also local variables are typically faster

digital wasp
#

oh ok

#

so i have to make that array inside the script?

#
_texts ["text1", "text2", "text3"];
[  
  ["Speaker 1", selectRandom _texts, 0]
] spawn BIS_fnc_EXP_camp_playSubtitles;
``` is this how the whole script should look?
little raptor
#

needs =

digital wasp
#

yeah i forgot

little raptor
# digital wasp oh ok

basically you should only use global variables if you want it to survive after the script is ended (e.g. you need it later in some other script)

elfin comet
#

Does the number provided to BIS_fnc_respawnTickets have to be a positive number or zero? If I use a negative number, will it just subract tickets instead?

little raptor
still forum
halcyon arrow
#

is there a way to place an amount of objects randomly using maker or something

open fractal
#

yeah

nocturne canopy
open fractal
#

I donโ€™t believe the trees are defined in CfgVehicles anyway so youโ€™d just be dealing with static models

little raptor
runic warren
#

does anyone know of a function/script that can be used to generate equipment thumbails? I've followed the wiki to get everything else (vehicles and units) but does anyone know how to get thumbs for stuff like uniforms, vests and that sort of thing?

little raptor
runic warren
little raptor
#

I'm talking about the same thing

runic warren
#

can BIS_fnc_exportEditorPreviews be used for equipment?

#

where even would I put the p3d paths?

little raptor
#

like I said you have to modify the function yourself.

runic warren
#

ah, right

#

is there any vanilla way of doing that instead of editing an existing function?

little raptor
#

no guarantee it'll work because I didn't test it

little raptor
runic warren
#

I'll take a look, thanks

little raptor
digital wasp
#

i have 3 static turrets and i want them to spawn with 50% chance each, how would i do it?

little raptor
#

just slap what I wrote into a sqf file and execVM it

runic warren
#

Im gonna have to convert it into a function, since just running it takes a thumbnail of every single item in the game

little raptor
#

execVM takes arguments as well

runic warren
#

oh. Didnt know that

little raptor
#
[nil, "all", [], ["mymod"]] execVM "script.sqf";
runic warren
#

"no classes found"

little raptor
#

have you defined your mod in CfgMods?

runic warren
#

[nil, "all", [], ["sas_gear"]] execVM "export_image_thumbs.sqf";

#

as for CFGMods, you mean inside the SQF?

little raptor
runic warren
#

i think so ill double check

little raptor
#

just open config viewer and go to cfgMods

#

I really doubt you have sas_gear in there

runic warren
#

huh I guess I did not

open fractal
open fractal
#

yeah

digital wasp
#

kk

runic warren
little raptor
#

you're just adding it to the config

runic warren
#

I did add it to the config

#

and it still doesnt work

#

i could be doing it wrong though

little raptor
runic warren
#

i do have cfgpatches

little raptor
#

I know. everyone does. your mod doesn't work without one

#

I mean use it

runic warren
#

how?

little raptor
runic warren
#

the patch is called SAS_Gear which was the same thing I was putting before

little raptor
#

ok blobdoggoshruggoogly

runic warren
#

and it didnt work

#

guess the mod's staying with vanilla thumbnails until I can be bothered to manually make them lmao

#

thanks for the help though!

little raptor
little raptor
runic warren
#

then i dont know where the problem is

#

because it has the cfgpatches defined

little raptor
#

what does it say?

runic warren
#

no classes found

#

doesnt work with any of the pbos

#

using the vanilla function i managed to get the vehicles and units

little raptor
#

have you defined your items in CfgWeapons?

runic warren
#

yes although ive separated them in hpp files that are linked to the main config file

#
{
    #include "Cfg_Uniform.hpp"
    #include "Cfg_Vest.hpp"
    #include "Cfg_Headgear.hpp"
};```
#

would that be why it isnt working?

little raptor
#

what is your cfgPatches?

little raptor
runic warren
#
{
    class SAS_Gear
    {
        requiredAddons[]=
        {
            "A3_Characters_F",
            "A3_Weapons_F"
        };
        requiredVersion=0.1;
        units[]=
        {
                 }
weapons[]=
        {
                }```
#

they are filled

#

i just skipped the lines for brevity's sake

#

as in, they are formatted correctly, i can send the cpp file if you'd prefer

#

or at least correctly enough so the game reads them

little raptor
#

I removed the vehicles from it

runic warren
#

gonna try 1 sec

#

still no classes found

#

well, that sucks.

little raptor
#

how are you running the script?

runic warren
#

from the editor's debug console [nil, "all", [], ["sas_units"]] execVM "export_image_thumbs_v2.sqf";

little raptor
#

your cfgPatches is called SAS_Gear

runic warren
#

tried gear as well, did not work either

little raptor
#

you're using the mod field

#

not patches

#

...

runic warren
#

... oh

#

it should be the previous bracket set?

little raptor
#

no, next

#

see what I wrote

runic warren
#

so [nil, "all", [], []["sas_units"]] execVM "export_image_thumbs_v2.sqf" ?

little raptor
#

just copy what I wrote

runic warren
#

where?

#

i am running on your last code snippet

little raptor
#

wherever you're running that

little raptor
runic warren
#

[nil, "all", [], [], ["mypatch"]] execVM "script.sqf"; this ?

little raptor
#

yes

runic warren
#

okay now it does work, issue is that the item is not in frame

#

its hyper zoomed in

little raptor
#

the cam is probably reversed

runic warren
#

how do I fix that?

little raptor
#

for uniforms you might want to create a soldier tho meowsweats

#

they look weird...

runic warren
#

i do have soldiers linked to uniforms

little raptor
#

I mean for screenshots

runic warren
#

hm

#

oh damnit

#

i need to add the vests as spawnable items

#

dont I

#

on the preview they look with vanilla textures instead of with mine

#

well the previews work, and thats what I needed, thank you very much for the help!

little raptor
fleet sand
#

Hi guys i have a question i dont know where to post it so i hope here is fine. I am thinking of creating like a scary op like you enterd in hell or something and is there a way to make sky look red if so how would i do that ?

open fractal
little raptor
# runic warren on the preview they look with vanilla textures instead of with mine

you can modify this part of the code (line 328):

private _hierarchy = configHierarchy _x;
    private _isVeh = _hierarchy param [count _hierarchy - 2, configNull] isEqualTo (configFile >> "cfgVehicles");
    //--- Create object
    _object = if (_isVeh) then {
        createvehicle [_class,_posLocal,[],0,"none"];
    } else { //modify this part for uniforms and vests; create soldiers instead of simple object
        createSimpleObject [gettext (_x >> "model"), _posLocal, true];
    };
runic warren
#

will do

#

uhhhhh how would I change that?

#

change "model" to "unit"?

little raptor
#

wat?

#

create a temp soldier and put on the uniform/vest

runic warren
#

I dont know how to do that?

#

my scripting knowledge is... non existant

runic warren
#

I'll just have to make spawnable plate carriers it seems

#

with that code the uniforms worked but the vests were invisible

little raptor
#

see if it works

runic warren
#

vests show up now but have vanilla textures

little raptor
#

this adds a white overall to them

#

you can also change it to U_B_Protagonist_VR

#

I guess that looks better?

runic warren
#

that works!

#

B_Soldier_VR_F works even better

little raptor
runic warren
#

yeah i did

#

alright

#

well i think this solves my issue, thanks

cold mica
#

Does the this magic variable work in the Presence Condition field?

I want to write !(this inArea "debugZone_0") but this always returns false, inside or outside the debugZone.

fair drum
#

if you hover over the fields, it will show you what magic variables you can use

cold mica
#

No, in a unit's presence condition field

fair drum
#

oh

cold mica
#

I was familiar with that, the tooltip did not mention any magic variables

limpid charm
#

Any idea how to dynamically disable editing for a moderator in the default Zeus scenario if the server was started with parameter that allows editing for a moderator?

tepid vigil
#

Why do journalist clothes (U_C_Journalist) return an empty array with getObjectTextures?

little raptor
proper niche
#

heyo. Im having an issue with CfgSounds/Say3D and was hoping someone with a big brain can point out where im going wrong. The sound is working in-game however it is playing very quietly, and nothing on either the CfgSound classes or the Say3D script line seems to be having an affect on the volume.

#

Script:

params ["_this"];

_windowsShutdownUID = ["76561198053168002", "76561198013224521", "76561198202731368"];
_bonkUID = ["76561198031166588"];
_gruntBirthdayUID = ["76561198198724038"];

_allUID = _windowsShutdownUID + _bonkUID + _gruntBirthdayUID;

if ((getPlayerUID _this) in _allUID) then 
{
    if ((getPlayerUID _this) in _windowsShutdownUID) then 
    {
        _this addEventHandler ["Killed",
        {
            _this spawn
            {
                params ["_unit"];

                _soundSource = "NCA_emptyObject" createVehicle [0,0,0];
                _soundSource setPosASL getPosASL _unit;
                [_soundSource, "NCA_windowsShutdown_sound"] remoteExec ["say3D"];
                sleep 10;
                deleteVehicle _soundSource;
            };
        }];
    };
    if ((getPlayerUID _this) in _bonkUID) then 
    {
        _this addEventHandler ["Killed",
        {
            _this spawn
            {
                params ["_unit"];

                _soundSource = "NCA_emptyObject" createVehicle [0,0,0];
                _soundSource setPosASL getPosASL _unit;
                [_soundSource, "NCA_bonk_sound"] remoteExec ["say3D"];
                sleep 10;
                deleteVehicle _soundSource;
            };
        }];
    };
    if ((getPlayerUID _this) in _gruntBirthdayUID) then 
    {
        _this addEventHandler ["Killed",
        {
            _this spawn
            {
                params ["_unit"];

                _soundSource = "NCA_emptyObject" createVehicle [0,0,0];
                _soundSource setPosASL getPosASL _unit;
                [_soundSource, "NCA_gruntBirthday_sound"] remoteExec ["say3D"];
                sleep 10;
                deleteVehicle _soundSource;
            };
        }];
    };
};
#

CfgSounds (in a mod .cpp file)

class CfgSounds
{
    class NCA_testSound_sound
    {
        sound[] = {"\NCA\NCA_core\data\sounds\testSound.ogg", 80, 1};
        titles[] = {0,""};
    };
    class NCA_windowsShutdown_sound
    {
        sound[] = {"\NCA\NCA_core\data\sounds\windowsShutdown.ogg", 300, 1};
        titles[] = {0,""};
    };
    class NCA_bonk_sound
    {
        sound[] = {"\NCA\NCA_core\data\sounds\bonk.ogg", 300, 1};
        titles[] = {0,""};
    };
    class NCA_gruntBirthday_sound
    {
        sound[] = {"\NCA\NCA_core\data\sounds\gruntBirthday.ogg", 300, 1};
        titles[] = {0,""};
    };
};
open fractal
proper niche
open fractal
#

have you tried increasing maxDistance from the default 100 for say3D

proper niche
#
[_soundSource, ["NCA_windowsShutdown_sound", 300, 1, 1]] remoteExec ["say3D"];

I have tried this format, you could hear it on yourself when you died but other players couldnt hear it. there is also no noticeable change in volume

#

idk if thats what you mean by the maxDistance for Say3D

open fractal
#

if you increase maxDistance the sound will be louder over distance

open fractal
proper niche
open fractal
#

oh i see what you did now

#

your code is very repetitive

proper niche
#

i know. I dont have it in me to rewrite it lol

#

i guess i could change it to this

params ["_this"];

_windowsShutdownUID = ["76561198053168002", "76561198013224521", "76561198202731368"];
_bonkUID = ["76561198031166588"];
_gruntBirthdayUID = ["76561198198724038"];

_allUID = _windowsShutdownUID + _bonkUID + _gruntBirthdayUID;

if ((getPlayerUID _this) in _allUID) then 
{
    _this addEventHandler ["Killed",
    {
        _this spawn
        {
            params ["_unit"];

            _soundSource = "NCA_emptyObject" createVehicle [0,0,0];
            _soundSource setPosASL getPosASL _unit;
            if ((getPlayerUID _this) in _bonkUID) then
            {
                [_soundSource, "NCA_bonk_sound"] remoteExec ["say3D"];
            };
            if ((getPlayerUID _this) in _windowsShutdownUID) then
            {
                [_soundSource, "NCA_windowsShutdown_sound"] remoteExec ["say3D"];
            };
            if ((getPlayerUID _this) in _gruntBirthdayUID) then
            {
                [_soundSource, "NCA_gruntBirthday_sound"] remoteExec ["say3D"];
            };
            sleep 10;
            deleteVehicle _soundSource;
        }];
    };
};
modern magnet
#

hey guys, im trying out a new (to me at least) control type. specifically (CT_LISTNBOX_CHECKABLE) the wiki entry (https://community.bistudio.com/wiki/CT_LISTNBOX_CHECKABLE) is rather lacking and I couldn't find any examples of it's use online. my current dialog file is

class permsEditor
{
    idd = 122500;
    class controls
    {
        class bg: RscText
        {
            idc = 122501;
            x = 0.417481 * safezoneW + safezoneX;
            y = 0.357 * safezoneH + safezoneY;
            w = 0.139251 * safezoneW;
            h = 0.286 * safezoneH;
            colorBackground[] = {0.1,0.1,0.1,1};
        };
        class permsListCheck
        {
            idc = 122502;
            type = 104;
            colorBackground[] = {1,0,0,1};
            x = 0.422638 * safezoneW + safezoneX;
            y = 0.368 * safezoneH + safezoneY;
            w = 0.0979913 * safezoneW;
            h = 0.231 * safezoneH;
        };
        class saveButton: RscButton
        {
            idc = 122503;
            text = "Save"; //--- ToDo: Localize;
            x = 0.422638 * safezoneW + safezoneX;
            y = 0.61 * safezoneH + safezoneY;
            w = 0.128936 * safezoneW;
            h = 0.022 * safezoneH;
        };
    };
};```
which loads the background and save button but, from what i can see, does nothing in response to the "permsListCheck". Anybody have any experience in its use or know what i've setup wrong with it that might fix it doing "nothing"?
open fractal
#
params ["_this"];

private _windowsShutdownUID = ["76561198053168002", "76561198013224521", "76561198202731368"];
private _bonkUID = ["76561198031166588"];
private _gruntBirthdayUID = ["76561198198724038"];

private _playerUID = getPlayerUID _this;

NCA_playerDeathSounds = [];

if (_playerUID in _windowsShutdownUID) then {
    NCA_playerDeathSounds pushBack "NCA_windowsShutdown_sound";
};
if (_playerUID in _bonkUID) then {
    NCA_playerDeathSounds pushBack "NCA_bonk_sound";
};
if (_playerUID in _gruntBirthdayUID) then {
    NCA_playerDeathSounds pushBack "NCA_gruntBirthday_sound"
};

_this addEventHandler ["Killed",
{
    {
        _this spawn {
            params ["_unit"];
            private _sound = _x;
            private _soundSource = "NCA_emptyObject" createVehicle [0,0,0];
            _soundSource setPosASL getPosASL _unit;
            [_soundSource, _sound] remoteExec ["say3D"];
            sleep 10;
            deleteVehicle _soundSource;
        };
    } forEach NCA_playerDeathSounds;
}];
``` @proper niche
#

i bet this can be cleaned up even more

orchid stone
#

would anyone be able to give me their personal review of a function I wrote as part of a mod. basically trying to determine if any players are near any group members.

params["_grp"];

(count(allPlayers select {
    private _playeri = _x;
    count((units _grp) select {(_x distance2D _playeri) < (dynamicSimulationDistance "Group")}) > 0;
})) > 0
#

oops hit send to soon. oh well. it's functional. just wondering what i can improve on

open fractal
#

```sqf for highlighting

orchid stone
#

oops

#

nice, ty!

orchid stone
#

ooo

#

ya that would clean it up

proper niche
fair drum
#

with large arrays, use findIf @orchid stone

orchid stone
#

cool, thats 2 things i can do today. appreciate the feedback gents

open fractal
#

edited my code block from earlier btw missed a ;

proper niche
orchid stone
#
allPlayers findIf ({
    private _playeri = _x;
    (units _grp) findIf {(_x distance2D _playeri) < (dynamicSimulationDistance "Group")} > -1
}) > -1
#

appears to work pretty well. thanks again

open fractal
#

yeah that's definitely better

finite bone
#

How do I enable call zen_dialog_fnc_create to only be displayed to curator and not all players in the server?

#

Currently, both call zen_dialog_fnc_create and call zen_common_fnc_showMessage displays for all players in the server instead of virtual zeus/curator

open fractal
#

remoteExecCall [_function,_zeus]

spare vector
#

wondering if i can get someone to look at my supply drop script and tell me why when in multiplayer and i call it in only i can see the items in the crate

#

i dont know how i can post the file... the upload option is not available for me

tough parrot
#

How do you stop a uav from taking off again after it lands ("LandedStopped"). I can't disableAI bc there is no apparent way to get a handle to the ai controlling it.

limpid charm
#

i have kinda weird question. lets say i have an infinite loop spawned on server. Is it possible to get script handle of this spawned code from scheduler somehow?

spare vector
little raptor
quaint oyster
#

Would someone be able to help me with creating a rope through ropeCreate?

I was trying a few different methods to create a rope that seemingly is held by the player, i did this by making it hooked to an invisible object and attatchto the hands of the player, this worked for me ages ago, but i since lost my snippet and haven't even been able to get a rope to appear in game since I recently tried.

tough parrot
quaint oyster
#

how might i find out what qualifies?

tough parrot
quaint oyster
#

Darn, no "Balloon_01_air_NoPop_F", I'm trying to use the "Balloon_01_air_NoPop_F" to act as a fishing lure, it floats on its own on top of the water and doesn't explode when it gets shot, but I'm ignorant of how ropes work to make it look more realistic lol.

tough parrot
quaint oyster
#

yep thats the end goal

#

i have it scripted right now with setvelocity and some weird ducttaped together math making it fly towards the player, in place of shortening an actual rope

#

it "works" but its ugly and janky, rope mechanics would be the GOAT way but custom vehicle configs and such are above my head

tough parrot
quaint oyster
#

I have... pbo manager, do you mean something like that? for packing a pbo?

tough parrot
#

whatever turns your class file into pbo

quaint oyster
#

I believe I have that portion covered then

#

as for the rest of it I'm absolutely going into it dark as I don't mess with mods of my own too much, "standalone" ones that is

#

Hold on I spotted something in the vehicle list earlier let me try it in game

#

"SoundSetSource_01_base_F"

#

maybe it can work by attaching it to things and making it the intermediate

#

crashes me game using that "SoundSetSource_01_base_F"

#

okay work around idea failed

halcyon arrow
#

is there a way to create a grass cutter using getMarkerSize

warm hedge
#

getMarkserSize is not even related to it...

halcyon arrow
#

oh lmao

#

is there a way to create what I want though

#

I found a script online for a grass cutter but it's not that accurate

warm hedge
#

What exactly is your goal?

halcyon arrow
#

I'm trying to create a grass cutter using a marker

#
{
    if(
        markerShape _x == "RECTANGLE" &&
        toLower _x find "grasscutter" == 0
    ) then {
        if(isServer) then {
            _sin = sin markerDir _x;
            _cos = cos markerDir _x;
            markerSize _x params ["_mw", "_mh"];
            markerPos _x params ["_mx", "_my"];
            for "_i" from -_mw to _mw step 7 do {
                for "_j" from -_mh to _mh step 7 do {
                    createVehicle ["Land_ClutterCutter_large_F", [_mx + _cos * _i + _sin * _j, _my + -_sin * _i + _cos * _j, 0], [], 0, "CAN_COLLIDE"];
                };
            };
        };
        deleteMarkerLocal _x;
    };
} forEach allMapMarkers;```
warm hedge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
halcyon arrow
#

that's what I have right now, but it's not that accurate

warm hedge
#

What do you mean by accurate/inaccurate?

halcyon arrow
warm hedge
#

And?

halcyon arrow
#

I have to keep loading replacing it, and loading.. repeat... because it's not accurate

warm hedge
#

As I said what do you mean by accurate?

halcyon arrow
#

when I set the marker down it has to have an offset like the image shows

warm hedge
#

Explain what the image means

halcyon arrow
#

the green markers are the grass cutter and the orange markers are buildings

warm hedge
#

And?

halcyon arrow
#

what I'm trying to achieve is that I can place the green marker exactly where the building is for the grass cutter

#

rather then it having an offset on the building because it's not accurate

warm hedge
#

Then it is not what the script's fault. Those house markers aren't supposed to be accurate

halcyon arrow
#

oh, is there a way I can execute the script on the building then

#

rather then using a marker

warm hedge
#

No script can do it as well, or if there is it would be a great messy overcomplex thing

halcyon arrow
#

like an sqf script

warm hedge
#

The idea is this. You mark the house with an object, and you see how big it is in the map

halcyon arrow
#

oh lol

#

so there's no way I can excute the sqf i sent on the building rather then a marker?

warm hedge
#

Because it is how the script works

halcyon arrow
#

is there a way to hide grass using a hide terrain objects

warm hedge
#

I mean if you can see how big it is in the map, you can cover it with a marker accurately

#

Hide Terrain Objects is not related to grasses

warm hedge
#

Did what, how?

warm hedge
#

What it looks in the Editor's map?

halcyon arrow
warm hedge
#

Well, if the thing is that small, why not just try to place Grass Cutters manually not with a script?

halcyon arrow
#

if i got it worker with a smaller object accurately it would do the same with my larger ones

real epoch
#

Can it be that the maximum distance for "EmptyVehicle" setDynamicSimulationDistance is 1000m? I have set a larger value and checked with dynamicSimulationDistance "EmptyVehicle". It shows me that a larger value is set, but with simulationEnabled cursorObject it always returns false as long as I am over 1000m away.

lyric portal
#

Hello. I used the vr entity and made it so itโ€™s like a UAV. I made it keep track of a unit. However, the live feed just keeps shaking around. How do I fix this?

Edit: Solved

tough abyss
#

Good Day All,

Question on IF - THEN - ELSE statement...

private _hostageLocation = selectRandom ["airportTerminal","ghostMotel","officeComplex","usEmbassy"];
private _hostagePos = getMarkerPos _hostageLocation;
hint str _hostageLocation;

if (_hostageLocation = str "ghostMotel") then {hint "then statement"} else 
{hint "else statement"};

My issue is getting the condition to return true when the "ghostMotel" marker is selected. I need the position or the marker to return true.
I've tried several different ways in the condition statement. None of which work.

hallow mortar
#

if (_hostageLocation == "ghostMotel")

warm hedge
#

= is to define, == to compare

tough abyss
#

Thank you very much! Moving on...

willow plume
#

An alternative (and more universal solution) would be something like this:

/* Put in init.sqf */

_hostageLocations = createHashMapFromArray [
    ["airportTerminal", "Hostage Location at Airport Terminal"],
    ["ghostMotel", "Hostage Location at Ghost Motel"],
    ["officeComplex", "Hostage Location at Office Complex"],
    ["usEmbassy", "Hostage Location at US Embassy"]
];

missionNamespace setVariable ["Hostage_Locations", _hostageLocations];

getlocation = {
    param ["_hostagelocation"];

    if !(_hostageLocation in (missionNamespace getVariable ["Hostage_Locations", createHashMap])) exitWith {hint "Invalid hostage location"};

    hint ((missionNamespace getVariable ["Hostage_Locations", createHashMap]) get _hostageLocation);
};

/* Put in area where code is being executed (such as a button, action menu or dialog etc etc) */

"ghostModel" call getLocation; // parses to hint "Hostage Location at Ghost Motel"

Allows for differently generated hint messages based on the individual location(s)

limpid charm
# little raptor Unless you spawned this yourself and saved the handle when you did so, no

yeah, this is related to the question i asked before about removeCuratorEditableObjects in Zeus gamemode. I figured out that if you set moderator permission to anything except spectating only then bis_fnc_mirrorCuratorSettings will be spawned which synchronizes editable objects for zeus and moderator (2 curators in this gamemode) in the loop and removeCuratorEditableObjects stops working for moderator. I can see that running function with diag_activeSQFScripts. Maybe there is a hacky way to get script handle?

hybrid pier
#

Hello, I have the following problem, unfortunately I can't switch the server to custom settings. Changed the Server.cfg and the Arma 3 profile. Just can't change the third person view in the game. can someone please help me?

little raptor
little raptor
#

it has nothing to do with this channel anyway

hybrid pier
#

๐Ÿ˜ฆ

limpid charm
spare vector
#

anyone around that might be able to help me with some basic addAction stuff ?

willow plume
#

What's up?

spare vector
#

Trying to add an addAction to one player that is only usable by him and when in multiplayer other players are able to walk up to him and use the action

#

but i want it to only be usable by one player its on

willow plume
#

Lets see your code

spare vector
#

c1 addAction ["Request Supplies", "supplydrop.sqf"]

willow plume
#

And where is it being executed?

spare vector
#

i added that to the init of the player slot

#

<---noob

#

lol

willow plume
#

c1 addAction ["Request Supplies", "supplydrop.sqf", nil, 1.5, false, true, "_target isEqualTo _this"]

#

Or alternatively

#

inside the init.sqf do

#
if (player isEqualTo c1) then { player addAction ["Request Supplies", "supplydrop.sqf"]; };```
spare vector
#

which one would be better

willow plume
#

the latter option is probably better

spare vector
#

kk thanks i will try that... really appreciate it

willow plume
#

no worries

spare vector
#

putting it in the init file will stil stop others from using it

willow plume
#

Remove it from the init of the unit and just put it in the init.sqf

spare vector
#

wont require a target like the other

willow plume
#

Nope

#

Just call the unit you want to add the action to c1

#

as you have already done

spare vector
#

cool thanks

willow plume
#

so you can understand where went wrong, basically any code inside the init of the units placed on the map is evaluated on all clients, so the action for c1 was being added to everyone

spare vector
#

ah ok that makes sense

#

but by calling it in the mission init it only assigns to the unit named

#

got it

noble zealot
#

If server host an AI group with 5 units, it's possible for one player to take control on an AI unit of this group and other player take control of another AI unit from this group, at the same time, with remoteControl?

rancid nacelle
#

I'm setting up an encounter where an explosive goes off, and then enemy infantry ambush a vehicle, but they aren't attacking it. It's an APC, do only AT infantry fire at it? Is there any way I can make all the infantry in a squad to fire at this APC?

tough abyss
#

Does anyone know how to add fadein/fadeout to a dialog
i have my dialog and each control inside has fade= 1
if i do this below

    onUnload = "[(_this select 0), 1] call Apoth_fnc_fadeDialog;"```

it gets called immediately and the fade gets set back to 0 without any animation that should be happening from ctrlCommit
```params ["_dialog", ["_fadeValue", 0], ["_delay", 5]];

{
    _x ctrlSetFade _fadeValue;
    _x ctrlCommit _delay;
} forEach allControls _dialog;```
fleet sand
#

Hi guys quick question how can i disable respawn button in esc menu ? When i do respawnButton = 0 in description.ext it disables the button but when person dies and its in select respawn screen i am unable to press the button to respawn.

drifting sky
#

Arma 3: How do you add launcher ammo to units? How come addmagazine doesn't work as it does in arma 2?

tranquil jasper
#

arma 3 has an entirely new inventory system so that's probably 1 thing

drifting sky
#

Google isn't returning any results on adding launcher ammo. Only other threads asking the same thing with no answer.

tranquil jasper
#

do you have space for a rocket in the part you're trying to add a rocket to?

drifting sky
#

what part does addmagazine add to?

hallow mortar
#

Wherever there's space

drifting sky
#

So, even with an empty inventory, it still doesn't add any rocket ammo

hallow mortar
#

rockets are big so you'll probably need to make sure the unit has a backpack

drifting sky
#

can they have a backpack and a launcher?

hallow mortar
#

yes, the launcher goes in the launcher slot and the backpack goes in the backpack slot

tranquil jasper
#

Bad practice for making functions MP-safe?

//fn_exampleFunction.sqf
if (local _object) then {
    //do some code
} else {
    [_params] remoteExec ["EXAMP_fnc_exampleFunction", _object];
};

thoughts?

drifting sky
#

is there a command to add a backpack empty?

granite sky
#

@drifting sky Note that if you want to put a magazine in the launcher, that's _unit addSecondaryWeaponItem _magazine

#

There are empty and pre-filled backpack types

hallow mortar
drifting sky
#

with addmagazine, it seems the first mag is put in a rifle. Why not the same way with the launcher?

hallow mortar
#

Arma

#

if you add the magazine before the weapon it should be auto loaded

tranquil jasper
#

because it wasn't programmed that way

drifting sky
#

I am adding all the ammo before any of the weapons

granite sky
#

Fun fact, if you give an AI unit a CBA or RHS disposable, you still need to add a fake magazine or they won't use it.

drifting sky
#

what do you mean by "fake" magazine

granite sky
#

Those launchers have fake zero-weight magazines, like "CBA_fakeLauncherMagazine".

#

Players don't need magazines to use them, because they're auto-generated when you press reload.

drifting sky
#

Ok, so this still doesn't make sense. If I add a backpack, then the first round is placed in the launcher, and the second in the backpack. But if I have NO backpack, how come the first round isn't placed in the launcher?

granite sky
#

because it can't add the round in the first place, I expect?

#

This is why addSecondaryWeaponItem is useful.

drifting sky
#

Except then I have to define regular ammo separately from launcher ammo. Meaning I have to redefine all my custom loadouts.

granite sky
#

well, you could technically config-check your loadout mags against the weapon for compatibility...

#

but you're probably better off splitting the data.

hallow mortar
#

Unfortunately, even if it's inconvenient, the fact is that either you use a backpack to have enough space to add the magazine, or you use addSecondaryWeaponItem to put it directly in the launcher. That's just...how it works.

granite sky
#

I suppose since setMaxLoad you could add the backpack, increase the capacity, add all the gear and then restore the max load...

#

server-only though.

drifting sky
#

hmm... ai still seem to fire rockets even when I see no rocket in their inventory.

tranquil jasper
#

they probably get the privilege of starting the mission with a rocket loaded

drifting sky
#

how come their launcher is empty when I take it off them? If they haven't fired.

fair drum
#

its like

[_params] remoteExec ["EXAMP_fnc_exampleFunction", 2]

if you run that on the server, it doesn't actually use network usage I believe

tranquil jasper
#

So as long as you know what you're doing and you're careful, is there any benefit to using commands regularly vs remoteExec everything? Or is the reduction in possible mistakes valuable enough?

#

I'm trying to make something I made recently work in MP and so far it's just been me converting regular command calls into remoteExec + figuring out and staying aware of the locality context, and locking out code from running in the wrong locality

fair drum
#

its all context on what you want to do with it. in your above application, it would be useful for say, if you had something running on the server but the object is going to be changing locality regularly, so it will always pick the correct client

#

if you ever have an inkling of thought that you want something MP, best to begin writing it for MP first.

tranquil jasper
#

Yeah changing locality is an issue; It's a revive system. I read somewhere that when group leader switches to an AI unit, the group locality gets changed to server; which happens whenever a player "dies" (setUnconscious true)

#

also when the player gets revived and takes control of the group again

fair drum
#

is this ACE's or something else?

tranquil jasper
#

No, this is custom that I released to the community to use in their missions. I've been playing some user-created scenarios lately and something that bothers me is lack of, or a bad, revive system. It's not that realistic but eh, arma's a game, the most realistic game in existance, but still a game. So I made something for all to use and now just trying to make sure it works in MP

#

I like to post interesting stuff in the scripting forum and give away my scripts so a revive system totally fit my vibe, and I might actually be good enough now to make it + working in MP

acoustic abyss
#

Had an issue of my own, however...

#

I'd like to give the player the ability to look at briefing images in full screen.

The Leaflet functions seem a great candidate vs coding a buggy GUI of my own.
I can get them to work during play, but not in the briefing screen.

In normal play, I can use the BI examples as follows

["init",[myLeaflet,"#(argb,8,8,3)color(1,1,0,1)","Yellow pages"]] call bis_fnc_initLeaflet;
// initializes the leaflet texture and holdaction on a mission object called myLeaflet

[myLeaflet,true] call bis_fnc_initInspectable;
// Makes the player inspect the flyer directly (no holdaction needed)

Again, these work normally during play. But in Briefing, the second line generates this error:

params [
["_mode","",[""]],
["_this",[],>
Error position: <params [
["_mode","",[""]],
["_this",[],>
Error Params: Type Bool, expected Array
File A3\functions_f_orange\Misc\fn_initLeaflet.sqf, line 28 

Which makes sense when you look at bis_fnc_initLeaflet in the config viewer. But I'm getting stuck here.

  • I don't understand how these two functions properly together (because they do in normal circumstances).
  • I don't understand how bis_fnc_initLeaflet, the displayer of textures, works by itself. I don't see any GUI controls in the function itself.

Anyone have experience with this?

copper raven
ruby bronze
#

Is there a code that works as the opposite of onMapSingleClick {_shift};?
That code disables the personal Shift-Click map waypoint. But what I want to do is have a code that can re-enable it on an individual if possible

copper raven
#

it doesn't work for dialogs

#

you should just ctrlSetFade 1, commit 0 on load, and then fade it in like you normally would

copper raven
#

or just onMapSingleClick {}

#
addMissionEventHandler ["MapSingleClick", {
  params ["", "", "", "_shift"];
  _shift && {
    damage player <= 0.5 // random condition, put your stuff here
  }
}];
ruby bronze
#

Oh really? I'll give that a try. Thank you

#

Oh heck yeah, thanks

copper raven
# ruby bronze Oh heck yeah, thanks

actually nvm the stackable

Does not have engine default functionality override like the original EH
but the rest what i wrote still applies

ruby bronze
#

Roger that, will ignore the stackable

drifting sky
tough parrot
#
(driver uav) disableAI "all";

this command does not work on uav notlikemeowcry

fair drum
#

i just cannot seem to visualize the splitstring and joinstring to achieve this formatting for easy paste...

_array = ["class1", "class2", "class3"]; //etc

// Wanted formatting below
'["class1",
"class2",
"class3"]'

I have so far:

_str = str _array splitString '"[],';
"[" + (_str joinString ("," + endl)) + "]";

//Gives me
'[class1,
class2,
class3]'

I also have...

_str = str _array splitString "[],";
"[" + (_str joinString ("," + endl)) + "]";

//Gives me
'[""class1"",
""class2"",
""class3""]'
tough parrot
#

probably there is no indent outside structured text

fair drum
#

the main problem I'm having right now is getting each item to keep its ""

fair drum
#

it either loses them, or doubles them

open fractal
#

have you looked at this

#

you can write your own function to check if the arty is "busy"

drifting sky
#

using what test?

open fractal
#

setVariable and getVariable?

#
_arty setVariable ["FSI_artyBusy",true];
//BIS arty function here
drifting sky
#

also, the description of the return value for bis_fnc_wpartillery doesn't make sense. "Boolean - true when done".

#

does that mean if you call the function and it returns false that the group is currently firing the artillery?

tough parrot
open fractal
#

that I don't know, but you can add a "fired" eventhandler to count how many rounds it fires and set artyBusy to false when rounds are complete

fair drum
#

the extra "" marks come from stringing things at different points for the split and join

orchid stone
#

trying to render a line between 2 positions to make a debug view for pathing that i can see in spectator view. is there a command available that will do this?

fair drum
#

fixed it. you just need to add a copy to clipboard and it removes them...

_str = str _array splitString "[],";
_str = "[" + (_str joinString ("," + endl)) + "]";

copyToClipboard _str;

//When you paste gives:
["class1",
"class2",
"class3"]
lyric portal
#

Howdy. I'm trying to put a custom siren with the addAction

if (!hasInterface) exitWith {};
 
_this setVariable ["siren",false];
_this addAction ["Turn On Siren",{(_this select 0) setVariable ["siren",true,true]},nil,0,false,false,"","!(_target getVariable 'siren') && _this == driver _target"];
_this addAction ["Turn Off Siren",{(_this select 0) setVariable ["siren",false,true]},nil,0,false,false,"","(_target getVariable 'siren') && _this == driver _target"];
 
while {true} do {
    if (_this getVariable "siren") then {
        _this say3d "Siren";
        sleep 2;
    } else {
        sleep 1;
    };
};

My sound file is in ogg named "Siren" located in my mission folder. This is the description ext.

class CfgSounds
{
    class Siren
    {
        name = "Siren";
        sound[] = {"Siren.ogg", 5.0, 1};
        titles[] = {1, ""};
    };
};

I don't hear the sound when I get in game and do addAct tho.

#

What I put on the init of the vehicle

nul=this execVM "siren.sqf";
#

Solved. I went on to reconvert it to ogg.

#

Oh hey, is there a way I can fix this

weee woo theres a pause here that sounds too long before it goes wee woo again

warm hedge
#

Adjust sleep time?

lyric portal
tough parrot
#

Is there a way to freeze a vehicle from moving (bc driver will not stop) without stopping unitPlay?

crude vigil
open fractal
crude vigil
open fractal
#

I might be thinking of doArtilleryFire

crude vigil
#

all wpArtillery does is basically use doArtilleryFire , it is a function to adapt to waypoint system to check its accomplishment to move on to next waypoint.

#

well it also probably checks if it is able to shoot on top of it of course..

#

and of course has to make entire group shoot instead of only one.

#

but u get the idea.

open fractal
#

Iโ€™ll have to check but I vaguely recall making a mortar unit its own group and just using that function as the first thing I found and never bothering to go back and โ€œfixโ€ it

drifting sky
#

I need a way of doing the following: check if an artillery battery is busy. I have a list of batteries and want to chose the first one that is ready to fire.

lyric portal
#

Good day. I need some help on how to run remote exec on a few stuff

UAV live feed

this addAction ["UAV Norm", {[ISRA attachTo [Vettel, [-10, 20, 550]]];[ISRA setVectorDirAndUp [[0,0,-1], [0,1,0]]];['ISR', ((units ISR) select 0)] execVM  
'createSatelliteCameraDay.sqf';}];
this addAction ["UAV Thermals", {[ISRA attachTo [Vettel, [-10, 20, 550]]];[ISRA setVectorDirAndUp [[0,0,-1], [0,1,0]]];['ISR', ((units ISR) select 0)] execVM  
'createSatelliteCameraNight.sqf';}];

Vehicle siren

nul=this execVM "siren.sqf";

Helmet camera live feed

this addAction ["Body Camera Stream (Day)", { 
    ['soldiercam1', ((units Echo_1) select 0)] execVM 
'createHelmetCamera.sqf'; 
 
}];

CCTV's live feed

this addAction ["Start Cameras", {execVm 'initPlayerLocal.sqf'}]

So far I don't get the things I've been seeing on the web since the things I'm doing are not working so I must be doing something wrong.

tranquil jasper
#

in github

proper sail
#

Do objects still respond to eachother physics wise if enablesimulation is false?

winter rose
proper sail
#

if i attach an object to a car but it collides with the wheel

#

will disabled simulation prevent it from taking off to the moon?

#

that is my context

winter rose
#

try and thou shalt see

proper sail
#

oki

nimble pagoda
#

hi would this Unit(s) addEventHandler ["Fired", { params ["Unit(s)", "Smoke Grenade - White"]; }]; work in removing white smoke grenades from bots?

#

i want to remove/blacklist white smoke grenades from bots so they cant use them, i am new to scripting because i cant find a mod or option to remove them

nimble pagoda
#

if there is an alternate way please help

winter rose
#

yes but is it a MP mission, do they respawn, etc

nimble pagoda
#

yea it altistasi run in mp

winter rose
#

how do you have access to the console then?

nimble pagoda
#

i am the host from my machine

winter rose
#
{
    _x removeMagazines "SmokeShell";
} forEach (allUnits select { not isPlayer _x ));
#

if they get deleted/respawned, you will have to run it again

nimble pagoda
#

where or how whould i use this? in server exec?

winter rose
#

yes

nimble pagoda
#

thank you will try this when i run the scenario again, i am having an issue with enemy ai constantly using white smoke grenades that block the whole area but for some reason they can shoot trough it and handle it like its not there so i want to remove it completely

tough abyss
#

What is the difference between Hit and indirecthit

winter rose
tough abyss
#

indirecthit what is

winter rose
#

e.g grenade blast

crude vigil
drowsy geyser
#

hey, is it possible to create directional #lightpoint via script? I mean where the light shines in one direction?

winter rose
#

using #lightreflector, as said on that page ๐Ÿ™‚

#

ninja'd @crude vigil

drowsy geyser
#

amazing

drowsy geyser
#

but i just noticed if you create light via #lightreflector then you cant set its brightness with "setLightBrightness" you have to set it with "setLightColor" or "setLightAmbient", "setLightBrightness" has no effect

drowsy geyser
#

haha sry my bad xD

keen orchid
#

yo guys

#

this addAction ["Disable Camera", {deleteVehicle this}]; this says 'this' (in the deletevehicle code) is invalid

#

i know it's got something to do with it being in an addaction but i'm not sure how to properly do it without having to go through and give each object a variable name to delete

#

any help would be appreciated

crude vigil
# keen orchid ```this addAction ["Disable Camera", {deleteVehicle this}];``` this says 'this' ...

Think of it like that {deleteVehicle this} is being executed not in that particular place you wrote but in another place as it is being activated upon "action is activated", thus, "this" is not defined in there...
What you should do is, for convenience, there are bunch of parameters being provided to you in there...
Check:
https://community.bistudio.com/wiki/addAction
Notice that you are modifying 2nd parameter of the addAction inside the array which stands for "script".
The line I am referring to is the line that contains params [...] and below that, description for what they stand for. So what you need to do is, copy that params line on your code, then use the one you need instead of "this".
Which one you have to use as well as how you gotta write it is your homework. praise_the_sun

acoustic abyss
# copper raven cannot reproduce ๐Ÿค”

Thanks for the reply. So the error comes when I try to execute the expression in the briefing, eg:

player createDiaryRecord ["Diary", ["Situation"," 
<execute expression='[myLeaflet, true] call BIS_fnc_initLeaflet;'> testimage </execute>

Note that the expression works fine if it is executed in the debug console.

willow plume
#

is that your entire code, or you missing something?

ebon citrus
ebon citrus
#

2 of them, infact

#

If that's your code

#

If it's an error, then show the full error

#

And the code

acoustic abyss
#

@willow plume Full description is in previous message see link above.

crude vigil
#

Or did u post it as "example" provided by BIKI?

acoustic abyss
#

Oi vey, I should really just format it into a single message.
I'm trying to make a clickable link in the briefing screen (or Diary Record) that displays an image fullscreen. The leaflet functions allow you to look at images this way, but only during normal play. I'm trying to get them to work in the diary/briefing screen.

crude vigil
#

I also got no knowledge about diaries and stuff but looking at the example, you are completely missing an inner array for createDiaryRecord.

#

It has an inner array and array starts with "Execute" as 1st param

acoustic abyss
#

I will try that. Interestingly, the current method will execute other expressions without issue.

crude vigil
#

Could be, I got no knowledge regarding as I said, but it is not in same form as provided in examples. Plus you havent pasted the final version so we are forced to estimate stuff due you called it "fixed brackets". There is also a missing " there for example, did u fix it too or no? thonk So yep, edit your fixes and let us see them too(either post again or preferably, edit your message containing code along with an "updated original post" message) so we can assist in an easier way.

acoustic abyss
#

I ... did post a final version?

#

Let me try your suggestion though

crude vigil
acoustic abyss
#

That's an interesting semantic point. Is a correct version a final version? Well, when I write that it has been corrected, typically I mean that, according to the timestamp, it has been corrected to the current version.

#

No but thanks

#

I don't want to sound defensive.

crude vigil
#

Whatever you got in your hand right now, reveal it! In short ๐Ÿ˜

#

If that is what you got right now, there are 2 missing square brackets and 1 " at the end.

#

And that is still not fitting according to examples provided in BIKI of link above of associated command.

acoustic abyss
#

OK! Well you were totally correct about following the BIKI example.
If you make a test mission with a player, a flyer, and these two expressions: #arma3_scripting message

And you use the modified example 7:

player createDiaryRecord ["Diary", ["Execute","<execute expression='[myLeaflet,true] call bis_fnc_initInspectable;'>Some text</execute>"], taskNull, "", false];

It vurks!

crude vigil
#

Very well, congratz, enjoy!

acoustic abyss
#

In my (weak) defense, it's interesting that can you skip most of the formatting, and have it execute other things fine eg player createDiaryRecord ["Diary", ["Execute","<execute expression='hint ""cookie monster""'>click for hint</execute>"], taskNull, "", false];

#

Appreciate the quick help ๐Ÿ™‚

willow plume
fleet sand
#

Hi guys question. How i can make it so every player has its own arsenal with its own whitelisted items. So i am using ace and ace arsenal and i have arrays of equipment for every player just i dont know how to make it so when that specific player with variable name interacted with arsenal to open his specific whitelisted stuff any help would be awsome

open fractal
#

and then you can use findIf to determine which one can fire

#

As Talya said doArtilleryFire is the simplest way to make them fire

#

you donโ€™t need to find a function that does it for you just make one

lyric portal
#

Good day. I need some help on how to run remote exec on a few stuff

UAV live feed

this addAction ["UAV Norm", {[ISRA attachTo [Vettel, [-10, 20, 550]]];[ISRA setVectorDirAndUp [[0,0,-1], [0,1,0]]];['ISR', ((units ISR) select 0)] execVM  
'createSatelliteCameraDay.sqf';}];
this addAction ["UAV Thermals", {[ISRA attachTo [Vettel, [-10, 20, 550]]];[ISRA setVectorDirAndUp [[0,0,-1], [0,1,0]]];['ISR', ((units ISR) select 0)] execVM  
'createSatelliteCameraNight.sqf';}];

Vehicle siren

nul=this execVM "siren.sqf";

Helmet camera live feed

this addAction ["Body Camera Stream (Day)", { 
    ['soldiercam1', ((units Echo_1) select 0)] execVM 
'createHelmetCamera.sqf'; 
 
}];

CCTV's live feed

this addAction ["Start Cameras", {execVm 'initPlayerLocal.sqf'}]

So far I don't get the things I've been seeing on the web since the things I'm doing are not working so I must be doing something wrong.

Yeah I still donโ€™t quite get remote exec. Been looking at the web

fair drum
# fleet sand Hi guys question. How i can make it so every player has its own arsenal with its...

You can do something like this in your initPlayerLocal.sqf (make sure your arrays are defined first before this runs):

// local init with no items
[box_1, false, false] call ace_arsenal_fnc_initBox;

// add items locally
switch player do {
    case p1: {
        [box_1, p1_whitelist, false] call ACE_arsenal_fnc_addVirtualItems;
    };

    case p2: {
        [box_1, p2_whitelist, false] call ACE_arsenal_fnc_addVirtualItems;
    };

    default {};
};
fair drum
wary sandal
fleet sand
# fair drum You can do something like this in your initPlayerLocal.sqf (make sure your array...

Ty veryMutch i used something like that and created this and it works:

//Array of Equipment for each player:

Legions_arsenal = ["Rangefinder","MiniGrenade","srifle_GM6_ghex_F"];
Players1_arsenal = ["arifle_AK12_F","G_Balaclava_TI_G_tna_F","NVGoggles_OPFOR","ClaymoreDirectionalMine_Remote_Mag","launch_MRAWS_green_rail_F"];

//this creates ace action Open Arsenal.
private _boxAction = ["Open Arsenal","Open Arsenal","",{
params["_target","_player","_actionParams"];
switch (_player) do {
    //"Zeus" varaiable name of a unit in eden editor.
    case Zeus:{
        hintSilent "Arsenal is opend by Zeus";
        [box, Legions_arsenal, false] call ACE_arsenal_fnc_addVirtualItems;
        [box, player,false] call ace_arsenal_fnc_openBox
    };
    //"Player_1" varaiable name of a unit in eden editor.
    case Player_1:{
        hintSilent "Arsenal is opend by Player 1";
        [box, Players1_arsenal, false] call ACE_arsenal_fnc_addVirtualItems;
        [box, player,false] call ace_arsenal_fnc_openBox
    };
    default {};
};

},{true},{},[], [0,0,0], 50] call ace_interact_menu_fnc_createAction;
//Put down a box with variable name "box"
[box, 0, [], _boxAction] call ace_interact_menu_fnc_addActionToObject;
winter rose
#

@wary sandal 5 minutes up'ing, noice ๐Ÿ‘€

wary sandal
winter rose
#

gr

willow plume
wary sandal
#

through the Eden editor

rancid egret
#

I'm like a newborn baby in scripting, so can someone help me with a mod pls?

winter rose
rancid egret
#

That's what I ment xD

#

It's a mod but I want to write a script for it

willow plume
winter rose
willow plume
#

Oh wait

wary sandal
#

it's RHS

willow plume
#

Okay

rancid egret
# winter rose OK, so what is it?

It's a Warhammer 40k mod, there are drop pods. I can initiate launch when I'm in one but AI buddys can't. I want to make a command or maybe even that I can call in radio support

willow plume
willow plume
wary sandal
#

alright

fair drum
#

he probably can give you the function outright without us having to download the whole thing and look through his code

rancid egret
#

I'll take a look, thank you <3

wary sandal
#

@willow plume how's the testing going?

willow plume
#

Haven't been able to check yet, been a tad busy

#

I would look into animationNames, animationSource if you haven't already

#

That was going to be my first port of call

drifting portal
#

I have a little confusion over JIP in remoteexec, so when I do [array,{ comment "code"; }] remoteExec ["spawn", 0, cursorobject];

#

the nedId of the object is returned as a string

#

so when I disconnect from the server an reconnect

#

the spawn command that was supposed to be execute when somebody joins is not executed on me

#

why is that?

drifting portal
drifting portal
#

is this how JIP supposed to work?

fair drum
#

what? post your actual code

granite sky
#

It'll be running something, as long as cursorObject still exists.

#

Usually the issue with JIP is that it runs stuff very early.

drifting portal
fair drum
granite sky
#

maybe test with shorter code first?

drifting portal
#

@fair drum

#

fixed it

#

there was a typo

#

I edited the link

fair drum
#

k, in a WT match sec

drifting portal
fair drum
#

wait

#

as long as helipadobject exists, it will remote exec on new clients that join

#

your error must be somewhere else

#

but even still, why are you remote executing a spawn anyways? that's a HUGE spawn to send over the network like that

#

make a function, and then remoteexec that function

drifting portal
#

thats what I have done

#

in my original code

#

but in here I just changed it a bit

#

for the example's sake

#

the code is 700 lines so I had to shorten it and make it make sense for you

fair drum
#

split it up for readability

drifting portal
#

I used that same exact code in sqfbin

#

the cursorobject was a vehicle

#

netid was returned back and I got the action and was able to use it

#

I reconnected to the server and I'm missing the action

#

I also noticed something

#

line 460

#

the mprespawn eventhandler

#

it actually working

#

and I get the action after I respawn (because I relayed the action code to the server using BIS_fnc_setServerVariable)

#

but when I first join and spawn it doesn't execute the action code

fair lava
#
thisList findIf { getText (configFile >> "CfgVehicles" >> typeOf _x >> "simulation") == "UAVPilot" } != -1;

i'm trying to create a trigger that activates when any UAV flies through it, this is what i'm currently trying to use but it doesnt seem to trigger

copper raven
noble zealot
#

This gives a false?simulationEnabled objNull

little raptor
#

test

#

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

#

should be true tho

noble zealot
#

๐Ÿ‘

little raptor
#

it will return whatever's the default. idk what it is for simulation

granite sky
#

(always test these)

noble zealot
#

Ok Thanks.

granite sky
#

editor debug console is your friend

tranquil jasper
#

shouldn't it? objNull is an object

#
typeName objNull
#

just as grpNull is a group, controlNull is a control, etc

noble zealot
#

It returns true ๐Ÿ˜ฎ

#

Bug solved

#

alive objNull return false

little raptor
little raptor
jolly jewel
#

Does anyone know of an elegant way of completing a waypoint when AI is within 200m or so?

#

I want them to drive the path they think is efficient but stop before they get there

#

Placing the waypoint 200m before is not the best solution, because it can change the path they take

#

Waypoint completion radius does not work

agile cargo
#

Is there a function to get the classname of the ammo of the current loaded magazine?

#

got it with

player addEventHandler ["Fired", { 
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
copyToClipboard _ammo; 
}];
brazen smelt
#

Anyone have a working script for setting up ACRE2 Channels per unit? I tried following the one on the IDI Wiki but I just get a 'Error reserved variable in expression'

fair drum
little raptor
brazen smelt
#

But it has not been updated since 2016.

#

So I don't know if there is now a better way that actually works to help accomplish what I'm seeking.

drifting portal
agile cargo
#

I'm just going through the arsenal and firing each magazine to get the bullets and their parents

little raptor
agile cargo
#

I know, but I also need to see how the tracer looks

#

I'm applying the ACE Tracers to all the ammo with tracers

#

for ammo from other mods

fair drum
fair drum
#

and how are you calling this?

brazen smelt
brazen smelt
thick venture
#

im looking for someone to help me with fixing a script. DM me plz ty

winter rose
fair drum
#

and you never know when someone will want the same answer later. best to just post it here.

ebon sparrow
#

ok i need help so im using the tiow warhammer mod and is there a way to script a drop pod landing if anyone can help i would really apreciate it

ebon sparrow
#

oh ok thanls

#

sorry to bother yall i dident know that server existed

#

lol

fair drum
#

nah its just he is a very good scripter and mod maker, but his code is very difficult to read imo so its hard to read through it and show you how to do it ourselves

ebon sparrow
#

well thanks alot

#

๐Ÿ™‚