#arma3_scripting

1 messages · Page 318 of 1

subtle ore
#

@rotund cypress yes but that wouldn't even help me with calculating the time in script. I'd need to know in a date and time format not just seconds.

dusk sage
#

Think the command for start date is missionStart

#

or along those lines

rotund cypress
#

Ah ye, time is just for how much time has passed since mission start

#

Or since you are in the game with display #46

subtle ore
subtle ore
#

the "CAN_COLLIDE" tag for create vehicle will drop the barrel to the ground if it's floating above something correct?

subtle ore
#

Well that wouldn't make any sense if it returns localy okay then it should be fine on remote? Unless the object only exists locally and the effects of the bullet are handled somewhere else? 🤷

#

^ just throwing ideas out there

little eagle
little eagle
#

Oh, projectiles are like createVehicleLocal objects

#

only exist on their local machine, but everyone has a copy

subtle ore
#

aha!

little eagle
#

that wouldn't work anyway. attachTo doesn't work for CfgAmmo

vapid frigate
#

could sync the marker instead of the projectile

#

but yeh doesn't seem very efficient

ionic aurora
vapid frigate
#

missing { } around the event handler code

#

player addEventHandler ["respawn", { enable fatigue etc }]

ionic aurora
#

thank you sir , i wish you a great day 😃

inner cypress
#

newguy question-- i had an idea to use an array of logical expressions in order to test the end of a waitUntil loop. Can you use expressions in arrays, or is there a better way given a bunch of ending conditions?

#

I guess my assumption is that all the logical expressions to test end have to be on the last line after a sleep

#
    _myWaits = [
        (!alive _unit),
        (isNull _item),
        (_timeOut < time),
        (unitReady _unit)
    ];

    waitUntil {
        sleep 1;
        {
            if (_x) exitWith {True};
        } forEach _myWaits
    }
#

does something like that work?

#

I thought about wrapping the expressions in {} inside the array variable, but I didn't know if that would create some weird scope issue

vapid frigate
#

you could do it with an array just with the { }

#

and if(call _x)

inner cypress
#

would the forEach still exit properly with true -- as so end the waitUntil

vapid frigate
#

hmm yeah not certain about that

#

if not, could use breakOut

#

but it might work anyway

inner cypress
#

oh that would be suck an ugly hack

#

like using a GOTO in my mind

vapid frigate
#

yeh i agree.. don't like using them

#

you could also just do like _done = false; { if (call _x) then {_done = true}; } forEach _myWaits; _done

inner cypress
#

yeah that works-- and it's easy to read too

#

thanks-- i hate ask such questions but even simple in-game tests are still difficult for me to setup

vapid frigate
#

yeh the original would be better if it works (won't check unnecessarily)

inner cypress
#

getting a function recognized by the game seems the hardest part of all of this

vapid frigate
#

i'd just use cfgfunctions

#

but for testing, the debug console

inner cypress
#

i'm only a week into this-- i've not figured all that out yet

vapid frigate
#

debug console just lets you run any working code (unscheduled though, so can't sleep unless you spawn your code)

#

without restarting the game, etc

#

or mission

inner cypress
#

hehe There is currently no text in this page.

vapid frigate
#

need to add the ) back to the url, discord breaks it

inner cypress
#

facepalm thanks

#

I've been reading KillZoneKids blog -- it's been very helpful with the basics

#

thanks for the quick assistance

stable wave
#

Are there any full guides on ArmA 3 scripting/editing that are written within last 12 months?

inner cypress
#

I don't know of any full guides. Back in ARMA or maybe ARMA 2 I remember someone made huge PDF that was the bible at the time for scripting. But so much changed over time.

stable wave
#

Yeah. I've been really looking forward to getting into ArmA 3 editing/scripting. But it just boggled my mind when I found out there wasn't an official editing guide.

inner cypress
#

I found little scripting problems like above are actually some of the easier things to deal with. Setting up a work enviroment, build/make, testing. That's all the soul crushing stuff for me so far

#

Everything takes 20x longer than you think it would

#

I'm gutting it out so far

warm gorge
#

So how does lbSetPictureRight work in the arsenal menu, but I cant seem to get it working in any of my menus?

little oxide
#

Any way to add in dialog, a button, to connect to an server, with ip and port ? ( i want to modify my main menu of the game)

dusk sage
#

Don't think it's possible

thick sage
#

It may be useful for you, as it is being for Epoch and Exile devs.

inner cypress
#

@thick sage thanks -- someone pointed me to yesterday for use with atom. It must be very good.

thick sage
#

let me know if you need help installing it (I am always searching for people to use it, because the more feedback (aka bugs) I get)

warm gorge
#

Disregard my question above ^^ Was doing something wrong.

little oxide
#

@thick sage This can be useful, if we can use it with Atom ❤

thick sage
little oxide
#

@thick sage Hooo, thanks dude

austere hawk
#

in my script i need to read config properties of hitpoint classes. Problem: with the EH eventhandler i only get selection names. I can turn that into classnames (strings) no problem. But then there are 2 more problems - 1)hitpoints in turrrets are not under the same config path as regular hitpoints. 2) all turrethitpoints (HitGun, HitTurret) have the same name for every turret... How would i be able to get the config path of a specific hitpoint in this situation?

little eagle
#

iterate through all class HitPoints and identify them by their selection name.

#

Turret paths can be found with the allTurrets command.

#

They correspond to how you would use ((_cfgVehicle >> "Turrets" select 0) >> "Turrets") select 0 >> "HitPoints"

#

which is turret [0,0]

austere hawk
#

_firstTurret = (_cfgVehicle >> "Turrets" select 0) <- thats a syntax one can use?

little eagle
#

I think so. Maybe I'm off with the parenthesis, but you should get the gist.

#

_cfgVehicle >> "Turrets" select 0
corresponds to turret path [0]

#

And all the classes inside all "turrets" classes are turrets that have class "Hitpoints" and all of those have unique selection names. Each turret can have additional "Turrets" sub classes.

austere hawk
#

yes i know

little eagle
#

Not all hitpoints are valid though. They only are if the selection exists in the model.

austere hawk
#

i use "HitTurret01_01" as selectionname for 1st subturret of turret 1 for example

little eagle
#

Can be checked with getAllHitPointsDamages or whatever it was

#

It's a huge PITA and sucks all around imo.

austere hawk
#

i know the pathNumbers to the turret from the selection, just not the name of the turretclass or its parrents. If the "turrets" select 0 would work that would make things much much easier
e.g.
_path = ( _cfgVehicle >> "Turrets" >> "Turrets" select 1 >> "Turrets" >> "Turrets select 0" >> "HitPoints" >> _desiredHitpoint ) for 1st subturret of turret 2 ?

little eagle
#

that is wrong. check out config select number syntax

#

_cfgVehicle >> "Turrets" >> "Turrets" select 1 >> "Turrets" >> "Turrets" select 0 >> "HitPoints" >> _desiredHitpoint )

#

just a misplaced quote mark I think

#

no wait

#

_cfgVehicle >> "Turrets" select 1 >> "Turrets" select 0 >> "HitPoints" >> _desiredHitpoint )

#

again, not sure if this needs parenthesis

#

[1,0] turret

vague lichen
#

EXTdb3 question: say I have 3 fields ... Index, uid, and allowed in a table. Does it make a noticeable performance difference if I create an array to store all of those values at server start or just check the value of allowed using onPlayerConnected?

#

ie checking only executing when the player connects ... or just making a large array of all the known values when the server starts up?

#

For sake of argument .... on a 100 player server?

inner cypress
#
    // the list of all men, including in vehicles and the dead
    _listMen = entities [["Man"],[],true,false];

    // the list of alive men only, including in vehicles
    _listAliveMen = entities [["Man"],[],true,true];

    // filter out those alive from the list of all men
    _corpses = _listMen - _listAliveMen;

Is this a reasonable way to accomplish this? I could iterate through the first list and test alive _x, but I'm not sure which is optimal

vague lichen
#

on one side, it compiles all of the information at server start and just runs a quick check to see if they are allowed

little eagle
#

?

vague lichen
#

on the flip side, I lose a valuable piece of the puzzle .. the ability to flip the bit in "allowed" in the database without having to restart the server

#

just tell the player ... disconnect and reconnect and boom! you are allowed. Whereas the former, I have to tell them to wait until server restart

inner cypress
#

Thanks.

little eagle
#

yw

subtle ore
#

When would it be fired? On a runway

#

Ahh. I seee, one of those faked runways sort of placed near the carrier.
Ohh. landing canceled huh? CANCELED.

#

(╯°□°)╯︵ ┻━┻

#

I swear to god they used google translate for that shit, I translate the Czech translation back into english and it spits out "canceled"

halcyon crypt
#

they're both correct according to the internet 😛

#

US vs UK

subtle ore
#

I've seen it still spelled cancelled in the uk. ¯_(ツ)_/¯

halcyon crypt
#

it's canceled in the US and cancelled in the UK 😛

subtle ore
#

Wow, "filthy imperial" cough cough americans?

#

@halcyon crypt non sense

halcyon crypt
#

¯_(ツ)_/¯

austere hawk
#

is there an easy way to damage/ kill a unit or vehicle via script, but have it react /make it so the instigator is another unit or vehicle?
Right now for example my damage script causes destruction of a vehicle and crew if ammo was hit. But since the damage is scripted, a team killer would receive no penalty for example and killed EH returns "" as instigator.

jade abyss
#

what about: handleDamage EH -> SetVar on Veh about last instigator -> script checks for last instigator?

austere hawk
#

