#arma3_scripting

1 messages · Page 138 of 1

hallow mortar
#

modelToWorld is for converting from modelspace coordinates to worldspace coordinates. Positions don't have modelspace coordinates, so...
If you want to get a position relative to another position, in any space, use vectorAdd

#

"mission event handler" means it is added to the mission overall, as opposed to a specific object. Most mission event handlers are not server-specific.
playerViewChanged must be added on whichever machine you want to detect the player's view changing for. It only detects the local player. (A dedicated server doesn't have a player, so it won't do anything if only added on the server and run on DS)

half sapphire
#

yeah that part i got. but then adding it to the player leaves me with non local vehicles not being passed by the _vehicleIn param. since the player doesn't "know" the vehicle (??)

hallow mortar
half sapphire
#

well thats a relieve. i've spent quite some time banging my head creating the UI (1st timer) and hoping "imma make a loopless view distance script!". but it would be worth adding that objectParent has the same issue. if you exec objectParent player (on the player machine) while inside a non local vehicle, you get the player itself as parent. that also seems quite wrong.

#

also, a dedi server DOES "know" var named players. i can server run objectParent "varname" and it does return the correct parent.

hallow mortar
#

objectParent is used for detecting vehicles a player is in (including as a passenger so non-local) in a system I've worked on, and I've never seen any failure to detect vehicles on that basis

half sapphire
#

running objectparent player (on local) while on a non local vehicle also returns the player itself.

#

always talking dedi server here.

hallow mortar
#

btw, be careful about drawing conclusions from the text representation of objects references. For example, if a vehicle doesn't have its own variable name, its text representation will be that of its driver (or possibly effective commander, not sure which). However, the actual object reference is still to the vehicle.

#

Try returning the objectparent's type with typeOf rather than just the object reference

granite sky
#

typeof objectParent player is the quick workaround.

half sapphire
hallow mortar
#

Note that the game's comparison systems (==, isEqualTo) compare the object reference, not its text representation, so the typeOf check is just for human-readability in debugging, not needed for the script's functioning, unless you actually need the type for something

half sapphire
#

this all comes VERY handy. thank you so much

#

i've "smelled" some other tasty commands for 2.18 baking in the oven while browsing commands.

terse tinsel
#

Can you help me how to write a script to add a second rifle with optics to the backpack?

bleak mural
#

not sure where to ask this, but regarding the tac ops DLC, this part says "And More – Listen to newly composed music tracks, unlock additional Steam Achievements, and take advantage of new scripted systems to help create advanced custom Arma 3 scenarios."

#

new scripted systems in the DLC? what exactly does it have?

sullen sigil
#

modules like civilian presence and so on

distant mountain
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
bleak mural
#

Thanks

sweet vine
#

Bit of a long shot here, trying to spawn static weapons on rooftops
Does anyone have a copy of https://forums.bohemia.net/forums/topic/170066-rooftop-static-weapons-script/
Can't seem to find any mission with it that I could salvage it from

proven charm
#

what's the best way to detect key input considering that the key you check maybe bind to some action? Im using KeyDown to check the key input

drifting dome
#

Hello!
I'm making a script for a randomised flyby, and am fairly happy with the results, number and type of planes, start and end positions all work. However towards the end of the plane's flight path, the FPS drops rapidly down to about 30 FPS, for both client and server. I have verified that this is not an issue with the BIS_fnc itself, but seems to be some element of the script that chugs the performance at the end. I have no clue what this could be however, any thoughts?
Thanks in advance!

