#arma3_scripting

1 messages · Page 407 of 1

ripe imp
#

whats the best way to construct that array from inside the eden editor?

#

besides plopping down markers and copy pasting

lone glade
#

doing something else right now, so nothing better than this is coming to my mind

#

oh wait

#

mouse eh

ripe imp
#

and what if I wanted in the future to adjust a map marker

#

i wouldn't want to have to edit an array of x y z coordinates

lone glade
#

well, it's better than having n number of markers pre-placed and "hiding" them....

ripe imp
#

perhaps 8)

#

ok thanks! gonna marinate on that

astral tendon
#

i have a new problem, even if i use disableAI "move" the car still moves if the gunner order to move

ripe imp
#

gunner too swole

astral tendon
#

any work around to that?

lone glade
#

is the gunner a player?

astral tendon
#

yes

#

in this case, me

lone glade
#

is it intended for sp or mp?

astral tendon
#

the gunner is never supouse to give orders anyway

lone glade
#

he's the current commander of the vehicle, so yes he is

astral tendon
#

to work around this usue i use unit capture

#

even if he is a civilian or enemy?

lone glade
#

no

#

but BI changed how vehicle "commanding" works in SP

austere granite
#

Did you consider using a trigger?

astral tendon
#

I did.

ripe imp
#

i have a blah.sqf script that is attached to an addAction. is there some way to keep a variable between invocations of this script, e.g. "some_variable = time" such that it doesn't lose value between calls via the in game menu? I've tried currentNamespace but it always turns out to be = 0 at the start of the script, unless I'm missing something obvious...

austere granite
#

literally some_variable = time;

#
_timeSinceLast = missionNamespace getVariable ["quakephiltag_some_variable", 0] - diag_tickTime;
quakephiltag_some_variable = diack_tickTime;
ripe imp
#

whats the typical naming convention for variables in armaverse? blah_blah? blahBlah?

#

i guess blah_blah

lone glade
#

tag_myVarName

#

CBA / ACE has the GVAR macro and all it's variants for making that easier

austere granite
#

most common 3 is letter tags,

#

ADA is best tag, buy Cardano now

ripe imp
#

is there anything like hashes in arma scripting? can i ever do something like var[somestring] = blah?

lone glade
#

no, but we do have cba hashes

jade abyss
#

What do you mean with "hashes"?

ripe imp
jade abyss
#

var[somestring] = blah
var = "abc"; ?

astral tendon
#

another question, is there a way to disable vehicle brakes?

jade abyss
#

no

subtle ore
#

what

#

what are you even on about

jade abyss
#

@astral tendon You can disable breaks via config (0.00001 breakforce), but NOT the handbreak, when the Vehicle is not moving.

astral tendon
#

this hole week i am trying to figure ou how to make gunners not give orders to the driver, now i am trying to fix it with unit capture, but the AI brakes

lone glade
#

you mean nested arrays?

jade abyss
#

That's why i asked. No clue what he rly wants ¯_(ツ)_/¯

astral tendon
#

wile the car does move with unitplay but the AI keep braking because hes loveling gunner is not ordering to move

#

so the wheels drag on the road

#

my last atempt is to remove the driver entirely

ripe imp
#

so that blah.sqf that i'm calling from my addAction has a variable which, naturally, is undefined at the beginning. somewhere in my script i set it to a value, but is it possible to check earlier in the script to see if it has been set (previously) or not?

I tried "if (!isNull myvar) then { ..." but it is still telling me Error Undefined variable in expression: myvar

#

i guess I can just set it to a blank value... duhh

#

thanks again for your guys help over the past few days, i'm actually cracking this sqf crap 8)

jade abyss
#

isNil

#

If you want help, you have to be more precise

#

isNull = Checking for an Object
isNil = Check if Var exists

#
if ( isNil "_Var" ) then{systemchat "Var isNil"};
_Var = 1;
if ( !isNil "_Var" ) then{systemchat "Var  !isNil"};
ripe imp
#

I was missing the double quotes TT

jade abyss
#

Not rly with isNull

#
_player = player;
if(!isNull _player)then{systemchat "player is not ObjNull"};
ripe imp
#

you might not believe me, but i already have, and i was staring at those two exact pages for several minutes before realizing i was missing the double quotes TT

jade abyss
#

with IsNull? I doubt that

ripe imp
#

i must not have even had an object at that point

jade abyss
#

Then why do you check for IsNull?

ripe imp
#

because i want to check if the variable has been set or not

jade abyss
#

ISNIL

ripe imp
#

yup

#

"yup"

jade abyss
wispy kestrel
#

I am tring to get code in a stacked event handler to fire on a dedicated server; I can't seem to get it to work.

["attendanceConnected", "onPlayerConnected", {
    _name = _this select 2;
    _uid = _this select 1;
    _text = format ["Connected:  -  %1  -  %2" + "<br /><br />", _name, _uid];
//    {[_x, "Attendance", _text] call BIS_fnc_createLogRecord;} forEach allPlayers;
    [player, "Attendance", _text] remoteExecCall ["BIS_fnc_createLogRecord", -2, true];
}] call BIS_fnc_addStackedEventHandler;
restive matrix
#

does addPublicVariableEventHandler not fire for JIP clients when they receive the JIP queued pubvar?

cloud thunder
#

maybe if you could add the addPublicVariableEventHandler before receiving the JIP queued pubvar but not likely as the JIP queued pubvar has priority and is received first i believe.

meager heart
#