so you mean i should save the instigator on the veh and then use scripts on killed event to manually set the score? Thats the hard way i would like to avoid... as i would have to replicate the entire AI reaction and score system

#

or is there a default vanilla variable for the last instigator for such things?

jade abyss
#

For example, yeah

#

not that i know off :/

tough abyss
#

how would i create a group and join that same group? i was looking at the join thing but i dont understand it. if someone could type up a example? thanks

indigo snow
#

[player] joinSilent (createGroup west)

#
_group  = createGroup west;
[player] joinSilent _group;
#

etc

tough abyss
#

can you create as group in civilian?

indigo snow
#

sure

tough abyss
#

ok thanks

inner cypress
#

taking a position2d as a parma -- is position2d also a type? does anyone have a typical guard expression for them?

#

params

indigo snow
#

position 2D is just an array of size 2 instead of size 3

#

either only take arrays on length 2 or take any length greater than two and resize

inner cypress
#

ok thanks for the quick rely

#

reply

indigo snow
#

i think most of the commands even plain take normal position arrays too btw

#

marker creation ones do

#

just be aware get you use getMarkerPos it will be position2D not 3D

inner cypress
#

ok-- i eventually use it in a distance2D expression

indigo snow
#

distance2D takes normal positions too

inner cypress
#
_unit distance2D _refPosition > CONSTANT
indigo snow
#

_refPosition can be [x,y,z] there too

#

format position vs format position2D

inner cypress
#

aye but I would like the distance to be agl only

indigo snow
#

it will just ignore the Z component tho

#

no difference between using a normal position or a normal position with Z snipped off

inner cypress
#

ohh really? ok.. well then. thanks

tough abyss
#

how do i get someone to leave a group?

indigo snow
#

have them join another group

#

or even grpNull

tough abyss
#

how does grpnull work

indigo snow
#

[_unit] joinSilent grpNull

tough abyss
#

ok and what does it do? join another group or ...

indigo snow
#

every unit must be in a group

#

so yes

#

it will create a new one for the unit

tough abyss
#

ok thanks

rotund cypress
#

Would anyone know what this means? 0:08:44 Skipping mods and signatures due to overflow flag being set. Could it be a variable being too big?

indigo snow
#

this sounds more like some engine thing during startup

rotund cypress
#

It was not during startup, it was after a syncing script of mine ran

shadow sapphire
#

What's the syntax to create a group's waypoint on a marker?

subtle ore
#

What do you mean "syntax" waypoints and markers aren't inheritely associated.

#

you could add a waypoint at a marker position (getMarkerPos "MySuperCoolMarker")

#

Ex: (Yes I did grab a biki example because I am in rush of time) _wp =_grp addWaypoint [(getMarkerPos "MySuperCoolMarker"), 0];

#

_grp being deinfed like: _grp = createGroup west;

shadow sapphire
#

@subtle ore, that's exactly what I needed! Thanks!

subtle ore
#

@shadow sapphire Sure thing.

shadow sapphire
#

Can anyone tell me how to create a waypoint for an AI group based on another existing AI group's waypoint?

This is what I'm doing currently:

#
    private _wpPosition = waypointPosition _waypoint;
    _wpPosition = _wpPosition getPos [100, 0];
    _waypoint setWPPos _wpPosition;
} forEach waypoints _G4;```
#

What'm I doing wrong?

subtle ore
#

@shadow sapphire I'm pretty sure getPos in this situation still contains 3 numbers just like a regular position array. Don't see as to why it wouldn't.

shadow sapphire
#

Hmm...

#

Okay, I'll go look at syntax.

#

Looks like it only takes two numbers.

subtle ore
#

getPos?

shadow sapphire
#

origin getPos [distance, heading]

#

That's the syntax from the biki.

subtle ore
#

what;s the error?

shadow sapphire
#

No error, it's just not executing anything.

little eagle
#

The code looks like it just moves the waypoints of _G4, not create new ones for a new group.

shadow sapphire
#

Ah! Okay, so I need to create a waypoint first??

subtle ore
#

No

little eagle
#

All you do atm is move the old waypoints.

subtle ore
#

You need to create the waypoints for the seperate group with the data from the other group.

little eagle
#

Yeah. The other group isn't even part of the script. Only _g4

#

No surprise that nothing happens.

#

All you do is move the waypoints of _g4 100 meters north.

shadow sapphire
#

No, that's not the whole script.

#

It'll work now. Wait one, then I'll share complete script.

#

Working perfectly now.

#
Sleep 1;
_G1 = [(getMarkerPos "M1"), EAST, ["I_Soldier_SL_F","I_soldier_F","I_Soldier_M_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G2 = [(getMarkerPos "M1"), EAST, ["I_Soldier_TL_F","I_soldier_F","I_Soldier_GL_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G3 = [(getMarkerPos "M1"), EAST, ["I_Soldier_SL_F","I_soldier_F","I_Soldier_GL_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G4 = [(getMarkerPos "M1"), EAST, ["I_Soldier_TL_F","I_soldier_F","I_Soldier_GL_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G5 = [(getMarkerPos "M1"), EAST, ["I_Soldier_SL_F","I_soldier_F","I_Soldier_GL_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G6 = [(getMarkerPos "M1"), EAST, ["I_Soldier_TL_F","I_soldier_F","I_Soldier_GL_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;```
#
    {
    _x execVM "Gear\FN_CentralGreen.sqf";
    _x setBehaviour "AWARE";
    } forEach units _x;
} forEach [_G0,_G1,_G2,_G3,_G4,_G5,_G6];

_G2 addWaypoint [(getMarkerPos "M2"), 0];
sleep 30;

_G1 copywaypoints _G2;

_G4 copyWaypoints _G2;

{private _waypoint = _x;
    private _wpPosition = waypointPosition _waypoint;
    _wpPosition = _wpPosition getPos [100, 0];
    _waypoint setWPPos _wpPosition;
} forEach waypoints _G4;

_G6 copyWaypoints _G2;

{private _waypoint = _x;
    private _wpPosition = waypointPosition _waypoint;
    _wpPosition = _wpPosition getPos [100, 180];
    _waypoint setWPPos _wpPosition;
} forEach waypoints _G6;
sleep 30;

_G0 copywaypoints _G2;
_G3 copywaypoints _G4;
_G5 copywaypoints _G6;```
subtle ore
#

Eeeek, execVM

shadow sapphire
#

Alternatives?

subtle ore
#

call compile

queen cargo
#

Preprocessfilelinenumbers is missing @subtle ore /cc @shadow sapphire

subtle ore
#

@queen cargo Aye, duh. sorry bout that.

queen cargo
#

In an optomal world CfgFunctions would be used

#

Saving the compiled code in a variable is OK too though

subtle ore
#

@queen cargo Only if something is ran more than once. Otherwise something that runs and closes once the entire game it wouldn't make a difference.

queen cargo
#

Organization is key
That part belongs to it

subtle ore
#

Right, but none the less.

little eagle
#

Organization indeed. If you have 6 times essentially the same line, then there is much room for improvement.

#

Getting dizzy from looking at the patterns.

#

Never used

copyWaypoints 

myself.

subtle ore
#

@little eagle thats where you put it into the functions config.

#

Whats the alternative? @tough abyss

#

Aye, i see.

shadow sapphire
#

@tough abyss how would you write my script above!? I'd be very curious to see how it would be done your way. I'd like to be a real cool guy and use move/domove.

subtle ore
#

@shadow sapphire cool kids club 😎

shadow sapphire
#

Kool kids klub??

#

It's not far up, like at all. I'm surprised it's not still on screen.

#

Can't work that way, I don't think. The markers are just placeholders.

#

Their waypoints and spawn locations are going to be dynamically determined.

#

Well, it probably can work that way, but it's over my head.

#

Well, I'm familiar with it. Our community developer does everything, really. But i read his code.

#

Haha, yeah, I have had hard times with that, too.

little eagle
#

make your scripts case insensitive

shadow sapphire
#

For sure! Especially when sometimes the wiki has the wrong shit, you gotta go copy/paste the shit from the editor.

little eagle
#

doArtilleryFire needs config case? lol

#

edits wiki

#

That is hilarious.

subtle ore
#

'if(troubled) then {laughItOff};'

little eagle
#

I thought this was about in, but the command being case sensitive is legitimately retarded.

#

No one uses these commands, because no one uses artillery.

subtle ore
#

Was it you Quik that suggested doc videos or was that dedmen?

little eagle
#
_entry in parseSimpleArray toLower str _array
#

I'd laugh about it, but the BWA3 Leopard does the same :S

#

So a loop for something that happens twice a mission. 😃

#

Are they for actually touch down or for using the auto pilot to land?

warm gorge
#

Is there much control available over the tactical ping? As in detecting it with inputActions or something. Trying to intercept it to prevent it from being used in global channels

tough abyss
#

Is there a way to unstring a string?

jade abyss
spark phoenix
#

@warm gorge it could be prevented with a keyDown event just like other arma default keybinds could be

warm gorge
#

@spark phoenix Yeah I figured out which actionKeys value to use for it. Just a pain to handle it with combinations, such as the shift + t as default, but even then when people changed it to other combinations would be more of a pain

spark phoenix
#

@warm gorge wait do you know the inputAction ?

#

or are you asking for it

warm gorge
#

I do know it

spark phoenix
#

What is it?

warm gorge
#

TacticalPing

#

It wasnt documented so I just looked in the related config

digital pulsar
#
    disableSerialization;
    _html = findDisplay 46 createDisplay "RscCredits" ctrlCreate ["RscHTML", -1];
    _html ctrlSetBackgroundColor [0,0,0,0.8];
    _html ctrlSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH];
    _html ctrlCommit 0;
    _html htmlLoad "http://www.bistudio.com/newsfeed/arma3_news.php?build=main&language=English";
};``` how do i get the html from the control as a string?
spark phoenix
#

