#arma3_scripting

1 messages · Page 224 of 1

remote narwhal
#

Maybe in the future you can add an alternative syntax for getUserInfo, like getUserInfo owner ?

still forum
#

not planned

#

You cannot write files no

#

Furthest you can get is creating a new mission in Eden and pasting something in maybe

#

if Eden is already open

radiant lark
#

Gotcha

#

RPT can be spammed tho

#

I remember I had disabled allvariables command on my server and CBA spammed the RPT with errors, 40mb file lool

#

Do you have in mind making a command that will return an unique identifier for each computer? Like HWID

still forum
#

No something about user privacy.
I also had like GPU name in graphics info, but that was pulled because identifying info and privacy

radiant lark
errant jasper
#

if you are going to fingerprint me at least offer me some delicious cookies

radiant lark
#

fingerprinting you will imply you are a stinky cheater

errant jasper
#

So you want a fingerprint of people the compuer used by person, you have confirmed cheats, to then do nothing with ?

radiant lark
errant jasper
radiant lark
errant jasper
radiant lark
#

I mean, destroying buildings and nuking the whole server

old owl
# radiant lark I mean, destroying buildings and nuking the whole server

I really do empathize but unfortunately wouldn't last long before they made such a command useless anyways- as they've had the ability to change results of commands like getPlayerUID.

Just gotta have a good CfgDisabledCommands, CfgRemoteExec and a heart beat like system to catch when they attempt to kill AC or do anything mischevious. Also watch what they do on every frame and ban them on the frame they do.

digital hollow
#

There are a few replay/aar mods. Have you checked if they suit your purpose?

still forum
tender fossil
still forum
#

You can't disable raw SQF input (in a way they can't super easily bypass anyway)

old owl
tender fossil
still forum
#

remoteExec is checked on server side, not bypassable.
But they can still run any code locally, just not remotely

errant jasper
#

Can they createVehicle and run init line everywhere?

radiant lark
tender fossil
#

I see 👍 I guess it having some kind of protective effect would require verifying all data that the clients send

radiant lark
#

Hence why I'd save the thread handle

old owl
#

Truthfully I should probably read more of what he writes on that end more often as if he got hit by a bus, we'd be really really screwed. Just always been really spoiled that it's always been his wheelhouse. Constant game of cat and mouse, I know he's spent hundreds if not thousands of hours over the years. Thankful for it and sure don't envy it when they end up doing something new.

radiant lark
#

Is he keeping it at SQF only?

old owl
# radiant lark Is he keeping it at SQF only?

We don't utilize any mods with any kind of client extensions as we are a mission only server for making it for easier for people to join.

The mission I work on has been getting added to for 12+ years and generates decent revenue so any of us who develop for it are under NDA so only so much I can say; as shitty as of a response as that is and I really do sincerely apologize w_sadcat

radiant lark
#

It’s really sad, my goal is to set a decent standard in the spanish community.

still forum
#

Everyone wants to use the badly made life framework and work around the security problems.
No-one wants to actually replace it with secure code 😢

old owl
radiant lark
still forum
#

Tonic lead by example of opening his code.
Everyone took it and cooked their improvements in secret

old owl
#

Yeah, really sucks. We'd all love to get into Reforger but we got a taste of our own medicine last time we tried. The Everon Life framework is so bare bones and the largest developments are made by servers who gatekeep it, like us.

#

Just a bummer w_sadcat

radiant lark
#

The only thing holding me back is that server owners will read the code and ask chatgpt for vulns to use on my own server

#

Any server will do warfare to be the only one standing

#

So sad the community cannot be shared

old owl
#

Which is a shame, because I feel like that kinda competition has really lead to other servers burning out over the years. Never been a fan, and tbh sucks for your code to not really be yours. Would love to publish the stuff I make to the workshop but can't due to those constraints I'm under and would have to be forced to chose; and I really do enjoy developing it and the people I develop it with.

split ruin
#

mission designers are so happy when ppl have a blast with their missions 👌
I like to have more crazy titels with coop missions, my last one was called "Semper Infidelis" and yeah it was about a traitor

#

oh, I never really made SP mission 🤫

#

actually team switch works well in MP but only when the player controlled unit dies he gets the menu and can choose another entity to control
in SP player can change who he will control even if the units are alive
this makes me think a simple menu using selectPlayer command will be a solution

#

or maybe ACE is doing some strange things in the background ...

#

ACE is uncharted territory full of wonderful surprises 😆

#

I had a friend screaming because he cannot play the mission, turns out he has ACE and ACE no medical and other mods turned on

#

life is hard 😂

hushed turtle
#

The only think I don't like about it is I can't respawn dead units

#

In SP you can spawn new ones and add them to teamswitch list, not in MP though

hushed turtle
dusk gust
# radiant lark They can dump and kill threads tho, heartbeat could be replicated

Sure, they can replicate the heartbeat in some ways. There are ways to do so without them being able to intercept the results. Active scripts with verifiable values, pings from server, generate variable names/values on join. One thing coming soon with the hashValue with script handles will make it easy to store and verify active script handles (as they can currently just swap it to a different script).

dusk gust
# still forum I wonder how that works though. They cannot override it on server side. So surel...

Essentially they can change the result of getPlayerUID/name/owner on their own player object. Unsure as of now if its due to them pointer-swapping the commands to something else, or if they are just locally changing the flag of their player object.
From what I've seen, getPlayerUID and name do still work server-side, just will not return properly on their client.

They also do some interesting pointer-swapping with compile/compileFinal/isFinal commands, but thats a story for another day.

radiant lark
#

Which to be fair sounds pretty achievable to me

dusk gust
#

And function can be overwritten

#

So yeah, they can

radiant lark
#

And, by the way, thank you so much for suggesting that incredible mission event handler

#

For spawned script

dusk gust
#

Oh haha, been wanting it for years

radiant lark
#

It's going to be really useful

radiant lark
#

I am afraid this dedmen guy will shuffle up the network messages identifiers 😅

#

Because, I guess the EH will need a new network message

dusk gust
#

If you're not doing something... strange, the network message "identifiers" wont matter to us. The eventhandler also shouldnt be a network event anyhow

restive leaf
dusk gust
#

I really hope so tbh

restive leaf
#

I do think I remember ban messages for it changing in the past

silent cargo
#

Yeah that sucks

granite sky
#

If a vehicle has the same magazine on multiple turrets (eg pilot + gunner), there is no way through script to determine which turret a particular pylon is assigned to through setPylonLoadout, correct?

hallow mortar
#

getAllPylonsInfo?

granite sky
#

Ah ok, missed a command, thanks.

#

Apparently this codebase is older than this command :P

hushed turtle
#

I don't think teamrespawn allows you to do that

proven charm
#

is it possible to disable player reloading for a moment?

#

other than disableUserInput

still forum
proven charm
sleek forum
#

Hello there, lads. Needed some help with a mission I am making. I have been trying to make custom airbase on a map (South Asia). I know that there are airports there, but I want some in a new place where AI can take off and land. I know that there is something called the Dynamic Airport Configuration, but I have no idea how to script it in

hushed turtle
#

I think you're talking about other respawn types, which respawn unit, but don't allow switching unit using teamswitch. I don't thibk there is way to get them both at the same time

proven charm
sleek forum
proven charm
#

basically you make a mod. unless possible in the mission config (description.ext)

sleek forum
#

Dammit I suppose

sleek forum
#

Preferably both

#

Choppers are easier, yes. Jets are the problem

#

Oh I would need luck, alright

warm hedge
#

You can actually spawn an airport that is used by USS Freedom, if that's sufficient

sleek forum
warm hedge
#

Other than that there is no vanilla equivalent IIRC

sleek forum
#

I am playing on a map called South Asia which is huge and perfect for air combat. The problem is that the airports are way too far apart so I wanted to make some airbase close to each other

#

It takes around 5 mins to to reach one airbase

#

That's too much

warm hedge
#

Oh correction. You can use AirportBase if that is bigger enough for you. It has 500m long runway

#

Other than that, you want to make a Mod

sleek forum
warm hedge
#

Do the same but just AirportBase

sleek forum
#

Huh alright, I will do that

sleek forum
cursive tundra
#

Hey im having a problem with this script, which is supposed to enhance AI Vehicles detection.
Its supposed to make the commander and gunner observe the environment, esp if there are no current known enemies to engage
The problem is, instead of turning 20° to the left or right of the vehicles orientation, the gunner almost does a full turn, even when he is not designated the observer.
Why is that?
Does he follow the commanders turning?

#
params ["_veh","_sideEnemy"]; 

/// insert [this, _sideEnemy] execVM "thisScript.sqf" in a vehicles init or 

while {alive _veh} do {
    _dirVeh = getDir _veh;
    /// figure out if the commander of the gunner is the primary observer (here called "watcher")
    /// usually this role is the commanders
    private _watcher = commander _veh;
    /// if no commander is found, the gunner is the selected watcher
    if (isNull _watcher) then {
        _watcher = gunner _veh;
    };
    
/// OBSERVATION PART:

    /// resets the observers current obeservation target, turret resets to resting position again
    _watcher doWatch objNull;
    
    /// Logic for the rotation of the turret / periscope / whatever means the watcher uses to observe the surroundings
    private _random = random 1;
    for "_i" from 1 to 18 do {
    private _heading = _dirVeh;
    if (round _random == 1) then {_heading = _dirVeh + 20*_i;};
    if (round _random == 0) then {_heading = _dirVeh - 20*_i;};
    private _position = _veh getPos [600,_heading]; 
    _watcher doWatch _position; 
    _watcher lookAt _position;
    
    sleep 0.3;
#
    /// once a full 360° observation is done, resets the observers current obeservation to reset the turret to resting position again
        if (_i == 18) then {
            _watcher doWatch objNull;
        };
    };
     /// if the gunner isnt the observer, this handles the gunners observation behavior 
        if (_watcher != gunner _veh) then {
        private _nearTargets = (gunner _veh nearTargets 1200) select {_x select 2 == _sideEnemy};
            if (count _nearTargets == 0) then {
                private _headingGun =  _dirVeh;
                hint format ["%1",_headingGun];
                private _randomDir = random 1;
                if (round _randomDir == 0) then {_headingGun = _dirVeh + 20;};
                if (round _randomDir == 1) then {_headingGun = _dirVeh - 20;};
                private _positionGunner = _veh getPos [600,_headingGun]; 
                gunner _veh doWatch _positionGunner; 
                gunner _veh lookAt _positionGunner;
                sleep 8;
                gunner _veh doWatch objNull;
            }; 
        }; 

    private _random = 0;
};
granite sky
#

lol

#

⁨```sqf
if (round _randomDir == 0) then {_headingGun = _dirVeh + 20;};
if (round _randomDir == 1) then {_headingGun = _dirVeh - 20;};

#

Turns in a random direction rather than attempting to pick the closest.

#

Ah, I probably misread the intention anyway.

cursive tundra
#

i mean its supposed to be random whether he checks left or right, but it should still be 20° of 0 no?

granite sky
#

It's in a 1-18 loop.

#

So it does 20 degrees per 0.3 seconds, in a full circle.

cursive tundra
# granite sky So it does 20 degrees per 0.3 seconds, in a full circle.

yes - thats what i want for the watcher, hes supposed to check full circle - the problem is the /// if the gunner isnt the observer part - the gunner, if hes not the observer, should keep the gun more or less in the direction the vehicle is facing and only check that, while the commander / watcher checks 360°

hallow mortar
#

Oh sorry, I read the other one, never mind

cursive tundra
#

it seems however that the gunner follows the commanders direction - if i spam "gunner _veh doWatch objNull;" in the 1-18 loop, the turret doesnt turn until it reaches the /// if the gunner isnt the observer part

#

so it seems to be a thing with AI behaviour

split ruin
somber silo
#

It seems the alternative syntax for lineIntersectsSurfaces doesnt work
I get an error that 3 elements expected in array, 8 provided

example code

lineIntersectsSurfaces [ [[0,0,0], [0,0,0], objNull, objNull, true, 1, "GEOM", "NONE"], [[0,0,0], [0,0,0], objNull, objNull, true, 1, "VIEW", "NONE"] ];

hallow mortar
#

You need another level of array

#

The syntax is lineIntersectsSurfaces [[ _array1, _array2, _array... ]]

somber silo
#

Actually on wiki its

lineIntersectsSurfaces [[element1, element2, ...]]

but I get the point - atleast 3 elements required.
Maybe this should be on the wiki?

hallow mortar
#

"at least 3 elements required" isn't the problem

#

Your example code should look like this:

lineIntersectsSurfaces [[
  [[0,0,0], [0,0,0], objNull, objNull, true, 1, "GEOM", "NONE"],
  [[0,0,0], [0,0,0], objNull, objNull, true, 1, "VIEW", "NONE"]
]];```
There is a layer of `[]` missing from your original attempt
somber silo
tulip siren
#