or ```sqf
waitUntil {!(isNull player)};
...addPublicVariableEventHandler

cloud thunder
#

wut? is to late by then and will never fire because the pvar has already been received.

#

pvars sync befor !isnull player

meager heart
#

Only that way it was working for me

cloud thunder
#

just check not isnil pvar and do what you need to with the data and let pveh handle from then on

meager heart
#

Btw i don't know is it still need it, we have now remoteExec

cloud thunder
#

they are different things, remotexec does not detect updated pvar

meager heart
#

Well yes, but i mean you can do things without pVars spam in global

cloud thunder
#

ofcourse you can update the data globally with pvar but you can't make another machine do code when it is updated unless you have a loop contantly cheching for update wich is what addPublicVariableEventHandler does in a very efficient way.

#

the benefit of pvar is that it has priority, remoteexec global is schecduled

meager heart
#

Yes i understand that it's like "right tool" for the job

peak plover
#

I would not use pvh

#

Does on connected not work at all

#

Isn't it supposed to be missionEH

#

Do u even need addstacked in 2018?

lone glade
#

Nope

#

not when missionEH exist

little eagle
#

Oh boy.
@wispy kestrel onPlayerConnected stacked eh doesn't pass it's args in _this, but other magic variables. _name, _uid, _owner etc. You overwrite them with undefined _this select N.
@restive matrix No, PVEH does not fire for JIP clients.
@meager heart @cloud thunder The only limitation is, that it does not work in frame 0. Which only matters if you mess around with preInit functions. All your other beloved init scripts and boxes are executed after frame 0.
@cloud thunder There is no magic priority of PV or PVEH. It's the same as RE, but more efficient and safe due to skipping the CfgRemoteExec stuff. All dumb rumors.
Also, PVEH is not a constantly checking loop. It only checks an array of (decompiled/stringified) functions if a variable was received. This may even be a hash, I don't know the internals, but the array of variable names listened to should be very small anyway. Like zero in vanilla and three with CBA. And maybe six with ACE. It's nothing.
@peak plover Stacked eh has two benefits: EHIDs are strings, so you can easily overwrite (remove old and replace with new) previous eventhandlers. And you can pass arguments. Neither is used here, so they could use addMissionEH, which would pass the args in _this.

meager heart
#

There is no magic priority of PV or PVEH. It's the same as RE, but more efficient and safe due to skipping the CfgRemoteExec stuff...
I thought exactly opposite about "the safe way" i know that hackers was using it with BIS_fnc_MP...

lone glade
#

BIS_fnc_MP is just a wrapper for remoteExec now

little eagle
#

"Safe" as in safe from mission makers breaking it.

meager heart
#

yea well... thanks for the info guys

restive matrix
#

thanks for the info @little eagle

sullen willow
#

Hey guys! Quick question: Is there any way to reduce the range of which an object is interactable? I made a simple takedown command but you can use it from like 30 feet away so it looks like you're killing a person with your mind.

lone glade
#

yes, which type of action? addaction?

little eagle
#

addAction?

sullen willow
#

Yes, addaction

little eagle
lone glade
little eagle
#

Haha, faster

sullen willow
#

This is what I've got on the guy that you're able to take down

#

this addAction ["<t color='#FF0000'>Takedown</t>", "takedown.sqf"]

lone glade
#

go fix the build error you introduced commy 😄

little eagle
#

What?

sullen willow
#

will take a look @lone glade

little eagle
#

: (

#

@lone glade What build error?

lone glade
#

check #dev on slack

#
#define PREP(var) FUNC(var) = compileFinal preprocessFileLineNumbers format ["fnc_%1.sqf", QUOTE(var)]
//#define PREP(var)
//is: FUNC(#0#) = compileFinal preprocessFileLineNumbers format ["fnc_%1.sqf", QUOTE(#0#)]
//was: [QPATHTOF(functions\DOUBLES(fnc,#0#).sqf), QFUNC(#0#)] call CBA_fnc_compileFunction
In File \z\ace\addons\arsenal\missions\Arsenal.VR\script_component.hpp: Line 3 #define altered without a #undef
little eagle
#

That's a make error if anything.

lone glade
#

yeah :/

little eagle
#

And redefining macros is valid, only Mikero's Tools errors out on it, because apparently valid syntax is baaad.

#

#undef PREP before it.

restive matrix
#

I setup a simple mission Draw3D eh, and use drawIcon3D to draw an icon over a player, works great until they get into a vehicle then the updates seem staggered/glitchy (due to vehicle sync i guess?) , anyone have a workaround ?

little eagle
#

Well, once they sit inside a vehicle they become proxies attached to the vehicle. Which probably slows down their simulation frequency. Using the visual getPos etc. commands should solve that.

lone glade
#

afaik it does

restive matrix
#

ok thanks, ill try out getPosVisual

little eagle
#

getPos is bad for this anyway, because it reports the distance to the lowest pathway LOD below the object. Your icon would appear under the object if it stood inside a watchtower, on a roof, or on a stone or a harbor pier.

sullen willow
#

Ok, so I got this- radius (Optional): Number - 3D distance in meters the unit activating the action must be within to activate it. -1 disables this radius. Default (and max) value: 15.

So how would I translate that into the script? (I'm still really new at this.)

little eagle
#

Dunno if that's true for getPosVisual. Wiki says no implicitly.

sullen willow
#

thug1 setDamage 1;

#

is the script I'm using

meager heart
#

getPosATLVisual and then _pos set [2, <adjust>]; ?

lone glade
#

I prefer visiblePosition _x,

little eagle
#

You pad your addAction with all the default values for the args you don't want to change. There is an example on the wikis comments. @sullen willow

#
ASLToAGL getPosASLVisual _object;
lone glade
#

visiblePosition is AGLS btw

little eagle
#

For getPos this is needed to report AGL, but it may not for getPosVisual.

lone glade
#

nope, indeed

#

both are AGLS

#

use getPosVisual.

little eagle
#

Yeah, and getPos is AGLS, which is different from AGL.

lone glade
#

oh, forgot the S on my second post

little eagle
#

AGL and ASL is what most commands need.

#

Dude.

#

Whatever. Try it out inside watchtowers and adjust it accordingly.

sullen willow
#

I'm gonna be trying to get this to work for 15 hours straight lmao

little eagle
#

lol @lone glade The wiki says both are the same, but one describes AGL and the other describes AGLS. FML.

restive matrix
#

still getting simulation issues

lone glade
#

mind posting the code / a gist ?

restive matrix
#

sure one sec

little eagle
#

@sullen willow Stare at the last comment on addAction's wiki page.

#

For 15 minutes and you will get it.

#

There is no other way to explain it.

restive matrix
#
addMissionEventHandler ["Draw3D", {
    if (!isNull player) then {
        private _remoteUnits = missionNamespace getVariable ["Hades_RemoteUnits", []]; //array of players remotely controlling ai
        {
            private _remoteUnit = _x getVariable ["Hades_RemoteUnit", objNull]; //players current remotely controlled ai unit
            if (!isNull _remoteUnit) then {
                private _pos = ASLToAGL getPosASLVisual driver vehicle _remoteUnit;
                private _text = name _x;
                private _icon = "\a3\ui_f\data\map\Markers\military\box_CA.paa";
                private _color = [1,0,0,0.7];
                
                drawIcon3D [_icon, _color, _pos, 1, 1, 0, _text, 0, 0.05];
            };
        } forEach _remoteUnits;
    };
}];
sullen willow
#

Might help if I knew what I was doing in the slightest. Thanks anyway.

little eagle
#

@restive matrix Well looks like ACE uses visiblePositionASL, so it probably can't get better than that.

meager heart
#

Something like this maybe ? ```sqf
private _position = getPosATLVisual _unit;
if (isNull objectParent _unit) then {
_position set [2, 1]; //--- on foot
} else {
_position set [2, 2]; //--- vehicle
};

lone glade
#

that's not related to the issue

little eagle
#

^ Also, ATL != AGL

#

You need AGL, and if there's no command for AGL, you need to convert from ASL.

#
_target modelToWorldVisual (_target selectionPosition "head")

^ something else you can try.

lone glade
#

honestly i'm not sure if AGL was the right name for that, AFL? "above feet level" ?

restive matrix
#

dang, same issue with visiblePositionASL , for context its on a local dedi

little eagle
#

@lone glade The names are beyond hope. No point in trying to rationalize them. Just learn them.

lone glade
#

😦

little eagle
#

Like you'd a foreign language.

#

One alternative is to store the relative position of the vehicle type somewhere and to use visible/getPos/ASL/Visual/World/whatever on the vehicle and vectorAdd the offset.

#

That'd work, but may be not feasible.

restive matrix
little eagle
#

Yeah, that is where I copied it from. Well, nametags component, but same diff.

restive matrix
#

works perfectly

little eagle
#

Nice.

cloud thunder
#

@little eagle
I never said PV was magic.
Rocket said they had priority but what does he know. Shame on former BIS dev spreading dumb rumors.
https://forums.bistudio.com/forums/topic/129103-arma-2-oa-beta-build-94209-160-mp-compatible-build-post-160-release/?tab=comments#comment-2133294
I know eventhandlers are not loops per say. Wrong wording on my part.
On a related a note biki's description of addPublicVariableEventHandler says

  • EH will not fire on the machine that executed broadcast command, only on the machines that receive the broadcast.
    which is not true..
    For example, this code ran from hosted local server will fire the PVeh.