@warm gorge ill work on something, with desolation i just disabled it in the cfgDifficulties

forest ore
#

Hello,
how and from where does one remoteExec this: player addAction ["<t color='#FF0000'>Group Management</t>","disableSerialization; ([] call BIS_fnc_displayMission) createDisplay 'RscDisplayDynamicGroups'",nil,1,false,true,"",""]; so that every player on a dedicated server gets a Group Management text in their Action Menu (mouse wheel menu) from where they can then access the BIS Dynamic groups functionality?

spark phoenix
#

@warm gorge here is one shit code that works

#

should work with any inputAction defined and any key combination

#

given that its a keyboard combo and not a mouse button

#

This is arguably the worst thing ive ever written so dont judge

dusk sage
#

just include the header 😛 ?

spark phoenix
#

its a live compile for the DIK_(key) so #define wouldnt work so i just parsed them all in as variables 🤣

dusk sage
#

🙈

spark phoenix
#

lul

#

like i said

#

worst thing ive ever written in the last 2 years of my life

#

but its just the basic concept i wanted shadow to get

#

_ids = actionKeys BLOCK_ACTION;
_names = actionKeysNamesArray BLOCK_ACTION;
using ids and names to block shift+T alt+T and normal characters

lavish ocean
#

it's working, if not you doing something wrong or bug ...

tough abyss
#

Thanks @jade abyss!

jade abyss
#

wut?

#

i didn do nuttin

tough abyss
#
[4:42 PM] Dscha: 
call compile "hint 'a'";
call compile "hint str 123";

https://community.bistudio.com/wiki/compile
https://community.bistudio.com/wiki/call(edited)
compile
call
jade abyss
#

Ah, yeah. That was me.

tough abyss
#

😆

twilit tartan
#

Anybody using aissp script?

tough abyss
#

Is there a way of checking a player name and by his name determine which classname of vest give to him?

#

Do it for 20 players without running through all of them

jade abyss
#

what?

tough abyss
#

?

jade abyss
#

Don't answer with a questionmark to a question^^

tough abyss
#

I didn't know what to say though :I

jade abyss
#

Is there a way of checking a player name and by his name determine which classname of vest give to him? <- ?

tough abyss
#

here's an example

#

I want a player named "mark" to have the vests with the class name "tf24_marciras_assaulter_aor2_mark"

#

I have 6 versions of this classname, assaulter, grenadier, machineguner, etc,etc

#

I have 20+ classnames with other names than "mark"

jade abyss
#

This "playername mark" part is confusing me

#

am just guessing what you mean

player addVest format["tf24_marciras_assaulter_aor2__%1", name player];```
#

¯_(ツ)_/¯

tough abyss
#

😮

#

that's it? .-.

jade abyss
#

uhm, i guess. I still have no clue if that was helpfull or not^^

tough abyss
#

get outta here

#

:I

jade abyss
#

But the Syntax up there works

tough abyss
#

yeah that's what I want

jade abyss
#

(i still don't get, why a player needs the name "mark" to get that Vest. That still confuses me)

tough abyss
#

so now let's say you are a player and your name is Dscha and I have a classname with "Dscha" in the end. it will be like player addVest "tf24_marciras_assaulter_aor2_dscha";

jade abyss
#

Yep

tough abyss
#

I made the vests have the player names on them

tough abyss
#

sorry I didn't say that in the begining

jade abyss
#

wut? Don't make it yourself so hard.

#

You made that Vest yourself (have the MLOD?)

tough abyss
#

no, I only re-textured it

jade abyss
#

But you know.. there will be no Vest added ,when the name is not existing?

tough abyss
#

it's possible to make the vest have the player name on it without this thing?

jade abyss
#

Okay okay, wait

#

wait

#

So: You want a Texture on a Vest, that shows "Mark", "Grenadier" etc?

#

depending on, who wears it.

#

OR
do you want the names of that person (who is wearing it) on a Vest?

tough abyss
#

do you want the names of that person on a Vest?

#

^ that

jade abyss
#

Then...

#

don't do it that way

#

You end with ... erm... a few trillion names (and configs/Textures) or players don't receive a Vest

tough abyss
#

I know, I mean only the players in-game will receive their own vests

jade abyss
#

Outgame wouldn't make sense^^

tough abyss
#

well yeah ><

jade abyss
#

But what if a guy connects with "[GGH] HellBoyMasterLeetYOLOSwagL0rd" ?

#

^^

tough abyss
#

oh

jade abyss
#

I doubt you will have that in your Config, wich would result in:
tf24_marciras_assaulter_aor2_[GGH] HellBoyMasterLeetYOLOSwagL0rd

tough abyss
#

right ><

jade abyss
#

😂

#

(solution: I can't think of any, tbh. Not without draw3D, and that takes alot ofp erformance)

tough abyss
#

I won't have that kind of name in my group since I force first names and last names

indigo snow
#

ever open a phone book?

#

lots of those

tough abyss
#

but you're still right

indigo snow
#

shame you cant target vests with hiddenselections

#

would have been an avenue

tough abyss
#

yeah

jade abyss
#

Even if -> He only Retex them, so adding a HiddenSelection can't be added

tough abyss
#

there's something else though. what if someone connects with a name I don't have

jade abyss
#

unless he gets the MLOD (Source)

#

Thats what i said.

#

You end with ... erm... a few trillion names (and configs/Textures) or players don't receive a Vest

tough abyss
#

it's quite different .-.

#

oh right nvm

#

pft

#

sooo

#

it's impossible?

jade abyss
#

You better scratch that. Might be a nice idea, but not doable a) without mlod/Source file b) your current knowledge (no offense)

indigo snow
#

for every name? yes. A select set of names, sure.

#

keep in mind that would be 6 or so full textures per name and filesize goes up fast

shadow sapphire
#

How might I plug BIS_fnc_findSafePos into this?

[((getMarkerPos "M1") findEmptyPosition [20,50,"B_APC_Tracked_01_AA_F"]), 180, "B_APC_Tracked_01_AA_F", _G1] call bis_fnc_spawnvehicle;
Sleep 1;
[((getMarkerPos "M1") findEmptyPosition [20,50,"B_APC_Tracked_01_AA_F"]), 180, "B_APC_Tracked_01_AA_F", _G1] call bis_fnc_spawnvehicle;
Sleep 1;```
tough abyss
#

@indigo snow yes

#

it's something like 50mB per name

indigo snow
#

so 10 guys already half a GB

#

@shadow sapphire what do you want with it?

#

just use it to get you a position, you already use findEmptyPosition there

jade abyss
#

50MB ????

#

What's the Size of the Texture 40960x40960?

indigo snow
#

10MB textures 😄

shadow sapphire
#

@indigo snow, I'm trying to spawn an armor troop, but after the first few tanks, they all start spawning inside each other. So, I'm trying to figure out an alternative command to keep them from spawning inside each other.

indigo snow
#

plug ((getMarkerPos "M1") findEmptyPosition [20,50,"B_APC_Tracked_01_AA_F"]) into BIS_fnc_findSafePos

#

(or just spawn less tanks)

tough abyss
#

it's actually 30 but it doesn't make any difference doesn't it? 😦

jade abyss
#

Not rly, wayyyy to big

tough abyss
#

well that's the size of the texture :I

shadow sapphire
#

Spawning fewer tanks isn't really an option. If they don't have a full armor troop, it won't even be a challenge for my players.

indigo snow
#

just plug that location into the other function then

tough abyss
#

I have 14 textures for a name, 7 different camos * 2 textures of the model

indigo snow
#

although im quite sure that other function already uses that command

shadow sapphire
#

I don't understand the syntax. That's why I asked how to plug it in.

indigo snow
#

look up BIS_fnc_findSafePos in the function viewer

shadow sapphire
#

Really, I don't understand what center is or how to designate it.

indigo snow
#

it takes like 9 arguments

#

center is probably just a position

#

the position it searches around

tough abyss
#

although all of the struggle, there is no other method that takes the name of the player, checks if theres a classname with that name and if there is he will get the item with the name, if isn't he will get tf24_marciras_assaulter_aor2_noname?

shadow sapphire
#

Right, but can I put my marker in there as center? I figure I'll just go ahead and try it.

indigo snow
#

Adir thats easy to do with format amd some checks if the classes exist

#

DelJ you should check the function documentation

#

Cant know that by heart

tough abyss
#

Alright, thanks @indigo snow and @jade abyss

shadow sapphire
#

I'm staring at it, but I'm not a scripter, haha. I don't really understand it.

tough abyss
#

I will try IFs and formats

jade abyss
#

np

indigo snow
#

isClass too

#

To check if the uniform classname exist before you try adding it

tough abyss
#

thanks 😃

#

what about isNil ?

indigo snow
#

Thats not relevant

#

That looks if a variable exists

tough abyss
#

I don't fully understand how isClass works. isClass (configFile >> "cfgPatches" >> "addonClass")

indigo snow
#

You point it at a config entry

tough abyss
#

addonclass is the classname of the item?

indigo snow
#

Since uniforms have config entries, in order to exist it should have a class

#

Yes but probably not in that place

#

Reference your config.cpp

#

Youll want the entry in cfgWeapons IIRC

tough abyss
#

isClass (configFile >> "cfgWeapons" >> "tf24_marciras_assaulter_cptnnick_aor1")