hello, im making a mission where you provide air support to a ground team, problem is i cant see where the ground team is 90% of the time, is there a way to add a 3d tracker to them?

granite sky
#

That would be a fairly straightforward use of drawIcon3d

cursive tundra
#

i have a script set up that uses fireAtTarget to make a tank fire at a target - so far, so good...
now i do want him to fire a HE round tho...
since there is no guarantee that mods will have "HE" in the string or something, how do i select the proper magazines?
currently, it works, but the tank just fires "currentMagazineTurret", which is usually an AP round

#

It seems that one can use the configs for it, but ive never done that before

warm hedge
#

I think you need to load magazine before that, can't tell much rn, but since fireAtTarget doesn't have mag argument

cursive tundra
#

yeah i load it before, thats not the problem, but i dont know how to reliably get a HE magazine from magazinesTurret.

#

which is why for now its using currentMagazineTurret for testing purposes, resulting it only firing AP

#

if (count _nearTargets != 0) then {
        
        /// select turret & magazines
        private _turretPath = [0];  
        private _mainGun = (_veh weaponsTurret [0]) select 0;
        private _magazinesTurret = _veh magazinesTurret [0];
        
        // Select Ammo
        _HEround = _veh currentMagazineTurret [0]; 
        _veh loadMagazine [_turretPath,_mainGun, _HEround];


        
        
        /// target selection Logic
        _nearEnemyObjects = _nearTargets apply {_x select 4};
        _target = selectRandom _nearEnemyObjects;
        hint str _mainGun;
        _veh doWatch _target; 
        waitUntil { _veh aimedAtTarget [ _target] > 0 };
        sleep 1 + random 2;
        gunner _veh selectWeapon _mainGun;
        gunner _veh fireAtTarget [_target, _mainGun];
    };

granite sky
#

If there's no HE then it'll be a HEAT round or some sort of DP thing.

cursive tundra
#

i got it to work, thank u!

#

ugh... only to find out as soon as i test it on an RHS instead of CUP tank it doesnt return the main gun but some random laser...

#

okay that seems to be a problem with the array sorting. Ill fix that tomorrow

granite sky
#

Trying to make stuff work with arbitrary vehicle mods is a losing battle :P

young mist
#

Anyone have experience with creating spawn points that can place characters in Vehicles or locations on a map before a mission begins? I want to be able to have a mission start with the player having the ability to choose how their team will deploy

hushed turtle
#

I don't think you can this from briefing before mission starts

#

On mission start you display a dialog or something, where player can adjust his preferences and then clicks a button to close dialog and start the mission. Then you move him based on his preferences

hallow mortar
#

You can have briefing links that execute code, and you may be able to use the MapSingleClick Mission Event Handler as well

#

Some code might not work properly while simulation is paused in the briefing phase, but you can at least queue up data to be used once the mission actually starts

cosmic lichen
errant iron
#

Is it possible to get the artillery computer's map control and draw icons on it?
I recently got my friendly icons to render on minimap side panels (ty sa-matra from the past) and was wondering if this is possible, since my players will sometimes friendly-fire with artillery unless they're regularly flipping between the computer and their map.

cosmic lichen
#

Afaik the UI has no unique Idd. Getting the control is a bit hacky. You need to loop over all controls, find the map control and check if it has the correct class name with ctrlClassname.

#

Then you should be able to draw on it, but I don't know for certain.

errant iron
# cosmic lichen Afaik the UI has no unique Idd. Getting the control is a bit hacky. You need to ...

ahh thanks for the tip, i wrote a polling loop to find the display and add it: ```sqf
while {true} do {
sleep 1;
if (!shownArtilleryComputer) then {continue};

private _displays = allDisplays select {
    ctrlIDD _x isEqualTo -1
    && {ctrlClassName (_x displayCtrl 500) isEqualTo "CA_TSMap"}
};
if (_displays isEqualTo []) then {continue};

private _ctrl = _displays # 0 displayCtrl 500;
if (!isNil {_ctrl getVariable "WHF_addMinimapHandlers_called"}) then {continue};

_ctrl ctrlAddEventHandler ["Draw", WHF_fnc_drawMapProjectileIcons];
_ctrl ctrlAddEventHandler ["Draw", WHF_fnc_drawMapFriendlyIcons];
_ctrl setVariable ["WHF_addMinimapHandlers_called", true];

};```

torn stream
#

Okay, i'm trying to figure out what's going on
i have a script RightConsoleInit.sqf it's currently being ran with:
["FiringRange\ATMoving\RightConsoleInit.sqf"] remoteExec ["execVM", 2];

it doesn't run/work in Dedicated servers,

within it there is a addActions that runs the following:
["FiringRange\ATMoving\Right\Right100.sqf"] remoteExec ["execVM", 2]

If i manually run the addActions in the first script (it works), and the second script (trigger by the action) also works, it's just the first script that doesn't runs

Am i missing something?

warm hedge
#

How it does supposed to be called? Which file, which script does that?

torn stream
#

i'm currently using the Debug console to try and run it, and it doesn't work

#

neither Local, Global, Server

warm hedge
#

Are you sure RightConsoleInit.sqf does have any scripts within?

torn stream
#

yes, i'm copying directly from it

warm hedge
#

Does that script have any obvious debug commands, like hint?

torn stream
#

and i can CTRL+A the script and run it in the debug console and it works

#

it's just calling that file that doesn't

warm hedge
#

What about other targets than 2 ? Like 0

torn stream
#

and just looking over the game's configs there's a class CfgRemoteExecCommands which i think it is what it sounds to be, and it does not include execVM, but then the second script via addAction shouldn't work either right?

torn stream
warm hedge
#

...Wait, you're addAction'ing into the server?

torn stream
#

Wym?

#

i'm asking the server to run an addAction, yes

warm hedge
#

addAction is a Local Effect command, it won't networked

torn stream
#

i see

#

makes sense

warm hedge
#

So if it's a dedi, you are adding actions to nobody

torn stream
#

wym?

#

no, no there's a variable

warm hedge
#

?

torn stream
#
ATRangeConsole_Right addAction ["<t color='#001BFF'>Right AAT 100m</t>",{["FiringRange\ATMoving\Right\Right100.sqf"] remoteExec ["execVM", 2]},nil,1,false,true,"","",4];
#

it's a Object variable set via eden

warm hedge
#

It doesn't matter/unrelated. The server, which is nobody, will not network the action to other clients

torn stream
#

so an addAction needs to be ran on everyone's client for it to appear to them?

warm hedge
#

If you want everyone to use it, yes

torn stream
#

on the wiki for addAction it have this, what's this supposed to be then?

warm hedge
#

GA means Global Argument(s), means you can use non-local (networked) object to use, LE is Local Effect, which is what I'm talking about

torn stream
#

ah, ok, ty

old owl
sharp torrent
#

Enhanced movement mod - allows to get off the building safely (depending on height) via keyboard shortcut (with animation)

cursive tundra
#

Is there a way to make a tank turn its hull towards a direction in place?

#

the way im doing it rn ( ordering the driver to move about 10m in direction of target) works, but its prob not the best way to do it

supple shard
#

Hi everyone, i have a question, do you have a tool to convert a mp4 file to ogv ?

supple shard
#

Thx for your answer 🙂 Have a good day

hallow mortar
#

I dunno if setFormDir would work, might be worth a shot

cursive tundra
#

setFormDir didnt work, tried that already

#

unless i messed it up

#

sendSimpleCommand might - doesnt have to be super precise, everything is better than tanks with their back to the enemy

remote narwhal
#

regularCheck in server.cfg doesn't work? I'm trying to check with regularCheck = "kick (_this select 0)"; I've been on the server for over 20 minutes and nothing is happening.

trail smelt
#

Hello, is it possible to detect a PBO that a player launches with the game and then display an error message in the main menu asking the player to restart the game because they are using incompatible addons/PBOs? Like Engine errors

proven charm
#

one way is to check CfgPatches to see if the mod is loaded ```sqf
isClass (configfile >> "CfgPatches" >> _mod)

#

replace _mod with the mod config name

quasi zenith
#

I'm having trouble with setFlagSide
It appears to work fine in singleplayer, but in multiplayer, some people can see the flag on the carriers back, and some cannot. This is a pretty old arma function but for some reason it's not working. Anyone have experience with this?

All I want to do is be able to have players carry a flag. "this setFlagSide east;"
Is what i'm using so blufor can carry that flag.

winter rose
#

if you use it in the init field, don't

winter rose
quasi zenith
#

(with a flag name?)

fair drum
#

that would be for an init field of an object

quasi zenith
#

Ok, tried this, but now the flag doesn't show on the characters back at all, in MP or singleplayer.

#

Tried a base game flag and setting a custom texture

#

The option is there, it runs down the flagpole and then vanishes

winter rose
#

try without any mods at all

little eagle
#

setvariable PUBLIC does trigger PVEH in 1.55 dev (haven't tested in 1.56 RC). At least when used on objects

tulip siren
#

Hello, im making my first big scenario and i was wondering if its possible to make it so in the tactical map, once u click a node, it spawns a custom composition and teleports the players there. Would be nice to know if its even possible before attempting to make it. Thanks.

cosmic lichen
#

What is the tactical map?

tulip siren
#

from what i saw its a module that lets u open an interactive map

#

i know u can add nodes to it that have an "on activation" parameter but im not sure if u can spawn compositions on a specific part of the map

cosmic lichen
#

You mean the strategic map. Yes you can execute any script when clicking on one of the icons

tulip siren
#

alr thanks

exotic flame
#

When i look at the config of the AK12 configfile >> "CfgSoundShaders" >> "AK12_tailInterior_SoundShader" >> "volume" i can see volume = "interior"; so i assume the game can detect when a unit is inside a building. Is there a command or something to detect by script it the player is inside a building or not ?

hallow mortar
#

Yes, funnily enough it's called insideBuilding

#

Note that it's based on the surface the unit is standing on (as is the weapon sound controller), not a "real" check for whether the unit is surrounded by walls/roof/etc, so it can return "inaccurate" results in some circumstances

split ruin
#

I wonder if I group every enemy AI in one group (they will be only static defense of a village) can I squeeze some more performance?

exotic flame
#

i'll probably use both actually, is insideBuilding is false then i check every 45° around the player and if all intersects a surface at a predetermined distance

split ruin
#

can somebody help with smoke module, I need to create smoke screen for assaulting infantry, is it possible by changing the particles properties?

hushed turtle
split ruin
#

so making all defending AI to be in one group literally make them "comunicate via radio" where the enemy is, this is cool
I will try to solve the problem with the smoke screen by making a script that spawns mortar smoke shells ...

tulip siren
#

does anyone know how the strategic map's zoom works, i set the scale to 0.1 and it looks really zoomed in but any scale above 1 doesnt zoom out more, and it doesnt seem to have a zoom feature with the scroll wheel

split ruin
#

@tulip siren you cannot zoom in/out the strategic map

tulip siren
split ruin
#

yes, but during mission you cannot change its scale

tulip siren
#

I was messing with the scale param, everything below 1 made it zoom in but anything above 1 didnt affect it in any way for some reason

split ruin
#

1 is max zoom out I think

#

and you have to drag a lot with the mouse, this cannot be changed unfortunately

tulip siren
#

Maybe i could grab a smaller resolution of the map and use that as the display?

split ruin
#

yeah having just part of the map as the strategic map will fix the problem ...

tulip siren
#

Alright, thanks for the help

naive needle
#

@silent cargo here is one , its taking te pos of the vehicle tho , so you can try to replace getPosASL _vehicle with eyePos _player.

player addEventHandler ["GetOutMan", {
  params ["_player", "", "_vehicle", ""];
  [_vehicle] spawn {
      params ["_vehicle"];
      _player = player;
      private  _VehiclePos = getPosASL _vehicle;
      _VehiclePos = [_VehiclePos select 0,_VehiclePos select 1,(_VehiclePos select 2) + 1.25];
      waitUntil {uisleep 1.5;vehicle _player isEqualTo _player};
      private _ObjectsInterlineIntersectsWith = lineIntersectsWith [(eyePos _player),_VehiclePos,_vehicle,_player];
  
      if (_ObjectsInterlineIntersectsWith isNotEqualTo []) then {
          _Sucess = _player moveInAny _vehicle;
          if !(_Sucess) then {
              _player moveOut _vehicle;
              uisleep 1;
              _player moveInAny _vehicle;
          };
      };
  };
}];```
little eagle
#