"paddscore" addPublicVariableEventHandler {_data = _this select 1; (_data select 0) addScore (_data select 1);};
paddscore = [player, 5]; 
publicVariableServer "paddscore";```
lone glade
#

OA != arma 3

cloud thunder
#

still applies

#

the last part I mean

still forum
#

@ripe imp CBA has Namespaces and hashes which can both be used as "hashes" but Namespaces are the only real hash maps where you can only use strings as key

#

@cloud thunder publicVariable and publicVariableServer are two slightly different things

cloud thunder
#

both work the same in example context..

lone glade
#

you're sending the var to the server, which is where the code is executed

still forum
#

publicVariable means "Send to anyone else" so the local PVEH wouldn't receive it.
publicVariableServer means "Send to server" if you re the server then ofcause you will receive it

cloud thunder
#

yes and where the pveh is

still forum
#

So no they don't work the same

#

if you are on the server then actually not at all

lone glade
#

it's like remoteExec'ing something to yourself then wonder why it works.

cloud thunder
#

just tried it with publicVariable and score keeps going up... I don't wonder why it works. Been using it for a while. i know it works.. bibki say those two commands can't be used on same machine.

#

biki*

still forum
#

Then fix biki

#

I guess that wasn't touched since OA and has changed since then

cloud thunder
#

I think that note is newer than OA

still forum
#

Where does it actually say that on biki? Can't find it

#

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

EH will not fire on the machine that executed broadcast command, only on the machines that receive the broadcast.
That? As you can see it kinda contradicts itself as if you send something to yourself you executed the broadcast command and also recveived the broadcast

#

And if you actually read what's on that page

While it is true that the event handler will only fire on the machine receiving the broadcast value. Please note that this machine can actually be the same machine broadcasting it in the cases of publicVariableClient and publicVariableServer.

cloud thunder
#

EH will not fire on the machine that executed broadcast command

#

works with publicVariable too

still forum
#

That note was added March 2013

#

That is OA time.

cloud thunder
#

So A3 then. was playing A3 in 2013 its been working this way at least since OA in A2.

still forum
#

A3 was released september 2013

cloud thunder
#

nothing has changed then? note is wrong?

still forum
#

And as I said. If you actually read the full page you'll see the note from 2015 that says that exactly what you are experiencing is also expected

cloud thunder
#

Like i said it even works with publicVariable so no, even SilentSpike's note is wrong

#

or misleading

still forum
#

Maybe just use remoteExec then. It was kinda made to replace PVEH anyway

cloud thunder
#

two different commands. its not a replacement. remoteexec was made to replace call RE from A2.

still forum
#

You mean replace BIS_fnc_MP? Which was using PVEH?

cloud thunder
#

addpublicVariableeventhandler works like a very efficient trigger for custom Vars

lone glade
#

Change in remExField triggers execution of eventhandlers on all clients in the network game (initialized in init.sqf), script remExServer.sqf interpretes remExField (remExFP resp.)

#

do you even read what you post

#

it was using PVEH

#

it's just an array that get changed and trigger PVEHs

#

hell, it's directly said right above:

library of scripts that are performing non-global script commands globally on network
using publicVariable + addPublicVariableEventHandler (EH that fires for each publicVariabled variable on all clients - excluding calling client) + direct call on calling client

cloud thunder
#

well, except you could use it without having to place an eh in init.sqf or any where to make it fire..

still forum
#

same as remoteExec now

cloud thunder
#

if (isServer) then { [nil, nil, rEXECVM, "Scripts\Tasks\clocks\CheckPoinETimer.sqf", time] call RE; };

still forum
#

And not really

lone glade
#

🤦

still forum
#

They automatically place the EH in init

#

You just don't see it

lone glade
#

it's written black on white on the page he linked

cloud thunder
#

remoteExec is scheduled

still forum
#

no it's not

#

remoteExec might run scheduled under certain circumstances

#

But if you complain... remoteExecCall is not scheduled use that

lone glade
#

or, you know, add a scheduled check and re-run the func with CBA_directCall if that's the case

cloud thunder
#

lol

little eagle
#

@cloud thunder Yes, it is a dumb rumor. The source of a dumb rumor doesn't matter.

#

All he said was, that using publicVariableClient/owner reduces network traffic compared to publicVariable sending it to everyone. That is nothing new or surprising.

still forum
#

Most people are just like "That's whats happening! I read the wiki! I might have stopped reading after the first two lines but you don't need to know that."
And that's how rumors happen. Or if the wiki is actually wrong...

little eagle
#

remoteExec is scheduled
This is contextually wrong though. RE is the same as REcall for commands and unscheduled for e.g. call.

#

So saying "remoteExec is scheduled" is wrong.

#

The wiki is pretty clear:

Scripted function - scheduled environment (suspension is allowed, i.e. spawn, execVM).
Script command - unscheduled environment (suspension is NOT allowed). 
cloud thunder
#

were talking about custom code and vars not remotexecing a command. stay on track

little eagle
#

Well you utter one falsehood after another. Hard to do so.

still forum
#

"custom code" that's what remoteExec can do.

lone glade
#

reading comprehension 0/10

still forum
#

and remoteExecing call myFunction is the same as a PVEH that call's myFunction

little eagle
#

RE is short for remoteExec btw. No one cares or should care about A2.

lone glade
#

not only that but RE for A2 is PVEHs

little eagle
#

Well duh, how else would it work.

lone glade
#

so not only his point is moot but it's a link he provided ....

little eagle
#

RE (A2) is just a very dumb function name.

#

RE (A3) is abbreviated for remoteExec.

cloud thunder
#

I didn't bring up A2, only replied to mention of A@

#

A2

little eagle
#

Including scripting questions.

#

So, and now we all agree that PVEH somehow having priority over RE is a dumb rumor.

cloud thunder
#

whast was your source?

little eagle
#

The game.

still forum
#

What @cloud thunder called "priority" was just scheduled vs unscheduled.

#

So calling it priority in the beginning was bullshit

little eagle
#

Well, that is not what priority means, and not even what the post of that Arma dev is about. The post is even older than RE.

still forum
#

Because that has nothing to do with that

little eagle
#

Yep.

cloud thunder
#

I think what he ment by priority was network stack or que.

#

but thats subjective like dumb and bullshit

little eagle
#

Well, for "priority" to make sense, you'd have to know over what. It's kind of a relative term.

still forum
#

You have no Idea how the netcode works though. It isn't documented anywhere

little eagle
#

Certainly it's not over RE, because that was made after the post in question.

cloud thunder
#

but commy does, he has that game

still forum
#

No commy doesn't

#

Even I don't

little eagle
#

All I see is, that a post talking about how PVclient and PVServer can be used to save network traffic over PV (others) is again and again used to justify that RE is somehow more efficient or some bull shit.

#

And that is a dumb rumor.

cloud thunder
#

I see it as a Dev who had access to internal engine and says all pvs are high priority netcode and to steam lint the message stack use pvsever and pvclient where you can to limit netcode.

little eagle
#

Well, and who's surprised by that?

still forum
#

Well yeah. They are high priority and reliable transfers

little eagle
#

Of course sending it to one client is less work than sending it to everyone and then discarding it.

still forum
#

Just like a shot being fired

#

Just like remoteExec. Though PVAR and RemoteExec are probably lower than fired shots

cloud thunder
#

probably? this is how rumors start

still forum
#

uhuh... yes

#

sure.. Although it doesn't actually matter at all whether fired shots are higher or lower

#

and something being "high priority" actually doesn't say anything

#

because "ultra priority" and maybe 10 or 20 other levels are still higher than "high priority"

little eagle
#

Almost as if:

Well, for "priority" to make sense, you'd have to know over what. It's kind of a relative term.

errant jasper
#

I think high priority here might just be a bad synonym for "reliable".

little eagle
#

And what is the unreliable alternative? It's all bs.

still forum
#

Yeah same

#

unreliable as in UDP @little eagle

errant jasper
#

You don't have an unreliable alternative in SQF. But the game uses that internally. Like movement, turning

#

voip/von

still forum
#

position updates are unreliable transfers

little eagle
#

That makes sense, but it doesn't affect anything of what we can do, and it doesn't mean what countless people made it out to be and frequently annoy me with.

cloud thunder
#

well you can tune accuracy for that with network settings at expense of bandwith but you can't tune it for pvs necessarily

queen cargo
#

i know one thing for certain: if you think you know everything about a topic, you probably do not know anything at all

#

what i also do know is: it is easily testible which one has priority above the other using a dripping network and wireshark

#

if anyone here really wants to know, he can test it

still forum
#

traffic is encrypted and packed. So no. not really wireshark

queen cargo
#

you still can use wireshark

#

packages differ in size

still forum
#

but it won't really tell you anything

#

As I said. Packed.

scarlet spoke
#

Does SQF support scientific number notation? Something like _myNum = 3e123

queen cargo
#

yes

still forum
#

yes

little eagle
#

Yes.

#

lol

queen cargo
#

just had to implement it in sqf-vm to parse the allinone config

little eagle
#

get outta here, lol

errant jasper
#

All game uses packing. Even if you have 60 FPS, the game might only send frames out 20 times per second. It packs stuff into as few messages as possible to get less overhead.

still forum
#

Well. I guess @queen cargo has the lowest ping here

queen cargo
#

won

#

also typing speed above average ❤

scarlet spoke
queen cargo
#

because it is syntax

still forum
#

It is listed

#

The largest real positive number that can be entered via script is: 3.4028235e38

scarlet spoke
#

well indirectly yes

#

but it isn't mentioned that SQF does accept it that way

queen cargo
#

scientific syntax also includes 1.123e-2 etc. btw.

errant jasper
#

Degrees are a poetic licence used to indicate a number returned from functions like acos and asin

#

What? Poetic license?

scarlet spoke
#

Even 0xFFe$A

still forum
queen cargo
#

and might include the 1.23e+45 variant too

little eagle
#

Evene 0xFFe$A
This is a crime against humanity.

queen cargo
#

wat

#

hexa also works?

#

now that rly is broken if scientific wouldwork

#

though ... sqf-vm does not support hexa ...

#

do not think i ever will add

#

though ... it is kidna simple

little eagle
#

e, e+ and e- all work. Also big E works, which I prefer, because it's not confused with Eulers-Number as much.

scarlet spoke
#

@little eagle true but isn't that what SQF is all about?

queen cargo
#

hah ... crap ... forgot the big E actually in my code 🤦

#

or more: the tokenizer

austere granite
#

big E for president

little eagle
#

Fix it.

still forum
#

unfix it

queen cargo
#

it is fixed

#

and even pushed now

#

now go and play around with config stuff my minions @signal peak daddy needs to know if he did wrong somewhere else

little eagle
#

But does Arma understand 0xFFe$A I wonder.

queen cargo
#

please no

#

that is horrible

scarlet spoke
#

I think not... What should that mean anyway?

little eagle
#

It probably doesn't work, because E is 14.

queen cargo
#

he means 0xFFe4A

scarlet spoke
#

But you can do this: 0xAA + $F2

#

Ahhh

#

Didn't see the e

queen cargo
#

and i highly doubt that syntax could ever work

#

as E is in the hexa decimal range

little eagle
#

Yeah, the E is ambiguous.

#

Do hexadecimals even support commas?

queen cargo
#

should not

scarlet spoke
#

I just wondered the same

queen cargo
#

hexadecimal should behave as if you would directly input binary data

#

should work with floating points, but you would have to calculate the floating point yourself

little eagle
#

We need COMPLEX_NUMBER type in SQF. Would make some math on map positions easier 😛

queen cargo
#

also i yet have to see a language where hexa.hexa would work

austere granite
#

Arma needs COMPLEX_HUMAN aka female, but we dont have those either

still forum
#

(╯°□°)╯︵ ┻━┻

queen cargo
#

you already got a complex number ... a floating point value @little eagle

#

BIG_NUMBER would be interesting though

#

allowing for endless growth

little eagle
#

You think that can be abused for complex math?

still forum
#

How about double precision floating points?

queen cargo
#

what complex math?

little eagle
#

sqrt -1

queen cargo
#

nobody wants that @still forum
booohhhhh

still forum
#

Btw.. I think I can easilly replace all script floats by doubles

little eagle
#

You think that'd break anything?

still forum
#

dunno if operators like * and such would convert back down to float.. probably would

#

no..

#

I think others that want to access them have to convert back to float.. so.. Wouldn't change anything 😄

#

unless we make new * n such operators

#

But at that point we could just make a new bignumber type

little eagle
#

Intercept can add types right?

queen cargo
#

if they are casted to float, probably will downscale

still forum
#

yeah

little eagle
#

Might be best to just make it a type...

queen cargo
#

nah .... what we need is BIG_NUMBER then

#

not double

still forum
#

Just go ahead and make a Intercept_CBA PR

little eagle
#

haha.

still forum
#

Problem is that you need a custom fromStringToBigNumber function to generate these types

little eagle
#

Right after you release TFAR v1.0

queen cargo
#

such a method would not be that complicated
already wrote numeric parsers

#

just let me dig through old code quickly

still forum
#

I guess every big number library will have a parse function anyway

meager heart
little eagle
#

Here's a test to find out which of them has "priority":

"PV" addPublicVariableEventHandler {systemChat str _this};
"RE" remoteExec ["systemChat"];
missionNamespace setVariable ["PV", "PV", true];
missionNamespace setVariable ["PV", "PV", true];
"RE" remoteExec ["systemChat"];
still forum
#

Make the PV variable be as long as systemChat

#

otherwise you have a size difference

little eagle
#

🤔

still forum
#

The remoteExec transmits "RE" and "systemChat" and some flags
the PVAR transmits "PV" and "PV" and some flags

little eagle
#
"TystemChat" addPublicVariableEventHandler {systemChat str _this};
"RE" remoteExec ["systemChat"];
missionNamespace setVariable ["TystemChat", "PV", true];
missionNamespace setVariable ["TystemChat", "PV", true];
"RE" remoteExec ["systemChat"];
#

Like this?

still forum
#

so the PVAR is theoretically smaller. Engine might schedule based on size

#

yeah

queen cargo
#

would parse it different nowdays

#

but still: big_number is pretty simple

#

a list containing bytes so that you just can append new ones if needed

#

after the comma, you also use a byte list that you append

#

no more floating point due to more complex math required for it and big-number works more simple with bytes

little eagle
#

I don't think you're using "complex math" right 🙈

queen cargo
#

talking about emulating floating point operations yourself instead of just a simple "+" with takign the overhead

errant jasper
#

To be honest, double floating points would be nice. They have a nice performance vs precison/size tradeoff. Yes, they suffer the same underlying problem as (single-precision) floats do, but in practice the numbers you work with, it is rarely a problem, unlike float which is too imprecise for even time tracking.

queen cargo
#

but rather then implementing a double_number type a big-number type should be coming
the double instead of float is something dedmen sometime could takle to check

still forum
#

I'm quite sure it won't work like I thought

queen cargo
#

100%tbh

still forum
#

converting a anonymous value to number calls getNumber func which returns float

tough abyss
#

There is a huge performance difference between using doubles and a Big number implementation. The precision difference compared to floats is enormous as well, every bit increase is a doubling in what it can accomodate so its actually 2^32 times more accurate. Double is more than enough to measure every point in the solar system with 3 coordinates at sub millimetre precision it has enormous range and precision compared to floats

queen cargo
#

uhm ... that is complete and utter bullshit

#

nobody would use double for actual precision

#

there is too much not covered in floating points

#

want a simple example? 0.3

#

hah
there is even a webpage covering this "issue"

#

that is inb4 also why == floating points can result in false falses

#

because _myheavychangedfloat might not be 0.5 but rather 0.5000000000001

#

simply due to some rounding error happening at some random point in time

errant jasper
#

Can't tell whether you are joking or not. But precision is not about equality.

queen cargo
#

mhhh?

errant jasper
#

You cannot get ms accuracy on seconds, if there are more than 1000 full seconds with (single-precision) float. So the 'time' command is not ms accurate. But if it was double (and didn't cap the decimals) it would trivially.

still forum
#

actually you can

#

diag_tickTime is good enough for millisecond and tens of microseconds

#

at the single digit microseconds it get's bad-ish

#

even if you ran the game for hours it's still good enough ish

queen cargo
#

you cannot use floating point for precision is what i said
simply because rounding errors will happen

they are good enough for most things though ...

#

but using them eg. in satelites already made some crash

errant jasper
#

Single-precision floats can only represents numbers with 6 significant digits, so 4243.341 cannot be represented (in general)

#

You can use floating point for precision. Yes you accumulate errors, but you can reason about that. Numerical analysis, is, amonst other things, about designing floating point algorithms that result in a good enough precision.

still forum
#

If I need precision I just make my own timing functions :3

errant jasper
#

Yes, but do we know whether time command gets that directly, and the n reduce precision, or whether it accumulates it?

#

Because if it accumulates it, it can reach full second of error in 3 hours.

still forum
#

time is on each frame time += deltaT

#

diag_tickTime is systemtime directly

tough abyss
#

My point is that big numbers and doubles solve different issues. If you want greater precision then doubles get that dramatically compared to floats. Big numbers on the other hand are a lot slower but can offer arbitrary precision and other reprensetations that can deal with 0.1 better at the cost of performance. They aren't useful for the same things.

queen cargo
#

obviously not

#

time etc. in a big_number would be nice though

#

generally having an int

#

instead

#

would already solve a lot of "issues"

#

enscript will come

#

and it will be welcomed

#

((typing at compile time already is 💗 ))

errant jasper
still forum
#

so yes time is accumulating

errant jasper
#

Is there any reason to use time over diag_tickTime?

#

Ahh, nvm different starts

still forum
#

I think time resets at mission start

queen cargo
#

yup

#

in sqf-vm diag_tickTime btw. prints the current time in ms

errant jasper
#

So can you make a working serverTime, without network overhead, using diag_tickTime?

queen cargo
#

missionNamespace setVariable ["_privatevar", 123]
working or not?

still forum
#

should work

#

I don't see why it wouldn't

queen cargo
#

IIRC we already tested once
but i am right now not sure

still forum
#

@errant jasper how? If you get clients and server to use the same time then yes.

#

But I don't know how you would do that with diag_tickTime

#

in setVariable you can use anything UTF-8. Just using bare variables in code is very limited

errant jasper
#

It would not be entirely exact, which is not really possible with distributed systems anyway. But might get close. Idea:
Server sends own tickTime to client A
client A responds immediately . Server records roundtrip (it knows the time it sent), and respond with that
client A responds immedaitely (and then server) again for a couple of times.
clientA now knows roundtrip (by averaging, and maybe dropping the largest one (because reliable transfer may resend), and may assume network delay is half, so it can correct for network delay for the initial time

queen cargo
#

servertime? the hell is that @errant jasper

peak plover
#

command, returns the time on the server

#

faulty 'tho

errant jasper
queen cargo
#

why exactly is that needed?

peak plover
#

If you want to debug like FPS. and then later assemble them, you need a unified time

queen cargo
#

debug ... fps?

peak plover
#

See at which point how many fps did cleint/server have?

still forum
#

time is probably not synchronized

peak plover
#

in 2018 however

#

I belive date is decent to measure it

#

as it seems to be synchronized

queen cargo
#

what is that useful for?
server should have always the same depending on how many units it has to simulate and how much is running in awaited space
client depends on area he is in due to rendering etc.

debuging FPS is literally the most useless crap one ever could do

errant jasper
#

Date has minute accuracy

austere granite
#

serverTime is what most mods use to use a time that's synced across clients

#

aka, wanna show a cooldown, timer, whatever that isn't local, serverTime is the usual way to do it

peak plover
#

So u do like spawnwaves like that? for ex.

errant jasper
#

Yep. Cooldown is what prompted my original need.

peak plover
#

for cooldown just make ur own timer, remove 1 from the variable every second and then once it's negative it's good to go

errant jasper
#

CBA_missionTime, is almost that, except it AFAIK does not try to correct for latency, and it accumulates (thus also accumulating error).

queen cargo
#

i still do not know how it is important for anybody to have exact measurements on clients here ... important is that the server ends correctly

#

the clients "just" get a display

#

that needs to be roughly correct

still forum
#

CBA doesn't correct latency and accumulates yes.

errant jasper
#

@queen cargo Maybe things are better now. But I remembe in A2, that if a server was struggling it would have vastly different ideas of time than clients.

#

So for instance a waitUntil {time > X} would trigger on completely different times.

queen cargo
#

it still does not changes
as long as you got a number that grows upwards on all clients the same, you can relyably get a timer off correctly

peak plover
#

time slows down with fps

errant jasper
#

like minutes

queen cargo
#

and only the server needs actual accurate time to stop whatever event centralized

peak plover
#

just run your thing on the server

queen cargo
#

all other designs are designed to fail

peak plover
#

And set a variable true if it's good to use

#

or sth

queen cargo
#

doing stuff on clients event based is bs nonetheless

#

a client does not has to be bothered with anything until it happens

peak plover
#

^

queen cargo
#

that includes a bool that is awaited @peak plover

peak plover
#

You can get your second headless client handle the scripts and run all ai on the first hc

#

@queen cargo doa action >> is bool true? >> do action

#

not really waiting for it

queen cargo
#

you not even get off with an excuse for anything
nowadays, you can offload whole scripts to a separate entity

in future, you can spin up a different sqf environment to run your code on locally (thx to sqf-vm getting more and more features)

#

it is waiting because somewhere you got code running that waits for the bool

#

use remoteExec

#

and skip the waiting part completly

#

just useless crap that runs on a client for no reason

peak plover
#

No need to wait

#

For ex

#

Player wants to use a butrton

#

once button pressed, check condition

#

Don't have to loop that

queen cargo
#

that is even worse. .. that requires player input to proceed

peak plover
#

What

#

In my idea, you need the condition to use the button

#

Do you mena for something like

queen cargo
#

otherwise you just get promted with "not ready yet"

peak plover
#

Player will die if sth

#

Yeah, button that when pressed detonates a nuke

#

1 nuke per 3 minutes

#

Ofc you can't just do it as soon as the time is up

queen cargo
#

dialog is the only exception to the waiting thing

peak plover
#

you need the button to be pressed

queen cargo
#

but that is due to the nature of dialog

peak plover
#

Well

#

Any action would work, what were you thinking of?

errant jasper
#

But the point with the server struggling was that for instance, you generated a side mission using scripting. It get's cancelled within 30 minutes (using waitUntil on the server only). But because the server is struggling, player's get 37 minutes to complete it.

#

If you then had a "countdown" on the clients ,it would be off

queen cargo
#

diag_tickTime
regular updates on server on minute base

#

done

#

your problem fixed

peak plover
#

I think you need 🇮 🇳 🇹 🇪 🇷 🇨 🇪 🇵 🇹

queen cargo
#

and clients get a performance boost because they do not update themselves in a loop

peak plover
#

If your server is struggling to remain >30fps and time slows down then you have some other problems that need fixing before you can generate side missions

#

Like maybe only allow side missions if server fps > 40

restive matrix
#

i hadnt looked at intercept in awhile, is that still being dev'd on?

queen cargo
#

that is there to optimize stuff

forest ore
#

When a player spawns in on a mission what is the best way by means of scripting to remove the magazine that is attached to the weapon the player spawns with?

restive matrix
#

probably player removeMagazine currentMagazine player after waiting for the player to not be null

forest ore
#

ok, so currentMagazine is actually a thing. Will try that

#

Thanks looter

meager heart
#

Next option to try will be: player removePrimaryWeaponItem currentMagazine player;

#

Which is working....

lone glade
#

"player to not be null" unless you're doing this from the server this can be safely ignored

little eagle
#

removeMagazine removes it from the inventory I think.

#

removePrimaryWeaponItem removes it from the rifle slot weapon.

elfin palm
#

Is there any Event Handler that triggers on the vehicle horn, similar to Fired?

inner swallow
#

Doesn't fired work too?

#

Since Horn is a weapon

elfin palm
#

hasn't been so far for me, it doesn't work on weapon with an empty mag either.

lone glade
#

horns are weapons

inner swallow
#

hmm, interesting

still forum
#

LeftClick hotkey handler 😉

elfin palm
#

Yeah, looks that way, cheers anyway 😃

meager heart
#

Fired eh will work only if it was added when unit was in a vehicle
FiredMan in this case will be better

#

No ?

little eagle
#

fired should still work if attached to the vehicle, not the driver.

lone glade
#

Fired: vehicle
FiredMan: Anything that person fires

little eagle
#

Well, maybe the horn does indeed not trigger fired. Can't remember if the counter measures and smoke launchers do either.

lone glade
#

they do

little eagle
#

I remember something weird about all these.

lone glade
#

can't say anything for the horn, but countermeasure launchers definitely do

subtle ore
#

well the horn essentially is a "weapon" right?

little eagle
#

It is.

lone glade
#

it doesn't fire anything tho, which is probably why fired doesn't fire

#

CM launchers do fire grenades / flares

little eagle
#

You mean no projectile?

lone glade
#

yeah.

still forum
#

@peak plover you still alive? you writin so littl

subtle ore
#

well maybe if you bulli less dedmen nigel would be lively

little eagle
#

No, I get it.

lone glade
#

throwing a grenade?
You're firing it through your arm 😄

little eagle
#
        class CarHorn: Default {
            cursor = "";
            cursorAim = "";
            scope = 1;
            displayName = "Horn";
            reloadTime = 0;
            drySound[] = {"A3\Sounds_F\weapons\horns\MRAP_02_horn_2", 1, 1, 200};
            canLock = 0;
            optics = 0;
            enableAttack = 0;
        };
#

This is the config.

#

The sound is the drySound.

still forum
#

@subtle ore yeah. Nigel always bully me ._. so evil

lone glade
#

aaaaaah

little eagle
#

So the weapon has no ammo.

#

No ammo = no fired event.

lone glade
#

.... I want a combat horn now

subtle ore
#

@still forum Stronger than quik that's for sure. Watch your back, nigel may have you on your back 😉

still forum
#

piggy back you mean? That would be awesome. I'd show nigel my Arma scripting engine bullshit museum

subtle ore
#

😄

little eagle
#

my Arma scripting engine bullshit museum
👀

meager heart
#

There also "SportCarHorn" 😄

#

On offroads i think

little eagle
#

BikeHorn

lone glade
#

there's also stones

little eagle
#

But the sound file attached to it is empty.

still forum
#

It's a weapon... Can you addWeapon that to players?

subtle ore
#

😄

little eagle
#

Persons can't have vehicle weapons I believe.

still forum
#

._.

subtle ore
#

Who says we can't use the wav\ogg from it?

little eagle
#

Sure, you can do that.

still forum
#

lul. Megafon model in pistol slot with car horn sound

#

what's megafon in english?

lone glade
#

loud speaker?

still forum
#

lautmachtüte

subtle ore
#

megaphone?

still forum
#

yes!

lone glade
#

M.E.G.A phone

little eagle
#

tfar_megaphone.pbo

subtle ore
#

That actually would be cool

still forum
#

I wanna do that... But..
pct rescued: 2.47%
current rate: 21493 kB/s
remaining time: 1d 2h 9m

subtle ore
#

get a loudpseaker to broadcast someone's voice

still forum
#

I think people already requested that

meager heart
#

lol

still forum
#

biggest problem is the directionality of the megaphone

little eagle
#

That'd be in scope for the mod imo.

still forum
#

It obviously not omnidirectional

little eagle
#

But with players you already have directional sound sources.

still forum
#

not really

little eagle
#

Do you mean multiple sources?

still forum
#

they are omnidirectional

#

I don't respect where their mouth is facing

#

yet

#

they emit the same volume to behind as in front of them

little eagle
#

Yeah, I guess that wouldn't be accurate for a megaphone, but for a loudspeaker?

still forum
#

The 3D sound library can do that though. but didn't feel need yet

#

Loudspeaker would be fine I guess

#

we already have that in 1.0. kinda

#

you can place Radios on the ground set their volume to 20000% and enable speaker

#

I think in Eden I made a limit of about 300m range

#

There is no eventhandler to detect if a certain object is spawned on the ground aka dropped? Besides put EH

little eagle
#

I think you could use init for the ground weapon holder, which should work since CBA v3.4

still forum
#

I nearestObjects every frame to find speaker radios on the ground.. which is shit

#

Thaaat would be awesome

lone glade
#

hahahahahahhahaha

little eagle
#

You never know if someone didn't put it inside a different gwh though.

still forum
#

I find all gwh in range via nearestObjects and check if they have a radio

#

Using the EH I could keep a list of existing gwh's so that's atleast a bit better

#

But... That might have all gwh on the map then :U So it won't really make it much better

#

For the Intercept variant that would be useable I guess.. But not a improvement for the script variant

subtle ore
#

So I've screwed with this horn a bit, and it becomes increasingly distored as you move + 4 horns playing at the same time doesn't sound bad...sounds like some keyboard music with 3 notes lol

meager heart
#

flute with distortion

ripe imp
#

how to move out after BIS_fnc_moveIn? I tried unit action ["getOut", vic]; which does kick out the unit but then it runs back and gets inside the vehicle again

cold pebble
#

Add ```sqf
unAssignVehicle unit;