shadow sapphire
#

Update! BIS_fnc_findSafePos is vastly superior to findEmptyPosition.

Not even in the same league. If you ever have trouble with findEmptyPosition, use BIS_fnc_findSafePos instead.

austere hawk
#

just use the clan or unit texture for this. Way better solution. Works on vanilla stuff too

#

give every guy a custom texture with whatever logo you want + his name in it

#

doesnt work on vests, but thats life. Who needs their name on headcap, uniform, weapon, vest, shoes... all at once? unless this is a dementia group...

inner swallow
#

is there any command available that can check which addons are required by the mission, or which will return the name of the addon that an object belongs to?

#

i.e. something like getObjectDLC but for addons (PBOs)

still forum
#

_Exp stuff comes from Apex. The rest of the DLC stuff everyone has anyway

inner swallow
#

@still forum yeah but do you know a way to check this within the game?

#

like via scripts or something

inner swallow
#

ooooh

#

thanks a lot!

inner swallow
#

hmmm i don't suppose

{

if (configSourceMod (typeOf _x) == "tanoa") then {/*do something*/};

} forEach all3DENEntities select {typeOf _x == "structure"};```

would work? I know "tanoa" and "structure" are probably the wrong strings to use, but will `(configSourceMod (typeOf _x)` work or is the full path required?
still forum
#

I'm very sure it needs full path

#

It's not like the BIKI examples only show full paths. And It's also not like that command expects config and typeOf returns a string...

#

I guess you can answer that question yourself 😉

inner swallow
#

yeah that's what i was thinking too, but was hoping/wishing that it work regardless 😛

#

so is it a good assumption that there's no way to querry addons without knowing the full config path?

still forum
#

Yeah.. But getting full config path is not that hard.. Structures are CfgVehicles afaik

inner swallow
#

I see.

#

Would mods be consistent about this? Assuming non-BIS mods are involved.

still forum
#

It's not possible to have vehicles outside of CfgVehicles..

#

So... I suppose that Mods would be somewhat consistent in having vehicles in CfgVehicles..

inner swallow
#

Cool, thanks for the help, will see if i can get something to work.

tawny urchin
#

Is there a command to tell AI pilots to fly with anti collision lights on or would anti collision lights turn on automatically when set to safe or careless?

#

Thanks

vapid frigate
#

use forEach?

#

or if you really want to make it a multidimentional array, _newArray = _oldArray apply { [_x, 20] };

#

err nvm, think i misunderstood

#

from your 20 example

#

which i think should have been 15

#

i don't know of a good way (just counting/removing them)

#

need to keep the array in tact?

#

only way i know is probably messier

#

would have to use while count array > 0 instead of foreach, and

array = array - [array select 0];```
tough abyss
#

@tough abyss on my phone, but how about this?

array = [["magname", 4], ["magname2", 2]];
{
     entity addMag [_x select 0, _x select 1];
} forEach array
#

Randomize quantity and class?

#

pushBackUnique may be useful?

#

Nice

#

What's the implementation for this?

#

Ok, gotcha

#

Should work nicely. Don't see the network fingerprint being much tbh

#

Never seen selectRandomWeighted before.

#

For sure.

#

Are you limited to adding 1 item x quantity every time?

#

Would be nice for it to take an array

warm gorge
#

For regularly getting values such as prices of weapons/items/vehicles etc, would I be better off using 2 dimensional arrays or configs with getNumber/getArray etc?

dusk sage
#

That depends if they're arrays or not? 😛

warm gorge
#

What do you mean @dusk sage

dusk sage
#

You're asking if you should use getNumber or getArray

#

Oh right

#

Misread

warm gorge
#

yea

dusk sage
#

It's your preference

#

How would you feel more comfortable doing it? There is no 'better' way

warm gorge
#

Just wasnt sure if it was faster one way or the other

dusk sage
#

Most people use configs (personally I'd say it's more elegant, unless you want to fill up your namespaces with invididual names)

#

You're talking negligible times

vapid frigate
#

i think usually you're better off using configs, because otherwise you sorta have to search in SQF

#

which is gonna be slow

#

(unless you use some sort of index.. but it gets messy)

#

having it in a variable does have the advantage of being able to edit it on the fly though

tough abyss
#

How would I go about applying code using forEach to each unit in an array of groups?

#

forEach units group _spawnedUnits doesn't seem right...

vapid frigate
#
{
     _group = group _x;
     {
          _unit = _x;
          //your code
     } foreach units _group;
} foreach _spawnedUnits;```
#

(_group and _unit are just to make it clearer)

tough abyss
#

Hm, ok. Thank you.

vapid frigate
#

err sorry that's for if _spawnedUnits is an array of groups like you said

#

would have to be _group = group _x; if it's actually an array of units

tough abyss
#

Will I have to adress every unit as in the code as _unit or is it still _x?

vapid frigate
#

inside that foreach, it will be both

#

you can remove the _unit = _x if you want

#
{
     {
          //your code
     } foreach units group _x;
} foreach _spawnedUnits;```

would also work
tough abyss
#

Thanks.

vapid frigate
#

that will do groups/units multiple times though (ie 10 guys in 1 group in _spawnedUnits will run your code 10 times on each guy)

tough abyss
#

Eh... that's kinda bad.

vapid frigate
#

yeah, depending on what you're doing

tough abyss
#

Basically this ```SQF
#include "script_component.hpp"

private _i = 0; // Private loop number var, so we can hint it later
_spawnedGroups = [];

// Froup spawning loop
for [{_i = 0}, {_i <= 5}, {_i = _i + 1}] do {
// Select random pos at a max distance from player
_aiPos = [player, GVAR(maxDistance)] call CBA_fnc_randPos;

// Check if pos is too close or if pos is on water, if so exit loop
if (((player distance _aiPos) < GVAR(minDistance)) || surfaceIsWater _aiPos) exitWith {};

// If above is false, spawn defined groups
_dummyGroup = [_aiPos, GVAR(groupSide), GVAR(groupArray)] call BIS_fnc_spawnGroup;

// Move spawned group into array, for which code will be ran on each element
_spawnedGroups pushBack _dummyGroup;

};

// Apply code to spawned units
if (GVAR(unitCode) != "") then {
{
{
call compile GVAR(unitCode);
} forEach units group _x;
} _spawnedGroups;
};

// Hint how many groups were spawned based on number of loops, max is 5
systemChat format ["Created %1 groups", _i];

vapid frigate
#
private _allUnits = [];
{
     {
          _allUnits pushBackUnique _x;
     } foreach units group _x;
} foreach _spawnedUnits;

{
     //your code
} foreach _allUnits;
tough abyss
#

So code will only be ran on units inside _allUnits?

vapid frigate
#

yep, which is all units 1 time (because pushBackUnique)

tough abyss
#

Nice.

vapid frigate
#

all the units in all the groups that _spawnedUnits are in that is

#

looks like you have _spawnedGroups, not _spawnedUnits though?

tough abyss
#

Yes.

vapid frigate
#

then if the groups are already unique, you can just use

#
{
     {
          //your code
     } foreach units _x;
} foreach _spawnedGroups;```
#

otherwise you can make them unique by adding _spawnedGroups arrayIntersect _spawnedGroups at the top

tough abyss
#

They're spawned using BIS_fnc_spawnGroup so they're already unique.

#

As seen using diag_log ```
11:25:41 "SPAWNED UNITS: [B Alpha 1-4], DUMMY GROUP: B Alpha 1-4"
11:25:41 "SPAWNED UNITS: [B Alpha 1-4,B Alpha 1-5], DUMMY GROUP: B Alpha 1-5"
11:25:41 "SPAWNED UNITS: [B Alpha 1-4,B Alpha 1-5,B Alpha 1-6], DUMMY GROUP: B Alpha 1-6"
11:25:41 "SPAWNED UNITS: [B Alpha 1-4,B Alpha 1-5,B Alpha 1-6,B Alpha 2-1], DUMMY GROUP: B Alpha 2-1"
11:25:41 "SPAWNED UNITS: [B Alpha 1-4,B Alpha 1-5,B Alpha 1-6,B Alpha 2-1,B Alpha 2-2], DUMMY GROUP: B Alpha 2-2"
11:25:41 "SPAWNED UNITS: [B Alpha 1-4,B Alpha 1-5,B Alpha 1-6,B Alpha 2-1,B Alpha 2-2,B Alpha 2-3], DUMMY GROUP: B Alpha 2-3"

#

It's meant to be "SPAWNED GROUPS" 😛

vapid frigate
#

yeh then the last one i pasted should work

#

without the arrayintersect

tough abyss
#

Thanks again 😄

austere granite
#

Is there a way of figuring out a PBO location on disk through scripting?

tough abyss
#

Quick question, is this proper?

private _someCode "
    // Some Code Here
";

[[], call compile _someCode] remoteExec ["spawn", _owner];
still forum
#
private _someCode = "
    // Some Code Here
";

[[], compile _someCode] remoteExec ["spawn", _owner];
#

But I'm not sure if you can do multiline strings like that

tough abyss
#

Tested in debug console

#

Guess so

#
myString = "
this is a 
multilinestring
";

myString:

"
this is a 
multilinestring
"
#

But true, I guess I don't need the call. Thanks

gray thistle
#

Hello there so i am developing atm a dynamic campaign with use of extDB and i am currently working on the player persistance, i am thinking at the moment about how i will call the script if i use for that initPlayerServer.sqf , initPlayerLocal.sqf or init with an MissionEventHandler like PlayerConnected and Disconnected

tough abyss
#

You can do it either way @gray thistle

#

Server needs to setup connection to db

gray thistle
#

This is already done and the Data is already recived is just need to think about the execution

tough abyss
#

Client can request to server to get the information. Server gets it and sends it back to the client.

gray thistle
#

So i have my functions ready and tested now i want to know a good way to execute the functions and there are more than one possibilty it seems

#

And i am not asking for the perfect code just for informations about the pros and cons of each possibility

tough abyss
#

Client:

[_uid, _sender] remoteExec ["query_fnc_checkPlayer", 2];

Server:

// Code for getting result from db if they exist
[_playerExists] remoteExecCall ["process_fnc_playerCheckReturn", (owner _sender)];

Client:

if (_playerExists) then {
    // Have them query the data
    [_pid, _sender] remoteExec ["query_fnc_getPlayerData", 2];
} else {
    [] call Process_fnc_newPlayerSetup; // Does a similar thing as ^ but inserts new player
};
#

Personally the process I go about with getting it.

gray thistle
#

i am working quiet diffrently since i use extDB3

tough abyss
#

As do I

#

I have the server run a server only mod for handling the transfer of data, etc.

#

Client just sends requests and handles returns

gray thistle
#

sure i thought in the beginning about a init which saves all 5 minutes for each player their progress if they are already in the DB, let them either insert & update while getting on the server the first time, and give them a action to save for themselfs if they want to be sure, also well on the disconnect

tough abyss
#

Easily done, just loop every 5 minutes and run [PASS DATA HERE] remoteExec ["query_fnc_updatePlayer", 2];

#

Server needs to know what query_fnc_updatePlayer is and run it, which inputs data into db.

gray thistle
#

sure, this is the easiest part of all already have done that with some enviroment part

while {true} do {
sleep 60;
[] call ser_fn_updateingametime;
};
jade abyss
#

```sqf
//NextLineIsCode
```

#

@gray thistle

#

👍

gray thistle
#

i don't know much of the remoteExec part yet but i am learning still this is the first project and since i am often throw code awy and create a new one cause of new informations this isn't a big issue

#

also you brought in some ideas already about one part

#

if a player joins on the server is it faster to load or insert data over an eventscript like initplayerServer.sqf or an eventhandler like PlayerConnected

#

i mean such task only have to be executed once

jade abyss
#

initplayerServer.sqf

#

OR:
Use in the mission folder the
initPlayerLocal.sqf
Player connects -> blackScreen+waitUntil{VAR} (maybe input disabled later?) -> Send a request to the Server vis IPL.sqf -> Let the Server handle the stuff, send it back to player via remoteExec -> after Vars are set (or Gear assigned, or whatever you wanna do) -> server sends (again REC) VAR = True -> blackscreen dissapears and Player input is enabled again -> profit

#

roughly written

gray thistle
#

I think for that task initPlayerServer will do better the other option is a bit like working around a corner

#

and since it is a one time task for each player and it won't have frequently changes like KoTH the server should be handling it perfectly

jade abyss
#

Do as you please ¯_(ツ)_/¯

gray thistle
#

It's just idea gathering for an Military Roleplay Campaign (ZEUS) ^^ i trying to get some ideas with the help of you since i don't know about the most stuff i am glad about that. Is there a idea about the disconnect part? I just seen yet a MissionEventhandler and OnDisconnect which is mostly the same i seens just with a diffrence that it is stackable

austere granite
#

check the wiki, it explains it perfectly

gray thistle
#

Oh hello there Adanteh ^^

#

Okay maybe the Handler HandleDisconnect seems the way because it contains the unit not sure about the override part

gray thistle
#
player addaction["<t color='#FF0000'>Save</t>", {call ser_fn_updateplayernato;},[],0];``` can someone tell me why the UAV Terminal is still under this action? This only happens when i use the init script if i execute it over the cosole it is at the right place
inner swallow
#
_staticObjects = (all3DENEntities select 0) select {_x isKindOf "Static"};
_tanoaBuildingCount = {getObjectDLC _x == 395180} count _staticObjects;
if (_tanoaBuildingCount > 0) then {
systemChat format [ "Warning: %1 Tanoa map objects detected",_tanoaBuildingCount]} 
else {systemChat "no Tanoa map objects detected"};```

@lavish ocean would this cover all tanoa map objects? Could there be some  restricted structures that are not `isKindOf "Static"`?
inner cypress
#

Would the receiving function treat these two calls the same in terms of the arguments? I see the [] used sometimes and sometimes not, but I'm not sure of the consequences.

_arguments = [_foo, _bear, _swim];
_arguments spawn tag_fnc_doLotsOfStuff;

vs. this call

_arguments = [_foo, _bear, _swim];
[_arguments] spawn tag_fnc_doLotsOfStuff;
inner swallow
#

i think it would, yes

rancid ruin
#

2nd one is an array with args within an array

#

1st one is an array with args

#

i think

inner cypress
#

hehe

// tag_fnc_doLotsOfStuff

params ["_funcParameters"];

private _bigFoo = _funcParameters select 0;
private _bigBear = _funcParameters select 1;
private _bigSwim = _funcParameters select 2;

isn't working for me.

ERROR: Argument exception - expected ARRAY but provided ARRAY tag\functions\AI\orders\tag_fnc_doLotsOfStuff.sqf:62

#

it spits out an array, but the guard reads an array-- but it isnt

#

without the [] in the call _funcParameters comes out as OBJECT

rancid ruin
#

expected ARRAY but provided ARRAY

#

this is why we love arma scripting

inner swallow
#

lol

inner cypress
#

to be fair, I'm using CBA IS_ARRAY() macro to test, but everywhere that helper works fine

#

it's not the macro

#

I look at spawn vs call, but not sure why that would matter here

#

Is it ok to declare array's private?

private _myNewArray = [];

maybe it's the original declaration that is messing it up

inner swallow
#

btw try with _this instead of params and see what happens? not a solution but if you're trying

inner cypress
#

good advice thanks-- i never use this really

#

almost always I find these problems are the result of some minor typo way up stream and never considered

inner swallow
#

do check out the biki in that case, some of the examples looked interesting.

#

not used params much so can't be of more directed help.

inner cypress
#

kk will do

indigo snow
#

[_a,_b,_c] call FNC; ---> params ["_a","_b","_c"];

[[_a,_b,_c]] call FNC; ---> (_this select 0) params ["_a","_b","_c"];

warm gorge
#

Are waitUntil delays better used with time or diag_tickTime? I'm having trouble understanding the difference betweent he 2

indigo snow
#

time will give the time in seconds sincethe mission started, diag_tickTime since the game was launched

split coral
#

time doesn't move if the game is paused

indigo snow
#

and also that

rancid ruin
#

BI have a habit of naming their functions in a stupid way imo

rotund cypress
#

What does diag refer to?

rancid ruin
#

like endl instead of something sensible like lineBreak

#

diagnosis?

rotund cypress
#

Ah maybe thats it

warm gorge
#

Diagnostics

rancid ruin
#

what pisses me off is that there's no consistency with the names. camPreload / curatorCamera. visiblePosition / getPos. eyeDirection / getDir. the list is endless

little eagle
#

B-but diag_tickTime reads the machines system time and uiSleep reads the unsuspended simulation time : (

#

getPos alternative syntax is stupid.

split coral
#

The dir & distance one?

little eagle
#

yes

jade abyss
#

Why? oO

split coral
#

params wrong way around imo

little eagle
#

Because it's totally different from the original purpose of the command.

jade abyss
#

nope

#

original Purpose -> Get a position
Alternative -> get a position in Direction.
I can't see a problem there

little eagle
#

Get a position of an object (AGLS)

jade abyss
#

Okay, true. But who reads the Description anyway

little eagle
#

Now it also has get a position relative from an origin (object or position) (and ATL)

#

It's not about the description

jade abyss
#

Oh my Commy. Instead of beeing happy that this exist, you rant again^^

little eagle
#

Yes, because the way it's done is stupid.

jade abyss
#

🤦

#

Oh commy

little eagle
#

Glad you agree.

jade abyss
#

not rly.

#

tbh, i don't give a damn about namings, as long as the commands does, what it says.

indigo snow
#

shouldve been relPos

little eagle
#

tbh, i don't give a damn about namings, as long as the commands does, what it says.
🤔

jade abyss
#

Should be yeah.

indigo snow
#

and have options for differentiating Z or something too and be fancy

jade abyss
#

you mean switching between asl/AGL stuff?

little eagle
#

getPos normal syntax is for the trashcan anway, because AGLS lol

jade abyss
#

^^

little eagle
#

getRelPos should've been what the alternative syntax of getPos is plus an optional boolean to toggle the "relative" part.

#

also drop the "get"

indigo snow
#

if there's a get, there should be a set 😛

#

ah well

jade abyss
little eagle
#

I love that video

#

mimi mimi mimi mimi

jade abyss
#

Yeah, i know the text 100%

little eagle
#

mimi mimi mimi mimi mimi mimi

jade abyss
#

😄

little eagle
#

mimi mimi mimi mimimimi mimi mimi mimi

#

mimi mimi mimi mimi

#

mimi mim

#

MIMI

#

sorry

jade abyss
#

saved for eternety, when i get a warning for spamming and you don't 😄

little eagle
#

Do I hear "mimi mimi" from you?

jade abyss
#

Yes.

#

if("mimimi" == true)then{/rant here/};

little eagle
#

Oh noes.

open vigil
#

For Dscha

#

😉

jade abyss
#

wut?

drowsy hollow
#

I don't suppose there's an easier/better way to get the value of a local private variable from its name (as string) other than this?

call compile "_some_private_variable"
thick sage
#

_some_private_variable?

#

ah, sorry, after edit.

jade abyss
#

From a LOCAL Var? "_Var" and not "VAR" ?

#

(just to make sure)

drowsy hollow
#

yes, I thought I explicitly mentioned that in my question

jade abyss
#

You don't wanna know how many ask question but mean something else.

#

Then answer might be no. Call Compile for that only.

#

for Global Vars, it can be done with

missionNameSpace getVariable[format["My%2","VarName"],"Stuff"];```
drowsy hollow
#

fyi, i'm trying to do something like this:

fnc_array_reduce = {
    params ["_array", ["_expression", {_acc = _acc + _x}], ["_vars", [["_acc",0]] ] ];
    private (_vars apply {_x select 0});
    { call compile format ["%1 = %2", _x select 0, _x select 1]; } forEach _vars;
    _expression count _array;
    call compile (_vars select 0 select 0)
};
still forum
#

Just pass the value of the variable in instead of the name.
private (_vars apply {_x select 0}); What is this?`

indigo snow
#

Setting up an array containing the string names of local variables, probably.

#

Seems an array with [["_a"],value] pairs

drowsy hollow
#

yes, it's a list of all local variables, which might be used for the calculations in _expression

#

in simplified terms, it's to sum up an array (optionally with a more complicated expression)

quasi thicket
#

}else
{
still forum
#

Ewww

warm gorge
#

New arma update outt

jade abyss
#

Added: New modelToWorldWorld and modelToWorldVisualWorld script commands 😂

rotund cypress
#

Tweaked: Security of the debug console was improved
:kappa:

oblique spoke
#

wow at those names..

jade abyss
rotund cypress
#

👌

warm gorge
#

@rotund cypress Not sure what security improvements they mean

rotund cypress
#

Would be nice if they could've said what they improved ^

warm gorge
#

I know this is non-scripting related but theyve changed flying mechanics of everything, feels so weird flying everything now

tough abyss
#

So, I trust that the new pylon commands have better documentation now?

steep gazelle
#

I want to make Praetorian (new dlc turret) OPFOR. Is there any script for that?

rancid ruin
#

modelToWorldWorld what?

mortal shoal
#

How to remove next d panel from mouse wheel

little eagle
#

You can't with scripting.

#

@rancid ruin Same as modelToWorld, but instead of reporting PosAGL, reports PosWorld,which is the same as PosASL, but relative to the model center instead of the lowest LandContact point.

rancid ruin
#

what a crazy name for a function though

steep gazelle
#

Done

little eagle
#

The name of PosWorld is fucked. Should've been PosASLCenter

rancid ruin
#

i wish they would just go back and make aliases for all these functions

little eagle
#

inb4 "mimimi"

steep gazelle
#

joinSilent script

#

it's soooooo OP

rancid ruin
#

like when they realised they spelled damaged wrong 🤙🏿

jade abyss
#

@little eagle "mimimi"

#

😄

dusk sage
#

Has anyone brought up the right panel actions yet? Any info?

#

(the addactions there 24/7)

little eagle
#

look at convo

grand berry
#

Has any seen the enableTraffic command before? Just noticed it in latest stable - its on the wiki but only for ToH.

dusk sage
#

ta

jade abyss
#

Anybody know, if intersect is broken or not?

rancid ruin
#

90% sure it wasn't broken a few months ago, not sure about now

#

disregard, i was thinking of lineIntersectsObjs

jade abyss
#

Yeah

subtle ore
#

@BoGuu#1044 the panels have been a problem since day 1 even on the dev, rc revisions. Dunno.

#

@grand berry is it available on the function viewer? I was very intreaged by it as well, just no documented parameters.

jade abyss
#

hm, with LOD "FIRE" it detects both, GEOM and VIEW not. strange

grand berry
#

@subtle ore not sure, will give it a look in a minute

abstract sigil
#

@here did anyone ever suggest "BOOL := is64Bit()" as a script command?

#

or integrate it into productVersion() ?

#

(let me guess. i am dumb and it is already in productVersion() ?)

#

^ confirmed

#

that is what happens when you dont look into arma for half a year

vague hull
#

I wouldn't call the state of being dumb temporary

rancid ruin
#

what?

jade abyss
#

@austere hawk The annoying part is: You rly have to filter out the dmg... no clue why 0 dmg is beeing in the HandleDamage EH anyway :/

austere hawk
#

it returns the current damage... i only just realized this now

#

this makes this EH super useless in trying to detect how much damage was actually caused

jade abyss
#

Yes and No. You have to store the current Dmg in the Vehicle itself (setVar).
Still -> Messy as hell and nonsense

austere hawk
#

yes i was thinking that. I just dont get the point. Why do you need to return current damage? It can be easily read with getHit and the equivalent commands when you have a selection.

jade abyss
#

e.g. if you wanna negate dmg (safezone etc.). Otherwise the dmg could restore that Hitpoint to 0 again.

#

or when you wanna alter the Dmg handled itself (e.g. reduced dmg from bullets)

#

+"when you have a selection." <- thats also a strange thing, sometimes the selection is an emptry string.

#

Same with the _hitPartIndex (wich can be -1)

austere hawk
#

empty selections are either wrongly configged hitpoints, or global Hitpoints

#

if hitpartindex is -1 its global hitpoints, otherwise not

jade abyss
#

iirc i tested with Vanilla Vehicles

austere hawk
#

like i said, you can easily get the hitpoints by different means and also find pretty well what part is actually meant. What you cant get easily is the damage caused, at least not without pointless checking of every hitpoint every hit, custom variable writing and reading (needs to be globally synched after all...)

zinc fossil
#

Anyone here messed around with making extensions for arma?

jade abyss
#

"What you cant get easily is the damage caused" <- _damage - oldDmg 😄 happy workaround again

zinc fossil
#

Alright will do, thanks 😃

austere hawk
#

@jade abyss and where do you get oldDmg from?

jade abyss
#

mom

subtle ore
#

Your mom gave you oldDmg Dscha? What a lucky boy 😀

jade abyss
#

roughly ripped apart:
mom

austere hawk
#

oh, i thought the hitpoint already has updated values when the EH triggers. apparently it doesnt. just tested it

#

ok that makes things alot easier

jade abyss
#

Could be that. Last time was ~4-5 weeks ago, that i touched it. Confused myself

params["_unit","_hitSelection","_damage","_source","_Projectile","_hitPartIndex","_instigator","_hitPoint"];

_NewDamage = _unit getVariable ["CurrentDamage",0];
if( _damage > 0 )then
{
    if(isNull _source || {_source isEqualTo _unit})then
    {
        _NewDamage = _NewDamage + _damage;
    };
    _unit setVariable ["CurrentDamage",_NewDamage];
};
_NewDamage```
#

no clue why i have that isNull _source in it... hm...

#

i tend to confuse myself pretty often oO

#

dafuq did i wrote there?

austere hawk
#

no, i mean i used getHit for the hitpoint, and it returns the "old" value that was there before the handledamage

#

no setVariable

jade abyss
#

Could work also. No clue. I still try to figure out what i did there 😑

austere hawk
#

it does work, i just tested it

#

except now i feel pretty stupid... or bad at reading. Welp, at least the fix to my script is easy now.

jade abyss
#

At least (dafuq did i wrote there...)

#

AH!

#
        {
            _NewDamage = _NewDamage + _damage;
        }```
= When crashing with your Car against a wall
#

(got a dmg modifier, thats why i need that)

austere hawk
#

isnt there a config param for that?

#

epe something

#

wlep, fix to script easy, except now i have to retune all my damage values. Great fun.

jade abyss
#

epe available in non-Dev?

austere hawk
#

epeImpulseDamageCoef = 30;

jade abyss
#

whats that now. Oh my

#
epeImpulseDamageCoef
int≥0, (PhysX)

<?>Undocumented: the name suggests this is a coefficient influencing how much damage the vehicle takes from physics-controlled impacts (i.e. crashing into a wall, another vehicle, etc.). Higher numbers suggest the vehicle takes more damage from such events.

[undocumented]```
https://community.bistudio.com/wiki/Config_Properties_Megalist#epeImpulseDamageCoef
austere hawk
#

ima baseclass explorer, thats why i know this shit 💩

jade abyss
#

^^

#

dang hitpoint sys

austere hawk
#

i'm used to it now. considering i thought there was yet another bug that i had to circumvent and now i dont, i feel even slightly better about it 😄

lunar mountain
#

Greetings. Any config entry which helps me decide if a vehicle is actually a DLC/Expansion vehicle or not? Using configsourcemod command now, but I think that's not 100% reliable. Eg: m-900 shows up as Apex. I think the non-civ classnames were added in Apex, original was in Heli DLC, but not even sure if it needs heli dlc.

austere hawk
#

every DLC weapon has a special icon in EDEN. So maybe you could search for all the DLC icon pathnames?

little eagle
#

The config entry is named "dlc".

austere hawk
#

pahhh too easy 😄

lunar mountain
#

yes, Jets DLC doesn't have it

#

AND

#

although it's not vehicle, but some Apex objects which are in the vanilla package (so you don't need to have or download APEX) actually has them

