#arma3_scripting

1 messages Β· Page 219 of 1

young current
#

!purgeban 1180031396199288832 0 crypto scam spam

lyric schoonerBOT
fair drum
#

Pew pew

crisp wave
#

hey! im an absolute beginner to scripting and am wondering if anybody knows how to get a template of text to remain on an ace notepad style item when it is spawned

sharp grotto
#

create dummy items with unique "classnames", since you cant save data to items (if we talk about inventory items).
then write the script & create GUI to connect items and text
Alot to learn for a newby.

  • Need to learn how to make your own mod & config to be able to create the items needed for it (notepad items with unique classnames).
  • Need to learn scripting itself
  • And also need to learn how to make the UI's (finicky/janky).

Depending on how fast you can learn and how good you can read, it will take you hundreds of hours.

crisp wave
#

in my use case, im intending for it to be used in correlation with a passport mod.

stable dune
#

!code

wicked roostBOT
#

Please use !sqf from now on (!enforcescript soonβ„’)

urban juniper
#

im having issues with setVariable getVariable, i know setVariable Fires but the getVariable is unset, ive tested and im 100% sure that the code would work if the IF statement comes back true
im testing in SP only atm, any tips

myaction = ['Hook Up','Hook Up','',{
    _unit setVariable ['ffr_static_line_hooked', true, true]; hint "Hooked up";
},{true;}] call ace_interact_menu_fnc_createAction;
[_unit, 1, ["ACE_SelfActions"], myaction] call ace_interact_menu_fnc_addActionToObject;
    if (_unit getVariable ["ffr_static_line_hooked", false]) then {
        hint "Deploying chute";
        _unit action ["OpenParachute", _unit];
    };
#

appolagies

stable dune
urban juniper
#

ah legend

radiant lark
#

Hey there, I wonder why the first time a player joins the server, the unit it controls is created by the server (ID: 2) but when it dies and respawns, the unit that it controls is created by the client (ID: clientOwner). Why is it like that??

granite sky
#

"Why" doesn't feel like a useful question with A3. It's weird and you deal with it.

radiant lark
#

Shit, gotta get used to that mindset

hushed turtle
#

Maybe because client didn't load yet, so server creates his unit for him? And later he creates units himself, since his unit would be local anyway

granite sky
#

If you're ever dealing with AI it's more like "Why god whyyyyy"

radiant lark
#

I am just serversiding everything now, and I just wonder why certain things are like they are, well, Arma claims to be client-focused

fair drum
granite sky
#

netIds are persistent, aren't they? They don't change with object locality.

hallow mortar
#

If that's in relation to the previous stuff and not an unrelated question, I think they were talking about the owner's machine ID, not the object netID

hallow mortar
drowsy geyser
#

Is there a command that can open a utility drones box? Just like when it drops the leaflets

radiant lark
mortal folio
radiant lark
#

Which is made of creator and id

mortal folio
# radiant lark NetId yeah

Exactly so as others have said the player unit is first made on the server and then ownership is transfered, netid itself doesnt change between transfers

#

the game uses the netid as a small string of data to identify objects - which is likely how theyre referenced internally when for example you feed an object into a network message

#

If it would change the reference would keep getting invalidated and youd end up with a right mess

tender inlet
#

hello,
I want to catch the info when there is no player still connected on a dedicated server (persistent=off)
I used different EH (HandleDisconnect/PlayerDisconnected) to have the input, I even make a test with a while true loop.

but I can't detect in every case!