#

As the unit will still be assigned to the vehicle

#

So will go and get back in

meager heart
edgy dune
#

does the sky falling animation use a EH to determine when to stop the animation?

#

if so

still forum
#

no

#

that's in engine

edgy dune
#

shit,well is there away to determine when someones hit the ground or when they hit a solid object, im tryna make a jump pack script

still forum
#

HandleDamage I guess

edgy dune
#

wouldnt that conflic with ace? cause ace handles dmg diffrently?

still forum
#

Not sure. maybe

inner swallow
#

is this allowed in SQF? can't remember

#

obj1 = obj2 = obj3 = obj4 = obj5 = obj6 = false;

still forum
#

XD

#

totally not

#

_var = value is like the worst SQF bug I know

#

Actually the only SQF bug I know.. I think.. The others are just buggy commands but this is a bug in the language itself

inner swallow
#

ah, thanks 😄

still forum
#

I'll fix that someday

inner swallow
#

thorn saffron
#

The BIS transport unload waypoint is a bit spotty and can result in death and injury of the cargo units (helo sometimes files up when units are disembarking so they fall down).
A land waypoint with this in activation field works really well.
{doGetOut _x} forEach units group player;
Now, how can I run the doGetOut for any and all units in cargo? Even if there are multiple ones, with players mixed in.