austere hawk
#

the icons or the classname?

lunar mountain
#

the DLC config entry 😄

#

eg dlc = "expansion"

#

just looking for a reliable way to tell if they are DLC locked or not without testing eveything

little eagle
#

Sounds like a problem with the Jets DLC then.

#

Try this?

#
configSourceModList (configFile >> "CfgVehicles" >> "B_Plane_Fighter_01_Stealth_F")
-> ["jets"]
lunar mountain
#

yes, that's what I tried

little eagle
#

....and?

lunar mountain
#

as far as I can tell, it's still not representing actually if it's dlc locked, but testing it now

little eagle
#
private _test = "B_Plane_Fighter_01_Stealth_F" createVehicleLocal [0,0,0];
private _result = getObjectDLC _test;
deleteVehicle _test;
_result

-1
hmm

lunar mountain
#

yeah, that would be the usual hacky workaround 😛

little eagle
#

Yeah, but it doesn't work.

#

Seems like it's broken. Probably BECAUSE the DLC config entry is missing.

austere hawk
#

jet dlc isnt deployed yet, is it? maybe thats why

little eagle
#

Oh, but I'm on 1.70 and the planes are in the game 😐

austere hawk
#

stable?

lunar mountain
#

eg: Land_IRMaskingCover_01_F . It's in the vanilla game without Apex, shown up as apex, showing "expansion"

