#arma3_scripting

1 messages ยท Page 147 of 1

sleek galleon
#

That worked ! ๐Ÿ‘

hallow mortar
#

https://community.bistudio.com/wiki/Variables#Scopes
Variables starting with _ only exist within the current script scope. Variables without it are global variables that are available to any script on the current machine.
Local scope variables are usually preferable because you can have many with the same name at the same time, each specific to an instance of their particular script, without conflicts.

sleek galleon
#

I see

#

So for instance if I were to execute my script twice, I wouldn't have to rename the 2nd cargo to Cargo2 for instance

meager granite
#

Is there no way to script custom attribute in 3DEN without an addon?

meager granite
#

Doesn't work with undefined custom attributes

#

You can't seem to set any attribute you want

fleet sand
meager granite
#

Sucks big time

fleet sand
meager granite
#

I want to save a value associated with an object in mission.sqm

#

Its needed within 3DEN but it needs to be saved and loaded

fleet sand
meager granite
#

I need that for a tool that is fine being a single file script

#

Setting up a mod, having to run it each time you open that mission, etc. etc.

#

Don't want to deal with that

fleet sand
meager granite
meager granite
#

Made it parse init field so I can get scale value and apply it within 3DEN to preview the scale

#

No mods life aviator

#
// Params: Entity
// Returns: Number / Nil
editor_getScaleFromInit = {
    private _regex = _this get3DENAttribute "init" select 0 regexFind ["this\s+setObjectScale\s+([0-9.]+)"];
    if(count _regex > 0 && {count(_regex select 0) > 1}) exitWith {
        private _scale = parseNumber(_regex select 0 select 1 select 0);
        if(_scale <= 0) then {_scale = 1;};
        _scale;
    };
};
```in case anybody will need it
tight cosmos
#

Does anyone know if there is a script to add all the items in the game into an ammo cache/box etc. I know about virtual arsenals already but i actually want a box that just has all the items in the inventory, and yes i know this is a weird request.

fair drum
meager granite
meager granite
fair drum
tight cosmos
fair drum
#

you're probably at the level where we need to write it for you

tight cosmos
#

yes probably

fair drum
#

but if you want to try in the mean time, you use configClasses

#

and you are aware, that if you don't change the storage capacity of a crate, that no one will be able to put items back into it because all items in the game will overload it. meaning as people take stuff out that they dont want, you end up with a huge stack of objects on the ground

tight cosmos
#

yeah i understand that but im in a singleplayer game rn

#

to make more sense to you im playin g antistasi and want to add ammo and backpacks etc to my loot

fair drum
#

oh... ok

#

well thats easier since you really are just using the To Crate option after you add them

tight cosmos
#

yeah

#

i just dont want to add like 10 of every item individually'

fair drum
#

alright well give me a few min

tight cosmos
#

thanks man

meager granite
#
if(isServer) then {
    {
        if(getNumber(_x >> "ItemInfo" >> "type") > 0) then {
            this addItemCargoGlobal [configName _x, 10];
        } else {
            this addWeaponCargoGlobal [configName _x, 10];
        };
    } forEach ("getNumber(_x >> 'scope') == 2" configClasses (configFile >> "CfgWeapons"));
};
#

Be careful what you wish for hmmyes

tight cosmos
#

do i just add this to the initilization of the ammo cache or should i run it in the debug console

tight cosmos
#

I shouldve asked before but this will work with zeus correct?

meager granite
fair drum
#

using this it won't

#

the variable for the arsenal crate is boxX in antistasi

#

@meager granite have you moved over to enfusion at all yet?

meager granite
#

Wish I could copy-paste me like 3 times

fair drum
tight cosmos
#

ok so i tried adding the code to the debug console, an empty crate, and the virual arsenal in antistasi and it didnt do anything, I do not know if I did something wrong or what, i replaced the code this with boxX aswell

meager granite
tight cosmos
#

ahh i see

#

sorry about the trouble

#

I shouldve specified before thats my fault

fallen locust
#

you know you can just define it the mission? :P

#

right?

granite sky
#

If it's community Antistasi or based on it then you can run this as server:

{
  _x call A3A_fnc_unlockEquipment;
} forEach (allWeapons + allItems + allMagazines + allExplosives);
#

Preferably avoid doing this when you're trying to use the server. It will jam the network.

unkempt marsh
#

can i use "missionDifficulty = x" or can i only use "x = missionDifficulty"?

warm hedge
#

Context?

#

If you mean a getter command being a setter, no

unkempt marsh
#

is there any way mission side to set difficulty then? i see the prologue is forced on regular but i wonder how to do the same myself

granite sky
#

Yes and no.

#

Arma has separate server skill and mission skill values, which are combined to produce final skill values for AIs.

#

Missions can change mission skill values but not server skill.

red matrix
#

is there a way to have an object init in 3den that activates after the init.sqf?

granite sky
#

Although I might be answering the wrong question there.

unkempt marsh
#

yea nah i was more thinking about setting it forced to regular/veteran more so than changing AI skill values

granite sky
#

It's plausible that description.ext would have stuff for that, but the only option documented is for the tactical ping.

red matrix
granite sky
#

A reference, if it's an array or hashmap.

#

Internally everything is a reference, but other types just make a copy when you assign them to a variable.

candid sun
#

thanks @queen cargo , i'd have written it up but i don't really understand dialogs enough to explain it

fair drum
spiral trench
#

I'm a little late to the party @candid sun but why do you need some RscEmpty when you have all of these ctrlCreate classes?

queen cargo
#

@fallen locust so what?

#

@spiral trench because you still need a display/dialog for ctrlCreate

#

ctrlCreate is just for the control elements (createDialog/createDisplay still needed)

candid sun
#

yeah i just want an empty dialog class that i can ctrlcreate shit in to, without having to define that empty class in description.ext

spiral trench
#

Yeah I get that but I suppose it depends on the use case, I would just define in description.ext then use createDisplay or use ctrlCreate on some display like 46 or whatever, if I really needed to

candid sun
#

i'll have to do it that way i guess, just seems so counter-intuitive

little raptor
#

They're still references. You just can't modify them by ref

#

Because there's no command for it

#

But arrays and hashmaps (and structured text) do have commands that modify by ref (pushBack, set, etc.)

digital rover
#

Using a single element array to create a reference to an unreferable type... Delightfully devilish Seymour

molten tree
#

I've finished making my vehicle spawner; the only issue is that my 'display' models aren't sitting on the table correctly. Is there a way to fix it?

stable dune
molten tree
stable dune
# molten tree ```SpawnTable = createSimpleObject ["FoldTable", getPosATL this, false]; Spa...

Or change attach point.
Just testing


private _pos = getPosATL player vectorAdd [0,10,0];
private _tank = "O_T_MBT_02_cannon_ghex_F" createVehicle _pos;
private _spawnTable = "Land_CampingTable_F" createVehicle _pos;    
_tank attachTo [_spawnTable, [0,0,0.65]];
_tank setVectorDirAndUp [[1,0,0], [0,0,1]]; 
_tank setObjectScale 0.1;

and with setVectorDirAndUp you can change direction of object

#

dont know what table and tank do you use.
Just testing vanilla.
to init of tank

private _tank = this;
private _pos = getPosATL _tank;
private _spawnTable = createVehicle "Land_CampingTable_F" _pos;
_tank attachTo [_spawnTable, [0,0,0.62]];
_tank setVectorDirAndUp [[1,0,0], [0,0,1]]; 
_tank setObjectScale 0.1;
detach _tank;
sullen trellis
#

I have a mod installed which creates an object on player every once in a while, I want to check everytime this object is created so I can run another script, is it possible?

alias_snow = "Land_HelipadEmpty_F" createVehiclelocal [0,0,0];
sullen trellis
sleek galleon
#

Hey guys, i'm a bit confused, yet again ๐Ÿ˜…

TriggerTask3 == 1;

I get a "generic error" with this line of code, it doesn't seem to do anything bad as the trigger works just fine, but I still get the warning.

The error message is on the picture

#

Any ideas of what it could be ?

#

To explain the code itself, on the triggers there's a condition where it checks if "1", and the actions/things that trigger the triggers there's a "On activation triggertaskX =1"

willow hound
#

What is the initial value of TriggerTask3?

sleek galleon
#

I suppose 0 ?

#

I didn't touch the initial value

fleet sand
sleek galleon
#

On the screen the mission just started

#

So no, nothing done during the mission yet

#

And it keeps switching between triggertask2 & Triggertask 3 every tick

#

On the error message

fleet sand
willow hound
sleek galleon
fleet sand
#

You are trying to check if TriggerTask3 is equal to 0 but becouse you didnt assing them anywhere they are null so basicly you are doing this with a code:
null == 1

sleek galleon
#

So I should put in the init lines that state

TriggerTaskX = 0 ?

willow hound
#

If you never provide an initial value, the variable would be undefined (not null or nil or something like that), and that would result in an error.

willow hound
granite sky
sleek galleon
#

Added it in the init, fixed it

#

Thx lads !

stable dune
#

Hello,
If I have a default value (number) x from cba setting, tag_myDefaultValue

_value = _myObject getVariable ["tag_myValue", tag_myDefaultValue];

So if value is not defined it will use default value.
so in check

if (_value > random 1) then {
// do stuff
}

works yes.
But if i want define if someone set _value to true or false it uses 1 or 0
Is only way to check

if (_value > random 1 || _value) then {
// do stuff
}

So it will check "number" or "boolean" .

fleet sand
granite sky
#

Yes, that's the point.

ornate whale
#

Is it possible to enable gun light on a unit which is in animation loop?

willow hound
proven charm
#

if you dont know which type a variable is you can use isEqualTo because it doesnt throw an error

willow hound
little raptor
#

Also I actually checked the memory and both point to the same data

twin moon
#

Quick question. Let's say you wanted to restrict certain ace arsenal items to specific players. Basically a whitelist list of weapons specific to one player.
So one person has access to the ak while another one doesn't.

twin moon
#

Does this go under the Adding ace arsenal to box or is it somewhere else in the ToC?

#

Ah wait no think I understand it

stable dune
twin moon
#

will prob ask some stuff later on managed to find a forum thread that kinda helps just wondering about the local and how it works with each and every player.
forum discussion: https://forums.bohemia.net/forums/topic/233579-weapon-restrictions-for-specific-roles/

cedar cape
#

hes let me give it out to other people if you want it

twin moon
torpid sedge
#

anyone arma 3 dev can help out with my fucked mission file
[21:24]
pleade just dm i am doijng old lakisde map i got everrything at this my idk whatwrong i need new insite

thin fox
molten tree
molten tree
stable dune
#

make your vehicle [v] simple object

molten tree
stable dune
#

What code do you use currenlty?

#

could you share your code and object type what your are using

molten tree
# stable dune What code do you use currenlty?
SpawnTable attachTo [this, [0,0,0]];  
detach SpawnTable;  
SpawnTable setPosATL [(getPosATL this select 0) + 0, (getPosATL this select 1) + 0, (getPosATL TableHeight select 2) + 0];   
this setPos [(getPos this select 0) + 0, (getPos this select 1) + 0, (getPos TableHeight select 2) + -1.625];     
  
this setDir 135;  
this setObjectScale 0.1;  
#

Object type is any vehicle the script is attached to; it's meant to be copied and pasted into any vehicle. The script is intended to make a player-operated vehicle spawner, and these small vehicles on tables are meant to be spawn selectors.

