#arma3_scripting

1 messages ยท Page 164 of 1

true frigate
#

Oh wait, I'm stupid. It's getMissionPath isn't it

#

Yeah fixed

gusty rivet
#

Anyone able to help with this as i have no idea what's going on, everything was working fine before Arma updated now it doesn't...

we have a spawner that we use to get our vehicles and supplies, using one visible marker to indicate the spawner area, and one invisible marker to set the direction the vehicle will face when spawned, but after the arma update i can no longer make any changes to the spawners, it just locked me out from pressing the "ok" button, but if i remove the code from the item init field it works again.

the code clearly works because its working as intended on the server, but we need to be able to make changes to it and i cant for the life of me figure out why its not letting me do anything, below is the code from the init field and the error given, any help would be beyond appriciated:

private _posASL = getPosASL Car_1 vectorAdd ((getPosASL Car_2 vectorDiff getPosASL Car_1) vectorMultiply 0.5); _posASL set [2,_posASL # 2 + 7.4]; { if (_x != _this) then {deleteVehicle _x}; } forEach nearestObjects [ASLToAGL _posASL,["Car", "Armored"],5]; _this setPosASL _posASL; _this setDir (Car_1 getDir Car_2);

little raptor
warm hedge
#

Especially in Eden

gusty rivet
#

thats the thing, they are both named correctly, these are direct copy and paste from the ones we have on the server which work perfectly fine, just cant edit them

#

thats what im not getting

warm hedge
#

As I said, not in Eden

little raptor
warm hedge
#

In the first place what are you trying to do

gusty rivet
#

basically i need to be able to add and remove or change things for our unit as we develop, the list function is no issue, its just the previously mentioned init field which is causing the issue since the update, therefor blocking me from making any changes.

it clearly works when the mission is running but as mentioned when it comes to needing to change something in the editor i cant do anything because it thinks its wrong, it wasnt even giving me an error before, had to use 3den enhanced just to get the error to even show

#

long story short, we need to make it so the spawner accepts the init code again, because i have no idea why its stopped working all of a sudden

warm hedge
#

And where is the reason why you need to run in Eden

gusty rivet
#

if i run the mission they spawn perfectly fine, everything works, but i make changes to them in eden, they are save in compositions so i just change them as needed

warm hedge
#

they are save in compositions so i just change them as needed
Not sure what this does mean

gusty rivet
#

we palce our spawners in on our mission files through saved compositions for our unit so everything is there and up to date

the problem is just the init field is telling me its wrong when it clearly isnt, so im not able to change anything in the spawners because of that code, i just dont know what wrong with it

warm hedge
#

And I still don't know why you're running that script in Eden

gusty rivet
#

its the only way i could get an error code to show up, before that there was nothing being displayed, the code is being ran through a module

warm hedge
#

Well

#

It is simply because you're running a code that you don't really supposed to run in the environment

gusty rivet
#

thats the thing, we have always been using that code, for well over a year, its literatlly just the game update that it started to break, i just have no idea why, without these spawners working we cant change any of our assets

little raptor
#

I'm pretty sure it never worked that way

warm hedge
#

Unless you have a Mod that assign such variable name

little raptor
#

Maybe Eden Enhanced? (tho I doubt it)

warm hedge
#

(Which I made my own for my internal use)

gusty rivet
#

it deffinatly works because the spawners are recognising it, if i run the mission and try spawn something in at the spawner then it works no issue, but in the editor if i try to change something i get no errors and just locks the "OK" button, i can spam it all i want but wont accept it

south swan
#

it just locked me out from pressing the "ok" button
maybe actually showing the window that doesn't work as you expect it to can help blobdoggoshruggoogly

gusty rivet
#

literatlly this, just locks the button from being pressed

warm hedge
#

So you're twisting the issue all the time? You wanted to run this code in this chunk of environment but not in Debug Console in Eden Editor?

gusty rivet
#

the only reason it was in the debug was because thats the only way i can get the error code to display, and even then i have to use 3den enhanced to get it to show up, only reason why that was done.

but the code is ran through the module as show above

warm hedge
#

How do we supposed to help if we have no exact issue/error

gusty rivet
#

thats exactly the issue, i have no clue what the problem even is because it wont give me any error code, nothing at all, all i know is that since the update the spawners now reject the code that clearly does work because its on the server, its just now stopping me from changing anything in the module

stable dune
gusty rivet
# stable dune Maybe new CBA or/and arma update broke something on SSS (i assumme that is Simpl...

correct we are using SSS, my script knowledge is kinda limited, this is the code we have been using for well over a year now with no issues till the update came, so not really sure what else i would put there to achieve the same goal?

all that realistically is needed is to tell it to face a specific direction (hench the invisible marker "Car_2"), and to delete anything on the spawn area if something new is spawned in

still forum
#

You can set the background color somewhere, if you set that to transparent, it should be transparent.

#

I have transparent test UI's, so it does work.

south swan
#

may require non-default rvmat for UserTexture object iirc tanking

#

or maybe i'm misremembering stuff
P.S. yeah, it was the other way around. The problem i've misremembered was solved by switching to UserTexture object ๐Ÿคฃ

still forum
#

So the bug then, is that dialog returns true, even when no dialog is open?

faint burrow
still forum
#

Mh I think there is no way to check which dialog the "dialog" is.
Its a user dialog, but

digital jacinth
still forum
#

A hashmap is two arrays. That's it.

digital jacinth
still forum
faint burrow
runic surge
#

How can you pass 3den entities into a function?
[[1538e25b580# 442157: memorypoint1.p3dLand_MemoryPoint1,1536893e080# 442163: memorypoint1.p3dLand_MemoryPoint1,1536cdf6b00# 442169: memorypoint1.p3dLand_MemoryPoint1]] call BTH_fnc_function; Of course won't work

little raptor
runic surge
#

That just fails without error

#

I tried that already. It is treated as an empty array

south swan
#

pass 3den entities to do what?

little raptor
runic surge
#

the eden entities are created by a function and output as an array of entities. Inputing that array (which is the exact array I posted in my example) simply doesn't work

warm hedge
#

Is that snippet the code you actually put in Debug?

south swan
#

they don't really convert back from strings blobdoggoshruggoogly

little raptor
#

You shouldn't convert your array to a string as artemoz said
Example would be the output of debug console, which is a string

runic surge
#

I'm not converting anything

little raptor
#

You're not. The game does it automatically when you display it in debug console output (output is a string)

runic surge
#

that output is just proof the function is receiving the array as it should

south swan
#

wot

warm hedge
runic surge
#

No that's just a literal array of entities as an example

#

I'm trying to pass an array of eden entities into a function that sorts them in a particular way (for a start, anyway)

warm hedge
#

Do you mean that's a psuedo code to tell the idea

runic surge
#

yes

#

it just also happens to be what it looks like

warm hedge
#

get3denSelected command etc can fetch Eden object(s)

runic surge
#

I am trying to use an array produced by a function that generates eden entities (it uses the selected as input)

south swan
#

and array is passed to the second function how? Copy/paste the debug output to the code field? Saved to variable and taken from there?

runic surge
#

it's a variable

ListOfThings = call BTH_fnc_GenerateThings; 
// returns [[entities],[entities],[entities]]
[(ListOfThings select 0),true] call BTH_fnc_ProcessElements;
south swan
#

okay. And how does "sorts them in a particular way" happen afterwards? Some kind of _x setPos* [...]? or _x set3DENAttribute ["Position", [...]];?

runic surge
#

right now it just pairs one item with the next, and then pairs the second item with third, third with the fourth, etc

#

that's just what it does so far, though

south swan
#

so where do you encounter a problem?

runic surge
#

here's the test function I was using:

BTH_fnc_pairElements = {
    private _array = _this;
    private _processedArray = [];

  copyToClipboard str _array;

    if ((count _array) < 2) exitWith { _processedArray };

    for "_i" from 0 to ((count _array) - 2) do {
        _processedArray pushBack [_array select _i, _array select (_i + 1)];
    };

    _processedArray
};
#

this is obviously just the sorting part

#

the entities appear in the clipboard but the output of this function is just empty

warm hedge
#

And what do you actually pass into this fnc

runic surge
#

the boolean is for a later thing but BTH_fnc_ProcessElements is essentially just BTH_fnc_PairElements

south swan
#

and what are the actual outputs (clipboard and debug console result string) of the actual code you've pasted here? ๐Ÿฟ

runic surge
#

[]

proven charm
#

the exitWith always returns empty array []

still forum
# faint burrow https://community.bistudio.com/wiki/allDisplays ?

Yes thats it. The first or second one is the user dialog. Thank you. Somehow I didn't find that one.
First one would be options menu which is probably not open.
so if dialog == true, the first should be the dialog.

@solid gale you could try what allDisplays prints while dialog==true

tough abyss
#

is it possible to
If you have to ask then no.

#

You can only set the capacity to nine with an addon and then do some fiddeling with lock. GL getting that to work on dedi with JIP.

runic surge
#

I can't seem to create eden entities for objects accurately. I believe I was told this function could do it:

fnc_getPitchBankYawAccurate = {
    _v = _this select 0;

    _y = vectorDir _v;
    _z = vectorUp _v;
    _x = _y vectorCrossProduct _z;

    _ay = -asin(_z#0);
    _az = _y#0 atan2 _x#0;
    _ax = _z#1 atan2 _z#2;
    [_ax, _az, _ay] apply {rad _x};
    [_ax, _ay, _az]
};

And I thought I tested it but apparently I didn't. It even returns the rotation values in radians which means it can't be right

runic surge
#

I definitely remember it working. I don't understand how/why it would work

little raptor
#

I have no idea what you're talking about

runic surge
#

That function is supposed to take an object and create eden entity rotations for and eden object

#

yeah I did ask about it lol

#

That's the context anyway

little raptor
#

Well it does "create" rotations so idk what's the problem
They're in radians, yes, but you can skip that and get the result in degrees

runic surge
#

that appears to work

#

I need to figure out the origin offset eden creates and it's done

#

nevermind there is still a lot of misalignment. I need 100% accuracy

little raptor
#

Are you using getPosWorld/setPosWorld?

runic surge
#

positioning is because the origin point in eden entities is different than their models as far as I can tell.

Rotation is the biggest issue

#

and getPosWorld

#

no set pos commands ofc

little raptor
#

How are you applying the rotations anyway?

runic surge
#
BTH_fnc_placeLineBetweenPointsEden = {
    params ["_o1", "_o2", "_model"];
    
    private _p1 = getPosWorld _o1;
    private _p2 = getPosWorld _o2;
    
    private _dir = _p1 vectorFromTo _p2;
    private _up = vectorNormalized ([_dir#1, _dir#0 * -1, 0] vectorCrossProduct _dir);
    
    private _line = createVehicle [_model, [0,0,0]];
    private _bb = boundingBoxReal _line;
    private _size = (_bb#1 vectorDiff _bb#0)#1;
    
    private _center = (_p1 vectorAdd _p2) vectorMultiply 0.5;
    private _scale = (_p1 vectorDistance _p2) / _size;
    _line setVectorDirAndUp [_dir, _up];
    _line setPosWorld (_center vectorAdd (_up vectorMultiply (_bb#0#2 * _scale)));
    
    _line setObjectScale _scale;
    _line3den = objNull;
    collect3DENHistory {
        private _pitchBankYaw = [_line] call BTH_fnc_getPitchBankYawAccurate;
        copyToClipboard str _pitchBankYaw;
        private _3denpos = ASLtoATL getPosWorld _line;
        _line3den = create3DENEntity ["Object",_model,[0,0,0]];
        set3DENAttributes [
            [[_line3den], "Rotation", _pitchBankYaw],
            [[_line3den], "Position", _3denpos],
            [[_line3den], "ENH_objectScaling",_scale]
        ];
    };
    //deleteVehicle _line;
    _line3den
};

this is how

#

it doesn't matter what order since the rotation and position values are just properties of the entity

#

eden objects use ATL or AGL

little raptor
#

afaik 3den needs x y z

runic surge
#

I already fixed it

#
BTH_fnc_getPitchBankYawAccurate = {
    _v = _this select 0;

    _y = vectorDir _v;
    _z = vectorUp _v;
    _x1 = _y vectorCrossProduct _z;

    _ay = -asin(_z#0);
    _az = _y#0 atan2 _x1#0;
    _ax = _z#1 atan2 _z#2;
    [_ax, _ay, _az]
};
little raptor
#

Because it measures the height from the land contact not model center

runic surge
#

yes I know

#

private _3denpos = ASLtoATL getPosWorld _line; that's what this is supposed to do

little raptor
#

No

#

getPosWorld is at model center

runic surge
#

it's a requirement to retrieve the position from the non-eden object

little raptor
#

Not land contact

#

So you must use getPosATL

runic surge
#

private _3denpos = getPosATL _line;?

little raptor
#

Yes

runic surge
#

I'm certain I tried that. I know I didn't have it weird for no reason. Let me test

#

Looks about the same

little raptor
#

Screenshot?

runic surge
#

The eden entity is the one that is not aligned. The screenshots with only one wire is showing the eden entity

#

It almost looks like it's JUST a position issue but the rotation seems a bit off as well

little raptor
#

To me it looks like the position is off

runic surge
#

Yep, rotation too. Moving one end into place causes the other end to be even further off

little raptor
#

After running the 3den position command, confirm that their posWorlds are the same

#

[getPosWorld _line, getPosWorld _line3den]

#

You can also do the same for rotations

#

See which one is actually off

#

(I'm 99% sure it's the position only)

runic surge
#

[[5138.06,5939.7,15.9672],[5138.06,5939.7,15.9691]]

#

z is off by a bit

little raptor
#

And rotations?

little raptor
runic surge
#

[[-4.33699,0.0386578,0.366959],[-4.33697,0.0386578,0.366959]]

little raptor
#

You must normalize all those 3 vectors first

runic surge
#

damn I already knew that

#

let me see if that fixes it

little raptor
#

Also why do you write _x1 in there? meowsweats
Just put private before your variables

#

You don't need to create new var names

runic surge
#

Oh I was just double checking there wasn't a syntax issue because it was _x and it was used that way later

little raptor
#

Well yeah just make it private

runic surge
#

Looks promising

#

I'll have to test more thoroughly to be absolutely sure but if this is all because I forget about the scale thing I am quite annoyed by that

#

["Position:",[5033.98,6446.33,28.4747],[5033.98,6446.33,28.4747],"Rotation:",[-1.88902,0.0683772,-178.847],[-1.889,0.0510004,-178.454]] Seems to be a very slight rotation difference

little raptor
#

What is the pitchbankyaw function rn?

runic surge
#
BTH_fnc_getPitchBankYawAccurate = {
    private ["_v","_y","_z","_x","_ay","_az","_ax"];
    
    _v = _this select 0;

    _y = vectorDir _v;
    _z = vectorUp _v;
    _x = _y vectorCrossProduct _z;

    _ay = -asin(_z#0);
    _az = _y#0 atan2 _x#0;
    _ax = _z#1 atan2 _z#2;
    [_ax, _ay, _az]
};
little raptor
#

There's no normalize meowsweats

#

Also don't use the array private because that's slow

runic surge
#

Normalize? Like vectorNormalized?

little raptor
#
BTH_fnc_getPitchBankYawAccurate = {
    params ["_v"];

    private _y = vectorNormalized vectorDir _v;
    private _z = vectorNormalized vectorUp _v;
    private _x = vectorNormalized (_y vectorCrossProduct _z);

    private _ay = -asin(_z#0);
    private _az = _y#0 atan2 _x#0;
    private _ax = _z#1 atan2 _z#2;
    [_ax, _ay, _az]
};
little raptor
runic surge
#

["Position:",[5037.13,6260.28,23.7286],[5037.13,6260.28,23.7286],"Rotation:",[-2.02298,-0.126705,176.418],[-2.02296,-0.126704,176.418]] MUCH closer. Shouldn't really be noticeable I would imagine but I guess that would need some testing to be sure

#

Seems legit

#

Thank you so much for all your help with this

little raptor
#

np

runic surge
#

btw can you structure params like this params ["_o1", "_o2", ["_model","Land_Powerline_01_Wire_50m_f",[""]], ["_eden",false,[false]]]; with inconsistent use of the string or the array with additional info?

#

it appears you can

fringe granite
#

Is there a easy way to get a list with class name of all vehicles? I have many mods, but documentation is lacking.

tulip ridge
fringe granite
#

Thank you so much Dart! Thats really helpfull!

tulip ridge
#

๐Ÿ‘

solid gale
#
if (dialog) then {
    diag_log format ["Displays open: %1", str allDisplays];
} else {
    diag_log "No dialog is open.";
};
pallid palm
#

wow that looks awsome

signal imp
#

Hey all, I have a custom SP/MP sniper battle mission with tons of parameters and customization, complex dynamic AI teams, scripted helicopter transport, artillery, etc. So far, I've been able to let the AI do everything the players are able to do, and calling down a supply drop is last on my todo list for them.

I have a virtual supply drop provider/requester for each team, and of course when it's available a player can activate it through their supports menu and it spawns the plane, flies over the indicated spot, drops a custom initted crate, then does whatever it wants until I make it available again.

However it doesn't look like I can manually activate that request from a non-player unit. Anyone know if that can be done? I plan to just scrap the internal support altogether if not, and make my own supply drop code that does the same thing. Just hoping I can save myself a little effort.

acoustic wren
#

hey, newbie here need help

_vehicle = createVehicle [_vehicleType, _position, [], 0, "FLY"];

_vehicle setDir (markerDir _marker);
_vehicle setPosATL _position;

_unit moveInDriver _vehicle;

why when i respawn in the jet the jet stalling?
if i remove


_vehicle setDir (markerDir _marker);
_vehicle setPosATL _position;

everything is fine, how can i fix that?

warm hedge
#

setPosATL etc resets the velocity too

#

setVelocity or setVelocityModelSpace to reset the velocity

acoustic wren
worldly kite
#

Hi, on the right side you can see respawn inventory loadouts. As you can see it calls the default cfgvehicles's loadout. On the left you can see my custom loadout exported via BI arsenal. How can i apply my custom loadout to be called instead of the default cfgvehicle?

acoustic wren
#

sorry for having to many question, i want to delete the jet after explotion to save FPS in the long run, what script command should i use ?

params ["_unit", "_corpse"];

if (!(isNull _corpse)) then {
    _vehicle = objectParent _corpse;

    if (!(isNull _vehicle)) then {
        _vehicle deleteVehicleCrew _corpse;
    } else {
        deleteVehicle _corpse;
    };
};

_side = side (group _unit);

_vehicleType = switch (_side) do { 
    case blufor: { "B_Plane_Fighter_01_F" }; 
    case opfor: { "B_Plane_Fighter_01_F" }; 
    case independent: { "B_Plane_Fighter_01_F" }; 
    default { "B_Plane_Fighter_01_F" }; 
};

if (_vehicleType == "") exitWith { };

_markerPattern = format [
    "respawn_vehicle_%1", toLowerANSI (str _side) ];


_markers = allMapMarkers select { ((toLowerANSI _x) find _markerPattern) == 0 };

if ((count _markers) == 0) exitWith { };

_marker = selectRandom _markers;
_position = getMarkerPos _marker;

_position set [2, 2000]; 

_vehicle = createVehicle [_vehicleType, _position, [], 0, "FLY"];

_vehicle setDir (markerDir _marker);
_vehicle setPosATL _position;

_speed = 300;    
_vehicle setVelocity [
    _speed * sin (markerDir _marker),   
    _speed * cos (markerDir _marker),   
    0                                   
];

_vehicle addEventHandler ["Fired", { (_this select 0) setVehicleAmmo 1 }];

_unit moveInDriver _vehicle;
warm hedge
#

deleteVehicle and deleteVehicleCrew

warm hedge
worldly kite
#

That's right

#

I have a tamplate how to type in all the items but thats a lot of time, exporting would so much easier

worldly kite
#

I know this, with this solution i only can call the default cfgvehicles (vanilla soldiers) OR i can start typeing a tons of lines for the custom loadout... but i know that there is an easy way and somehow call the exported loadout (you can see on the left picture)

warm hedge
#

I'm sure somebody online wrote such "export"

faint burrow
thick hatch
#

Hello! I was directed here by an exasperated friend after asking one too many questions, and I'm stumped as far as finding a solution goes, so here it is:

I am trying to set a trigger to run playSound3D (an alarm) and loop the audio 3 times after the sound file finished playing each previous time. My planned approach was to sleep for the equivalent time of the sound file, then play it again, but I'm encountering problem after problem and the bohemia wiki provides not much relief. Can anyone here help?

faint burrow
#

To get started, provide your code, screenshots, error messages, etc.

thick hatch
#

Sorry yes

#

On Activation
for "_i" from 1 to 3 do { playSound3D ["a3\sounds_f\sfx\alarm_blufor.wss", Speaker1, false, getPosASL Speaker1, 2, 1, 500, 0, false]; sleep 5.0; };

warm hedge
#

And where is the error

thick hatch
#

It plays the sound once and spits out this error at the same time

faint burrow
#

spawn your code.

thick hatch
faint burrow
thick hatch
#

_this spawn {for "_i" from 1 to 3 do { playSound3D ["a3\sounds_f\sfx\alarm_blufor.wss", Speaker1, false, getPosASL Speaker1, 2, 1, 500, 0, false]; sleep 5.0;};}

#

I did the above and got no error but the sound never played

warm hedge
#

Are you sure the trigger is even triggering

thick hatch
#

It did when I ran my code without the spawn command, and I didn't change the trigger since

warm hedge
#

Are you still sure it is

faint burrow
warm hedge
#

Let's say put a hint etc, to make it more obvious

thick hatch
faint burrow
hallow mortar
thick hatch
#

Had to search up what 'Pass empty array' means, but now it is working. Thank you so much everyone.

faint burrow
thick hatch
#

While I'm here, is there any command that tells the script to wait for the previous audio file to play out before repeating it/continuing the script?

thick hatch
hallow mortar
#

It's preferable to use 0 rather than [] where possible because it is slightly faster than creating a new empty array

lavish stream
thick hatch
#

Trust me my mission isn't going to be busy with code, but good to know :)

thick hatch
scenic shard
#

is there a way to move a dropped weapon so it is only visible when checking the inventory of a dead body? and not exist as a "ground" object?

I managed to delete the weapon using getCorpseWeaponholders but then i cant loot it. any way to find the actual weapon classname (it just says dummy) and add that to the corpse before deleting?

faint burrow
#

Try getting a weapon from a weapon holder and adding it to the corpse.

scenic shard
#

that one returns a empty array unfortunately

faint burrow
#

Code?

scenic shard
#

i just tried with weaponsItemsCargo corpse in console

faint burrow
#

Because corpse isn't a weapon holder.

thick hatch
#

Hello again! I have a fresh new problem straight from the printing press if anyone could help me. The purpose of this script is to make this Opfor say a random voice line from a set array, from the start of the mission until he dies like, 2 minutes later. Currently my problem is that instead of waiting between voice lines, he just says them all instantly, overlapping each other.

faint burrow
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
warm hedge
#

Because it spawns 10 times, not wait

thick hatch
#
for "_i" from 1 to 10 do { [] spawn {
playSound3D [selectRandom [getMissionPath "DT_C_Death_CHAOS_1.wav", getMissionPath "DT_C_Death_CHAOS_2.wav", getMissionPath "DT_C_Death_CHAOS_3.wav", getMissionPath "DT_C_Death_CHAOS_4.wav"], CM1, false, getPosASL CM1, 2, 1, 100, 0, false];
Sleep 10;
}
 };
#

Oh there I did it

thick hatch
warm hedge
#

for is repeating the spawn execution

#
for "_i" from 1 to 10 do {
    [] spawn {
        // sound
        sleep 10;
    };
};```This is your code right now, as you can see you have no code after the `sleep`
thick hatch
#

Oh! Ok I switched the 'for' and 'spawn' strings around and it works now? Is that right?

warm hedge
#

String is not the term you use in this context, but yes

thick hatch
#

Apologies, right

warm hedge
#

I'm not asking you to say sorry either

thick hatch
#

uhh thumbs up then!

#

:P

winter rose
#

for and spawn are scripting commands ๐Ÿ™‚

dusk gust
winter rose
stuck palm
#

Hey all, I've got some questions about weather functions. Working on a pvp mission to be hosted on a dedicated server.

BIKI Example:

skipTime -24;
86400 setOvercast 1;
skipTime 24;
0 = 0 spawn {
sleep 0.1;
simulWeatherSync;
};

Does any part of this need to be executed on the client via remote exec? Current'y am remote executing most settings on client and host.

I am also a little befuddled on forceWeatherChange vs simulWeatherSync. forceWeather change doesn't seem to have any effect on rain, for example.

Essentially, I have a few environmental params related to rain, cloud cover, wind, waves, etc, set by the host in desc.ext. Those settings are then applied. I want to ensure that the weather not only is implemented instantly when applied, but that those settings remain persistent for the duration of the match, be it 2 hours or 2 days.

My thought process was to just spawn a thread that reapplies the weather settings every few minutes, ensuring the weather doesn't change. If that isn't necessary, it'd be nice to have that verified. Rain for example, seems to begin dissapating after awhile. Using the above example, but with rain instead of overcast results in no rain.

Also, it seems simulSetHumidity has made a return. I assume that's server executed?

Current script in progress:

https://pastebin.com/CmuXBLby
sharp grotto
#

Read the wiki, it contains all needed info about how the commands should be handled.

#

All working weather commands need to be server executed and not on the client. (Client syncs with server).
The only thing you need to remoteExec on JIP players is overcast, since the syncing is broken.
So already online players could have drastically different values for overcast compared to ones that join later.
https://feedback.bistudio.com/T183693

still forum
#

There is probably some game bug there.
But I don't have steps to reproduce it in vanilla, and I don't have the time to guide you through getting me the information I need :/

fair drum
solid gale
# still forum 6969 sounds like a mod ๐Ÿ˜„ I don't know how to get proper readable names, like c...

๐Ÿ™‚ 6969 Itโ€™s the debug menu where I executed the code from

class AH_ExecMenu {
    idd=6969;
    movingEnable = false;
    class controlsBackground {
        class AH_DevBackground: LIFE_RscText {
            idc = 1031;
            x = 0.0312851 * safezoneW + safezoneX;
            y = 0.104778 * safezoneH + safezoneY;
            w = 0.183014 * safezoneW;
            h = 0.830355 * safezoneH;
            colorBackground[] = {-1,-1,-1,0.7};
        };
        class AH_DevHeaderBg: LIFE_RscText {
            idc = 1000;

            x = 0.0313498 * safezoneW + safezoneX;
            y = 0.0811797 * safezoneH + safezoneY;
            w = 0.183014 * safezoneW;
            h = 0.0235679 * safezoneH;
            colorBackground[] = {-1,-1,-1,0.9};
        };
        class Background: LIFE_RscText {
            idc = 1000;

            x = 0.259373 * safezoneW + safezoneX;
            y = 0.105053 * safezoneH + safezoneY;
            w = 0.598062 * safezoneW;
            h = 0.492593 * safezoneH;
            colorBackground[] = {-1,-1,-1,0.7};
        };
        class ExecutorTopBackground: LIFE_RscText {
            idc = 1000;

            x = 0.259285 * safezoneW + safezoneX;
            y = 0.0809917 * safezoneH + safezoneY;
            w = 0.598125 * safezoneW;
            h = 0.0238519 * safezoneH;
            colorBackground[] = {-1,-1,-1,0.9};
        };

        class WatchTitleBackground: LIFE_RscText {
            idc = 1000;

            x = 0.259285 * safezoneW + safezoneX;
            y = 0.601321 * safezoneH + safezoneY;
            w = 0.598125 * safezoneW;
            h = 0.0238519 * safezoneH;
            colorBackground[] = {-1,-1,-1,0.9};
        };
        class WatchBackground: LIFE_RscText {
            idc = 1000;

            x = 0.259373 * safezoneW + safezoneX;
            y = 0.625007 * safezoneH + safezoneY;
            w = 0.598084 * safezoneW;
            h = 0.310168 * safezoneH;
            colorBackground[] = {-1,-1,-1,0.7};
        };
    };

I donโ€™t know, man. Like I said before, 6 months ago, nothing happened, and the server was running smoothly. Itโ€™s like Arma 3 changed something over these 6 months, but I donโ€™t know what it is. I tried looking at the update changes but didnโ€™t find what I needed to know, so Iโ€™m still not sure. Thanks for trying to help; I really appreciate it.

faint burrow
still forum
#

Yes Arma 3 changed alot, specifically related to UI controls and dialogs recently. Most of it isnt in changelog as its background stuff
But I don't know what specifically could cause this

faint burrow
#

There is BIKI.

#

Providing links to BIKI where everything is explained is rude?

#

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

#

In the middle of a mission or when a player joins?

#

Since you add the intel on server side, you can move your code to initPlayerServer.sqf.

wind flax
#

Hey guys. Working on a script to precisely align an object. I'm unable to reposition it exactly where it was. The original position is achieved by spawning in the object, attaching it to another. Making it seamless. When I get it's position after it's been spawned, and attached ( and detached) I cannot get it back into the same position without having gaps

faint burrow
#

Position, direction and vector up should be enough.

wind flax
#

Tried that

#

Still not exact

granite sky
#

getPosWorld/setPosWorld are required.

wind flax
#

That I have not tried

#

I'll give it a try, thanks

granite sky
#

Not entirely sure how that's going to work with attached vs detached though.

wind flax
#

The object is detached when I'm attempting to get it's position

faint burrow
#

Your code and screenshots?

wind flax
#

It's a Joint Project with a friend; he wrote the original piece to orientate the object, I'm now making another part to save the configuration of those objects, and load them on demand

#

It's a modular killhouse system which supports saving and loading of layouts

faint burrow
#

Well, without code and screenshots we can't say exactly what the problem might be.

wind flax
#

I understand, I'm going to try what John recommendend, and I'll follow up in here if that doesn't work

faint burrow
#

Good luck.

crimson lion
#

I'm doing something nightmarish to mess around in the editor, and I have this line of code to get all things derived from type HOUSE on the map:
AllUsableBuildings = nearestObjects [[(worldSize/2),(worldSize/2),0],["HOUSE"],(worldSize / 2),true];
Is there any magical thing I could search for besides HOUSE or BUILDING that would get me structures only? In a perfect world, it'd only find things that have path LODs. Or am I approaching this a weird way?

#

As is, this returns lots of walls, lamp posts, etc. that derive from the base house class. About 11k objects on Malden.

faint burrow
wind flax
# granite sky getPosWorld/setPosWorld are required.

cc: @faint burrow

This is better, but I'm still hitting a roadblock. Important parts of the script(s):

saving:

{
 private _pos = getPosWorld _x;
 private _dir = getDir _x;
 private _class = typeOf _x;
 //private _nearestObject = nearestObject [getPosASL _x, "Land_HelperObj"];
 
 //systemChat str _nearestObject;
 
 // Push the positional array into the main array
 _killhouseObjects pushBack [_class, _pos, _dir];
 
 // Delete the object
 deleteVehicle _x;
 
// systemChat str (_x call BIS_fnc_getPitchBank)
} forEach _objs;

loading:

    private _type = _x select 0; // Object name
    private _location = _x select 1; // getPosWorld
    private _dir = _x select 2; // getDir
    
    private _v = createVehicle [_type, [0, 0, 0], [], 0, "CAN_COLLIDE"];
    
    _v setDir _dir;
    _v setPosWorld _location;

First screenshot shows it's seamless, then the second shows the gap/issue when re-creating the objects stemmed from setPosWorld

winter rose
#

instead of dir, try using vectorDir + vectorUp ?

wind flax
faint burrow
winter rose
wind flax
#

@faint burrow Re-attaching back to the original object is unreliable as there are too many (there are about 200-300 of those helper objs in this area)

wind flax
faint burrow
wind flax
#

Ah I get what you mean, I've done that for another layout system before

faint burrow
#

Try saving [_class, _vectorDir, _vectorUp, _offset] and restoring like that:

{
    _class = _x select 0;
    _vectorDir = _x select 1;
    _vectorUp = _x select 2;
    _offset = _x select 3;

    ...

    _object attachTo [_center, _offset];
    _object setVectorDirAndUp [_vectorDir, _vectorUp];
} forEach _objectsInfo;
granite sky
#

We use setPosWorld & setVectorDirAndUp and it's accurate. Might have some dependence on object sim type though.

wind flax
#
{
    private _type = _x select 0;
    private _location = _x select 1;
    private _dir = _x select 2;
    private _vector = _x select 3;
    
    private _v = createVehicle [_type, [0, 0, 0], [], 0, "CAN_COLLIDE"];
    
//    _v setDir _dir;
    _v setPosWorld _location;
    _v setVectorDirAndUp _vector;      
    
} forEach _killhouseObjects;
#
{
 private _pos = getPosWorld _x;
 private _dir = getDir _x;
 private _class = typeOf _x;
 private _vectorDir = vectorDir _x;
 private _vectorUp = vectorUp _x;
 private _vector = [_vectorDir, _vectorUp];
 
 //private _nearestObject = nearestObject [getPosASL _x, "Land_HelperObj"];
 
 //systemChat str _nearestObject;
 
// private _vector = vectorDir _x;
 
 // Push the positional array into the main array
 _killhouseObjects pushBack [_class, _pos, _dir, _vector];
 
 // Delete the object
 deleteVehicle _x;
 
// systemChat str (_x call BIS_fnc_getPitchBank)
} forEach _objs;
#

Could simplify the vector defition, but still leads to the gap. Starting to wonder if it has something to do with the terrain or something.

wind flax
granite sky
#

wait, how large is this gap?

winter rose
#

no need to store dir, just store [vectorDir _x, vectorUp _x] and setVectorDirAndUp _vectorDirAndUp

wind flax
granite sky
#

yeah you can't do that, Arma just isn't that precise.

#

you get some wobble in the low precision bits even with setPosWorld.

wind flax
#

I had another approach to this problem; wondering if you could throw some insight into it

#

The goal is to be able to "save" and "load" the configuration of the walls on demand; instead of placing them (creating new objects, and aligning them), do you think you could accomplish this by changing an existing object? If the bar at the top (which is the helper object) had the same offset as the wall (so the wall, and bar would be combined into a 2nd Wall object), could that work?

granite sky
#

I don't know what you mean.

#

You could try just reversing the setVectorDirAndUp and setPosWorld.

wind flax
#

Right now, the objects are 2 parts, the 1st one has an act interact to spawn the 2nd object, and attach it

#

If the first object was just the top, and you had a second object which was both the bar, and the bottom piece, would you be able to "change" an existing object without having to re-align?

wind flax
wind flax
granite sky
#

Attaching everything to a dummy object seems like the next move.

wind flax
#

That actually just gave me another idea that may work lol

#

Thanks

bold rivet
#

whats the diffrence between normal and _O shells in the vehicle weapon list thing?

winter rose
bold rivet
#

ok, thx

hallow mortar
#

It is. There's one difference between the magazine classes: the name displayed on MFDs for vehicles with the magazine loaded. For the OPFOR variant, it's in Cyrillic.

lament grotto
#

Hi all could someone tell me whats wrong with this script here?
Context - I am trying to do a multiplayer addAction that is placed on a unit which will give out random objectives.

[[Dimitri], ["Request Job", "DJobInit.sqf",[],1,false,true,"","_this distance _target < 2"]], "addAction", true, true] call BIS_fnc_MP;

tulip ridge
lament grotto
tulip ridge
warm hedge
#

Check pinned for some explanation for remoteExec usage

#

...Also, tell what's wrong with your current code

lament grotto
#

Got it to work thank you for pointing me in the right direction!

[Dimitri,["Ask for a job","core\Objectives\DJobInit.sqf",[],1,false,true,"","_this distance _target < 3"]] remoteExec ["addAction",0];```
teal drum
#

Why does briefingName in 3DEN preview return the name of the mission folder (trigger_testing) instead of the briefingName property from description.ext?

#
[briefingName, getText (missionConfigFile >> "briefingName")]

returns

["trigger_testing","Operation Haha"]
warm hedge
#

What do you expect?

teal drum
#

I was expecting them to match since the description of briefingName mentions:

Returns the name of the current briefing/scenario name.
implying (from my interpretation at least) that it would "mirror" the property under the same name from description.ext

#

... Especially when missionName behaves the same way under the same setup

warm hedge
#

As far as I can tell it is working fine to me

#

Are you sure your description.ext is loaded

teal drum
#

...? Guess I forgot to reload the mission after I shoved the file in

#

Lovely stuff

#

Thanks

faint burrow
#

If I'm not mistaken, briefingName gets value from mission file, and there can be several briefingName props.

teal drum
#

It does, yeah, I just didn't figure to reload my mission after I updated the files in my mission folder ๐Ÿ˜“

thick hatch
#

Afternoon everyone, where can I locate and edit the mission start config file in 3den?

#

Say, to get certain scripts to run on mission start?

#

SO far I've just placed down a random object and put everything I need in it's Init

hallow mortar
#

In the Editor there's a mission init field in the uhhhhhhh Attributes menu.
You can also create init.sqf in the mission folder and then edit it externally, as well as description.ext (https://community.bistudio.com/wiki/description.ext) for config stuff.
I usually prefer the external files as they are easier to access and offer more flexibility. (Caution: I don't know which takes precedence if you have both an Editor mission init and an init.sqf)

cosmic lichen
thick hatch
#

Thank you!!

hallow mortar
faint burrow
#

Object initialization fields are called before init(XXX).sqf.

hallow mortar
#

I'm referring to the Editor mission init field, not object inits

#

It's probably the same but I don't know for sure

cosmic lichen
polar radish
#

does anyone know if theres a way to make a trigger that gets tripped if only 1 specific unit detects players, instead of just "detected by X faction"

#

im trying to set off a claymore if one specific unit sees players inside the trigger

faint burrow
polar radish
#

ty :)

final harbor
#

Hello, is there any way to make sure that when putting on clothes, she also occupies the bulletproof vest slot, as is done with the helmet, which occupies the nvg slot

thick hatch
#

Silly little question - for some reason in my mission using stationary turrets is broken (freelook while in it and can't fire) would an unsuspecting script have done that, or would it be something else entirely? It's something else

tulip ridge
thick hatch
#

Silly question #2; I am trying to make an addAction that only shows when the player is in the vehicle of the aforementioned addAction; what would the condition parameter be to achieve that?

stable dune
thick hatch
#

Thank you very much... I think I didn't believe it was going to be that simple

faint burrow
#
_this in _target
sonic orchid
#

Does anyone know how to call the end mission splash screen without ending the mission? im trying to use triggers to make it pop up for a min

sullen sigil
#

Not relevant to this channel but also far too much manpower required

old owl
#

Perhaps I'm over simplifying it but seems like it would be worth it's while.

thick hatch
#

Hello, does anyone know where this directory is? I've searched as hard as I can.

#

"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa"

tulip ridge
#

If that's what you mean

thick hatch
grizzled cliff
#

Mmm I love when you find fixes to little bugs that were making you doubt things... The only doubts I have are my abilities to always get things right the first time ๐Ÿ˜›

#

also, even with intercept drawLine3D is still a slow as fuck function ๐Ÿ˜›

upbeat hill
#

Hi I'm trying to just delete a light source the documentation says i just use delete Vehicle but it does not seem to be working

private _lightSource = "#lightpoint" createVehicleLocal _position; 
_lightSource setLightColor [0,1,1]; 
_lightSource setLightAmbient [0.2,0.0,0.3]; 
_lightSource setLightUseFlare true; 
_lightSource setLightFlareSize 3; 
_lightSource setLightFlareMaxDistance 3.5; 
_lightSource setLightBrightness 4; 
_lightSource setLightDayLight true; 
 
_lightSource spawn { 
 while { sleep 0.05; player distance _this > 2 } do 
 { 
  _this setLightBrightness 4 max (40 / (player distance _this)); 
 }; 
 deleteVehicle _this; 
};

0 spawn { 
 sleep 5; 
 hint "deleting light";
 deleteVehicle LightPosHere;
};
warm hedge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
upbeat hill
#

woops sorry

warm hedge
#

And which deleteVehicle supposed to delete the lightsource?

upbeat hill
#

the one in the sleep at the bottom

warm hedge
#

That is not deleting the lightsource

#

The light is _lightSource in this context

upbeat hill
#

oh thought if you deleted the object it would get rid of the light

warm hedge
#

Because in your spawn it is undefined

faint burrow
#

Look at the previous spawn.

upbeat hill
pallid palm
#

here you go friend i set it up for you ok

#
private _position = LightPosHere modelToWorld [0, 20, 1.5]; 
private _lightSource = "#lightpoint" createVehicleLocal _position; 
_lightSource setLightColor [0,1,1]; 
_lightSource setLightAmbient [0.2,0.0,0.3]; 
_lightSource setLightUseFlare true; 
_lightSource setLightFlareSize 3; 
_lightSource setLightFlareMaxDistance 3.5; 
_lightSource setLightBrightness 4; 
_lightSource setLightDayLight true; 
 
_lightSource spawn { 
 while { sleep 0.05; player distance _this > 2 } do 
 { 
  _this setLightBrightness 4 max (40 / (player distance _this)); 
 }; 
 deleteVehicle _this; 
};

0 spawn { 
 sleep 5; 
 hint "deleting light";
 deleteVehicle LightPosHere;
};
#

just for easy to see

#

i didnt change anything

upbeat hill
#

thank you

pallid palm
#

you bet

#

no one ever tells us its mach. code we must use to do this

upbeat hill
pallid palm
#

Schatten will fix u up, he's a super pro

#

why do u want to delete the _lightSource

#

i have a hard enought time creating a _lightSource i never want to delete it lol

warm hedge
#

Your last spawn doesn't

pallid palm
#

ah POLPOX he great also

#

he helped me alot

#

and btw thx to all you awsome people that helped me, i love you guys

#

where would i be with out you guys

upbeat hill
heavy perch
#

Is anyone familiar with a way to override displaynames for inherited actions. For example; I'd like to change the displayname for "Turn In" to something else.

vapid scarab
#

You would have to override the config for it
Specifically here to change eject, you need to write a config (while inheriting the need classes) all the up to UserActions and the action config. Then set displayName to something else. This can only be done in a mod, no scripting allowed.

heavy perch
#

Thanks!

tulip ridge
#

For example, B_T_MBT_01_TUSK_F doesn't even have a UserActions class defined in it at all

tulip ridge
vapid scarab
#

He knows more than me

#

But that is always the place the check

heavy perch
upbeat hill
#

@faint burrow Hey sorry to bother you but i was looking through the isFlashlightOn documentation again and cant see to find if there is a variable to check if flashlight is off is there not one?

faint burrow
#
_flashlightTurnedOff = !(_unit isFlashlightOn _weapon);
tulip ridge
#

Same as any other condition, just use !, the not operator, to invert it.

!true; // false
!false; // true

1 > 2; // false
!(1 > 2); // true
upbeat hill
#

oh didnt know you could do that

#

The more you learn

#

Thanks once again

upbeat hill
faint burrow
#

For the second condition ! should be inside brackets.

#

And if you want to invert the whole condition, ! should be placed at the beginning and parentheses should be used.

upbeat hill
#

would i have to do it for each variable in there aswell. like !player !isFlashlightOn

tender fossil
upbeat hill
#

so like

!(player inArea thisTrigger) and { !player isFlashlightOn (currentWeapon player) }

faint burrow
#

I would use parentheses for readability.

upbeat hill
#

!(player inArea thisTrigger) and { (!player) isFlashlightOn (currentWeapon player) }

#

so like that

faint burrow
#
!(player isFlashlightOn (currentWeapon player))
upbeat hill
#

ohhhh

#

i see now

#

wait does that mean i dont need the {} Brackets if i replace them with curly ones or does is it case by case scenario

upbeat hill
#

ooo interesting

#

Thank you for putting up with my annoying questions

near monolith
#

hey guys, not my usual place in this discord so apologies in advance for any misunderstandings or limited knowledge on this front but:

As of late, we have been playing a modded scenario on ALIVE and have noticed that UAV's seem to not listen to Commands from the Operator. (Example: Operator connects to UAV and places a loiter command, then tries to update altitude to a certain number - but the UAV refuses and stays at 100m indefinitely.) Is there some sort of init script we could utilize to ensure that commands are regularly updated and carried out or is that too expeditious and isn't something that would be possible?

(Dare I say I tried concocting something on ChatGPT, but from history on these channels - people have stated a lot of this is essentially code gibberish it picks up from random sources.)

tender fossil
tender fossil
#

I'm not 100 % sure though

near monolith
#

I'm at my wits end with this tbh lol, i've tried every trick in the damn book other than turning to essentially the big brain minds of y'all over here.

It seems to work fine in the Editor; but as soon as it hits the server: BOOM no worky.

I was hoping maybe there could be some sort of updated script that looped to ensure that the commands were carried out. But if this is a bug, guess I just gotta wait on the server updates from good ol' BI.

jolly sierra
#

hey, I'm pretty confident in Arma scripting, but I just can't get inArea to work. I place a trigger in mission editor, give it a variable name, and then when I check in-game using watch variable for player inArea triggur then it always prints false, and it's not a variable name problem, since if I spell it wrong it just doesn't output anything

#

the trigger has -1 default height, but even if I give it a fixed height, it's the same result. Trigger is just default from editor, nothing changed. I try to run the mission in multiplayer, if that changes anything

#

play -> play in multiplayer

faint burrow
#

Send screenshot with trigger settings.

jolly sierra
faint burrow
#

Are you sure you're within trigger area?

jolly sierra
#

the thing I want to do is to restrict player from spawning in certain zone in a CTI server when server initializes, so I guess I check it like that, just place triggers with forbidden zones, and then check with inArea or inAreaArray after I get multiple

jolly sierra
#

I can do a short video

faint burrow
#

OK, let's see.

jolly sierra
#

gotta cut it so it fits lol, 117MB, 80% is just mission loading

faint burrow
#

Works for me. I still think that you're not within the trigger area.

jolly sierra
#

it's such a basic function that i'm surprised it isn't working for me lol

#

is there a chance that idk mission somehow removes/disables all triggers?

faint burrow
#

Haven't used Watch field. Try executing in the main field.

jolly sierra
#

I pasted little script which was checking for it every 1 second

#

and watch field checks result of a statement when you pree esc key

#

so if I would place a hint there I would need to keep pressing escape to display it.

#

I have an idea, ill make a empty mission and test that way

#

yep it instantly works

#

so the mission does something weird

#

I guess I'll figure it out. Thanks anyway lol

faint burrow
#

Maybe the mission disables simulation of the trigger?

#

Or event deletes it?

quaint oyster
#

Stupid question on my part, but does "addMPEventHandler ["MPKilled" need to be on the client or the server?

#

Had strange results running it on a single player which is why I asked.

tender fossil
fair drum
jolly sierra
#

that's video size

fair drum
#

Oh okay

jolly sierra
#

ok maybe I'll ask another way: how can a mission remove trigger? Cause when I check for my trigger in init.sqf it returns empty list of all missionObjects of type "Trigger" and "Empty_Detector". Is this some weird setting in Eden editor which can disable them?

faint burrow
#

Using deleteVehicle command.

jolly sierra
#

cause some weird shit is going on with the mission

hallow mortar
jolly sierra
#

ok ill check it

#

ok so at the moment of init.sqf it's there, let's see further

#

and after mission's init it's gone. So at least we've gone somwhere

jolly sierra
#

ok that's the line

#

thanks all for help!

tender fossil
# jolly sierra

Just curious, is the magic variable _x defined outside of the forEach block too?

jolly sierra
#

@faint burrow that's how it was deleting it.

hallow mortar
jolly sierra
#

I know

#

but it just does it later using that way, setting to objNull

#

oh nah

#

it's actually deleteVehicle

hallow mortar
hallow mortar
placid spear
#

What would be the reason I can still see markers that are supposed to be in the direct channel (5)?

#

code excerpt

 if (getPos self distance getPos _x < detectionRange) then {
                        _ins = terrainIntersect [getPos self, getPos _x];
                        if !(_ins) then {
                            activeMarkers pushBack _markerName;
                            _marker = createMarker [_markerName, getPos _x, 5, objNull];
                            _marker setMarkerType "mil_triangle";
                            _marker setMarkerColor "ColorRed";
                            _marker setMarkerText "Unk. Munition";
winter rose
#

I believe markers can only be global, side or group, no?

placid spear
#

Well that's kinda a bummer

#

It's interesting though, because if I switch to the direct channel, the marker goes from being half-alpha, to fully visible

#

But it shows up globally to all sides

hallow mortar
#

Well, how would it know who to show or hide it from?

placid spear
#

I assumed direct did some shenanigans with vicinity, but guess not. Just gonna add a foreach loop that sets the alpha to zero for players outside 50m

hallow mortar
#

if markers could be created in direct by players (unclear) then it might use proximity to the author. But this is a script-created marker - it has no author, especially since you've specified its owner as objNull, i.e. nonexistent. So whose proximity would it use?

placid spear
#

That's fair. This opens up me being able to get it to show for people outside the TOC as well, I suppose

hallow mortar
#

BTW, if you're going to specify the owner as objNull, you can just skip specifying it entirely, since objNull is the default and there are no parameters after that that you might need to specify it in order to reach

nova berry
#

So I am in the process of trying to a game of capture the flag with forklifts. I've got the system down for when you capture the opposing teams forklift and bring it back to your base.

But I am trying to get it to when you get in to the opposing teams forklift it pops up a hint that the flag was stolen. I am not quite sure where to start with this to have it only pop up when a specific side gets in to the vehicle

modest sonnet
#

Is there a place to ask reforger scripting questions?

tulip ridge
modest sonnet
pallid palm
#

hello all, So i made this Outro Mission ending script that plays after all condistions are met,
and if people are flying a pawnee Chopper, ofcorse they crash,
how do i make all pawnee choppers go into (Auto Hover Mode) while the script is playing

pallid palm
#

cool thx POLPOX

#

i was looking for this but i could not find it thx again

cyan dust
#

Good day. I want to create "Library_WeaponHolder" but I want to prevent any actions with it. Unfortunately even with all the

_holder lockInventory true;
_holder enableSimulation false;
_holder setDamage 1;

It is still available to player to interact with. Is it even possible?

cyan dust
remote cobalt
#

Hey folks,

i am trying to find something out. In the Arma Wiki for the HEMTT it is said that the HEMTT Flatbed is capable of loading HURON Containers as cargo.

But I can't the fuck find out how. It seems I would have to add an addAction in the Editor for this, but I am not sure how I would do this. I can't be the first one trying to look into this. So does anyone know how this works or maybe even can point me to a how to?

Here is the Wiki Page that says that:
https://armedassault.fandom.com/wiki/HEMTT#HEMTT_Flatbed

Armed Assault Wiki

The HEMTT (full name: Heavy Expanded Mobility Tactical Truck) is logistics truck used exclusively by NATO forces in ArmA 3. Roles: Troop transport Munitions transport Cargo transport Ground...

faint burrow
#

Try moving the container on the HEMTT.

remote cobalt
# faint burrow Try moving the container on the HEMTT.

Hey man, yeah true, in the editor this works. But I would like to design a Mission where Players have to resupply different points that need different things. So they would have a storage where they decide what to load on which vehicle and how to organise that. So I would need that to work ingame. and not only in Editor.

remote cobalt
#

I could not imagine that there is no BIS_fnc or script that already does that

remote cobalt
pallid palm
#

you can make anything into a Ammobox

brittle badge
#

i need the creator of EZM pls.

#

im the creator of th e1st zombie warlords in arma 3 and the creator of the arma reforger 2022 Conflict - Early Access.

#

i need some help bc his mod on my server is ya.... extrem weird loadet aso

pallid palm
#

this is what i use to make anything into a AmmoBox

brittle badge
#

and why tf one guy delite all my rolls???

pallid palm
#
_crate = _this select 0;
                        
_Bomb              = 7;
_Ammocount        = 20;
_Nades            = 20;
_MedicAidCount    = 10;
                       
clearMagazineCargoGlobal _crate;
clearWeaponCargoGlobal _crate;
clearItemCargoGlobal _crate;
clearBackpackCargoGlobal _crate;
                                
_crate addMagazineCargoGlobal ["SatchelCharge_Remote_Mag", _Bomb];
_crate addMagazineCargoGlobal ["30Rnd_65x39_caseless_mag_Tracer", _Ammocount];
_crate addMagazineCargoGlobal ["1Rnd_HE_Grenade_shell", _Ammocount];
_crate addMagazineCargoGlobal ["HandGrenade", _Nades];
_crate addItemCargoGlobal ["FirstAidKit", _MedicAidCount];
#

just a small EX

thin fox
#

it's basically attachTo

pallid palm
#

i like useing attachTo its awsome

#

i use attachTo in My fuel transport mission

wheat mica
#

What is general oppinion on the best and most performant way nowdays to repeat periodically certain cleanup action of low priority all the time during mission run? "EachFrame" event handler, or simply spawned code with some pause...or something from CBA events handling functionalities (e.g. waitAndExecute which runs in unscheduled)...or...?

#

Thanks ๐Ÿ™‚

tulip ridge
#

You could use spawn, however if its constantly running it would eat up the allowed time of every other scheduled script, not to mention the other downsides of scheduled.

tender fossil
worldly granite
#

i know this is for scripting but is anyone familiar with host havoc? Im trying to get a server to work with mods and I cant get the server to start do to something called DMNS_Ace_Compat and support is less than reliable

blissful current
#

If you don't need to specifically pass a param in a specific index, what is the best way to "skip it" or "leave it blank"?

For instance, I do not need to write anything in the second index here because the third index is what I need to pass along. This works by leaving the quotes blank but perhaps there is a consensus on what is proper?:
["intro1", "", marcinko] remoteExec ["FoxClub_fnc_Conversation"];

faint burrow
blissful current
#

Params like this can be listed in any order correct? For example, below I could switch the index of _args and _target without any negative effects.
params ["_target", "_caller", "_actionID", "_args"];

granite sky
#

No.

#

The names that you put in there are your choice. The positions are not. If you swapped _args and _target then _args would then be the target object.

tulip ridge
#

If you need to skip something, just use an empty string

hallow mortar
#

params interprets the input in the order it's passed.

[1, 2, 3, 4] params ["_one","_three","_two","_four"];
// _three contains 2, _two contains 3```
When you do `params` with no left argument, it's still doing the same as what I just showed; it automatically uses the autogenerated `_this` variable containing arguments passed to the script. The names still don't matter - the input is still parsed in the order it was given.
If you're generating the input array yourself, by passing your own arguments to your own `spawn` or whatever, then you can switch them around as you like. If the input is being generated by someone else (e.g. EH params, addAction information) then you have no choice but to accept it in the order it's given.
cobalt path
#

Is there a way to make Turrets look certain direction?

#

Like I wanna make a sam look directly up

blissful current
hallow mortar
#

remoteExec is not params.
params has generated the new variables (_target, _caller etc) from its input.
Now that has been done, you're free to use those variables however you like. You don't have to keep them in order wherever you use them - that would make it impossible to use them.

hallow mortar
blissful current
#

_target should be grabbing the variable name of my addaction unit correct?

tulip ridge
#

_target will be whatever the first param passed to it is

hallow mortar
#

No, _target contains a reference to the object the action was attached to (I'm assuming this is all happening in an addAction code scope, anyway). It does not contain the variable name. If you do str _target it will print the variable name* because that's the human-readable result of doing str on an object, but what's actually in the _target variable is an object reference.
* if the object actually has a variable name. If it doesn't, then a string containing some other identifying information like net ID, group ID etc will be generated.

blissful current
#

When I pass _target to my function (as you see third index). I change it to _npc for readability reasons. Doing that should have the addaction unit speak as follows:

private _sound = _npc say3D "answer1";

But the unit of a different addaction speaks not the one I'm trying to pass with _target.

Sorry it's confusing, I know.

#

So I must be passing _target incorrectly. Or just plain dont understand fully what I'm doing. Or both, lol.

hallow mortar
#

It would help to see more of the content of foxclub_fnc_conversation

blissful current
#

I'll post an example. Let me cut out all the extra stuff so it's more readable.

#

Here is my addAction. I want scout to respond to the question. Function to follow...

scout addAction [
    "<t color='#FFFF00'>""So, you're our carson?""</t>", 
    { 
    params ["_target", "_caller", "_actionID", "_args"]; 
    ["question8", _caller, _target] remoteExec ["FoxClub_fnc_Conversation"];
    }, 
    nil, 
    8, 
    false, 
    true, 
    "", 
    "_target != _this", //so scout can't ask himself this question
    4
];
#

In the function _player correctly plays the sound from the player. However sound is not played from _npc which is the same as _target which is the same as scout.

        case "question8": {
        private _sound = _player say3D "question1";
        _player customChat [FOX_DialogueChannel, "Whatโ€™s your story, pal?"];
        ["answer8", _player, Marcinko] spawn FoxClub_fnc_Conversation;
    };

        case "answer8": {
        private _sound = _npc say3D "answer1";
        _npc customChat [FOX_DialogueChannel, "blah blah blah"];
    };
tulip ridge
#

You'd have to show more of your function, that part alone doesn't tell you much

tulip ridge
hallow mortar
#

just post your whole function on pastebin and give us the link

blissful current
#

The function is very long I can't post it all but basically its has _npc as a different addaction previously in the code.

blissful current
tulip ridge
#

A website

#

It's just a thing to copy/paste stuff onto

#

It does have SQF as a language for syntax highlighting, so you should pick that when making it

hallow mortar
#

If you go to #rules and accept them you can also just upload the sqf file here

blissful current
#

I just pasted it. Im try to see how to "share" it.

tulip ridge
#

"Create New Paste" at the bottom, and then copy/paste the url

blissful current
tulip ridge
#

That's not the whole function

blissful current
#

Hmm it didnt work.

#

I used ctrl+a in vscode.

#

and ctrl+v in pastebin

tulip ridge
#

You didn't copy it then

#

You just selected the content, and then pasted whatever you had copied last

blissful current
#

lol I am the worst. Yes

#

Ok it says please wait cause its like 400 lines long or something.

hallow mortar
#

I've got a strong feeling there's a way to optimise it substantially. But we'll get to that after solving this initial issue.

blissful current
#

Its a conversation with like 10 different npcs. its basically the same stuff I posted on here repeated over and over again.

tulip ridge
#

That's why it could probably be optimized

blissful current
#

Eh, its taking too long. Ill just post the .sqf

hallow mortar
#

It's very likely that you have a lot of code that's repeated, when it could be just one set of code that receives different inputs

blissful current
hallow mortar
#

okay, so here's the units you pass into the function: _target and _caller, which become _npc and _player.
But on the first pass through - the Question pass - you don't use _npc (_target). You have instead a hardcoded reference to Marcinko, which is what you then use as _npc for the Answer pass.
My suspicion is that Marcinko is a different unit and not the same one as the original action target.
You need to check what unit Marcinko actually is and what unit you've added this action to.

#

Or replace the hardcoded Marcinko with _npc in the first place.

blissful current
#

Spot on! Okay I need to change:

        ["answer8", _player, Marcinko] spawn FoxClub_fnc_Conversation;

to

        ["answer8", _player, scout] spawn FoxClub_fnc_Conversation;

That way scout says the say3d. I'm embarrassed. I should have spotted that. Thank you both so much for the help!

hallow mortar
#

Well, change it to _npc so it dynamically uses the action target, then you don't need to worry about keeping track of variable names

#

Of course, the real secret to optimisation is going to be that you don't actually need to distinguish between "player" and "npc" at all

blissful current
#

Ohhh I see what you are saying. I don't need the hardcoded unit varible name, Just:

        ["answer8", _player, _npc] spawn FoxClub_fnc_Conversation;
blissful current
tulip ridge
#

You only use one of them at a time though

#

For example in here, in "answer1" you only use _npc.
In "question2" you only use _player.

blissful current
#

I should mention this is for MP too, if that matters.

hallow mortar
blissful current
#

so player isn't always player. That's why I need _caller for the addaction

hallow mortar
tulip ridge
#

With that fixed, you could simplify a lot of your code to not have nearly as much copy/pasted stuff.

Something like:

// fn_speak.sqf
params ["_unit", "_text", "_soundClass"];

private _sound = _unit say3D _soundClass;
_unit customChat [FOX_DialogueChannel, _text];
_unit setRandomLip true;
waitUntil {isNull _sound};
_unit setRandomLip false;

And then in your conversation function:

// fn_conversation.sqf
params ["_convo", "_player", "_npc"];

private _text = "";
private _soundClass = "";
private _speaker = objNull;

switch toLowerANSI _convo do {
    case "intro1": {
        _text = "Good morning gentlemen. There's an arsenal right there if you want to adjust your equipment. I'll be over here if you have any last minute questions.";
        _soundClass = "intro1";
        _speaker = _npc;
    };
    // ...
};

if (_text != "") then {
    [_speaker, _text, _soundClass] call FoxClub_fnc_speak;
};
#

Also as a heads up, those CfgSounds classes should have prefixes (if those are your classes, which I assume they are)

blissful current
#

I had a version of this going last week where I just had _speaker for everything. But the sound would play from only the _npc and not the _caller on questions that had follow-up questions. By separating the _player and _npc it works now. I haven't update my githb. Lemme see what it looked like before.

blissful current
tulip ridge
#

A prefix / tag is just an identifier to make sure you and another mod don't accidentally conflict
Like you have your functions prefixed with FoxClub

blissful current
#

So just rename intro1 to fox_intro1 and it solves the issue?

blissful current
#

Oh I'm trying to understand Darts code. I think I see.

hallow mortar
#

No, I mean you have one piece of code that just works on "the speaker" and does all the message-sending, sound-playing etc., and something else determines who is the speaker to pass to that code

blissful current
#

_unit and _speaker

hallow mortar
#

That way, all the operational code is completely reusable and doesn't need to be repeated

#

I'm writing something to do this in a slightly more in-depth way, I just need to test it

blissful current
#

Oh I think I see what Dart is doing. A functions calls a function. That way it doesnt need to run the whole 400 lines each time the function is called?

hallow mortar
#

Partly, and also those 400 lines are substantially reduced because you don't need to have say3D and customChat etc written out multiple times per dialogue instance - that's all written once in the "speak" function, which then gets called by the dialogue instances.

blissful current
hallow mortar
#

I'm writing something for you to do this

blissful current
thin fox
#

what kind of error is this? (dedi server)

hallow mortar
# blissful current Much appreciated!

Note that this is designed for back-and-forth conversations where the speaker always alternates between two people. Supporting conversations with more than 2 units, or where 2 consecutive messages can come from the same person, is doable but more complicated. (You can sort of do it within this system by using extra single-message conversations run in sequence)

blissful current
#

So this and what Dart wrote and what I wrote do the same thing but mine is inefficient. What's the difference between yours and Darts?

hallow mortar
#

Just slightly different philosophical approaches to the design.
I think I would say Dart's is a bit less efficient because it uses a switch case rather than a hashmap. Maybe a bit less flexible in terms of running a whole conversation off of one input.
I'm not criticising Dart's work though, it's better than what was there before and it's similar to things I've used in the past too. It would be a reasonable way to do it.

hallow mortar
blissful current
#

Ah okay, so it's the minutia that I can't see since I'm so new. Either way is excellent.

blissful current
#

Okay so most of this goes over my head. But I kinda see how I might plug and play some of this. What is the sleep needed for?

hallow mortar
#

It's just presentation timing. You can adjust it as you like to find a natural pace between dialogue lines.

#

The value could also be baked into the conversation data instead of a universal constant, if you need to have different delays between some lines

blissful current
hallow mortar
hallow mortar
#
["keyword reference",[_speakerUnit0, _speakerUnit1, _speakerUnit2]] remoteExec ["foxclub_fnc_conversation"];```
This is the activation code (with placeholder arguments, obviously). As long as `"keyword reference"` is one of the key strings in `foxclub_var_conversations`, and as long as the array of speaker units contains however many units are needed for the conversation in question, it doesn't matter where the activation originated. If your conversation only uses speaker `0`, then you only need to provide one speaker unit.
blissful current
hallow mortar
#

Make sure only one machine is sending the remoteExec

blissful current
#

Well default is 0 which IIRC means it gets sent to all clients and the server. If that's what you mean then I need to be more specific on which client it goes to?

hallow mortar
#

No, sending to all clients is fine (assuming you want everyone to see it). You just need to be sure that the broadcast is only sent by one machine. Otherwise it will be duplicated.

blissful current
#

Gotcha. Yes I place the remoteExec in a server only trigger usually.

hallow mortar
#

In addAction code you can be sure of this, because addAction code only runs on the machine that activated the action. Other contexts can be less controlled.

blissful current
#

This is custom chat. I am using %UNIT_NAME to show the "speaker". What I like better about sidechat though is that in MP it shows the Group Name and the user. Is there a way to do this for customChat? I would prefer it to look like sidechat: Group Name (MP Usersname)

hallow mortar
blissful current
#

I was just about to link that but I dont see one that has BOTH. Perhaps I could nest one inside of the other within the index?

hallow mortar
#

Ever used format before?

blissful current
#

No sir

hallow mortar
#

Well, I was going to say it works the same way, but now that's not going to help :)

blissful current
#

No worries. If it's advanced it's just a small nitpick. I can come around to it later.

hallow mortar
#

Things like %UNIT_NAME are special wildcards you can use, but the string you end up with doesn't have to be just one of them

#

or any of them, for that matter

blissful current
#

"%UNIT_GRP_NAME (%UNIT_NAME)"

#

Something tells me that wont work though

hallow mortar
#

I think you should try it

blissful current
#

Here goes nothing

#

LOL, it worked! The one idea I've ever had that actually worked. Ima go buy a lottery ticket today.

blissful current
#

I am trying to mimic what happens IRL when someone speaks on a radio next to someone with a radio. If the person is close enough they will hear their voice and their voice on the radio at the same time. So I have this:

private _sound = _player say3D "wait1";
private _sound2 = playsound "wait1";

They both play the same sound file. But there seems to be a little offset when the audio files are played so it breaks immersion.

hallow mortar
#

Depending on how big the offset is (and how reliably it happens) you might be able to use a very small sleep between the commands to correct for it.

blissful current
#

Whats the lowest a sleep can go? Like .01?

hallow mortar
#

Depends on frame rate, technically. sleep will always suspend until at least the next frame. So at low frame rates, the minimum is higher.

#

At 30 FPS the effective minimum suspension should be 0.03s

old owl
#

Is this the most efficient way to set hashmap data that is being broadcast as public?

// Assuming "hashmap" is set as a public object variable
private _objectData = _object getVariable ["hashmap", createHashmap];
_objectData set ["key", 10];
_object setVariable ["hashmap", _objectData, true];
#

Looks like the set command doesn't have a parameter to set it public there

stable dune
old owl
# stable dune Where do you use it and how.

Currently we have likely a few thousand objects across the map of which are unique to players and stores their data. Previously that data was stored as individual public variables. With recent JIP changes though we want to cut down and reduce our usage of those dozen variables we have on each object and combine them instead. Since some of them may also be nil at a given time, I figured a hashmap would be more appropriate in terms of storing data opposed to something like an array where a part of it's length many not exist.

remote cobalt
#

Hey folks,

I am trying to add an addAction to all Boxes that can be loaded into a vehicle via ViV.

I thought about doing this with an Event Handler in the initServer.sqf.


["ReammoBox_F", "init", {

_this addAction
[
    "Load into Vehicle",
    {
        params ["_target", "_caller", "_actionId", "_arguments"];
        
        _vehiclesArr = nearestObjects [_target, ["Car", "Plane", "Helicopter"], 50];
        _vehicle = _vehiclesArr # 0;

        if (! vehicleCargoEnabled _vehicle ) exitWith {
            hint "Vehicle cannot transport cargo";
        };
        
        _check = _vehicle canVehicleCargo _target;
        
        if (_check isEqualTo [true,true]) then {
            _vehicle setVehicleCargo _target;
        }
        else {
            if (_check select 1) then {
                hint "Vehicle has not enough free space for cargo.";
            }
            else {
                hint "Cargo is to large for this vehicle.";
            };
        };
    },
    nil,
    99,
    true,
    true,
    "",
    "isNull (isVehicleCargo _target) && nearestObjects [_target, ['Car', 'Plane', 'Helicopter'], 50] isNotEqualTo [];",
    50,
    false,
    "",
    ""
];


}, true, [], true] call CBA_fnc_addClassEventHandler;

But I get the following Error Message in the Log and can't really wrap my head around it:

0:05:40 Error in expression <r.sqf"
["ReammoBox_F", "init", {

_this addAction
[
"Load into Vehicle",
{
param>
 0:05:40   Error position: <addAction
[
"Load into Vehicle",
{
param>
 0:05:40   Error addaction: Type Array, expected Object

Can anyone help me with that?

old owl
#

Hehehe

#

I could be wrong because I just glanced but could it be because you are attaching the addAction to _this instead of this?

#

@remote cobalt sorry forgot to tag ๐Ÿ™‚

remote cobalt
#

I should mention: The addAction is testet. Added it manually to objects in the init and worked fine.

old owl
#

My bad appears you also have that within the event handler too so I would imagine _this would make more sense provided the object is being passed as an argument.

hallow mortar
#

_this contains an array. This array only contains one element, the object in question, but it's still an array. You should use _this select 0.

old owl
hallow mortar
#

Well, it's an init EH, at that moment there's nothing else useful to pass.

remote cobalt
old owl
hallow mortar
remote cobalt
bitter palm
#

Hello maybe you can help me and I'm trying to code, I think that's the easiest way

the map Kandahar province has a black sky i want to get rid of it, the problem is i used hindukush black sky patch as a guide i renamed the pbo's and i changed the config, everything the map name but it still doesn't work

west grove
#

am i stupid or is there no easy way to get the current state of a planes landing gear? like, if it's up or down

#

guess i have to use the EH. hm. but maybe better that way

warm hedge
#

vehicle player animationSourcePhase "gear"

west grove
#

welp, so simple

#

thanks

oblique lagoon
#

Hello, I would like to detonate disconnected RC-40 Drone with below code. I will server exec the code but I'm worried because the isUAVConnected command works for local terminal. In that case dedicated server cannot detect if some uav is disconnected or not.

addMissionEventHandler ["EntityCreated", {    
    params ["_entity"];   
    if ((typeOf _entity) isKindOf "UAV_RC40_Base_RF") then {   
        [_entity] spawn {   
            params ["_rc40"];   
            while {isUAVConnected _rc40} do {  
                sleep 1;    
            };
            // Use native "Detonate"
            _rc40 forceWeaponFire [weaponState _rc40 select 1, weaponState _rc40 select 2];
        };   
    };    
}];
meager granite
#

I think UAVControl could work

oblique lagoon
#

oO

#

Why did I miss that command

#

๐Ÿซก

meager granite
#

I have no idea how RC-40 drone works, I guess you want something like this:

addMissionEventHandler ["EntityCreated", {    
    params ["_entity"];   
    if (_entity isKindOf "UAV_RC40_Base_RF") then {   
        [_entity] spawn {   
            params ["_rc40"];
            waitUntil {sleep 0.1; !isNull(UAVControl _rc40 select 0)}; // Wait until somebody connects the first time
            waitUntil {sleep 0.1; isNull(UAVControl _rc40 select 0)}; // Wait until they disconnect
            // Use native "Detonate"
            _rc40 forceWeaponFire [weaponState _rc40 select 1, weaponState _rc40 select 2];
        };   
    };    
}];
oblique lagoon
#

I guess it automatically connect after spawn

meager granite
#

Its that underbarrel launched drone, right?

oblique lagoon
#

yes

meager granite
#

I don't know how its done exactly, I guess there is connection on Fired event but who knows what happens and how many frames of delay there is, so I added the check just in case

oblique lagoon
#

You might be correct

meager granite
#

Also I don't know drops your current connection to connect to new drone

#

In case you were connected to something else

warm hedge
#

IIRC lxRF_fnc_RC40 has detonation mode too

#

I'll check soon

oblique lagoon
#

I thought that forceweaponfire command can trigger it.

warm hedge
#

That is not how it works

oblique lagoon
#

The problem is...

addMissionEventHandler ["EntityCreated", {    
    params ["_entity"];   
    if ((typeOf _entity) isKindOf "UAV_RC40_Base_RF") then {   
        [_entity] spawn {  
            params ["_rc40"];   
            systemChat str _rc40; // THIS DOES NOT WORK!
            while {!isNull ((UAVControl _rc40)#0)} do {  
                sleep 1;    
            };
            _rc40 forceWeaponFire [weaponState _rc40 select 1, weaponState _rc40 select 2];
        };   
    };    
}];
#

Even the systemchat in spawn does not work even in editor

#

Since I can debug it with local exec for now..

meager granite
#

Add it earlier before isKindOf check to see if its the problem

oblique lagoon
#

it works fine. I checked it.

#

Maybe I messed up with params?

#

it is in []

meager granite
#

No, it looks proper

#

Add diag_log at each step to see whats going on

oblique lagoon
#

My rpt file is full of mess. I'm doing it in liberation

meager granite
#

add some long string to ctrl+f it

oblique lagoon
#

good idea

meager granite
#
diag_log [1, "FUUUUUUUUUUUUUUUUUUUUUUCK", _entity];
...
diag_log [2, "FUUUUUUUUUUUUUUUUUUUUUUCK", _entity];
oblique lagoon
#

lel

#

seems like its working

#

thank you. But as POLPOX said it detonates only with setdamage for now.

warm hedge
#
[rc40,"Explode"] call lxRF_fnc_RC40```
oblique lagoon
#

I'll try that

#

Works great

west grove
#

well, now i'm happy we didn't do that gl pistol

real tartan
#

is there an alternative for createVehicleCrew for filling up cargo with soldiers?

meager granite
#

Its easy with fullCrew [vehicle, type, includeEmpty]

#

can get typicalCargo class too

#

or use needed one

bitter palm
#

Hello maybe you can help me and I'm trying to code, I think that's the easiest way

the map Kandahar province has a black sky i want to get rid of it, the problem is i used hindukush black sky patch as a guide i renamed the pbo's and i changed the config, everything the map name but it still doesn't work

bold rivet
#

I wanted to give the blackfoot the weapons of a AH-64 helicopter. It all worked fine but i want to set the fire rate of the GMG higher and want to lower the reload time between each 200rnd mag. But i cant figure out how to use the setWeaponReloadingTime command. Someone knows how to change fire rate and magazin reloading time?
here is the code if it helps:

this removeWeaponTurret ["gatling_20mm", [0]];
this removeMagazinesTurret ["1000Rnd_20mm_shells", [0]];
this addWeaponTurret ["GMG_20mm", [0]];
this addmagazineturret ["200Rnd_20mm_G_belt" , [0]];
this addmagazineturret ["200Rnd_20mm_G_belt" , [0]];
this addmagazineturret ["200Rnd_20mm_G_belt" , [0]];
this addmagazineturret ["200Rnd_20mm_G_belt" , [0]];
this addmagazineturret ["200Rnd_20mm_G_belt" , [0]];
this addmagazineturret ["200Rnd_20mm_G_belt" , [0]];

this removeWeaponTurret ["missiles_DAGR", [0]];
this removeMagazinesTurret ["24Rnd_PG_missiles", [0]];
this addWeaponTurret ["missiles_DAR", [-1]];
this addmagazineturret ["24Rnd_missiles" , [-1]];
this addmagazineturret ["24Rnd_missiles" , [-1]];

this removeWeaponTurret ["missiles_ASRAAM", [0]];
this addWeaponTurret ["missiles_ASRAAM", [-1]];
this addmagazineturret ["2Rnd_AAA_missiles" , [-1]];

this addWeaponTurret ["missiles_SCALPEL", [0]];
this addmagazineturret ["8Rnd_LG_scalpel" , [0]];

#

I tried using the command like that but it didnt work so far: this setWeaponReloadingTime [gunner this, "GMG_20mm", 0];

warm hedge
#

Literally the example there can help you

bold rivet
#

so far i tried
this setWeaponReloadingTime [gunner this, gunner this, 0];
this setWeaponReloadingTime [gunner this, "GMG_20mm", 0];
this setWeaponReloadingTime [gunner, "GMG_20mm", 0];
this setWeaponReloadingTime [(gunner), "GMG_20mm", 0];
this setWeaponReloadingTime [0, "GMG_20mm", 0];
this setWeaponReloadingTime [0, 1, 0];
this setWeaponReloadingTime [this, "GMG_20mm", 0];

but none of em work

warm hedge
#

?

west grove
#

wouldn't it be easier to just make a new config for the helicopter

bold rivet
#

i want it in the init box so i can spawn it in pub zeus

#

nvm i found some random code on redit that seems to work

thick hatch
#

Hello, I've been making a mission for a while now that includes some vehicle compositions. A part of one of these compositions is a vehicle with a spotlight I added through scripting, which can be turned on through an action. This spotlight uses a basic 'addAction' in order to do this, with the argument/script vaguely like;

centaur addAction [  
  "Floodlight", {  
    if (lightIsOn source == "ON") then {  
      source switchLight "OFF"  
    }  
    else {  
      source switchLight "ON"   
    }  
  },  
  nil,  
  1.5,  
  true,  
  true,  
  "headlights",  
  "player in centaur",  
  50,  
  false,  
  "",  
  ""  
]; 

Now my problem; The script works, but ONLY for the client that activates thw action. for anyone who isn't the client. no light turns on. Does anyone know why??

Thank you!

warm hedge
#

switchLight is a local effect command

#

Try remoteExec it

thick hatch
#

So, move the whole command within a remoteExec string?

warm hedge
#

Don't know whole command mean here but I guess yes

thick hatch
#

All good, thank you. I'll look into seeing how to do that

tardy osprey
#

why the fuck does Orbat have to be so fucking difficult

#

It keeps giving me the Error of Class Not found, and now theres several units that does not show up on the map. You could keep it simple and just have "HQ" and then a couple of squads or whatever, but if i wanted to have Companies and then Platoon, it has a stroke and dies

hallow mortar
#

Impossible to diagnose without seeing the code

tardy osprey
#

2 seconds then

#

I assume the problem comes with the way i've done the "};" I just cannot decipher what causes the issue, as i've tried multiple ways of ending it

thick hatch
#

Back to report it did not work

#

I just decided to make it easy and keep the light on always

hallow mortar
#

Can you tell me the exact and full error it gives you?

thick hatch
#

Anyway! Another fun question for anyone who may be able to help me; In the same vehicle, I have actions to switch from the vehicle into turrets placed on top. Although I have discovered through testing that in multiplayer, only the driver can switch to the turret, and if someone is in the driver when you switch back to the vehicle FROM the turret, you get ejected. Any suggestions?

centaur addAction [    
  "Move to Gunner", {     
    moveout player; player moveInGunner bolter     
  }, nil, 1.5, true, true, "", "player in centaur"   
];


bolter addAction [    
  "Leave Gunner", {     
    moveout player; player moveInAny centaur;     
  }, nil, 1.5, true, true, "", "player in bolter"   
];
tardy osprey
#

This is the only Errors i get, the Debug thing doesnt really elaborate or anything.

#

This is current view of Orbat, I want the Platoons in A-company to be parallel to each other. The Map only shows CSAT, Air, HQ, and oddly enough the 1st Platoon under the A-Comp.

#

(Map example)

#

Two seconds, i may have found the issue, there was no ">>" between Acom, and Pla3 on the eden module

faint burrow
tardy osprey
# hallow mortar That'd do it

Okay, well its not done yet, but it works now. The reason Acom did not show up on the map but it did in Orbat, was because of a spelling error... ๐Ÿ˜

hallow mortar
#

It's a classic

tardy osprey
hallow mortar
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
tardy osprey
#

ah, i see

hallow mortar
#

Note that that example uses sqf for...SQF syntax. Config, like in cfgOrbat, is not actually SQF. It's closer to C++, so use cpp to get more useful highlighting when posting config.

tardy osprey
#

I see, cheers mate.

thick hatch
hallow mortar
#

About indentation as I mentioned before, the trick is to have the opening { and closing } of any class (or code scope) be at the same level of indentation. You should be able to trace a straight vertical line between any matching pair. Getting it right makes a big difference to how easy it is to read.
Here's your CfgOrbat with the indentation fixed:
* works if you open it in a text editor, Discord lets you down as usual

thick hatch
#

The script works whenever no-one is in the drivers seat other than the player moving

tardy osprey
faint burrow
# thick hatch - I wrote `moveInGunner bolter`, 'bolter' being the object - As you can see, I w...

I wrote moveInGunner bolter, 'bolter' being the object
And? bolter isn't local for you, but is local for driver: https://community.bistudio.com/wiki/Multiplayer_Scripting#General_information_about_locality

As you can see, I wrote after that moveInAny centaur, 'centaur' being the vehicle
As you might guess, moveout moves a unit out of the vehicle. Then yes, you move a unit in the vehicle using moveInAny.

thick hatch
#

The bolter shouldn't be local to anyone when executing the action moveInGunner bolter, because it is empty.

As for the second point, I don't get how this helps? I am asking why the command does not work only when someone is in the driver's seat of the vehicle I am moving into

tardy osprey
hallow mortar
#

& is a special character and it's getting confused

#

try using &amp; instead

tardy osprey
#

The & unfortunately does not work. But i'll just write "and" instead. Nvm, i'm just thicc and forgot to save the txt files.

faint burrow
thick hatch
#

Okay, so how do I bypass this locality?

thick hatch
#

Right so I have to remoteExec it

#

Thank you

hallow mortar
#

About limits, I have no idea what the limit is for the ORBAT viewer, if there is one. There is a limit on string size in general, so presumably that's the absolute maximum.

#

I think the string limit is 10,000,000 characters. Hopefully you won't need to exceed that.

tardy osprey
thick hatch
#

Okay can someone quickly ELI5 why something like, attachTo doesn't need to use remoteExec in MP but moveInAny does? Specifically when the machine executing the command is just trying to leave or enter someone else's 'local' vehicle?

hallow mortar
#

It's just the way the different commands work in the engine.

faint burrow
hallow mortar
#

There's not really a "why" that we can understand (because we can't see the source code), it's just how BI has decided the system works.

thick hatch
#

So if I remoteExec just to the server, will what I'm trying to achieve work? (To anyone's best estimate)

faint burrow
#

Not always.

thick hatch
#

Hmm ok

hallow mortar
#

Try using the vehicle object as the remoteExec target.

granite sky
#

moveInAny claims to be global-argument...

thick hatch
granite sky
#

Which is different from the other moveInXXX commands. Not sure if true. I gave up on moveInAny a while back due to other bugs.

hallow mortar
thick hatch
#

I thought it's supposed to be a number?

hallow mortar
#

Numbers are one option out of many.

granite sky
#

The other moveInXXX commands are unit-local, not vehicle-local, IIRC.

thick hatch
#

So say, moveInPassenger (if that exists) wouldn't encounter this problem?

hallow mortar
#

Maybeโ„ข

hallow mortar
thick hatch
#

I guess I'll try things when I get up. Thanks everyone for slowing down to get me to understand.

hallow mortar
#

If remoteExec with the vehicle as target doesn't work, try doing it with the unit as target instead.
Can't hurt to try all the options ๐Ÿคท

granite sky
#

moveInCargo says:

The command should execute where the unit (not vehicle) is local.

bitter palm
#

The Arma 3 Config thread cant help me.
Maybe you can

#

Kandahar province Config

fair drum
bitter palm
#

Yes but They answer Not, it is ONLY a Config more Not

#

They are pro i am a beginner

#

And it would be cool if you could learn something from the pros

fair drum
#

its not only a config. everything you are listing is within the config when making a terrain. and sometimes, the pros don't have an answer.

#

maybe check out the PMC terrain making wiki

#

maybe there is an answer in there

sharp grotto
#

Any way to block the ejecting from a vehicle if you press double V via scripts or a mod ? ๐Ÿค”
onkeyDown + onKeyUp EH's do the job

thick hatch
#

wait - I may have figured it out, be right back

#

AAAAA okay so I'm getting this error

#
truck addAction [   
  "Move to MultiLas", {
    remoteExec [
      player moveInGunner laz2, truck
    ]   
  }, nil, 1.5, true, true, "", "player in truck"
]; 

But I don't see what's wrong with this

hallow mortar
#

remoteExec works like this:

_leftArgument command _rightArgument;
// --->
[_leftArgument, _rightArgument] remoteExec ["command"];```
#

So:

player moveInGunner _vehicle;
// --->
[player, _vehicle] remoteExec ["moveInGunner"];```
thick hatch
#

oh my god I think I'm getting how to reformat it for the first time

#

๐Ÿซถ

#

no error at least but also now it just does nothing

#

could I replace "player" with "caller"?

#

nevermind, seems not

hallow mortar
#

If you want to use the provided action information like _caller, you have to extract it from the autogenerated _this variable, using select or params

thick hatch
#

how do I target just the person who uses the action?

hallow mortar
#

Action code is only executed on the machine that activated the action. So if that's who you want to target, don't use remoteExec.

thick hatch
#

I can't because then it doesn't work when another person is in the vehicle ๐Ÿ˜ญ

hallow mortar
#

Well, using remoteExec to only target the caller won't help with that, because it's the same as not using remoteExec, just with an extra step

thick hatch
#

I feel guilty at this point for just pasting code and asking if it's correct, but that's what I'm doing right now...

truck addAction [    
  "Move to MultiLas", { 
    [player, laz2] remoteExec [ 
      "moveInGunner" , 0 
    ]    
  }, nil, 1.5, true, true, "", "player in truck" 
]; 
#

Does this not work because if I use "player" with remote exec, that targets every person on the server?

hallow mortar
#

That's functional code, though breaking up the remoteExec onto different lines like that is a bit weird.

hallow mortar
thick hatch
#

Okay so do you mind re-explaining what the other person tried to explain to me last night then? I'm obviously not getting something

hallow mortar
#

I'm not completely sure what they were getting at, to be perfectly honest.

#

Okay, so one issue you might have here is that moveInGunner requires the unit to not be in a vehicle to begin with. You must move them out of their original vehicle before moveInGunner will work. Your current action doesn't do that.

thick hatch
#

I feel like I shouldn't have to frick* with remoteExec right now to be honest, what that guy said before seems wrong (if it isn't then I deserve this but yeah)

#

I didn't say frick first time but the server didn't like it

hallow mortar
#

When it comes to putting this into action for real, you might want to make the unit invincible before moving it out. Just in case of unforeseen consequences. But don't worry about that for now, it's not the main issue.

thick hatch
#

OKAY so the moveout fixed it, thanks. I removed it when starting this f*ckfest this morning, forgetting I needed it

#

I'll have to grab a poor soul today to test it in multiplayer before I find out if it works

thick hatch
# hallow mortar When it comes to putting this into action for real, you might want to make the u...

I'm baaaacck :P

Unfortunately, still an issue
SO the action works as intended if the person using it is in the driver's seat, or the only person in the vehicle.
BUT if you are a passenger and another player is in the driver's seat, using it will just kick you out of the vehicle but not move you to the turret.

I propose that the problem is not to do with the local and server gunk that was proposed originally; could it actually be that the first command to move the player out, then stops the second command from working because one of the conditions of the action is '_player in _object'

#

This still leaves the question; why does it work still for me in SP when I test it?

hallow mortar
#

No, it can't be that.
The condition is only for the action to be displayed and interactable. Once the action code is actually started, the condition has no effect on it.

thick hatch
#

Ok scratch that then; could it maybe be then that since the player is out of the vehicle for a split second, and the command was executed locally, that the command has no effect on the player?

hallow mortar
#

The player is always* local to themselves. The command was executed locally, so the command was executed where the player is local.
I see two potential options**:

  • you may need to introduce a (very tiny) delay between moving out and moving in. Trying to do both on the same frame may lead to a contradiction when you consider network delays.
  • the command's alleged locality requirements may not be entirely true, meaning you may need to actually execute the command where the target turret is local, or possibly even where the target turret is local and where the player is local.

* there are actually some edge cases where this is not true, but these occur during mission loading so they're not relevant.
** doesn't mean there aren't other options that I'm too stupid to see

thick hatch
#

So does that mean I'd have to do a spawn command to be able to use sleep?

hallow mortar
#

Yes

thick hatch
#

Easy, I'll try it, thanks!

#

PS; added you because you seem cool, if you would rather not idc/idm

thick hatch
# hallow mortar Yes

All works! the sleep did it. I don't know why but the moving back to the vehicle works as well now, even though I didn't touch that code. Thanks again

#

I kind of suspect that rather than the sleep, the spawn {} actually fixed it, but I can't say why

hallow mortar
#

All the spawn does is move from the Unscheduled environment (code happens immediately and nothing else happens until it's done) to the Scheduled environment (there is a per-frame limit on how much time scheduled code can take up, and anything that exceeds that will be delayed; also deliberate delaying is now allowed). This code is very small, so that change shouldn't make any difference on its own ๐Ÿค”

thick hatch
#

f*ck me dead, I have zero clue why these all work now. All I can do now is just be happy about it, so thanks again lmao

pallid palm
#

hello ummm How do i get the script,,, to exit,, when a condition is true

#

i tryed,, BrackOut "Main" and exitwith and it still dont Exit

tulip ridge
#

You can also just return nil, i.e. exitWith {};

pallid palm
#

so this dont work ?

#
if ( ((getPosASL Helo2) select 2 > 9) && ((getPosATL Helo2) select 2 > 9) && Alive Helo2 && CanMove Helo2 && Alive Pilot2 ) ExitWith
{
    "Pilot:  BlackHawk  IN Flight  Wait One" remoteExec ["systemChat"];
};
#

how would i make this work ?

tulip ridge
#

What would make that not work?

#

The capitlization is weird, but otherwise looks fine

pallid palm
#

it just dont exit the script

tulip ridge
#

Then the condition returns false

#

Also just get the position once and check it then

pallid palm
#

hmmm it does hmm

tulip ridge
#

Oh nevermind, ATL and ASL

pallid palm
#

yes

#

maybe its because the CAps

tulip ridge
#

SQF commands / variables are case-insensitive

pallid palm
#

oh ok

tulip ridge
#

ExitWith is the same as exitwith and exitWith

pallid palm
#

ok

#

hmmm'

tulip ridge
#

It's camelCase by convention though

pallid palm
#

wounder why that dont exit the script then

tulip ridge
#

Show more of your script

pallid palm
#

um ok

tulip ridge
#

exitWith exits the current scope, which isn't always the script itself

pallid palm
#

oh so its just exiting the current line ?

tulip ridge
#

No, if isn't a new scope

You could simplify that code quite a bit, and definitely cut down on indentation

#

Like instead of wrapping the whole thing in a if (hasInterface) you can just do:

if (!hasInterface) exitWith {};
pallid palm
#

hmmm ok

tulip ridge
#

That wouldn't be your issue though

pallid palm
#

ah i had that but i changed it lol

#

ok ill try to cut it down ok

#

its for a DED server

#

and this part i run on the client

#

or that part

#

exitWith exits the current scope, which isn't always the script itself

#

so this is my issue right

tulip ridge
#

Seemingly, you could do something like this to test it though:

private _condition = ((getPosASL Helo2) select 2 > 9) && ((getPosATL Helo2) select 2 > 9) && Alive Helo2 && CanMove Helo2 && Alive Pilot2;

systemChat str _condition;
if (_condition) exitWith {
    "Pilot:  BlackHawk  IN Flight  Wait One" remoteExec ["systemChat"];
};
pallid palm
#

ahhh ok i see

tulip ridge
#

Oh also that line where you just have Exit; doesn't do anything

It's a holdover from SQS scripts, and does nothing in SQF

pallid palm
#

ahh ok nice i see thx m8 awsome

#

really cool friend thx alot

#

thats awsome

#

ill delete that crap up there i made lol

pallid palm
#

@tulip ridge woohoo hell yeah it worked thx mate woohoo Arma 3 yeah

#

worked like a charm love you man

#

where would i be with out you guys

tulip ridge
#

Still some other things that could be improved / updated

Here's a bunch of changes I made, with some comments explaining them

#

If something doesn't make sense, ask away

pallid palm
#

ok mate thx

#

wow awsome i see totaly awsome thx you so much

#

i understand it

#

really great work m8

tulip ridge
#

If you don't need the exact clicked position on every machine, you could also just replace:

missionNamespace setVariable ["TAG_mapPosition", _pos, true];

With just:

TAG_mapPosition = _pos;

So that it's not synced over the network

#

Since logically, the marker would also be at the position they clicked at on all clients anyway

pallid palm
#

roger

#

i see ok awsome

tulip ridge
#

Oh that mapPosition = nil bit on Line 12 can be deleted, I missed it

pallid palm
#

ok

#

super cool m8

#

i did as u say

#

holy cow m8 thats great work

#

your awsome

#

you just made my day friend

#

now im super happyer then i was before

#

cuz of you

tulip ridge
#

Nice, glad it's all working for ya

pallid palm
#

it is works great

#

thx you so much for your help

#

holy cow thats an awsome script, thx to you @tulip ridge

#

and you are correct , i did want, ||=and or there thx again friend

#

and you did that so fast too god your awsome

pallid palm
#

what a great guy you are Dart, it works so good its just awsome

#

i love man lol

pallid palm
#

oh and btw @tulip ridge im going to tell How Awsome you are in my Script;

flint topaz
tulip ridge
flint topaz
#

I was just reading your comments, but then realised you likely took them out while debugging

pallid palm
#

hello Dart i have another ?,,, if i click on land close to sure line how can i make the Helo2 find a safe pos on land somewhere

#

btw the script works perfect

tulip ridge
pallid palm
#

ok cool thx

tender fossil
#

It does sometimes things like in the pic ๐Ÿ˜„ But it's still useful

pallid palm
#

hmmmm

#

oh yes i used this before ok

#

this find safe pos stuff

#

cool thx Dart

tulip ridge
pallid palm
#

yes i used this for placement of soldiers

#

works good

#
 _spawnPos = [_pos, 50, (RANDOM 360)] call BIS_fnc_relPos;
 _spawnPos = [_spawnPos, 10, 20, 3, 0, 1.0, 0] call BIS_fnc_findSafePos;
#

yes Dart My Chopper script works so great after you helped me thx again so much

#

you must be a pro scripter

#

ok friends im off to eat ill bb soon Arma 3 woohoo Hell yeah !!!

teal drum
#

Did the commands for increasing uniforms' max load break/change behavior after 2.18?

thick hatch
#

Good morning, I am trying to animate a spaceship flying 'out of warp speed' above a map using setVelocityTransformation. Unfortunately, even after a night of reading too much mathematics I can't figure out why it won't work. Currently, I have this code:

ship setVelocityTransformation [ 
 [ 
  1787,-2031, 1000 
 ], [ 
  1787, 835, 1000 
 ], [ 
  0, 3000, 0 
 ], [ 
  0, 0, 0 
 ], [ 
  0, -1, 0 
 ], [ 
  0, -1, 0 
 ], [ 
  0, 0, 1 
 ], [ 
  0, 0, 1 
 ], [ 
  0,0,0.5 
 ], 1 
];

And am getting this error:

#

I am lost for reasons as to why this keeps on popping up. Any suggestions?

granite sky
#

You have nine vectors there. There's only eight before interval.

#

Was the last one supposed to be customCenter? Because that goes after interval.

thick hatch
#

x_x

#

Ooone second...

vapid scarab
#

Can and how do I include a composition in a addon?

thick hatch
granite sky
#

I think you may be completely misunderstanding what setVelocityTransformation does.

thick hatch
#

It still just goes to the end

#

I think maybe....

granite sky
#

For continuous movement this command should be executed each frame while changing the interval value.

thick hatch
#

So is this not a scripted way to keyframe then?

#

okay, I'll try that

granite sky
#

If you call it with interval 0, it'll use all the "start" values. If you call it with 1, it'll use the "end" values. If you call it with 0.5 then you'll get an interpolation.

#

It's pretty difficult to implement correctly.

thick hatch
#

ah. I understand

#

I'll try my best if I can take some of your time for questions

thick hatch
#

so within the spawn would be the setVelocityTranslation and sleep, plus some type of looping command?

#

the things that are past my expertise is how to tell the code when to change the interpolation, and when to end the loop

#

Okay so could someone tell me why this code upsets the game? I thought I could use %1 as a number?

0 spawn{ 
[10] call BIS_fnc_countdown; 
While {[true] call BIS_fnc_countdown} do { 
ship setVelocityTransformation [  
 [  
  1787,-2031, 1000  
 ], [  
  1787, 835, 1000  
 ], [  
  0, 200, 0  
 ], [  
  0, 0, 0  
 ], [  
  0, -1, 0  
 ], [  
  0, -1, 0  
 ], [  
  0, 0, 1  
 ], [  
  0, 0, 1  
 ], %1 
]; 
sleep 0.01}}
faint burrow
#

I thought I could use %1 as a number?
But you can't.

thick hatch
#

Apparently "%1" counts as one

#

still doesn't fix why I don't understand this though

faint burrow
#

Because you should provide a number, %1 isn't a number.

thick hatch
#

Doo you have any suggestions on how to fix the code to do as intended?

faint burrow
#

Try this:

[] spawn { 
    for "_i" from 0 to 1 step 0.01 do { 
        ship setVelocityTransformation [..., _i];

        sleep 0.01;
    };
};
thick hatch
#

Thank you! I had to step away but I will as soon as I get back. I knew there had to be a way to dictate progressing a number from A to B but just couldn't find the right documentation. You are a saviour.

pallid palm
#

hello Schatten how are you friend,,, love having you around

faint burrow
#

I'm good, thanks. Hope you're good too.

pallid palm
#

oh yes completely good Dart helpped me with my chopper script and it works awsome

#

i love you guys you guys are pros

#

you guys are important to the operations of my missions

#

thx you guys so much

#

i really can't thx you guys enough

faint burrow
#

You're welcome.