#arma3_scripting
1 messages · Page 224 of 1
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
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
No something about user privacy.
I also had like GPU name in graphics info, but that was pulled because identifying info and privacy
But it can be hashed
Shit bro I was about to use that to do some fingerprinting
if you are going to fingerprint me at least offer me some delicious cookies
fingerprinting you will imply you are a stinky cheater
So you want a fingerprint of people the compuer used by person, you have confirmed cheats, to then do nothing with ?
They buy cheap steam accounts and cheat again
Yeah, but you claim being finger printed implies a stinky cheater. So if you are only going to finger print known cheaters what is the point?
Fingerprint right before ban just so they dont come back again
Sure, but the fingerprint is then useless if you never compare it against someone, like someone joining. If you know a person joining is a cheater you don't need to finger print. If you are not sure, you may in fact finger print someone who is not a cheater.
Well, cheating in my case is really blatant
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.
There are a few replay/aar mods. Have you checked if they suit your purpose?
I wonder how that works though.
They cannot override it on server side.
So surely the server owner would immediately notice when the server says the client has a different UID, than what the client says.
Like it takes 30 seconds to write a remoteExec to check for that and easily find a bunch of cheaters?
What if you just disabled raw SQF input altogether and used whitelisted functions only?
You can't disable raw SQF input (in a way they can't super easily bypass anyway)
Fraali does our AC stuff and he's really the only one making changes to that repo so I could be mistaken but from my understanding you're very much correct.
My bad, I meant commands' remote execution with CfgRemoteExec. Or is it bypassable too?
remoteExec is checked on server side, not bypassable.
But they can still run any code locally, just not remotely
Can they createVehicle and run init line everywhere?
They can dump and kill threads tho, heartbeat could be replicated
I see 👍 I guess it having some kind of protective effect would require verifying all data that the clients send
Hence why I'd save the thread handle
Well I think the trick is to make it as difficult and cumbersome for them to do so as possible. I don't really have good advice on how to prevent that since I only really dabble in the changes my friend makes on that end, but we've been doing okay for a good while. I understand though that's not very helpful. This might be useful though #dev_rc_branch message
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.
Wow that's indeed really really useful
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 
No worries 😸 we all know how life comunities are, I also work on a life server and it’s built onto Tonic’s much exploiteable altis life
It’s really sad, my goal is to set a decent standard in the spanish community.
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 😢
Yeah... as true as that is what you said about life servers; I also think so many communities are super reluctant to share anything AC for security reasons, which also really just sucks because it leaves other smaller servers up to dry
Thats what I am doing hehe, not from scratch though because the community is really unpredictable and you never know if they are going to choose your server over the other ones. I have to keep shitty steep roads because people are sooo used to it that they somehow find it funny that they bounce and fly around the place
Tonic lead by example of opening his code.
Everyone took it and cooked their improvements in secret
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 
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
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.
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 😂
You can open the teamswitch dialog at any time you want even in MP
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
ACE is amazing, but cause issues in missions, which weren't built for it
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).
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.
Hopefully they cant override cfgfunctions
Which to be fair sounds pretty achievable to me
And, by the way, thank you so much for suggesting that incredible mission event handler
For spawned script
Oh haha, been wanting it for years
It's going to be really useful
Yess I've seen you suggested it on '23
I am afraid this dedmen guy will shuffle up the network messages identifiers 😅
Because, I guess the EH will need a new network message
If you're not doing something... strange, the network message "identifiers" wont matter to us. The eventhandler also shouldnt be a network event anyhow
Thought infiSTAR also dealt with these potential changes
No clue, I haven't looked into infistar for a long time.
I really hope so tbh
I do think I remember ban messages for it changing in the past
Yeah that sucks
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?
getAllPylonsInfo?
Ah ok, missed a command, thanks.
Apparently this codebase is older than this command :P
I don't think teamrespawn allows you to do that
is it possible to disable player reloading for a moment?
other than disableUserInput
We still have gpu name and actual monitor resolution, but only in the diag binary.
maybe i just use addUserActionEventHandler ["ReloadMagazine" to check it
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
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
according to wiki they can be defined in config.cpp. not sure if possible in description.ext
Oh dear, now where will I find whatever that is
basically you make a mod. unless possible in the mission config (description.ext)
There are no tutorials online either
Dammit I suppose
Preferably both
Choppers are easier, yes. Jets are the problem
Oh I would need luck, alright
You can actually spawn an airport that is used by USS Freedom, if that's sufficient
I did spawn the dynamic airbase, but it is way too small
Other than that there is no vanilla equivalent IIRC
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
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
How do I use it again? Similar to dynamic airport?
I use this script:
create3DENEntity ["Object", "DynamicAirport_01_F", screenToWorld [0.5, 0.5]]
Do the same but just AirportBase
Huh alright, I will do that
Will give it a shot and let ya know
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;
};
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.
i mean its supposed to be random whether he checks left or right, but it should still be 20° of 0 no?
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°
Well there's a sleep 8 in there so it should be less frequent than that
Oh sorry, I read the other one, never mind
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
@hushed turtle maybe I have something in description.ext that prevents the menu showing or some weird keybind ...
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"] ];
You need another level of array
The syntax is lineIntersectsSurfaces [[ _array1, _array2, _array... ]]
Actually on wiki its
lineIntersectsSurfaces [[element1, element2, ...]]
but I get the point - atleast 3 elements required.
Maybe this should be on the wiki?
"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
Thank you! I completely missed that!
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?
That would be a fairly straightforward use of drawIcon3d
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
I think you need to load magazine before that, can't tell much rn, but since fireAtTarget doesn't have mag argument
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];
};
Basically you search for the shell with the highest indirectHitRange.
If there's no HE then it'll be a HEAT round or some sort of DP thing.
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
Trying to make stuff work with arbitrary vehicle mods is a losing battle :P
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
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
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
Fyi. If you own the Spearhead 1944 dlc you could use the map voting system. https://community.bistudio.com/wiki/Spearhead_1944_Map_Vote_UI
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.
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.
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];
};```
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?
How it does supposed to be called? Which file, which script does that?
["FiringRange\ATMoving\RightConsoleInit.sqf"] remoteExec ["execVM", 2]; used to run in the init of a object in editor (the object it's supposed to add the actions), i tried moving it to the initServer, didn't work either
i'm currently using the Debug console to try and run it, and it doesn't work
neither Local, Global, Server
Are you sure RightConsoleInit.sqf does have any scripts within?
yes, i'm copying directly from it
Does that script have any obvious debug commands, like hint?
no it's 4 addActions
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
What about other targets than 2 ? Like 0
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?
0 works but it's not ideal
...Wait, you're addAction'ing into the server?
addAction is a Local Effect command, it won't networked
So if it's a dedi, you are adding actions to nobody
?
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
It doesn't matter/unrelated. The server, which is nobody, will not network the action to other clients
so an addAction needs to be ran on everyone's client for it to appear to them?
If you want everyone to use it, yes
on the wiki for addAction it have this, what's this supposed to be then?
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
ah, ok, ty
If you're running a public dedicated server I would recommend peeping this #arma3_scripting message
Enhanced movement mod - allows to get off the building safely (depending on height) via keyboard shortcut (with animation)
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
Hi everyone, i have a question, do you have a tool to convert a mp4 file to ogv ?
see ffmpegtool < v4.0.2
https://community.bistudio.com/wiki/OGV_File_Format
Thx for your answer 🙂 Have a good day
sendSimpleCommand is one way, but it's not super precise and doesn't have an innate target direction - you'd have to just tell them to turn, then tell them to stop turning when they're pointing roughly the right way.
I dunno if setFormDir would work, might be worth a shot
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
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.
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
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
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.
if you use it in the init field, don't
you should use
if (isServer) then { this setFlagSide east; };
Ok, put this in initServer?
(with a flag name?)
that would be for an init field of an object
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
try without any mods at all
setvariable PUBLIC does trigger PVEH in 1.55 dev (haven't tested in 1.56 RC). At least when used on objects
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.
What is the tactical map?
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
You mean the strategic map. Yes you can execute any script when clicking on one of the icons
alr thanks
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 ?
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
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?
Hmm i see. Thank you very much, i'll see what i can do with it and if i should better use lineintersectsurface
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
can somebody help with smoke module, I need to create smoke screen for assaulting infantry, is it possible by changing the particles properties?
In theory I would say yes, but question is how much though. Known enemies to AI are tracked per group
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 ...
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
@tulip siren you cannot zoom in/out the strategic map
Is there a way to at least make it be further out than default?
yes, but during mission you cannot change its scale
@tulip siren use scale param with the strategic map function
[display, pos, missions, ORBATs, markers, images, weather, night, scale, simulation, label, missionName, missionIcon] call BIS_fnc_strategicMapOpen;
https://community.bistudio.com/wiki/BIS_fnc_strategicMapOpen
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
1 is max zoom out I think
and you have to drag a lot with the mouse, this cannot be changed unfortunately
Maybe i could grab a smaller resolution of the map and use that as the display?
yeah having just part of the map as the strategic map will fix the problem ...
Alright, thanks for the help
@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;
};
};
};
}];```
How? Just use a different variable name.
Nope just the tactical map module being goofy, ended up just swapping display
ok, It worked after the mission started
Those conditions contradict each other. If there's 1 player alive, then there cannot be 0 switchableUnits alive.
No, there's one. That player.
https://community.bistudio.com/wiki/switchableUnits
Command is relative to the client on which it is executed and will only show playable units for the same side as player's group + player himself
Also note that switchableUnits has limitations in multiplayer, which are described on the wiki page.
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?
i guess its not possible to remove magazine from unit that has X amount of ammo?
You remove all the magazines and then add back the others.
yea was thinking the same, but very big operation 🙂
Ai would have to reload i guess....
or not if bullets remain in the weapon
Not sure what it's for, but there are certainly performance risks :P
i made script where AI throws you a mag, if requested
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.
good point. i think im going to avoid the mag resetting because of bandwidth and the AIs typically have only full magazines anyway
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.
well if some one cheats by giving AI mags thats not big thing, but how you even give AI mags Idk
Backpack access, vanilla feature.
Well, it's not creating new bullets at least :P
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
That sounds like really good idea
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
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.
idk throwing sounded like a good idea because thats how it would probably go in real combat
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
Maybe play some ammo sound 
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 😆
part of the problem is knowing which AI is closest and where because that AI will give the mag
A little ✨ raycasting ✨ ought to solve that problem
im checking checkVisibility so that AI has to actually see you
FWIW, there is already a mod which does this unless you've tried it and just decided to make your own: https://steamcommunity.com/sharedfiles/filedetails/?id=2944181980
thx for the link! but I like to write my own scripts 🙂
understood, carry on
can probably get good ideas from others scripts though... 🙂
the way that script handles mag passing is different from my approach
You can pass -1 to remove magazines: https://community.bistudio.com/wiki/addMagazineAmmoCargo
ok thx not sure how this helps with my problem though but maybe i didnt understand correctly
oh i see now how that command works but idk how to get right cargospace yet as the mags can be anywhere
Units already had removeMagazine anyway.
yes but it seem this command removes mags by the ammo count
hmm, I guess
you could do magazinesAmmoCargo uniformContainer _unit and search for it.
(and the other two)
good idea i'll try that, thx!
seem to work gud, thx everyone! 👍
Thank you. I will give this a test!
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.
could be because you're running too many scripts at once
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)
no thanks Scotty, I write my own scripts 🙂 because coding is fun
famous last words before running to some coding dilemma 😅
You could rewrite his script for your liking 😀
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....
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
Well if Scotty runs it from radio trigger probably does work.
Don't radio triggers run locally?
ya definitely should work when ran on client
np
yup
ok ic
oh , what you tried?
ok 🙂
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
Yes, they are the same case, but if you're unsure you can also use toLowerANSI to normalise things
i just happen to write my repack script day or two ago
well if their same then working with them should be painless (in command in mind)
actually i get ```
(configFile >> "CfgWeapons" >> _x >> "magazines")
Not necessarily. The magazines array is specified by the developer, not automatically generated from CfgMagazines classnames, and there's no guarantee they matched case when writing it.
ok i will take into account then. thx
Also, some (many) weapons use magazine wells, so magazines doesn't tell the complete story of what magazines they can use
yes, what my script also does
oh didnt know that
Luckily we have compatibleMagazines to do all this in a simple way
aah thx i will use that!
I do not know if compatibleMagazines matches CfgMagazines case; you should test that before relying on it.
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
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
CBA doesn't even do anything.
CBA actually makes the game to run even smoother from my experience
It's needed so different mods don't break each other.
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
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
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
I tend keep my modlist under 25-30 mods max
because really, there are a lot of shitty stuff in workshop lol
my current modlist is 7 mods 🙂
well there are some units/groups that uses like 70+ mods easily
Western Sahara
CBA
AWESome : Aerial Warfare Enhanced Somehow
Advance Aero Effects
JCA - Infantry Arsenal
ACE
JBAD
Lythium
it's all about scenario depedency
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)
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
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
So use it!
everything are mods technically - maps, dlcs, etc 🙂
If DLCs are, is the base game a mod to you?
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
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
you don't need mods because... in your missions you don't need them lol, there's nothing special about this
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 😂
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 😄
but only skeptical thinking will bring any change so better question yourself from time to time 🤔
I don't think those would exclude each other 😛 But anyways, I guess back to topic 😅
my love for arma is above any questioning
?
I have seen a lady that stores her own piss in her hous for years ...
Did she use Arma 3 Scripting to do it?
(off topic)
I thought it will be good npc for apocalypse scenario
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.
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 {};
so I have to remove it from the old unit, then add it to the new unit?
how to remove the support menu ?
You replace add with remove: https://community.bistudio.com/wiki/BIS_fnc_removeCommMenuItem
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.
Quick question, could someone explain what a dedicated server and non dedicated server is? And what a headless client is?
dedi is like when only server is running on the machine and no clients
Dedicated server is when a dedicated machine is running as the server. E.g. when you pay a company to rent a server from them
A "non-dedicated" server would be like a player hosting a mission so their computer acts as both the server and a player
it maybe confusing because in arma terms dedicated may mean the server you are running on your PC
then theres command to check that https://community.bistudio.com/wiki/isDedicated
Ah I see, thank you, do you per chance also know what a headless client is?
havent used that my self so i point you to this page: https://community.bistudio.com/wiki/Arma_3:_Headless_Client
Oh, haven't found that wiki page yet, thanks
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?
2.22
Ah i see - so its planned for release?
no, they just write things on the wiki for the lolz
yeah it's planned 😄
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
For some reason i thought we was ahead of 2.22 🙂 i'll just stick to 10 channels then
Oh I get it now, thank you.
Sorry for the late reply. Anyway, thx again for the help
And where is the confusion? Nothing stops you from running dedicated server on your PC.
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
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.
ill have a look at this. thanks 😄
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.
_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 ...
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
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
its better to write your own data exporter. place the compositions on the ground, find a center point, then store the classes, relative positions and rotations, etc (You'll need to grab the 3den object attributes, things like getDir don't work here). Then once you have your data, you can then use the ingame commands such as createVehicle to rebuild them.
Alr thanks a lot for the pointer, will try to learn all of this and possibly not go insane.
that's what i wanted to say, dedi doesnt mean a server that you have rented
I just skip the dedicated server and use local host, its a lot faster to set up everything
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
Zeus Enhanced has keybind for doMove on units, might work on agents?
agents need setDestination instead of doMove unfortunately
That would be a good improvement though :)
yeah perhaps worthy of a request or something; granted its quite a rare use case but still
Ok, the issue still exists if there's a gunner inside the vehicle. The vehicle just won't move. Perhaps related to this: http://feedback.arma3.com/view.php?id=19794
ZEN actually already does both and works with agent 😂
oh, nice lol
thanks!
I think I've used it for "dumb" drivers in combat
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)
Only thing I can think of is the blood textures being applied to the uniform / body
hm
is it possible to get it so when a player hits an object it triggers a script
Do you mean like when they shoot an object or like walking up and bumping into it?
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
hmm that could work but when you do distance. Where would the distance be from, would it be from the whole object or a specific point on the object
Distance is always going to be from the root of the object, i.e the spot where the icon is
So if the object is largr you need to compensate
The more accurate method would involve raycasting using lineintersectssurfaces
i see
is a way to export the inventory items from a vehicle?
I mean physical items, not virtual arsenal ones
Surprise! There ain't any, other than getWeaponCargo getMagazineCargo etc, there is no getUnitLoadout equivalent for vehicle inventory
😭
If there are backpacks. Do I need loop through one by one to get their items?
Do you mean inventory in inventory situation?
Yes
That's what I believe, yes. everyBackpack can fetch inventories within
there is getItemCargo but gets everything but weapons and magazines, etc ...
getWeaponCargo getMagazineCargo?
getBackpackCargo?
I am wondering what this makes with AI, they become dumb ?
_soldier disableAI "FSM";
they lose their engine-defined behaviour, becoming mostly useless 🙂
This is how ZEN does it https://github.com/zen-mod/ZEN/blob/master/addons/common/functions/fnc_serializeInventory.sqf
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?
_pos = getMarkerPos "Jumber";
_pos set [2,300];
get the right pos above sea level
Gets positions 300 above water(or terrain if you use it as ATL), regardless of marker height
flyInHeight or flyInHeightASL, probably
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
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*
The function "BIS_fnc_hasItem" (bohemia defined script, base game) has a script error if _found doesnt exist inside the script due to it using select on a nil value. You wont be able to edit these functions unless you make your own mod for it.
As far as I'm aware, not really much you can do to fix the error other than just not using the function.
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.
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?
I'd use Draw3D
I really don't know about vehicles, but try to make empty Geometry LOD or PhysX LOD
I don't know why
Just update the hud when you change the health, or if it's vanilla damage: from a handle damage event handler
I'll also need a HandleHeal event handler, and im not sure how reliable that one is
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;
};
}];
if you are concerned with all the what ifs during this event, you might want to make your own event that is custom tailored to you, using a frame handler to check and store current hp per frame, then throw an event when hp changes
at that point, I might as well run a while loop that updates the entire HUD every few frames, right?
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;
}
};
If you're just using HandleDamage and HandleHeal, won't it still not change for setDamage?
I'll manually update it all times I use setDamage
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?
Why are you doing a remoteExec?
dont need to, changing it
The return value is just the amount of damage to be applied. That's why it says a value of 0 will make them invulnerable to damage.
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."?
it means the return value will be the damage value that's set on that hitpoint/total unit health (depending on context)
so is Milo wrong?
basically if you just simply want to return it like vanilla, you would just do _damage + (damage _unit) (in case of total damage)
oh
so the return value is the final amount of damage the player will have after the event
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?)
yes
it depends on the part as milo said
handledamage triggers multiple times per hit - once per part + once for total damage
so if my EH returns 0, any damage will fully heal the player?
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 😄
I believe it would just prevent damage from being inflicted; not change the players existing damage to healed
it would actually heal the player
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
Ah okay you may be right.
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"
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 };
};
precisely (although isDamageAllowed being false iirc doesnt trigger the EH anyway)
thanks
I just tested and you are correct- I suppose been a while since I touched damage handling 
I guess in our event handlers we return the original damage so makes sense.
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.
If damage isnt allowed, then it wont fire the event handler. Afaik, empty string with getting returns the same as getDammage
I can see that the eventhandler is being triggered. Shortly after I load into a mission.
Does remoteExec send something to server, if I use local object as target?
Good question, whether there is an optimization trick there. Might also depend on JIP option, I would guess.
Yes. To validate that you're allowed to execute it
I see. Is it worth doing local check then and avoid remoteExec, if target is local?
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.
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
Does someone know what _exitCodes there are and what their meaning is, like is there a list on the wiki or something?
https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onUnload
Its basically which button was pressed to close it
OK button or Cancel button == different codes
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
Does https://community.bistudio.com/wiki/linkItem work?
Seem like that will do it
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
enableAI
wait really that's it?
Your radio commands your character says or the stuff your AI say?

Which?
but can I do it in the debug console?
general radio chatter. Like 2 report in. 3 is down etc
Does your character say that or do your subordinate say that?
That was also not a yes or no question.
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
You might need to do:
enableSentences true; or
whateverunit enableAI "RADIOPROTOCOL" or
whateverunit enableAI "Male01_F (you can use any voice)
what about for all units? Is that just _Unit or foreach?
{_x enableAI "RADIOPROTOCOL"} forEach allUnits
that worked thanks guys
may I ask a strange question?
how much RAM is okay for script to take?
Just have it be as little as you can make it. One can always simply not use a script that causes problems for them.
I do understand that but I do not have experience balancing capability of a script and it's RAM cost so I was asking to know mostly for that.
How much is it using and what's the script for?
It is not yet made I am still refining that but it will be like a dozen or two megabytes. And I plan for script to make a defined UAV strike clumped up enemy infantry units while avoiding civilians and/or allied units.
Recently, somebody was talking about how they were working on a mission that had like 10 GB (or something in the GB) of functions (so in memory, IIRC) or something crazy.
I'm happy to be wrong in this case
.
using a dozen megabytes of memory with script is hard to achieve with properly written scripts
But the issue here is that this is a process that will run within arma simulation/mission
So?
you mean their scripts used 10 gb of RAM?!
man my notebook (not gaming pc) could not ran those scripts
The issue is I do not like easy paths and want to make UAV target not a unit but a spot that would hit the maximum ammount of infantry that clummed up
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
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
If it has sleep, its scheduled
which means the max time is limited anyway and it can't impact fps that much
oh no the algorithm is not slow the ram usage is relatively big but I see you guys saying it should be okay so I will probably stop worrying.
If scheduled is limited, why does infinite while loop with no suspension can cause fps drop?
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
I think you may be thinking of us haha #arma3_scripting message
More just 10gb of memory being used total, although we do have quite a lot of functions 🙂
Because much of the engine is otherwise frozen during script execution.
If you otherwise have 90 fps ~ 11.1 ms, and force the scheduler to waste an additional 3 you are down to 71 fps.
Sounds legit
What is the best way to server game state for a scenario-style mode like in antistasi?
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?
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.
@misty dew "Modded" Bed?
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?
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?
You could add the action to the player and check if they're in the area
would i need to put that in a loop or no? how would i go about doing that
You'd just check it in the action's condition
Something like:
_this inArea yourTriggerVarName
thanks, ill try that 🫡
In that way, condition is already on "a loop". It anyways executed every frame
works great, how would i go about giving every player on the server this action and having them keep it on respawn? i tried doing the addaction in onPlayerRespawn but it didnt show up at all
initPlayerLocal and onPlayerRespawn depending on your respawn settings
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"
];```
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?
I use markerShape instead. Seemed like the only one that was reliable and reasonably fast.
Hm. That possibly beats my alternative. Had to rewrite checks to markerPos _markerName isNotEqualTo [0,0,0]. Still curious what makes that happen, though...
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.
Hm. markerShape check it is, then. Thanks!
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?
How are you creating the marker?
It's better to use a trigger.
@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
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"
this setVariable ["pairedMarker", "pairedMarkerName"];
Have you tried adding some systemChat at various points to confirm that _markerVarName and other variables contain what you expect?
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.
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?
moveInAny says its global arg, but all the other moveInX commands are local which seems odd
right?
moveInDriver is definitely local, will try moveInAny because it's moving player to driver seat first, so it shouldnt be an issue
_player action ["GetinDriver", _vehicle]; could be it
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?
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.
What's the full name of the marker as shown in the Editor?
mrker_tsk2_tower_bearing_1
Well, that's not the generated name you're going to get from your script
Your script is combining "mkr_tsk2_tower_bearing_" with "radiotower_gizmo_1"
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.
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
Yep it's Global. I was having trouble with scope. But as I understand, this is a switch that will be activated once per tower. There's no duplicate tower/symbol variable names. So as I understand, this isn't a problem in this case.
Is HMD head mounted device or what it stands for?
https://community.bistudio.com/wiki/getSlotItemName
Well both the init and scriptfile show that I am. But I was having trouble with accessing the param as a local variable inside the brackets (scope). Didn't want to ask multiple questions.
Yes, Head Mounted Device. NVG slot
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
Not displays in Arma terms I guess. Like not dialogs?
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.
@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.
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.
Ok, thanks 
Just checking-
So the object init passes a param [this]. Won't running my scriptfile override targetname with a new object each time?
Yes, and that's the problem. The action code tries to access targetname later - after it's been overwritten by other scripts.
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.
Sequence of events:
- script1 sets
targetNameto object1 when adding action1 - script2 sets
targetNameto object2 when adding action2 - the mission continues
- someone completes action1
- action1 looks up
targetNameand finds it contains object2, so now completing action1 has activated the marker for action2
So I haven't accounted for people who don't complete the action? I see.
Thanks.
No, that's not it at all
Oh this occurs at init.
Doesn't matter
OK I need to pay attention then.
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.
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?
The script runs however many times you tell it to run. You execVM it in the init field of 5 objects? It runs 5 times on every machine.
An area trigger on each tower that adds the action would fix this, yes?
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)
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)?
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.
Hm. The remoteExec is more of a server perspective command I suppose.
Not necessarily. It has lots of utility for clients too. You just have to be careful with it.
I can certainly imagine. Broadband internet has made me lazy with traffic. This was educational. Thanks again.
i guess drawIcon3D can draw only one icon
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
ye im trying that now
just kinda hard to aim the extra icon to the end of the first icon string
hmm i tried getTextWidth but that didnt seem to give correct text width _itext getTextWidth ["PuristaMedium", 0.05];
Dunno. Doesn't say on BIKI it gives correct either: "Returns estimated width of the text"
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
doesnt matter, cant get the icon to stay on side in 3D anyways XD
Alternatively you can also draw UI controls in 3D space
really, how to do that?
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.
controls are always 2D (except ctrlObject)
so what am i setting 3D then?
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)
It really isn't that complicated. Just start with a simple control and change it's position each frame.
yeah i know that command but thats as far as i know 😄
maybe make a control group and move that
Sure, you can also make a group
Sadly I don't have the script anymore where I did some testing with that.
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.
ok thx Revo 🙂 which display was 313 again? i should probably use game display
Eden Editor*
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 🙂
That's really nice trick 😀
Is there any event handler that would be able to detect remote controls? Anything for like camera change or UAVs
playerViewChanged mission EH might do what you want
Reading though this - https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Hit - Is it safe to ad this in bulk for all AI in the mission to get some detailed stats of player hitting the AI at the end of the game or is there a better alternative?
If there are a lot of AI units, Add a fired event to the player, which spawns a hitPart on the projectile when he fires.
Track the hit and then removeeventhandler on the projectile
If you're players are likely to spam MG fire, or have many players, that might still be a problem.
Oh, and you'll want hitPart, because hit will return the projectile, not the shooter.
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
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.
and then extract the results later
I also thought of using https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage
🤔 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.
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.
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?
I rather like the projectile hitpart idea though.
I think the implied question was whether performance will suffer with all those EH's.
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)
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.
Cannon spamming into a bunch will be painful but then it always is.
Unless the goal is to have sever-wide stats at mission end (which i assume)
If that's the case, escape the EH if not server, same idea.
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.
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
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.
Now in theory, the players could also hit other players which we want to keep a track of anyways
@crude barn Nah, I know about the bug but I don't have a workaround.
Ah damn, was worth a shot
It can calculate the paths fine but it breaks them when it crosses room boundaries :/
probably some one-liner ATL/ASL bug.
Do you want to track stats like their hit %?
Or their targets even if they miss?
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
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.
Yea exactly 
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.
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.
I've never messed around much running client-side scripts like that, so I'm not sure how to run the script client-side and get the returns on the server tk tabulate.
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?
Easy starting point is initPlayerLocal.sqf. Data can be sent back with remoteExec and the player's UID or similar.
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.
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.
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
I'm assuming you are using a "nuke" from zeus enhanced or whatever? The framerate drop comes from the killing of entities.
righttt
Negative. Currently it's an RHS "Bear" dropping the nuke but I'm wondering if it's possible to just play the explosive sfx and filter.
wouldn't know. you can look through the code to see if its function has a parameter for not damaging entities. worst end result you just extract the sfx and filter and build your own nuke
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"
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.
This is quite clever I would say
Yes no need for while loops if you wanted to disable 3rd person for example
is it safe to delete (deleteAt) hashmap item when looping it via forEach?
I would say yes, since keys don't change when removed like indexes in arrays do
ya maybe
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
player action ["GunLightOn", player];
Switches to primary weapon regardless if it has flashlight, despite you holding handgun with a flashlight.
GunLightOff switches off handgun light just fine. Damn Arma! ||Right now I'm on dev branch though||
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...
I think objects like helipad aren't entities. It can find me, but not building
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.
Seems like only units, animals, modules and vehicles can be returned by entities
even chickens lol 🙂
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 ];
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];
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];
second one is better imo because its more secure..
Aight, thx
but client telling server to delete stuff isnt too secure either :U
I dont even need to use remoteExec here, do I?
No, not really
Aight, appriciate the quick responses, thx yall
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?
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?
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.
The text is getting cut off
And I have to insert a line break to keep the message on the control
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.
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?
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
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
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 ? 🤔
itemID: Number - item ID returned by BIS_fnc_addCommMenuItem command
// 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];
@errant jasper thank you, works like a charm, variables always save the day
I wonder can we make AH-66J internal pylons to be always open?
quick google search says "no" 😭
https://community.bistudio.com/wiki/animateBay
Yes you can
@still forum can you tell, why getUserInfo return "" (empty) steamProfileName on some servers?
Maybe I need to open some additional ports in the firewall?
how can i make a event handler that makes ai super tanky
Use HandleDamage https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage
The return value of the script you put in it is the resultant health (not damage) of whatever it's triggering for. You can return the current health minus some fraction of the new damage.
ive tried this but it hasnt actuly worked
it just auto kills it
What exact script have you been using?
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
_damage * 0.1
}]; ```
trying to do it on 3as stuff
i am extremly new to scripting this is my first time ever messing with this stuff
You're returning the new, added damage. IIRC, you need to return the new health.
E.g.:
_B2 addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
if (_selection != "") exitWith {};
_oldDamage = damage _unit;
_oldDamage - 0.1 * _damage;
}];
its still taking the normal ammount of damage to kill it
Try it again; I edited it.
still the same
its a turret if it makes and difference its a 3AS deka
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.
could ace be messing it up?
With ACE medical enabled?
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.
do you know anyway to do it?
Ask the ACE people or the KAT people if the overwrite the override.
wait but its a turret should kat have no effect on it?
You were talking about a turret this whole time? Send a screenshot of it so I know what you mean.
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.
it is a turret that a ai or a person can get inside i have the guy sitting next to it so it can be moved using a attach script
Watch Untitled by MrToast123 and millions of other Arma 3 videos on Medal. #arma3
Maybe the script works for vehicles, but maybe it doesn't. I don't know if ACE Vehicle Damage or some other thing interferes or not.
ok do you know how to make a hit counter so it can die after a certen ammount of hits?
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.
would you be able to do it please i have no idea what i am doing
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;
}];
What is that trying to do?
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.
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.
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";
i would try https://community.bistudio.com/wiki/setCombatBehaviour "CARELESS"
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
googled this for you https://community.bistudio.com/wiki/Arma_3:_Animated_Opening 🙂
Didn't give me the answer to my question but thanks i guess
how do you get the class name of a currently attached weapon item, like a scope or a muzzle attachment?
Any way to check if unit in vehicle is in one of the spots from where it can use it's firearm?
The same with the vanilla "Escape from Tanoa" mission.
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!"};```
(assignedVehicleRole player) params ["", ["_turretPath", []]];
_isPersonTurret = (_turretPath isNotEqualTo [])
and { (getNumber (([objectParent player, _turretPath] call BIS_fnc_turretConfig) >> "isPersonTurret")) == 1 };
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 ?
where do you run this code?
init
does DCO even use FSMs?
which init?
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";
};
}];
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
params doesn't even work in init fields because there's no _this
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
moveIn commands trigger the EH though
does the AI that spawns inside the UAV uses the moveIn command ?
afaik there is no "spawn inside" command. but the unit is first created then moved inside with moveinXXX command
ok thanks, so it should work
but only with editor placed units because only they have init
I was talking about the init.sqf, because some AIs are created after mission start
right
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
flagpole configs or just search for flag names with https://gist.github.com/HallyG/fa7a6cda10abcb630b1dc325f0523553
I did find an answer to my problem with this mod (https://steamcommunity.com/sharedfiles/filedetails/?id=3574267375&searchtext=DCO+excluder), thank you for your help !
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!
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
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)
That works, thank you!
So within the [] there's no recognition of variables? I'm new at this if you didn't guess yet. If you have a sec - can you tell me about the other parts of that array? # 0 , 0
And last thing, I was trying to do was make it so that the action repacks the rotor as well. This unpacks, but didn't activate a repack.
the engine calls the code assigned to addAction so none of the previously declared variables exist in there. with exception of global variables
if you want to know more about the **_this **array check out the wiki (Parameters-script) https://community.bistudio.com/wiki/addAction
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.
well i hope it clears a bit
Yup, lots! Google is currently explaining the rest. Thanks again for the hand!
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
Test it 🙂 There is a button in the console for such purposes.
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)
SeatSwitched. But you will also need GetIn or GetInMan.
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
Yes, it is normal ))
closest i could find is ArtilleryShellFired, but unfortunately its target position doesn't account for spread:
https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#ArtilleryShellFired
I guess setVariable variables on player don't stay on him after respawn?
@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 🙂
Object namespace variables and object EHs are actually preserved across respawn
e: written before above message was edited
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.
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?
Well, if you remove Xi'ans or creating a wreck I added to the mission, then drawing icons on nav info panel starts working. 🤔
positionCameraToWorld is good if you want where the player is looking, rather than what the player unit is doing
I need it for attaching stuff, so unfortunately that doesn't work for me
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.
yeah. also check out cba_fnc_attachToBone if you haven't yet
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.
Why are you using all caps
MAYBE YOU SHOULD NOT BE SHOUTING SO PEOPLE ARE NOT TOO IMPRESSED BY YOUR CAPS LOCK USAGE AND CAN FOCUS ON HELPING
other than that, see https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#IncomingMissile
Turns out to be faster, yes,
0.00054 ms (getPlayerUID)
0.00031 ms (hmapuids get clientOwner)
Tested it with BIS_fnc_codePerformance;
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
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
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
Removing the Geo Lod will remove collision checks with the object. Be sure to have at least a view-Geometry however, as otherwise addAction entries disappear. Check out this command: https://community.bistudio.com/wiki/disableCollisionWith
disabled pathing. What I want is basically them to go into combat only when actually engaged, rather than because a unit 150m away outside of their view was killed.
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)
With disabled pathing they just stay on spot
Oddly enough, performance is normally better with smaller groups.
You asked me how do I keep them in one place
Perhaps I misunderstood
One group per unit is likely to run out though :P
but if I had to choose between one group with 256 units and 256 groups with single unit, the former would be easier on CPU no? :D\
Last time I tested, 2-unit groups were significantly faster than 8-unit groups given the same number of units.