little eagle
#

["Arma 3","Arma3",170,141764,"Stable",true,"Windows","x64"]

#

And I just created a "B_Plane_Fighter_01_Stealth_F"

lunar mountain
#

I_C_Heli_Light_01_civil_F is Apex "content", also you can get into it without Apex

#

this is my actual problem

austere hawk
#

hm ok then i wonder why i still get the DLC warning even though i have the DLC - which i thought way because Steam doesnt "know" the BI pack yet

#

but propably unrelated then

little eagle
#
getText (configFile >> "CfgVehicles" >> "I_C_Heli_Light_01_civil_F" >> "dlc")
#

"Expansion"

lunar mountain
#

yes, but it's not

little eagle
#

That was APEX, no?

lunar mountain
#

😄

#

it is APEX, because Apex added the independent one, but it's not DLC locked

little eagle
#
private _test = "I_C_Heli_Light_01_civil_F" createVehicleLocal [0,0,0];
private _result = getObjectDLC _test;
deleteVehicle _test;
_result
lunar mountain
#

yes, this is it

#

manually creating the list, here I come

little eagle
#

reports nil

lunar mountain
#

I mean, I know it works

#

but for example.. for an ingame vehicle shop... it might not be the best idea to create every listed vehicle locally to test if it's DLC content, right? 😄