How? Just use a different variable name.

tulip siren
#

Nope just the tactical map module being goofy, ended up just swapping display

remote narwhal
sly cape
#

What are you currently doing?

#

I mean what's your code.

hallow mortar
#

Those conditions contradict each other. If there's 1 player alive, then there cannot be 0 switchableUnits alive.

#

No, there's one. That player.

#

Also note that switchableUnits has limitations in multiplayer, which are described on the wiki page.

hushed turtle
#

Why do you need to check if 1 player is alive and 1 switchable unit at the same? Why one them them is not enough?

proven charm
#

i guess its not possible to remove magazine from unit that has X amount of ammo?

granite sky
#

You remove all the magazines and then add back the others.

proven charm
#

yea was thinking the same, but very big operation 🙂

#

Ai would have to reload i guess....

#

or not if bullets remain in the weapon

granite sky
#

Not sure what it's for, but there are certainly performance risks :P

proven charm
#

i made script where AI throws you a mag, if requested

granite sky
#

That's probably fine. Won't be used enough to cause issues.

#

Continually adding and removing items is a bit dangerous because I don't think Arma will optimise the JIP queue unless you remove everything from a container.

proven charm
#

good point. i think im going to avoid the mag resetting because of bandwidth and the AIs typically have only full magazines anyway

granite sky
#

They don't reload until they run out of bullets, I would guess?

#

I guess players could cheese it by adding mostly-empty mags to the AI's backpack.

#

You could work around that by removing a magazine and then checking how many bullets were lost.

proven charm
#

well if some one cheats by giving AI mags thats not big thing, but how you even give AI mags Idk

granite sky
#

Backpack access, vanilla feature.

proven charm
#

oh

#

isnt that a cheat already ;D

granite sky
#

Well, it's not creating new bullets at least :P

proven charm
#

i doubt anyone realizes such exploit... because i doubt not many people looks for such a thing in CTI mission. because mags are virtually free in that

hushed turtle
proven charm
#

its hard to make the AI throw the magazine at you, works only 90% of time right now but maybe i'll figure out something new

hushed turtle
#

It's throwing that important? I'm thinking action in action menu, which would remove one mag from AI and give to you would do it.

proven charm
#

idk throwing sounded like a good idea because thats how it would probably go in real combat

hallow mortar
#

I think if I was doing it, I would make it so it doesn't actually interact with the AI's inventory. It would just be "if they aren't completely out, then they can give you one by creating it, with some cooldown". Relatively cheese-proof if the cooldown is 30+ seconds, minimal chance of getting screwed by the Arma 3 inventory system

hushed turtle
#

Maybe play some ammo sound blobcloseenjoy

#

I understand in real life. Someone would give you mag by his hand or throw it at you, but here we are in Arma 😀

#

I've just realised I can just take mag from AI's backpack, if he was one 😆

proven charm
#

part of the problem is knowing which AI is closest and where because that AI will give the mag

hallow mortar
#

A little ✨ raycasting ✨ ought to solve that problem

proven charm
#

im checking checkVisibility so that AI has to actually see you

past pollen
proven charm
#

thx for the link! but I like to write my own scripts 🙂

past pollen
proven charm
#

can probably get good ideas from others scripts though... 🙂

#

the way that script handles mag passing is different from my approach

proven charm
#

ok thx not sure how this helps with my problem though but maybe i didnt understand correctly

proven charm
#

oh i see now how that command works but idk how to get right cargospace yet as the mags can be anywhere

granite sky
#

Units already had removeMagazine anyway.

proven charm
#

yes but it seem this command removes mags by the ammo count

granite sky
#

hmm, I guess

#

you could do magazinesAmmoCargo uniformContainer _unit and search for it.

#

(and the other two)

proven charm
#

good idea i'll try that, thx!

proven charm
#

seem to work gud, thx everyone! 👍

silent cargo
deep quiver
#

Ughh.. I made a script that makes an AI group to get in a vehicle and then drive to a nearby waypoint (also scripted). In SP everything works smoothly, but for some reason in MP (dedicated) there's a huuuge delay (+200s) between getting in and moving to the next waypoint. Has anyone solved anything similar?

#

I'm using assignAs... and orderGetIn commands.

lone glade
#

could be because you're running too many scripts at once

deep quiver
#

Other waypoint types, like MOVE, are working well.

#

I now made an empty virtual reality mission, with a 4 men group and one hunter. I tried the mission both in SP (editor) and MP (dedicated) with a following debug console code:

grp = group leader1;
men = units grp;
leader1 assignAsCargo car1;
(men select 1) assignAsDriver car1;
(men select 2) assignAsCargo car1;
(men select 3) assignAsCargo car1;
men orderGetIn true;
wp = grp addWaypoint [(position goal1), 10];
wp setWaypointType "MOVE";

goal1 is a flag pole in the distance.
SP: everything works
MP: the group gets in and just idles for something like 2-4 minutes before moving.

#