noble pond
#

crew command will help you out @thorn saffron

#

you just selet anyone in cargo from crew for that vehicle and run the foreach loop on it

lone glade
#

@thorn saffron if you haven't figured it out by now you should use fullCrew with cargo as param, select all non player entities and give them "doGetOut"

#

moveOut also works

plucky willow
#

I want to track all player UIDs and IDs with something like

#

arrayIDs = [];
arrrayUIDs = [];
onPlayerConnected{
arrayIDs = arrayIDs + [_id];
arrrayUIDs = arrrayUIDs + [_uid];
};

#

but I'm having trouble referencing those global variables in functions

still forum
#

more details on the trouble

#

use pushBack

lone glade
#

and use tags

#

pls

still forum
#

use addMissionEventHandler instead of the single use eventhandler

#

use tags on your variables

#

don't misstype array in your variable name

lone glade
#

also one of those two vars has 3 r

tough abyss
#

arrrrr

lone glade
#

arrrAAAAAAAAAY

still forum
#

No @tough abyss That's 5

tough abyss
#

grr

still forum
#

5 is not 3

tough abyss
#

simple maths

still forum
#

5 == !3 -> true

lone glade
#

I can break arma to make 2 != 2 return true

#

that bug.... I swear

tough abyss
#

i can make bool a string