austere hawk
#

i would make a request for a function to BI if you dont find something that works easily. This seems like something they should provide and maintain.

#

if you get lucky you have killzone kid jump on it and have it the next day ^^

little eagle
#

I thought maybe "dlc" is ignored when inherited like "author" is, but:

#
getText (configProperties [configFile >> "CfgVehicles" >> "I_C_Heli_Light_01_civil_F", "true", false] select {configName _x == "dlc"} param [0, configNull])
#

"Expansion"

lunar mountain
#

I made a "layout" editor for our multiplayer mission. General rule that you cannot place Apex objects on Altis/Stratis, as it would need the players to have Apex expansion. But there are Apex, but not apex objects. I basically disabled Apex and listed all the addon/pbo names and created a whitelist 😄

#

I just wanted to avoid such solution

austere hawk
#

that heli it part of the dlc, so "expansion" is not wrong, but its of the free part

little eagle
#

That could be it, but then how to determine if you have access to an object?

#

getObjectDLC alone?

#

Requires an object and not classname.

#

Also a bit tricky to handle since it reports nil.

lunar mountain
#

nil can be handled if you expect it 😃

little eagle
#

And -1 for the jets, so maybe they haven't come up with a id for the DLC yet.

lunar mountain
#

well, they have an id

little eagle
#

-1

#

seems more like a placeholder

#

or what I would've used instead of nil

#

confusing, confusing

lunar mountain
#

id is basically the appID of the steam game

#

it's 601670

#

oh it really returns -1

#

the heck 😄

little eagle
#
_plane = cursorObject;

[isDLCAvailable getObjectDLC _plane] param [0, true]
#

That's the magic words, but it needs an object. Classname insufficient.

lunar mountain
#

isShowingWatermarksIfIequipIt

little eagle
#

Yeah. No idea what you'd use for weapons.

#

And items etc.

lunar mountain
#

I think there was something for the weapons, but I'm not sure anymore

little eagle
#

The classnames are listed in configfile >> "CfgMods" >> "Jets" >> "Assets" in arrays in subclasses.

lunar mountain
#

hm

little eagle
#

Including weapons. Not for jets DLC, but for marksemen at least.

lunar mountain
#

but does that mean only those are locked?

little eagle
#

I think that's how it's done.

#

reference[] = {"CfgVehicles","B_Plane_Fighter_01_F"};

#

configfile >> "CfgMods" >> "Jets" >> "Assets" >> "DLCJetsBluforFighterJet" >> "reference"

#

tryAsset[] = {1,"B_Fighter_Pilot_F","B_Plane_Fighter_01_F"};

#

configfile >> "CfgMods" >> "Jets" >> "Assets" >> "DLCJetsBluforFighterJet" >> "tryAsset"

#

BUT

#

This command is broken and doesnt work on dedicated server

#

¯_(ツ)_/¯

lunar mountain
#

I relly just want a command where I can put vehicle/weapon/magazine/whatever classname and get the DLC(s)

#

anyways... it conforms me a little that I wasn't just not paying attention and it is actually a real issue

little eagle
#

Well there are all the assets to hack something together.

lunar mountain
#

assuming they are only showing the dlc locked assets

little eagle
#

Pretty confident in that. The heli you mentioned for example is not listed in configfile >> "CfgMods" >> "Expansion" >> "Assets" >>

lunar mountain
#

configfile >> "CfgMods" >> "Heli" >> "Assets" >> "DLCBcivilianHeli"

#

tryAsset[] = {1,"C_Man_Pilot_F","C_Heli_Light_01_civil_F"};

#

C_Heli_Light_01_civil_F is not DLC locked 😛

little eagle
#

Shrug

#

What do I know. Maybe it's woven into the models.

lunar mountain
#

possibly

warm gorge
#

Anyone know the difference between using RscDisplayDebug and RscDisplayDebugPublic?

rotund cypress
#

Well, RscDisplayDebugPublic is inherited from RscDisplayDebug @warm gorge

#

Essentially, exactly the same. You get all the RscDisplayDebug stuff with RscDisplayDebugPublic

warm gorge
#

Was just wondering if something was changed, because I use createDialog with it in an admin menu which no longer works

#

Shows nothing but a cancel button at the bottom so wasnt sure if it was changed or something

rotund cypress
#

createDialog "RscDisplayDebugPublic";?

warm gorge
#

yes

rotund cypress
#

That is very strange, tried it yesterday. Worked fine.

#

Are you on a mod?

warm gorge
#

Worked fine up until this update, and no no mods. Vanilla arma

rotund cypress
#

Do you have it on escape in 3DEN?

warm gorge
#

Works fine in singleplayer, but not in multiplayer

rotund cypress
#

It's the same files

#

In singleplayer and multiplayer

#

IIRC

warm gorge
#

In singleplayer it works fine both through createDialog and escape menu, however on a mp server it doesnt display it properly.

#

On a different topic, is there any way to control the capabilities of vehicle radars? I cant find any scripting commands or difficulty settings regarding it

rotund cypress
#

I can't remember, but I would advice checking the changelog 1.70

warm gorge
#

@rotund cypress Come to think of it, could my issue have something to do with the user not being a logged in admin? Related to these security improvements

rotund cypress
#

if you are using createDialog, shouldn't have an effect.

warm gorge
#

Yeah hmm

rotund cypress
#

I'll double check for you one sec

#

In your debug console, do call BIS_fnc_isDebugConsoleAllowed

#

But hmm, you don't have access to it anyways

#

One sce

#

I cannot remember if that was there before

#

But that is the check upon opening it

warm gorge
#

I noticed that that script was changed

#

Which is why im thinking it might be the case

rotund cypress
#

Ye so, BIS_fnc_isDebugConsoleAllowed is now blocking it.