while {true} do { // While loop, will run the script from exec to mission end
    // sleep (300 + random 600); // Waits at least 5min + random value up to 10min
    sleep 10; // Added for testing reasons
    private _amount = selectRandom [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; // array for how many vehicles should be spawned (array number + 1)
    private _startpos = selectRandom ["flyby1s", "flyby2s", "flyby3s", "flyby4s"]; // array for start positions of the flyby, picks a random one when called
    private _endpos = selectRandom ["flyby1e", "flyby2e", "flyby3e", "flyby4e"]; // array for end positions of the flyby, picks a random one when called
    private _planes = selectRandom ["LIB_P39_w", "LIB_Pe2_2_w"]; // array for the vehicles desired for the flyby, picks a random one when called
    for "_i" from 0 to _amount do { 
        private _existingVehicles = vehicles select {_x isKindOf "air"}; // array of current air vehicles, used later 
        [getMarkerpos _startpos, getMarkerpos _endpos, 300,"FULL", _planes] call BIS_fnc_ambientflyby; 
        private _createdVehArray =  ((vehicles select {_x isKindOf "air"}) - _existingVehicles); // array of all current air vehicles minus _existingVehicles
        if (_createdVehArray isNotEqualTo []) then { 
            private _amountGroup = selectRandom [1, 2, 3, 4, 5]; // array for how many vehicles should be spawned in a group (array number + 1)
            private _createdVeh = _createdVehArray #0; 
            _createdVeh setVelocityModelSpace [0,150,0]; 
            sleep ([2,15] select (_i == _amountGroup)); 
        }; 
    };
};
proven charm
#

are those planes deleted anywhere?

drifting dome
#

the ambientFlyBy function deletes them at the endpoint

proven charm
#

ok

kindred zephyr
proven charm
kindred zephyr
proven charm
kindred zephyr
# proven charm i dont even know how to define actions 😬

Vanilla actions and inputActions:
https://community.bistudio.com/wiki/Arma_3:_Actions
https://community.bistudio.com/wiki/inputAction/actions

How to create new actions and bind them:
https://community.bistudio.com/wiki/UserActions - Mod only
https://community.bistudio.com/wiki/Arma_3:_Modded_Keybinding (This is specially relevant since this one is not binded to an unit class) - Mod only

How to check actions using EH:
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#UserAction_Event_Handlers

You can technically check actions added by the addAction command by just checking the shortcuts defined for them (if any)

proven charm
kindred zephyr
#

np, hope that help you

proven charm
#

so actions can be created only via mod?

winter rose
#

no, scripts too

kindred zephyr
#

totally new defined action yes, but as mentioned before, you can technically check for an action created by addAction by using the shortcut instead, as those are not able to have a named reference, only numerical reference that is binded to the object itself

proven charm
#

ok thx

bleak gulch
proven charm
winter rose
#

oh, actions as in unit action [] - yes

proven charm
#

well i guess using addaction and mapping Use Action 1 to that works. havent yet figured how to make more input actions via script

granite sky
#

It's a bit of a faff to set up but it seems to work well.

#

Ah never mind, was scrolled up.

proper sigil
#

Hey lads! I have problem with a function that works perfectly fine in local test but naturally behaves awkwardly on dedicated server. In summary what function does it:

  1. Removes all actions on object which creates action and calls some other function to get an array of string values from inidb2 DB - function is fine as different script also relies on it and gets data just finde, confiremd by diag_log. DB output is something like that ["RTT","RTT","Tank"] and then it self intersect so for later use we have ["RTT","Tank"]

  2. Creates an action on object (panel). Upon interaction it removes original action (using removeAllActions) and then creates an action for each unique item in DB output (in this example we'd have 2 actions)

  3. On interaction a function to spawn a vehicle is called and this one is tested as well. On interaction the function is also called again to start over

The problem is on server the function only seems to go to certain piece of code and does not execute further addActions

The function is at first called from object init field like this

null = [this] spawn {waitUntil {!isNil "DNT_phantomSpawn"}; [(_this select 0), phantSpawn] call DNT_phantomSpawn};

#

Functions seems to be stopping here


    params ["_spawnPanel", "_spawnLocation"];
    
    private _garageVehicles = call DNT_clientReadsVicsFromDb;
    
    private _garageVehiclesDistinct = _garageVehicles arrayIntersect _garageVehicles;
    
    private _casperVehicles = ["Delta Starfighter", "Y-Wing", "ARC-170", "LAAT C", "LAAT I", "V-Wing", "Z-95 HeadHunter", "Nu A-Class Shuttle", "Transport Ship"]; 
    
    _garageVehiclesDistinct = _garageVehiclesDistinct - _casperVehicles;
    
    removeAllActions _spawnPanel;
    
    _spawnPanel addAction ["Login to vehicle dispenser...",{
        
        params ["_target", "_caller", "_actionId"];
        
        private _garageVehiclesDistinct = _this select 3 select 0;
        
        private _spawnLocation = _this select 3 select 1;
        
        private _actionText = "";
        
        removeAllActions _target; // Does not seem to go any further

...
#

Rest of code

            _actionText = format ["Select %1", _x];
            _target addAction [_actionText,{
            
                params ["_target", "_caller", "_actionId"]; 
                private _vicType = _this select 3 select 0;
                private _spawnLocation = _this select 3 select 1;
                private _subTypesClasses = [_vicType, _target, _actionId] call DNT_phantomSpawnActions;
                removeAllActions _target;
                
                {
                    _actionText = format ["<t color = '#ff0000'>Deploy %1</t>", _x select 0];
                    _target addAction [_actionText, {
                    
                        params ["_target", "_caller", "_actionId"];
                        
                        private _vicClass = _this select 3 select 0;
                        private _spawnLocation = _this select 3 select 1;
                        
                        [_spawnLocation, _vicClass] remoteExec ["DNT_spawnVehicleFromGarage"];
                        
                        [_target, _spawnLocation] remoteExec ["DNT_phantomSpawn"];
                    
                    },[_x select 1, _spawnLocation],1.5,true,true,"","true",10,false,"",""];

        }forEach _subTypesClasses;
            
    },[_x, _spawnLocation],1.5,true,true,"","true",10,false,"",""];
            
        
}forEach _garageVehiclesDistinct;
        
},[_garageVehiclesDistinct, _spawnLocation],1.5,true,true,"","true",10,false,"",""];
granite sky
#

Does call DNT_clientReadsVicsFromDb actually work from the client?

#

I assume the forEach is running on _garageVehiclesDistinct.

#

Ah whatever. It feels like you're making assumptions about where the code "stops working". Put more diag_logs in there.

proper sigil
proper sigil
granite sky
#

It's really hard to read nested addActions anyway, especially when your indentation is messed up.

proper sigil
#

Lol, it doesn't really matter as it seems it works now xD

#

Idk even why but I'll take it as it is lol

proven charm
undone flower
#

what's a good execution time for a O(n) script?

#

worst case N best case 1

winter rose
#

the smallest

undone flower
#

🧠

proven charm
#

@undone flower use debug console to test script speeds

hallow mortar
#

The debug console tells you the numbers, but it doesn't tell you what the numbers mean, which was the question

proven charm
#

yea i know, but you can do your own comparisons then

undone flower
tender fossil
#

Also while the Big O notation / time complexity is often very useful thing when optimizing code performance, it doesn't take e.g. the hardware part into account. Things like cache coherence can speed up the execution of seemingly slower code so that it actually beats the theoretically faster solution

gusty surge
kindred zephyr
#

tbf, HandleDamage has a disclaimer for remote units. If you are going to check damage, check on the machine to which the unit is local to, saves you troubles.

#

oh nvm, I misunderstood lol

sudden yacht
#

is it possible to get magazine for current weapon and then add it?

warm hedge
#

currentMagazine and addMagazine

sudden yacht
#

ty

tight cloak
#

"error reserved variable in expression" error line is apparently the onframehandle

_startPos = getposATL fr_frigate;
_endPos = getPosATL fr_end;
_controlPointATL = getposATL fr_controlpoint;
fromcontrolpointoffset = _controlPointATL vectorDiff _startPos;
tocontrolpointoffset = _endPos vectorDiff _controlPointATL;
t1 = time;
t2 = time + 30;
onEachFrame = {
    timeremaining = linearConversion [t1, t2, time, 0, 1];
    fr_frigate setVelocityTransformation [
    _startPos vectorAdd (fromcontrolpointoffset vectorMultiply interval),
    _controlPointATL vectorAdd (tocontrolpointoffset vectorMultiply interval),
    [0,0,0],
    [0,0,0],
    [0,1,0],
    [1,0,0],
    [0,0,1],
    [0,1,0],
    timeremaining
];

};
fair drum
#

name it something else

tight cloak
#

ahh i see

fair drum
#

also, use the EH version

tight cloak
#

whats the EH versions name?

tight cloak
#

something like this?

addMissionEventHandler ["EachFrame", {
    timeremaining = linearConversion [t1, t2, time, 0, 1];
    fr_frigate setVelocityTransformation [
    _startPos vectorAdd (fromcontrolpointoffset vectorMultiply interval),
    _controlPointATL vectorAdd (tocontrolpointoffset vectorMultiply interval),
    [0,0,0],
    [0,0,0],
    [0,1,0],
    [1,0,0],
    [0,0,1],
    [0,1,0],
    timeremaining
];}];
fair drum
#

and it also returns a handle that you can use to remove it as well

tight cloak
#

just given it one

#

got a new error now

#

setvelocitytransformation "0 elements provided, 3 expected"

rich bramble
#

What's the limit on arrays that was introduced in 1.54? I've got some code involving some very large arrays and "setVariabble" (global) that suddenly started failing with 1.54

tight cloak
#

is that a position related error?

#
_startPos = getposATL fr_frigatephys;
_endPos = getPosATL fr_end;
_controlPointATL = getposATL fr_controlpoint;
fromcontrolpointoffset = _controlPointATL vectorDiff _startPos;
tocontrolpointoffset = _endPos vectorDiff _controlPointATL;
t1 = time;
t2 = time + 30;

fr_event = addMissionEventHandler ["EachFrame", {
    interval = linearConversion [t1, t2, time, 0, 1];
    fr_frigatephys setVelocityTransformation [
    _startPos vectorAdd (fromControlPointOffset vectorMultiply interval),
    _controlPointATL vectorAdd (toControlPointOffset vectorMultiply interval),
    [0,0,0],
    [0,0,0],
    [0,1,0],
    [1,0,0],
    [0,0,1],
    [0,1,0],
    interval
];}];
hallow mortar
#

Your _startPos and _controlPointATL variables are private variables defined the script that adds the EH; they are not available in the EH code because it's a separate scope.

tight cloak
#

so what do i do to push it into the scope

hallow mortar
#

I guess. You should use more unique names for global variables, though. Generic names can potentially get overwritten by other scripts by accident.
You could also consider saving them in the object's namespace with setVariable/getVariable, rather than leaving them in the overall mission namespace. That would let you have multiple objects being operated on at once without conflict.

#

Oh you changed your post while I was typing that :U

tight cloak
#

i changed it because it didnt work

#

XD

#

gonna try something quick

hallow mortar
#

It should have, as long as you changed them to global vars in all instances

#

However, there is a better way

#

That would be the best method as it's fast, convenient, and doesn't require anything to be global

#

You should be able to change everything except interval (because it has to be modified and persist between firings) to be passed as arguments

#

interval should get a more unique name and possibly be moved into the object namespace, though

tight cloak
#

so override the interval constantly through setvariable and then retrieve it on the interval line

#

is there a more efficient way to slowly scale the interval?

#

linear conversion stutters alot

granite sky
#

that's probably not the issue. Your code for that looks fine.

tight cloak
#

any idea then?

granite sky
#

Is your testbed SP or DS+client?

tight cloak
#

SP currently

#

will it work better on DS

granite sky
#

oh actually, you do need to set a velocity that makes sense.

#

DS just adds extra problems.

tight cloak
#

i figured

#

how on earth would i set a velocity that makes sense when i just want it to move from point a to b

#

with a nice curve

granite sky
#

You're moving from a known point to a known point in 30 seconds, right

tight cloak
#

yes

meager granite
#

Client 1:

hs = createHashMapFromArray [["a", 1], ["b", 2]];
hs2 = createHashMapFromArray [["one", hs], ["two", hs]];
publicVariable "hs2";
hs2 get "one" set ["a", 100];
hs2
``` => `[["two",[["a",100],["b",2]]],["one",[["a",100],["b",2]]]]`
Client 2:
```sqf
hs2 get "one" set ["a", 100];
hs2
``` => `[["two",[["a",1],["b",2]]],["one",[["a",100],["b",2]]]]`
#

Interesting property of hashmaps and I guess arrays after network deserialization

meager granite
#

I assume there is no way to instantly reload the magazine without re-adding the weapon?

bleak mural
#

with a condition of "call {true}" and an activation of

#
call{{if ((side _x) == east) then {_x addEventHandler ["FiredMan", {_shotPos = [_this select 6,(random 4), (RANDOM 360)] call BIS_fnc_relPos; _this select 6 setPos [_shotPos select 0, _shotPos select 1, _shotPos select 2];}];}} forEach allUnits;}
#

how much can something like this impact performance in large scenarios?

#

as far as im aware EH's are very performance friendly but i cant help but think this is alot to process for the CPU

meager granite
#

Don't know how triggers work much, but I assume you execute this code only once?

#

If you do, if you'll have more units afterwards they won't have this event handler on them

#

Btw this code is pretty weird, you'll end up with bullets inside walls and such, could be very bad for say missiles

#

If you want to degrade accuracy you can do something like:

private _shot = _this select 6;
private _degrade = 5;
_shot setVelocityModelSpace (velocityModelSpace _shot vectorAdd [_degrade/-2 + random _degrade, 0, _degrade/2 + random _degrade]);
bleak mural
meager granite
#

What's your idea for it? Add event handler to all units?

bleak mural
#

essentially yes my initial idea was to reduce accuracy for all units,but yes i noticed too high values resulted in infantry firing a rifle forward and the guy standing to his left recieving the bullet 😄

meager granite
#

With repeatable you'll end up adding the event handler over and over

#

so each shot does like 100 repositions

bleak mural
#

I essentially just want to add a dispersion to enemy vehicles now

#

and static turrets

bleak mural
meager granite
#

Maybe it could be done with triggers but I don't use them to tell exactly how

bleak mural
meager granite
#

This is for Fired/FiredMan event handlers

#

How I'd do it: Make a preInit function that executes:

addMissionEventHandler ["EntityCreated", {
    if(_this isKindOf "CAManBase") then {
        if(side group _this == opfor) then {
            _this addEventHandler ["FiredMan", {
                private _shot = _this select 6;
                private _degrade = 5;
                _shot setVelocityModelSpace (velocityModelSpace _shot vectorAdd [_degrade/-2 + random _degrade, 0, _degrade/2 + random _degrade]);
                systemChat str [diag_frameno toFixed 0, "Degraded shot for", _this select 0];
            }];
        };
    };
}];
grim cliff
#

hey can someone help me out with this:

if !(isNil _mags) then {_holder addMagazineCargoGlobal [_mags, _count2];} 
                            else {diag_log format["Bad magazine array for: %1",_loot];}

for some reason i keep getting this in the log:

"Bad magazine array for: bin\config.bin/CfgWeapons/sgun_aa40_snake_Holo_IR_snd_lxWS"

when the magazine that should have been added to _holder should have been "8Rnd_12Gauge_AA40_Smoke_Snake_lxWS"

meager granite
#

I'm not sure if adding EntityCreated in preInit will have editor placed stuff go through it, but I think it should

meager granite
bleak mural
#

very interested in something simple now just for vehicle gunners, would this apply to a vehicle init or gunner ai?

#
private _shot = _this select 6;
private _degrade = 5;
_shot setVelocityModelSpace (velocityModelSpace _shot vectorAdd [_degrade/-2 + random _degrade, 0, _degrade/2 + random _degrade]);
meager granite
#

Check if unit is inside a vehicle before doing thata

grim cliff
#

am i supposed to put the variable name in doublequotes like that?

meager granite
#

Yes, there is isNil STRING and isNil CODE

#

isNil _mags will check if variable with NAME contained inside _mags exists

#

isNil"_mags" will check if variable NAMED _mags exists

grim cliff
#

Ahhh i see thank you!

meager granite
#
private _var_to_check = "_somevar";
isNil _var_to_check; // Checks if _somevar exists => false
isNil"_var_to_check"; // Checks if _var_to_check exists => true
isNil{_var_to_check}; // Checks if _var_to_check exists => true
meager granite
#

You can also do it with Fired too but you'll need to add it to every vehicle instead

#
addMissionEventHandler ["EntityCreated", {
    if(_this isKindOf "CAManBase") then {
        if(side group _this == opfor) then {
            _this addEventHandler ["FiredMan", {
                if(!isNull objectParent(_this select 0)) then {
                    private _shot = _this select 6;
                    private _degrade = 5;
                    _shot setVelocityModelSpace (velocityModelSpace _shot vectorAdd [_degrade/-2 + random _degrade, 0, _degrade/2 + random _degrade]);
                    systemChat str [diag_frameno toFixed 0, "Degraded shot for", _this select 0];
                };
            }];
        };
    };
}];
#

if(!isNull objectParent(_this select 0)) then { will check if unit is inside a vehicle before applying the accuracy degradation

bleak mural
meager granite
#

Gonna take copy-pasting the init fields though

#

But up to you

bleak mural
#

so the above on each vehicle but not gunner right?

meager granite
#

Do a this call someFuncToAddMyEventHandlers instead of whole code

meager granite
bleak mural
#

ohh i see

#

can it be a simplified version of fired,that i can apply to a a specific unit/vehicle?

#

i just have 20 vehicles on opfor i want to edit essentially

#

to reduce their accuracy by ANY means

meager granite
#

Add Fired in each init field

#

or better call function that adds Fired

#

So you don't have to copy-paste same stuff over and over

indigo snow
#

Read the wiki entry on arrays

#

"arrays are limited to maximum of 999999 (sometimes 1000000) elements"

bleak mural
# meager granite Add `Fired` in each init field

thanks man. im more familiar with using the editor,and unit inits and working right from there, iv decided to alter my original and use it on a per unit init basis such as tank gunner/commander without the needs of triggers

#
this addEventHandler ["FiredMan", {_shotPos = [_this select 6,(random 10), (RANDOM 360)] call BIS_fnc_relPos; _this select 6 setPos [_shotPos select 0, _shotPos select 1, _shotPos select 2];}];
#

random 10 being configurable

meager granite
#

Move this into a function and have units call the function

#

So you don't have to copy-paste same thing exactly

bleak mural
#

can you link me a good tutorial on that by chance?

#

havent dabbled with it before

bleak mural
#

thanks

meager granite
#

Define your function, the call it in init field

bleak mural
#

bout time i learned that

sharp grotto
#

If you have a mission you can also be lazy and fast and add functions via init.sqf / initPlayerlocal.sqf / initServer.sqf in your missionfile.

{
    missionNamespace setVariable [(_x #0), compileScript [_x #1]];
} forEach
[
    ["ABC_fnc_A1","ClientCode\ABC_fnc_A1.sqf"],
    ["ABC_fnc_A2","ClientCode\ABC_fnc_A2.sqf"]
];
inland iris
#

its not even that hard as well

polar belfry
#

does arma have else if

#

like
if (condition) then {}
elseif (condition) then
else

hallow mortar
#

No, but you can produce similar behaviour by other means

polar belfry
#

how?

hallow mortar
#

If you give me 20 seconds to type it I'll tell you :U

polar belfry
#

sorry. take your time

hallow mortar
polar belfry
#

thanks

rich bramble
#

Thanks! I didn't even think to look at that, that's how bad BIS have usually been with updating the wiki :P (in the past, the last few months were a really nice change :) )

polar belfry
#

I have a question is there a command that would be gettting AGL inseatd of ASL or ATL

#

I read something about just getpos

winter rose
polar belfry
#

I want it for my calculations of altitude of my players for code I did like if you are above ground under 1700m but under 10m (they are landed on the runway ) the code doesn't do anything. If you are over 1700m then the code does thing 1, if under 1700m the code does thing 2. Actually writing this I realize it could be cheesy to do so

#

and taxing probably to the server

#

I thought what if someone flies like the way the provided diagram in wiki shows

#

is it dumb

#

what type does arma use for plane altitude in the gui

sullen sigil
#

i think its a combination of ASL and ATL..?

indigo snow
#

The wiki has been on point for at least the last two years in my experience. If not BIS updating it, it would be KK and the other splendid contributors

rich bramble
#

Yeah. I guess scripting has been covered quite well for some time now, it's a shame that config/toolchain stuff doesn't get the same love :(

sullen marsh
#

Mostly on point

winter rose
vapid dune
#

Hi there, how do I pass a variable to selection in addAction? It requires string, but I want to make dynamic code without making separate function for every door.
I tried {format ["Door_%1", _doorNum]}both with and without quotes, tried "{format ['Door_%1', _doorNum]}", and nothing works.

warm hedge
#

Without quote, without outer bracket

#

format returns a string already

vapid dune
#

Uhm, I thought I tried this, thank you

rich bramble
pastel pier
#

Is there a way to automatically escape strings with brackets in it?
Example:
Instructions:
'["vn_fnc","x-coordinates","y-coordinats","response","ammo_type"]
"vn_fnc" can ONLY be one of these three: "vn_fnc_artillery_arc_light","vn_fnc_artillery_plane" and "vn_fnc_artillery_heli".
The user will try and call a grid reference most of the time existing of 6 numbers. You need to split it into x-coordinates and y-coordinates.
DO NOT CHANGE THE NUMBERS you split.
"response" is always a forward air controller talking to forward observer on the ground.'
I know how to escape in python but not sure how to make it work in arma.

proven charm
vapid dune
#

Doesn't SQF have else if?

sullen sigil
#

no

warm hedge
#

No

vapid dune
#

I'm confused

sullen sigil
modern osprey
#

Good afternoon

I create a "Titan_AT" projectile and set it via the player's "setShotParent".

However, for some reason in Kill eventhandler both killer and instigator are zero

#

What could be the matter?

sullen sigil
#

where is setshotparents executed

modern osprey
winter rose
#

Crime Alley

bleak mural
#

can someone point out the syntax error and explain why?

#
this addAction 
["skip 5 hours", {skipTime 5},  
"_this distance _target < 5" 
]; 
#

works ok but im getting "bool" error

bleak mural
#

oh🤦‍♂️

#

dont know how i didnt notice

winter rose
#
this addAction [
  "skip 5 hours",
  { skipTime 5 },
  "",
  nil,      // arguments
  1.5,      // priority
  true,     // showWindow
  true,     // hideOnUse
  "",       // shortcut
  "true",   // condition
  5         // radius - here is where you may be interested
];
#

@bleak mural ↑

hallow mortar
undone flower
#

real quick question how do I get the class name of a vehicle

hallow mortar
#

typeOf _vehicle, in a script.
If you're in the Editor, you can mouseover it, or rightclick and select Log > Log Classes to Clipboard.

undone flower
#

OH TYPEOF how did I forget about it

#

thanks

modern osprey
undone flower
#

any way to make this forEach better?

AllowedVehicleClasses in an unsorted string array

{
    if(_x in _category) exitWith{
        _canAttach = true;
    }
} forEach FABHH_mmv_AllowedVehicleClasses;

I'm hitting 0.01ms in my PC, but I have no idea if that's any good

granite sky
#

findAny

cosmic lichen
#

What's the best way to disable teamswitch in an SP/MP scenario? enableTeamSwitch = 0 has no effect in SP

proven charm
cosmic lichen
#

Totally.

#

Prevent access to the menu.

#

I guess I have to use an EH + disable the button in the pause menu

proven charm
#

i wish i could help you but im under impression the team switch is not even enabled by default

winter rose
hasty gate
#

does anyone know what config specifies or is used to calculate in game velocity of a projectile? Let's say of 40mm grenade, ammo G_40mm_HE, mag 1Rnd_HE_Grenade_shell? (that is used in example in RHS M4)

hallow mortar
#

I believe it's the ammo initSpeed combined with something from the weapon config (representing barrel length). Then over time the ammo's drag config, and acceleration if it has it, also affects it.

ivory lake
#

its initSpeed in the magazine for the muzzle velocity
airFriction is how much the speed is reduced and is in the cfgammo

#

weapons can modify initspeed too

hasty gate
#

@ivory lake and @hallow mortar thanks, I'll give it a try

hallow mortar
#

initSpeed being magazine instead of ammo makes me very sad

drifting spire
#

Hey! I'm working on a pretty classic vehicle ambush where a convoy's lead vehicle getting blown up by an IED is an initiator for an ambush. How do I ensure the enemy infantry don't open fire until the lead vehicle is destroyed?

tight cloak
#

Then use a trigger that relies on a !Alive vehiclename to re-enable and maybe a look at or do target

#

They will track but won't shoot. Vehicle goes up in flames they open up

winter rose
drifting spire
#

I use a couple of AI enhancing mods which I think will, unfortuntely, mess with that. Do you think it'd be a better idea to set them as civilian?

winter rose
#

remove all their ammo 😂

#

in that case then disableAI (move, target, etc) is better.

drifting spire
#

Got it

drowsy geyser
#

maybe this?

{_x disableAI "TARGET";} forEach (allUnits select {side _x == east});
waitUntil {damage leadVehicle >= 1};
{_x enableAI "TARGET";} forEach (allUnits select {side _x == east});
drifting spire
#

Still waiting for 2.18 😦

#

It'd be nice just to disable fireweapon

drifting spire
winter rose
#

(please use my waitUntil, waiting on disabled/destroyed vehicle)

drifting spire
#

Got it.

bleak gulch
meager granite
bleak gulch
#

It seems it's not bug or glitch because after deserialization there are two separate copies of the same array which aren't affected by the SET command

#

so we have two references which linked to the two different arrays

#

it's a bit inconsistant to send the local reference over the network

#

so basically we have this:

pseudo:

array1 = [1, 2];
array2 = [array1, array1];
    IS
array1 = [number(1), number(2)];
array2 = [unique_ref_array1, unique_ref_array1];

publicVariable "array2";

array2 is [unique_ref_unnamed_array_7345, unique_ref_unnamed_array_2948d]; 
drifting spire
#

a real life pseudo code user?

bleak gulch
#

as unique_id_unnamed_array_7345 is not linked with unique_id_unnamed_array_2948d anymore, they refer to the separate arrays after transfering to the other machines.

#

As workaround you can utilize EH which accepts unique_ref_array1
and assembles array2 locally from the received data. As an advantage - it saves network bandwidth / performance by not sending the whole array2, but only part of the data (array1).

#

publicVariable article on the BIS Wiki:

It is not possible (and illogical) to transfer a local entity reference, such as scripts, displays or local objects.
Also, note that Team Member is not supported.

modern osprey
#

Is there some kind of eventhandler to connect the terminal to the drone?

winter rose
modern osprey
velvet knoll
#
/* player addAction ["Get in the turret"]; {Player moveInGunner AATurretOlive_1}; */
#

hmm

winter rose
#

wat

velvet knoll
#

nvm, i figured it out

velvet knoll
granite sky
#

Paste it into the Advanced Developer Tools console, works pretty well.

undone flower
#

is it possible to know, through the fired event handler, on a dynamic loadout vehicle, which pylon was used?

warm hedge
#

Seems that's a no. What is your goal to get the pylon?

undone flower
#

regenerate ammo on pylons after a certain time

#

for that I check if the magazineTurretAmmo is 0

#

then I iterate through getAllPylonsInfo using the _magazine from the fired EH to find the magazine that is also used by the pylons

#
{
    if (_magazine == _x select 3) then {
        _thisvehicle setAmmoOnPylon [_forEachIndex+1, 9000];
        systemChat format["set ammo on pylon %1", _forEachIndex+1];
    };
} forEach getAllPylonsInfo _thisvehicle;
#

but current implementation is kinda glitchy

warm hedge
#

Hmm 🤔

#

Maybe store getAllPylonsInfo into setVariable and compare upon you Fire?

undone flower
#

magazineTurretAmmo behaves very strangely when there's two or more of the same pylon in a vehicle

undone flower
warm hedge
#

IIRC magazineTurretAmmo issue is known. I can't think up any workaround

undone flower
#

looks like I gotta use ammo instead

#

oh if only bohemia added pylonindex to the fired EH....,.,..........................

warm hedge
#

Probably a ticket worthy thing

undone flower
#

ok I gotta try something else

#

I have an A-164 wipeout with two pylons with one falchion missile each. the hud on the top right says I have two missiles, that is correct

however player ammo currentMuzzle player returns 1

meager granite
#

There is no getter, right?

#

Weird that its not in getAllPylonsInfo

bleak mural
#

is there a well known autonomous way/EH or script thats easily applied to an Ai vehicle that detects if they are on their side or roof,and then sets there direction back to normal? Im going to delve into making something if not as iv figured out how to prevent disembark from damage,in water,and upside down

#

but wanted to ask here first if anyone knows a quick n easy method

#

im unsure what im looking at here theres many pages on this

#

never mind, got something working.

bleak mural
#

Can someone point out the syntax error, im unsure why this isnt working

#
if !(isServer) exitWith {};

private ["_allVehicles","_vehicle","_fnc_flipVeh"];

_fnc_flipVeh = {

    params[ ["_object",objNull,[objNull]] ];

        waitUntil {
            sleep 1;
            (_object nearEntities ["Man", 10]) isEqualTo [] || !alive _object
        };
        if (!alive _object) exitWith {};
        _object allowDamage false;
        _object setVectorUp [0,0,1];
        _object setPosATL [(getPosATL _object) select 0, (getPosATL _object) select 1, 0];
        _object allowDamage true;
};

while {true} do {

    _allVehicles = (entities [["LandVehicle"], [], false, true]) select {
        (getNumber (configFile >> "CfgVehicles" >> typeOf _x >> "hasDriver")) isEqualTo 1 &&
         {(crew _x) isEqualTo []}
    };

    {    
        _vehicle = _x;
        (_vehicle call BIS_fnc_getPitchBank) params ["_vx","_vy"];
        if (([_vx,_vy] findIf {_x > 80 || _x < -80}) != -1 && {!canMove _vehicle}) then {
            0 = [_vehicle] spawn _fnc_flipVeh;
        };

    } forEach _allVehicles;
    sleep 4;
};
#

getting errors with "if (!alive _object) exitWith {};"

#

which is needed to check if vehicle is still alive,looks ok but erroring

hallow mortar
meager granite
bleak mural
# meager granite Post full error

'....exitwith {};
_object allowdamage false;
|# | _object setvectorup [0,0,1];
_object...'
ERROR invalid number in expression
file C: \Users\PC\documents\Arma3\mission ......
Line16

#

but the set vector up is written correctly here

meager granite
#

Add logging to see what's going on

#

diag_log ["_object", _object];

#

and other vars

#

then check RPT

bleak mural
#

cheers

bleak mural
#

con: vectorUp v1 select 2 < 0

#

act: v1 setVectorDirAndUp [[1,0,0], [0,0,1]];

#

repeatable trigger

sullen trellis
#

does anyone know if you can add height using this function "setVehiclePosition"?

proven charm
#

from wiki: "Normally only x and y are considered, unless "CAN_COLLIDE" is used for special placement"

#

so thats another option

drifting spire
#

I know how to skip a waypoint using a trigger, but how do I skip a waypoint using a script?

sullen trellis
proven charm
#

then i guess CAN_COLLIDE could work but you need the z of the current floor you are placing them. building position would give you the z

#

building pos is actually quite handy if you want to place them at random positions in the house

drifting spire
#

Not sure what channel this should go in, but how do I get a helicopter to land on a position and stay there? I've got a land WP, and then a hold WP that is on a radio trigger. But after landing, the helicopter hovers at the hold wp

sullen trellis
#

the code is somewhere "line 264" this is going to tough if anyone wants to help, but i got stuck for days trying to figure out how to increase the height of the spawned loot inside buildings

drifting spire
proven charm
#

what is exactly what you want to do?

sullen trellis
#

the sqf works 99% fine, the only downside is that loot sometimes spawns underground making it invisible, so im trying to give alittle elevation to stay above the ground

proven charm
#

ok

sullen trellis
#

i tried this "_itembox setPosATL [_posToSpawnLoot select 0, _posToSpawnLoot select 1, 1];"
but then cancels the setVehiclePosition not allowing spawns on 2nd floor in buildings

proven charm
#

hmmm

sullen trellis
sullen trellis
proper sigil
#

Can addAction "condition" parameter access variables defined within addAction scope? Example


_someobj addAction ["Some action", {

  private _someVariableName = "TAG_some_missionNamespaceVariable";


},[],6,true,true,"","!isNil _someVariableName", 10,false,"",""];

hallow mortar
#

Not local scope variables. Global variables, yes.

proper sigil
#

Shame but I expected that much, thx

winter rose
sullen trellis
winter rose
#

technically it's _heightAboveCurrentPos

private _currPos = getPosATL _object;
private _heightOffset = 5;
private _newPos = _currPos vectorAdd [0, 0, _heightOffset];
_object setPosATL _newPos;
```**or**```sqf
private _posATL = getPosATL _object;
private _altitudeATL = 5;
_posATL set [2, _altitudeATL];
_object setPosATL _posATL;
meager mist
#

I'm altering a very old script from 2014 for a bomb defusal but the script doesn't activate the "BOMB ARMED" timer whenever you disarm before the timer starts on screen. I've been trying to figure out how to get it to work but no success. I'm not sure where to call the start of the 5 second timer. (same goes for taskSetState but I think I can figure that out later..)

init.sqf

CODEINPUT = [];
CODE = [(round(random 9)), (round(random 9)), (round(random 9)), (round(random 9)), (round(random 9)), (round(random 9))]; //6 digit code can be more or less
WIRE = ["BLUE", "WHITE", "YELLOW", "GREEN"] call bis_fnc_selectRandom;
DEFUSED = false;
ARMED = false;

codeHolder = [lAPTOP1, LAPTOP2, LAPTOP3, LAPTOP4] call BIS_fnc_selectRandom;
codeHolder addAction [(("The Code")),"DEFUSE\searchAction.sqf","",1,true,true,"","(_target distance _this) < 3"];
caseBomb addAction [("Defuse the Bomb"),"DEFUSE\defuseAction.sqf","",1,true,true,"","(_target distance _this) < 5"];

//Mission Task
if (isServer) then {
    [ west, "Task_Defuse", ["Find the code and defuse the bomb before it explodes.", "Defuse the bomb.", "DEFUSE"], caseBomb, TRUE ] call BIS_fnc_taskCreate;
};

// Hide helper arrows
{hideObject _x} forEach allMissionObjects "Helper_Base_F";

[] spawn {
    waitUntil {DEFUSED};
    caseBomb removeAction 0;
    hint "";
    ["Task_Test", "Succeeded"] call BIS_fnc_taskSetState;
};

[] spawn {
    waitUntil {ARMED};
    caseBomb removeAction 0;
    hint "";
    ["Task_Test", "Failed"] call BIS_fnc_taskSetState;
};

fn_bombTimer.sqf

private ["_bomb", "_time"];
_bomb = [_this, 0, objNull, [objNull]] call BIS_fnc_param;
_time = [_this, 1, 0, [0]] call BIS_fnc_param;

//Validate parameters
if (isNull _bomb) exitWith {"Object parameter must not be objNull. Accepted: OBJECT" call BIS_fnc_error};

while {_time > 0 && !DEFUSED} do {
    _time = _time - 1;  
    hintSilent format["Bomb Detonation: \n %1", [((_time)/60)+.01,"HH:MM"] call BIS_fnc_timetostring];

    if (_time < 1) then {
        _blast = createVehicle ["M_Mo_82mm_AT_LG", position _bomb, [], 0, "NONE"];
        {
            if (_x distance _bomb <= 15) then {_x setDamage 1};
        } forEach allUnits;
    };
    if (ARMED) then {
        _time = 5; 
        ARMED = false;
    };
    sleep 1;
};

//Return Value
_bomb
exotic flame
#

Is there a way to lock a weapon or prevent the user of a turret to fire ?

#

I could remove the weapon, but i need the player to be able to see how many ammunitions are left

spice lava
#

Hi sorry if this is a redundant question but im trying to set Ai (hmgguner1) to enter the vehicle as gunner (hmg1). I set the command on activation hmggunner1 moveInGunner hmg1; but the ai just walks to the car and stand still, what did i do wrong?

#

wait nvm, I changed to move and it works, but vehicle get in doesnt work?

pastel pier
#

In arma 3 using sqf or one of the commands how to check that batteleye anti cheat is on?

scenic shard
#

I cant seem to get BIS_fnc_ambientAnim to work correctly on dedicated server +hc.

I have the the following code:

params["_unit", "_chair", ["_combat", true]];

if(!local _unit) exitWith {};

//BIS_fnc_ambientAnim do not work from init, add sleep 
sleep 2;

private _cPos = getPos _chair;
private _cDir = (getDir _chair) + 180;

_unit disableCollisionWith _chair;
_chair disableCollisionWith _unit;

_unit setPos _cPos;
_unit setDir _cDir;

[_unit, "SIT2", "ASIS"] call BIS_fnc_ambientAnim;

if(_combat) then 
{
    (group _unit) addEventHandler ["CombatModeChanged", {
        params ["_group", "_newMode"];
        if(_newMode == "COMBAT") then
        {
            {
                _x spawn 
                {
                    sleep random 3;
                    _this call BIS_fnc_ambientAnim__terminate;
                    _this setUnitPos "UP";
                };        
            } forEach (units _group);
        };
    }];
};

do i need a longer sleep? is it a locality issue? if i understood the wiki right it is supposed to be executed where the unit is local only

#

works fine in the editor

cosmic lichen
#

From where are you executing that code?

scenic shard
#

init of the unit (solo)

cosmic lichen
#

but params doesn't work there.

#

the unit is referenced with this

scenic shard
#

ah, it is a function containing the above. the actual init has [this, c6, false] spawn FLO_fnc_sitOnChair;

cosmic lichen
#

I see.

#

Should work then.

scenic shard
#

the unit is just sent to the chair location, fixed in place and wont react and only loop some jerky buggy animation

hallow mortar
#

You should use getPosASL / setPosASL or ...ATL rather than plain getPos/setPos. getPos and setPos don't use the same position format so combining them can introduce an error.

#

You don't need to do disableCollisionWith both ways; it's already a bidirectional command.

scenic shard
#

thanks, i have updated and will try it out

#

no jerky movement now, but they are still just standing still on the chair pos.

I have dynamic sim enabled for these units and they start outside the range, could that break it?

cosmic lichen
#

Yes

scenic shard
#

so should i keep them simulated all the time, or is it enough to toggle it on before i issue the command?

or will it break as soon as i turn it off again?

meager granite
#
l = getUnitLoadout player; l set [5, nil]; player setUnitLoadout l; l select 5
``` => `["B_UAV_01_backpack_F",[]]`
#

😠

#

setUnitLoadout modifies the array without asking

#

Wanted it to avoid creating the backpack

scenic shard
fair drum
meager granite
#

empty string removes the backpack

#

as empty array

#

tried it all

granite sky
#

I don't get it. What are you trying to do?

meager granite
#

I want to retain my backpack after using setUnitLoadout

#

The same entity

granite sky
#

yeah that might be impossible.

#

hmm

#

I wonder if setUnitLoadout is much slower when there's a backpack in there.

#

I remember empty and full loadouts being vastly different costs.

quick zodiac
#

Hi! I've setup a wasteland server for me and my friends and i'd like to edit it to add modded cars to the static spawns around the map, i endded up finding the spawn script and the variable used to define the vehicle type but i dont get where you find what's the vehicle type..
Hope i dont interupt your convo 🙃
here's the code for the vehicle type variable
private ["_createRandomVehicle", "_totalRadius", "_carPerMeters", "_townThreads", "_startTime"];

_createRandomVehicle =
{
private ["_pos", "_minrad", "_maxrad", "_counter", "_vehicleType", "_mindist"];
_pos = _this select 0;
_minrad = _this select 1;
_maxrad = _this select 2;
_counter = _this select 3;

_vehicleType =
[
    [A3W_smallVehicles, 0.30],
    [civilianVehicles, 0.40],
    [lightMilitaryVehicles, 0.15],
    [mediumMilitaryVehicles, 0.15]
meager granite
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
meager granite
#

Thought I found a hack how to quickly take the backpack until we have actionNow, but it takes random amount of frames to complete

#

Stupid take animation

sullen trellis
#

how do i fix this
hint format ['"Health: %1",(((1-_Health)*100)-((1-_Health)*100 mod 1))\n%1\nThirst\n%2\nHunger\n%3', health, thirst, hunger];

granite sky
#

random burst of bad maths in the middle of the string

undone flower
#

is there a way to easily get that number?

granite sky
#

I only know really bad ways. The pylon stuff is a mess.

#

Basically iterate over the pylons, check the magazine types and add the current ammo.

undone flower
#

oh my god

granite sky
#

actually it's worse than that :P

meager granite
#

Trying to figure magazine commands in SQF is like doing a puzzle

#

Also you can delete the magazine from the vehicle yet getAllPylonsInfo will still show that magazine and ammo in it

granite sky
#

Whoever wrote our pylon code decided that there wasn't a way to determine the remaining ammo on a pylon, so it generates the full value on init and reduces it with Fired EHs :P

meager granite
#

Looks like pylon commands simply return last known magazine values instead of real magazines or something

undone flower
#

forgive me coding masters, for I shall iterate a lot.....................

granite sky
#

But yeah, magazines in Arma are generally bad. Pylons are even worse.

hallow mortar
#

I love that pylons exist but technically they're a forking disaster

undone flower
#

but you can't do much with them specially in vehicles

#

if you add a magazine to the turret it'll still count as 0 if you try to get ammo from the magazine because it's fetching from the first, now empty mag

#

so you must delete the old empty mag

granite sky
#

Magazines used to be worse, I think. JNA has some pretty crazy methods for what are simple operations with commands added since.

meager granite
#

Yeah, you had very little control over vehicle magazines some years ago

#

Some stuff is still impossible

#

Like loading particular magazine or setting ammo to particular magazine

undone flower
#

oh no no that ain't gonna work 💀

#

also magazine stuff sometimes breaks AIs because they simply don't acknowledge that they got a new mag

#

maybe you can force them to reload the magazine so they acknowledge the new mag then force reload to their old mag

#

maybe

#

but this sounds extra terrible

#

uh oh I need to define if a vehicle's weapon is dynamic loadout or not

#

hm

#

because, of course, if you use the normal magazine scripting commands on pylon weapons, it'll break them

meager granite
undone flower
meager granite
#

at all or right now?

#

walk through all pylons, get their weapon class, check if weapon is in that turret

#

Mag >> pylonWeapon

undone flower
#

thing is using mags is somewhat bug prone because some vehicles can have both non-pylon weapons and pylon weapons that use the same mag

granite sky
#

yeah, I have a note about that on some pylon-stripping code.

#

Might be useful:

private _turrets = [[-1]] + allTurrets _veh;
private _toRemove = [];
{
    private _turret = _x;
    private _baseWeapons = getArray (([_veh, _turret] call BIS_fnc_turretConfig) / "Weapons");
    private _weapons = (_veh weaponsTurret _turret) apply { toLower _x };
    // Avoiding array subtract in case there's a pylon and non-pylon copy of the same weapon
    // RHS has case bugs (zu-23 notably) so we force everything lower
    { _weapons deleteAt (_weapons find toLower _x) } forEach _baseWeapons;
    { _toRemove pushBack [_x, _turret] } forEach _weapons;

} forEach _turrets;

Trace_1("Removing pylon weapons: %1", _toRemove);
{ _veh removeWeaponTurret _x } forEach _toRemove;
granite sky
#

For missiles you can probably assume that everything's a pylon though.

vital silo
#

Hello

#

I need to add all the commands that allow you to kill a player in the battleye filters, I added setDamage, setVehicleArmor and all setHits commands. Do you know any more?

#

I have added the setPos filters too.

undone flower
granite sky
#

For guns there are absolutely cases where the same magazine is used for pylon and non-pylon weapons.

undone flower
hallow mortar
#

There are still existing vehicle classes, from before pylons were added, that use missiles, and who knows what mods do

undone flower
#

but the occasion is rare enough for me to not tear my hair off because of it for now

#

I also need to find a workaround for manualfire

#
_mmvEHIndex = _vehicle addEventHandler ["Fired", {

        params ["_thisvehicle", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
    
        // Attention: ADD SUPPORT FOR MANUAL FIRE - "_gunner" can be NULL!'    
    
        if (_thisvehicle magazineTurretAmmo [_magazine, _thisvehicle unitTurret _gunner] == 0) then {
            _currentTurretPath = _thisvehicle unitTurret _gunner;
            _thisvehicle removeMagazineTurret [_magazine, _currentTurretPath];
            _thisvehicle addMagazineTurret [_magazine, _currentTurretPath];
            _thisvehicle loadMagazine [_currentTurretPath, _weapon, _magazine];
        };

    }]; //end EH
meager granite
#

Is _gunner null when you use manual fire?

#

Anyway I was looking into manual fire few days ago

undone flower
bleak mural
# sullen trellis i solved by something so stupid i just had to change from this *_itemBox setVehi...

another method(if you have similar issue in future) is something i used to to when i "ported" dayz map into Arma3 and buildings had no positions for loot. i hand placed containers(which had positions) into every building on the map,set them to hide, and my loot script picked up the container pos,and spawned loot,above the floor as container was slightly above when placing via editor. Alot of work,as u can imagine but worked

meager granite
#

What is needed to check if you can manual fire

  1. isManualFire command returning true / enableManualFire=1 in vehicle config to know if its possible at all
  2. You can manual fire from primaryObserver=1 turret or driver if no turret has it
  3. You manual fire a first turret that has primaryGunner=1
undone flower
#

or find a way to somehow know the turretPath manual fire takes control of

meager granite
#

Its primaryGunner=1 turret

sullen trellis
meager granite
#
// Params: [Vehicle, String (Property), Code (Condition)]
// Returns: Array (Turret)
both_func_vehicles_findTurretProperty = {
    if(_this select 0 isEqualType objNull) then {
        _this set [0, typeOf(_this select 0)];
    };
    call both_func_vehicles_findTurretPropertyC;
};
both_func_vehicles_findTurretPropertyC = {
    both_vehicles_findTurretPropertyCache getOrDefaultCall [_this, {
        params ["_vehicle", "_property", "_condition"];
        if(isNil"_condition") then {_condition = {getNumber(_this) > 0}};

        private _trts = configFile >> "CfgVehicles" >> _vehicle >> "turrets";
        private _turret = (for "_i" from 0 to count _trts - 1 do {
            if(((_trts select _i) >> _property) call _condition) exitWith {[_i]};
            private _trts2 = (_trts select _i) >> "turrets";
            private _subturret = (for "_j" from 0 to count _trts2 - 1 do {
                if(((_trts2 select _j) >> _property) call _condition) exitWith {[_i, _j]};
            });
            if(!isNil"_subturret") exitWith {_subturret};
        });
        if(isNil"_turret") then {[-1]} else {_turret};
    }, true];
};
both_vehicles_findTurretPropertyCache = createHashMap;

// Params: Vehicle
// Returns: Array (Turret)
both_func_vehicles_getPrimaryTurret = {
    both_vehicles_getPrimaryTurretCache getOrDefaultCall [typeOf _this, {
        [typeOf _this, "primaryGunner"] call both_func_vehicles_findTurretPropertyC;
    }, true];
};
both_vehicles_getPrimaryTurretCache = createHashMap;

// Params: Vehicle
// Returns: Array (Turret)
both_func_vehicles_getPrimaryObserverTurret = {
    both_vehicles_getPrimaryObserverTurretCache getOrDefaultCall [typeOf _this, {
        [typeOf _this, "primaryObserver"] call both_func_vehicles_findTurretPropertyC;
    }, true];
};
both_vehicles_getPrimaryObserverTurretCache = createHashMap;
```You can have code I use
#

cached turret config look up

#

probably could be optimized a bit but its cached so its fine

meager granite
#

I stopped using Fired for a while now, always use FiredMan and it always has gunner and vehicle regardless of manual fire or even UAV control

modern osprey
#

Is there any way to get the highest point on earth?

I need to press the object to the ground, taking into account houses, stones, etc.

scenic shard
#

is there any reason that a gameLogic would be removed or something on dedicated servers?

I am trying to run this on all players
player setPosATL (getPosATL nameOfGameLogic)

the logic is just placed and named in the editor. This used to work fine, even on dedicated, but not i end up at 0,0

scenic shard
meager granite
#

Do some logging

#

diag_log ["nameOfGameLogic", nameOfGameLogic, getPosATL nameOfGameLogic];

#

I remember vehicle var names being unreliable

scenic shard
#

will do, at least it still works in editor. so must be something with locality

modern osprey
# meager granite huh?

Roughly speaking, I have an object and I want to press it to the highest surface in the position

undone flower
undone flower
#

a trillion raycasts...

undone flower
#

plus other things I thought about and forgot for now

#

oh yeah a total rewrite... maybe later

scenic shard
meager granite
#

to make sure that variable contains it

meager granite
scenic shard
undone flower
undone flower
#

my god this pylon stuff is a thing of nightmares

modern osprey
undone flower
#

I am not sure if I should be proud of myself with these hacks i'm pulling off to make things work

turbid steeple
#

I want to make a script to give me random missions and exfil how would I go about that thanks

#

I know there is mods and scripts for this but I want to learn how to do it so I can customize

fair drum
#

How far are you into learning scripting?

hasty gate
#

Hi, does anyone know if its possible to adjust player/AI small fire weapon elevation? (to fire at a certain angle), or if it's possible to make AI adjust elevation to perform indirect fire using GL launcher via SQF

undone flower
#

i'm using spawn yet the sleep statement inside the function says suspending is not allowed

#

🤔

#

why is a function spawned from initServer not allowed to suspend

granite sky
undone flower
undone flower
#

and better, no need to wait for the units to fill the group

#

that was my pain point

granite sky
#

Code in an EH is run in unscheduled context.

knotty gyro
#

how do I move an entire collection/ layer with a setpos? I have a composite collection I wantr to move across the map from one static pos to another. Is there a nifty little way to move entire collections, or do I have to respawn every piece with specific coordinates and stuff?

undone flower
#

skill issue from my part

polar belfry
#

I have a question. I made a script and want to know how it will work if it is encapsulated in foreach player

#

the code is in acomposition so it runs locally from zeus

fair drum
polar belfry
#

yea found it sorry I'll delete the code

#

to clear the scripting

undone flower
#

where's the documentation for Config.cpp

granite sky
undone flower
#

already took a look

terse tinsel
#

Is it possible to disable damage to details in vehicles, such as the track or turret? and that he would receive the damage as a whole?

undone flower
#

this is where I would start

terse tinsel
#

OK, thank you i try

terse tinsel
granite sky
#
  1. Don't let them go into combat mode.
undone flower
#

man add-on builder is ignoring all my functions/script files

#

dunno what i'm doing wrong

granite sky
#

Are you using the UI or command line?

undone flower
terse tinsel
granite sky
#

Disabling binarization may also work. I forget. That's the only way with the command line version because the exclude seems to be bugged.

undone flower
granite sky
#

In general Arma AI does what it wants and you shouldn't fight it unless it's really important.

undone flower
#

finally got my add-on working in game

terse tinsel
turbid steeple
#

So can anyone help me get on the right track to make random mission generation

warm hedge
#

A lot of scripting knowledge and more. There is no one-stop guide or anything about it

terse tinsel
#

Could someone help me write a script to prevent the tank's gun from getting damaged? or turn off hit points ??. But the tank would still be destructible ??? plese

fair drum
dapper cairn
#

I have a question. Is it possible to set a custom loadout on a plane to carry 2 VLS cruise missiles? I know you can set custom weaponry but I don't know how

terse tinsel
terse tinsel
# dapper cairn I have a question. Is it possible to set a custom loadout on a plane to carry 2 ...

I found something like this. But this is probably the other way around, because this script only gives damage to selected parts. and I would like it to skip selected parts _unit addEventHandler ["HandleDamage", {
private _unit = _this select 0;
private _hitSelection = _this select 1;

// If the part is in ["head", "face_hub"], allow damage to it, otherwise return the part's original damage with none in addition
if (!(_hitSelection in ["head", "face_hub"])) then {
    _damage = if (_hitSelection isEqualTo "") then {damage _unit} else {_unit getHit _hitSelection};
};

_damage

}];

granite sky
#

first run getAllHitPointsDamage cursorObject on your vehicle to see what the selection and hitpoint names are.

turbid steeple
#

@fair drumok says nothing about making a random mission script ...I would have to see a video or written tutorial to understand that.

terse tinsel
fair drum
# turbid steeple <@177167602768936960>ok says nothing about making a random mission script ...I w...

What it does tell you is how to start getting into scripting. You stated you wanted to learn it, so I'm giving you the starting steps. A lot of this journey is going to be reading. Luckily, Arma 3 is very well documented. You need to understand the

task system
https://community.bistudio.com/wiki/Arma_3:_Task_Framework

Scheduler
https://community.bistudio.com/wiki/Scheduler

Loops, variables, arguments, parameters, initialization files, etc.

#

You want the customization, but it comes with the overhead price of learning a lot of this.

#

Read what I linked originally, then start moving to the other things I linked

turbid steeple
#

I have been using chatgpt to show me ways of making dynamic missions but none of the code works

fair drum
#

Chatgpt is straight garbage for sqf

#

There isn't enough data out there for it to learn on. Its going to always be wrong.

turbid steeple
#

ok like I said though I learn better from a video

fair drum
#

Not much out there at the moment that is up to date unfortunately.

#

For your specific goal

turbid steeple
#

I feel lost just looking at the different codes and what they do I have to see it in action

fair drum
#

Instead, try starting with some smaller simpler tasks. Things like, learning how to teleport a unit, or creating a vehicle. Small things first, that will eventually lead to the big thing you want

turbid steeple
#

is there a way to take a mission and look inside it to see how the scripts are written

#

I made this mission with some code

fair drum
#

I don't remember exactly where workshop missions are stored, but yes, your computer has a copy of everything it downloads.

turbid steeple
#

took like 2 days to make this mission but I think it turned out ok

fair drum
#

Many missions and mods have public githubs you can go to. Just don't copy paste the stuff, but you can see how people did things.

turbid steeple
#

I dont do that I just watch how its done and change stuff I like

#

So how do I open these missions up in the editor

fair drum
#

Unpack the pbo, take the folder and place it in the missions folder in your documents

#

Should be something like

Missionnamehere.mapname

turbid steeple
#

ok...So ever since I have been playing the western shara dlc I like how that mission plays out and gives you different obj and money for the work, and I like how old man missions worked

fair drum
#

Dlc stuff is locked behind a .ebo file until after some time and then BI unlocks it. You might not be able to look at their stuff for sahara

turbid steeple
#

I have been playing tarkov and gray zone and have been trying figure out how I can make a mission where you go stuff and get new weapons or money

fair drum
#

Start smaller. Learn how to even spawn random stuff in a crate first.

turbid steeple
#

I wanted to make my own gray zone as it where cause I like how that missions works then I found Dlc extraction which really is like gray zone

#

The mission I put in this post I made the whole thing and learned triggers and putting stuff on a computer to make you get intel

terse tinsel
fair drum
turbid steeple
#

ok Thanks for your help

bleak mural
#

is it feasable to script something that can force organically AI GL users to fire flare rounds at enemies at night?

#

i remember seeing AI using flares before years ago im just not sure what triggered it

bleak gulch
#

@meager granite I'm wondering, can the game engine automatically reassemble the array / hashmap transfered over the network and consisted from the references pointing on the same array?

arr = [];
refArr = [];

// Generate array with the actual data
for "_i" from 0 to 1023 step 1 do
{
    // [0, 1, 2, 3, 4, ..., 1023]
    arr pushBack _i;
};

// Generate array with the references
for "_i" from 0 to 1023 step 1 do
{
    // [arr, arr, arr, arr, ..., arr]
    refArray pushBack arr;
};

// Transfer
publicVariable "refArr";

// ???
// How much data will be sent?
// [[0, 1, 2, ..., 1023], [0, 1, 2, ..., 1023], [0, 1, 2, ..., 1023], ...]
// OR
// [[0, 1, 2, ..., 1023], ref_to_0, ref_to_0, ref_to_0, ...]
// where `ref_to_0` is just reference to element 0
// ???
meager granite
#

I wonder if it also doesn't for save games so references will be lost after loading the game? 🤔

bleak gulch
#

I mean.... hm I was unclear. It's pretty obvious those references aren't transfered over the net but how the game serialize the two (or more) references pointing on the same array? Does the game just straight forward transfer the arrays or it sends kind of (meta-) references and recreates the array from the scratch making separate unlinked arrays?

meager granite
#

It probably makes a copy of referenced contents during serialization

bleak gulch
#

well if so, it's very unoptimized, waste of traffic (and CPU cycles)

meager granite
#

Well, you gotta keep this in mind when designing data structures that will be sent over network

#

Use hashmap keys instead of references if you don't want data copied

#

I still wonder if same limitation applies to save games and other serialization like profile namespaces

bleak gulch
#

storing into profileNamespace also unlinks arrays

#

they are just two separate copies of the same array.

meager granite
#

yeah its probably same/similar serialization everywhere

bleak gulch
#

singleplayer save game also affected by this behaviour, just tested.

meager granite
#

5 hours in trying to move backpack from a dead body to alive unit with as less frames as possible

#

Arma fun

meager granite
#

I think you can combine Frame 1 and 2 actually

#

Doing actions inside vehicle and moveOut is a substitute for 2.18's actionNow

#

Doesn't work with PaperCar, needs proper vehicle, works with C_Quadbike_01_F

#

Probably has to do with animations or something

#

Now I can revive players by respawing them, giving them their exact previous backpack entity so it retains their weed-colored drone 😎

velvet merlin
#

anyone has a good animation/a reliable way to get you from unconscious on the ground to kneeling position (not standing up)

proven charm
velvet merlin
#

this makes him turn over on the ground

proven charm
#

yea i thought it did something 😄

hallow mortar
#

Try _unit playActionNow "Crouch"? after setUnconscious false

stuck palm
#

anyone how might I go about disabling the menu overlay via script manually when opening the arsenal (Normally would just hit backspace, but I am displaying text and want to force it off)? Want to delay it from appearing until BIS_fnc_blackIn is called.

        _NUP_playerFace = face player;
        _NUP_playerVoice = speaker player;
        _NUP_playerInsignia = [player] call BIS_fnc_getUnitInsignia;
    
        // Create an Arsenal unit at the location of NUP_arsenalHelper
        _NUP_arsenalUnit = createAgent [typeOf player, (getPosATL NUP_arsenalHelper), [], 0, "CAN_COLLIDE"];
        [_NUP_arsenalUnit,true] remoteExecCall ["hideObject",[-2,-clientOwner],_NUP_arsenalUnit];
        _NUP_arsenalUnit disableAI "ANIM";
        _NUP_arsenalUnit disableAI "MOVE";
    
        // Store the Arsenal unit reference in player's variable
        player setVariable ["NUP_arsenalUnit", _NUP_arsenalUnit];

        // Set Arsenal unit's loadout, face, voice, and insignia
        _NUP_arsenalUnit setUnitLoadout (player getVariable ["Saved_Loadout",[]]);
        _NUP_arsenalUnit setFace _NUP_playerFace;
        _NUP_arsenalUnit setSpeaker _NUP_playerVoice;
        [_NUP_arsenalUnit, _NUP_playerInsignia] call BIS_fnc_setUnitInsignia;
        _NUP_arsenalUnit setDir 90;
    
        ["Open", [true, NUP_arsenalHelper, _NUP_arsenalUnit]] spawn BIS_fnc_arsenal;
                playMusic "EventTrack02b_F_Tacops";
        // Open the custom arsenal presentation
        ["NUP_blackout", false] call BIS_fnc_blackOut;
        
        sleep 1;
        
        [
            ["MISSION:","<t valign='center' shadow='1' size='1.5'>%1</t><br/>"],
            ["SUBTEXT","<t align='center' shadow='1' size='1.5'>%1</t><br/>"]
        ] spawn Bis_printText;
        sleep 3;
        
        ["NUP_blackout", TRUE, 5] call BIS_fnc_blackIn;```
terse tinsel
#

Is there any way to manually (via Scripts) reduce the accuracy of AI tank shots???

warm hedge
#

via Skype?!?!?

hallow mortar
#

I'm hoping they meant "via SQF" and got autocorrected

terse tinsel
hallow mortar
#

You could use a Fired EH or ProjectileCreated mission EH to slightly adjust the projectile velocity, which would affect accuracy. You could also try turning down the AI accuracy skill for tank crews specifically.

terse tinsel
terse tinsel
warm hedge
#
tank addEventHandler ["Fired",{
  hint str _this;
}];```This may give you an idea
terse tinsel
#

I wrote clearly that I'm just starting and I don't know how to build full scripts yet. and I see that you only refer to links, and that is not very helpful . sorry

warm hedge
#

...Link? What link?

terse tinsel
hallow mortar
#

Here's a link: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Fired

// Add an event handler to the tank that fires when the tank fires
tank addEventHandler ["Fired",{
  // retrieve the information about the event
  params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
  // Get the existing velocity of the projectile, relative to the projectile
  private _oldVelocity = velocityModelSpace _projectile;
  // Add a small randomised adjustment to the velocity vector (numbers may need tweaking)
  private _newVelocity = _oldVelocity vectorAdd [random [-1, 0, 1], random [-1, 0, 1], random [-1, 0, 1]];
  // Apply the new velocity to the projectile
  _projectile setVelocityModelSpace _newVelocity;
}];```
That's one of the ways to do it. For changing the skill of tank crews, see <https://community.bistudio.com/wiki/setSkill>. The ProjectileCreated mission EH would be similar to the Fired EH method, but you'd have to add a filter to detect whether it was the right kind of projectile to act on, whereas the Fired EH definitely only applies to projectiles fired by the tank you added it to.
terse tinsel
hallow depot
#

Hi!
Can someone explain to me why my code don't work as intended?

I'm working on a practice scenario for my unit.
So, I'v created one FSM for a conversation function where I also want it to show different "slides" when player interacts with different sentences. But my issue here is that when I schoose a sentence the "slide" is one static picture, and it don't change when I change sentence.

This is parts of my code.

https://pastebin.com/embed_js/5wEFeded?theme=dark

winter rose
sullen trellis
#
    hintSilent parseText  _hintText;```
any possible fix for this? it shows the "\\" and "n" marks on hint hud how can i remove them
warm hedge
#

<br>?

meager mist
#

Is there a way to rename the display name of an item? I would like to rename a mobile phone item to "Bomb Tracker" to make it more clear for my players. Is it even possible?

meager granite
#
  1. Addon
  2. Hacky stuff with changing strings on UI
meager mist
#

Kinda what I thought, I think I'm better off adding piece of intel lying around that indicate that a phone is used for that. Just for 1 mission it's not worth it I guess. THanks

proven charm
#

or create task

meager mist
meager granite
#

You work at BI but have no role in Discord?

sullen trellis
warm hedge
#

Literally <br> instead of \n

meager granite
#

Unlike HTML, Arma's Structured Text requires /

sullen trellis
warm hedge
#

What is your code now then?

sullen trellis
#

_hintText = format ["<t size='1.0'>Health: %1<br>Thirst: %2<br>Hunger: %3</t>", _formattedHealth, thirst, hunger];

meager granite
#

You need /

warm hedge
meager granite
#

Yeah it treats <br> as unclosed tag and it eats everything inside it

#

hintSilent parseText "111<br>222</br>333"; => 111\n333

#

So you need <br/>

sullen trellis
#

oh i see

#

there it is, it worked : D cheers, couldnt have done it without this beautiful community

#

_hintText = format ["<t size='1.0'>Health: %1<br/>Thirst: %2<br/>Hunger: %3</t>", _formattedHealth, thirst, hunger];

this is how it looks now

undone flower
#

meanwhile i'm on day 185 of trying to make pylons make sense

#

maybe comparing old/new ammo values on each pylon would do the trick, but no... I remembered that pylons can change at any moment so there goes my idea

winter rose
#

wait, what was your idea again? (for the record, I already regret asking 😄)

warm hedge
#

You could delete your post if you regret

winter rose
#

no

warm hedge
#

I recall it was related with resupplying a pylon, after (few secs?) it fires

undone flower
#

so after a few seconds it's full ammo again

meager granite
#

Once its depleted?

#

Otherwise you can just walk through all pylons X seconds after last shot and set full ammo to each

undone flower
warm hedge
#

Thing is Fired EH doesn't return which pylon was used. But if the question is about resupply the pylon after it is empty, the script could be more easier

undone flower
#

here's the source code so far

undone flower
warm hedge
#

*Dedmen

undone flower
#

I sure home Dedmen adds that sometime 🥴

warm hedge
#

😄

meager granite
#

What's your exact end goal?

#

Feels like you overcomplicated it to be honest

warm hedge
#

Probably just iterate ammoOnPylon on all pylons, and if it returns 0, resupply the pylon

meager granite
#

So your idea is to set magazine ammo to full ammo when it was fully depleted after some delay?

undone flower
#

_gunner ammo _muzzle == 0 is also unreliable in this case

#

i've tried magazineTurretAmmo too

winter rose
#

ammoOnPylon?

undone flower
winter rose
#

you can store the current pylons and their ammo and compare

warm hedge
#

Well, I mean, if it should be instantly refill once it reaches 0, which means that 0 is the only pylon that potentially fired in that moment

winter rose
#

Fired event
→ is a pylon empty?
- no = carry on
- yes = (store the pylon index and) reload (later)

meager granite
undone flower
# meager granite You want only pylons or any vehicle mags?

since vehicles can have both pylon weapons and non-pylon weapons those need to be treated accordingly because if you use addMagazineTurret and loadMagazine on a pylon weapon, it'll break. so the type of weapon (pylon or not) must be known

meager granite
#

If you delete and add backpack again the packed vehicle deletes and creates a new one when unpacked next time

#

Packed drone also keeps the textures 😎

undone flower
#

oh this is why your name sounded so familiar, you the guy who made koth 🥴

fair drum
terse tinsel
#

does increasing the number in this option make the imprecision greater or less? aiDispersionCoefY =

undone flower
#

is there a command to add ammo to a magazine?

#

or you gotta get and set...

#

apparently there's no good way to do this

fair drum
#

Yeah its a get, delete, and recreate

undone flower
#

with that I could create a battlefield-esque ammo regenerator where it gives you X ammo every T seconds

terse tinsel
winter rose
terse tinsel
drowsy geyser
#

Is there a way to attach a camera to a physics object but prevent the camera from rotating with the object (football) if the object moves?

meager granite
#

Set positions each frame

knotty gyro
#

Is there a keypad UI available for vanilla? Sort of "addaction, input code, returns true/false" kind of deal?

drowsy geyser
# meager granite Set positions each frame

I did it like below, it works, although I don't know if that's what you meant

params ["_object"];
_cam = "camera" camcreate [0,0,0];    
_cam cameraeffect ["internal", "back"];   
showCinemaBorder false;         
_cam setPosATL (getPosATL _object vectorAdd  [0, -4, 0.5]);  
while {alive _object} do 
{  
    _cam setPosATL (getPosATL _object vectorAdd  [0, -4, 0.5]);   
    sleep 0.01; 
};
meager granite
#

that's scheduled, not ideal

#

do EachFrame MEH

drowsy geyser
#

okay thank you

sullen sigil
#

draw3d probably better for cameras

#

i think

#

but minimal difference

granite sky
terse tinsel
terse tinsel
granite sky
#

Doesn't matter how it's written. Some mods use a calculation that gets evaluated to produce a number.

rugged spindle
#

With the module framework, do I need to have it packaged as a pbo to enable in 3DEN, or is it possible to have everything inside the mission folder? Trying to follow along with https://community.bistudio.com/wiki/Modules but having a bit of difficulty with the latter approach, so not sure if it's possible.

terse tinsel
bleak gulch
#

ideally - make an addon

terse tinsel
bleak gulch
# terse tinsel in the dispersion value itself it is written, e.g. 0.00xxx and in dispersion x\x...

The dispersion measured in the radians. One circle is 2pi radians or 360 degree. 00029088 rad is 1 Minute of Angle. MOA unit is commonly used in the military than rads (unless it's very long range sniping) because it allows quickly convert the visible angle of the target to the distance without using the calculator.

Just for the reference.
1 rad is an angle where arc is equal to its radius.
https://i.imgur.com/tcjFfDN.png

#

I'm using these macro to convert the units. You can use it in your config.cpp

// Angular unit conversion
#define MRAD_TO_MOA(d) ((d) * 3.43774677) // Conversion factor: 54 / (5 * PI)
#define MOA_TO_MRAD(d) ((d) * 0.29088821) // Conversion factor: (5 * PI) / 54
#define DEG_TO_MOA(d) ((d) * 60) // Conversion factor: 60
#define MOA_TO_DEG(d) ((d) / 60) // Conversion factor: 1 / 60
#define DEG_TO_MRAD(d) ((d) * 17.45329252) // Conversion factor: (50 * PI) / 9
#define MRAD_TO_DEG(d) ((d) / 17.45329252) // Conversion factor: 9 / (50 * PI)
#define MOA_TO_RAD(d) ((d) * 0.00029088) // Conversion factor: PI / 10800
bleak gulch
terse tinsel
#

I just checked in game. thank you gentlemen for your help. I already know how to go about it... best regards!!

undone flower
#
private _isPylonWeapon = "Pylon" in str(getArray (configFile >> "CfgWeapons" >> _muzzle >> "magazines"));
#

how hacky is this?

#

this looks ugly but is possibly fast

hasty gate
# undone flower ```sqf private _isPylonWeapon = "Pylon" in str(getArray (configFile >> "CfgWeapo...

you might have inspiration from this (its not optimized tho):
`// NER_units_unitIsOutOfAmmo
params["_unit", ["_checkAllMags",true] ];

private _currentWeapon = currentWeapon (vehicle _unit);
private _currentMuzzle = currentMuzzle (vehicle _unit);

private _countMags = {
params ["_unit", "_weapon", "_muzzle"];
private _mags = magazinesAmmoFull (vehicle _unit);
private _compatMags = [_weapon,_checkAllMags] call CBA_fnc_compatibleMagazines;

private _count = 0;
{
    _x params ["_magName", "_ammoCount", "_ammoType"];
    
    if(_ammoCount > 0 && _compatMags findIf {_x == _magName;} != -1) then {            
        _count = _count + 1;
    };        
} forEach _mags;
_count

};

private _magCount = [_unit, _currentWeapon, _currentMuzzle] call _countMags;

_magCount > 0;`

undone flower
#

I've decided on storing the muzzle class on a variable, if the muzzle is in that array, then it's a normal weapon instead of a pylon weapon

analog mulch
#

hello,
I have created a task to kill a commander but the player won't know what they look like unless they pick up an intel document. Is there a way to update the current "Kill commander" task with new lines after the intel has been picked up rather than create another task?

analog mulch
#

also, how to place an intel object in the inventory of a vehicle so it can retrived by the player causing the task to be updated?

wind sapphire
#

this may seem like a bit of a random question but I was wondering if AI pathfinding implements the Dijkstra’s Algorithm.

granite sky
#

I'd be very surprised if it didn't.

#

But we don't know. Arma AI is a black box full of shit spaghetti.

wind sapphire
#

@granite sky Good one - and thanks for the reply

bleak mural
#

is there any way to fix existing buildings/AI pathing dynamically. these buildings are still not usable by AI

#

"Land_Cargo_Tower_V3_F" "Land_Cargo_Patrol_V3_F" "Land_Cargo_HQ_V3_F"

#

FOR example CBA defend is used in these pictures, AI "can" path to these positions but 90% of the time dont do it. is there anyway to make the positions easier to reach?

sullen trellis
#

is it possible to change position of titleText or cutText on screen?

proven charm
undone flower
#

is this correct if I want to append a value to an existing variable?

_nameSpace setVariable ["varName", ((_nameSpace getVariable "varName") + [_x]), true];
proven charm
undone flower
#

forgot to mention that

hallow mortar
#

You can also use pushback or pushbackUnique

granite sky
#

It tends to re-calculate the path when it enters different sections, and on those recalculations it breaks the Z-value.

#

I gave up trying to isolate the bug though. There are just too many of them.

undone flower
#

the only good thing arma 3 ai is good at is headshotting me with a 50 cal while i'm flying at 800km/h in a plane

granite sky
#

They are genuinely quite good at leading targets :P

kindred zephyr
#

the dispersion coeff for a lot of guns while being used by AI is insanely accurate, vanilla config barely gives them "recoil" to put it in a way too

granite sky
#

The whole accuracy system seems to be based on random dispersion rather than systematic error too. In practice when people fire an HMG they're typically drawing a line of bullets, while Arma is just random spray around a point.

drowsy geyser
#

Can someone please help me with a problem, I want to execute a code after a random sleep duration but the random duration is not the same random duration for everyone I guess I need a seeded random but I don't know how that would work.

undone flower
#

when manual firing, is there a way to know which turret path is being manual fired?

granite sky
drowsy geyser
#

So execute the whole Script from the server?

hallow mortar
#
// server
private _random = random 5;
[_random] remoteExec ["my_fnc_name"];
// .... in that function ....
params ["_random"];
hint "thing 1";
sleep _random;
systemChat "thing 2";```
Alternatively:
```sqf
[] remoteExec ["my_fnc_part1"];
sleep random 5;
[] remoteExec ["my_fnc_part2"];```
kindred zephyr
kindred zephyr
hallow mortar
#

It depends. You might have other parameters to pass that need to be determined after the sleep in order to be up-to-date. And if it's a long sleep, you might want to have the second part run on any clients that JIP'd during the gap.

kindred zephyr
#

doesnt remoteexec has a flag for JIP?

hallow mortar
#

Yes, but that would start the whole sequence at the beginning for JIP clients, which might not be what you need

kindred zephyr
#

I guess it does depends on what the mission maker wants to do

#

yes

hallow mortar
#

If this is a high-frequency event then yes reduce broadcasts as much as possible, but one extra function RE won't kill anyone. It's fine to do that if you need the flexibility. Function broadcasts are very cheap as long as you're not sending big arguments with them.

bleak mural
granite sky
#

I wouldn't know. I haven't been working with Arma for that long.

#

I didn't even consider that it's an introduced bug, but I guess it's plausible that they added the path recalculations to fix something else.

#

Also the behaviour's so bad now that it's hard to see how it would have passed initial testing.

bleak mural
#

i just spent 30 mins trying to get AI into malden bunkers pre placed

#

you need to set a certain elevation or they dont even recognize the positions

#

also(whats more anoying) buildings hidden on the map still generate their positions in session

#

so AI move into "garrison" nothing

#

the more you try make Arma3 dynamic the more you realise it needs to be heavily scripted and picture perfect to obtain what you envisioned

still forum
still forum
still forum
undone flower
still forum
#

This also gets you SImpleVM so it'll be nice and fast. I think it would reject the exitWith

granite sky
#

Everyone missed my findAny reply? :P

still forum
#

I chose to ignore it

cedar kindle
#

thank god arrays can sometimes have 1000000 instead of 999999 elements

candid sun
#

any ideas why this script http://pastebin.com/3ZdxZA5F (for creating a camera and following a target for 5 seconds) is fine the first time you call it, but subsequent times the camera is all jittery?

formal stirrup
#

Is it possible to script in the CAS missions from the fire support modules in zeus. The function on the wiki sorta lacks all the info needed

indigo snow
#

does _follow ever get set to false?

fair drum
formal stirrup
#

Part of the problem is idk what the classname for the zeus modules is so idk what search for in the function/config viewer

fair drum
#

scopeCurator > 1 tells you you can access it in zeus

candid sun
#

that was it, thanks very much!

wanton swallow
#

Is there a difference between one Draw3D EH and severals EHs?
When we split different logic by several EHs and when we put all logic in one EH.
What approach is better?

warm hedge
#

Context?

bleak mural
#

can someone help me understand how to define units in this code?```sqf
_group = _this select 0;
{
_x addEventHandler ["FiredMan", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"];

    _all = [];
    _side = side _unit;

    _groups = allGroups select{
                side _x isEqualTo _side 
                && alive leader _x
                };
    _groups apply {_all append units _x};        
    //    copyToClipboard str _all;

    {
        If(!isPlayer _x)then{
            If(isNull _x)exitWith{};
            
            if(isNil {_x getVariable "Var_GF_doMove"})then{_x setVariable ["Var_GF_doMove",false];};
            if(_x getVariable ["Var_GF_doMove",true])exitWith{};
            _x setVariable ["Var_GF_doMove",true];
            
            _x allowFleeing 0;
            _x stop false;
            _x doMove (position _unit);
        };
    }foreach _all;
    
    systemchat "fired";
}];

}forEach units group _group;

#

i believe here is where i enter variable name sof units who i want this script to apply to: _groups apply {_all append units _x};
// copyToClipboard str _all;

#

iv tried alot of variations with trings but im not getting any errors,it just isnt working

#

calling this on the init of a group leader

fair drum
#

_group = _this select 0 is the same as params ["_group"] if that helps you.

you need to just do [_group] call thisFunction

#

actually

#

there is an error on this anyways

#

last line, remove the group command

bleak mural
#

so }forEach units group _group; to }forEach units group; ?

fair drum
#

forEach units _group;

#

now if you are just copy pasta this into your code, you don't even need the first line. just have the _group ready

bleak mural
#

how do i define what units are affected by this though?

fair drum
#

are you copy pasta'ing this into your file?

bleak mural
#

the code above is supposed to ,when called via a units init, call defined other groups to move to their position. so a group is calling the script through its init with 0=[this] execVM "GF_Support.sqf";

#

and any units defined in the script(which im unsure how to define) should move to the position

fair drum
#

well the way he wrote it is meh with naming his variables. he mentions _group but what he actually wants is the _leader. If you do this as is, in the leader's init, it would be

if (isServer) then {
  this execVM "GF_Support.sqf"
};

the file should be fixed though to accommodate both the leader and the group:

params [["_group", grpNull, [grpNull, objNull]]];
if (_group isEqualType objNull) then {_group = group _group};

and the last line would be:

forEach units _group;
bleak mural
#

ok im half understanding

#

say i wanted just one unit, "vehicle1" to be the support unit,how to i write this in the syntax?

#

or do you have a better alternative to get a unit to move to another units position on a combat event handler?

#

essentially i wana ditch the Guard wp in favour of making something that has an array of vehicles,move to support a few different groups of infantry

fair drum
#

the code above looks like it makes every unit on the unit's side move to that location, is that what you want

bleak mural
#

no i just want a few defined vehicles to act as support

#

vic1 vic2 vic3 etc

#

i thought this part of the syntax allowed me to do that :groups apply {_all append units _x};
// copyToClipboard str _all;

fair drum
#

aka, time to write your own that is more inline with what you want

bleak mural
#

i thought all apend was allowing some sort of array

#

that i had to define

#

ok man cheers

fair drum
#

_all is created in that event handler. hes initializing the variable with an empty []. You can't touch that. Its local in that event handler as it is in a different scope

bleak mural
#

got it

bleak mural
#

editing to something like addWaypoint [position group1,group2.group3, 0];

fair drum
# bleak mural quick question. is it posible to create an array of potential positions(ie group...
private _positions = [];
for "_i" from 0 to 100 do {
    private _group = missionNamespace getVariable [format["group%1", _i], grpNull]; //group1,group2,group3,etc
    if (isNull _group) then {continue};

    _positions insert [-1, [
        [getPosATL leader _group, 0]
    ]];
};
// example output
[
    [[3834.82,6287.92,0.00143909],0],
    [[3790.36,6273.17,0.00143909],0],
    [[3838.84,6210.04,0.00143909],0],
    [[3912.23,6206.82,0.00143909],0],
    [[3910.28,6269.1,0.00143909],0],
    [[3891.55,6323.78,0.00143909],0],
    [[3821.9,6348.96,0.00143909],0],
    [[3766.74,6338.15,0.00143909],0],
    [[3738.48,6249.23,0.00143909],0],
    [[3759.27,6189.55,0.00143909],0]
]
meager granite
#

Kinda expected nil to mean "do not touch the backpack"

still forum
meager granite
bleak mural
terse tinsel
#

I have a problem, I want the bomb to detonate in the air in a helicopter. but then the bomb spawns and flies to the ground. How to make it explode right after spawning in the air? bomb="Bo_GBU12_lgb" createVehicle (getPos heli1)

hallow mortar
#

triggerAmmo

terse tinsel
bleak mural
#
this addEventHandler ["CombatModeChanged", { 
 params ["_group", "_newMode"]; 
   
 if (_newMode == "COMBAT") then   
  {  
   _wp =  vic1 addWaypoint [position yy5, 50]; _wp setwaypointtype "SAD"; _wp =  vic2 addWaypoint [position yy5, 50]; _wp setwaypointtype "SAD";   };  
    
}];    yy5 attachTo [this, [0,0,0]];
#

yy5 is a trigger attached to the group this syntax has in its init

#

it sort of serves my needs and im gona go with it,as im still learning alot about scripting

#

any feedback to make it better in a manner of speaking?

#

this sends vehicle 1 and 2 to support a group when they get into combat. id be applying this on each group with a further 3 vics in the mix. each group in combat is sent support(with SAD WP) and once its done it moves onto the next group that generated a combat state and supports it

#

I tried using "OR" for randomly choosing a vic,seeing the error pop up i assume thats not the way "OR" works. anyway id love feedback and knowledge. cheers

analog mulch
#

hi,
would like the script that checks if any civilians in the map have been killed and if so will display a hint

#

mission ends if a certain number of civilians are killed

cosmic lichen
#

Use a entitykilled mission event handler.

analog mulch
bleak mural
#

can i have an example to?

#

iv used selct random once before

cosmic lichen
#

I am on my phone..so..no😄

bleak mural
#

lol

#

select random needs an array i assume

hallow mortar
#

It's...not a terribly complicated command. https://community.bistudio.com/wiki/selectRandom

private _selectedVic = selectRandom [vic1, vic2, vic3];```
You could also subtract the selected vic from the array using `-` to ensure the same vic doesn't get selected twice.
bleak mural
#

thanks im looking now

bleak mural
#

under one of the menu's

analog mulch
#

yeah i've come across that option, just need in addition to that a hint to display everytime a civilan dies

hallow mortar
# hallow mortar It's...not a terribly complicated command. <https://community.bistudio.com/wiki/...

e.g.

// somewhere during initialisation
ra_var_supportVics = [vic1, vic2, vic3];
// .... EH
if (_newMode != "COMBAT") exitWith {};
if (count ra_var_supportVics < 1) exitWith { systemChat "No support available."};
private _selectedVic = selectRandom ra_var_supportVics;
ra_var_supportVics = ra_var_supportVics - [_selectedVic];
_selectedVic addWaypoint [leader _group, 50];```
I'm very dubious about your trigger attachment. `CombatModeChanged` is a Group EH and must be added to a Group; you can't attach things to a Group because it's not a real object. So either you're adding CombatModeChanged to a Unit (wrong) or trying to attach a trigger to a Group (also wrong). That needs adjusting and I'd question whether you actually need the trigger at all.
analog mulch
# cosmic lichen Use a entitykilled mission event handler.

i tried the following but gave me an error:

civDead = 0 ;
addMissionEventHandler ["EntityKilled",
{
params ["_killed", "_killer", "_instigator"];
if (isNull _instigator) then {_instigator = UAVControl vehicle _killer select 0}; if (isNull _instigator) then {_instigator = _killer};
if ((isPlayer _instigator) and (side group _killed == civilian )) then {civDead = civDead + 1; hint "A civilian died. WATCH YOUR FIRE!"
}];

bleak mural
#
yy attachTo [this, [0,0,0]]; this addEventHandler ["CombatModeChanged", { 
 params ["_group", "_newMode"]; 
   
 if (_newMode == "COMBAT") then   
  {  
   _wp =  vic1 addWaypoint [position yy, 400]; _wp setwaypointtype "SAD"; _wp =  vic2 addWaypoint [position yy, 400]; _wp setwaypointtype "SAD"; _wp =  vic3 addWaypoint [position yy, 400]; _wp setwaypointtype "SAD"; _wp =  vic4 addWaypoint [position yy, 400]; _wp setwaypointtype "SAD"; _wp =  vic5 addWaypoint [position yy, 400]; _wp setwaypointtype "SAD"; };  
    
}];    
#

and i have a trigger(though i could use a invisible helipad or whatever)

#

attached to the group

#

the trigger is just reference point for the wp

#

yy is the trigger name in the above

#

400 random pos

hallow mortar
#

You can't use attachTo to attach things to Groups because Groups do not physically exist. They don't have positions.

#

And you don't need a trigger as the reference point for the waypoint; just use the group leader's position as in my example.

hallow mortar
#

Are you absolutely certain this is in the group's init and not the group leader's init?

bleak mural
#

positive

#

blue rectangle

#

but yes i will use your example above just saw it

sullen sigil
#

tf

bleak mural
#

i even killed leader, and moved the group to a new location, tested and wp's were correctly given to new pos

hallow mortar
#

Tested. Objects attached via the group init field this are actually just attached to the group leader.

sullen sigil
#

ah

hallow mortar
#

It's kind of wild that that actually works at all

bleak mural
hallow mortar
#

It's completely undocumented and I never tried it since groups aren't real objects

bleak mural
#

you are correct. i did move the group but leader dead body was also moved

#

seems it is attached to leader

bleak mural
hallow mortar
#

The var definition goes somewhere...uh probably initServer.sqf and then publicVariable it, if this is MP, otherwise init.sqf for SP.
The rest of it goes inside your CombatModeChanged EH, whereever that is.

#

I'm not sure about the locality of group EHs. If they only fire where the group is local, then all fine, otherwise you also need a if !(local _group) exitWith {}; at the start of the EH to prevent conflicting responses from different machines.

bleak mural
#

its sp

hallow mortar
#

Is it staying SP or are you just testing in SP for now?

bleak mural
#

MP is a long way away for now so just sp

#

baby steps

#

so this in the init.sqf detects when a combat EH has fired essentially?

#

calls the defined vics

hallow mortar
#

No

#

The variable definition ra_var_supportVics = .. goes in init.sqf because that only needs to happen once, at the start

bleak mural
#

yes i did that

hallow mortar
#

All the rest of the code goes in the CombatModeChanged EH. Literally take it, and put it into the EH code. Inside the EH. It replaces the code previously in the CombatModeChanged EH.

bleak mural
#

oh i see

#

makes sense

hallow mortar
#

It's not fully complete, you need to add setting the wp type to SAD, but I think you can figure that part out

bleak mural
#

looking ok so far

#

out of 5 vics,one got the wp to move to support

hallow mortar
#

How many vics do you want to assign to each group?

#

(I suggest a number that divides cleanly into the number of available vics...)

for "_i" from 1 to 3 do {
  if (count ra_var_supportVics < 1) exitWith { systemChat "No support available."};  
  private _selectedVic = selectRandom ra_var_supportVics;  
  ra_var_supportVics = ra_var_supportVics - [_selectedVic];  
  _selectedVic addWaypoint [leader _group, 50];
};```
bleak mural
#

from 1 to 3 is giving a random number between that count to assign?

#

5 vics and 6 groups of infantry

hallow mortar
#

No, it means run this iteration 3 times. It's like a procedurally generated forEach - same effect as { } forEach [1, 2, 3]

bleak mural
#

got it got it. i think at this low number its perfect

#

il further experiment with this and adding more to the syntax,still quite confusing but understanding this much today and how it works was big step. thanks alot

kindred zephyr
#

can titles created using rscTitles be obtained by using findDisplay?

I've been trying a couple things, but it seems that Im only able to get controls from within a title if I have an uiVariable with the display object instead of being able to find it by numeric reference.

proven charm
#

storing the display like that is what i use, not sure if there is any other way

bleak mural
# hallow mortar No, it means run this iteration 3 times. It's like a procedurally generated `for...

iv found one issue(apolagies i should have explained in depth what i was looking to achieve). i understand it now that the vics are being technically assigned,once to a firendly group position,but after that they never get a new position when another combat EH happens. the mission is dynamic and lasting two hours,im hoping to have these vics continuously look for the EH firing and generate new wp's. is it possible to tweak that?

#

so IE one vic would be able to support any number of groups over a long duration of time. like a Guard wp essentially

hallow mortar
#

when you determine the vehicle is available again (condition up to you, but it should give enough time for the vehicle to have responded to its first mission), you can do ra_var_supportVics pushbackUnique _vehicle to add it back to the array of available vehicles

bleak mural
#

is this " ra_var_supportVics pushbackUnique _vehicle" simply added to the init on new line or edit original line?

#

ra_var_supportVics = [vic1, vic2, vic3,vic4,vic5];

hallow mortar
#

pushback and pushbackUnique add anything to the end of an array (pushbackUnique just makes sure it doesn't get added again if it's already in there)

hallow mortar
#

How you determine when the vehicle has "finished its assignment" is something you need to decide.

bleak mural
#

thats tricky. off top of my head and easiest way would be a simple timer(based on how mission is set up)

#

original support requester group in aware is another idea but less reliable

#

and not sure if possible to identify.

#

id go with a simple timer

#

so simply running " ra_var_supportVics pushbackUnique _vehicle" on a trigger activation is doable?

hallow mortar
#

Try adding this after the part that adds the waypoint:

[_selectedVic, waypointPosition _waypoint] spawn {
  params ["_vic","_pos"];
  waitUntil {sleep 5; (_vic distance _pos) < 200)};
  sleep 90;
  ra_var_supportVics pushbackUnique _vic;
};```
kindred zephyr
hallow mortar
hallow mortar
# bleak mural so pushback re adds items/units etc to an array selection?

Just to clarify, pushback/Unique is not specifically for re-adding things. We're calling it re-adding because we're working with vehicles that were previously in the array, but it can add anything to the array, there's no requirement that it had been in the array before. You could, for example, use it to make more or replacement vehicles available later in the mission.

bleak mural
#
this addEventHandler ["CombatModeChanged", {  
 params ["_group", "_newMode"];  
    
if (_newMode != "COMBAT") exitWith {};  
if (count ra_var_supportVics < 1) exitWith { systemChat "No support available."};  
private _selectedVic = selectRandom ra_var_supportVics;  
ra_var_supportVics = ra_var_supportVics - [_selectedVic];  
_selectedVic addWaypoint [leader _group, 50]; [_selectedVic, waypointPosition _waypoint] spawn { 
  params ["_vic","_pos"]; 
  waitUntil {sleep 5; (_vic distance _pos) < 200)}; 
  sleep 90; 
  ra_var_supportVics pushbackUnique _vic; 
};       
     
}]; 
#

getting error missing ;

hallow mortar
#

Oh, I thought you would've saved a reference to the waypoint for changing its type to SAD. You do need a reference to the waypoint in order to...refer to it later.

#

Also we need to work on your indentation :U

#
this addEventHandler ["CombatModeChanged", {  
    params ["_group", "_newMode"];  
        
    if (_newMode != "COMBAT") exitWith {};  
    if (count ra_var_supportVics < 1) exitWith { systemChat "No support available."};  
    private _selectedVic = selectRandom ra_var_supportVics;  
    ra_var_supportVics = ra_var_supportVics - [_selectedVic];  
    private _waypoint = _selectedVic addWaypoint [leader _group, 50];
    _waypoint setWaypointType "SAD";
    [_selectedVic, waypointPosition _waypoint] spawn {
        params ["_vic","_pos"];
        waitUntil {sleep 5; (_vic distance _pos) < 200};
        sleep 90;
        ra_var_supportVics pushbackUnique _vic;
    };
}];```
#

Oh, there's a ) in the wrong place

#

fixed

bleak mural
#

thanks im trying now, i decided no SAD was needed as just proximity should be ok and vics on SAD just have more chance of running over low walls and sticking(rhino on any Altis wall)

hallow mortar
#

Oh, hold on, let me make this more clever

bleak mural
#

go ahead, what are you thinking?

#

type group, expected object error with the above syntax on EH happening

#

is that because some of the named vics are dead/deleted?

hallow mortar
#

was the error type group, expected object or type object, expected group?

#

And are vic1, vic2 etc the vehicle objects, or the crew groups?

bleak mural
#

error distance : type group, expected array,object,location

#

vic names are not on vehicle,rather they are in the group init

#

group variable name

hallow mortar
#

that's annoying

bleak mural
#

it can work if i name the vehicles themselves?

#

object vehicle?

#

no it didnt

hallow mortar
#

Change them to be the vehicle objects, and try this:

this addEventHandler ["CombatModeChanged", {  
    params ["_group", "_newMode"];  

    if (_newMode != "COMBAT") exitWith {};
    
    private _selectedVic = objNull;
    while {isNull _selectedVic} do {
        if (count ra_var_supportVics < 1) exitWith {};
        private _tempSelected = selectRandom ra_var_supportVics;
        ra_var_supportVics = ra_var_supportVics - [_tempSelected];
        if (alive _tempSelected && {canMove _tempSelected}) then {
            _selectedVic = _tempSelected;
        };
    };
    if (isNull _selectedVic) exitWith {systemChat "No support available."};
    
    private _waypoint = group _selectedVic addWaypoint [leader _group, 50];
    _waypoint setWaypointType "SAD";
    [_selectedVic, waypointPosition _waypoint] spawn {
        params ["_vic","_pos"];
        waitUntil {sleep 5; ((_vic distance _pos) < 200) or (!alive _vic)};
        if !(alive _vic) exitWith {};
        sleep 90;
        ra_var_supportVics pushbackUnique _vic;
    };
}];```
bleak mural
#

type object expected group

#

ok one sec

bleak mural
hallow mortar
#

gud

bleak mural
#

salute you sir

hallow mortar
#

There are some more checks that could be added during the vicfinding phase, like "has ammo", "has crew", "has fuel" (canMove doesn't check that because ???)

bleak mural
#

{sleep 5; ((_vic distance _pos) < 200) the sleep is 5 sec's after starting SAD wp? and 200 meters is what?

hallow mortar
bleak mural
#

yeah i have EH's for everything else to make life easier

#

crew cant disembark in water,broken vic or upside down. they are there for life as short as it may be. ammo is resupplied by script.

hallow mortar
hallow mortar
bleak mural
#

love realism but i also have full time job i just want my AI self sufficent and "believable". with this "support" wp that is one huge step closer

bleak mural
#

infact if they blow up they bail,they are then a mission task for helo pilot to rescue

#

youve helped make my scenario a million times better. the Guard WP ,i found too many flaws and this is perfect! big thanks

#

Beautiful hmmyes

undone flower
#

where is the editor category and subcategory defined for weapons? I've looked in CfgWeapons and it's definitely not there

#

unless there's no definition and weapons are assigned to their respective categories by script

hallow mortar
#

CfgWeapons weapons aren't placeable in the Editor (or creatable in the world at all apart from simple objects using their models)

undone flower
#

yeah I figured that's the case

#

I should be looking at cfgvehicles

hallow mortar
#

The things in the Editor aren't true weapons, they're just ground holder objects (invisible containers) that come preloaded with a weapon

undone flower
#

yep it's in CfgVehicles

#

makes sense

pastel pier
#

How to check if battleye is on?