still forum
#

I should replace == and != by returning random results :3

tough abyss
#

lol

plucky willow
#

when i use pushback do i need to encapsulate the added value with brackets?

still forum
#

no

#

Read wiki about it

tough abyss
#

ye

plucky willow
#

i was looking at it on it

#
arrayIDs = [];
arrayUIDs = [];
onPlayerConnected{
    arrayIDs = arrayIDs pushBack _id;
    arrayUIDs = arrayUIDs pushBack _uid;
};
#

arrayUIDs is not returning an array

still forum
#

Look at wiki for pushBack again

plucky willow
#

oh lol

vocal knot
#

is anyone familar with using the ace arsenal?

#

trying to figure out how to make it only allow you to select nato items

still forum
#

It allows everything by default

#

and only allowing specific items is very similar to BI Arsenal

vocal knot
#

how do you find the names of the variable arrays

#

like all the nato items are in one array right?

still forum
#

variable arrays?

vocal knot
#

so i can just reference them all at once

still forum
#

No idea what you are talking about.. So I guess no

vocal knot
#

making it only allow specific items

#

do i have to do each item seperately?

still forum
#

yeah. You need an array of classnames for that

#

Items don't have the information to which side they belong

#

besides uniforms

vocal knot
#

well its more uniforms that i wan to restrict

still forum
#

So you have to make that list yourself

vocal knot
#

hm

#

thats annoying

still forum
#

ace_arsenal_configItems contains all possible items

vocal knot
#

and how do i view that (total noob)

still forum
#

Ingame debug console

#

just type that varname into watch field on the bottom

vocal knot
#

and then?

#

is it meant to do something?

still forum
#

show you the contents.. oh oops

#

uiNamespace getVariable "ace_arsenal_configItems"

vocal knot
#

so its looking like i have to make a whole whitelist file

#

joy

#

thaaats a long string

#

so is there no easy way to sort out specific types of things?

#

really just trying to keep people from wearing opfor gear

#

lol

still forum
#

The array is seperated into all item types

cinder gyro
#

If I would do ```sqf
private _fogAction = [
QGVAR(fogAction),
"0.2",
"",
{
1 setFog 0.2;
},
{true}
] call ace_interact_menu_fnc_createAction;

in a function, would it run this on the server or client?
#

That is in a missionfile btw

little eagle
#

That depends on which mission file, not the function. The function has local effects.

peak plover
#

Hmm, how do I set defaults for cba settings for a server?

little eagle
#

Fifth value in cba_settings_fnc_init.

peak plover
#

store on profile

#

and if my 3rd (array) value is "server"

#

so with the ACE3 settings to cba settings converter

#

I have to maunally write every line?

little eagle
#

?

peak plover
#

To make these work on the cba server settings and save

#

I have to "server", true] call CBA_settings_fnc_set;

#

every line

little eagle
#

Doesn't look right.

#

Can't you use the ingame menu?

peak plover
#

only has an export option

#

export is out

little eagle
#

Ah, I remember. You can thank the guys that wanted copyFromClipboard disabled in MP for security reasons.

peak plover
#

🤦

#

motherfucking motherfuckers

#

sooo

little eagle
peak plover
#

basically time to get writing 200 lines of settings

#

🤔

little eagle
#

Or setup the dev environment for CBA and make the master branch 🍌
Nah, you can still use the Arma 3\userconfig\cba_settings.sqf file and paste it in there.

peak plover
#

I guess I can get the settings pbo from master

#

ohh

#

okay

#

But does cba_settings.sqf use classes?

#

or is it the same format as the converter converts to?

little eagle
#

Same format of the converter.

#

You need -filePatching on the server.exe.

peak plover
#

That's ez

#

I assume I needed that for ace settings too

little eagle
#

🤷

peak plover
#

Thanks, I'll try the cba_settings, if that does not work I'll just custom CBA for a bit with settings from master

little eagle
#

I think you could also SAVE your personal current settings in SP.

#

IMPORT these converted ones and SAVE them too,

#

And then LOAD them on the dedicated server SERVER tab.

peak plover
#

Will that save into server profile?

little eagle
#

And then LOAD your original ones in the CLIENT tab.

#

Yes it will.

peak plover
#

Alright

#

that sounds ez

#

Ohh btw, before I foregt about this

#

When I used cba settings to change the mission settings from an sqf file

#

it says WARNING: Source is mission but not in 3DEN editor.

#

How does that make senes ? 😄

little eagle
#

Well, you can only store the settings in a mission in the editor.

#

Because it requires writing to the mission.sqm.

peak plover
#

ohh

#

Okay

#

So if I wanna change a setting with a script I should just change the server setting but false for saving

little eagle
#

Eh? We were talking about "mission", not "server".

peak plover
#

It's a setting that's different every mission

#

But set in a script in the mission

#

I cannot use mission setting

#

I should use server setting without save?

#

for ex.


// fatiuge
ace_advanced_fatigue_enabled = true;
ace_advanced_fatigue_performanceFactor = 2;
ace_advanced_fatigue_recoveryFactor = 5;
ace_advanced_fatigue_loadFactor = 0.75;
ace_advanced_fatigue_terrainGradientFactor = 1;
#

I should use

#

"server", false] call CBA_settings_fnc_set;

#

instead

thorn saffron
#

Ok, I'm trying to create an array for a vehicle for all of the units in cargo AND units in FFV positions. Problem is fullCrew [helo, "cargo", false];Returns only the cargo units, so I would need to go through each crew position and check if its an FFV position. Fortunately "fullCrew " does return that in the 4th param, true in case the unit is in FFV position, false in case of pilot, gunners etc.
I tried this:

private _crew = fullCrew helo1;
private _fullCargo = fullCrew [helo1, "cargo", false];

{
if ((_crew select 4) select _forEachIndex) then {
_fullCargo pushBack ((_crew select 0) select _forEachIndex);
};
} forEach (_crew select 0);```
But I get zero divisor error.
#

I basically want to add the 1st param from the _crew to the _fullCargo array if the 4th one is true (ie. the seat is FFV).

little eagle
#
private _crewNoFFV = fullCrew [_vehicle, "", false] select {!(_x select 4)} apply {_x select 0};

This?!

thorn saffron
#

I actually want the FFV seats

little eagle
#

Well, invert the bool:

private _crewOnlyFFV = fullCrew [_vehicle, "", false] select {_x select 4} apply {_x select 0};
thorn saffron
#

Will test it now

little eagle
#

; at the end, not :

#

Typo :/

thorn saffron
#

@little eagle Damn, it returns an empty array and I do have units in FFV seats

little eagle
#

What vehicle?

thorn saffron
#

CUP UH-1H

little eagle
#

Eh, I have no CUP atm. Can you try it on the Chinook-eque heli from vanilla?

thorn saffron
#

derp

#

forgot to name the helo for testing

little eagle
#

Shouldn't that put an on screen error message then?

thorn saffron
#

nope it just didn't do anything

little eagle
#

Generic error (because undefined variable inside array used as arg)

thorn saffron
#

ok it worked perfectly now

private _crewCargo = fullCrew [helo1, "cargo", false]; 
private _crewOnlyFFV = fullCrew [helo1, "", false] select {_x select 4} apply {_x select 0};
_fullCargo = _crewCargo  + _crewOnlyFFV;
{doGetOut _x} forEach _fullCargo;```
#

this makes all of the cargo and FFV guys disembark the helicopter, while leaving gunners and such mounted

little eagle
#

I think that would have some of them doubled.

#

Like every Cargo slot with FFV would be twice in that array.

thorn saffron
#

FFV seats are treated as gunners, not cargo

little eagle
#

Really?

thorn saffron
#

yup

little eagle
#

[B Alpha 1-1:5,"Turret",1,[3],true]

#

Turret, not Gunner

#

But I know what you mean.

#
private _crewCargoAndFFV = fullCrew [_vehicle, "", false] select {_x select 1 == "cargo" || _x select 4} apply {_x select 0};
#

Makes more sense to me.

#

_crewCargo in your example would be an ARRAY full of subarrays, and therefore make doGetOut error.

thorn saffron
#

nope it works fine

little eagle
#

Tested with cargo slots that are not FFV? Because doGetOut shouldn't accept arrays.

thorn saffron
#

I tested on a fully loaded helo

little eagle
#

It looks 100% like error to me. Maybe the heli has no cargo slots. ¯_(ツ)_/¯

thorn saffron
#

it does

little eagle
#

Well then it would error. Let me try...

thorn saffron
#

I configed that thing myself including the FFV

shut flower
#

stumbled across a quite strange behviour of setPosASL
if an object has set vectordirandup and I execute obj setPosAsl (getPosAsl obj) the object rises toward z axis

#

does anybody has a clue why this is happening and how to prevent this?

little eagle
#

Nice. Apparently doGetOut accepts an ARRAY full of Object or sub ARRAY's with garbage data and objects:

{doGetOut _x} forEach [["garbage data", player]];
#

Ah, and if you use subarrays, everything that isn't an object is ignored, but the units disembark one after the other.

#

Instead of all at the same time.

thorn saffron
#

and player gets dismounted as well

little eagle
#

Yeah, it works for playable characters.

thorn saffron
#

I basically wanted to create an alternative to the transport unload WP, one that does not result in injuries or death due to erratic helo behaviour

#
private _crewCargoAndFFV = fullCrew [helo1, "", false] select {_x select 1 == "cargo" || _x select 4} apply {_x select 0};
{doGetOut _x} forEach _crewCargoAndFFV;``` 
Also works perfectly
lone glade
#