#
[
    "DebugConsole", 
    getMissionConfigValue ["enableDebugConsole", 0]
] 
call (missionNamespace getVariable "BIS_fnc_getParamValue");```
#

try putting enableDebugConsole = 1; in description.ext and see if that solves your problem.

warm gorge
#

@rotund cypress Yeah making myself an admin seems to work. Do you know if its possible to have multiple admins logged in at once?

rotund cypress
#

No you cannot be logged in multiple at once

#

However, you can assign preset UIDs in server.cfg in order to not have to input password when logging in.

warm gorge
#

Will that work for multiple admins? Because im gonna need to allow debug console for certain players

#

Will be extremely painful having only 1 person to access debug console at one time

rotund cypress
#

I could suggest to copy/paste the debug console into your mission and remove the BIS_fnc_isDebugConsoleAllowed

warm gorge
#

Where can I find the full class for it

#

Console viewer displays it weirdly

rotund cypress
#

Well, it is in ui_f

#

Under RscDisplayDebug

#

And RscDisplayDebugPublic

#

Then you need the function which handles the debug console. Which is located at ui_f/scripts/GUI/RscDisplayDebug.sqf

warm gorge
#

Alright ill give this a go

#

@rotund cypress Having trouble finding RscDisplayDebugPublic.hpp, however I did find the .sqf

rotund cypress
#

It's in the ui_f / config.bin

#

Which you will need A3 Tools CfgConvert in order to convert to a cpp

#

Then in there RscDisplayDebug and RscDisplayDebugPublic will be located

warm gorge
#

@rotund cypress Found the class, so the onLoad/onUnload calls BIS_fnc_initDisplay, I assume that then calls the RscDebugConsole.sqf?

rotund cypress
#

Yep

#

So just do the following

#

[_this, "onLoad"] execVM "location of RscDIsplayDebug.sqf";

#

Put that in onLoad

warm gorge
#

Alright sweet time to give it a go

#

Ill let you know how it goes

rotund cypress
#

I think I jacked up big time

#

RscDisplayDebug does not check function BIS_fnc_isDebugEnabled

#

I was looking in wrong debug console script

#

(RscDebugConsole.sqf)

#

So there shouldn't be an issue, but give it a go if you want

warm gorge
#

@rotund cypress It must be called somewhere for it to be preventing access. If its not in RscDisplayDebug.sqf then I dont think this will work lo.

rotund cypress
#

RscDisplayDebug is the script called when doing createDialog "RscDisplayDEbugPublic"

#

RscDebugConsole.sqf is the script called when pressing escape if I think correctly

#

So that would be why that is doing a check for isDebugConsoleAllowed

warm gorge
#

RscDebugConsole.sqf contains onLoad and onUnload modes. Just having trouble finding any checks to see if the player is admin in this script

rotund cypress
#

It has checks in RscDebugConsole, it does not have checks in RscDisplayDebug

warm gorge
#

Ah yeah I see what you mean now

#

Just trying to find where RscDebugConsole is called

rotund cypress
#

look at RscDisplayPause

warm gorge
#

Yeah this is ridiculous. This debugConsoleAllowed check is in the actual code execution scripts as well. Ill have to message Killzone Kid about this causse I noticed he wrote a couple of these scripts. Theres gotta be a way for multiple admins to access the debug console

rotund cypress
#

There isn't.

#

Not with the one in Pause Menu

#

It is however possible with createDialog "RscDisplayDebugPublic"

warm gorge
#

Its not though because the buttons on it (Local exec, global exec, server exec) dont work unless the user is an admin (checked through isDebugConsoleAllowed)

#

Im looking at the updated execution scripts for all the buttons now

rotund cypress
#

The buttons wont work in MP if you don't have call in CfgRemoteExec

warm gorge
#

fn_debugConsoleExec.sqf:

if (isServer && call (missionNamespace getVariable "BIS_fnc_isDebugConsoleAllowed")) exitWith
#

This is called at the top off the script which is run when you click Local Execute, Server Execute etc

rotund cypress
#

And that is called from where?

warm gorge
#

The buttons in the debug console for executing on server, global and local call that script

rotund cypress
#

In what script

#

RscDebugConsole?

warm gorge
#

Yes

rotund cypress
#

Well, that is the wrong one.

#

You need to be looking at RscDisplayDebug.sqf

#

or RscDisplayDebug in config.cpp

#

RscDebugConsole is probably the one in pause menu

tough abyss
#

It's RscDisplayDebugPublic.

warm gorge
#

Thats what im trying to use, but it doesnt work for non-admins

#

Before this update anyone who could call createDialog "RscDisplayDebugConsole" could use it fine. Now the user needs to be an admin to access it

#

Because somewhere in the scripts behind it theres calls to this new fn_isDebugConsoleAllowed script

rotund cypress
#

Not for RscDisplayDebugPublic

tough abyss
#
In multiplayer, the debug console is unavailable by default. It is possible to make it available by configuring access option (see below). It is worth noting that when debug console is configured for admin access, it is only available for logged in admin, voted in admin is treated just like any other user in this respect.
indigo snow
#

that would be the menu integrated one though

rotund cypress
#

^^

#

As I've been trying to say

indigo snow
#

youve always been able to create the display scriptwise

#

i could check tonight if our admin tools been affected for you if you havent solved it by then

tough abyss
#

What's inside fn_isDebugConsoleAllowed.sqf?

rotund cypress
#

Its the check for default debug console in Pause Menu @tough abyss

#

Checks the missionConfigFile for allowDebugConsole = number;

warm gorge
#

It also checks if the user is an admin, or if we're in singleplayer. But this is what im trying to say, something has been changed with RscDisplayDebugPublic which now uses this fn_isDebugConsoleAllowed otherwise if that check fails you cant use it

#

I understand the pause menu debug console is different, but the other one created through createDialog is now also affected

#

@indigo snow Please let me know. Because my admin menu worked fine calling createDialog "RscDisplayDebugPublic

#

Now it doesnt.

rotund cypress
#

You are on about RscDebugConsole in Pause Menu

indigo snow
#

they might have changed the rsc itself in the latest update

#

ill take a peek tonight

#

in the meantime you might just wanna set that BIS_fnc_variable to true first or something

#

oh wait thats just a roundabout way to call the function

tough abyss
#

From changelog: ```
Tweaked: Security of the debug console was improved

indigo snow
#

worst case just copy the rsc and remove that requirement

rotund cypress
#

Hmm

warm gorge
#

Thats what im trying to do but cant find the related checks for it

rotund cypress
#

I just tried it on MP

#

It only shows cancel

#

So I guess you are right @warm gorge

#

Just do as I previously mentioned then

warm gorge
#

Yeah thats what im trying to work on now, but im just having trouble trying to figure out exactly which scripts I need to work with

#

Cause theres multiple for debug console stuff

rotund cypress
#

RscDisplayDebug class and rscDisplayDebugPublic class

#

And script RscDisplayDebug.sqf

#

With all the functions which it is calling

indigo snow
#

it's probably an onLoad event?

rotund cypress
#

Yes ^

indigo snow
#

just copy the rsc into a custom class and modify the unload

#

assuming this is a mod thing btw

warm gorge
#

@rotund cypress @indigo snow So it turns out RscDisplayDebugPublic calls RscDebugConsole.sqf, so would need to change quite a few scripts to make a custom class for this. Not only RscDebugConsole.sqf, but also fn_debugConsoleExec.sqf which is called for each execute button as these all make calls to isDebugConsoleAllowed. Very painful for something so simple

rotund cypress
#

Shouldn't be that hard

indigo snow
#

but you can change the config entry that calls that script 😉

rotund cypress
#

Just copy everything

#

And also as Cptnnick said

warm gorge
#

How would I change the config entry that calls it

indigo snow
#

with a mod

rotund cypress
#

With a mod

warm gorge
#

lol

#

In my case I wouldnt be able to do that as its a non-modded server

rotund cypress
#

Then your options is copy/pasting

warm gorge
#

yup

rotund cypress
#

Or writing an angry letter to bohemia describing your frustration wishing they will revert back kappa

indigo snow
#

its a decent speedbump for scriptkiddies

rotund cypress
#

^

warm gorge
#

Considering isDebugConsoleAllowed checks for the variable BIS_fnc_admin, couldnt that just be set manually or is there some sort of thing in place that prevents that

rotund cypress
#

I mean @warm gorge if you copy/paste it, you can have it do whatever you want, i.e. server side check to make sure they are admins

#

It's compiled finally

#

So no

warm gorge
#

Ah alright, welp, guess ill just have to make my own debug console and just edit all the scripts. Annoying but I guess once done it works

rotund cypress
#

^

#

I have a question for the peeps here. I am currently working on a system for the dynamic loadouts. I am struggling with a good way of finding out what magazines are compatible

#

I have checked in the vehicle class, but nothing there

#

So I guess it would be under the magazine itself, but that makes things complicated

#

No it's not in CfgMagazines either, so maybe I would check hardpoints then and check them together... hmm

indigo snow
#

compatible magazines are stored in the weapon config

#

or at least before

#

the new pylon system might work differently

rotund cypress
#

Ah ye right, but that seems to complicated to do, I think maybe comparing the hardpoints on the pylons to the magazines are easier

rotund cypress
#

Yes

#

Well, as long as server initializes

#

I call the extension on server init

#

initServer.sqf

#

if (isServer) {callext...};

indigo snow
#

why an isServer in initServer.sqf?

rotund cypress
#

I dunno, just wrote it there 😛

#

But yeh, no really need for it

thick sage
#

could someone check this: count [1] + [2] gives error on evaluates to 2?

#

(not in windows atm)

vapid frigate
#

you would be better to do count [1] + count [2] anyway

indigo snow
#

count wowuld be a unary operator here

vapid frigate
#

so it doesn't create a whole new array just to count

indigo snow
#

unary commands have higher precedence than +

#

so it would evaluate to (count [1]) + [2]

thick sage
#

count is both a unary and binary operator. My question is whether what matters is the operation (count [1]), or the operator (count).

indigo snow
#

without a code block in front of it it acts as a unary operator

thick sage
#

so, to double check, {true} count [1] + [2] returns 2

#

because now count is binary, and + has precedence over binary

#

@vapid frigate yes, this was just an example of a unary/binary op on the left side of a binary op, to double check operators precedence.

indigo snow
#

it should but likewise i have to access no arma atm

vapid frigate
#

yeh fair enough.. i just add brackets when it's not obvious

#

better for anyone reading your code that doesn't know all the obscurities anyway

indigo snow
#

i figure the code itself just serves as an illustration to the underlying question

#

the precedence behaviour of commands that can both be unary and binary

thick sage
#

@vapid frigate I agree, but since I am programming the SQF parser (https://github.com/LordGolias/sqf), I need to implement it 100% correctly. Because the whole point is to detect when someone "abuses" precedence.

vapid frigate
#

ah, understood 😃

#

count [1] + [2] = error
{true} count [1] + [2] = 2

#

(tested)

thick sage
#

Thanks a lot for testing it ingame!!

indigo snow
#

man that'll be fun to parse since youll have to find out if a command willbe behaving unary or binary

#

[] call { { true } } count [1] + [2];