#

I think the problem is setObjectScale itself, rather than a positioning problem. But I could be wrong.

stable dune
molten tree
#

'this' is the tank itself.

#

Hold on, I'll show you the rest:

_spawnDescription = getDescription this;    
_spawnClassName = _spawnDescription select 0;    
_displayName = format [getText (configFile >> "CfgVehicles" >> (typeOf this) >> "displayName") + " (" + (typeOf this) + ")"];
   
SpawnTable = createSimpleObject ["FoldTable", getPosATL this, false];    
SpawnTable attachTo [this, [0,0,0]];  
detach SpawnTable;  
SpawnTable setPosATL [(getPosATL this select 0) + 0, (getPosATL this select 1) + 0, (getPosATL TableHeight select 2) + 0];   
this setPos [(getPos this select 0) + 0, (getPos this select 1) + 0, (getPos TableHeight select 2) + -2.5];     
  
this setDir 135;  
this setObjectScale 0.1;  
  
[this, ["Set vehicle spawner to spawn " + _displayName + ".",        
{ 
   params ["_target","_caller","_actionID","_target"];
   VehicleType = _target;       
   DisplayName = format [getText (configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName") + " (" + (typeOf VehicleType) + ")"];
   hint format[DisplayName + " selected."];
   VehicleSpawner = 1;
}, 
_target, 
10, 
false, 
false, 
"", 
"", 
3]] remoteExec ["addAction"];
#

And this is in the init field of any vehicle you want to turn into a spawner without changes (except vertical position).

stable dune
#

hmm.
Many things.
You do not need detach "table" from your object.
And if you are using init, you do not need remoteExec your addaction code because its executed for every client.
So you could do workaround.
Just do all on server with

 if (isServer) then {
   private _tank = this;
   private _spawnDescription = getDescription _tank;
   private _spawnClassName = _spawnDescription select 0;    
   private _displayName = format [getText (configFile >> "CfgVehicles" >> (typeOf _tank) >> "displayName") + " (" + (typeOf _tank) + ")"];
   private _spawnTable = createVehicle FoldTable (getPosATL _tank);
   _tank setDir 135;  
   _tank attachTo [_spawnTable, [0,0,0.5]]; //set this value to correct height  
   _tank setObjectScale 0.1;  
   [
      _tank,
      [
         "Set vehicle spawner to spawn " + _displayName + ".",        
         { 
            params ["_target","_caller","_actionID","_target"];
            private _type = typeOf _target;
            private _display = format ["%1 %2",getText (configFile >> "CfgVehicles" >> _type  >> "displayName",_type];
            hint format[_display + " selected."];
            VehicleSpawner = 1;
         }, 
         nil,
         1.5,
         true,
         true,
         "",
         "true",
         10, 
         false, 
         "", 
         ""
      ]
   ] remoteExec ["addAction"];
 };

And noot sure about your addaction parameters so just added "default" from wiki..

molten tree
#

So far, it currently works as intended. At this point, the only issue is placement of said vehicle in relation to the folding table.

#

And after some testing, I realized it may not be so simple; I tried turning on physics, and some clipped the ground itself to a partial extent, so I'm wondering if the model's hitbox changes from its actual visual location.

wind flax
#

Anyone know how I'd do this?

#

I'm basically trying to get the ViewAngle between a player, and another player to determine if they are looking at the upper, or lower part of the body

warm hedge
#

lineIntersectsSurfaces is probably one way to check if one is looking upper or lower

molten tree
warm hedge
#

Yes, or intersected selection

fair drum
fair drum
molten tree
blissful current
#

How can I use script to skip a waypoint? I have it working in the editor with a skip trigger but I actually want this to run in an .sqf

warm hedge
#

setCurrentWaypoint or something I don't recall exact name rn, but should be possible

blissful current
#

deleteWaypoint [group, index] I found this. Is the group the object name in the editor? And what is index? The wiki just says 'number'.

#

deleteWaypoint [B Alpha 1-2, 0]; I used the group command to return the group in the editor. But when I run the sqf it says it's missing a ]

warm hedge
#

First WP you place is 1, second is 2 so fourth

#

The group's initial pos that is placed automatically is 0 IIRC

#

Also your second code is not referencing group

blissful current
#

deleteWaypoint [group heli, 1]; So this reads as: delete waypoint 1 from the group that has heli in it?

warm hedge
#

Basically

blissful current
#

It works! ty!

thin thunder
#

Hello

fair drum
#

Top of the evening to ya

thin thunder
#

Please can anyone make a function Arma 3 weapon?

fair drum
#

i don't know what you are asking

blissful current
#

player addAction ["<t color='#FFFF00'>End Mission</t>", "call BIS_fnc_endMission;", nil, 7, false, true, "", ""]; I am getting an error with this about an expected string. It works kinda even with the error

warm hedge
#

Using quote within the quote is the error

blissful current
#

I just removed that and got a new arror now about a string or an expected array

#

I think it has to do with the call part

warm hedge
#

What exactly is the error message

blissful current
#

error type oject, expected array, string

#

BIS_fnc_endMission.sqf

warm hedge
#

It does mean how you call endMission is wrong

#

Use 'END1'?

blissful current
#

I dont really like the glitch effect since this is a vietnam mission

#

but if I have to use it oh well

warm hedge
#

You can always make your script

hallow mortar
#

BIS_fnc_endMission uses END1 by default if you don't specify an ending

warm hedge
#

Probably it tries to look _this that addAction throws?

hallow mortar
blissful current
#

but how do I do the syntax correctly within an addaction. I think thats whats tripping me up. Maybe I need brackets?

warm hedge
#

Use different quote in quote, in fact you've already done in your code

hallow mortar
#

Use Code instead of String for the action code, it'll save a lot of trouble

warm hedge
#

Or, don't use String to specify the code you want to execute in addAction

hallow mortar
#
_obj addAction ["mytitle", { hint "button pressed!"; player setDamage 1; }];```
blissful current
#

player addAction ["<t color='#FFFF00'>End Mission</t>", "["end1", true , 3, true, true, true] call VN_fnc_endMission;", nil, 7, false, true, "", ""];

Usually I call a sqf from the addaction but I thought maybe it would be easier to do it within.

#

It say error mission bracket

#

I should stick to what I know lol

hallow mortar
#

Where you're specifying the code you want to run when the action is triggered, you're enclosing it in "", making it a String data type. This is valid, but it means when you use another " inside the string, the game sees that as the end of the string, which confuses it

#

Instead, enclose the code in {}, making it a Code data type. addAction also accepts this, and using " won't confuse it because that's no longer the delimiter character for the whole thing.

#

You can also use quotes inside Strings by using the other kind of quote, ', or doubling them for the inner string ("text text ""my string"" text"), but using a Code data type is much more convenient and is usually better if it's possible.

blissful current
#

player addAction ["<t color='#FFFF00'>End Mission</t>", {"["end1", true , 3, true, true, true] call VN_fnc_endMission;"}, nil, 7, false, true, "", ""];

hallow mortar
#

Instead, not both at the same time

#

That's just a String inside a Code

blissful current
#

Ahhh okay. I might be understanding a little.

hallow mortar
#
player addAction ["<t color='#FFFF00'>End Mission</t>", {["end1", true , 3, true, true, true] call VN_fnc_endMission;}, nil, 7, false, true, "", ""];```
blissful current
#

How do you make yours have color?

hallow mortar
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
blissful current
#

Your has error parama type bool epected code.

#

this means its one of the trues right?

#

bool = true or false if i undersrtand

hallow mortar
#

It's from your vn_fnc_endMission call

blissful current
#

I think the last one true is the culprit. lemme check

hallow mortar
#

Have another look at the vn_fnc_endMission documentation. The last parameter, if specified, needs to be Code; you've provided Bool.

#

It's an optional parameter so if you want to use the default, just don't specify it at all.

blissful current
#

nice so i did catch that. but when i delete the last true I get an error that says missing ]

hallow mortar
#

Did you also delete the comma after the previous parameter? You need to.

blissful current
#

oh wait I can try ""?

blissful current
#

Yeah that was the problem the comma

#

So how come I cant just use "" there? That works in addactions all the time to leave it blank

hallow mortar
#

Data type matters. "" is a String. If the command or function expects a different data type, it will throw an error.

blissful current
#

interesting. will arma 4 have the same code as arma 3 or will I have to learn anew?

hallow mortar
#

Reforger and A4 use the new Enforce language, which is quite different.

blissful current
#

Does anything translate or is it like learning a completely new language?

hallow mortar
#

It is a completely new language

blissful current
#

Oh wow this means proprietary from Bohemia?

hallow mortar
#

SQF is also a proprietary BI language

blissful current
#

Interesting. Venture a guess as to why change the language?

hallow mortar
#

New game engine

blissful current
#

So every game engine requires a new language?

hallow mortar
#

It doesn't require a new language, but it will often result in one for technical reasons. Especially when the old language deserves to die

#

(when we talk about game engines changing languages, keep in mind not all engines actually have a separate userside scripting language. A3 is not written in SQF. If a game that doesn't have a separate language changes to an engine that's written in a new language, that's what you get. Reforger/A4 could have had SQF support instead of Enforce, but why recreate a bad language instead of making a new fast one that can do much more?)

hallow mortar
blissful current
#

Ahhh ok I was wondering that. I couldnt figure out how the code knew what to provide if I didn't put anything there.

#

Thanks Nikko for the tutoring lesson. Im headed to bed. cya!

sullen sigil
#

(sqf isnt a bad language)

hallow mortar
#

It's not bad in every way, just many of them

exotic gyro
exotic gyro
cosmic lichen
#

Neva!!!!11

exotic gyro
coarse sedge
#

anyone know why when i use setFlagTexture the flag reverts to the original texture after a period of time?

warm hedge
#

A Mod or something is overwriting

coarse sedge
#

thanx thought it was strange

#

@warm hedge would you be interested at having a look at a script? it has no loops in it so i have no idea how this flag is changing. Its weird, if the flag pole has no texture when the server starts then i use setFlagTexture the flag will stay but then if i change this current flag with setFlagTexture it will revert back, if i do this process with a flagpole that has a texture set by the server on start it will always revert to that texture. So its making me think the server is doing something and not the script but i really have no idea.

#

do i have to like delete the pole and make a new one?

warm hedge
#

No idea

proven charm
coarse sedge
#

client atm

#

i think

proven charm
#

ok you need to call the command where the flag is local

#

so probably server..

#

but that should be the problem only if you are running dedi server?

warm hedge
#

If that's the case indeed setFlagTexture is GE

coarse sedge
#

its called in init.sqf

proven charm
#

well maybe ```
if(isServer) then
{
flag setFlagTexture "texnamehere";
};

coarse sedge
#

im so confused, i use execvm in init to call the script that has setFlagTexture, sorry im so bad at this ๐Ÿ˜ฅ

proven charm
#

i have to ask if you have dedi running + client. ? or is it all in editor?

coarse sedge
#

so at the moment ive made a init.sqm im the mission file while im messing with scripts, then i chuck it all up on a dedi and everything has been fine untill this flag thing. i never noticed it on the dedi only now when starting a mp mission from eden then having another client join

#

local client

proven charm
#

so where is the flag created? server or client?

coarse sedge
#

i dont know? how can i tell?

proven charm
#

is the flag placed in the editor?

coarse sedge
#

yea

proven charm
#

then it should be server

#

try my code

coarse sedge
#

roger

still forum
coarse sedge
#

@proven charm so its kind of working, but now clients who join that use the script cant change the texture, sorry im so confusing with my explanations

proven charm
#

all changes to the texture must be made on server side

coarse sedge
#

sweet as thanks for your help ๐Ÿ‘

proven charm
#

yw

still forum
sullen sigil
#

claaaic dedmen W

sullen trellis
#
 _objects = player nearEntities [["Flag_FD_Green_F", "Flag_FD_Orange_F"], 30];
    sleep 15; 
   if (_objects) then {
        sleep 5;
 hint "Player reached the flags";
    } ;

i want to check if player has reached any of the given classname flags within 30 distance, how do i fix nearEntities? i tried also working with nearobjects/ nearestobjects no luck so far

proven charm
sullen sigil
#

isnotequalto [] is faster

sullen trellis
sullen trellis
winter rose
sullen trellis
#
[] spawn { _objects = player nearEntities [["Flag_FD_Green_F", "Flag_FD_Orange_F"], 30]; 
    sleep 15;  
   if (_object isNotEqualTo []) then { 
        sleep 5; 
 hint "Player reached the flags"; 
  };  } ;

its now looking like this, getting error just before _object isNotEqualTo []

proven charm
#

_objects

sullen trellis
#

ops my bad

proven charm
#

doesnt seem to work with nearEntities . try ```sqf
_objects = nearestObjects [player, ["Flag_FD_Green_F", "Flag_FD_Orange_F"], 30];

sullen trellis
proven charm
#

np

upbeat hill
#

Hi I'm trying to get this script working when you click on someone in zeus and put this is the execute area but it doesn't seem to be working. It should be displaying what ever word i want above their head. Would appreciate some help with this i can't figure it out.

[_this, "text here", 30] remoteExec ["3DText",0];

south swan
#

inb4 ChatGPT

sleek galleon
#

Maybe a stupid question, but would this work in a trigger condition ?

I'm trying to make an objective with an optional task, basically there's a FOB with a comms tower that the players would have to destroy, but there's also another location near it. The idea is that if they destroy the fuel tank (optional OBJ), the FOB sends a QRF to the location that the players could evade to then strike a weakened FOB.

This works, but now i'm trying to make the trigger that makes the main objective "Succeeded" and the optional "Canceled" if the players decide to fudge subtility and just strike the FOB with the comms tower without doing the diversion.

alive AJFuelTank;```
cosmic lichen
#

Use && operator

#

(and)

sleek galleon
#

Where do I place it in this code ?

cosmic lichen
#

!alive a && alive b

sleek galleon
#

Oh I see

#

Thans k!

#

Thanks !*

ornate whale
#

If I delete a trigger or a spawn point on the server with deleteVehicle, will it cease to exist on clients as well? Thanks

winter rose
thin fox
#

Hello! I'm working on a artillery menu with map and such, but the text in the markers in the GUI map don't show up. Anyone knows why?

little raptor
thin fox
#

CT_MAP_MAIN

little raptor
#

iirc there's 2, one with type 100 and other 101, and you should use the 101 one

#

iirc it's called CT_MAIN_MAP

little raptor
thin fox
little raptor
#

Hard to say what's wrong exactly because I'm reading it on mobile, but try inheriting from the vanilla one

#

I guess you might've missed a color

thin fox
little raptor
#

Or just inherit meowsweats

thin fox
little raptor
#

No inherit from the game main map

thin fox
#

in this case class RscMapControl : CtrlMapMain ?

little raptor
#

And declare it first but yeah (also make sure it exists, I just wrote the name from memory)

#

Are you making a mission or mod?

thin fox
#

let me check cfg viewer first

thin fox
#

well, for my missions

little raptor
#

Then you should import it:

import CtrlMainMap;

In addons you declare them (you also need to list the correct requiredAddons):

class CtrlMainMap;
thin fox
#

aaa, I was reading about the import command, a practical example, nice

#

is this the correct one from the cfg? configfile >> "ctrlMapMain"

little raptor
#

idk it could be. check if its type is 101

thin fox
sullen trellis
blissful current
#

I'm having an issue getting a helicopter to land on a dedicated server (works in editor just fine.)

  1. Helicopter has a hold waypoint.
  2. Players enter trigger zone that removes the hold waypoint.
  3. Helicopter flies to invisible helipad but wont land.
    Oddly enough if I removed the hold waypoint it has no problem working on the server. Something about the hold waypoint breaks it.
south swan
#

inb4 locality problem when trying to delete the hold WP tanking

blissful current
#

Well I'm not so sure it's a locality issue, because the waypoint is removed for all clients via a remoteExec:
deleteWaypoint [group heli, 1];
And indeed the heli is able to fly away and hover above the landing zone. But it just wont land.

thin fox
#

@little raptor got it working without having to inherit, it was the multiple sizeEx with wrong format

deft zealot
#

someone has a workaround for player action ["Gear", _myVehicle]; not opening the inventory if the player is inside the vehicle (it opens when you disembark - surprise)?

fleet sand
#

by any chance does anybody know the name of animation where person is kneeling handcuffed behind back ?

hallow mortar
#

Try "Acts_ExecutionVictim_Loop"

fleet sand
floral trail
#

guys, does someone knows a script to put a server FPS measurer? to show on the players map or something like that

naive needle
#

hey guys I want to achieve that I'm able to prevent people to use for example the nightvision via displayeventhandler.
That already worked pretty easily via using actionKeys check. But now the problem is when people add key combination like shift+N or even B+N it doesent work anymore due to bit flags probably being added to the dik value. And the number which then is inside the actionKeys are rising up higher than 7 digits and since numbers in sqf are floats it becomes not precise anymore.

so my solution was to use actionKeyEx (includes key combination) and since displayeventhandler only triggers for one key maybe the best would be to use a array which contains all the keys which are getting pressed and added via KeyDown and then getting deleted via KeyUp , what do you think , maybe any better solutions ?

hallow mortar
#

You could use a UserAction EH to detect the vision switch event rather than the controls, then use player action ["nvGogglesOff",player] to immediately switch back.
Or, you could use a keyDown EH and check whether the NVG inputAction is currently active, rather than looking for the specific buttons.

naive needle
#

I forgot that addUserActionEventHandler existed , thank you I will give it a shot , looks promising !

for inputAction thats what I tried as well, the only issue is that it bocks other key inputs as well if the one key is getting pressed, for example Shift+N for Night Vision and then you stop running if inputAction is higher than 0.
Then you could make another check only if the key for nightvision is getting pressed and then you are back to check which key combination is getting pressed

indigo wolf
#

i have a vehicle in the mission with variable name "OBJECTIVE_VEHICLE_1" that MUST exist always meaning if it gets destroyed or deleted it should respawn at the last known position with the same variable how i do this?

finite bone
# floral trail guys, does someone knows a script to put a server FPS measurer? to show on the p...
[[], {
    if (hasinterface) then {
        if(isNil "FPSDiagActive") then 
        {
            FPSDiagActive = true;
            while {true} do 
            {
                player setVariable ["PlayerFPS", floor diag_fps, true];
                sleep 1;
            };
        };
    };
}] remoteExec ["spawn", [0, -2] select isDedicated, true];

showFrames = true;

addMissionEventHandler ["Draw3D", {
    {
        _distance = (ATLToASL (positionCameraToWorld [0,0,0])) distance _x;
        if (_distance < 1200) then {
            _playerFPS = _x getVariable ["PlayerFPS",50];

            if (_playerFPS  <20) then 
            {
                if(showFrames) then {
                    drawIcon3D
                    [
                        "",
                        [1,0,0,0.7],
                        ASLToAGL getPosASL _x,
                        1,
                        2,
                        0,
                        format["%1 FPS: %2", name _x, str _playerFPS],
                        0,
                        0.05,
                        "PuristaMedium",
                        "center"
                    ];
                };
            }
            else
            {
                if(showFrames) then {
                    drawIcon3D
                    [
                        "",
                        [1,1,1,0.5],
                        ASLToAGL getPosASL _x,
                        1,
                        2,
                        0,
                        format["%1 FPS: %2", name _x, str _playerFPS],
                        0,
                        0.03,
                        "PuristaMedium",
                        "center"
                    ];
                };
            };
        };
    } forEach allPlayers;
}];```

I run this code (Local Execution) that helps me view the FPS of all players in the server (Only for me).
naive needle
#

With true it will just sends it to everyone every 1 second

#

for example with each of these 80 people sending it to 80 other people that would be 6.400 vars getting send over the network every second

finite bone
#

Ah yes, true

molten tree
#

Hey all. What's the easiest way to make a mod that references a normally hidden object (ie. scope = 0) and make it visible in 3den (ie. scope = 2)? There's a mod that does something similar, but it's so poorly written I want to start over.

I think I can figure out how to change the scope and stuff myself; I more need help with making a mod override that's simple.

blissful current
#

Can I please get some help remoteExec'ing this:
player addAction ["<t color='#FFFF00'>End Mission</t>", {["end1", true , true, true, true] call VN_fnc_endMission;}, nil, 7, false, true, "", ""];

#

This is what I got so far but it says invalid number in expresssion:
player addAction ["<t color='#FFFF00'>End Mission</t>", {["end1", true , true, true, true] remoteExec ["call VN_fnc_endMission", 0];}, [], 8, false, true, "", ""];๏ปฟ

warm hedge
#

"VN_fnc_endMission" not "call VN_[...]"

#

Check pinned

blissful current
#

Hmmm. I still get the same error that way.

granite sky
#

You'd need to remoteExec the addAction.

warm hedge
#

Post exact error

blissful current
#

Thats the goaal

granite sky
#

these are hard as hell to write. Give me a few minutes.

blissful current
#

On Activation: Invalid Number in Expression

warm hedge
#

Exact means lieteral, word to word character to character, no skip or add or summarize

blissful current
#

"A picture is worth a thousand words."

warm hedge
#

Are you sure you have no invisible illegal character there?

granite sky
#

actually the easiest bad way is just:

[{player addAction ["<t color='#FFFF00'>End Mission</t>", {["end1", true , true, true, true] call VN_fnc_endMission;}, nil, 7, false, true, "", ""]}] remoteExec ["call", 0];
#

wait never mind, not sure what this function does.

blissful current
granite sky
#

It shouldn't be used in the editor.

blissful current
#

Im going to try on dedicated server now.

blissful current
granite sky
#

For some reason I assumed you were trying to add an action everywhere from server script.

blissful current
#

It's an addaction for every client

granite sky
#

And I actually have no idea what you were trying to do or what that function does, so ignore everything I said.

warm hedge
blissful current
#

Oh nice I have notepadd++. Any idea how to check the code for errors in it?

warm hedge
#

The mirrored P icon

#

You'll see some strange characters, but make sure there is no "super strange" ones

sullen sigil
#

what's the best way to get full orientation (vdirup) player is aiming? not v familiar with camera commands and cant seem to get it to work

granite sky
sullen sigil
#
private _startPos = positionCameraToWorld [0,0,0];
private _endPos = positionCameraToWorld [0,0,2];
private _vdirandup =  [_startpos, _endpos] call BIS_fnc_findLookAt;```
is currently what im doing but seems to give some sort of offset... usecase is for firing projectiles from player's eyes
#

i was aiming straight up on the far left one

#

never mind

#

jenna doesnt remove her deprecated code i was updating deprecated code its all her fault blame her

gleaming rivet
#

I guess I'll ask here, but:
What's a good way to remove the vests from TFA - namely just removing them from the arsenal without whitelisting all the other contents?
Can I create a config patch to change their scope?

jaunty ravine
#

Is there some way to get all markers only from a specific channel? I.e. can I somehow fetch markers only from Side Channel?

jaunty ravine
#

Thank you, POLPOX.

little raptor
south swan
#

do you really need a vectorUp for spawning the projectile, though?

#

just _vectorDir = (AGLToASL positionCameraToWorld [0, 0, 1]) vectorDiff (AGLToASL positionCameraToWorld [0,0,0]); for unit-length direction vector blobdoggoshruggooglyfixed: added AGLToASL

south swan
#

directions don't care about ASL/AGL/ATL/whatever, though. And vectorDiff would give you a direction As long as both points are in the same format.

#

and

usecase is for firing projectiles from player's eyes
sounds like the most fitting usecase for screenToWorldDirection

south swan
# little raptor It should be ASL

point taken, my error is: AGL doesn't have a flat base plane, so Z offset would be different in the starting and ending points. (AGLToASL positionCameraToWorld [0, 0, 1]) vectorDiff (AGLToASL positionCameraToWorld [0,0,0]) should be used. The original code has the same bug, though ๐Ÿ™‚

#

at least if BIS_fnc_findLookAt doesn't take care of that internally

analog mulch
#

hi,
is there a trigger condition that detects once the leaflet has been opened by the player?

["init", [this, "YourImage.jpg", "text"]] call BIS_fnc_initLeaflet
analog mulch
#

so in the leaflet's init:

intel1 addEventHandler ["objectInspected", {
    params ["_object", "_texture", "_text", "_sound", "_textureRatio"];
    
    _object setVariable ["leafletRead", true, true];

in trigger condition:

intel1 getVariable ["leafletRead", false]
warm hedge
#

Check BIKI more carefully

analog mulch
#
if (isServer) then {
    intel1 addEventHandler ["objectInspected", {
        params ["_object", "_texture", "_text", "_sound", "_textureRatio"];
        missionNamespace setVariable ["leafletRead", true, true];
    }];
};
analog mulch
#
[missionNamespace, "objectInspected", {
    params ["_object", "_texture", "_text", "_sound", "_textureRatio"];
    if (_object == intel1) then {
        missionNamespace setVariable ["leafletRead", true, true];
        hint "New location has been located";
    };
}] call BIS_fnc_addScriptedEventHandler;
#

trigger condition:

missionNamespace getVariable ["leafletRead", false]
proven charm
#

!(missionNamespace getVariable ["leafletRead", false])

analog mulch
#

Ok but I want to check whether it has been read

proven charm
#

ok

analog mulch
#

Then it shows a marker on map in the trigger activation

proven charm
#

so whats the problem?

analog mulch
#

It didn't work

proven charm
#

what didnt work?

remote cobalt
#

Hey Folks, stupid question:

How can I find out if a Class that is given to a function is a disposable Launcher (so only one time)? Is there a way to find that via config or something? I looked into the NLAW config and didn't find a value that caught my attention.

hallow mortar
#

There is no system for disposable launchers in the vanilla game. Mod implementations are all scripted, usually with EHs. GM disposables have a config flag for it but that's a courtesy, not something that's actually required, and other mods use different flags or none at all.

#

The EHs required for disposability will be visible in the launcher's config, under its EHs subclass, but you can't really read that in a reliable way through scripting.

analog mulch
proven charm
granite sky
#

RHS and CBA (used by CUP) have different disposable launcher systems. Not sure whether GM uses one of those.

#

RHS: getNumber (_config >> "rhs_disposable") == 1
CBA: getArray (_config >> "magazines") # 0 == "CBA_fakeLauncherMagazine"

#

probably not given that one has "rhs" in it and GM doesn't require CBA :P

#

I thought we handled GM disposables but I guess not.

hallow mortar
#

CBA also has CBA_fnc_firedDisposable, which can be used by any weapon from its EHs without any particular config requirements. That's what ACE uses for its modified vanilla NLAW.

granite sky
#

CBA actually has three versions of each launcher. A launcher+fake missile one that should be in the arsenal, a real launcher + missile pair that it turns into when equipped, and an empty tube.

#

IIRC other modsets stick with the two. CBA's system is so you don't need to put a missile in the launcher.

#

RHS will create a missile for an empty launcher when humans use it, but this doesn't work for AI.

hallow mortar
#

Oh, CSLA and SOGPF (and Spearhead? I can't remember if any of their launchers are disposable) will have their own systems too. They're probably functionally similar to one of the other major systems since there's only so many ways to do it, but the problem is that the config flags (if used) and function names will be different again, so in order to detect them you have to basically build a specific check for every version of every system

analog mulch
#

i set another hint to show in the activation, and that one didn't fire

proven charm
#

the whole BIS_fnc_addScriptedEventHandler thing goes to init.sqf or something like that, not to trigger

ivory lake
#

sorta wished by this point there'd be native support for disposable weapons especially when there's been examples in... every game on the engine so far

proven charm
#

@analog mulch I ran this on console and it worked good ```sqf
[intel1, "#(argb,8,8,3)color(1,0,1,1)", "This is some Magic Pink"] call BIS_fnc_initInspectable;

[missionNamespace, "objectInspected", {
params ["_object", "_texture", "_text", "_sound", "_textureRatio"];
if (_object == intel1) then {
missionNamespace setVariable ["leafletRead", true, true];
hint "New location has been located";
};
}] call BIS_fnc_addScriptedEventHandler;

analog mulch
#

i just used it in a Game Logic module and worked

#

so is that what they are there for, Game Logics that is?

#

basically use them for as an init?

proven charm
#

never used them my self meowsweats

analog mulch
#

ty @proven charm

serene sentinel
#

Can someone help. How can I check if uniforms in container can be weared by player? Maybe need some manipulations with isUniformAllowed command?

private _Uniform = ("getText (_x >> 'simulation') in ['Weapon'] && getNumber (_x >> 'ItemInfo' >> 'type') in [801] && getNumber (_x >> 'type') in [131072]" configClasses (configFile >> "cfgWeapons")) apply {configName _x};
private _Uniforminbox = (itemCargo _container) arrayIntersect (_Uniform);
private _canUseUniform = ....
granite sky
#

Assuming that the player is local: _canUseUniform = _uniformInBox select { player isUniformAllowed _x };

#

You really shouldn't scan the whole config here though. Just run the check on the items that are in the crate.

serene sentinel
#

@granite sky Thanks.

kindred zephyr
#

Would the Eden editor display return anything when using

findDisplay _someIDD;
``` while testing the mission from there? Or does that IDD only exist while the actual editor is active?

Same question with the ZEUS IDD, will it return anything when the mission normally runs or does it only return something while you are using the zeus interface itself?
rich falcon
#
_westOrEast = simulationEnabled triggerComms;

if (_westOrEast = false) then {
    onOff setPos [7706.14,9696.31,0];
}

else {
    onOff setPos [7702.57,9682.04,0];
};

Having a hard time understanding why it's giving me this as an error despite me having a closing parenthesis thing

granite sky
#

(= should be ==)

rich falcon
#

Ah

granite sky
#

I think _var == false does work these days but you should really do !_var instead.

rich falcon
#

Sounds good, I'll change that, thanks for the help

granite sky
#

right, boolean support for == added in A3 2.00

stable dune
granite sky
#

The bulk of the cost there is usually the setPos, so probably not much.

#

If your Z values are accurate then you can use setPosATL instead and then it's much faster.

#

Not the sort of code where performance matters though.

eternal spruce
#

Does anyone know how to force the AI to raise or lower the landing gear in an aircraft, I've looked online but found no results

hallow mortar
eternal spruce
#

I did try using nameOfPlane action ["LandGearUp", nameOfPlane]; but the gear was still down, am i suppose to loop it?

sleek galleon
#

Is the dedicated version of the "call" command "RemoteExecCall" ? I tried to check on the wiki but didn't really understand if it is.

I noticed on our dedicated server that this script from Advanced Rappelling didn't work
[Helo1,30,GetPosASL LZA_RappelPos] call AR_Rappel_All_Cargo

eternal spruce
#

@hallow mortar sorry i dont understand

hallow mortar
#

That's the documentation for the LandGearUp action, which I linked to before.
It says you have to loop it to get it to apply to AI.

warm hedge
#

I've done some experiment recently and it is simply bugged and unreliable

remote cobalt
#

Hey folks,

I am again, down in Configs and I realise that I know not enough to fight my way through that.

I have a function that gets a classname of an item and now I want to read a value from this. For this I need to know if the item is in CfgWeapons or CfgMagazines.

to go for the correct item info patch I use here:

sqf _mass = getNumber (configFile >> "CfgWeapons" >> classname >> "ItemInfo" >> "mass");

How would I know if to search in CfgMagazines or in CfgWeapons?

How could I do this?

distant venture
#

Hi all, pretty simple problem here. I am trying to make targets pop back up on a command using scripts. I can't seem to get my syntax right, I have all the target names stored in an array and I am trying to loop through the array with a for statement and setting the targets animation. But I am getting this error, I cant figure it out from reading the docs. Any help?

` targetList =["t", "t_1", "t_3", "t_4", "t_5", "t_6"];

"i" = 0;

for "i" in targetList do {

 select targetList["i"] animate["terc", 0];

};`

warm hedge
warm hedge
distant venture
#

Just less lines?

warm hedge
#

Less lines, less things to execute

distant venture
#

Cheers

remote cobalt
#

@warm hedge

#

Classname could be a Weapon, or a Magazine, for example:

"ACE_M26_Clacker"
"ACE_VMM3"
"DemoCharge_Remote_Mag"

warm hedge
#

So you put these classes by hand? Not fetched by some command?

remote cobalt
warm hedge
#

Then isClass maybe the way

remote cobalt
#

Ah, okay, wonderful. I think this should work. Didn't know about that command and was obviously not searching the right buzzwords in the wiki.

remote cobalt
graceful root
#

Hey I saw this message from about a year ago, but do you still have that low gravity mission handy.

I have been looking everywhere for a script that can help my unit with a moon op!

crude flame
#

hey how would we find out of the player is in water

warm hedge
#

This or its example

crude flame
#

also how do we get uavs to automaticly follow something from the start

#

because follow waypoints dont work\

queen junco
#

Quick question: I am trying to remove a specific magazine from a vehicles inventory. But apparently

_myVehicleReference removeMagazine _magazineToBeRemoved;

does not work. I browsed the wiki for quite some time now and I didnt find any alternatives. Is there a workaround?

warm hedge
#

Clarify. You want to remove from inventory where infantry can access, not from vehicle magazine where they consume upon fire their cannon?

queen junco
#

Yes. The inventory a player can access and place magazines inside.

#

I was thinking to create an array, save the current inventory of magazines, remove all magazines, substract the array element and then add all magazines from the array. But this seemed a little too complicated for such an (in theory) easy task

warm hedge
#

Unfortunately, that's the way. No idea why

queen junco
#

if (ARMA) then {?!};

warm hedge
#

Pretty much

upbeat hill
#

Hi im trying to make it so the vehicle i have attched not be attached to anything anymore but unsure how to do that. cant find anything on the attachedto docmentation aswell

[vec1 ,null] call BIS_fnc_attachToRelative

hallow mortar
upbeat hill
marsh bough
#

Hello there - I am wondering if it is possible to add the alchemist magic to a player (from the saharan CDLC) via script e.g. if a player interacts with an object

cosmic lichen
kindred zephyr
thin fox
#

Hello. The command "inRangeOfArtillery" is acting weird. Calling it directly through a script always return false, but calling the <<same>> code from the debug, returns true lol. Any ideas?

stable dune
thin fox
#

this is a piece of it, in the original version of things, another scripts calls it, and it works normally, but if I try to call this function directly with the arguments above, always returns false

#

If I try to realocate this piece of the code to the other script that actually calls it, also returns false

#

If I run the inRangeOfArtillery command directly from debug with the same arguments, returns true (as it should).

fleet sand
thin fox
# fleet sand And what is the code of the script that calls this fnc ?
/* 
Author: PiG13BR
fn_checkParams.sqf

Description:
Checks if the player selected the items from the list boxes
Checks if the player selected a target position
Check if the artillery is busy

Parameter(s):
-

Return:
-
*/
    
// Check if the artillery is selected
private _indexArty = lbCurSel 2100;
if (_indexArty == -1) exitWith {hint "Select the artillery piece"; PIG_fire_button = 0;};
// Get the selected artillery object
private _arty = uiNamespace getVariable "artySelected";

// Check if the ammunition is selected
private _indexAmmo = lbCurSel 2101;
if (_indexAmmo == -1) exitWith {hint "Select the ammo type"; PIG_fire_button = 0;};
// Get the selected artillery ammo
_ammo = lbData [2101,_indexAmmo]; 

// Check how many rounds
private _indexRound = lbCurSel 2102;
if (_indexRound == -1) exitWith {hint "Select how many rounds"; PIG_fire_button = 0;};
// Get the selected rounds
_rounds = lbValue [2102,_indexRound];

// Check if the player clicked on the map
if (isNil "PIG_artyPos") exitWith {hint "Select a position in the map"; PIG_fire_button = 0;};

// Check if the selected artillery is busy
if (!unitReady _arty) exitWith {hint "The artillery is busy right now"; PIG_fire_button = 0;};

if (PIG_fire_button == 1) then {
    [(_arty) select 0, _ammo, _rounds, PIG_artyPos] spawn PIG_fnc_fireArty; // Checks if the artillery is in range and fires it
    // Don't close the dialog and run the script again
    [] spawn PIG_fnc_fetchArtyInfo;
    [] spawn PIG_fnc_checkDialog;

    // Remove map single click EH
    ["arty_event", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;

    // Delete the placeholder target marker
    deleteMarkerLocal "marker_arty";

    // Delete pos variable
    PIG_artyPos = nil;
};
#

if I put the code below in that script above, it returns false. But the same code called from it, returns true

_isInRange = _targetPos inRangeOfArtillery [[_arty], _ammo];
if !(_isInRange) exitWith {hint "The target is out of artillery range"; PIG_fire_button = 0};
fleet sand
thin fox
#

calling it from the menu, works normally, but calling directly doesn't

fleet sand
thin fox
#

also, I'm testing this on dedi server, the artillery seems not to fire using doArtilleryFire. I used this code before on dedi and it should work normally

thin fox
kindred zephyr
thin fox
#

but my problem now is the arty that doesn't fire

stable dune
thin fox
thin fox
#

what shoud I do?

stable dune
#

remoteExec your artillery event

kindred zephyr
#

specifically speaking

#

remoteexec doArtilleryFire

#

and thats it

stable dune
#
private _unit = arty1;
private _pos = getMarkerPos "artyPos";

if (!local _unit) then {
    [_unit,[_pos, "8Rnd_82mm_Mo_shells", 3]] remoteExec ["doArtilleryFire",_unit];
} else {
  _unit doArtilleryFire [_pos, "8Rnd_82mm_Mo_shells", 3];
};
thin fox
kindred zephyr
#

although, you already have a function prepared

#

you might aswell remote exec the function

stable dune
#

Yeah true

fleet sand
stable dune
#

execute there where your aritllery is local

kindred zephyr
#

its a cleaner more organized way

thin fox
#

and, for the remote targetting, shoud I just put clientOwner?

fleet sand
# thin fox

Yea but in this video you are getting 2d pos [x,y,0] with AGL you get [x,y,z].

kindred zephyr
#

I Assume the arty is created on server right?
If so using ID 2 is enough, if the arty is supposed to be local to a player get its owner but you require to query the server for that

thin fox
kindred zephyr
#

yeah, 2 is enough then

thin fox
fleet sand
thin fox
thin fox
#

thank you

#

now i'm gonna get the markerPos

thin fox
#

I noticed that got the object inside an array, let me see if this is the problem

#

yup, fixed it

thin fox
#

so, using "unitReady", it's the same thing: I need to check if the unit is local, right?

proven charm
kindred zephyr
proven charm
#

then it should be dropable in editor?

kindred zephyr
kindred zephyr
#

i never used the "prop" itself

proven charm
#

humm well i got the new airport dropped in, in editor but i guess it doesnt render the runway? its just for AI?

kindred zephyr
#

correct, the doc mentions its just for ai and auto pilot logic

#

Placing the airport in 3DEN allows to see its shape in the map view (2D map), as well it is rotation. However, in 3D it is basically invisible.

proven charm
#

ok

rich falcon
#

Looking for a way to make it so that when I spot any unit within a group a trigger fires
I've already got a basic setup down using

cursorObject == spot4;

But I really do not wanna write out

cursorObject == spot401 || cursorObject == spot402 || cursorObject == spot403

and so on.
Is there a way to target any units within the group in one go?

eternal spruce
#

@hallow mortar I tried looping the AI to have the LandGearUp with this

[] spawn {
while {true} do {

{F15EX_1_Pilot enableAI _x;} forEach ["ANIM","MOVE","FSM","TARGET","AUTOTARGET"];
F15EX_1 action ["LandGearUp", F15EX_1];

sleep 5;

{F15EX_1_Pilot enableAI _x;} forEach ["ANIM","MOVE","FSM","TARGET","AUTOTARGET"];
F15EX_1 action ["LandGearUp", F15EX_1];

};

};

But all I see happened was the gear animation plays half way then it's lowered again

hallow mortar
#

Why are you looping enableAI?

#

The documentation I linked before says you should use a per-frame loop (e.g. eachFrame mission event handler). Alternatively, as POLPOX mentioned, the command may just not work properly.

eternal spruce
#

It's a unitCapture but the aircraft itself is bouncing on unitPlay so I attached a game logic to the aircraft and replayed it and solved the problem

meager granite
#

but you could do cusorObject in units groupToSpot

rich falcon
#

Yeah it's more look at those objects tbh
I'll try that though, thanks!

plush belfry
#

I am using a combination of the keyframe modules along with the camera module to create a moving camera sequence, I want to enter and exit the camera view's by script.

This is the current script I got.

camera1 cameraEffect ["internal", "back"];```

Pretty basic, everything goes smooth for like 2 seconds and the camera runs on the track and then it kicks me out of the camera view. 
The way I fixed this is by using the ``switchCamera`` function,
```[timeline_1] call BIS_fnc_timeline_play;
camera1 switchCamera "internal";```

 but the problem I am running into that with is that it does not take any of the effects applied inside the module into account, running both switchCamera and CameraEffect results in the same thing of CameraEffect kicking me out but switchCamera works fine.

**TLDR; CameraEffect kicks me out when used to enter a module made camera, switchCamera works fine but does not apply any effects onto the Camera (i.e: Cinematic Borders)**
eternal spruce
#

@hallow mortar I got it working now

hoary saddle
#

how do you spawn the smoke from a destroyed vehicle? cant seem to find another smoke pillar like it

hoary saddle
#

thank you

cedar cape
#

how would I go about scripting a map onto a whiteboard

#

im just looking to put the map for the terrain im playing on onto a whiteboard

opal zephyr
#

@cedar cape Look at setObjectTexture on the wiki

cedar cape
#

With the whiteboard donโ€™t you use the texture path in the attributes

opal zephyr
#

Sure, you can use that. If you're using that then just get the image of the map and put its path there

tidal idol
#

Any help on this particular error I'm getting?

#

Module is attached to unit in Zeus, unit is given Fire Mission waypoint, and as soon as it fires, this happens.

warm hedge
#

_projectile is an object there

tidal idol
#

hmm how'd I convert that to string?

warm hedge
#

typeOf

tidal idol
#

just str(_projectile)?
oh ok

blissful current
#

How do you get notepad ++ to have the colors for different code like it does here on discord?

fleet sand
#

Scroll down where you see highlight for 2.16

blissful current
#

Oh wow this is a project that someone is keeping up with. Amazing

tidal idol
#

Is there a quick (one-line) method I could use to set the side of an arbitrary unit to that which matches the numerical value stored in a variable _AmmoSide (1 is west, 0 is east, and so on)?
Current code is below, but it's a modification of some code I found elsewhere and it doesn't seem to work. All spawned entities currently are their default config-set value of side = 1;.
I'm guessing the error is that I'm not using the "west", "east", "UNKNOWN", etc, but writing those if statements/switch statements would probably be much more taxing on performance.

[_ICMVehicle] joinSilent createGroup _AmmoSide;
fleet sand
tidal idol
#

hmm, sideID returns numbers, which are what I'm already starting with. Looks like BIS_fnc_sideType returns the EAST/words which is waht I'm looking for, will try that.

frozen seal
#

Is there a way to execute code when a player deploys an UAV from their backpack?

sharp grotto
frozen seal
sharp grotto
frozen seal
#

gotcha, thx

meager granite
tidal idol
#

Hmm must have swapped those thx

wind sapphire
#

I am looking for suggestions as to how to force the AI driver to drive from the vehicles current position to a waypoint. Right now, about half the time or less, the driver either does not move or gets stuck at an intersection going through a town or city. I have tried with combateMode "SAFE" or "AWARE".

tidal idol
#

Theres a command called something like forcefollowroads you can try

faint burrow
proven charm
#

how do you make smoke effect similar to when buildings get destroyed? I need that for large area (50x50 atleast)

hallow mortar
proven charm
#

thx for the link. i was hoping for preexisting function because i havent done much particles my self

hallow mortar
#

When you use setParticleClass as part of creating the source, you can choose preset types that already exist in the config. I think building destruction dust might be one of them, so you might have a good starting point available

proven charm
#

ooh nice

hallow mortar
#

Also, one of these creates dust similar to that caused by building destruction. I don't remember which of them it is, but it's pretty easy to test.

_emitter2 setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal",16,12,13,0],"","Billboard",1,15,[0,0,0],[0,0,0.01],0,1.276,1,0.03,[0.8,5,9,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12],[[0.2,0.2,0.2,0.2],[0.2,0.2,0.2,0.16],[0.2,0.2,0.2,0.12],[0.2,0.2,0.2,0.1],[0.2,0.2,0.2,0.8],[0.2,0.2,0.2,0.6],[0.2,0.2,0.2,0.3],[0.2,0.2,0.2,0.01]],[1000],0.1,0.02,"","","",0,false,0,[[0,0,0,0]]];
_emitter2 setParticleRandom [5,[10,10,1],[0.4,0.4,0.1],30,0.3,[0,0,0,0],0,0,1,0];
_emitter2 setParticleCircle [10,[0,0,0]];
_emitter2 setParticleFire [0,0,0];
_emitter2 setDropInterval 0.09;

_emitter3 setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal.p3d",16,12,13,0],"","Billboard",1,2,[0,0,0],[0,0,0.2],0,0.05,0.05,0.05,[3,4,5],[[0.5,0.4,0.3,0.06],[0.5,0.4,0.3,0.11],[0.5,0.4,0.3,0.06],[0.5,0.4,0.3,0.05],[0.5,0.4,0.3,0.015],[0.6,0.5,0.4,0]],[1000],0.1,0.05,"","","",0,false,0,[[0,0,0,0]]];
_emitter3 setParticleRandom [1,[2,2,0.2],[3,3,0.15],20,0.2,[0,0,0,0],0,0,0,0];
_emitter3 setParticleCircle [1,[1,1,0]];
_emitter3 setDropInterval 0.001;```
proven charm
#

both seem to create dust. man all those numbers notlikemeow

hallow mortar
#

The particle system has a lot of complex attributes. It's surprisingly flexible, but a bit inaccessible as a result. That's how it is ๐Ÿคท
The tutorial should have links to things like the particles array page that explain what each number means.

proven charm
#

yep the wiki is pretty good, still lot of numbers ๐Ÿ™‚

hallow mortar
#

You can try the Emitter 3Ditor mod to get a more visual way of experimenting with it. It'll let you export the parameters to an SQF-ready format. (It's still complex and sometimes unstable, but at least you can see what you're doing.)

proven charm
#

hmm does it support rectangle areas or ellipses? All i found was setParticleCircle

hallow mortar
#

setParticleRandom also contains area randomisation. It's probably ellipse (well, 3D ellipse/spheroid) but I don't know for 100% sure.

proven charm
#

ok thx

wind sapphire
#

Thanks you for that feedback. I will try setting the drivers's combat behavior to "CARELESS" and skipping forceFollowRoads and report back.

faint burrow
#

I use such code for group:

{
    deleteWaypoint _x;
} forEachReversed (waypoints _group);

_group setBehaviourStrong "CARELESS";

Such code for waypoints:

_waypoint setWaypointBehaviour "SAFE";

I also have a monitor script that periodically runs such code:

_groupLeader = leader _group;
_groupLeaderVehicle = objectParent _groupLeader;

{
    if (((abs (speed _x)) >= 5) or { (behaviour (effectiveCommander _x)) == "COMBAT" }) then {
        continue;
    };

    if (_x == _groupLeaderVehicle) then {
        _waypoint = [_group, currentWaypoint _group];
        _waypointPosition = waypointPosition _waypoint;

        if ((_x distance2D _waypointPosition) > ((waypointCompletionRadius _waypoint) max 10)) then {
            _x doMove _waypointPosition;
        };
    } else {
        if ((_x distance _groupLeaderVehicle) > 50) then {
            _x doFollow _groupLeader;
        };
    };
} forEach _vehicles;

In general it works, but not ideally -- sometimes either leader's vehicle, or the others, or all of them get stuck.

wind sapphire
#

Thank you - I will give this a try

stable dune
# proven charm how do you make smoke effect similar to when buildings get destroyed? I need tha...

Do You have some example?
I mean if you have some house "explosion" effect what you do wanna use.
You can get all particles that are used on explosion from config and you could use those.

_object = curatorSelected select 0 select 0;
_pos01 = getPosATL _object;
_source01 = "#particlesource" createVehicleLocal _pos01;
_source01 setParticleClass "HousePartDust";
_source01 attachTo [_object, [0,0,0]];

from

class Land_u_Shop_01_V1_F: Land_i_Shop_01_V1_F
{ ..
    class HitPoints
    {
        class Hitzone_1_hitpoint
        {
            armor = 0.6;
            material = -1;
            name = "Dam_1";
            visual = "DamT_1";
            passThrough = 0.4;
            radius = 0.4;
            convexComponent = "Dam_1";
            explosionShielding = 20;
            minimalHit = 0.02;
            class DestructionEffects
            {
                class Dust
                    {
                        simulation = "particles";
                        type = "HousePartDust";
                        position = "Dam_1_effects";
                        intensity = 1;
                        interval = 1;
                        lifeTime = 0.01;
                    };
.....
stable dune
proven charm
#

yeah the _emitter2 that Nikko posted looks promising

kindred zephyr
#

there are even "evil eyes" particles, its one of those that start with "alk", its pretty goofy haha

fleet sand
#

Quick question why do i have to remoteExec these commands to show on hosted MP ?
I put them in init of a AI. When i just use switchMove they dont show but when i RE they show ?

[this,"Acts_ExecutionVictim_Loop"] remoteExec ["switchMove",2];
[this,"Acts_ExecutionVictim_Loop"] remoteExec ["playMoveNow",2];
kindred zephyr
#

due to the locality of the unit

#

if the unit is not local, it doesnt matter if the execution is global

#

using 2 suggest you are using a dedi or someone is hosting, so the unit is most likely local to those instance and you are trying to execute the code remotely

#

remoteExec the whole code you are doing and let the server/host handle the rest

fleet sand
kindred zephyr
#

otherwise you end up flooding the server with RE requests

kindred zephyr
#

Local Argument commands can sometimes not make sense, most of them predate the times of remoteExecute. Some other are like that by design.
Specifically speaking anything before 1.58 I think? I dont remember when was that introduced.

fleet sand
#

ok Big thanks.

flint topaz
#

[0, -2] select isDedicated using this idea will always make it run globally correctly in hosted MP or dedicated

#

but yeah hosted multiplayer is 2 2 is the server

#

this is an optimisation though, to avoid dedicated servers running code they don't need to

fleet sand
faint burrow
fleet sand
flint topaz
#

yeah and -2 is to everyone but the server

fleet sand
#

Wouldnt that mean that command would run that many times how many players are on the server ?

flint topaz
#

depends what context you are using it

kindred zephyr
# flint topaz this is an optimisation though, to avoid dedicated servers running code they don...

There is an argument to be made here imo though, it really depends on how often you need to remote execute.

You are more prone to have a worse performance by spamming RE and creating artificial latency of execution + scheduler on your side than letting the server handle it completely.

I guess it varies according to how often its planned to be executed and the complexity of whats being executed.

flint topaz
#

Yes I've read the doc aswell

fleet sand
flint topaz
#

then you don't need to remoteExec

#

as that will run on each client when they connect

fleet sand
flint topaz
#

including the server

kindred zephyr
#

init runs it on everyone

#

the reason of why its not working its likely due to you units not being fully initialized or unavailable to animate on startup

fleet sand
flint topaz
#

I would recommend using a delay, spawn the statement and put a sleep or use waitUntil, However finding a better trigger case may be better

kindred zephyr
#

spawn the code in the init and give it a half second sleep

flint topaz
#

for example RespawnEH

kindred zephyr
#

yup

hallow mortar
#

I would not recommend using a "bare" init field for this as every machine runs their own local copy when they start the mission - including when they join mid-mission. A client joining in progress will send a new instruction to the server/other clients, causing the animation to reset, or start again if it's stopped

stable dune
#

Hmm.
PlayMoveNow in examples in spawn, so it needs a scheduled event?

hallow mortar
flint topaz
#

I'll leave you guys to it there is plenty of people who can help here atm

hallow mortar
fleet sand
kindred zephyr
#

ye

hallow mortar
#

I'd usually put the isServer check outside the spawn, so the clients aren't spawning an unnecessary thread

flint topaz
#

you would want the server check flipped and I would recommend isDedicated

#

and putting it outside of the spawn is a good shout

hallow mortar
kindred zephyr
#

I love the fresh smell of optimisation in the morning

flint topaz
#

that would only switchMove on the server

hallow mortar
#

Yes, that's the intention

flint topaz
#

right, but then nobody is going to see it?

hallow mortar
#

switchMove is a Local Argument / Global Effect command

flint topaz
#

ohh nm

#

it's a looped animation

fleet sand
#

Ok and last question when i have code that adds ace interaction would i need to remoteExec the code that is inside the interaction if i want for everybody to see it ?

private _hostageAction = ["LEG_ReleaseHostage","Prepare Hostage","",{
    params ["_target"];
    [5, [_target], {
        params ["_args"];
        private _obj = _args#0;
        [_obj,""] remoteExec ["switchMove",[0,-2] select isDedicated];
        [_obj, true] call ACE_captives_fnc_setSurrendered;
        [_obj, true, objnull] call ACE_captives_fnc_setHandcuffed;
        [_obj,0,["ACE_MainActions","LEG_ReleaseHostage"]] call ace_interact_menu_fnc_removeActionFromObject;
    }, {hint "Failure!"}, "Preparing Hostage."] call ace_common_fnc_progressBar;
},{true},{},[], [0,0,0], 100] call ace_interact_menu_fnc_createAction;
[this, 0, ["ACE_MainActions"], _hostageAction] call ace_interact_menu_fnc_addActionToObject;
kindred zephyr
#

if its intended to be there from the very beggining I would suggest doing a function and use initLocal

hallow mortar
flint topaz
#

I misunderstood the intention

#

I thought we were making them complete an action once you loaded

fleet sand
flint topaz
kindred zephyr
#

are ace actions propagated by default?

cobalt path
#

question, does anyone know whats the issue with this? I am trying to spawn a missile and make it hit the target. target is a helo, and missile should spawn behind it at an angle

_position = AGLtoASL (mfammotarget1 getRelPos [2000, 170]) vectorAdd [0,0,-10];
[[_position], "ammo_Missile_AA_R77", mfammotarget1, 900, false, [0,0,0.25]] spawn BIS_fnc_exp_camp_guidedProjectile;
#

mfammotarget1 is the helo

#

I get fn_guideprojectile invalid position, not a 3d vector

winter rose
#

you wrap it in another array

fleet sand
cobalt path
#

oh

#

I see

ornate whale
warm hedge
#

It is AFM only command

hallow mortar
#

RTD commands require the helo to use AFM. I don't think helos use AFM unless a player with AFM is the current pilot.

ornate whale
#

I have it ON:

#

Even when I am inside.

warm hedge
#

Then what do you do actually

ornate whale
#

This gives an ; error: heli setThrottleRTD [0.5, -1];
And this does nothing: heli setEngineRpmRTD [500, -1];

#

And this one just almost turns the engine off, though idle is ~4000RPM:
heli setWantedRPMRTD [3900, 10, 0];

hallow mortar
#

setThrottleRTD has a game version indicator for Take On Helicopters but not Arma 3. It may not exist in this game.

warm hedge
#

Indeed it is not

junior moat
#

hey just asking why wont this work?

["6", [formatText ["%1", image "images\buried_treasure_map.paa"], "Find the buried treasure", ""]] call BIS_fnc_taskSetDescription;
``` I just get an error from inside the `BIS_fnc_taskSetDescription` function
warm hedge
#

Likely because formatText returns Structured Text not String

junior moat
#

ah, so, convert it to string via str()?

faint burrow
#

Just format.

junior moat
#

much appreciated

#

i could just be stupid but it didnt seem to work, i dont get the error anymore though which is good!

faint burrow
#

Incorrect path to the image?

junior moat
#

dont think so, i triple checked

faint burrow
#

hint it.

junior moat
junior moat
#

interesting, hint didnt show anything. like not even an empty box or a sound. just did nothing

faint burrow
junior moat
#

ok i get an image now, but its tiny

faint burrow
#

By the way, you can use size attribute to zoom your image.

junior moat
#

got it, gimme a sec

#

ok i have this:

hint parseText "<img image='image\buried_treasure_map.paa'/>";

but im getting an error again

faint burrow
#

What's the error?

faint burrow
junior moat
#

yea gimme 2 seconds

faint burrow
#

I also see this warning:

17:41:54 Warning Message: Picture image\buried_treasure_map.paa not found

junior moat
#

thats strange because im 100% sure thats the correct directory

#

in my mission root folder, there is a folder called images. and inside that is buried_treasure_map.paa

winter rose
#

images

junior moat
#

FFFFFFFFFFFFFFFFFF

#

uck

faint burrow
#

This is the last error:

17:41:54 Error in expression <};

private ["_text"];

{
_text = _txt param [_forEachIndex,"",["",[]]];
if (t>
17:41:54 Error position: <param [_forEachIndex,"",["",[]]];
if (t>
17:41:54 Error Type Text, expected Array,String
17:41:54 File /temp/bin/A3/Functions_F/Tasks/fn_setTask.sqf..., line 210
As mentioned, you pass text, but must string.

junior moat
#

dude my brain is fucking stupid sometimes

#

if this works now im going to cry ๐Ÿ˜ญ

#

ok no, still the same issue

faint burrow
#

Try

["6", [format ["%1", image "images\buried_treasure_map.paa"], "Find the buried treasure", ""]] call BIS_fnc_taskSetDescription;

or

["6", ["<img image='images\buried_treasure_map.paa'/>", "Find the buried treasure", ""]] call BIS_fnc_taskSetDescription;
junior moat
#

top one didnt work, let me try the bottom one

brave mountain
#

hi guys, does anyone know if its possible to run keyframe camera via trigger somehow?

junior moat
faint burrow
#

As I wrote, you can use size attribute.

junior moat
faint burrow
#

Inside.

junior moat
#

kk lemme try it

#

cant seem to figure this out as well (sorry im being so dumb)

["6", ["<img image='images\buried_treasure_map.paa' size='0.2'/>", "Find the buried treasure", ""]] call BIS_fnc_taskSetDescription;

is this the right place?

faint burrow
#

Yep.

junior moat
#

didnt seem to do anything then

#

i could just manually decrease the size of the image lol, atleast i know how to do that

#

right now its 1024x1024

faint burrow
#

Yes, seems you can't use fractional numbers to zoom out images, but you can use integers (e.g. 2).

junior moat
#

good enough

#

thanks for all the help, im so sorry that i suck at coding ๐Ÿ˜ญ

faint burrow
#

You're welcome!

frozen seal
#

I've got a question about function library attributes https://community.bistudio.com/wiki/Arma_3:_Functions_Library#Attributes
Is my understanding correct that if I run a function with preInit then the mission objects will not exist yet during the execution?

Thing is, I want to edit terrain objects en masse and I've read that for this purpose it's better to use preInit. However I want to effect to be limited only to the area of certain triggers. But triggers don't exist during preInit ๐Ÿ˜ฆ What can I do?

fleet sand
frozen seal
#

(it's a bit more complex actually, I have a few "Include" triggers of different shapes and a few "Exclude" triggers for areas that I don't want affected)

#

I guess technically inArea function allows me to pass trigger dimensions instead of the trigger itself. But where do I cache those between saving the mission in Eden and preInit?

fleet sand
frozen seal
fleet sand
frozen seal
fleet sand
frozen seal
#

for example, let's say I need to remove trees ONLY within this rectangular trigger

#

I can not just use Radius because a rectangle does not have a radius x)

#

So what I'm doing is I'm using nearestTerrainObjects to get all objects in the circle that encapsulates the trigger.
And then I filter out all objects based on whether or not they're inside the rectangle.

fleet sand
frozen seal
#

do they exist in preInit?

fleet sand
#

IDK myb.

frozen seal
#

aight I'll check, might just work, thx!

#

otherwise might have to resort to postInit ๐Ÿ˜ฆ

digital rover
# frozen seal otherwise might have to resort to postInit ๐Ÿ˜ฆ

Why do you think need you to use preInit? It doesn't make much difference in your circumstance. The mission doesn't load until all inits are done either way.

Also, use the inAreaArray command to filter the object list, it's much faster than checking inArea for each object individually.

frozen seal
#

Also inAreaArray will come in handy, thanks!

faint burrow
digital rover
frozen seal
digital rover
#

Or use a random method which isn't truly random

frozen seal
digital rover
#

It will be more reliable

frozen seal
digital rover
#

So the first method is probably your best bet, transferring a single array as part of a remote function call is better than potentially thousands of individual network messages

kindred zephyr
#

Im doing exactly this already on one of my projects, seed your random

#

and you will get the same results for everyone in the session

#

each session the seed token changes and results in different rolls

digital rover
#

For example, your seed could just be the _forEachIndex of the object creation loop.

frozen seal
#

yeah that could work

#

I think that would be more bug prone though, and I'm already getting a bit burned out with my current mission ๐Ÿ˜„ I'll probably go with a single array remotexec

kindred zephyr
#

why would it be bug prone?
A seed always warranties the same sequence in each session

#

the seed itself can always be the same number and will yield different sequences each session, what you gain with it is that you obtain the same sequence in X iteration in a random generation

#

unless im missing some context, this is a map cleaner right?

digital rover
#

Yep, just make sure you always interate over the objects in the same order (and nearestTerrainObjects and inAreaArray are both already deterministic so you don't need to worry.), then use _forEachIndex as the random seed and it'll be the same on each client

#

Just don't modify the triggers during the mission and it'll stay deterministic

#

But for peace of mind the array remoteExec method isn't bad, so do whatever

frozen seal
# kindred zephyr unless im missing some context, this is a map cleaner right?

well in a sense, it's a "no mans land" generator ๐Ÿ˜„
Maybe it's not as bug prone, but I'm just not feeling like making TOO drastic changes to my code at this point.
Debugging sqf is pain and if I mess up during the rng coding and will have to debug this code again I might just abandon the mission, I know myself.

#

remoteExec approach seems more straightforward so I'll preserve my mental resources ๐Ÿ˜„

#

not saying RNG approach is bad or anything, it's just me

kindred zephyr
#

well, if you are willing to take time from the mission startup do the array stuff then. Just be aware that desync can linger for up to 10 minutes after the code finishes spamming network

digital rover
#

A single array transfer won't spam the network, that's the point of that

frozen seal
frozen seal
#

this the end result btw, used to be forest

digital rover
#

Fuck them trees

frozen seal
#

Arma has too little frontline battles and trench warfare for a war simulation game, Ima fix that

#

(hopefully)

kindred zephyr
#

a single big variable data type is no better that multiple smaller messages. Data transfer is not really a3 forte haha. Same with publicVariable iirc.

#

hopefully youll get a good result in the end

digital rover
#

It is better though, with many commands sent over the network there's a chance you get desync in the form of missing objects, and also these objects will have updates sent over the network for the duration of the mission if they are created correctly.

A big array might desync the server whilst it is being sent, but it won't straight up miss parts of the array and also the local objects are better for performance long term.

frozen seal
#

now that I think about it, technically my whole generation of no mans land is one huge loop. I guess what I could do is add a RandomNumbersRequested = 0 variable and use it as seed for the RNG. I would increment this variable each time a new random number is requested. This way I'd get the same sequence of seeds for every client

#

seems like nearestTerrainObjects are ordered by proximity, so the order of elements should be identical among everyone

digital rover
#

Yeah I've done that before

frozen seal
#

hmm did something change with LAN testing for multiplayer?
Arma wiki says:

Select the mods that the host will use (if any)
Launch the game using the Play/Play with Mods button
Select the mods that clients will use
Launch the game again using the Play/Play with Mods button

But when I click Play with Mods for the second time the first instance gets closed

kindred zephyr
#

disable battleye

#

@frozen seal

frozen seal
#

yep that worked ๐Ÿคฆโ€โ™‚๏ธ I've got to sleep more.
Thanks!

gaunt tendon
#

is there a command that outputs a unit vector tangent to an interpolated value from bezierInterpolation?

opal zephyr
#

Anyone know why the diag_captureFrame set of commands dont work? I've tried it on profiling and dev and they just give an error saying theyre missing a semi-colon

delicate hedge
#

how can i get which "add to inventory" functions can be applied to class?

delicate hedge
delicate hedge
granite sky
kindred zephyr
molten tree
#

I've tried searching all over, but can't seem to find anything.

hallow mortar
#

What do you mean?

molten tree
hallow mortar
#

Commands and functions are different

#

Commands are built into the game engine; their "contents" is internal to the game and you can't read it.

molten tree
#

I saw the "Class Rope" and all those attributes, and was hoping I could define a rope before using a command with it.

hallow mortar
#

You can but it requires a config mod, because those are CfgVehicles and CfgNonAIVehicles config classes.

molten tree
#

Yep, which was the plan. However, I also don't want to overwrite the existing rope because that would break the functionality for everything else. I'm not sure how to use, for example, "createRope", but using the specialty rope I was making specifically with that command, and not the standard rope.

hallow mortar
#

Use the rope type parameter for ropeCreate

molten tree
hallow mortar
#

"RopeEnd" is one of things you'd need to change because that refers to the class of the rope end segment to be used. "slingload0" is a memory point on the source vehicle that they're using as the attachment point for the rope - you probably want to change that but it's not related to the rope type.

#

The rope type parameter is the 8th parameter in the main syntax [6th in alt syntax]. You can quickly find it in the list of parameters because it has the "since 2.06" indicator next to it. It doesn't appear in any of the examples, but it's really not hard to use - it's just a string that goes in the 8th [6th] position in the parameters array.

molten tree
#

Going to give it a test. ๐Ÿ™‚

molten tree
#

@hallow mortar Yep! That did the trick, thanks! ๐Ÿ˜„

brave mountain
#

Hi guys, so usually to make an animation "set" to synch I use a game logic, like for the animation "abuse".... so, at first they start synched BUT then they un-synch... why that?

#

I attach units to game logic using this : this attachTo [logic1, [0,0,0]];

cobalt path
#

question, I noticed that not super long ago some more Data Terminals were added to the game. Does anyone know if there is a script to move its "progress bar"?

hallow mortar
#

It's an animation, so you can use animate or animateSource to adjust it, as well as to open or close the terminal. You can look in the object's config to find the names of its animation sources.

#

Note that for that object the animation state ranges are 0-100, not 0-1 as is common.

cobalt path
#

Thanks I will check!

fleet sand
#

Quick question is there a way to switch show/hide state from Show hide module via script ?

frozen seal
# digital rover It is better though, with many commands sent over the network there's a chance y...

Heya just wanted to give a little update on what I ended up doing.
I found a way to spawn the objects without affecting network at all. I've ran my algorithm on the server and saved all the generated objects data into clipboard, then pasted it into a new SQF file which basically only contains this fat array. Since SQF files are part of the mission every client has the same version of this array and is able to generate identical set of objects.

frozen seal
kindred zephyr
frozen seal
kindred zephyr
#

yeah saw that. Nice

hallow mortar
kindred zephyr
frozen seal
haughty timber
#

How do I do a simple addition to a variable again...?

#

I used something along the lines of _variable setVariable ((namespace getVariable _variable) + 3)

kindred zephyr
#

maybe i can give feedback for future reference

eternal spruce
#

this is what i used

Stretcher_1 attachTo [UH60Med_1, [0, 1.5, -1.8]];
Stretcher_2 attachTo [UH60Med_1, [0, 2.5, -1.8]];
Stretcher_2 setDir 90;
Stretcher_2 setDir 90;

kindred zephyr
#

most likely you didnt do anything wrong and its a limitation of the model itself. the interior is not rendered as the exterior in most vehicles

eternal spruce
#

Ok thank you

sullen sigil
#

you're the first thing that's rendered, then its the interior of any vehicles, then everything else (afaik)

spiral trench
#

Yeah @deft zealot do vehicle player action ["gear",vehicle player] - it's a little weird but it works...

nocturne bluff
#

its not odd

#

its correct

spiral trench
#

It just seems weird to consider when in all other (I think) situations you would think <unit> action ["gear",<target>] which works, but only when you get out of the vehicle you are in. In this case though we do <vehicle> action ["gear",<target>] as though the vehicle is a unit capable of opening its own inventory but heh

cedar cape
hallow mortar
#

Where you need to put it depends on when and for who you want it to take effect.

#

For all players, from mission start? Init.sqf, although there's also a description.ext config property you can use for that. At a certain time, for specific players? A trigger and remoteExec could be what you need, or maybe an event handler. There are many possible answers.

nocturne bluff
#

it ties into how arma handles veicles

#

its a bit wonky as is everything in arma

spiral trench
#

Yeah, I get what you're saying and it's just a little unexpected to most people I guess

errant jay
warm hedge
#

Define in somewhere, then use it somewhere

errant jay
#

but how do i define it somewhere?

warm hedge
#

init.sqf or Debug Console or some SQF script or... anywhere

hallow mortar
#

There are two main ways to define a function:

  • Save the function to a variable, using the varname = { function code here }; structure. This must be done in a place that runs before you want to use the function, and it must be done on all machines that will need to execute it, either by the code running on all machines or by one machine saving it and then using publicVariable. init.sqf would be a common place to do this, but keep in mind the Initialisation Order (https://community.bistudio.com/wiki/Initialisation_Order) to make sure you don't try to use it too early.
  • Register the function in the Functions Library (https://community.bistudio.com/wiki/Arma_3:_Functions_Library). This means the function will definitely be available when you need it on all machines. In this case, the function lives in its own sqf file in the mission folder, and the game detects and prepares it for use based on the CfgFunctions definition.
cosmic lichen
#

Anyone here familiar with the Spectator? I want to hide AI units from the list on the left.

I can already hide them from 3D view with BIS_EGSpectator_showAiGroups = false;

But BIS_EGSpectator_allowAiSwitch = false; doesn't seem to hide them from the tree view.

hallow mortar
cosmic lichen
#

@hallow mortar Yeah, its a bit messy. The trick seems to be to not set the variables in mission namespace but in players namespace.

#

The init function then moves them to missionnamespace.

#

The documentation is a bit misleading here

hallow mortar
#

Shocking

errant jay
#

im adding a magazine and a weapon to a vehicle, however once it adds them, it has to reload the weapon, is there any way to load it immediatley or just shorten the time it takes for it to reload the magazine?

hallow mortar
#

The classic way is to add the magazine first

errant jay
#

damn thats embarassing for me

#

but thank you

finite bone
#

Is there a way to convert map grids => 2d coordinates and vise-versa?

warm hedge
#

Do you mean 000-000 format vs position?

finite bone
#

ye

finite bone
#

Ooh I didnt know these functions existed! Thanks ๐Ÿ˜… ๐Ÿ‘๐Ÿป

serene sentinel
#

Hi. Can someone check, what is wrong with that code? Trying to check if player rifle have underbarrel GL, then find magazine for it in box. Something goes wrong (with _HE_compat_mags)

_unitRifle = primaryWeapon player; 
_muzzles = getArray (configFile >> "CfgWeapons" >> _unitRifle >> "muzzles") - ["this", "safe"]; 
 
_gls = _muzzles select { getText (configFile >> "CfgWeapons" >> _unitRifle >> _x >> "cursorAim") == "gl" }; 
_gls_str = _gls select 0; 
 
_compat_mags = compatibleMagazines [_unitRifle, _gls_str]; 
_HE_compat_mags = _compat_mags select {getNumber (configfile >> "CfgAmmo" >> _x >> "indirectHit") > 0};  
_GLinbox = (magazineCargo cont1) arrayIntersect (_HE_compat_mags);
_GL = if ((count _GLinbox) > 0) then { selectrandom _GLinbox } else { "" };
granite sky
#

Magazine classnames are from CfgMagazines, not CfgAmmo. So you have to do a double lookup.

#

After the muzzle lookup you should bail out if _gls is an empty array, but I assume you're testing with a unit with a GL at the moment.

tame bison
#

Tell me please
if you add more than one โ€œ_pos1โ€ to it, then systemChat โ€œtestโ€; duplicates
Tell me how to do it right
The task is: If the player enters a given radius, then execute the code, and not like mine, it is executed several times

{
private _player = _x;    
private _pos1 = [
[[13848.4,18603.3,0],100],
[[13848.4,18603.3,0],100]
];    
    {
    _x params ["_coordinate", "_radius"];
    _pos = (getPos _player distance2D _coordinate < _radius);
            if (_pos) then
            {
                systemChat "test";
                etc...
            };

    } forEach _pos1;
} forEach allPlayers;
granite sky
#

Well, if you put a break; after the systemChat then it'll only trigger once per player, regardless of how many regions that player is within.

tidal idol
#

Any ideas about this error I'm throwing? Previously, I had a string with the default value class name in there which worked fine. I've also attempted using str(_AmmoTypeMissile) but that caused the ammo to delete immediately upon firing. Attempted to debug using a hint str(_AmmoTypeMissile) but that did nothing.
Module config and function script attached.

warm hedge
#

_AmmoTypeMissile is not defined there

tidal idol
#

It is defined in the module with its default value, and in my get-line, I also set the default value as a backup.

#

do I need to pass it as a param?

warm hedge
#

It clearly is not. The Fired EH does not recognize it

tidal idol
#

Here is the module as placed in 3DEN, showing the default values set for the Missile and Shell types in their combo boxes.

warm hedge
#

Still. It is not defined within the EH

tidal idol
warm hedge
#

addEventHandler does not support external arguments to pass

#

You can somehow setVariable getVariable

little raptor
little raptor
warm hedge
#

That won't alter the render queue

opal zephyr
#

Anyone know how to work with a config entry type variable within the console or between string conversions?

granite sky
#

Don't convert it to a string except for logging.

opal zephyr
#

I need to be able to paste it into a editbox, which forces it as a string

granite sky
#

Then you have to use the SQF syntax form, configFile >> "CfgVehicles" etc.

opal zephyr
#

Is there any way to convert that from a string back into text that sqf will recognize?

granite sky
#

maybe. I haven't examined the output syntax.

opal zephyr
#

Alright, I'll look into, thanks for the suggestion

#

call compile seems like it can do it

granite sky
#

Oh, you mean SQF text -> code, yeah.

deft zealot
#

@spiral trench thanks

wispy venture
#

I'm interested in finding out if anyone has developed a mod or script that automates the process of managing class names from mods in Arma 3, specifically for use with ACE Arsenal.
Let's say that i have the mods installed, is there maybe a way to run a .py file or even an .sqf file that would look inside these files and scan for classnames that i can put into the limited arsenal?
Maybe even a script that skips that whole process and just finds everything like the little "^" arrow icon next to the searchbar in eden where you can filter by mod.

#

Wouldn't be suprised if someone has already made such a thing since it's a struggle to make limited arsenals with big gear/weapon mods. Any help would be appreciated.

meager granite
wispy venture
#

It would be a waste of time if i spent time on this, cause it's something that 50% of the "bigger" units already have.

hallow mortar
haughty timber
#

How do I make an Antistasi-like text bar on the top that displays certain text values like variables?

#

I want it to work on each client on a dedicated server

meager granite
#

Get it with uiNamespace getVariable "myCoolBar" to change it later

remote cobalt
#

Hey folks, again a question to which the answer is maybe hidden in the config but I can't for the love of god find it.

There is a function: inRangeOfArtillery but I would like to get the max range of the Artillery (If I am lucky even in meters?).

Is there a way to get it? Or can I somehow calculate it?

meager granite
#

I'm sure there is a formula to get max range of a shell somewhere here

#

But you could also just brute force it and cache the result

sullen sigil
#

if thats something that is fixable i can ticket it ๐Ÿคท

remote cobalt
sullen oar
#

is there a way to make a players weapon into a static? or some way to integrate the idea of the dead man drill for 240 gunners? mostly just looking for a cleaner way than dzn tripods to have mg tripods that also allow the unit to use the weapon without the silly looking tripod on all the time

digital rover
remote cobalt
south swan
little raptor
#

Yes

digital rover
little raptor
#

iirc it's called initSpeed

south swan
#

iirc artilelry has some meme way of redefining muzzle velocity for different charges meowsweats

little raptor
#

Ah yeah I think it used the muzzle config

ivory lake
#

im not sure why airfriction is disabled for it as I think AI are capable of accounting for it when aiming but shrug

digital rover
#

In a vacuum, it's a single formula to determine correct firing angle. With air resistance you have to simulate a path to find the correct solution

ivory lake
#

true

south swan
#

i mean, then you add an artillery piece that shoots, say, 25 km. And then you add an air height/density gradient

#

and then you add another half dozen or so effects into that

little raptor
ivory lake
#

to clarify - airfriction works for shotShell it's the artilleryLock parameter that disables airfriction

south swan
#

or forward observers ๐Ÿคฃ

remote cobalt
south swan
#

sin(90) meowsweats

#

oh, wait, that's 1

#

RIP my trig knowledge

#

yeah, 200*200*1/9.81 seems to match what i've found in some random video meowsweats

digital rover
remote cobalt
unkempt marsh
#

can anyone tell me why my code isn't preserving the vertical axis offset?
this setPos [getPos ball select 0, getPos ball select 1, getPos ball select 2];
[this, ball] call BIS_fnc_attachToRelative;

hallow mortar
#

First of all, rather than selecting each axis of the position individually, just use the whole position in one, e.g. this setPos getPos ball;
Selecting each axis is unnecessary and means you're using six commands, 3 variable retrievals and an array creation when 1 command and 1 variable retrieval will do.

unkempt marsh
hallow mortar
#

Secondly, don't actually use setPos and getPos. They're slow and they do NOT use the same position format as each other. Use set/getPosASL or set/getPosATL. They're faster, and each pair uses the same position format as each other.

unkempt marsh
#

would that matter if they were on the same x and y position? they should have the same surface height no?

hallow mortar
#

setPos and getPos calculate vertical position differently

#

sometimes it turns out the same, often not

unkempt marsh
#

ok, i'll see if that might stop the unit from snapping to the ground

#

YAY