transport WP ends up the way it does because they try to regroup and just fall off

little eagle
#

I think it's better to use this one ^, because it doesn't use a syntax with bad data that may break some time in the future.

#
{doGetOut _x} forEach crew cameraOn; // works
{doGetOut _x} forEach [crew cameraOn]; // works
{doGetOut _x} forEach [[crew cameraOn]]; // fails silently

The nesting cannot be too deep.

thorn saffron
#

than maybe just create a "clean" array

lone glade
#

third one would end up with
_x = [crew1, crew2, crew3]

little eagle
#

I think that ^ is why it accepts units in nested arrays. Making multiple crew _vehicleN disembark with one command. Still weird that it accepts non-objects.

lone glade
#

true

little eagle
#

The garbage data can only be inside the nested arrays:

{doGetOut _x} forEach ["garbage data", player];

This one errors "generic error".

#

I would add it to the wiki, but:

Registraion of new accounts for the Community Wiki has been temporarily suspended. We apologize for the inconvenience.

lone glade
#

can't use your bohemia account?

still forum
#

No

#

Why don't you have a wiki account yet 😮

lone glade
#

I do, I receive arma mobile ops ads from it 😄

little eagle
#

I can't use my old accounts anymore. They changed the website twice since, and the old logins don't work anymore.

thorn saffron
#

Damn, if I straight up put:

private _crewCargoAndFFV = fullCrew [vehicle this, "", false] select {_x select 1 == "cargo" || _x select 4} apply {_x select 0};
{doGetOut _x} forEach _crewCargoAndFFV;

into an activation filed of a land waypoint the helo does not wait and files up when units are disembarking resulting in deaths and injuries

still forum
#

If your account is still there then i can probably send a password reset email

little eagle
#

"You" can? xD

still forum
#

yeah

little eagle
#