(I used selections because that's the way I have to do it in the actual script)
(+ the dedicated server is fast and unmodded)

proven charm
#

no thanks Scotty, I write my own scripts 🙂 because coding is fun

proven charm
#

famous last words before running to some coding dilemma 😅

hushed turtle
#

You could rewrite his script for your liking 😀

proven charm
#

nah

#

some big scripts are nice to use so you wont have to write all that yourself , especially if the code is well written.

#

but i dont find very often well written scripts....

proven charm
#

i trust its good if ya say so 😉

#

well im sure its good then and of course you can show it to me if you want, maybe I can help too

#

true

#

post here

#

hmm interesting script, I have to point out that setAmmo only works on player/client machine not the server. dunno about reload if that works

#

like self hosted server? i was thinking of dedi?

#

did you try it on dedi?

#

well AFAIK setAmmo wants local argument which means only local player will do. so i doubt it works on dedi

errant jasper
#

Well if Scotty runs it from radio trigger probably does work.

#

Don't radio triggers run locally?

proven charm
#

ya definitely should work when ran on client

#

np

#

yup

#

ok ic

#

oh , what you tried?

#

ok 🙂

proven charm
#

i agree mag repack scripts are a must have

#

there was one? 🤔

#

oh ok

#

i have a question about magazines if anyone knows. are the mag class names from configFile >> "cfgMagazines" in same case than the magnames returned by magazines command?

#

Scotty not really other than what I already said

#

i wanna do ```
(_magname in magazines _plr)

#

my mag repack script

hallow mortar
proven charm
#

i just happen to write my repack script day or two ago

proven charm
#

actually i get ```
(configFile >> "CfgWeapons" >> _x >> "magazines")

hallow mortar
proven charm
#

ok i will take into account then. thx

hallow mortar
#

Also, some (many) weapons use magazine wells, so magazines doesn't tell the complete story of what magazines they can use

proven charm
#

yes, what my script also does

hallow mortar
#

Luckily we have compatibleMagazines to do all this in a simple way

proven charm
#

aah thx i will use that!

hallow mortar
#

I do not know if compatibleMagazines matches CfgMagazines case; you should test that before relying on it.

proven charm
#

my scripts always tend to bloat

#

no problems

proven charm
#

Scotty i didnt test your script but i reviewed it. i hope that was what you wanted?

#

I mean I commented on the code, earlier

split ruin
#

this is what a say to a friend good in Blender, secretly pushing him to make standalone Ka-52 model 😆

#

he made a space rocket engine from scratch for two days 🤫

#

but have never touch arma tools

#

or scripting

#

why not using JCA ?

#

all weapons there are vanilla plus quality

#

there are not much rifles and all are extremely well made

#

actually vanilla + JCA will make you skip RHS or CUP entirely and this is a lot of gigabytes

sly cape
#

CBA doesn't even do anything.

split ruin
#

CBA actually makes the game to run even smoother from my experience

sly cape
#

It's needed so different mods don't break each other.

short anchor
#

It provides a library of useful functions with performance optimisations, caching etc

#

I'm very stringent with the add-ons I run locally and on my server. Not all add-ons are bad.

It's like writing code without using libraries/shared DLLs

#

One of those things will give you a lot of grief and cause you to neglect relationships as you waddle your way through many problems.

The other is drugs

split ruin
#

from my experience I always spend time to test and find the good and needed mods, but yeah most milsim groups modlists are pure insanity 😵‍💫

#

I use only quality drugs lol

short anchor
# split ruin from my experience I always spend time to test and find the good and needed mods...

I developed the ArmaPresetCreator website to streamline the mod preset creation process from steam workshop. It was all working well until one user created a modpack comprising hundreds of mods which causes the system to error because I send all mod IDs to steam in a single request.

The use case is so niche that I haven't really been motivated to fix it. Hundreds of add-ons is insanity though

#

Not really, I've put my feet up 😂

The website works fine as long as the preset size isn't ridiculously large

#

People I play with used to ask for 5GB mods to be added so they could use a single item. Waste of time and space for everyone really

Too many mods are bad. It's always good to pick a handful of decent quality mods to improve the experience

thin fox
#

I tend keep my modlist under 25-30 mods max

#

because really, there are a lot of shitty stuff in workshop lol

split ruin
#

my current modlist is 7 mods 🙂

thin fox
#

well there are some units/groups that uses like 70+ mods easily

split ruin
#

Western Sahara
CBA
AWESome : Aerial Warfare Enhanced Somehow
Advance Aero Effects
JCA - Infantry Arsenal
ACE
JBAD
Lythium

thin fox
#

it's all about scenario depedency

short anchor
#

Yeah mine is like 7 or 8 I think.

I have 3 workshop collections comprising server mods (VCOM AI), essential mods (server and clients like weapons, units, vehicles etc) and optional mods (whitelisted on server, impacting single clients only)

thin fox
#

if you run a vanilla mission, you don't need many mods, then my list goes to 8 mods max just to make Vanilla plus

split ruin
#

yeah I know, its adds a very good desert map and guys that can roleplay any jihadi faction - islamic state, taliban, etc

#

not to mention desert skins for nato

sly cape
#

So use it!

split ruin
#

everything are mods technically - maps, dlcs, etc 🙂

sly cape
split ruin
#

everything that is packed as a mod I think

#

what are your terrains @pallid palm ?

#

I know Lybor

#

the vietnam one is looks really good

split ruin
#

literally every night mission is full moon , specially in a forest/jungle

#

especially with ace 😆

#

yeah I learn that with mods
standalone = good
vanilla compatible = good
complete overhaul = bad
dependencies = bad

#

scripting cannot bring weapons, gear, vehicles, terrains and if you need them for the mission, mods are the solution

thin fox
#

you don't need mods because... in your missions you don't need them lol, there's nothing special about this

split ruin
#

of course you need to actually test them not just copy paste some milsim group modlist like they do usually

#

that's a deep philosophical question 😂

tender fossil
#

A wise man said once: "you'll have to learn to like yourself; you're the only person you spend your whole life with"

#

Sorry, I didn't get it. I'm slow like always 😄

split ruin
#

but only skeptical thinking will bring any change so better question yourself from time to time 🤔

tender fossil
split ruin
#

my love for arma is above any questioning

#

?

#

I have seen a lady that stores her own piss in her hous for years ...

hallow mortar
#

Did she use Arma 3 Scripting to do it?

granite sky
#

(off topic)

split ruin
#

I thought it will be good npc for apocalypse scenario

hallow mortar
#

We're not moderators, we can't get you in trouble. It's just a reminder. It's polite to keep the channel on topic.

split ruin
#

actually I have on topic question
the problem is my moderator stuff is working only on the unit I controll initially
but we play coop missions without respawn, we use team switch
and switching to another unit lose my custom support menu
any way to fix this?

//initplayerLocal.sqf
if ((name player) == "kiba3x") then
{
    [player, "menu_comms_1"] call BIS_fnc_addCommMenuItem;
    [player, "menu_comms_2"] call BIS_fnc_addCommMenuItem;
    [player, "menu_comms_3"] call BIS_fnc_addCommMenuItem;

        MENU_COMMS_1 =
    [
        ["MenuName", false],
        [
            "Abandon Mission", [2], "", -5,
            [
                [
                    "expression",
                    "
                        'abandon' call BIS_fnc_endMissionServer;
                    "
                ]
            ], "1", "1", "\A3\ui_f\data\IGUI\Cfg\Cursors\iconcursorsupport_ca.paa"
        ],
        [
            "Fail Mission", [2], "", -5,
            [
                [
                    "expression",
                    "
                        'fail' call BIS_fnc_endMissionServer;
                    "
                ]
            ], "1", "1", "\A3\ui_f\data\IGUI\Cfg\Cursors\iconcursorsupport_ca.paa"
        ],
        [
            "Win Mission", [2], "", -5,
            [
                [
                    "expression",
                    "
                        'win' call BIS_fnc_endMissionServer;
                    "
                ]
            ], "1", "1", "\A3\ui_f\data\IGUI\Cfg\Cursors\iconcursorsupport_ca.paa"
        ],
        [
            "Clear Vegetation", [2], "", -5,
            [
                [
                    "expression",
                    "
                        { _x hideObjectGlobal true } foreach (nearestTerrainObjects [bars1,['TREE', 'SMALL TREE', 'BUSH'],50]);
                    "
                ]
            ], "1", "1", "\A3\ui_f\data\IGUI\Cfg\Cursors\iconcursorsupport_ca.paa"
        ]
    ];
} else {};
split ruin
#

so I have to remove it from the old unit, then add it to the new unit?

#

how to remove the support menu ?

errant jasper
deep quiver
#

Ah, the problem was caused by the new waypoint if it is given at the same time as the group is being assigned to a vehicle. Dunno why it behaves differently in SP though.

bold rivet
#

Quick question, could someone explain what a dedicated server and non dedicated server is? And what a headless client is?

proven charm
#

dedi is like when only server is running on the machine and no clients

tulip ridge
proven charm
#

it maybe confusing because in arma terms dedicated may mean the server you are running on your PC

bold rivet
#

Ah I see, thank you, do you per chance also know what a headless client is?

proven charm
bold rivet
#

Oh, haven't found that wiki page yet, thanks

austere rune
#

Hoping someone can help with RadioChannelCreate, the wiki says it can have up to 50 channels, but I can only seem to create 10 (1-10). How do you see/use the other 40? I created 25 custom channels as a test and only channels 1-10 seem to be registered in the engine which i believe was the previous limitation. Is the wiki wrong?

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

proven charm
#

wiki says 10 slots before 2.22

#

were at 2.20

austere rune
#

Ah i see - so its planned for release?

winter rose
#

no, they just write things on the wiki for the lolz
yeah it's planned 😄

tulip ridge
# bold rivet Ah I see, thank you, do you per chance also know what a headless client is?

You can think of it as a "mini server"
Some servers will use them to offload calculations to free up resources for the dedicated server. E.g. if you spawn a lot of AI, you may want to move some of them to a headless client so it can handle calculating stuff for AI instead of the server itself.

They're called "headless clients" because they connect to the server like a player, but are "headless" because they don't render anything to a screen

austere rune
#

For some reason i thought we was ahead of 2.22 🙂 i'll just stick to 10 channels then

bold rivet
hushed turtle
cursive tundra
#

can someone help me out with a thinking / scripting problem? I want to space out squads stored in an array along a line, something like this:

#

i am unsure on how to achieve that tho

#
    {    /// pattern 2
            _indexOfSquadInDirectAssault =  _squadsInDirectAssault find _x;
            if (_indexOfSquadInDirectAssault == 0) 
                then {
                    _x addWaypoint [_posPLD,0];
            } else {
            if (_indexOfSquadInDirectAssault != 0 && _indexOfSquadInDirectAssault % 2 == 0) 
                then {
            hint str _x;
                _posWP = _posPLD getPos [((_forEachIndex - 2)*50), _dirToObjective + 90];
                _x addWaypoint [_posPLD,0];
                } else {
                if (_indexOfSquadInDirectAssault != 0 && _indexOfSquadInDirectAssault % 2 != 0) 
                    then {
                    _posWP = _posPLD getPos [((_forEachIndex - 2)*50), _dirToObjective - 90];
                    _x addWaypoint [_posPLD,0];
                    };
                };    
            };
        }forEach _squadsInDirectAssault;
    };

I started out with something like this but this doesnt work

errant jasper
#

Maybe something like this as the base, with _dist=50 in your case.

// assumes groups in _squads and you have _dist between and _heading and center in _pos.
private _start = _pos getPos [((count _squads - 1) / 2) * _dist, -_heading];
private _squadWaypoints = {
    _start getPos [_dist * _forEachIndex, _heading]
} apply _squads;

If _heading is the advance direction and you want a "platoon line", then you can add 90 to _heading.

cursive tundra
#

ill have a look at this. thanks 😄

errant jasper
#

Good luck. The main idea was that the cumulative amount of intergroup space between is ((count _squads - 1) * _dist). So we go "back" half of that, and just keep grabbing a position _dist closer in direction _heading number of squads times.

cursive tundra
#
_squadsInDirectAssault =_ManeuverForce;
_posPLD = _assaultPositionChosen getPos [200,_dirOBJToStart]; /// Probable Line of Deployment -> where the unit deploys in its combat formation
_dirToObjective = _posPLD getDir _posOBJ;
_distance = 50;
_angle = 0;
    if (count _squadsInDirectAssault  % 2 == 1) 
    then { 
        {
            _indexHalved = (count _squadsInDirectAssault - 1)/ 2;
            _spacing = ((_forEachIndex - _indexHalved) * _distance);
                if (_spacing < 0) then {_angle = 90} else {_angle = -90};
            _posWP = _posPLD getPos [abs _spacing, _dirToObjective + _angle];
            _x addWaypoint [_posWP,0];
            _x setFormDir _dirToObjective;
        } forEach _squadsInDirectAssault;
    };
    if (count _squadsInDirectAssault  % 2 == 0) 
    then { 
        {
            _indexHalved = count _squadsInDirectAssault/ 2;
            _spacing = ((_forEachIndex - _indexHalved) * _distance);
                if (_spacing < 0) then {_angle = 90} else {_angle = -90};
            _posWP = _posPLD getPos [abs _spacing, _dirToObjective + _angle];
            _x addWaypoint [_posWP,0];
            _x setFormDir _dirToObjective;
        } forEach _squadsInDirectAssault;    
    };
#

this works now

#

at least so far

#

only the setFormDir part doesnt really work as i expected it ...

tulip ridge
#

Looks like you could just:

private _indexHalved = floor (count _squadsInDirectAssault / 2)
// rest of your code

Save yourself a decent bit of duplicated code

You can also use an array and select to pick a value based on a boolean, which can be faster than using an if/else block for simple code

private _angle = [-90, 90] select (_spacing < 0);
#

Currently you're checking the count three times

tulip siren
#

hello, im trying to make a strategic map that spawns custom compositions when selecting a mission, im looking for a way to get the spawn logic to use it, i tried to use the objects grabber and objects mapper functions but apparently they cant handle waypoints and triggers, so now im looking if theres a way to export a composition into an SQF file from the eden editor

fair drum
tulip siren
proven charm
split ruin
#

I just skip the dedicated server and use local host, its a lot faster to set up everything

mortal folio
#

did anyone ever do a thing for zeus that allows you to order agents around? if not i'd script it myself but i wanna know if another mod does that already

digital hollow
mortal folio
#

agents need setDestination instead of doMove unfortunately

digital hollow
#

That would be a good improvement though :)

mortal folio
#

yeah perhaps worthy of a request or something; granted its quite a rare use case but still

deep quiver
digital hollow
#

ZEN actually already does both and works with agent 😂

mortal folio
#

thanks!

digital hollow
mortal folio
#

quick one about handleDamage EH - what's the difference between context 0 and context 4?

#

it says "before bleeding" but i dont exactly know what that even means since i dont recall bleeding being a thing in vanilla (going down a while after a bullet hit)

tulip ridge
#

Only thing I can think of is the blood textures being applied to the uniform / body

mortal folio
#

hm

upbeat hill
#

is it possible to get it so when a player hits an object it triggers a script

tulip ridge
upbeat hill
#

When someone walks through it

#

or just touchs any of it in general

tulip ridge
#

Not easily if you want it to be precise afaik

#

If you just want something simple, you could just do _unit distance _yourObject <= 1, and adjusting it based on the size of the object

upbeat hill
mortal folio
#

So if the object is largr you need to compensate

#

The more accurate method would involve raycasting using lineintersectssurfaces

upbeat hill
#

i see

split ruin
#

is a way to export the inventory items from a vehicle?

#

I mean physical items, not virtual arsenal ones

warm hedge
#

Surprise! There ain't any, other than getWeaponCargo getMagazineCargo etc, there is no getUnitLoadout equivalent for vehicle inventory

split ruin
#

😭

hushed turtle
#

If there are backpacks. Do I need loop through one by one to get their items?

warm hedge
#

Do you mean inventory in inventory situation?

hushed turtle
#

Yes

warm hedge
#

That's what I believe, yes. everyBackpack can fetch inventories within

split ruin
warm hedge
#

getWeaponCargo getMagazineCargo?

hushed turtle
#

getBackpackCargo?

split ruin
#

I am wondering what this makes with AI, they become dumb ?

_soldier disableAI "FSM";
winter rose
hushed turtle
#

Like a certain height above marker?

#

height of waves seem unimportant here

#

You can just get marker postions and add 300 to returned height(which is always zero, unless alr syntax is used)

#

I assume you wanna spawn chopper?

split ruin
hushed turtle
#
_pos = getMarkerPos "Jumber";
_pos set [2,300];
split ruin
#

get the right pos above sea level

hushed turtle
hallow mortar
#

flyInHeight or flyInHeightASL, probably

abstract bison
#

well (assuming its a file) im not sure where to find the fn_hasitem.sqf

#

im sorry for the VERY late response btw

#

i opened the rpt and did a ctrl find and this shows up if yall can decipher

misty dew
#

Hey, does anyone know how to make a vechile "harmless" i want to attach a bed to a player but if the player runs the bed into another player, player2 will die because technically he would be "ran over" over by the bed.

#

vehicle*

dusk gust
errant jasper
#

Depending on how the variable is introduced and initialized in the script it may be possible to workaround by setting _found = false; before the call.

past wagon
#

if my HUD has a health bar, how should I keep it updated?

#