when the player disconnect normally (proper logoff), everything works fine, but,
if he loose his connection, like when it's logged:
"15:48:04 Player toto is losing connection"
no event are send (and it's logic) to the server.

so how did you detect when the last player leave the game in a way that it support brutal disconnection ?

thanks

proven charm
tender inlet
#

but this code seems to be never reached (diag_log) when a user lose his connection.
it's almost work when he logoff properly

#

I said 'almost' bc in shutdown, timing is critical and even a sleep 0.1 could make the code not executed

proven charm
#

ok have you tried ```sqf
addMissionEventHandler ["PlayerDisconnected",
{
params ["_id", "_uid", "_name", "_jip", "_owner", "_idstr"];

if(_name == "SERVER") then // Called after all players ends game
{
};
}];

tender inlet
#

yes, but event are send by the client πŸ™‚

#

and if the client crash no events are sent

#

the typical rpt for a brutal disconnect look like:
15:47:01 "Civilian vehicle CUP_C_Volha_Blue_TKCIV incident 20 at 1987.42" 15:48:04 Player toto is losing connection 15:48:09 NetServer: cannot find channel #1084154869, users.card=0 15:48:09 Message not sent - error 0, message ID = ffffffff, to 1084154869 (hipley) 15:48:09 Player toto disconnected. 15:48:09 All users disconnected, waiting for users.

I want to catch this moment on server side

proven charm
tender inlet
#

in this case there is a while loop to count player and two EH (xxDisconect)

#

is executed on server, but the evnt come from the client

#

sadly !

proven charm
#

oh

tender inlet
#

even LLM seems not to have any good info !

hushed turtle
#

On SQF? Indeed they don't

winter rose
#

yeah don't try 😹 they're not "well trained"

tender inlet
#

when you search for a very specific info, and you know pretty well your subject, you realize the LLM bullshit !

tender inlet
mortal folio
#

The only times llms are useful for sqf is when youre too dumb to do complex math or vector calc πŸ˜„ speaking from experience at least its good (sometimes) for churning that out 🀷

tender inlet
#

anyway, I leave this bottle to the sea, if someone know how to execute code on server (not persistent), when the last user disconnect in a reliable manner, please drop me a message!

mortal folio
#

Why not just check allUsers?

tender inlet
mortal folio
#

Hm... how late is too late?

tender inlet
#

I'll already try the "while loop" and the xxDisconect eventhandler

sharp grotto
#

HandleDisconnect should still trigger on connection loss, at least it did for ExileMod.

#

don't think persistence param only would cause that change?

mortal folio
#

yeah but i think the timing is the issue here, or at least it not happening at the actual connectin loss - disconnect timeout can take up to a minute (depending on server settings i think)

tender inlet
#

something like:
while {true} do { sleep 0.1; _current_uid = count (allPlayers select {!(_x isKindOf "HeadlessClient_F")}); if (_current_uid == 0 ) exitWith { diag_log "--- Mission End ---";

don't work whena player lost his connection, it work (and the EH too), when the player logoff properly

#

the typical rpt for a brutal disconnect look like:
15:47:01 "Civilian vehicle CUP_C_Volha_Blue_TKCIV incident 20 at 1987.42" 15:48:04 Player toto is losing connection 15:48:09 NetServer: cannot find channel #1084154869, users.card=0 15:48:09 Message not sent - error 0, message ID = ffffffff, to 1084154869 (hipley) 15:48:09 Player toto disconnected. 15:48:09 All users disconnected, waiting for users.

I want to catch this moment on server side

#

the EH and the while loop have the same diag_log

#

and you see, nothing happen

mortal folio
#

i mean handledisconnect will eventually trigger; it might not be immediate but does it really matter that the server do stuff precisely at the moment of the last disconnect?

tender inlet
#

nope, I really studied this point, the EH is executed on server only, BUT send by the client

mortal folio
#

oh

tender inlet
#

that all my distress πŸ™‚

radiant lark
tender inlet
#

the log I paste come from real working server with diag_log in these EH

thin fox
#

@tender inlet dedi or hosted by you?

tender inlet
#

dedi

dark viper
mortal folio
#

i mean i can think of at least one jank as hell solution to this but it's neither good practice nor is it very performance friendly

#

(have a callback heartbeat that the server does every few seconds that demands a response from the client which validates its presence)

thin fox
# tender inlet dedi

this is a code line from Liberation, and it works just fine:

    addMissionEventHandler ["HandleDisconnect", {
        if !(allPlayers isEqualTo []) exitWith {false};
        params ["_unit"];
        deleteVehicle _unit;
        ["Last player disconnected. Saving mission data.", "SAVE"] call KPLIB_fnc_log;
        [] call KPLIB_fnc_doSave;
    }];
mortal folio
tender inlet
mortal folio
#

yeah very interesting, i just realized i have to rethink how im gonna fix my function to recover players' loadout and position when they disconnect due to a crash lmao

#

since im also using handledisconnect for that

thin fox
#

xD

#

damn

tender inlet
#

yes, the only way is to not trust EH, use a while loop (and count player) BUT you must have the server persistent

mortal folio
#

why would the event to handle a disconnect even be reliant on the disconnecting client sending it notlikemeow

tender inlet
#

bc in the shutdown time, all scripts are stopped, and you don't have time to do much

sharp grotto
#

just use the persistence parameter, problem solved πŸ€·β€β™‚οΈ

tender inlet
sharp grotto
#

make a freeze manager for the AI

mortal folio
#

yeah idk 🀷 again maybe a connection heartbeat, i guess sending 4 bytes of data over network at frequent intervals isn't the end of the world

tender inlet
#

anyway thanks for the help 🫑

granite sky
#

Nah I'm pretty sure it's supposed to work. If it doesn't then it's a bug.

#

We did have some complaints about the server not detecting HC crashes, but I couldn't replicate that.

tender inlet
#

I put a diag_log in each, and nothing pop when a user lost his co, works otherwise

hushed turtle
granite sky
tender inlet
# granite sky Just tested, both handlers fired here. Used process suspend to simulate client d...

maybe a false positive, I have similar case when I test it.
you must have something like in the server log

15:48:04 Player toto is losing connection 15:48:09 NetServer: cannot find channel #1084154869, users.card=0 15:48:09 Message not sent - error 0, message ID = ffffffff, to 1084154869 (toto) 15:48:09 Player toto disconnected. 15:48:09 All users disconnected, waiting for users.

it seems that after the log of "Player toto is losing connection", the engine is suspended

#

only when it happen EH won't fire

my EH look like

addMissionEventHandler ['HandleDisconnect', { params ["_unit", "_id", "_uid", "_name"]; diag_log format ["--- player %1 (%2) disconnected...", _name, _uid]; if (_name select [0,3] in ["HC1","HC2","HC3"]) exitWith {

granite sky
#

Normally "player XXX is losing connection" is console.log but the netserver/message lines are RPT.

tender inlet
#

yes linux dedi

granite sky
#

hmm, maybe another Linux-specific bug then.

tender inlet
#

we poor linuxian, have only server.log πŸ™‚

granite sky
#

you have stdout and stderr :P

tender inlet
#

hehe, oldies goldies

#

I don't have any windows server, if some one can test, but it need a dedi and a real client failure

#

it's annoying when he's the last user, bc I can't start the save script at time

#

if he loose his co during the session, it's not a trouble, the game save him by itself, but when he's the last...
no EH code execution, scripts force close, even a while loop with a sleep 0.1 is too much

granite sky
#

Suspended client does generate all those messages. The difference here is that it also fires the event handlers.

tender inlet
granite sky
#

hah, I unsuspended it and the client doesn't know that it's disconnected.

#

Surprised it works at all.

tender inlet
#

in such case, the client should display a red warning text "no message from server " and a countdown

granite sky
#

Yeah, that's what it did.

tender inlet
#

if you have the right log in server.rpt, it (somehow) send the EH

#

did you reach the
15:48:09 Player toto disconnected.
message ?

granite sky
#

yeah, console log was:

17:39:57 Player DevJohn2 is losing connection
17:40:02 Player DevJohn2 disconnected.
tender inlet
#

and the EH fire ?

granite sky
#

Everything else is RPT log, and starts at 17:40:02

tender inlet
#

strange, in my setup (linux dedi) when a client lost his connection there is no log in the server log,
the EH is the same for all players, only won't fire in this case

#

the EH have a diag_log at first line

#

what EH did you use ? HandleDisconnect ?

granite sky
#

Both but I did actually screw up and only logged HandleDisconnect not PlayerDisconnected. Rechecking.

tender inlet
#

take care with PlayerDisconnected, it's a mess (look on wiki)

granite sky
#

we were already using it. Just wasn't logged.

tender inlet
#

HandleDisconnect shouldbe the right one, make it satrt wit a diag_log, likle:

addMissionEventHandler ['HandleDisconnect', { params ["_unit", "_id", "_uid", "_name"]; diag_log format ["--- player %1 (%2) disconnected...", _name, _uid]; ....

#

if it's work is a linux server issue

granite sky
#

yeah it's fine:

2026/01/07, 18:22:46 NetServer: cannot find channel #417616, users.card=0
2026/01/07, 18:22:46 Message not sent - error 0, message ID = ffffffff, to 417616 (DevJohn2)
2026/01/07, 18:22:46 2026-01-07 18:22:46:254 | Antistasi | Trace | File: HR_GRG_fnc_removeUser | Removing user: 4
2026/01/07, 18:22:46 2026-01-07 18:22:46:254 | Antistasi | Info | File: fn_initServer.sqf | Client ID 4 disconnected (PlayerDisconnected)
2026/01/07, 18:22:46 2026-01-07 18:22:46:254 | Antistasi | Info | File: A3A_fnc_onHeadlessClientDisconnect | Client ID 4 disconnected (HandleDisconnect)
tender inlet
#

damn!

#

text "2026-01-07 18:22:46:254 | Antistasi | Trace | File: HR_GRG_fnc_removeUser", come from code executed in HandleDisconnect ?

granite sky
#

nah, that one's a PlayerDisconnected. Separate code.

tender inlet
#

ok, I can re test this one, server is not persistent ?

granite sky
#

persistent=1 if that's what you mean.

tender inlet
#

and DevJohn2 was the last player ?

granite sky
#

First and last, yeah.

tender inlet
#

ok, so is persistent, ie: it continue to run whenever there is player or not

granite sky
#

Yes.

#

Persistent=0 might miss the last disconnect, I guess...

tender inlet
#

yes, when it's brutal

granite sky
#

would be degenerate behaviour but within the range for Arma :P

tender inlet
#

haha πŸ™‚

#

right !

granite sky
#

Were you running persistent 0 or 1?

tender inlet
#

0 cause I run CTI, and if I leave it persistent the fight continue

#

and I want to save the game state on last player, and I also want it work when the player lost brutally his co, I'm obstinate πŸ™‚

granite sky
#

I'll recheck with 0, might be interesting.

tender inlet
#

thanks for your time buddy!

#

on my side, I'll re test both EH with minimal code, more diag log, and restart le linux dedi

granite sky
#

Ok, with 0, playerDisconnected fired but handleDisconnect didn't.

tender inlet
#

I choose the wrong ones ?!

#

that's a very good news to me !

#

I'll update the code to use playerDisconnected instead

#

thank you very much

#

I have to go, I'll update the server code, and I'll come back to report ! 😘

old owl
#

Do you guys know what relative paths are supported by fileExists and loadFile or where I could find a list?

#

Ah I am guessing by this comment on loadFile that it's strictly mission path unless file patching is enabled:

Notice that you will have to activate file patching via -filePatching. Otherwise execVM and loadFile will not load any files outside your mission folder (like the global scripts).

proven charm
#

with filepatching you can load files from arma installation folder

granite sky
#

"strictly mission path" isn't really accurate though. You should be able to access anything that's in Arma's virtual file system, like the contents of any PBOs loaded.

hushed turtle
#

You can #include files from outside of misssion folder, but I dunno if you need filePatching for that

low spear
#

He's alive!
And the "crews" are replaced by the true unit, join the player group

warm kestrel
#

So, I'm very stupid. I was curious if it was possible to add an action in the scroll wheel of every player for a mission in a dedicated server, IE putting something in the player's init field that adds an action they can use at any time.

The specific thing that I wanted to do was to have an option that disables their damage for a set period of time before enabling it again, a temporary invincibility that also removes the actions after it ends. Is there a good place to start in terms of commands to look into or something else?

warm hedge
#

addAction

#

To be exact, the condition can have a variable to limit people to use it. Such like, theAbilityIsUsed variable being true forbids player to use it again

low spear
#

I haven't tested it in multiplayer, but I think it should work.

cosmic lichen
#

call <string> doesn't work. Gotta use call compileScript..

modern plank
#

I am looking for something to detect when inventories are invalid somehow.
I have an external tool which parses and modifies mission.sqm files directly, the main modification is the injection of inventories/cargos definitions.
My issue is that I don't manage the size of inventory items/available room into backpack and so on. So imagine the tool injects 25x mags in a vest. In-game, you open the inventory and the vest is full.... but 25x mags are available.
My question is how to detect such issues. It can be some scripts to run on mission to validate them before playing them.
Any idea folks?

hushed turtle
#

Never looked into this, but in theory. In config each cargo should have defined it's capacity and each item it's size

winter rose
#

IDK if it can return > 1, but worth a shot

modern plank
#

Thanks, it can help and spot the loadouts with issues πŸ™‚

hushed turtle
#

also backpackSpaceFor

modern plank
#

load{Backpack|vest|uniform} are what I am looking for I guess.

hushed turtle
#

maxLoad

winter rose
#

all these combined!

hushed turtle
#

Is there any command for item size?

winter rose
#

I don't understand the question?

hushed turtle
#

I guess it doesnt matter

#

load will probably do the job

modern plank
#

Ya, because I just can spot a unit with an offending backpack/vest/uniform, then, I don't need to dig into each item etc.... because in the end I will need a human to analyse the issue, and decide to remove/relocate some item.s

#

It cannot be automated.

finite bone
#

How do I make players immune to specific/scripted explosions but vulnerable to other explosions? Like I want the players to be immune to scripted artillery landing next to them but still vulnerable to other grenades etc. Turning off damage might work but what if on the rare chances that both explodes at the same time during this invulnerability?

finite bone
#

I was thinking about that as well, but unsure what the source or projectile values would be

sly cape
finite bone
#

Yea the projecticle for an artillery could be many kmao

#

should probably do a quick lookup - will try thanks tho

sly cape
finite bone
#

no just the ones i fire with scripts

#

which could be therotically any

#

think of it like a cod cinematic style artillery barrage

sly cape
#

Why wouldn't you know what you're spawning?

finite bone
#

probably because it can be used by other players as well including those with/without any special artillery mods

sly cape
azure mural
#

hey guys, I'm having an issue where remoteExecCall works on a local server (and on remote clients) but not on a dedicated server with no logs to trace what might be happening. The call originates from code executed on the server so it shouldnt be a CfgRemoteExec problem. any ideas on what might be happening?

modern plank
#

Params? please copy/paste the exact script here...

azure mural
#

its a little large, would it be alright to psot the gitlab repo?

modern plank
#

sure, share a link to the exact line

azure mural
#

the function get called from initServer.sqf, is it possible because the mission is loaded prior to the player joining PB_STAGING_VEC is possibly null on the client?

modern plank
#

looks like a JIP issue

azure mural
#

really you think so? the calls on the JIP queue I thought that would fix it

#

unless im misunderstanding how the queue works

modern plank
#

The order of persistent remote execution for JIP players is not guaranteed, i.e. the order in which multiple calls are added is not necessarily the order they will be executed for joining player.

#

Do you count only on the order to get the var content populated?

azure mural
#

I do, that would probably explain it

modern plank
#

ya, you need something more transactional...

#

based on waitUntil { !isNil "myVar" };

#

so you ensure that the client knows your var before using it

#

and put some logs for testing purpose.

azure mural
#

actually now that you mention that, it is wrapped in a waitUntilAndExecute (CBA function) my condition might be busted

#

because its trying to compare nil to 0, the var isnt initted on the client until the action is transmitted

modern plank
#

can't help.

azure mural
#

yeah thats on me I'll test it, thanks for your help though man

modern plank
#

hope you find your way πŸ™‚

#

My trick, when I don't know the status of my VAR, and we have so many at some point, is waitUntil { sleep 1; systemChat 'myVar is nil'; !isNil "myVar" }; right before using it.
I am currently doing it to understand the diff between my local tests and the mission on my dedicated πŸ˜…

azure mural
#

honestly thats a shout, I'm learning the hard way why thats necessary lmao. I wish I could use the native functions but scheduled code has caused me alot of headaches so I'm trying to stay out of it as much as possible lol

errant jasper
#

The order for JIP invocations is as the queue is. But obviously any use of remoteExec with non-commands might be executed out-of-order by the scheduler.

acoustic abyss
#

I am creating a scenario where explosives detectors are used to find items.

Is there a way to place "dummy" explosives that do not go off? Ideally invisible as well.

meager granite
acoustic abyss
#

I am an idoit

#

Training mine set to invisible.

#

How does one disable to "red triangle" detection ?

hallow mortar
acoustic abyss
granite sky
#

It shouldn't matter when you use it. After you run the command, they'll all stop rendering.

hallow mortar
#

Keep in mind that command is for the map markers, not the 3D markers

#

Most difficulty options can't be changed through scripting, and only Tactical Ping can be changed through description.ext

acoustic abyss
#

It doesn't seem to set invisible markers of mines that I myself have detected. Which seems realistic.

azure portal
#

So...anyone know why Arma 3 has a function for translating numbers into roman numerals?

cosmic lichen
#

Yes, to translate numbers

proven charm
#

is it possible to get some sort of type of objects that dont have typeof string? i was thinking of maybe using the .p3d name but that needs to be parsed from string

cosmic lichen
#

P3d is probably the best way.

proven charm
#

ok is the object id always same length? like 385642: limestone_01_02_lc_f.p3d i mean that number

#

so i can just use select

cosmic lichen
#

I don't think so

proven charm
#

hmm

cosmic lichen
#

Just splitString ":."

#

And trim

proven charm
#

ok thx

#

maybe ```
string find ":"

mortal folio
#

Does targetsQuery work reliably for players?

#

I wanna capture some data one of which being which enemies players saw etc...

#

But running checkvisibility against each player against each enemy is expensive

#

well the examples which i just noticed use player so i'll assume yes πŸ˜‚

proven charm
stark spade
#

How can I make an object invisible (like an invisible wall) that ai and the player cannot go through

cosmic lichen
little raptor
stark spade
#

damn

#

thanks man

proven charm
#

it seems my code is little bit faster

mortal folio
#

friendly reminder to occassionaly back up your profile .vars file

#

mine got wiped after testing some random mods suffer

#

(not even sure how that happens but oh well)

broken forge
#

could someone explain why the commented out line of code within NewDog returns objNull for the Vehicle?

DogClass = compileFinal createHashMapObject [[
    // Properties
    ["#type", "Dog"],
    ["owner", objNull],
    ["legs", 4],
    ["health", 100],
    ["vehicleClass", "Alsatian_Sandblack_F"],
    ["vehicle", objNull],
    
    // Constructor
    ["#create", {
        params [["_owner", objNull], ["_vehicle", objNull]];
        
        hint format ["Owner: %1, Vehicle: %2", _owner, _vehicle];

        if ([_owner, _vehicle] findIf { isNull _x } != -1) exitWith {};

        _self set ["owner", _owner];
        _self set ["vehicle", _vehicle];
    }]
]];

NewDog = createHashMapObject [
    [["#base", DogClass]],
    // [player, createVehicle [(DogClass get "vehicleClass"), [0,0,0], [], 0, "NONE"]]
    [player, createVehicle ["Alsatian_Sandblack_F", [0,0,0], [], 0, "NONE"]]
];
cosmic lichen
#

You are not setting the vehicle class in the constructor maybe?

#

Not sure if that is required. Haven't used these yet

broken forge
#

I figured it out, it was still using a non-existing class due to the hashMapObject being in-memory. It was still using Base_Dog_F instead of an actual Arma 3 dog class.

silent cargo
#

15 setFog 0.5;

#

Is the time delay in seconds or minutes

#

It says seconds on the wiki but for some reason its taking much longer than a few seconds for it to change

cosmic lichen
#

Seconds

golden mirage
#

can you change side of units during runtime?

#

i.e when I spawn a group thats config'd as blufor, can i turn them into opfor and how would i do that?

fair drum
golden mirage
#

doing that

fair drum
#

well post what you had

golden mirage
#

kk 1 moment

golden mirage
# fair drum you create a new group with `createGroup` using a different side as a param, the...

 // Infantry - try group configs first, fallback to East_Units
    case (_groupType isEqualTo "infantry"): {
        // Try group configs if available and valid
        if (_groupCfg isEqualType [] && {count _groupCfg > 0}) then {
            private _selectedCfg = selectRandom _groupCfg;
            if (isClass _selectedCfg) then {
                _realGroup = [_position, _side, _selectedCfg] call BIS_fnc_spawnGroup;
            };
        };

        // Fallback to East_Units if no group spawned
        if (isNull _realGroup || {count units _realGroup == 0}) then {
            if (!isNull _realGroup) then { deleteGroup _realGroup; };

            _realGroup = createGroup [_side, true];
            private _tempGroup = createGroup [_side, true];
            private _spawnCount = if (_unitCount > 0) then { _unitCount } else { 6 };

            for "_i" from 1 to _spawnCount do {
                private _unitType = selectRandom East_Units;
                private _spawnPos = [_position, 5, 20, 1, 0, 0.5, 0] call BIS_fnc_findSafePos;
                _tempGroup createUnit [_unitType, _spawnPos, [], 0, "NONE"];
            };

            { [_x] joinSilent _realGroup; } forEach units _tempGroup;
            deleteGroup _tempGroup;
        };
    };```
#

and this is what i had for


// Vehicle groups
    case (_groupType in ["motorized", "mechanized", "armor"]): {
        _realGroup = createGroup [_side, true];

        for "_i" from 1 to _unitCount do {
            private _vehicleType = "";

            // Select appropriate vehicle type
            switch (_groupType) do {
                case "motorized": { _vehicleType = selectRandom East_Ground_Vehicles_Light; };
                case "mechanized": { _vehicleType = selectRandom East_Ground_Vehicles_Light; };
                case "armor": { _vehicleType = selectRandom East_Ground_Vehicles_Heavy; };
                default { _vehicleType = selectRandom East_Ground_Vehicles_Light; };
            };

            // Find safe position for vehicle with larger radius and vehicle-appropriate spacing
            private _minDist = 10 + (20 * _i);
            private _spawnPos = [_position, _minDist, 150, 10, 0, 0.2, 0] call BIS_fnc_findSafePos;

            // Fallback if BIS_fnc_findSafePos returns the center position (failure)
            if (_spawnPos distance2D _position > 200) then {
                _spawnPos = _position getPos [_minDist, random 360];
                _spawnPos set [2, 0];
            };

            // Create vehicle and crew
            private _veh = [_spawnPos, random 360, _vehicleType, _side] call BIS_fnc_spawnVehicle;
            private _vehicle = _veh select 0;
            private _crew = _veh select 1;
            private _vehGroup = _veh select 2;

            // Ensure vehicle is grounded properly
            _vehicle setPos [getPos _vehicle select 0, getPos _vehicle select 1, 0];
            _vehicle setVectorUp [0,0,1];

            // Transfer crew to our group and delete empty group
            {
                [_x] joinSilent _realGroup;
            } forEach units _vehGroup;
            deleteGroup _vehGroup;
        };
    };```
#

vics

#

:P

fair drum
#

have you done any debug logging yet?

golden mirage
#

4 wut

#

ohh yeah i have i misread your sentence

#

ill retried doing the joinSilent etc and see if i can recreate it again tb

fair drum
#

and do you have the full error message? is it a script error message? or one of those pop up boxes for config errors?

golden mirage
#

no its an engine error for object not found (type 112 message) but i will try to replicate it rq

granite sky
#

Object not found messages are not necessarily a problem.

golden mirage
granite sky
#

Only the devs know.

golden mirage
#

@ dedman

#

xd

granite sky
#

Note that when you remove all of a group's units with join commands, it's supposed to delete the group anyway.

#

even if it's not flagged to delete when empty.

#

So it's possible that your deleteGroup is just referencing a group that's already deleted.

#

Likely harmless but the sort of thing that the engine might bitch about.

golden mirage
#

idk why

#

bleh just people will have to pick real opfor factions

granite sky
#

It works. What doesn't work is creating the units within a group of a different side.

#

If you do that they all shoot each other.

golden mirage
golden mirage
#

fixed

gritty kayak
split ruin
#

maybe some dumb question but ... can I spawn (BIS_fnc_spawnVehicle) enemy UAVs as vehicles? I mean with AI already in them?

marble plume
#

Hi folks, I'm looking for two very specific things and unable to find them as of yet. For context, this is for a sci-fi unit and I'm trying to turn our "ship" (currently just a composition we hide at the corner of a map) into an actual, physical object. All of the building is fine, but I run into two problems.

  1. Free-fall animation + sound
    Obviously, at a certain height you go into the freefall animation and it actually generates a sound from your character. How can I disable this?

  2. High-altitude wind sound
    There is an ambient wind sound when you're at high altitude. I'd be having to place the ship somewhere between 3-5km into the air, and in current testing the wind sound is super irritating and can make briefings and even general chatter difficult to follow. Is there a way I can disable this specific sound, or perhaps a script I can put on a trigger at the spawn location to disable ambient noise, then attach another at the exit point of the ship to re-enable it?

split ruin
#

@marble plume just drop this in initPlayerLocal.sqf

sleep 0.1;
enableEnvironment [true, true, 0.5];

last number is the wind sounds force in high altitude like mountains
1 = max, 0 = no sound

#

does anyone knows how to integrate AWS weapons system to a helicopter?
is it possible from mission config?
https://docs.google.com/document/d/1Jb8sj8uX4f-vQSKJlr55ckJq6AQ6ZM3LZLe9w4ACM40/edit?tab=t.0

chrome iron
#

Can someone provide a ready-made or corrected description.ext for a campaign?
Because for some reason, in this description.ext, the paths to the images do not work correctly.
description.ext:
`class Campaign
{
// Campaign parameters
name = "Dark night"; // For older Arma versions
briefingName = "Dark night"; // For Arma 3 UI
firstBattle = Missions;
enableHub = 1;
overviewPicture = "YearSP\imj\Night.jpg";
overviewText = "Crash site";
cutscene = "";

class MissionDefault
{
    lives = -1;
    lost = "";
    end1 = "";
};    

class Missions
{
    name = "The survivor in the middle of the forest";
    firstMission = M1O;
    end1 = "";
    lost = "";

    class M1O: MissionDefault
    {
        loadScreen = "YearSP\imj\M1.jpg";
        overviewPicture = "YearSP\imj\M1.jpg";
        template = M1O.Altis; 
        end1 = M2Op;
        lost = M1O;
    };

    class M2Op: MissionDefault
    {
        loadScreen = "YearSP\imj\M2.jpg";
        overviewPicture = "YearSP\imj\M2.jpg";
        template = M2Op.Altis; 
        end1 = M3O;
        lost = M2Op;
    };

    class M3O: MissionDefault
    {
        loadScreen = "YearSP\imj\M3.jpg";
        overviewPicture = "YearSP\imj\M3.jpg";
        template = M3O.Altis; 
        end1 = ""; 
        lost = M3O;
    };
};

};`
Folder paths:
@YearSP\Addons\YearSP.pbo ==> campaign, imj, config.cpp\campaign == >Missions, description.ext
if need i can send config.cpp
Thanks!

proven charm
#

you dont have folder at @YearSP\Addons ?

thin fox
#

!sqf

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓ turns into ↓

// your code here
hint "good!";
proven charm
#

i could be wrong but i use @AddonName\addons\folderName

#

so then i can just do \folderName\image.jpg

chrome iron
proven charm
#

ok try with \ "\YearSP\imj\M3.jpg"

winter rose
chrome iron
# winter rose shouldn't it be the following, according to https://community.bistudio.com/wiki/...

What exactly do you mean by CfgSounds? It shouldn't be there, because this is a general description for all missions, responsible for displaying pictures and text. @YearSP is the root folder, which contains the Addons folder, which then contains the YearSP folder with imj, campaign, and config.cpp inside. Or maybe I just misunderstood you.
You mean do like this: @YearSP \ Addons \ YearSP \ imj \ M3.jpg?

little raptor
#

in debug console type addonFiles "YearSP\"

proven charm
winter rose
#

addonFiles ["YearSP\", ".jpg"] then

little raptor
#

yeah I forgot the syntax

winter rose
#

how dare you

chrome iron
# little raptor did you set the addon prefix correctly?

Debug console: yearsp\imj\m1.jpg","yearsp\campaign\missions\m2op.altis\m2.jpg","yearsp\campaign\missions\m3o.altis\m2.jpg","yearsp\campaign\missions\m1o.altis\m1.jpg","yearsp\imj\m2.jpg","yearsp\campaign\missions\m3o.altis\m3.jpg","yearsp\imj\night.jpg","yearsp\imj\m3.jpg"]
Is it correct use lowercase yearsp\imj\m3.jpg?

marble plume
chrome iron
little raptor
#

try it with @ too like Lou said

#

if it still doesn't work, try using paa instead of jpg

chrome iron
#

@YearSP \ Addons \ YearSP \ imj \ M3.jpg? or just @YearSP \ imj \ M3.jpg?

little raptor
#

the latter

proven charm
#

and are the images inside the .pbo?

chrome iron
#

yes

chrome iron
# proven charm and are the images inside the .pbo?

@YearSP
└── Addons
└── YearSP.pbo
β”œβ”€β”€ config.cpp
β”œβ”€β”€ imj
β”‚ └── Night.jpg
β”‚ └── M1.jpg
β”‚ └── M2.jpg
β”‚ └── M3.jpg
└── campaign
β”œβ”€β”€ description.ext
└── Missions
β”œβ”€β”€ M1O.Altis
β”œβ”€β”€ M2Op.Altis
└── M3O.Altis
Just

chrome iron
#

There might be an error because my M1-M3 images are 1280 x 800, while 'Night' is the only campaign image that is 1920 x 1080 which I see? Maybe better 1024x1024

proven charm
#

the sizes have to be power of two

unborn prism
#

How do I set up Apex style subtitles for AI?

#

They don't have to play audio, I just want the text

hallow mortar
chrome iron
proven charm
#

didnt find arma wiki link but thats what you need

split ruin
#

@marble plume no need for this, it will be executed for every player and they will not hear wind hauling on the mountains altitude, Zeuses included

unborn prism
#

Having it stay in there triggers an error

#

Also, this is in a Multiplayer session, will this display for everyone? Or just people near the trigger?

hallow mortar
hallow mortar
unborn prism
#

Right

hallow mortar
#

Which machines execute the code depends on how your trigger is set up.
If it's set to Server Only, then naturally only the server will execute the code.
Otherwise, any machine where the trigger conditions are satisfied will execute the code. Triggers exist simultaneously on all machines, and each machine's local copy of the trigger will evaluate and execute independently. So, which machines will have their copy of the trigger activate, depends on what the condition is.

split ruin
#

anyone knows how to integrate FIRs AWS with Mi-48? I want to use the Russian weapons for this beast 😭

proven charm
#

isnt that config question?

split ruin
#

this is my question actually ... any way to integrate AWS with vanilla without modding config?

split ruin
#

I kinda solved the issue with GOM Loadout script ... but player will be in total chaos about pylons positions
does anyone have better pylon loadout script with better visualisation by chance ?

pallid palm
#

@split ruin can you just put more planes in and edit the pylon loadouts in the editor

sly cape
pallid palm
#

i see

silent cargo
molten yacht
#

In another language I'd go ( if CLASSNAME in ARRAY_OF_CLASSES then DO X). How is this done in a3 SQF?

if (X IN Y) then { doThing };```

Or can you actually just do `in`?
#

I'm trying to ask the engine if a damage source is in my list of explosives.

dusk gust
hallow mortar
#

Keep in mind that in is case-sensitive when comparing strings

molten yacht
#

Cool. Easy way to check for allowed demo charges on this script.

warm hedge
#

Is there any get3DENConnections equivalent that is useable in-game (in Preview I mean, not in Eden workspace)? In this context, it has to be reliable unlike synchronizedObjects which cannot be used on some certain simulations/non-AI vehicles

meager granite
#

Aren't these connections just for the editor and don't exist past mission start?

#

I think I remember wanting this too

warm hedge
#

Nope. That's the question

#

If there never is a way to find sync states in game, what's even the point of this system?

#

From what I can see it seems they ever wanted us to expand connections system (Cfg3DEN >> Connections), but we have zero commands to check the status of the connections, if I miss something obvious?

#

But Sa-Matra saying no seems to be the most reliable answer ever, thanks

meager granite
#

I'm not sure myself to be honest, I just recall wondering the same question

warm hedge
#

This must be the biggest bummer in Eden

warm hedge
cosmic lichen
#

Good luck getting this to work. It never really did for me.

#

There are also issues with grouping units via scripting.

stuck wave
#

Hello guys. I am just trying out arma3 scripts and I was wondering if there is any way I can move a tanks turrent by giving it some location? Like for example a direction in NE and an elevation angle for the turret. I have manged to move the turret using doWatch and doTarget commands but that way the soldier inside the tank is looking at a position in the map (which is what I don't want)

hushed turtle
#

You could technically use logic object, since it's invisible

#

But I dunno If it's possible to turn turret any other way

warm hedge
#

lockCameraTo

stuck wave
warm hedge
#

It literally does rotate the given turret

stuck wave
stuck wave
tough abyss
#

Not sure if I should be asking this here, but how do I make like premade loadouts for the faction I'm making to pick randomly when spawning in a unit

hushed turtle
#

You can copy loadouts in arsenal by pressing Ctrl+C

tough abyss
hushed turtle
#

Execute the code?

tough abyss
hushed turtle
#

Easiest is to save it inside of mission folder and call by execVM, but that's not recommended for performance

proven charm
#

is there a way to prevent this from happening when creation composition on uneven terrain?

sharp grotto
proven charm
#

i mean the chair.. and the guy

sharp grotto
#

disable simulation of the chair, attach guy to chair

proven charm
#

tryed those πŸ™‚

#

the guy is attached to the chair

sharp grotto
#

disable damage of the chair?

proven charm
#

tried attaching chair to house

sharp grotto
#

it shouldn't be able to fall down

proven charm
#

well ill keep testing , hopefully its something in my code that i can fix. thx

hushed turtle
#

If building and chair were both higher than terrain. Would it still result in chair ending up flipped?

proven charm
#

nope

proven charm
#

i think the attachTo works, i just had typo in my testing code earlier. need to do more tests

little raptor
proven charm
#

so i wouldn't know

azure mural
#

hi guys, does anyone have some good practices for synchronizing score across clients on a linux dedi? I'm using the built in scoring system and I havent been able to find much good documentation on how it works on the back end

hallow mortar
#

Well, addScore and addScoreSide are Server Only, Global Argument, Global Effect commands. So you must execute them on the server, and the server will automatically handle synchronisation.

#

There is no difference in script commands between Linux and Windows servers.

azure mural
#

interesting thats not what I'm seeing on my end, on a locally hosted server the score is synched as advertised but when testing on the linux dedi the clients dont appear to get that message as the score remains 0

hybrid sandal
#

is there a way to draw lines on map using sqf? I tried drawLine but can't get it working

hallow mortar
#

drawLine is one way, but it's a per-frame command, not a persistent line. It must be used in a per-frame event handler, like the Draw control EH on the map control shown in the example on the wiki.

#

For a set-and-done persistent line, you can use the polyline marker shape (setMarkerShape, setMarkerPolyline)

hybrid sandal
#

thank you that's exactly what I was looking for!

gritty kayak
#

hey guys just a question. for some reason the marker doesn't show up in first persom when you look into the direction but is there when you open the map.

[
player,
"boardHeliTask",
[
"Get everyone inside the infiltration helicopter.",
"Board the Helicopter",
"getin"
],
infilHeli,
"ASSIGNED",
1,
true
] call BIS_fnc_taskCreate;

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓ turns into ↓

// your code here
hint "good!";
gritty kayak
#

it has something to do with distance. when the player spots the object the marker does appear and does stay but i want it to apper even before

#

i figured it out I had to replace infilheli with [infilHeli, true], which bypasses the discovery check

little raptor
granite sky
gritty kayak
#

what would a good script be to tell a vehicle to stay on position after it lands with unitcapture?

#

I've tried this but it doesn't work. hydra 1 is the pilot of a helicopter in this case

hydra1 setBehaviour "CARELESS";
hydra1 disableAI "MOVE";
sly cape
gritty kayak
granite sky
#

A slightly less brutal approach for helis is to give them a land command before running the unit capture or setVelocityTransformation. Seems to stop them wobbling around after the forcing is removed, I guess because it makes them cut the collective earlier.

#

You need the land command for helis with landing gear anyway.

pallid palm
#

hell yeah Arma 3 Woohoo πŸ™‚

#

i started training my friend to build missions in Arma 3 it may take like 3 years πŸ™‚

proven charm
little raptor
#

the terrain causes them to flip over
why would it? iirc chairs don't have physics

proven charm
#

idk theres table and laptop too which fly around sometimes

little raptor
#

check its simulation in config. if it says "somethingX" it's physx otherwise it has no physics and shouldn't move

proven charm
#

ok thx

#

the chair is "thingX"

fleet sand
proven charm
#

that im doing πŸ™‚

fleet sand
proven charm
#

it seems to work but i havent done enough tests yet

proven charm
#

everything seems to work now. except when i tested first time no furniture was created . i have no idea how that happened

shadow sentinel
#

Hi all - I'm trying to make AI land vehicles reverse - possible or no?

winter rose
hallow mortar
#

There is sendSimpleCommand but it has several limitations

restive leaf
#

Put a wreck model in front of them, they will drive into it, then reverse back a few feet and then repeat that until you get bored looking at them πŸ˜‰

shadow sentinel
#

Haha, I've managed a janky solution with this:

group myTank addWaypoint [(getPos myTank) vectorAdd ((vectorDir myTank) vectorMultiply 50), 0];
sleep 5;
myTankG forceWeaponFire ["cannon_120mm", "close"];
sleep 5;
private _startPos = getPos myTank;
private _revDir = vectorDir myTank vectorMultiply -5; // backward

// keep moving until ~50m backward
while { (_startPos distance getPos myTank) < 50 } do {
myTank setVelocity _revDir;
sleep 0.05;
};
myTank setVelocity [0,0,0]; // stop

Trying to set up a demonstration of a tank engaging a target and "jockeying" back into cover. However this method does not provide a smooth / natural looking reverse and the tracks / road wheels do not animate with this method of reversing.

willow hound
#

Maybe, but you'll have to try if you can get it working for your use case.

shadow sentinel
#

Ack - many thanks. I'll try again tomorrow when I'm back at my computer.

willow hound
granite sky
#

well, there's also setVelocity.

#

But sendSimpleCommand is the only way to make the AI do it.

#

Oh, that's what he used in the first place. Surprised setVelocity doesn't make the wheels animate tbh.

drowsy geyser
thin fox
#

never saw this command lmao

granite sky
#

Main use is for towing, but yeah, might help here.

shadow sentinel
#

Thanks guys - will test all permutations. Simple command might be preferred as I want a natural looking move as much as possible (acceleration/deceleration etc).

agile pumice
#

Is it possible for a script error to cause a server to not fully start?

#

The server just hangs at loading core configs

still forum
#

That is a thing that was sometimes done in Arma 2 times by scripters who didn't know how to read variables by name.
They knew how to read variables in normal script, so they just went to assemble script and compile and call it.

A bad hack solving a problem in a bad way, no-one should be doing this anymore.
Plus your example will also fail if the players name has a space inside it, or any other non allowed character.

#

Depends on what you mean.
In general, no.
For rendering text into UI, yes.

winter rose
still forum
#

Scheduled throws an error when reading a variable that is nil. You have no variable here.
The error message is coming from the get variable instruction. There isn't one anywhere else.

#

in A3 when a script is done it implicitly ends with nil
After every statement (ends with ;) there should be a nil left behind.
Except when you have a variable assignment.

which is how the script knows when to end.
Uh no, the script knows when to end, by seeing if it reached the end

#

Guess it depends on your definition of what a "silent fail" is.
alive command specifically checks, and returns false if the object is null. There isn't really any "fail" there thats just by design

#

distance, distance2D and distanceSqr.

If either of the objects is null, it returns 1e10.
If either of the Position arrays fail to parse, it sets script error but also returns 1e10.
Have fun documenting πŸ˜„

agile pumice
#

The last thing being written to rpt is 3:19:25 SteamAPI initialization failed. Steam features wont's be accessible!

still forum
#

despite appearing to be a value
Then you're just missinterpreting what you're seeing.
"nil"'s have a type.
That is a nil of type string.

I don't quite know why that was done either, that goes back very far.

When you pass nil to a command. The command is never executed.
It aborts before executing because nil argument is always invalid.
And it puts a typed nil, with the commands return type, back onto the stack.

The most common type of a "nil" is any, which is what you see when you print out the result of the nil command.

still forum
#

const int CHUNK_SIZE = 9000; // Leave safety margin for Arma 10KB limit
There is no limit if you return data using extension callback. But that would be a bit harder to use as the return would not be instant but instead come via a deferred eventhandler.

Also why does a simple extension for reading/writing files for a mod, have so much stuff in there?
You are doing alot of cheat/malicious code like things, which BattlEye will dislike. That has nothing to do with the mod being "safe to use" for users.
You run the risk of causing a mass BattlEye ban on all the users of your mod...

Your code is also actively performance harmful because its intentionally doing random-length sleeps for which I can't see any purpose.

If you just want a key/value store. Instead of letting people write arbitrary files on disk, just use a SQLite database?
If you need text files. Then.. instead of all your checks for extensions and path traversal and shit. How about you just block /\. characters in the filename, and enforce a .txt extension at the end?
You can do that in like two lines of code, instead of all the complex and probably still unsafe (because its so complex its hard to make sure you got "everything") checks.

Your super complex 900 lines of code, could literally be 30 lines while also being much safer, and as bonus, not getting your users perm banned for cheating.

#

"not working" is a very broad spectrum, not possible without being able to tell what exactly is not working in what way..

#

parsingNamespace also persists between missions

#

Extensions only apply if it is NOT a web source. Which http/https is.
Why are you trying to mess with Wildcards, just put the full URL in there?
Your += makes no sense there. That is to append values, you are not appending. The array doesn't exist before you define it, there is nothing to append anything to.

old owl
# still forum "not working" is a _very_ broad spectrum, not possible without being able to tel...

Wow, cheers thank you for all the info today. Had no idea about that with nil. Very interesting and makes sense the way you put it- that the most common is any but that others exist as well and explains why I got those results.

Later I'll troubleshoot and see more specifically what isn't working with CT_WEBBROWSER. Something maybe a little better than "it no worky on stable" haha πŸ˜„

still forum
#

Your problem is the http?://
The ? is a wildcard, for, "there can be any character here" but.. "No character" isn't "Any character". A ? wildcard MUST have ONE character.
There must be a character after the http. But you have none. It simply doesn't match the pattern.
You probably want "(http|https)://*.domain.de/*" instead.

#

no

#

Read #rules, next time I'll hand you a written warning

golden mirage
#

huh

still forum
#

Yes it got patched.
Use connectToServer script command.

still forum
still forum
#

(Which fire right after that disconnected console message)

tender inlet
#

thank you for the info, it's hard to find reliable document on some EH behavior.
btw, we do some test with @granite sky (thanks to him), and notice that the HandleDisconnect EH is not called on server when (persistent is off, and the client lost brutally his connexion)

still forum
still forum
tender inlet
#

it's a CTI mission, if I lets the persistence on, the game continue without player

tender inlet
still forum
#

Note HandleDisconnect works much different than the others, it works on Entity owner change
If you want player disconnect, I'd expect you'd use the PlayerDisconnect eventhandler.

still forum
tender inlet
#

thanks, if fact I use PlayerDisconnected, HandleDisconnect and MPEnded, when the client CTD or have network issue, there is the log on server
15:47:01 "Civilian vehicle CUP_C_Volha_Blue_TKCIV incident 20 at 1987.42" 15:48:04 Player toto is losing connection 15:48:09 NetServer: cannot find channel #1084154869, users.card=0 15:48:09 Message not sent - error 0, message ID = ffffffff, to 1084154869 (toto) 15:48:09 Player toto disconnected. 15:48:09 All users disconnected, waiting for users.

even if all my EH begin with a diag_log

still forum
#

The Wiki might need some updating.
"Triggered when player disconnects from the game." is imprecise.
Better "Triggered when a players controlled unit changes ownership due to the owning player being disconnected"

Which then might make you think, that if the unit is deleted, it wouldn't fire.

tender inlet
#

you're right

still forum
#

Also the Similar to onPlayerDisconnected event but can be stacked is a bit pointless.
There is a OnPlayerDisconnected event that can be stacked.

still forum
tender inlet
still forum
tender inlet
still forum
# tender inlet yep, the test we made, show "PlayerDisconnect " EH is the right one to call, but...

You can have the unit if you need to. But you need to store it somewhere before.

OnUserDisconnected gives you the playerid.
PlayerDisconnected does too.
You just need to store somewhere, the playerid's unit, before the player connects.
Then you can just look up by the playerid, what unit they had.

https://community.bistudio.com/wiki/getUserInfo also gets you the player object.
It looks like the info is deleted only after the EH's are fired, so that should still have it

tender inlet
#

"Then you can just look up by the playerid, what unit they had." it is not too late ? there is still an player object accessible by the server ?
I thought only "HandleDisconnect" can allow me to save, for exemple, the unit loadout

still forum
#

I expect the owner reassignment to happen after the player is disconnected

#

PlayerDisconnected should fire before HandleDisconnect

#

And if the unit is still present for HandleDisconnect, then it definitely is before that too

tender inlet
#

I store new player uid through PlayerConnected,
so I usually reference user by uid, but in some case (loadout) I need to access to the player object

and when I search for all unit / or getunitbyuid, when HandleDisconnect fire, I found no object available

still forum
#

Because HandleDisconnect fires after the disconnect happened and the player is gone

#

The other EH's fire AT the disconnection, not after it

tender inlet
#

ok, make sense now

#

I test your suggestion of persistent server with custom end of game management. (should save me from critical timing when the server shutdown)

tender inlet
winter rose
still forum
#

If the player has no unit, no

winter rose
#

oookido, worth noting the difference indeed

winter rose
still forum
#

Yes but also

#

instead of onPlayerDisconnected, link to OnPlayerDisconnected mission EH.
And remove "can be stacked and"

Maybe also note that HandleDisconnect fires AFTER the player is disconnected.
So the player will already be gone from player lists and getUserInfo command

winter rose
proven charm
shadow sentinel
# granite sky But sendSimpleCommand is the only way to make the *AI* do it.

This was working for a time but now seems to be unresponsive on a tank+crew placed editor-side.

Script as follows:
commander myTank doTarget targetObj;
commander myTank doWatch targetObj;
gunner myTank doTarget targetObj;
gunner myTank doWatch targetObj;

// FORWARD 50m
private _startPos = getPos myTank;

while { (_startPos distance getPos myTank) < 50 } do {
myTank sendSimpleCommand "FORWARD";
sleep 0.01;
};

// brief brake pulse
for "_i" from 1 to 10 do {
myTank sendSimpleCommand "STOP";
sleep 0.01;
};

// WAIT UNTIL STOPPED
waitUntil { abs speed myTank < 0.5 };
sleep 1;

// FIRE
gunner myTank forceWeaponFire ["cannon_120mm", "close"];
sleep 2;

// BACK 50m
_startPos = getPos myTank;

while { (_startPos distance getPos myTank) < 50 } do {
myTank sendSimpleCommand "BACK";
sleep 0.01;
};

// brief brake pulse
for "_i" from 1 to 10 do {
myTank sendSimpleCommand "STOP";
sleep 0.01;
};

cursorObject sendSimpleCommand works when executed in debug console - on any vehicles+crew OTHER THAN myTank.
The key variable seems to be the Eden-placed crew - if I replace them with a dynamically spawned crew via Zeus, the above script works.

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓ turns into ↓

// your code here
hint "good!";
hallow mortar
# shadow sentinel This was working for a time but now seems to be unresponsive on a tank+crew plac...

Possible locality issue.
Editor-placed AI are typically local to the server unless something happens to move them. Zeus-placed AI are typically local to the Zeus's machine unless something happens to move them.

sendSimpleCommand doesn't have locality information listed, but many AI commands are Local Argument (must be executed where the target is local). When you use the debug console you're probably clicking Local Exec, which executes the code only on your machine.

granite sky
golden knot
sleek forum
#

Is it possible to trigger a trigger?
I am asking this because of a composition. It's more a script than a trigger, but in the editor, it shows up as a trigger. It's called Blackout Script

#

I want the blackout to happen when I walk into a certain area

sleek forum
sly cape
sleek forum
#

They do, yes

#

But I tried syncing one trigger with the composition and absolutely did not work

#

Might need a script in the activation field, maybe?

sly cape
sleek forum
#

Yes

#

It is called Blackout Script

#

In steam workshop

sly cape
sleek forum
#

Shows up as a trigger

vagrant cedar
#

though I would like to know how to get this down to 30 lines of code

errant jasper
#

Using raw SQL instead could probably do that in 30 lines: sending [SQL_STATEMENT, OPTIONAL_LIST_OF_LIST_BIND_PARAMS] to the extension and receiving a list of rows back.

#

Sending something like:

["SELECT playerUID, grenadeType, grenadeCount FROM inventory WHERE playerUID=? AND insuranceData >= ?",
  [
    [431232434, "2025-15-01"],
    [343434342, "2025-15-01"]
  ]
]

And receiving back in sqf:

[
   [431232434, "M69", 2],
   [431232434, "F1", 1],
   [343434342, "F1", 2]
]
wanton fiber
#

Possibly silly question, but im trying to get a AI to be interactable via the scroll wheel hold action, so that someone walks up tot eh AI holds space bar for 3 seconds then it pops up a small message on the screen in blue from the named AI, i thought i had a script that did this in Multiplayer but after testing it dosent work. Any help would be possible ( note for some reason it works in singleplayer but not on a dedicated Multiplayer server)

Bellow is the Script that works in Singleplayer

 this,               
 "Speak to Wg Cdr. M. Connor",            
 "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_Search_ca.paa",  "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_hack_ca.paa",     
"_this distance _target < 3",         
"_caller distance _target < 3",      
 {},                 
 {},                
 { call{cutText ["<t color='#00bfff'size='1.4'>Wg Cdr. M. Connor: </t> <t size='1.4'>Hey, *Insert screaming Child* God dam it Lenny, Sorry gotta go deal with the Child<<br/></t>", "PLAIN DOWN", -1, true, true];} },        
 {},                
 [],                 
 4,                 
 0,                
 true,               
 false                 
] remoteExec ["BIS_fnc_holdActionAdd", 0, this];}```
#

i have tried changing the following line remoteExec ["BIS_fnc_holdActionAdd", 0, this];} to be remoteExec ["BIS_fnc_holdActionAdd", 2, this]; in a hope it would work but it didnt work in either single or multiplayer

granite sky
#

I'm guessing the problem is that you're running other mods on the server and one of those is overriding the JIP ID.

#

0 is the correct target anyway. holdActionAdd needs to run everywhere (at least, everywhere with a UI)

wanton fiber
#

Hm i shall see if any mods are causing problems

granite sky
#

for testing you could try using a unique JIP ID.

radiant lark
#

Is there any way to make glassy UI like this? I guess PIP texture?

little raptor
#

if you don't care about the blur effects you can just change the alpha of pretty much all UI controls to make things transparent

#

in your image it seems to be also applying a negative color effect
no it's just some parts

radiant lark
radiant lark
little raptor
#

imo browser control is the best way to do that

radiant lark
little raptor
#

yes and you can do that with the browser control to make fancy UIs

radiant lark
#

Hopefully it wont eat much performance

#

When will browser control be on stable branch?

little raptor
#

I thought it already is think_turtle

radiant lark
#

BIKI doesnt say so

#

Ty Leopard!

fleet sand
#

@still forum sry for the ping. Dont you have a git repository on how to setup UI with HTML i believe i saw it somewhere.

still forum
radiant lark
#

As soon as I saw chromium I got a little scared

#

(RAM Prices are up for a reason)

#

But I know this one chromium wont harm performance that much riiiightttt?

#

By the way, wiki not updated regarding the introduction of browser control to stable branch

still forum
# vagrant cedar though I would like to know how to get this down to 30 lines of code

30 lines of code was referencing doing it in C++ with reading/writing text files, not rust with databases.

import std;
using namespace std::string_view_literals;
#include "RVExtensionUtil.hpp"

int CALL_CONVENTION RVExtensionArgs(char *output, unsigned int outputSize, const char *function, const char **argv, unsigned int argc)
{
    if (argc != 3)
        return 1;

    std::string fileName(argv[1]);
    std::transform(fileName.begin(), fileName.end(), fileName.begin(), [](const char x) {if ("\\/."sv.contains(x)) return '_'; return x; }); // Sanitize filename
    if (fileName.empty() || fileName.length() > 64) // Too long filenames might fail to create, so just cap it
        return 2;

    if (argv[0] == "write"sv)
    {
        auto len = strlen(argv[2]);
        if (len > outputSize - 2) // Make sure we can read it back and the file is not too large
            return 3;
        std::ofstream outFile(fileName + ".txt");
        outFile.write(argv[2], len);
    }
    else if (argv[0] == "read"sv)
    {
        std::ifstream inFile(fileName + ".txt");
        inFile.read(output, outputSize-2);
        output[inFile.gcount()] = 0;
    }

    return 0;
}

Here 31 lines. Could be 22 with some uglier formatting
Missing feature is that the disk can be filled with junk files. (Which your code didn't have either)

That needs one extra line for creating a subfolder to put everything in.
And about 5 lines to count number of files already present in folder, and block creating a new file if too many.

Also note your 9000 chunksize limit. Arma's limit is currently 20KiB, not 10KB.
Also Arma's limit might change and you cannot depend on it staying the same, so you should not hardcode that and instead use the buffer size that gets passed to you.

If you need to read larger files.
+7 lines for a command to get total filesize.
+3 lines for an optional offset argument in the read command.
(or use extension callback and Arma's new async script handle feature, to transmit the whole content but async)

If you want to delete files
+5 lines for the delete command.

I think with all that stuff maybe 50 lines? I don't wanna calculate.
In comparison to your 180 lines rust or 980 lines first C++ code or your 210 lines second c++ code...

Also noticed your code is doing stuff with mutexes, there is no need for that, your extension will only be called from one thread.

still forum
still forum
little raptor
jagged mica
#

Speaking of radar - I want to create a custom radar UI for my project, most likely using the UI to texture renderer

still forum
jagged mica
#

I wanted to take a peek under the hood of the default arma jet radar UI (activated with the square brackets) but it's all compiled

still forum
jagged mica
#

Are there any ways to get the information from the sensors onboard a jet or do I have to script it up from scratch?

still forum
jagged mica
jagged mica
#

Thanks, I'll give it a read

#

Okay this is, in fact, great

jagged mica
still forum
#

Drawback is that it depends on Steam providing the Webbrowser API.
Which they could remove and make unavailable.

Steam added the API in 2014. And Steam needs the browser for itself to display everything in the steam client itself.

errant jasper
#

So next arma version number is having a web view control based on Steams web api?

Is that one affected by steam overlay being enabled? I run with that disabled in games and some games break with that especially ingame friend lists.

errant jasper
#

Looks like ISteamHTMLSurface should be safe, but not ActivateGameOverlay

jagged mica
errant jasper
still forum
sleek forum
#

Okay, I need help with readable documents. I want players to pick up a document and read it from their inventory instead of the map

#

I know about addaction, or something like that but I do not want the pop up notification

sleek forum
#

If there is a mod for it, that would be amazing as well

harsh vine
sleek forum
faint burrow
sleek forum
sleek forum
#

Welo, problem solved

#

Ace has intel items that does not even need scripting

#

I am just a dumbarse

tulip ridge
#

I was going to suggest ace but you said it had to read through the inventory

sleek forum
#

So I am happy with it

tulip ridge
#

Fair enough

sleek forum
#

Though, adding pictures might be a struggle

wanton fiber
granite sky
wanton fiber
#

ah

errant iron
wanton fiber
#

its in the init field of the AI

errant iron
#

yeah, init fields run on all clients so remoteExec'ing inside one is usually not needed

#

i'd try without it, e.g. sqf [ this, ... ] call BIS_fnc_holdActionAdd;

wanton fiber
#

ah okay

granite sky
#

hmm, makes even less sense why it wouldn't be working then, because it'd reinstall itself every time a client joined.

errant iron
#

yeah... placed below some exit condition perhaps?

wanton fiber
#

So the orginal script works now i took out a mod and it fixed it, only downside is it shows up 3 times in the scroll wheel menu

granite sky
#

yeah that's the expected behaviour.

#

What other people said. If it's in an editor init field, it runs on every machine, so you can drop the remoteExec entirely here.

wanton fiber
#

Noted

thin pine
#

@eagledude4 I had a similar problem, turns out the userconfig folder was incomplete

lone glade
#

userconfigs are useless nowadays tho (except serverside ones)

delicate tangle
#

I dont know if this is the right place for this but is it possible to bind the default β€œnext optic” and cba β€œnext optic” commands to the same key? Possibly through CBA’s keybind script system?

pallid palm
#

i would guess yes: but i don't use any mods:

proven charm
still forum
#

with addUserActionEventHandler, you can detect the vanilla keybind being activated.
And from there can call the CBA function that CBA uses on its hotkey

sterile tapir
#

Is there a way to change the zoom level from holding right click?

I'd want to half it if possible.

sly cape
hallow mortar
#

Not with scripting. That's controlled by config - both the weapon config (for ADS) and the unit/vehicle config (viewPilot/ viewOptics / viewCargo subclasses and turret equivalents)

sterile tapir
#

Ah, so basically, pain

hallow mortar
#

Almost every playable unit in the game inherits its standard values from CAManBase, and most weapons inherit their standard values from Default, so you could make a fairly simple config mod to change those globally. But changing vehicles with more complex turret setups could be more difficult, and if any mod has a weapon or unit that explicitly sets those values rather than inheriting them, you'd need to make a specific patch for that.

sterile tapir
#

Gotcha. I'd only really want to make this a change for default infantry view, and infantry weapons.

I have yet to make an Arma 3 Mod, but have done a good amount of Reforger mods.

If you think this is possible, I'd love to attempt it.

proven charm
#

google for mod

round hazel
#

Hey chaps, does anyone happen to know how I might script a sniper shot hitting an ai fellow close to the player? Either by using an AI unit or spawning a tracer round. Whichever, I would like the shot to use tracer

#
_bullet = createVehicle ["B_762x51_Tracer_Green", getPosASL sniper, [], 0, "NONE"];
        
_vector = vectorNormalized ((getPosATL _bullet) vectorFromTo (target modelToWorldVisual (target selectionPosition "head")));
       
 _bullet setVelocity (_vector vectorMultiply 900);

I have this script, which fires the shot, but there's no tracer

sly cape
restive leaf
#

Tracers are created in a magazine's CfgMagazines entry with the lastRoundsTracer and tracersEvery variables

round hazel
#

Sorry for the delay, would you be able to elaborate?

#

In the context of the code that is

hallow mortar
#

Bullet config determines the colour of a tracer when a tracer is to be shown, but whether a tracer is to be shown is determined by the magazine config from which the bullet is fired.

#

Since script-created bullets are not fired from a magazine, there may not be any way to make them show a tracer.

#

Secondary note: your implementation of createVehicle may cause the bullet to be positioned wrong.
createVehicle does not use ASL positions, it uses a variety of AGL/ATL types - which means your ASL position, when treated as an ATL position, is likely to be between 1 and several hundred metres too high.
Also, a unit's position is at its feet, meaning that even if you were using the correct altitude type, you would want to adjust the position upwards by, say, a metre or two, to avoid hitting the ground. And maybe move it forward a bit to avoid spawning it inside the sniper.

silent cargo
#

When a player uses an FPV drone to crash into something, they always get a negative score. Is there an easy way to prevent this with a mission side event handler or something?

silent cargo
# little raptor HandleRating

I just dont know how to make it so it only adjusts the rating from player controlled drone kills. Ive tried in the past and couldnt figure it out

little raptor
tulip ridge
#

I'd assume dummy AI, I don't think vehicles can have a rating but could be wrong

silent cargo
#

Yeah I think I have to add it to the UAV unit

#

I will figure it out and this will help tons, thanks

little raptor
#

in that case you can use params ["_unit", "_rating"]; private _drone = vehicle _unit;

little raptor
mortal folio
#

so i've put together a data collector for my unit so we can analyze our actions post-op; it essentially gathers all the basic events (fired, getin/out, etc...) as well as positional data among other things every 0.1s - im storing this data in missionNamespace before saving it to our own file format using an extension, however during recording i appear to get a pagefile out of memory after a while as presented in the screenshot (i mean i kinda expected it on the first run since im kind of collecting *a lot) however i noticed that the RAM usage never really went anywhere near the limit (i was at like... 20gb out of 128gb) - im kind of baffled by why the game decides to use pagefile instead of RAM to store the seemingly massive missionnamespace array holding all the data

#

anyone else experience this with storing massive amounts of data within the game's own namespaces?

#

i suppose i could segment it and write to file in pieces to prevent the issue but... still curious

#

(also unsure if this is even the right channel but it's technically an issue concentred entirely within sqf so...)

granite sky
#

IIRC A3 does have a hard cap on maximum memory usage.

#

There may be a separate cap on SQF-allocated memory but I haven't heard of one.

errant jasper
#

I don't think the game explicitly uses pagefile. It is more likely a side effect of how it uses memory.

#

Though surprising it hits a memory limit in the script engine.

#

I made mine with dumping to RPT (guess a side effect is that also made it "crash-friendly"). Then a postprocessing step to convert it to a replayable format in JSON. About 1 MB per hour of gameplay.

#

How much is your massive data ?

#

Well I only stored every 5 for movement and dir data and only one changes. If you store it every 0.1s without reducing non-state changes it can grow. That's 36000 entries per entities per hour, or short of 4 million entries per hour for 100 entities. Unreduced position and dir with some unknown SQF overhead that might be 100-200 MB/hour as an estimate.

granite sky
#

Pagefile is a misunderstanding. The allocation unit of memory is the page. Usually 4KB.

errant jasper
#

Ah yeah, my bad, this is purely a memory allocation issue. (I just assumed OP's point since Arma does require unusual large amount of pagefile "availability" at least).

granite sky
#

I suspect the pagefile usage issue is that it allocates VRAM in a way that requires it to be backed by reserved memory, in case you switch tasks.

#

I think that's default behaviour in modern D3D versions though. I remember in older APIs you were expected to reload the texture data yourself.

errant jasper
#

My previous system had 10 GB VRAM and Arma required a sizeable pagefile to not crash. Recently got 16 GB VRAM, but haven't tried Arma yet, but in other (more) intensive titles actual page file usaged in performance monitor is zero (or 64kB one time).

#

So at least partially the way Arma operates.

#

But the 2 GB number shown in the picture would make me suspect 32bit, but Arma has been 64 bit for long

granite sky
#

Another option is to back the textures in system RAM. And then you have no pagefile reservation but you use more RAM.

#

But I don't know what's common in modern engines.

#

yeah the 2GB value is suspicious, but it's hard to guess what that's referring to.

#

Arma did just allow me to allocate more than that in SQF. Took a few seconds :P

viral hinge
#

If I wanted to have my trigger activate when a round hits within the triggers radius how would I go about it?
I first tried to use shotInAreaDetected in the condition field to no avail.
All I am trying to do is make it so when a shot connects against an invisible energy field it shows the shield prop, then hides it again.

fair drum
viral hinge
#

I'm not getting anything sadly.

fair drum
#

i just tested it, works fine for me

viral hinge
#

Huh, probably the weapons I am using are not triggering the function.

#

Using bolters

warm hedge
#

I don't know what is bolters though. Also we have no known shotInAreaDetected term in Arma 3

fair drum
#

figured he was asking AI

warm hedge
#

Was about to say

#

What I can suggest is ProjectileCreated MEH + HitPart projectile EH

#

allObjects is anyways incredibly performance unfriendly

viral hinge
#

Understood, I have two invisible walls setup that should intercept projectiles.
So maybe using it on those walls as long as I setup an variable name should help?

fair drum
#

yes, if they are actual objects with hitpoints/hitparts. don't know what object you are using. otherwise, since you asked for how to do it in a trigger, I responded with a trigger. using the EHs are going to be much preferred if you know how to use them

viral hinge
#

Sadly I do not, I am just really getting into the scripting part of arma so I don't have to do all the heavy lifting with Zeus.

fair drum
#

I anticipated you were new since you were trying to use a command that didn't exist lol

viral hinge
#

Yeah

#

I am using two Land_InvisibleBarrier_F stacked ontop of one another.
They do have hitboxes from what I tested.

tender fossil
little raptor
little raptor
errant jasper
#

He is using custom extension so just dump it regularly, rather than store it.

split ruin
#

any script way to add more smoke grenades to tanks in desperate attempt to make them survive longer ? πŸ€”

radiant lark
little raptor
radiant lark
#

I think it's just that css filters will apply to the website content, but it doesnt detect the arma video as website content so it cannot filter anything

radiant lark
mortal folio
#

thanks for the responses, i should pay more attention to pings, got a little distracted last night

mortal folio
# errant jasper How much is your massive data ?

Ill run another test today, it never saved fully because of the crash so idk but in regards to what you said just below this yeah im only storing changed data and using a timestamp, so it helps a lot with position for example.

mortal folio
mortal folio
# fair drum 0.1s rate is BONKERS

I could get away with a way less generous rate but i also wanted to make it err.. look nicer visually πŸ˜„ but seeing as the system is largely designed for figuring out group cohesion and organization (and actions people take but that is done through events anyway) i suppose it can be the first thing thats dropped in case i cant make it work at such a frequent interval

#

i'll also give JSON a shot

errant jasper
# mortal folio I could get away with a way less generous rate but i also wanted to make it err....

To be clear by nice visually, you can interpolate in the view. I separate position and dir from "state changes"/attributes. Here is an example of the pos dir time stream input data.

[
    //...
    {"t": 2333.14, "args": [[[13384.2, 8378.15, 7.4061], 100.273]], "e": "posdir"},
    {"t": 2342.02, "args": [[[13472.5, 8362.28, 7.36883], 101.564]], "e": "posdir"},
    //..
]

This is loaded into a Timeline struct consisting of snapshot, where the state part (.attributes , basically side, classname, "containing vehicle" etc, most things never change) is shared by multiple:

function Snapshot(time, posdir, attributes) {
  this.time = time;
  this.posdir = posdir;
  this.attributes = attributes;
}

I wanted to do all kinds of fancy things, but ended up doing binary search for any given time, and lerping the position and dir and using the last active attributes was basically a no-op when rendering at requestAnimationFrame (so at least 60 fps) speed on a canvas smoothly. This also means you can instantly skip hours back and forth without any hiccup. But trying to replace canvas with hundres of small SVGs was much more performance intensive.

little raptor
#

as MuzzleFlash said, if you already have an extension for writing data, just continuously write data. no need to store them in memory only to dump them way down the road

split ruin
#

any idea how to show remaining time of the mission? Lets say its 50 min and I want to check how much minutes are remaining ? setVariable but how ... πŸ€”

bleak valley
#

you can show a cooldown and when it ends you could call an endmission module

#

a countdown*

little raptor
split ruin
#

I just need to diplay the cooldown, its actually for a task

#

even better on the task itself

bleak valley
#

I know how to show it in hint, but it'd need some tweaking to show it in task description

#

if possible at all

split ruin
#

I am surprised they don't have it included in the task framework ...

little raptor
#

well you can update the task description. but idk how well it'll work

bleak valley
#

if you update it every min, it should be ok

#

every second ... that's a thing to test

split ruin
#

I don't need to display it constantly just to check how much time left before the task will be a time fail, probably alongside other admin things in the comms menu

bleak valley
#

theoretically, you could set the result of the countdown in a private variable and call it every time you open the task menu, but idk if you can update a private variable that many times

little raptor
# split ruin I don't need to display it constantly just to check how much time left before th...

well just set the start time and read it:

// Kiba_fnc_createTask
params ["_taskName"];
private _task = [...] call BIS_fnc_taskCreate;
missionNamespace setVariable [format ["Kiba_Task_%1_startTime", _taskName], time];

and you can get the elapsed time by subbing:

params ["_taskName"];
private _startTime = missionNamespace getVariable [format ["Kiba_Task_%1_startTime", _taskName], 0];
private _elapsedTime = time - _startTime;
#

or if you want to do it "remaining style", you can do:

_taskEnd = time + _duration;

// in another place:
_remainingTime = _taskEnd - time;

if remaining time is negative it's done

errant iron
#

i've used BIS_fnc_setTask a few times for live-updating the description too, although annoyingly it unassigns you from the task each time

little raptor
#

what about BIS_fnc_taskSetDescription? it shouldn't unassign it

errant iron
#

i was originally going to write that until i double checked my source code, but i cant remember why i didn't choose that method

#

might be in my commit history, one sec

#

ah, because it internally does the same thing: ```sqf
// BIS_fnc_taskSetDescription
private ["_taskID","_info"];

_taskID = _this param [0,"",[""]];
_info = _this param [1,["","",""],[[]], 3];

[_taskID,nil,_info] call bis_fnc_setTask;```

bleak valley
#

strange, because I use BIS_fnc_taskSetDestination and it doesn't unassign

#

(for another reason)

#

but it bother me that there is no alert of any kind

#

I might have to use hint or something like that to let people know destination changed

split ruin
#

I guess its squad leader's job to check how many minutes remaining to do the task and changing the plan accordingly

delicate tangle
#

Can you change a Spawn AI module’s blacklist after mission launch? There is a variable for it but setting after launch doesnt do anything.

silent cargo
#

Possible to set an AI's communication channel?

#

I have a hypothesis that drone pings cant be seen due to the fact the AI are not on the correct channel, if any at all. I assume they are in group channel which leads to your (their ping) not being visible to teammates while you are controlling the UAV unit

#

Won't have time to test it yet, but does that sound about right? Maybe I could just set the AI's communication channel to "side" and solve this issue?

versed trail
#

in the environment section in 3den, you can edit the time it takes for the forecasted changes to take effect. is there any scripting equivalent for setting that time for changes?

tender sable
cosmic lichen
versed trail
#

Ah makes sense, ok

tardy osprey
#

Is there a way to force POV for all players on a specific character so you get the feeling that you're watching a cutscene?

#

I remember for operation Harvest Red for Arma 2, it starts off with you getting briefed in a carrier. You're obviously yourself in that situation, but i was wondering if I can imitate that, but forcing pov, and then return the POV once the "cutscene" is done.

warm hedge
#

switchCamera supposed to do it

tardy osprey
# warm hedge switchCamera supposed to do it

From what i can see on the forum, switchCamera only change perspective of your own character? Correct me if I'm wrong.

I'm talking about when i load my players into a mission, i want them to see the POV of this random Rifleman, to make it seem like a cutscene. When the cutscene is done, fade to black and skip time. (The players spawn in boats for the sake of avoiding teleporting.) When the black screen dissapears again, the players will find themselves in boats ready to begin the mission.

warm hedge
#

You can switchCamera to anything

tardy osprey
# warm hedge You can switchCamera to anything

I'm not sure what im doing wrong then. I cant change the POV. Note, I'm not too good at scripting.

if (isNull camSoldier) exitWith {};

player enableSimulation false;

player camPrepareTarget camSoldier;
player switchCamera "INTERNAL";

sleep 5;

player camPrepareTarget objNull;
player switchCamera "EXTERNAL";

player enableSimulation true;
warm hedge
#

Why exitWith here? camPrepareTarget won't work here too because it's not a camera object

tardy osprey
#

Yeah, I was just trying to make sure the unit exists before doing the camera part. I tried using CamCreate before, And CamAttachto, I figured some logic would transfer over for "switch". I guess not. Again, i'm not that good. 😐

warm hedge
#

Just try player switchCamera "Internal" and see if it works. I didn't ask you to clarify you're not good. Just your logic you're building does matter

tardy osprey
#

Yes, switchCamera "Internal" works.

However it doesnt make you view it from the POV of the AI.

warm hedge
#

Because it specifies player to do it

#

Replace it with whatever you want

tardy osprey
#

I’m honestly pretty gobsmacked, I thought I’d need a whole setup to make my view switch to another unit. I didn’t expect it to work with just

camSoldier switchCamera "INTERNAL";
#

Cheers. Would this work within an MP setting, if i did a remoteExec?

ivory lake
#

yes

gritty kayak
warm hedge
#

Nothing limits you to do it anywhere

gritty kayak
#

ah okay thanks

turbid lodge
#

What's a script I can use and where in which if respawn tickets run out mission ends with one side winning?

glossy oriole
#

Will (_blu > _opf && _blu > 0) work as a trigger condition?

#

It will have to satisfy this for one minute before activating

#

Can't get it to work

#

Tried loads of things but don't understand why it doesn't work. I'm quite new to the scripting and in my mind that should work

warm hedge
#

We don't know what is _blu and _opf

glossy oriole
#

Ah and obviously it needs to count them aswell beforehand

warm hedge
#

That's not how it works at all
Let's keep it simple, what are they and supposed to do

glossy oriole
#

Well, if there is more blufor than opfor in given trigger area for 60 seconds it should trigger

old owl
#

Is it a side?

warm hedge
#

I think thisTrigger, count are the key

glossy oriole
#

So should i add a game logic to defy _blu and _opf or do not need to at all and just use the full blufor and opfor names

old owl
#

I think maybe this is kinda what you're looking for maybe?

{group side _x isEqualTo west} count thisList > 0
glossy oriole
#

What does _x do?

old owl
#

It is the current array item in count- in this case thisList

warm hedge
#

(You don't need to understand these, just saying you are doing not right that's the only thing you need to learn for now)

glossy oriole
#

Nah i've done some reading and i do understand what you are saying

#

Didn't know _private was voor local

#

IF (and i don't have to in this case) i need to make a global one it'd be a public variable

warm hedge
#

private is a command, not a variable

#

It's not _private

glossy oriole
#

Alright

#

Im trying so hard to remember all those things lol

#

Been hammering hours into this and can't quite get the hang of it.

#

Done some simple intel missions and now am trying to make a zone that blufor can capture by being in greater numbers than opfor for 60 seconds

glossy oriole
#

So i've looked up the variables and group in this case checks how many people in the trigger area are equal to west

#

And the condition them being that that outcome is greater than zero.

#

Is this a good observation @warm hedge?

errant iron
glossy oriole
#

But if i'd use that command, it would check only if west is greater than 0. Not if its also greater than east. How do i work around that?

#
{group side _x isEqualTo east} count thisList;
{group side _x isEqualTo west} count thisList > 0 && east 
#

This wouldn't work

errant iron
#

i'd assign the result of each expression to variables first, that'd make it easier to understand how to write the final condition

#

for example: sqf private _bluforCount = {side group _x isEqualTo blufor} count thisList; private _opforCount = {side group _x isEqualTo opfor } count thisList; _bluforCount > _opforCount

glossy oriole
#

That looks so much more simple

#

And easier to understand

#

I have the tendency to make things very complicated aswell (so i've noticed). I should just do this stuff more and more to understand how simple it can be.

#

Thanks alot for your help @errant iron, i'll give it a whirl tomorrow and see how it goes.

stark fjord
#

Question, if i spawn lotsa ai on HC, Do i need to enable dynamic sim for them on server?
As apparently local managers are disabled

mortal folio
#

should you use dynamic simulation even with AI offloaded to a headless client? sure, there's still a small benefit of entities not being simulated when it comes to network traffic, but that applies regardless of headless clients

stark fjord
#

I understand that. Imagine it like this: about 300 units are spawned by HC, and they dont all need to be simulated at the same time. Only when enemy is near. Ambiental ai if you will.

#

The thing is, that all are simulated, regardless of enableDynamicSimulation. Since this has local effect, and wiki states Each client have it is own dynamic simulation manager, all script commands do affect the local simulation manager. (While this is true, according to dedmen, these local systems are disabled internally and only the manager on the server is being used)

I wonder if i should set dynsim for these groups on server

#

As in remote exec enableDynamicSimulation

mortal folio
#

ah... i see - well given the locality i've always been running the command on all clients (including server) and haven't had any apparent issues so... i'd say yeah, given the context i can't see it going wrong to execute it on the server as well tbh (i wasnt aware of that quote from the wiki however)

errant iron
stark fjord
#

Welp, ill try doing it on server tommorow. Enough for today.

granite sky
#

If in doubt, test it. Plonk a new unit far from the player. Call enableDynamicSimulation on it. See whether it gets its simulation disabled.

mortal folio
#

feel like the wiki should be updated to have the SE tag for those commands to avoid confusion (or unnecessary global exec)

stark fjord
#

(And if that will even work) since unit isnt local to server

#

And to clarify, if same script is ran by server, they are unsimulated.

mortal folio
#

well even with your assumption (and wiki's tag) that the command was local (and not server-only) which is why you executed it on the HC only - it's local effect - so you would've had to globally execute it anyway (hence why it worked for me as i was doing so regardless),

granite sky
#

Given that enableSimulationGlobal works on the server regardless of object locality, it'll probably work.

mortal folio
#

^

stark fjord
#

But yeah, should that be the case, perhaps wiki can change its tag to server only.

old owl
azure portal
#

Can someone tell me which approach is better?

_this setUnitLoadout (getUnitLoadout (typeOf _this));

or

private _loadout = getUnitLoadout (typeOf _this);
_this setUnitLoadout _loadout;
stable dune
warm hedge
#

What is better in this context

azure portal
#

Faster/more functional, to be honest I'm not entirely sure if the first option would actually work

warm hedge
#

It does

#

Faster? Yes first is

#

Noticeable improvement? No

azure portal
#

Cool bananas, appreciate the feedback πŸ™‚

warm hedge
#

You can actually test the code's perforrmance

zinc saffron
#

can someone help me call arma 3 campaign dialogue into a mission, i used a sound browser to find it yet it won't play

#
    private _line = {
        params ["_name", "_text", "_file", ["_pause", 0]];

        // Chat log for players (simple + reliable)
        player globalChat format ["%1: %2", _name, _text];

        // Audio (local to whoever runs this file)
        playSound3D [_file, player];

        if (_pause > 0) then { sleep _pause; };
    };

    ["Kamino",   "Kamino to Broadway, shots fired!",
        "a3\\dubbing_f_epa\\a_in\\120_range\\a_in_120_range_ran_0.ogg", 4] call _line;

    ["Kamino",   "Requesting support. Broadway do you copy?",
        "a3\\dubbing_f_epa\\a_in\\120_range\\a_in_120_range_ran_1.ogg", 5] call _line;

    ["Broadway", "Kamino, Broadway. We read you. Wait one.",
        "a3\\dubbing_f_epa\\a_in\\120_range\\a_in_120_range_bhq_0.ogg", 20] call _line;

    ["Broadway", "Copy that, Kamino. Dispatching reinforcements. Just hold on!",
        "a3\\dubbing_f_epa\\a_in\\140_enemies\\a_in_140_enemies_bhq_0.ogg", 6] call _line;
};```
#

the text displays but the sound doesn't play

proven charm
#

change \\ to \

zinc saffron
#

let me give tha ta try

zinc saffron
#

Is there a way to make it as Blue chat like the campaign

stark fjord
#

Use sideChat instead of globalChat

#

Unit must have a radio item tho

zinc saffron
#

and i can do this with all campaign dialogue

#

holy sheeit

still forum
#

Open the debug console?

#

If you mean debug a website without ever opening it.. Uh. no

winter rose
proven charm
#

playSound3D is weird because it returns some id even if it fails to play the sound

still forum
#

Can you do the blur with Arma UI behind it?
Afaik UI can only blur whole screen, not just small area?

zinc saffron
winter rose
broken forge
#

Some of my UI work dims the screen and I'm able to make UI look as if it's being projected into the world. If I recall I was even able to do glass morphism on a test UI but I no longer have it, lol.

radiant lark
#

But I really want to do glassmorphism!

sleek forum
#

Need some help with unit capture. How do I make multiple replays at the same time?
Suppose, I want to make a scene where two jets are weaving in a valley, one behind another. How will I use unit capture to show both of the aircrafts

hallow mortar
#

Well playing it back is pretty easy. Making the capture data is more complex - not technically, just logistically.
You can always record each track separately, but that will be difficult if you need them to be close together. So you've got a couple of options:

  1. capture one plane, then play back that track while you're capturing the second, so you can use the first as reference
  2. use two players
sleek forum
hallow mortar
#

What's the problem?
Nothing prevents BIS_fnc_unitPlay from running twice at the same time.

sleek forum
old owl
hallow mortar
sleek forum
#

Ohhh

#

Basically, make a duplicate line for each function and change the variable name

#

That's genius

#

Thanks! @hallow mortar

analog mulch
#

hi
in a dedicated server setting, if i have the players start in an AI controlled heli that will then transport them to a base of sorts and drop there and then get deleted off to the distance, if another player takes an available slot and/or crashes and rejoins, they will just plummet to their death at where the heli first was at the start

how to make it so that to avoid that and they spawn somewhere at the base for example or near their squad that has moved off?

hushed turtle
#

One way would be to move chopper to corner of the map, instead of deleting it and move players to base once they join. But wait for others opinios I have never done anything like this.

tender fossil
#

Is it possible to make only part of the players to have any major medical mod on a server (while the rest would play vanilla)? I assume not?

hallow mortar
granite sky
#

In theory a medical system could support different UIs for different players. But you'd still be running that system everywhere.

hallow mortar
granite sky
#

Or it only moves them in if the heli still exists when they connect.

#

but yeah, start outside, move in conditionally.

hallow mortar
granite sky
#

Oh, if it flies off empty before being deleted, yes.

#

Stick a setVariable in a setWaypointStatements or something.

hushed turtle
granite sky
#

Issue is that these people are probably expecting to treat each other.

#

ACE would see a unit without the ACE handleDamage running as uninjured.

#

and vice versa.

glossy oriole
hushed turtle
#

I forgot you would still see ACE medical menu on all units

granite sky
#

Funny thing there is that ACE prevents the vanilla healing action being visible by keeping units at zero damage. So you could probably still vanilla-heal a unit that wasn't running the ACE handleDamage.

glossy oriole
#

@errant iron I've now went with private _bluforCount = {alive _x && side _x == west} count thisList; private _opforCount = {alive _x && side _x == east} count thisList; _bluforCount > _opforCount

#

This seems to work perfectly

#

Really appriciate the help.

remote cobalt
#

Hey folks, I am having a problem with sendSimpleCommand and I can't seem to break through it.

I recorded some APCs with unitCapture. Now they drive around with unitPlay, but I hoped I could make the tracks move with sendSimpleCommand. Doesn't seem to work at all.

I used setEffectiveCommander, in every vehicle there are two AI soldiers, I tried it with AI disabled, I can't seem to bring them to move these stupid tracks ^^.

Is there another way this could work or am I doing something terribly wrong here?

Thanks for the help.


_unBMP_1 = [[12117.8,14494.1,-5.72205e-06], 121, "CUP_I_BMP2_UN", west] call BIS_fnc_spawnVehicle;
_unBMP_1 params ["_unBMP_1Veh","_unBMP_1Crew","_unBMP_1Grp"];
_unBMP_1Veh engineOn true;
_unBMP_1Veh allowDamage false;

_unBMP_1Veh setEffectiveCommander (commander _unBMP_1Veh);

(commander _unBMP_1Veh) disableAI "ALL";

_routeBMP_1 = []; //Cut because overflow

[_unBMP_1Veh,_routeBMP_1,[_unBMP_1Veh,"unitPlayDone"],true] spawn BIS_fnc_unitPlay;

_forwardHandle_1 = [driver _unBMP_1Veh] execVM "scripts\moveForward.sqf";



//--------------------------------
// Move Forward Script
//--------------------------------
params ["_driver"];

while {true} do 
{
    _driver sendSimpleCommand "FORWARD"; 
};```
granite sky
#

disableAI "ALL" prevents the commander from audibly issuing the command.

#

I don't remember how to make sendSimpleCommand work though.

#

Generally they get the order and they ignore it.

granite sky
#

Maybe it was broken in a patch. I definitely had it working a few patches back.

remote cobalt
granite sky
#

LEFT/RIGHT do actually stick, or at least show up in vehicleMoveInfo. The other one is always STOP

#

I did wonder if the AI was countermanding the order afterwards but there's not even one frame where it changes from STOP.

stark fjord
#

Could this get server only tag, as it has no useful effect on any other machine?

remote cobalt
granite sky
#

Usable is a stretch for any of these.

#

I think Leopard had sendSimpleCommand working. Maybe he'll show up at some point.

granite sky
#

This did roll backwards fairly plausibly, but it'd take a fair amount of work to get it doing anything useful:

{ _x disableAI "ALL" } forEach crew mrap;
mrap disableBrakes true;
mrap engineOn true;
mrap setVelocityModelSpace [0,-2,0];
#

huh, tried that on a Panther IFV and the thing kept rolling backwards forever :P

mortal folio
#

well in regards to the recording thing i mentioned a while back - i've managed to optimize it enough to the point where the capture per unit is much smaller and i'm not getting the crash anymore; and have managed to successfully "replay" 5 minutes of a mission - horray

#

(now it's the shiny object syndrome in me wanting to try using this data with an ML algorithm to see if i can't make AI units act more like players lmao)

little raptor
granite sky
#

That's what I was trying to determine, but I couldn't convince it to do anything at all.

little raptor
#

there was a way to stop it but I don't remember off the top of my head. maybe doStop?

proven charm
proven charm
#

i just tested the command and it looks like it only works if player is on commander seat of the vehicle

little raptor
#

iirc I did it with agents

proven charm
#

humm with marshall that was the only way i got it working (With "normal" units)

tulip ridge
#

The command returns only local connections.
https://community.bistudio.com/wiki/UAVControl
What is a "local connection"?

Adjusting a script that sends a message to the pilot/driver of a vehicle to also work for drones, so that the drone's controller gets it (whether they're currently controlling it or not)

still forum
#

I'd rather say, what are "not local connections"?

#

I think it refers to the command being local-arg

#

The wiki even has a link to what it mean

tulip ridge
tulip ridge
hallow mortar
#

That detail was added by KK just a couple of days ago. Maybe you could ask him what it means.

tulip ridge
#

@unique sundial ?

tulip ridge
#

Also running into an issue where a player connects to a UAV, but hasn't taken control of it
Meaning the server (or whatever other machine) still owns it, but I'm not sure how I can get which player(s) are connected to it other than just running it on every machine and checking if they're connected

tulip ridge
#

Also local arg, needs to run on the player that controls the uav

unique sundial
tulip ridge
#

Same thing, still local arg (to prisoner)

unique sundial
tulip ridge
#

Yeah I had to use a workaround for now by sending it to all players and filtering by getConnectedUAV

charred monolith
#

Greetings, I've been searching but can't find something precise on the Wiki, is there a command that return when a player is in collision with an object and if yes can it return the object its in collision with ? All I can find is either nearestObjects or doing it manually with the boundingBoxReal command and do a AABB detection.

granite sky
#

No, there isn't an SQF command to do an engine collision check for some reason. So you have to do godawful bounding box and nearestObjects checks where at best it works 99% of the time.

charred monolith
#

thanks ! I image the player bounding box is not a classic brick like most games and I have to invoke some trickery like you said ?

granite sky
#

I'm not sure. When I'm working with units I'm trying to spawn them well out of contact, so their shape doesn't matter.

mortal folio
#

There is one for physx objects but players aint that

granite sky
#

For physX objects there is an event which you could theoretically trial & error with. But yeah, nothing for units.

mortal folio
#

Also depending on the size of the object involved you may need to be generous with your radius for nearobjects

#

I.e player touches a 30 metre wide building - nearobjects needs to be 30 metres to catch it and grab that bounding box

granite sky
#

You want raycasting for buildings.

mortal folio
#

Tbh youre probably better off just building a raycast grid around the unit and detecting that way

granite sky
#

Worst case is trees where the object center isn't aligned with the trunk.

#

Need a lot of rays to catch them, and the nearObjects doesn't work at all angles.

mortal folio
#

yeah, if you're only doing it for a player, and it runs on their machine, you can comfortably do a few dozen raycasts without much of a performance hit (esp if you use the multithreaded method)

#

if you wanna do it for every unit that's another can of worms, might want a headless client designed solely to run raycasts πŸ˜„

charred monolith
#

You can Multithread scripts ? I thought that was impossible.

I'm gonna be honest I think I'm way over my head here xD, all of the very basic raycast knowledge I have is only coming from, people who explain the original Doom Engine, and sebastian lague's videos.
Even more when talking about Headless clients, always been a mystery to me.

hushed turtle
#

I don't think trees are horrible to deal with. What trees don't have center aligned with trunk? At least closely

mortal folio
granite sky
#

I did not write down the model name. But it is a thing.

#

raycasting in SQF just means running a command that looks for surfaces along a line that you specify the start and end positions for.

#

The engine does the hard part :P

mortal folio
#

depending on your use case, at least to help with trees, you could for example just raycast from slightly above the position of the unit, upwards 2 metres (recalc depending on stance) and outwards maybe 1 metre, and have it really dense as opposed to raycasting a cube that fills the "volume" - already you get a lot more leeway with density

#

but that method has the issue of not detecting collision properly if it happens very low to the ground (player collides but raycast says nothing) - i used this method only for cases where i once disabled collision on a unit and did collision detection and "pushing" manually - worked welll

mortal folio
#

but i imagine that'd be a whole nightmare to do properly

hushed turtle
#

For trees I get their radius and multiply it by 0.2. It gives me size of trunk, at least roughly. For smaller trunk it's larger, but for large tanoa trees it's quite accurate

granite sky
#

Uh, radius gives you the canopy, doesn't it?

#

Oh, I see.

hushed turtle
#

For land units

#

For air units I don't change radius

charred monolith
#

Thanks to all of you for you help and knowledge, it gave me some ideas. I'll see if I can use this for my use case. Otherwise I might just move on from collision detection till a moment where i'm more comfortable with more complex problem ^^.

hushed turtle
#

Branches at the bottom of spruce trees don't have any collision

#

You can just walk through them

mortal folio
#

(well, see them sure, when the tree falls, but at that point there's no collision on the entire tree anyway)

unique sundial
unique sundial
hexed sundial
#

Can datalink detect projectiles or units only? i want to add one to one of my vehicles (projectiles means rpg rockets and etc)

opal ember
#

I'm wondering. Is it possible with a script to get the specific door in a building the player is looking at?
And maybe even it's location in worldspace?

tulip ridge
opal ember
#

thx, ill check it out

vagrant cedar
#

How can I make subtitles like the ones in the SOG CDLC

warm hedge
vagrant cedar
tulip ridge
#

Trying to make an AI place a backpack-deployed static weapon, tried doing _this action ["Assemble", backpackContainer _this]; and the unit played the gesture but didn't assemble a weapon. The Disassemble action works fine

Wiki only has the example, no other data
https://community.bistudio.com/wiki/Arma_3:_Actions#Assemble

faint burrow
#

Does the unit's backpack contain the weapon itself?
Is the unit near to the backpack with the tripod?

tulip ridge
#

Does the unit's backpack contain the weapon itself?
It's the vanilla style deployable weapons, i.e. you scroll wheel, select "Deploy xyz", and then the backpack is removed and the weapon is deployed in front of you

Is the unit near to the backpack with the tripod?
They're wearing it, hence the backpackContainer