@thorn saffron I think those waypoints have conditions. Just give either this one or the next one (can't remember which) the condition to be empty on those slots.

#
_crewCargoAndFFV isEqualTo []
still forum
#

Tho no I probably can't. I can send for wiki accounts but you need one for BI account

#

Or I can but it's not gonna do anything

little eagle
#

Oh, and if this is still about custom waypoints with config, then you could put a waitUntil there. The waypoint isn't finished until the script is done.

meager heart
#

crew and ffv's different groups there ?

little eagle
#

FFV is in Turret, but non-FFV may also be in Turret.

#

Cargo is in Cargo.

#

He wants FFV and Cargo. But I guess that includes the commanders of tanks.

thorn saffron
#

Its mostly about helicopters

little eagle
#

It would include a copilot if he had ffv enabled. But idk if that even works.

lone glade
#

doubt those exist

meager heart
#

why not something like this ?

private _group = group driver _heli;
{_x leaveVehicle _heli} forEach units _group;
lone glade
#

they did for a single day, then got removed 😭

thorn saffron
#

copilot is a dead weight anyway 😛

little eagle
#

Because then the pilot and the gunner would disembark too.

#

Also, you can use units on a unit, so you could skip thegroup command.

meager heart
#

Then i don't get what he trying to do...

little eagle
#

Make everyone BUT the gunner and pilot disembark.

thorn saffron
#

basically I want the helo to dump the cargo people including guys that can FFV

little eagle
#

Is this for a waypoint in the editor?

thorn saffron
#

kinda, I'm looking at the scripted WP now to see if i can work out the waitunitl to prevent helo from moving when units are disembarking

little eagle
#

They have some fancy stuff for the config waypoints since Orange:


            class Demine //sources - ["A3_Functions_F_Orange"]
            {
                displayName = "CLEAR MINES";
                file = "A3\functions_f_orange\waypoints\fn_wpDemine.sqf";
                icon = "\a3\Ui_f\data\Map\MapControl\waypointeditor_CA.paa";
                class Attributes //sources - ["A3_Functions_F_Orange"]
                {
                    class ClearUnknown //sources - ["A3_Functions_F_Orange"]
                    {
                        property = "ClearUnknown";
                        displayName = "Deactivat All Mines";
                        tooltip = "When checked, the group will clear all mines in the area, otherwise it will target only mines known to the group's side.";
                        control = "Checkbox";
                        defaultValue = "true";
                        expression = "_this setWaypointScript (waypointScript _this + format [' %1',_value]);";
                    };
                };
            };
thorn saffron
#

the land WP points to "A3\functions_f\waypoints\fn_wpLand.sqf" if I have a mission with scripts folder, then could I use "scripts\fn_wpLandDisembark.sqf"? For testing

little eagle
#

The script path has to be absolute most likely.

thorn saffron
#

I guess I will have to re-run the loop for creating _crewCargoAndFFV array to finally satisfy the "_crewCargoAndFFV isEqualTo []" condition

meager heart
#

is it will be not easier with just scripts ? 😀

little eagle
#

But this way you do it once, and then it's the easiest for forever.

thorn saffron
#

I want something that I can use as a waypoint in editor

little eagle
#
/*
    Author: Karel Moricky

    Description:
    Let group members fire artillery barrage on waypoint position

    Parameters:
        0: GROUP
        1: ARRAY - waypoint position
        2: OBJECT - target to which waypoint is attached to
        3 (Optional): NUMBER - number of fired rounds
        4 (Optional): STRING - magazine type

    Returns:
    BOOL
*/

private ["_group","_pos","_target","_count","_magazine","_wp"];
_group = _this param [0,grpnull,[grpnull]];
_pos = _this param [1,[],[[]],3];
_target = _this param [2,objnull,[objnull]];
_count = _this param [3,100,[0]];
_magazine = _this param [4,"",[""]];
_wp = [_group,currentwaypoint _group];
_wp setwaypointdescription localize "STR_A3_CfgWaypoints_Artillery";

private ["_vehsFire"];
_vehsFire = [];

waituntil {
    private ["_countReady","_vehsGroup"];
    _countReady = 0;
    _vehsGroup = [];

[...]

    sleep 1;
    count _vehsGroup == _countReady
};

//--- Cleanup
{
    _x setvariable ["bis_fnc_wpArtillery_magazine",nil];
    _x move position _x;
} foreach _vehsFire;
true
#

Shortened, but this is how a scripted one from vanilla works.

thorn saffron
#

I'm actually looking at the land cunction

#

fn_wpland.sqf

#
/*
    Author: Karel Moricky

    Description:
    Let group members land at the waypoint position

    Parameters:
        0: GROUP
        1: ARRAY - waypoint position
        2: OBJECT - target to which waypoint is attached to

    Returns:
    BOOL
*/

private ["_group","_pos","_target","_wp"];
_group = _this param [0,grpnull,[grpnull]];
_pos = _this param [1,[],[[]],3];
_target = _this param [2,objnull,[objnull]];
_wp = [_group,currentwaypoint _group];
_wp setwaypointdescription localize "STR_A3_CfgWaypoints_Land";

private ["_vehsMove","_vehsLand"];
_vehsMove = [];
_vehsLand = [];

waituntil {
    private ["_countReady","_vehsGroup"];
    _countReady = 0;
    _vehsGroup = [];

    //--- Check state of group members
    {
        private ["_veh"];
        _veh = vehicle _x;
        if (_x == effectivecommander _x) then {
            if (!(_veh in _vehsMove)) then {

                //--- Move to landing position
                _veh domove _pos;
                _vehsMove set [count _vehsMove,_veh];
            } else {
                if !(istouchingground _veh) then {
                    if (unitready _veh && !(_veh in _vehsLand)) then {

                        //--- van 't Land
                        _veh land "land";
                        _vehsLand set [count _vehsLand,_veh];
                    };
                } else {
                    //--- Ready (keep the engine running)
                    _veh engineon true;
                    _countReady = _countReady + 1;
                };
            };
            _vehsGroup set [count _vehsGroup,_veh];
        };
    } foreach units _group;

    //--- Remove vehicles which are no longer in the group
    _vehsMove = _vehsMove - (_vehsMove - _vehsGroup);
    _vehsLand = _vehsLand - (_vehsLand - _vehsGroup);

    sleep 1;
    count _vehsGroup == _countReady
};
true```
little eagle
#

Yeah, that is the other scripted one next to clear mines and arty.

thorn saffron
#

ok "scripts\fn_wpLandUnload.sqf" fired up on a pure scripted WP and helo landed, now I need to plug my get out thing and it should be fine

meager heart
#
_heli land "get out";
waitUntil {isTouchingGround _heli}; 
_group leaveVehicle _heli;    
thorn saffron
#

@meager heart I only want cargo and FFV guys to get out that is why I use sqf private _crewCargoAndFFV = fullCrew [vehicle this, "", false] select {_x select 1 == "cargo" || _x select 4} apply {_x select 0}; {doGetOut _x} forEach _crewCargoAndFFV;

meager heart
little eagle
#

¯_(ツ)_/¯

meager heart
#

I'am stoped...🙅

thorn saffron
#

damn can't paste what I tried

#

Ok, kinda got it working, but one issue, if the commander of the squad is inside the helo he will order units back in

#

also my waitUntil does not seem to end and helo stays grounded.

#

nevermind

#

the UH-1H is pretty derpy and pilot just smashes it into the ground, testing UH-60 with FFV instead, it lands it drops the droops, but it does not proceed to the next waypoint. My guess is that the script does not finish and the scripted WP is not completed

little eagle
#

systemChat debug time.

lone glade
#

TRACE / LOG masterrace

little eagle
#

: /

still forum
#

Real debugger debug time

little eagle
#

I didn't see any TRACE_n in the ACE arsenal.

lone glade
#

I removed them

little eagle
#

What's the point then?

lone glade
#

I used a shitload when I was writing it tho

little eagle
#

Well, why remove them? They're noop without DEBUG_MODE_FULL

lone glade
#

because they're not useful once i'm done with them

#

I did leave some in ai / garrison

little eagle
#

I don't see how they're better than systemChat then. That's like their main benefit.

thorn saffron
#

allrighty got it working fine for the player group, now I need to stop the AI commander from ordering the units back in

little eagle
#

I think that is just unassignVehicle _x.

thorn saffron
#

@little eagle Nope, they still get ordered back in by the commander, tried this

#
{unassignVehicle  _x} forEach _crewCargoAndFFV;```
#

OK! sqf {_x leaveVehicle _veh} forEach _crewCargoAndFFV;
Worked!

#

Ok, multiple separate helicopters work perfectly fine, they drop the troops and move on only after all of them disembarked. Multiple helos in one group fly up when one of them dumped the cargo, even if there are people left inside of other helos (results in fall and death).
Still it worked supprisingly well for a simple insertion WP, when helos were separate groups nobody died or was injured.

worn hatch
#

is it possible to make it so that when a player holsters a certain weapon it always drops on the floor instead of going on their back? (basically If im doing it the way I want too then it means making the main object a weapon but if they can holster it on there back it wont work so I want it to either not be able to be holstered or drop on the floor when they do)

simple solstice
#
{
diag_log format ['%1 => %2',configName _x,getText (_x >> "displayName")]; 
} forEach ("true" configClasses (configFile >> "CfgVehicles"));
``` I have this script for exporting classnames to vehicle names. How would I add an `if` so it only prints vehicles (cars, planes, etc.)?
#

got it

#
{
diag_log format ['%1 => %2',configName _x,getText (_x >> "displayName")]; 
} forEach ("getNumber (_x >> 'transportSoldier') > 0" configClasses (configFile >> "CfgVehicles"));
plucky willow
#

I'm on a CUP map and I'm trying to dynamically populate towns, but some are only listed under NameLocal rather than NameVillage or NameCity. I don't want to use NameLocal because it includes things I don't want to use. Has anyone had this problem before? Did you find a solution?

peak plover
#

stealth

#

is already part of the game

thorn saffron
#

@little eagle Showed an interesting example for a new waypoint config. I did manage to create my own working custom WP, but but his example had an extra option you can check. How can I actually make use of that? THe orange DLC is ebo file so I can't look into it how the function is actually using that waypoint option.

class Demine //sources - ["A3_Functions_F_Orange"]
            {
                displayName = "CLEAR MINES";
                file = "A3\functions_f_orange\waypoints\fn_wpDemine.sqf";
                icon = "\a3\Ui_f\data\Map\MapControl\waypointeditor_CA.paa";
                class Attributes //sources - ["A3_Functions_F_Orange"]
                {
                    class ClearUnknown //sources - ["A3_Functions_F_Orange"]
                    {
                        property = "ClearUnknown";
                        displayName = "Deactivat All Mines";
                        tooltip = "When checked, the group will clear all mines in the area, otherwise it will target only mines known to the group's side.";
                        control = "Checkbox";
                        defaultValue = "true";
                        expression = "_this setWaypointScript (waypointScript _this + format [' %1',_value]);";
                    };
                };
            };```
#

I can gather that it somehow sends the "true" value into the script

indigo snow
#

thats standard 3DEN attributes

#

so use it like that

#

its code that executes once whenever the - in this case - waypoint is spawned

#

( @thorn saffron )

#

Whats interesting is that these can be used for every entity that can be places in 3DEN , so also markers and triggers for example

#

We use a marker attribute to hide them from certain sides

indigo snow
#

How do you make a pie - it depends what you want

#

you want to make a new mission or?

torn juniper
#

doesn't arma lazy evaluate && conditions?

indigo snow
#

Yes && {like this}

torn juniper
#

ah thx needed the brackets 👍

#

didn't work w/o

indigo snow
#

It doesnt indeed

edgy dune
#

so is it possible to use disableCollisionWith and enableCollisionWith to make a object so that anyone and vic can walk through

tough abyss
#

"enableCollisionWith is a script that when you apply it to an object, it will be solid and the player will not be able to go through it. However, if you want your unit to go through it, you may want to use the disableCollisionWith command. An example for this is: "

edgy dune
#

can u do

#
_this disableCollisionWith {list of units};
tough abyss
#

expects another object so no

jade abyss
#
{ _Object disableCollisionWith _x;} forEach [ListOfObjects];```
edgy dune
#

ah cool ,I was tryna find out if there was a way to do it without a forloop but I guess it wokrs

#

thanks

edgy dune
#

alright so for some reason,it disableCollisionWith doesnt work for vics, this is wat im using

#
mergedList=allUnits;

mergedList append vehicles;

{ _this disableCollisionWith _x;} forEach mergedList;

hint "done";



#

any ideas why?

#

it works with infantry

still forum
#

@edgy dune

mergedList=allUnits;
mergedList append vehicles;

->
mergedList=allUnits + vehicles;

@Andrew#0693 It needs that because SQF requires to have the values passed to commands before it's calling the commands.
isPlayer _unit is a command so it has to evaluate it first and break it down to a single value. I think internally it even does lazy eval. As in if the left side is already false it doesn't even look what the right side value is. But it still needs to build the value to be able to pass it. {isPlayer _unit} is a CODE value. So nothing to do here.
Dirty fix but it works

#

@edgy dune On a Dedicated server?

#

@torn juniper Discord being shit again. See above

hallow spear
#

anyone know how to change the name of the AV in the UAV terminal? selector in top left of interface

still forum
#

That is the name of the vehicle you are controlling right?

edgy dune
#

@still forum i was actually testing in a quick misson i made in eden,will it work if i do it on my units server)

still forum
#

But if you test in editor it should work. What are you doing to test if collision is disabled?

edgy dune
#

Well wat im doing to test is

#

I spawn a vr block,one of the big ones

#

put the gode I have

#

code*

#

then walk through it,which works. Then I spawn like a tank and see if it works,which doesnt

still forum
#

You run the code after you spawn the tank tho right?

edgy dune
#

yes

#

after the tank is spawned

#

I have a feeling it doesnt work for vics,unless someones done it then in that case im messing up

still forum
#

LUL

#

You know.. Reading helps

#

Even I didn't read that

#

This command doesn't disable collision between PhysX objects.

#

Vehicles are PhysX

edgy dune
#

thats wat I thought XD

#

I had a feeling they where,I didnt want it to be true

#

So theres no way around it?

#

What im tryna do is

#

u know how in star wars hangers have sheilds? well someone iin my unit has a "shield object" a transperent blue object basicly. Wat id like to do is have that object be so that ppl and vics can go through ,basicly like a static object

still forum
#

I don't know another way atleast with disabling collision via script

#

Did you make that shield yourself? Can you modify it?

edgy dune
#

the sheild I think is already in the game as like a solid object

#

shield*

still forum
#

If you did model it yourself you could make a animation that disables the collision quite easily

edgy dune
#

yea cant edit the mod cause its not our mod to edit u know,dont wana piss the devs off

#

also

still forum
#

If it's a easy model maybe you find someone to remake it for you and add that animation

#

I would. But I'm disabled for this whole week sooo...

edgy dune
#

RIP

#

welp I guess our misson maker will have to get creative and use wat static object they have,atleast it works with infantry

still forum
#

When is the mission?

edgy dune
#

ermmmmm

#

hard to explain

#

my unit does fun ops like 24/7

#

wait

still forum
#

Like if you ask in #arma3_model if someone can help you with that and make a simple shield model with a animation. For me it would probably be an hour of work. Maybe someone is nice enough to quickly slap something together

edgy dune
#

would having disableSimulation on a addAction for a vic where it sets the speed to a constant velo untill an other addAction say "re enable sim" work?