event handlers, or a loop that updates it to the player's health every 0.1 seconds?

warm hedge
#

I'd use Draw3D

prime valve
#

I really don't know about vehicles, but try to make empty Geometry LOD or PhysX LOD

#

I don't know why

tulip ridge
past wagon
past wagon
#

can anyone show me how to use the HandleHeal event to update a player's health bar when their health changes? I'm unsure of the best method because the event fires when the player STARTS a healing action, they can take damage during the action, and there might be a delay before they actually heal after the action finishes

#

would this work?

player addEventHandler ["HandleHeal", {
    _this spawn {
        params ["_injured", "_healer", "_isMedic", "_atVehicle", "_action"];

        _oldDamage = damage _injured;

        _i = 0;
        while ((_injured getVariable ["BIS_action", "none"] == _action) && (_i < 100)) do {
            sleep 0.1;
            _i = _i + 1;
        };

        private _j = 0;
        while ((damage _injured == _oldDamage) && (_j < 100)) do {
            sleep 0.1;
            _j = _j + 1;
        };

        call TRI_fnc_updateHealth;
    };
}];
fair drum
past wagon
#

or I guess the frame handler would be better

#

I think I figured out a solution though:

player addEventHandler ["HandleHeal", {
    _this spawn {
        params ["_injured", "_healer", "_isMedic", "_atVehicle", "_action"];

        for "_i" from 0 to 14 do {
            remoteExec ["TRI_fnc_updateHealth", _injured];
            sleep 1;
        }
    };
sly cape
#

If you're just using HandleDamage and HandleHeal, won't it still not change for setDamage?

past wagon
#

I'm really confused about this. What exactly does the number I return in HandleDamage do?? Is it the overwritten amount of damage being taken, or the overwritten final damage that the player has?

past wagon
old owl
past wagon
#

what does it mean when it says "The return value is the hit zone's absolute damage value, not the damage to be added to it."?

mortal folio
past wagon
#

so is Milo wrong?

mortal folio
#

basically if you just simply want to return it like vanilla, you would just do _damage + (damage _unit) (in case of total damage)

past wagon
#

oh

#

so the return value is the final amount of damage the player will have after the event

old owl
# past wagon so is Milo wrong?

No, he's just saying it's for specific parts. For example if you shot a heli's rotors it would only effect the rotors (at least initially?)

mortal folio
#

it depends on the part as milo said

#

handledamage triggers multiple times per hit - once per part + once for total damage

past wagon
#

so if my EH returns 0, any damage will fully heal the player?

past wagon
#

ohh ok

#

thanks

mortal folio
#

everyone gets a bit confused by this when they get into it for the first time but there's a reason it's done this way - you have more control

#

you can make heal bullets 😄

old owl
mortal folio
#

like if the player actually had damage beforehand,, the EH is added that returns 0, then new damage is created, that old damage will be gone because new EH says return 0 damage

old owl
#

Ah okay you may be right.

mortal folio
#

think of it like the EH basically dictating the damage of the hitpoint - it's not "doing" anything, it's just saying "this guy got hit, here's the damage dealt from the hit, now you tell me what the new "Health" of the player should be"

past wagon
#

so if I want:

  • case 1 to make the player only take 1/5 of default damage
  • case 2 to make the player take no damage
  • case 3 to make the player take no damage
  • default to not change anything
    is this correct?
params ["", "_selection", "_damage", "_source"];

_oldDamage = player getHit _selection;
_damageAmount = _damage - _oldDamage;

switch (true) do {
        case (_vehicle isKindOf "Car" && _isNotPVP): { _oldDamage + (_damageAmount / 5) };
        case (_vehicle isKindOf "Steerable_Parachute_F" && _isNotPVP): { _oldDamage  };
        case (!(isDamageAllowed player)): { _oldDamage };
        default { _damageAmount };
    };
mortal folio
#

precisely (although isDamageAllowed being false iirc doesnt trigger the EH anyway)

past wagon
#

thanks

old owl
#

I guess in our event handlers we return the original damage so makes sense.

granite sky
#

Not sure what getHit returns for empty string input, which is what _selection is for general damage.

#

Also I have a vague recollection that handleDamage doesn't fire if allowDamage is set to false.

dusk gust
still forum
hushed turtle
#

Does remoteExec send something to server, if I use local object as target?

errant jasper
#

Good question, whether there is an optimization trick there. Might also depend on JIP option, I would guess.

still forum
hushed turtle
#

I see. Is it worth doing local check then and avoid remoteExec, if target is local?

errant jasper
#

Network wise? Yeah, obviously.
But then you miss out on the validation check (and any JIP flag which you don't need 99.999% of calls involving a local target anyway).

#

But interesting, I just presumed the clients read the local CfgRemoteExec instead (e.g. shared by description.ext).

#

Anyway, stuff like this is why I don't use remoteExec as a design-primitive, but only as implementation-primitive.

still forum
#

Clients can cheat though

#

There might be a mode where it instantly local executes, but also sends a remote message anyway?

#

Its easy to test with diag_frameNo

bold rivet
still forum
#

Its basically which button was pressed to close it

#

OK button or Cancel button == different codes

bold rivet
#

oh I see

#

Aight, thank you both for the fast help

hushed turtle
#

Am I correct there is no dedicated command for adding NVG directly into unit's NVG slot? I had to do a workaround and remove something first, otherwise there won't be enough space to add NVG into uniform/vest/backpack

hushed turtle
#

Seem like that will do it

idle whale
#

anybody knows the radio protocol command for the ai?

#

I have a mod that automatically disables the radio commands for the ai so I want to turn them back on can't find the specific command for it

idle whale
#

wait really that's it?

winter rose
#

no, I like to lie 😈
yes that's the command, but you need to use it wisely

sly cape
hushed turtle
sly cape
idle whale
#

but can I do it in the debug console?

idle whale
sly cape
idle whale
#

yes. but the other ai don't

#

for context this is the latest version of vcom ai

sly cape
idle whale
#

If you meant does my own character say that general radio chatter yes. But the other ai/ my own group is completely mute. And no radio text or subtitles are shown. Also to clarity the I'm not talking about the individual radio commands just the automatic chatter

sly cape
idle whale
#

what about for all units? Is that just _Unit or foreach?

sly cape
idle whale
#

that worked thanks guys

storm tiger
#

how much RAM is okay for script to take?

sly cape
storm tiger
sly cape
storm tiger
sly cape
storm tiger
#

ah no

#

I did not finish reading

hushed turtle
still forum
#

using a dozen megabytes of memory with script is hard to achieve with properly written scripts

storm tiger
storm tiger
#

man my notebook (not gaming pc) could not ran those scripts

storm tiger
still forum
#

okey.

#

Sounds like maybe a hundred lines of code

storm tiger
# still forum Sounds like maybe a hundred lines of code

yeah the issue is not in size but in execution. It is a bit heavy script afaik for something that looks so easy. Like idk storage wise as I have only basic idea but I am concerned about it taking precious RAM from mission when arma missions already are known for low fps

still forum
#

ram usage != fps

storm tiger
# still forum ram usage != fps

I do get that but it is not an Init script it will run with relatively small sleep (I was thinking like 0.5 of a sec) delay. Thus partially impacting fps

still forum
#

If it has sleep, its scheduled

#

which means the max time is limited anyway and it can't impact fps that much

storm tiger
hushed turtle
#

If scheduled is limited, why does infinite while loop with no suspension can cause fps drop?

still forum
#

not enough information

#

scheduled is limited to 3ms

hushed turtle
#

Not able to reproduce, don't have original code

#

So I guess all good

#

I was trying to "disable" player's flashlight. It turns out while he holds down L key, flashlight needs to be turned off on each frame. Original code was while loop and was causing me to drop couple of tens of fps when holding down L key. Then I changed it to onEachFrame EH and that was much better. But don't have the original code anymore

old owl
#

More just 10gb of memory being used total, although we do have quite a lot of functions 🙂

errant jasper
hushed turtle
#

Sounds legit

hexed sundial
#

What is the best way to server game state for a scenario-style mode like in antistasi?

cursive tundra
#

whats the best way to compare multiple numerical variables while also retaining information about where that number comes from?
if i want to make a script to simulate the AI making a decision between multiple courses of action that are corresponding with an expected Value, i.e. _option 1 = 50, _option2 = 70, _option3 = 45... and so on?

granite sky
#

Can't really tell what you're asking. You'd probably need to write an example so people can tell you how to improve it.

jade abyss
#

@misty dew "Modded" Bed?

gray cairn
#

I am trying to run respawn tickets per respawn points - ie; Point 1 has 20 tickets, Point 2 has 10 tickets. When the points run out, they are disabled.

Searching around hasnt landed me on anything amazingly useful. I figure I'll have to do it by having something count everytime a point is used and then disabling the point once X amount is counted.

Is there an easier/more straight forward way to do this?

scarlet igloo
#

hey guys, how would i go about having an addaction in a certain area instead of a singular object? is using triggers the only way or is there anything better?

tulip ridge
scarlet igloo
#

would i need to put that in a loop or no? how would i go about doing that

tulip ridge
#

You'd just check it in the action's condition

#

Something like:

_this inArea yourTriggerVarName
scarlet igloo
#

thanks, ill try that 🫡

warm hedge
#

In that way, condition is already on "a loop". It anyways executed every frame

scarlet igloo
tulip ridge
scarlet igloo
#

pasting the action into either doesnt work. tested it in debug console and it works fine

player addAction [
    "<t color='#15e628'>Rally Point Menu</t>",
    { execVM "openRallyMenu.sqf"; },
    nil,
    1.5,
    true,
    true,
    "",
    "_this inArea baseTrigger"
];```
grave belfry
#

So I have a custom mission that uses lots of markers to determine/initialize stuff.

Some of those markers aren't recognized by the engine correctly, though.

In the RPTs I see:

21:24:33 2026-03-04 20:24:33:255 | Antistasi | Warning | File: A3A_fnc_isWithinMarkerArea | No such marker: "factory_6" | Called By: A3A_fnc_updateRebelStatics

This is the marker in question in mission.sqm (obviously 3DEN generated, but there for reference):

class Item6
{
    dataType="Marker";
    position[]={31650.137,49.54422,16394.447};
    name="factory_6";
    markerType="RECTANGLE";
    type="";
    colorName="ColorWEST";
    a=118.8913;
    b=152.90527;
    angle=16.134054;
    id=34109;
    atlOffset=-0.0052566528;
};

The check generating above RPT message is this:

if (markerType _markerName isEqualTo "") exitWith {
    Warning_1("No such marker: %1",str _markerName);
    false;
};

So, markerType actually returns an empty string for the above marker. Also for select other markers (no all of them, of course) with type ELLIPSE. Anybody ever have that happen/know what the cause of that behavior would be?

granite sky
#

I use markerShape instead. Seemed like the only one that was reliable and reasonably fast.

grave belfry
granite sky
#

Looks like the editor's type value goes through untouched, and the editor is apparently very weird.

#

Common types for markerType RECTANGLE seem to be "rectangle" and "Empty".

#

rectangle is not listed as a valid option in the wiki.

#

If you create a marker with createMarker then its markerType is empty string.

grave belfry
#

Hm. markerShape check it is, then. Thanks!

acoustic abyss
#

My script is used with several objects that are paired with a marker.
I create the corresponding marker variable name with:

_markervarname = ["_objvarname",vehicleVarName targetname] joinString "";

My question:
How can I convert a variable reference to an object, to a string that setMarkerAlpha can use?
If I redundantly convert this to a string:

(format ["%1", _markervarname]) setMarkerAlpha 1;

Then the correct string, in single quotes " " is returned. But running the command with either this or simply _markervarname referenced directly:

_markervarname setMarkerAlpha 1;

-produces nothing. Not even an error.
If I write out the variable name manually, then of course setMarkerAlpha works normally.
What obvious syntax mistake am I missing?

granite sky
#

How are you creating the marker?

zealous arrow
#

@misty dew, as @prime valve said having a empty geometry lod would solve that issue, I'm no seasoned modeller but generally the geometry defines of what in that object is colidable, no geo lod, no collisions

hushed turtle
#

He just wants to mark some objects on map

#

It's easier, if the two are "paired" rather than two variables with no relation. Let's say I have object named vehicle1, then vehicleVarName vehicle1 returns string "vehicle1", and if I use this string as marker name, then I have them "paired"

faint burrow
#

this setVariable ["pairedMarker", "pairedMarkerName"];

hallow mortar
#

I also notice that your generated marker name string starts with _. I'm not certain that that's not valid, but it might be something to consider - sometimes there are limitations about which characters can be used where.

#

Keep in mind that vehicleVarName returns the object's Editor-set variable name only. If it doesn't have one, it will return "". That will work for a marker name once; subsequent instances will be duplicate names and will conflict with the first instance. My personal preference would be to generate the name from the object's netID instead - all objects have one and it is automatically unique, so you wouldn't have to go around specifically naming objects.

radiant lark
#

any command like moveInDriver where unit isn't local and can be executed from server?

#

remoteExec is an option, but isn't there a better alternative?

tulip ridge
#

moveInAny says its global arg, but all the other moveInX commands are local which seems odd

radiant lark
#

right?

#

moveInDriver is definitely local, will try moveInAny because it's moving player to driver seat first, so it shouldnt be an issue

radiant lark
shy cargo
#

Hello everyone, I have a question: has anyone made it possible Warlords Redux to play for 3 sides at the same time, with the blue and red teams as attackers, and the green teams as defenders, and is it theoretically possible to do this somehow?

acoustic abyss
#

Jouklik Your guess might as well be. Scotty just in case, Here's the full context:
I have set up a task for players where they interact with different radiotowers. When the action at a tower completed, an invisible marker at that tower is made visible. See first screenshot.

So to be clear: I have already placed a tower, and a corresponding marker before mission start.

In order to make ONE script serve multiple towers, I created a scriptfile for the BIS_fnc_holdActionAdd that is called on each tower. See second screenshot.

This is what is in the scriptfile radiotower_hack.sqf:

#
params ["_unitname"];
targetname = _unitname;

[
    targetname,                                                        
    "Download 3G connection data",                                                    
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa",    
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa",    
    "_this distance _target < 2",                                    
    "_caller distance _target < 2",                                    
    {},                                                                
    {},                                                                
    {     
    hint "Triangulating position...";
    _markersetvisible = ["mrker_tsk2_tower_bearing_",vehicleVarName targetname] joinString "";
    _markersetvisible setMarkerAlpha 1;    
    },                                            // Code executed on completion
    {},                                                                
    [],                                                                
    3,                                                                
    1,                                                                    
    true,                                                            
    false                                                            
] remoteExec ["BIS_fnc_holdActionAdd", 0, true];        

I am essentially matching the index number (1 in the screenshot) of the tower with its corresponding marker.
NikkoJT I have tested the output of the joinString line with hint format [ ...]. Works fine.
Yesterday I tried making the _markersetvisible variable name global, and it didn't seem to work. But it was late and I may have been sloppy.

hallow mortar
#

What's the full name of the marker as shown in the Editor?

acoustic abyss
hallow mortar
#

Your script is combining "mkr_tsk2_tower_bearing_" with "radiotower_gizmo_1"

acoustic abyss
#

Oh yes you're right!

#
vehicleVarName targetname select [17]);
#

That was in the script, believe it or not. I cleaned up comments. Let me double check my work.

hallow mortar
#

Also, I just noticed, your use of the targetname variable is going to cause issues if you have more than one of these things. You have one variable, but x many scripts; when evaluated, it will only contain the value for the last copy of the script that executes

#

I suggest using the arguments parameter for BIS_fnc_holdActionAdd, instead of a global variable

acoustic abyss
hushed turtle
acoustic abyss
hallow mortar
#

er, well, usually it's Head Mounted Display in real life, but most of the things in that slot in Arma are not really Displays

hushed turtle
#

Not displays in Arma terms I guess. Like not dialogs?

hallow mortar
# acoustic abyss Yep it's Global. I was having trouble with scope. But as I understand, this is a...

The issue is that targetname, in your code, is supposed to contain a reference to the object the action is added to, and it is used later on when you interact with the object. But every copy of this script is going to save its own object to that variable. So when you come around to using the variable later, when you complete the action, it will only contain the last object - not necessarily the one you're interacting with.

acoustic abyss
#

@hallow mortar Thank you for patiently reading my script.
You were completely correct. I was sleepy and had forgotten to copy paste the complete line for the joinString:

_markersetvisible = ["mrker_tsk2_tower_bearing_",(vehicleVarName targetname select [17])] joinString "";

^ This works.
Yet again sleep deprivation is the culprit. Thank you everyone for thinking along.

hallow mortar
# hushed turtle Not displays in Arma terms I guess. Like not dialogs?

In real life, it refers to things like the Apache IHADSS or the jet pilot JHMCS, which have information displays. Standard NVGs don't usually display information, they're just light amplification devices, so they're not considered HMDs.
Arma calling it an HMD is technically a misuse of the real term, because the slot is mostly used for things like NVGs and cosmetic attachments that are not really called HMDs.
It doesn't have anything to do with the Arma GUI display terminology.

hushed turtle
#

Ok, thanks blobcloseenjoy

acoustic abyss
hallow mortar
#
params ["_unitname"];
[
    _unitName,
    "Download 3G connection data",
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa",
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa",
    "_this distance _target < 2",
    "_caller distance _target < 2",
    {},
    {},
    {
      hint "Triangulating position...";
      _markersetvisible = ["mrker_tsk2_tower_bearing_", (vehicleVarName _target) select [17]] joinString "";
      _markersetvisible setMarkerAlpha 1;
    },
    {},
    [],
    3,
    1,
    true,
    false
] call BIS_fnc_holdActionAdd;```
This will solve your issues with reusing the global variable. Also, you don't need to use `remoteExec` because this script is being executed in the object's init field, which is executed on all machines at mission start/when they join.
hallow mortar
acoustic abyss
#

Thanks.

hallow mortar
acoustic abyss
#

Oh this occurs at init.

hallow mortar
#

Doesn't matter

acoustic abyss
#

OK I need to pay attention then.

hallow mortar
#

The code that's executed when the action is completed, with the hint and manipulating the marker, isn't executed when the action is added. It's executed later. After all the other action-adding has been done. When someone completes the action. By that time, because all the other copies of the script have run and overwritten targetname, it no longer contains the object the first script set it to.

acoustic abyss
#

I am trying to follow your explanation.
This is just a cut from my second screenshot.
This init field is on every radio tower.
Does this mean that my scriptfile has run several times at mission start, and that the targetname variable has been overridden?

hallow mortar
acoustic abyss
#

An area trigger on each tower that adds the action would fix this, yes?

hallow mortar
#

No, not really. You'd still need to do it however many times you want to do it. The issue is the reuse of a global variable.

#

#arma3_scripting message
As I showed here, you can avoid this by not using a global variable (and also not doing remoteExec)

acoustic abyss
#

I am trying to make this dedicated server proof. Is remoteExec redundant, because I am running it in an object init (which is all machines by default)?

hallow mortar
#

Yes.
If you do remoteExec in an init field, with target 0 (all machines), then every machine tells every other machine to execute the thing.

#

So if you had 5 machines, all of them would have 5 copies of the action.

acoustic abyss
#

Hm. The remoteExec is more of a server perspective command I suppose.

hallow mortar
#

Not necessarily. It has lots of utility for clients too. You just have to be careful with it.

acoustic abyss
#

I can certainly imagine. Broadband internet has made me lazy with traffic. This was educational. Thanks again.

proven charm
#

i guess drawIcon3D can draw only one icon

hallow mortar
#

There's no multi-icon syntax for a single instance of the command, if that's what you mean, but you can do the command multiple times in the same frame to draw multiple icons

proven charm
#

ye im trying that now

#

just kinda hard to aim the extra icon to the end of the first icon string

proven charm
#

hmm i tried getTextWidth but that didnt seem to give correct text width _itext getTextWidth ["PuristaMedium", 0.05];

errant jasper
#

Dunno. Doesn't say on BIKI it gives correct either: "Returns estimated width of the text"

proven charm
#

could be alignment issue too, especially when zooming the icons/text goes all over the place

#

counted text width times 5 gets me that. not sure where the logic is

proven charm
#

doesnt matter, cant get the icon to stay on side in 3D anyways XD

cosmic lichen
#

Alternatively you can also draw UI controls in 3D space

proven charm
#

really, how to do that?

cosmic lichen
#

You create a control as a RscTitle and translate the world coordinates to screen coordinates

#

That's how the arsenal does the icons.

#

If you want to interact with them you obviously don't want to use rsctitle but create them directly on the main display.

proven charm
#

ok thx i will try that

#

i have a overlay in RscTitles but i guess thats just 2D..

cosmic lichen
#

controls are always 2D (except ctrlObject)

proven charm
#

so what am i setting 3D then?

cosmic lichen
#

you need to translate [5000, 3540, 200] to [screenX, screenY]

#

there's a command for it

#

and you can fake distance by scaling the control e.g (large = close, small = far away)

proven charm
#

ic

#

ok well thats bit complicated but I guess i have to try that 🙂

#

thx

cosmic lichen
#

It really isn't that complicated. Just start with a simple control and change it's position each frame.

proven charm
#

yeah i know that command but thats as far as i know 😄

#

maybe make a control group and move that

cosmic lichen
#

Sure, you can also make a group

#

Sadly I don't have the script anymore where I did some testing with that.

proven charm
#

no problems

cosmic lichen
# proven charm no problems

_display = findDisplay 313;

_ctrlButton = findDisplay 313 ctrlCreate ["ctrlButtonOK", -1];

uiNamespace setVariable ["TestControl", _ctrlButton];

GRID_W = (0.5 * pixelW * pixelGrid);
GRID_H = (0.5 * pixelW * pixelGrid);

onEachFrame
{
    _entity = get3DENSelected "Object" param [0, objNull];
    if (isNull _entity) exitWith {};

    private _ctrlButton = uiNamespace getVariable ["TestControl", controlNull];
    

    _h = linearConversion [100, 1000, get3DENCamera distance _entity, 5 * GRID_H, 0.5 * GRID_H, false];
    _w = linearConversion [100, 1000, get3DENCamera distance _entity, 35 * GRID_W, 3.5 * GRID_W, false];

    _pos = worldToScreen getPosATL _entity;

    _ctrlButton ctrlSetPosition [_pos#0, _pos#1, _w, _h];
    _ctrlButton ctrlCommit 0;
    systemChat str (ctrlPosition _ctrlButton);
};```

Here is a very rough example.
proven charm
#

ok thx Revo 🙂 which display was 313 again? i should probably use game display

proven charm
#

hmm did u test the code? when i run with 46 display i get single pixel drawn 🙂

#

Lou ok thx 👍

#

aah i had to select the player 🙂

#

works nicely thx 🙂

hushed turtle
versed trail
#

Is there any event handler that would be able to detect remote controls? Anything for like camera change or UAVs

hallow mortar
#

playerViewChanged mission EH might do what you want

finite bone
covert oak
#

If you're players are likely to spam MG fire, or have many players, that might still be a problem.

covert oak
finite bone
#

The expectation is around 40 players with 150 - 300ish AI

#

At first I was thinking of finding any suitable EH to add to the player to keep track locally of all entities hit with their weapon

covert oak
#

I just recently did this on an AI spotter system I'm working on. When the Spotter calls a target, he assigns the player a fired eventHandler, which spawns a hitPart on the projectile. When the projectile hits, it checks if the projectile hit the target, and if not calculates the correction in MILS.

finite bone
#

and then extract the results later

covert oak
#

🤔 yeah, you're probably better putting it on the AI as it won't trigger until a hit occurs, whereas on projectile will trigger for every projectile.

granite sky
#

Could use EntityCreated so that you know when to add the EH to new AIs I guess.

#

And then HitPart as the local EH, so it's only triggering on shots fired locally to the player.

finite bone
#

The main concern is that bulk EH for the AI - is it worth it / performant enough to not cause any issues in the long run?

granite sky
#

I rather like the projectile hitpart idea though.

covert oak
#

I think the implied question was whether performance will suffer with all those EH's.

granite sky
#

Not unless they're triggered, and because HitPart will only trigger on local hits it'll only be the player's shots that trigger them (and other AIs, if local to the player)

covert oak
#

But, EH's dont really use any cycles until they're triggered, so adding one to each of 300 AI shouldn't be a problem unless a ton of them are getting hit at once.
But a single player belt dumping an LMG would be just a s bad.

granite sky
#

Cannon spamming into a bunch will be painful but then it always is.

covert oak
granite sky
#

If you don't trust clients to tell the server about it?

#

Doing all the accounting on server side might be a bit painful.

#

Also I think the only global EH that works for that is Dammaged.

finite bone
#

I trust the clients hence was wondering if theres something I can just attach to 40 players that works to identify who they fired at / hit and actually caused damage for final stat recording

crude barn
#

This is gonna be a long shot, but has anyone figured out a fix for that one bug that prevents AI from calculating paths upstairs in buildings. Desperately looking for a fix.

finite bone
#

Now in theory, the players could also hit other players which we want to keep a track of anyways

granite sky
#

@crude barn Nah, I know about the bug but I don't have a workaround.

crude barn
#

Ah damn, was worth a shot

granite sky
#

It can calculate the paths fine but it breaks them when it crosses room boundaries :/

#

probably some one-liner ATL/ASL bug.

covert oak
#

Or their targets even if they miss?

finite bone
#

Not at all, just the targets they hit to compare between friendly fire vs civilians vs enemies

#

More accurately, how many shots did the player fire at the target

covert oak
#

Well, how many shots at a target is gonna be the hard part. You can track how many hits easily, how many shots fired in total pretty easily, but if you want to show "how many times did this player shoot at that guy in particular, how many times did this player hit this guy"
That's where it gets a little harder.

finite bone
#

Yea exactly kmao

covert oak
#

To do that, you'd have to track each projectile with hitPart and get it's impact location, then use like findNearest to 'guess' at the target (nearest unit)
Unless it hits, then we assume he wasn't shooting at one target and hit another.

#

The EH itself wouldn't be too hard to write, so I'd write it, assign it to 40 AI units, and then force them all to fire with liek commandSuppressiveFire or forceWeaponFire and see if you get perf problems.

#

If the server can run that much code (it's async so it might) then you know your mission will probably run fine with players.

#

But again, if you set it up to run client-side, you just need to be able to retrieve the results at mission end.

granite sky
#

You can use dot products to find the closest enemy to the firing angle, which is better than the impact location (bullets might go miles long), but it's a bit expensive so you really wouldn't want to do that on the server.

covert oak
finite bone
#

What do you think about attaching just the Hit EH to the AIs and checking for _source or _instigator? Is there a reason we are avoiding this in large scale? Because compared to HitPart, Hit can actually ignore minor damage which is a good thing for the use case.

#

Or better yet use HandleDamage since it will only run it on the machine local to the AI and I can refer _source from it?

granite sky
#

If you can guarantee that all the AIs you care about are on the server and stay there, then yeah, HandleDamage or Killed + Hit on the server is ok. Really wouldn't want to do non-hit accounting on the server though.

#

Server's already gonna be busy with 300 AIs and 40 players.

forest island
#

This may be a stretch but I want a nuke to go off in a scenario but I only want it to be the animation and screen effect. I hate the frame drop that comes with dropping an actual nuke.

abstract bison
# dusk gust The function "BIS_fnc_hasItem" (bohemia defined script, base game) has a script ...

well ive figured out, it only happens whenever i use artillery in game master (i do have fire support mods) and whenever i order ai to "rappel" from helicopters, although with the heli one thats only temporary and goes away when the process is done i believe, could be me just being blind.. but if i dont do any then the error doesnt pop up at all.. could it just be mods thats making the error pop up?

#

yeah ill do that shortly, currently running tests on something right now

#

thats fire

#

right now im doing some stuff for fivem but im no dev when it comes to arma, as much as i love it lol

#

oh shoot, did you put that on the workshop by chance?

#

what kind of stuff do yall do?

#

man i love vanilla arma a lot but there are definitely some must have mods for me yk

#

blastcore and the missile vfx mods are FOR SURE up there 😂

#

yeah, i think my only issue with mods is the storage requirements

#

lucky you, ive got an entire drive for arma 3 only lol

#

lol, check this 1 sec

#

i got addicted!

#

yeah lmao

#

ive got a vanilla pack incase its ever too much for me lol

#

yeah, i played some vanilla before i got my mods but i opened the workshop once and seen some cool stuff and thats when the plague began to spread

#

now thats a foreign language to me lol

fair drum
abstract bison
#

righttt

forest island
fair drum
acoustic abyss
# forest island This may be a stretch but I want a nuke to go off in a scenario but I only want ...

There's several "nuke" or "nuclear" or "atom" bomb scripts online.
A popular one is this:
https://github.com/FreestyleBuild/A3-realistic-nuke/wiki
This particular one even lets you trigger it without damage:
https://github.com/FreestyleBuild/A3-realistic-nuke/wiki/How-to-use-the-script:-A-step-by-step-guide
Quote:
"damage: 'true' or 'false', wether the damage effects are used, if 'false' no damage is done, only visual effects are created"

GitHub

A realistic nuke script for Arma 3. Contribute to FreestyleBuild/A3-realistic-nuke development by creating an account on GitHub.

GitHub

A realistic nuke script for Arma 3. Contribute to FreestyleBuild/A3-realistic-nuke development by creating an account on GitHub.

#

The Global Mobilization DLC also has a small nuclear missile (launcher). The major plus of that one, compared to all the free versions, is that they've really optimized it so that it looks good but doesn't slow down the game.

hushed turtle
#

This is quite clever I would say

drowsy geyser
#

Yes no need for while loops if you wanted to disable 3rd person for example

proven charm
#

is it safe to delete (deleteAt) hashmap item when looping it via forEach?

hushed turtle
#

I would say yes, since keys don't change when removed like indexes in arrays do

proven charm
#

ya maybe

hushed turtle
#

You remove one by script?

#

If you took medkits away, doesn't it mean medic won't heal fully now, since he doesn't have the medkit, which heals fully, unlike FAKs

#

yeah, but does he heals people fully though?

#

With FAK

hushed turtle
#
player action ["GunLightOn", player];

Switches to primary weapon regardless if it has flashlight, despite you holding handgun with a flashlight. meowsweats GunLightOff switches off handgun light just fine. Damn Arma! ||Right now I'm on dev branch though||

grave belfry
#

Can someone share some insight as to why entities and nearObjects would return different results for me?

private _entities = entities[["Helipad_base_F"], []];
private _near = nearObjects[player, ["Helipad_base_F"], 150, true];

First array is empty while nearObjects (despite depending on object streaming) returns a list just fine. Is entities restricted to something that's currently not documented?

inb4 syntax: tried entities in its primary and secondary syntax; both to no avail: return value remains empty...

hushed turtle
#

I think objects like helipad aren't entities. It can find me, but not building

grave belfry
#

Well, then, what is an entity exactly? In both cases, the helipads were created w/ createVehicle. If it walks like a duck and quacks like a duck... Guess I'll have to use nearObjects with a "magic number" to make it work then, huh.

hushed turtle
#

Seems like only units, animals, modules and vehicles can be returned by entities

pallid palm
#

even chickens lol 🙂

real tartan
#

I am setting direction with offset (_dir = 180) to attached object so that _target is oposite way of _parent, but it keeps setting to _parent dir

    _target attachTo [ _parent, _offset ];
    _target setDir ( getDir _parent + _dir );
    [ _target, getDir _parent + _dir ] remoteExec [ "setDir", 0, false ];
granite sky
#

To set orientation of attached object use setVectorDirAndUp command

#

Oh, the part at the top implies that setDir also works. But you wouldn't use getDir _parent here.

#

You'd just set the relative value, so:

_target attachTo [_parent, _offset];
[_target, _dir] remoteExec ["setDir", _target];
bold rivet
#

Random question, does it actually make a diffrence if I use the first or second line? Or is it the same? (_objects is an array)

[_objects, { deleteVehicle _this }] remoteExec ["call",2];
[_objects] remoteExec ["deleteVehicle", 2];
proven charm
#

second one is better imo because its more secure..

bold rivet
#

Aight, thx

proven charm
#

but client telling server to delete stuff isnt too secure either :U

bold rivet
#

I dont even need to use remoteExec here, do I?

hallow mortar
bold rivet
#

Aight, appriciate the quick responses, thx yall

shy cargo
#

I have a question: has anyone made it possible Warlords Redux to play for 3 sides at the same time, with the blue and red teams as attackers, and the green teams as defenders, and is it theoretically possible to do this somehow?

past wagon
#

How do I deal with text wrapping in an RscStructuredText control? Is there a way to do it automatically? Do I have to manually insert line breaks whenever a line of text goes off screen? Won’t that cause discrepancies if the control’s size is defined in Safezone coords?

hallow mortar
#

It should be automatic by default

#

It will wrap according to the size of the control, not the screen. If the control extends off the screen, then the text will go with it.

past wagon
#

And I have to insert a line break to keep the message on the control

hallow mortar
#

Is the control part of a control group? If it is, it may be that the control is bigger than the group, in which case it will technically extend beyond the edge of the group without displaying that overshoot, as if it was extending off the screen.

cursive tundra
#

can i use inArea on a sector module as a way to check units in the area of the sector?

#

or do i need to use a trigger and use it on the trigger?

midnight pike
#

hello would someone have a script for the scale of objects to be modified ?? I know that we can do it with the arma 3 tool however I had problems in multiplayer on my server with unmodified objects

drowsy geyser
polar belfry
#

is there a way to set a dynamic radartargetsize

#

like if certain pylons are empty set the number to 0.4 and if they are loaded set it to 0.7

split ruin
#

I am trying to adapt @Scotty admin menu EH, I want the support menu to be deleted from old unit when using Team Switch

addMissionEventHandler ["TeamSwitch",{
    params ["_previousUnit", "_newUnit"];

    //Remove Comm Menu Items

    [_previousUnit, ?????] call BIS_fnc_removeCommMenuItem;

    //Add Comm Menu Items
    for "_i" from 0 to 0 do {
        _itemID = [_newUnit, format ["admin_tools", _i]] call BIS_fnc_addCommMenuItem;
    };
}];
#

I don't know what number I have to write in the remove comm menu fn ? 🤔

hushed turtle
#

itemID: Number - item ID returned by BIS_fnc_addCommMenuItem command

errant jasper
#
// Remove old part
private _prevComms = _previousUnit getVariable "kiba_commsMenu";
if (!isNil "_prevComms") then {
   [_previousUnit, _prevComms] call BIS_fnc_removeCommMenuItem;
   _previousUnit setVariable ["kiba_commsMenu", nil];
};

// Add comm menu part
_itemID = [_newUnit, format ["admin_tools", _i]] call BIS_fnc_addCommMenuItem;
_newUnit setVariable ["kiba_commsMenu", _itemId];
split ruin
#

@errant jasper thank you, works like a charm, variables always save the day

split ruin
#

I wonder can we make AH-66J internal pylons to be always open?

#

quick google search says "no" 😭

warm hedge
remote narwhal
#

@still forum can you tell, why getUserInfo return "" (empty) steamProfileName on some servers?

#

Maybe I need to open some additional ports in the firewall?

cyan hill
#

how can i make a event handler that makes ai super tanky

sly cape
cyan hill
#

it just auto kills it

sly cape
cyan hill
#

trying to do it on 3as stuff

#

i am extremly new to scripting this is my first time ever messing with this stuff

sly cape
cyan hill
sly cape
cyan hill
#

its a turret if it makes and difference its a 3AS deka

sly cape
# cyan hill still the same

It works for me. Is the event handler in the same script as where you define _B2?
It's possible that whatever you're talking about has some other mod's damage handler.

sly cape
cyan hill
sly cape
# cyan hill we have kat

So yes? ACE completely replaces the vanilla damage system. AFAIK, all units are always kept at full health until ACE says kill it and they instantly die. You'd need some way to interact with its scripts.

sly cape
cyan hill
sly cape
sly cape
# cyan hill

I have no clue what that is.
If it's like a guy that you walk around as (like the one on the left) and you have ACE on, you need to do something special.
If it's a turret like a machinegun you get in, then my thing should work (maybe) for it getting completely destroyed and blowing up.
If it's a guy in a turret, then it's the same as a guy.

cyan hill
sly cape
cyan hill
sly cape
# cyan hill ok do you know how to make a hit counter so it can die after a certen ammount of...

First, make a variable in the object's name space to count the number of hits and set it to 0.
Make a HandleDamage that first checks if the damage is above some threshold (so you don't end up dying from taking 0.0001 damage 10 times) and that it's to the main, structural damage (_selection == "").
If it passes that, have it check the number of hits by getting that variable. If it's too high, kill it, and if it's not increase the number by 1.

cyan hill
cyan hill
# sly cape At least try first.

_B2 addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "HandleDamage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
if (_selection != "") exitWith {};
_oldDamage = damage _unit;
_oldDamage - 0.0001 * _damage;
}];

cyan hill
sly cape
# cyan hill im trying to make a hit counter that kills it after a certen ammout of hits

Well that just looks like my damage multiplier with a different number. Try something like:

_B2 setVariable ["TAG_hitCount",0];
_B2 addEventHandler ["HandleDamage", { 
    params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
    if (_selection == "" and _damage > 0) then {
        if (_unit getVariable "TAG_hitCount" < 30) then {
            _unit setVariable ["TAG_hitCount", (_unit getVariable "TAG_hitCount") + 1];
        } else {
            _unit setDamage 1;
        };
    };
    0
}];
``` And replace TAG with your tag (2 or 3 characters that abbreviate your name or represent you). This one goes off twice with one hit or not at all, and I'm not sure how to fix that.
jade acorn
#

Can I make an AI group ignore death of a group member so they don't immediately switch to combat mode? Basically I have them spread around a point and they cannot see each other, and when one gets killed by the player I don't want everybody else go into the alarmed status. Trying to avoid having multiple one-unit groups.

hushed turtle
#

You can disable auto switching from aware to combat, but I'm not sure that's what will help here. How do you keep them in place prior to combat?

_unit disableAI "AUTOCOMBAT";
proven charm
quick peak
#

Hi is it possible to make tac ops or tanks dlc like animated opening in multiplayer? I understand that it's something like new mission with intro only and then actual mission with gameplay

proven charm
quick peak
#

Didn't give me the answer to my question but thanks i guess

mortal folio
#

how do you get the class name of a currently attached weapon item, like a scope or a muzzle attachment?

hushed turtle
#

Any way to check if unit in vehicle is in one of the spots from where it can use it's firearm?

faint burrow
#

The same with the vanilla "Escape from Tanoa" mission.

sharp grotto
#
if(count assignedVehicleRole player > 1) then {systemChat "Can shoot"};```
That would cover all cases except pilot's manual fire, I think.

Does not update on exiting the vehicle, so need to make sure to combine with objectParent check.
```sqf
if((!isNull objectParent player) && {count assignedVehicleRole player > 1}) then {systemChat "Can shoot from a vehicle!"};```
faint burrow
#
(assignedVehicleRole player) params ["", ["_turretPath", []]];

_isPersonTurret = (_turretPath isNotEqualTo [])
    and { (getNumber (([objectParent player, _turretPath] call BIS_fnc_turretConfig) >> "isPersonTurret")) == 1 };
bleak valley
#

Hello !

I'm trying to exclude every AI that are in air vehicles (planes, heli, drones) from being affected by an AI mod I'm using (namely, DCO)
I can't get into their discord (I asked the 05/03/2026 at 14:21) so I'm forced to try to do it myself. I have a middle knowledge of scripting. I came up with :

params [
    ["_unit", objNull, [objNull]]
];

_unit addEventHandler ["GetInMan", {
    params ["_unit", "_role", "_vehicle", "_turret"];

    if (_vehicle isKindOf "Air") then {
        _unit disableAI "FSM";
    };
}];

I'm trying to use an EH because for performance reasons I don't want a while loop or a sleep loop, also I want it to affect UAVs, and those spawn with an AI inside when deployed

ofc, it doesn't work, can anyone help me please ?

proven charm
#

where do you run this code?

bleak valley
#

init

little raptor
proven charm
#

well if you just paste that to init you can ditch the params part ```sqf
this addEventHandler ["GetInMan", {
params ["_unit", "_role", "_vehicle", "_turret"];

if (_vehicle isKindOf "Air") then {
    _unit disableAI "FSM";
};

}];

bleak valley
# little raptor does DCO even use FSMs?

I think it does
I had issues lowering an helicopter to an altitude low enough to allow rappeling, I deactivated the FSM part using 3den enhanced in attributes and it felt better

little raptor
bleak valley
#

now that I think of it, this EH won't work like I want it too, in UAVs AI doesn't "get in", they spawn inside directly

#

I need to find another EH

proven charm
#

moveIn commands trigger the EH though

bleak valley
#

does the AI that spawns inside the UAV uses the moveIn command ?

proven charm
#

afaik there is no "spawn inside" command. but the unit is first created then moved inside with moveinXXX command

bleak valley
#

ok thanks, so it should work

proven charm
#

but only with editor placed units because only they have init

bleak valley
#

I was talking about the init.sqf, because some AIs are created after mission start

proven charm
#

right

split ruin
#

how to find the path to other flags on USS Liberty?

a3\data_f\flags\flag_us_co.paa
#

also I want to change the name

a3\boat_f_destroyer\destroyer_01\data\destroyer_01_tag_01_co.paa
proven charm
bleak valley
versed ledge
#

I'm trying to add an action to a helicopter to pack and unpack it's rotor. If I include this function in the script the helo spawns with it's rotor folded.

[_hangarHeli, 1] call rhs_fnc_foldHeli;

So for addAction I tried a few things;

_hangarHeli addAction ["Unpack Rotor", { 0 call rhs_fnc_foldHeli;}];
_hangarHeli addAction ["Unpack Rotor", { [_hangerHeli, 0] call rhs_fnc_foldHeli;}];

#

_hangarHeli addAction ["Unpack Rotor", { call rhs_fnc_foldHeli;}];

#

No luck though other than seeing the addAction appear in the scroll menu

#

I think I need to also figure out how to make the action work for both 0 and 1, rather than just being an unfold action.

Any help is much appreciated!

proven charm
#

you need to use _this inside the script because _hangarHeli doesnt exist in there ```sqf
_hangarHeli addAction ["Unpack Rotor", { [_this # 0, 0] call rhs_fnc_foldHeli;}];

#

so try that

unreal scroll
#

Is there a way to ask the engine where exactly (+/-1 m max) the artillery projectile shall explode?
To be precise - the projectile is kind of "ShellBase", not guided, aimed at positon (ArtilleryTarget)

versed ledge
proven charm
#

the engine calls the code assigned to addAction so none of the previously declared variables exist in there. with exception of global variables

versed ledge
#

I did check that out and guess just still have more to learn about them. What I saw on there had a lot more values in the array and for some reason I thought that was rigid. So seeing just three has me confused.

proven charm
#

well i hope it clears a bit

versed ledge
#

Yup, lots! Google is currently explaining the rest. Thanks again for the hand!

radiant lark
#

Hey there, I have a crazy and pretty dumb question

#

Imagine I store all the UIDs for each player on a hashmap:
[KEY: "playerOWNERID", VALUE: "playerSteamID64"]

Will this eventually be faster than doing getPlayerUID player?

#

For repeated use screnario, ofc, so, getting UID plenty of times not only once

unreal scroll
#

Test it 🙂 There is a button in the console for such purposes.

hushed turtle
#

Game turns off your flashlight when you enter a vehicle, but not if you enter one of the seats from where you can use your firearm(naturally). But then flashlight stays on, even after changing seats 😆

#

Is there any EH which fires on seat change? (in vehicle)

unreal scroll
#

SeatSwitched. But you will also need GetIn or GetInMan.

hushed turtle
#

I've just noticed lights like flashlights and street lamps don't cast any shadows. Is that normal in Arma? I only have shadows from sun and moon light

unreal scroll
#

Yes, it is normal ))

errant iron
hushed turtle
#

I guess setVariable variables on player don't stay on him after respawn?

unreal scroll
#

@errant iron All standard ways (like getting position from the ArtilleryTarget) are tested, and it is no close to real hit position. The only way I known is to correct the projectile path - but when I get to client-server variant, it became a headache. I use a dummy object on a local projectile for every client, and with projectile correction I got a serious desync.

I guess setVariable variables on player don't stay on him after respawn?
It stays after respawn, but not after disconnecting/connecting (when your body stays in world).
The more complex question, how the game handles variables, which were saved on player's body when he is not on the server - I didn't test such cases 🙂

hallow mortar
#

Object namespace variables and object EHs are actually preserved across respawn

e: written before above message was edited

granite sky
#

IIRC I had a pretty good target position from calculating the shell position from the initial velocity (Fired EH), but there's still a bit of inaccuracy from the discrete simulation.

#

Dispersion is generally applied before the Fired EH which is why that helps.

hallow mortar
#

I remember something about the pos/rotation of the "Head" selection on a unit not being accurate to precision movements like head freelook. I don't remember which selection would be correct to use instead. Any thoughts?

faint burrow
digital hollow
hallow mortar
#

I'm getting "good enough" results with "neck" and "head" so I guess I'll stick with those. It seems like the head visual model doesn't fully match headlook movements either (e.g. looking all the way over your shoulder doesn't turn the head that far), so that's probably the best compromise I'm going to get.

digital hollow
#

yeah. also check out cba_fnc_attachToBone if you haven't yet

delicate nest
#

HOW DO I SCRIPT A CUSTO OBJECT LIKE A SPEAKER TO PLAY MY CUSTUM SOUND WHEN HIT DETECTS ANY INCOMING PROJECTICLE OR AIRCRAFT EXCEPT FOR BULLETS, FRAGS ETC AND IT TURNS OFF AS SOON AS IT DOSENT DETECT ANYMORE THEN IT RERUNS THE CYCLE EVERYTIME IT DETECTS NEW PROJECTILES? I have a custum sound in my DESCRIPTION.EXT.

tulip ridge
#

Why are you using all caps

winter rose
radiant lark
silent cargo
#

Is it possible to change a players displayed name in game via script?

#

The engine does (#) when duplicates join - so I was thinking it might be possible

tulip ridge
#

Don't think so, at least not script side
There's setName but it only works for units in singleplayer

#

If you're using ACE you can change it though since it has a separate variable for its nametags system

silent cargo
#

Yeah I saw the setname earlier. I might be able to make something to filter messages with UID check and have names bound to that and resend them through script with the custom set name but probably waste of time

thick oar
jade acorn
#

With separate groups it's pretty easy but I don't want to sacrifice performance and limit the scenario scope (and giving myself more work by spawning anything that's over the current group limit)

hushed turtle
#

With disabled pathing they just stay on spot

granite sky
#

Oddly enough, performance is normally better with smaller groups.

jade acorn
#

Perhaps I misunderstood

granite sky
#

One group per unit is likely to run out though :P

jade acorn
granite sky
#

Last time I tested, 2-unit groups were significantly faster than 8-unit groups given the same number of units.