#arma3_scripting

1 messages ยท Page 330 of 1

vapid frigate
#

yeah which is SQF

still forum
#

It's totally not. Old TFAR with SQF can take between 5 to over 50ms per frame. Effectively killing your FPS. new TFAR with Intercept is at about 2-5ms per frame.

#

AI is SQF yeah.

#

What native lang?

#

Yeah part of AI is native engine. But a lot of it is also FSM.

vapid frigate
#

it looks extremely similar to SQF

still forum
#

FSM is SQF.

tardy wagon
#

What is the EULA / TOS for reverse engineering arma to make mods?

#

or acquiring information to make mods with

still forum
#

Uhm. I think reversing is not allowed. But... BI didn't really get angry at Intercept yet... soo..

#

That's true

tardy wagon
#

Ok, well if I have data on a private computer they can try to send auditors if they want lol

still forum
#

Problem is SQF is the only part we can actually really influence.

tardy wagon
#

2 threads per unit?

#

oh lordy

#

the engine needs more work than I thought

#

I bet

still forum
#

Arma doesn't actually use Threads for that.

#

Also not visible in windows perf monitor

tardy wagon
#

windows performance monitor isn't always accurate though. It's best to use a debugger for that kind of thing

still forum
#

all scripts (FSM's are scripts) run in main Thread

tardy wagon
#

ah k

still forum
#

yeas

tardy wagon
#

If arma spun up 2 legit threads for every unit it would be a miracle for it to run at all

still forum
#

No.

tardy wagon
#

Oh you reversed it and mapped it out?

still forum
#

Publicly I don't have anything.

tardy wagon
#

you know when you say things like "publicly I don't have anything"

#

it doesn't do shit to cover you legally lol

#

especially when you just admitted to reversing, just own it

#

your computer, your control. they can send auditors if they want

still forum
#

I don't do anything bad with the Information I have. And that's also why I share as little as possible of that

vapid frigate
tardy wagon
#

That's fine. I'm just saying that things like "my friend may have..." I don't publicly..." don't do anything to protect you

vapid frigate
#

it's SQF in all the fields

#

not a 'native language'

tardy wagon
#

If I were to reverse engineer arma the intent would also be to improve gameplay experience for everyonre

rancid ruin
#

i'm sure you're pretty safe in the knowledge that there's sketchy people doing sketchy stuff with the same data you reverse eng'd anyway

vapid frigate
#

it's danger.fsm

still forum
#

@tardy wagon Which is what I'm doing ^^

tardy wagon
#

๐Ÿ˜„

jovial nebula
#

Though, remember that FSM is run the legendary 2nd core

tardy wagon
#

yay, I am a strong believer of "my computer my control"

still forum
#

FSM also runs in main thead. Not on 2nd or any other core.

jovial nebula
#

... No

still forum
#

Except if Addons like ASR AI modify AI behaviour

jovial nebula
#

At leasy

#

There is clearly stated on the wiki

still forum
#

Then the Wiki is wrong.

jovial nebula
#

That FSM is run on a dedicated core

#

Wtf

austere granite
#

where does it say that?

still forum
#

Or unclear.

#

The wiki is also mostly written by people that speculate and don't know any better.
We did a little cleanup on scheduled/unscheduled just recently

#

@tough abyss You also think Suma is a person? ^^

tardy wagon
#

Did you use IDA?

#

and olydbg?

#

those are my goto

still forum
#

Suma is a company.

#

BI was created out of Suma

#

Using IDA mainly.

rancid ruin
#

A version for Atari Jaguar was in development, but has not been released
nice. when can we expect this?

#

if I was feeling more trolly I would tag dwarden and ask him

tough abyss
#

ida is love. i wish i had enough to buy the proper licence though

#

would totally support those dudes that make it

still forum
#

Me too. I would actually really pay the 500โ‚ฌ for it as much as I use it. But that would only pay for the starter edition which doesn't support x64. Which is hugely important for me :/
They should really have a Education/Student program.
The stuff that I currently have a need for. When choosing the always cheapest option I'm looking at 8k.
I don't really like people that use cracked Software because they want to just spare money. But if I can choose between my own Car or a piece of Software I use as part of my Hobby a couple times a week. I don't think that long.
Why does #arma3_scripting always get so offtopic? ๐Ÿ˜„

tough abyss
#

@still forum branched discussions ๐Ÿ˜„

#

but tl;dr ida is very powerful. i love some of the addons it has (i mainly use it for reverse engineering)

tardy wagon
#

Cracked software? I would never do that but have fun proving it

hearty plover
#

Hey folks.

#
if !isserver exitwith {};

systemChat format["%picking new site..."];

_goodSite = false;

while  {!_goodSite} do {
    _site = selectRandom SITES;
    _goodSite = true;
};

systemChat format["%chosen new site..."];

_site
#

I have the following file. Should be returning a marker, from my global SITES.

#

However it's returning any

#

as in, if I systemChat _site

#

it states, any

dusk sage
#

_site is undefined in the parent scope (of the while loop). You need to declare _site in the parent scope (whether you define it, or just make it private)

hearty plover
#

Ahh,

#

Thank you.

#

I should have seen that..

#
if ((count units _group == 0) || (isNull _group)) exitWith {
    deleteGroup _group;
    0 = ["Zen_SpawnGroup", "No units could be spawned, group is empty and null", _this] call Zen_PrintError;
    call Zen_StackPrint;
    call Zen_StackRemove;
    (grpNull)
};

if (surfaceIsWater _pos) then {
    {
        _x setPosASL ([_pos, random 2, random 360, "compass", _pos select 2] call Zen_ExtendVector);
    } forEach (units _group);
} else {
    {
        _x setPosATL ([_pos, random 2, random 360, "compass", _pos select 2] call Zen_ExtendVector);
    } forEach (units _group);
};

call Zen_StackRemove;
(_group)
#

Is, (grpNull) a return statement?

#

This is obv not mine, from the Zen framework.

rotund cypress
#

Hey guys, does anyone know if default groups in lobby removes when empty? LIke if I choose a group in side selection in lobby, and then I script myself into another group, will that old group remove itself?
Because I know you can script so you can create a group that will delete when empty

rancid ruin
#

probably not, because then how would JIP players choose a group?

#

if they all just deleted themselves cos they were empty it would be a clusterfuck surely

rotund cypress
#

Ye, I was afraid of that

cedar kindle
#

yes @hearty plover, because of the exitWith

peak plover
#

Is there any way

#

of switching magazine type with a script command?

outer scarab
#

So I've got this script that destroys all buildings in an area. I've just modified it so that it will randomly damage or destroy a building, but other than the damage textures, the damaged buildings are still intact. Is there a way to make the damaged ones partially collapsed? _buildings = (markerpos "DE1") nearobjects ["house",500]; {_x setdamage selectRandom [0.9,0,8,1];} foreach _buildings;

obsidian chasm
#

I'm wondering if it would be difficult to add the 'Enhanced Movement' mod to my small co-op mission I have..

rotund cypress
#

@outer scarab I don't seem to get the point with the 8 in your array

#

As damage only takes values between 0 and 1

#

@obsidian chasm Define Enhanced Movement

#

If you are looking for reloading and such, have a look at actions @peak plover

little eagle
#
selectRandom [0.9,0,8,1];

typo?
0.9 0 8 1

rotund cypress
#

Maybe

obsidian chasm
#

Aye I did it. It was simple. I just kind of turned it on.. lol

rotund cypress
#

Action: SwitchMagazine

#

Maybe that is what you are looking for

little eagle
#

SwitchMagazine actually "switches" the weapon, muzzle and weapon mode, but not the magazine.

peak plover
#

Yeah this action does not work

little eagle
#

It does work..

peak plover
#

Well not like how I want it to

little eagle
#

Yes.

peak plover
#

I want a script where I can change the magazine of the weapon through a function. So basically instead of using action menu to load my tracers, I would use ace interaction and do it through that instead

tardy wagon
#

tracers will corrode the shit out of your barrel. Proceed with caution

#

they are also expensive as fuck

#

and you might start fires

peak plover
#

Im pretty sure more fires are started in the military by cooking than tracers

outer scarab
#

@rotund cypress Hah, that was MEANT to be 0.8

tardy wagon
#

It would be cool to write a rigging / mountaineering mod

#

building anchors, better rappelling, etc

peak plover
#

Hmm, yes

tardy wagon
loud python
#

Can't find anything about changing plane loadouts in a script in the wiki, can anybody link to some related page?

tough abyss
#

Look for pylon in then command list in wiki

#

If I need a good script for it then use
GOM Aircraft Loadout

#

It does it in a GUI where I can change the loadout in-game

lean tiger
#

Besides running canAdd on the smallest possible item (I'm thinking chemlight?), is there any way to determine if an object has storage?

little eagle
#
load _container < 1

I think.

forest ore
#

is there a way to "broadcast" briefing.(sqf) from dedicated server to init and JIP players alike?

lean tiger
#

@little eagle thanks for the tip, but it only works for "containers" -- ie uniform/vest/backpack ๐Ÿ˜ฆ

#

well, technically units*

empty blade
#

a

little eagle
#

b

dusk sage
#

d

empty blade
#

c

rotund cypress
#

Hey guys, does anyone know whats faster, _this select _i or _this param [_i]?

subtle ore
#

@rotund cypress param afaik

tough abyss
#

@rotund cypress u r comparing different things an u ve wrong syntax.
I think I mean:
_i=_this select 0;
which can be substituted with
params["_i"];
But to be precise this is more the same as
private _i=_this select 0;

params is faster and has much more features to define default values and check for types and so on...

rotund cypress
#

That is not what I mean

#

I would use params

#

But for only one parameter

#

{param [0] == "string"} or {_this select 0 == "string"}

dusk sage
#

@tough abyss ๐Ÿ˜„ ?

#

Think you got the wrong end of the stick

subtle ore
rotund cypress
#

no need to use that when only thing I need is one parameter

subtle ore
#

params[["_myCookie",objNull,Object,1]];

rotund cypress
#

that doesnt even need to be stored in a variable

#

Yes that is what I usually use

#

But there is sometimes no need for it

#

When only thing I have an if

subtle ore
#

Good to check anyways, just in case you or someone else is debugging your mission and has no idea the problem

rotund cypress
#

Sorry, but tbf, question wasn't about params or what to use, question was which one is faster, select or param

subtle ore
#

and you can't check if it's a string by doing "_myCookie == "object" typeName is the command you want to use

dusk sage
#

He never suggested that

rotund cypress
#

๐Ÿคฆ

dusk sage
#

Little off topic

subtle ore
#

Well I'm just pointing that out. It is related as Sim was asking the difference between param and just selecting from passed

#

and I was just suggesting that param should be used to check the variable type instead of getting a new line to check the type

rotund cypress
#

and you can't check if it's a string by doing "_myCookie == "object" typeName is the command you want to use

#

I never said I wanted to get datatype of a variable

#

It was just an example of checking a variable to a string

subtle ore
#

I'm not sure that you were, I was just pointing that out in case you hadn't already been using it

rotund cypress
#

๐Ÿ‘Œ

tranquil nymph
#

@subtle ore typeName is pretty much deprecated with the introduction of isEqualType

subtle ore
#

@tranquil nymph either one works.

#

unless code performance says otherwise

tranquil nymph
#

isEqualType is faster

#

and more readable

subtle ore
#

Alright, I'll make sure to use it in the future

tranquil nymph
#

๐Ÿ‘

dusk sage
#

@Midnight typeName is pretty much deprecated with the introduction of isEqualType
They are fundementally different, and cannot cover every use case

little eagle
#

typeName can be used for switch blocks I guess. But it definitely got rarer since isEqualType

plucky beacon
#

When doing the CFG radio is the db-100 like the cfgmusic where you can +10 too?


class CfgRadio
{
    sounds[] = {};
    
    class Halo2_D
    {
        name = "";
        sound[] = {"\Voice\dead\Halo2.ogg", db-100, 1.0};
        title = "";
    };
};
tough abyss
#

Idea @tough abyss Maybe handle the key being pressed to engage it?

jade abyss
#

if unconscious -> moveOut ?

#

at least for the VehicleProb

#

hmm

#

You can still do it, even without a Bipod

#

Yep :/

#

+Check 2nd comment

#

That together with an EH -> Should do the trick

zenith bramble
#

Does anyone know how long ago the loadUniform, loadVest and loadBackpack changed to percentages rather than total mass as the wiki describes?

meager granite
#

were percent since first day of alpha

zenith bramble
#

Thank you very much for that confirmation @meager granite

cedar kindle
#

@plucky beacon yes

tough abyss
#

Can someone explain this error 11:39:36 Performance warning: SimpleSerialization::Write 'params' is using type of ',CONTROL' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types 11:39:36 Serialization of Control variables is not implemented in the context of the following code ```SQF
#include "script_component.hpp"

disableSerialization;

params ["_control", "_pos"];

switch (str _control) do {
case "Control #80003": {
hint "works";
};
};

#

Called with ```CPP
onSliderPosChanged = QUOTE([ARR_1(_this)] remoteExecCall [ARR_2(QQFUNC(commitWeather), 0)]);

warm gorge
#

@tough abyss Certain data types (eg namespace, config, display, control, target, task) aren't optimized with params

#

I wouldn't worry about it too much, unless its constantly spamming you

tough abyss
#

@warm gorge thanks.

plucky beacon
#

Thanks cuel

tough abyss
#

is it possible to give a vehicle radar without modifying configs?

rancid ruin
#

mmm probably not

little eagle
#

@tough abyss It has nothing to do with the params, but with publicVariable or remoteExec. Just for the record.

scarlet temple
#

How can i split a multi array? For example: [[1,2,3],[4,5,6]] into [1,2,3] and [4,5,6] ?

halcyon crypt
#
_array1 = _multiArray select 0;
_array2 = _multiArray select 1;
scarlet temple
#

my bad i am an idiot...

halcyon crypt
#

๐Ÿ˜

tough abyss
#

@little eagle ok, thanks.

little eagle
#

@scarlet temple

_multiArray params ["_array1", "_array2"];
tough abyss
#

Also for the record, onSliderPosChanged returns 2 vars in an array. So the following won't work SQF _control = _this select 0; _value = _this select 1; but this will ```SQF
_sliderRtrn = _this select 0;
_control = _sliderRtrn select 0;
_value = _sliderRtrn select 1;

little eagle
#
(_this select 0) params ["_control", "_value"];
tough abyss
#

Wow that's...

#

Much better but still kinda retarded.

#

Why not return 2 separate vars...

little eagle
#
param [0] params ["_control", "_value"];
tough abyss
#

Can you explain that? ^

#

What is param [0]?

little eagle
#

Same as
_this select 0
but faster

tough abyss
#

Oh, nice.

little eagle
#

Idk, I was bored.

midnight idol
#

hello all im making a mission on utes so im making a script that kills the lights what are those lights called in the builinds around the airport control tower etc (noob at this but i gota start somewhere :D)

jade abyss
#

param was faster? oO

#

Barely noticable, or? @little eagle ?

rancid ruin
#

you could find out by using nearestObjects or something like that (i can't remember the function exactly) @midnight idol

#

like, get close to one, systemchat or diag_log near object classnames...boom

midnight idol
#

ok cool

vivid quartz
#
cutText ["<t color='#ff0000' font= 'PuristaMedium' size='5'>test</t>", "BLACK FADED", 999, true, true];

keep getting error for 2elements expected, 5provided
even used this in biki example:

cutText ["<t color='#ff0000' size='5'>RED ALERT!</t><br/>***********", "PLAIN", -1, true, true];

no luck

#

i can create extra display in rsctitles just to display this kind of thing, but there has to be another way

meager granite
#

I guess it never went into stable?

vivid quartz
#

think so (ive already made a display), but i have another question guys, whats the path to this background? http://prntscr.com/fu0mq7 iam searching through rscbackgrounds and stuff, cant find it

#

old screen ikr

rancid ruin
#

who was the person that got Discord to add syntax highlighting for sqf in code blocks?

#

asking on behalf of a game engine which has a discord but no discord syntax highlighting for their scripting language

still forum
#

@rotund cypress _this select 0 should logically be faster than param [0]
But best solution would still be to use params once for all your arguments. And if you only have on argument then don't pass it in an array.
Good to see Midnight is like always giving wrong advice and completly missing the actual question ๐Ÿ˜„

rotund cypress
#

๐Ÿ˜‰

#

I use params for all my parameters

#

However

#

When doing something like (param [1, [], [[]]]) params [...]

#

Params I don't think would be needed as it would drain more performance

still forum
#

If the code path that needs that parameter is rarely taken. use _this select 0 better readability than param [0] and should logically be faster because param has a few extra features that select doesn't have and that you probably don't need in there anyway

#

And if that path is rarely taken the performance impact doesn't matter anyway. so go for readability

little eagle
#

Dedmen, param is unary when "used with" _this. And that makes it faster I believe.

#

And it being easier to read is subjective. I got used to param [N] pretty fast. And since it's less words and unary...

still forum
#

You believe? one 16 byte value on the scriptstack is a couple nanoseconds.

#

compared to the amount of extra work param is doing o check for nil and stuff..

#

Finding the value in _this is probably taking the most time. but param is also doing that. Just behind the scenes

rancid ruin
#

why doesn't someone just test it and back their argument up with cold hard data

still forum
#

Next computer with Arma that I have access to is about 10km away from me. And I guess Commy doesn't have Arma running right now

rancid ruin
#

pretty sure commy is a bot running inside arma 3

little eagle
#
_this = [1,2,3];
_this select 0



_this = [1,2,3];
param [0]

Will test these ^

peak plover
#

wait, is param [0] params ["_a","_b"] faster than params ["_a","_b"] makes no sense

little eagle
#

Yeah, that would make no sense.

#
param [0] params [blah
vs.
(_this select 0) params [blah
peak plover
#

ooooh

#
params ["_a","_b"];
_a params ["_c","_d"];
little eagle
#

0.0066 ms
0.0085 ms

#

Yeah, select one is still faster

#

But it's a race of param vs. binary command, so it wasn't clear.

peak plover
#

select is only faster if you have 1 thing and you don't need private

little eagle
#

param has nothing to do with private

peak plover
#

s

little eagle
#

params does and params != param

#

param still has the benefit of working with non-arrays though.

#

Also this is all marginal and no one should care.

peak plover
#

Not really. There are some rare instances of things that run 1000s times per second

#

People should always care

still forum
#

If performance is important then it is. If it's not then it's not.

peak plover
#

Yeah, this isn't everyones top priority

cedar kindle
#

apply the pareto principle :^)

peak plover
#

Whenever I want to do something and I get ideas for something, I always look at someone elses work, but I never rip it off because I just disagree with most of it and have to rewrite to fit my "standards"

tough abyss
#
_this = [1,2,3]; 
_this select 0

0.0009 ms

_this = [1,2,3]; 
param [0]

0.0012 ms

#

๐Ÿ˜ I don't always save time, but when I do, it is in nanoseconds...

#

10k

peak plover
#

If everyone whose scripts I've sniffed knew I'd be sued.

tough abyss
#

@little eagle ^^^^^

peak plover
#

I've done a lot of things

#

I'll have you know I've made hundreds of missions ๐Ÿ˜‰

#

Some of them even worked

#

Recent ones use a mission framework that's a mod. I'm working on my own framework right now, I'll hit you on DM if still interested.

little eagle
#

It's not 300 nanoseconds per 10000 cycles, but per each cycle.

peak plover
#

https://pastebin.com/BCNLN7GZ I've spent hours on documentation now. I remove time from procastinating and browsing internet and put it into nanoseconds and documentation

#

Yeah, depending on how heavy the loop is it can save a bunch of performance

#

I had 3000 cycles in around a second and turned it to around half by optimizing and removing really stupid code

rancid ruin
#

nice nigel, when are you gonna write the code to go with those comments?

peak plover
#

That's all ready

little eagle
#

Yeah and also on the scope of what you're doing. If it's thousands of scripts like in ACE, you can't be as lazy as some BI scripts.

peak plover
#

I'm still not finished with all of the systems

#

I write the code, comment it and then make documentation

rancid ruin
#

documentation ๐Ÿ˜ฒ

peak plover
#
// Runs onRespawn for wave respawn
// Runs the respawn timer for players
// _unit call respawn_fnc_wave_onRespawn;
"respawn_fnc_wave_onRespawn" spawn debug_fnc_log;

// Code begins
params ["_unit"];
// Get/set unit side
private _unitSide = _unit call respawn_fnc_getSetUnitSide;
// Check if respawn wave has already been requested for _unitSide
_requestedVar = format ["respawn_wave_requested_%1",_unitSide];
private _requested = missionNamespace getVariable [_requestedVar,false];
// If wave is already requested, check if it's done yet
if (_requested) then {
    _timeVar = format ["respawn_wave_time_%1",_unitSide];
    _time = missionNamespace getVariable [_timeVar,1];
    // Respawn unit if respawn time is less than 0 and unit is dead
    if (_time < 1) then {
        if (_unit getVariable ["unit_respawn_dead",false]) then {
            _unit call respawn_fnc_respawnUnit;
        };
    };
} else {
    // if wave has not been requested, requrest it!
    missionNamespace setVariable [_requestedVar,true,true];
};
// Show time 'til respawn as hint ?
if (_unit getVariable ["unit_respawn_dead",true]) then {
    _unit spawn respawn_fnc_wave_playerTimer;
};
#

My issue is that I've got a pretty bad memory. So I can forget what I wrote in a few weeks

#

So doing this actually saves me tons of time when using older scripts in the future

rancid ruin
#

no tag = not valid code

peak plover
#

What do you mean?

rancid ruin
#

nige_func_funcname

peak plover
#

nah, fuck that. This is for my use. I'll put it on github when it's more polished. But I don't really care for nig_fnc

#

If I used some other mission base/fw or I do somethign as a mod I use nig_fnc. But this does not really need it as you won't have code with respawn_wave_ most likely

rancid ruin
#

those OPFEC guys are gonna fk you up when they find you

peak plover
#

What will they do?

rancid ruin
#

have you seen the film Scum?

peak plover
#

Nah

#

Not like they can steal it

halcyon crypt
#

it's a good convention though, no need to shit on it ๐Ÿ˜›

subtle ore
#

@peak plover nig_fnc ? Hehehe.

waxen jacinth
#

Hey there, can someone tell me how i would get the _adminpos out of this, prefering %3 ```C
_adminpos = username, uid, the guy executing the script thru debug infistar (F3 key)
_marker = createMarker ["event1", _adminpos];
_marker setMarkerType "mil_warning";
_marker setMarkerText "ADMIN SPOTTED";
_marker setMarkerColor "ColorRed";

subtle ore
#

@waxen jacinth because its an array not a single pos.

waxen jacinth
#

@subtle ore _adminpos = example

#

it was a wonky way to tell what i'm lookin for

jovial ivy
#

@waxen jacinth (position (_adminpos select 2))? Since _adminpos select 2 is, "the guy executing the script" which I assume is a player object.

waxen jacinth
#

doritos a nice!

#

yes indeed

#

i dom't understrand how you get that with C select 2

rancid ruin
#

explain your question better because it's not really making sense

#

you want to get a position or a username?

subtle ore
#

@waxen jacinth that's exactly what I was getting at sigh (position(_adminPos select 2))

hearty plover
#

The above pastebin is a file I have, which is giving me a missing ; on line 69...

#

I have been trying to track this one down for a few days, as the rest of my teams efforts have been on other features, now we are coming back around too it and we can't figure it out for the life of us..

#

If anyone can take some time to give it a look, please do.

#

Disclaimer, it's a mess, two large switch statements wrapping code that will eventual be moved into other functions.

#

So, sorry for that before hand.

indigo snow
#

you messed up your for syntax

#

for ... do, you're missing the do

hearty plover
#

Hmm, It's copied right from the website to...

#

Damn

#

Yeha

#

You can tell which one I used my auto complete on too.

#

The inner loop I did with the auto complete.

#

How did I miss that shit..

indigo snow
#

stared at it too long ๐Ÿ˜›

hearty plover
#

Likely..

#

Been wokring on this for 2 hours, trying to get it done this morning so the other guys can start splitting this into nice neat functions and I can move on to building a database for another set of things we wana do

tough abyss
#

@little eagle so when would one use param [N] instead of _this select N?

still forum
#

you can use param [N,default] to get a default value in case the entry doesn't exist in the Array or is Nil

#

also param can also cope with non-arrays "test" param [0] -> "test"
I only use param for the default value.

private _myvar = something select 0;
if (isNil "_myvar") then {_myvar = default;};

is equal to

private _myvar = something param [0, default];
little eagle
#

Although at that point you might as well write

something params [["_myVar", default]];
quasi rover
#

According to Config Viewer on Eden editor, Map size of Malden is 30720. is it correct?
(FYI, Stratis: 8192, Tanoa: 15360, Altis: 30720)

robust hollow
#

malden is somewhere between 12000 and 13000

quasi rover
#

Weird. Measured distance is 12xxx, but 30720 on the Config viewer.

meager granite
halcyon crypt
#

I believe this has already been reported on the feedback tracker

#

or not, it was a twitter post ๐Ÿ˜›

quasi rover
#

thx guys.

frosty cave
grand berry
#

That's part of CBA, do you have it launched?

frosty cave
#

ah thanks, I was working on a different mod when I remembered seeing those buttons, and CBA was loaded then

queen cargo
subtle ore
#

@grand berry not sure it is, thought it was in base game too

grand berry
subtle ore
#

@grand berry I swear it was at one point in time ๐Ÿคท

grand berry
#

Would be good if it was

warm gorge
#

Would calling endMission/BIS_fnc_endMission on a player loading into a server (past lobby, on map screen loading in) cause any issues? Or would it be better to waitUntil !isNull findDisplay 46 or something

rancid ruin
#

it would end the mission before he gets a chance to play it, is that not an issue?

warm gorge
#

Just curious because I want to use it in this way but not sure how endMission works with the UI or if it wouldn't work properly until the player is fully loaded in. But I guess it should be fine

rancid ruin
#

how come you want to do this anyway?

warm gorge
#

To prevent a player from loading into the mission if they arent whitelisted for a certain slot. So basically from initLocalPlayer it does a check and if that fails, it calls endMission

rancid ruin
#

ahhh that makes sense

#

so many things seem stupid til you think of all possible use cases ๐Ÿ˜ƒ

warm gorge
#

Yeah true aha

cloud thunder
#

If he is JIP then you could kick him before he runs initPlayerLocal.sqf if server does it remotely from initPlayerServer.sqf. Sudo code: private _player = _this select 0;
private _whitelist = ["232342342323","232323232323"];

if (!((getPlayerUID _player) in _whitelist) && _player == ReservedPlayerVarName) then {
"end1" remoteExec ["BIS_fnc_endMission", _player, false];
};

cedar kindle
#

initplayerlocal if (!((getPlayerUID _player) in _whitelist) then {endMission "LOSER"}

little eagle
#

Yeah, there is no reason to remote exec almost anything at mission start. You can just put it into the initPlayerLocal file instead. Why transfer information ingame when the whole mission is transferred beforehand anyway? (incl. initPlayerSever file!). It's like doing twice the work and the code is uglier too.

halcyon crypt
#

@little eagle you mentioned that the private params aren't set when using onMapSingleClick with addMissionEventHandler

#

does this apply to all (mission) EHs?

queen cargo
#

i have literaly no idea what you just said
and searching for that what you mentioned did not resulted in anythign useful @halcyon crypt (unless it was neither yesterday nor today)

halcyon crypt
#

nah it was way earlier

#

about the deprecation of BIS_fnc_addStackedEventHandler

queen cargo
#
params ["_foo", "_bar"]```
will mark `_foo` & `_bar` private if thats what youre talking about
halcyon crypt
#
[4:02 PM] commy2: @Neviothr _pos is not a special variable in the mission eventhandler version
[4:03 PM] commy2: use:
params ["_units", "_pos", "_alt", "_shift"];
(edited)
[4:03 PM] commy2: Order might be wrong.

that's the quote

queen cargo
icy raft
#

Hey! Someone is interested in making a JSON-RPC plugin for A3?

queen cargo
#

JSON-RPC?

icy raft
#

HTTP/RPC, whatever

#

I want to make a Marketplace addon for mission makers baked by NodeJS + Mongo

#

And I though that it would be usefull to make a .dll that directly connects with an external API from the client, as for now people tend to use extDB2/3, that gives a heavy load to the A3 server

#

I'm trying my way around it in C++ w/ sockets & threads, but I can't do it alone it seems

queen cargo
#

NodeJS and MongoDB ๐Ÿ™ˆ
connecting the bad with the evil

icy raft
#

Hahahaha, redis is also a choice ๐Ÿ˜„

queen cargo
#

no idea about implementation details of extDB2 ... but it sounds pretty bad if it does have a real impact

icy raft
#

Or would you rather do it in PHP? ๐Ÿ˜ฎ

#

It puts all request throw 'call_extension', that is blocking. They made a tickeing system that aliaviates some of the load, but still block on each call

#

Well, I leave this here, please do tell if you are interested in making a Open Source project for that

warm gorge
#

How come when I create a vehicle, for example a Go Kart (C_Kart_01_F), the camo/variant is different per client? How can I make it the same for everyone

rancid ruin
#

what's wrong with node or mongo @queen cargo ?

meager granite
#

@warm gorge Disable color randomization, do your own

queen cargo
#

both just hipster crap
nodejs usually gets used for applications like the discord client which opens gigantic security holes as to run it a full blown webbrowser is required
mongodb is simply missused most of the time like most of those db types are (just search for mongo db "security" issues in google)

meager granite
#

BI color randomization uses Init event handler which runs at point where vehicle locality is still not set and all vehicles you get from server appear as local to you so each client thinks they created the vehicle and paints it

queen cargo
#

in general: search for security problems and you will find plenty for both

warm gorge
#

Ah I see, thats kinda silly... Oh well. Found the variable I need to disable, BIS_enableRandomization. Will just set it manually. Cheers. @meager granite

rancid ruin
#

so your problem is with CEF based desktop programs rather than node itself?

cedar kindle
#

is that "security" issue you're refering to DBA's not changing the default password

rancid ruin
#

you'd have to come up with many good reasons to not use node if you want to counter the many good reasons TO use it

queen cargo
#

good reasons to use it?

#

gimme some

rancid ruin
#

it's very fast, it's javascript so comes with huge knowledge base and millions of packages

#

npm install anything_you_want

#

vs "hipster crap and ummm security problems?"

queen cargo
#

to 1: depends on your usecase
for what JS was build innitially, yes
for a lot of other cases, no

to 2: mainly useful for webdevelopers
C/C++ still has way more (though way more complicated in usage)
python also has a hell lot of packages
c#, java, ... all the same
just a different way to access those libs

to 3: there are other languages you can get such things too
hell thx to nuget in visual studio you even can do that in c/c++ nowdays

icy raft
#

hahaha

#

it's just a backend

#

you can do it with whatever, but all software implementations can break in pieces with a bad design

#

NodeJS, Python, Ruby, PHP etc

#

You probably are going to mess more easily with C/C++, Java etc that in JS

queen cargo
#

ye ... defend it
instead of admiting those problems

one lil thing: if you cannot find things you can point at on the language you use, and you enjoy using that language
you are probably nothing else but a fanboy ...

icy raft
#

But on the long painfull run, C++/Java is a better approach

queen cargo
#

c/c++ i have to agree on

#

java, c# etc. not rly

#

to mess up here you have to be trying

icy raft
#

NodeJS is good for a fast delivered prototype,

cedar kindle
#

lmao x39 talking shit again
use whatever tool or language that is suitable and right for the job

queen cargo
#

was asked why i am not for NodeJS @cedar kindle

icy raft
#

Hahaha

#

Everyone has it's opinions

queen cargo
#

just use the right lang for the right problem as @cedar kindle said
but do not use one lang just because you favor it if another lang is better

rancid ruin
#

javascript/node mainly useful to web developers? who'd have thought?

#

python does have many packages but npm has the most of any in the world. and it's faster than python for pretty much everything

cedar kindle
#

no i said use whatever you want as long as it's suitable
he was talking about a marketplace, you can use whatever backend you want

queen cargo
#

you did noticed that i said the exact same thing and agreed with you @cedar kindle ...

icy raft
#

Just

cedar kindle
#

yet you instantly said nodejs was wrong to use here which it is certainly not because it's nothing else than io

icy raft
#

Program in assembly, fun granted for years to come

#

Anyway, still no one interested in C++ .dll fun? ๐Ÿ˜„

rancid ruin
#

c++ is for hipsters and it's insecure

icy raft
#

But RVEngine forces you to use it for plugins

#

I'd rather do it in any other language, but I'm not allowed

#

(Yeah, I know there was a JNI plugin, but hasn't been updated since 2014 and doesn't work properly as of today)

cedar kindle
#

checkout sock rpc. But it's not being updated

#

so there's no x64 version

queen cargo
#

@cedar kindle fakenews ... the whole discussion was not about nodejs being right or wrong for the job

cedar kindle
#

lol.

queen cargo
#

it was about why i dislike nodejs and mongodb

icy raft
#

@cedar kindle yeah, tried it on my local machine but couldn't get it to work

#

But NodeJS is soooooooo easy for making an API

#

Piece of cake

rancid ruin
#

it's good isn't it

vague hull
#

Why is c++ insecure

rancid ruin
#

good question

vague hull
#

U said it

#

Go ahead

cedar kindle
#

it should work if you're running 32bit @icy raft, we're using it for logs on our unix server

icy raft
#

hmm

#

idk, will try to get it working some other day, tried compiling it from source with no luck

little eagle
#

@halcyon crypt

you mentioned that the private params aren't set when using onMapSingleClick with addMissionEventHandler(bearbeitet)
does this apply to all (mission) EHs?
Yes. _this is the only special variable and can be different from the stacked / command version.

#

Aaand as usual X39 is just talking non-sense. Why even answer if you have no idea? At least the wiki link is helpful.

queen cargo
#

aaaaand commy2 is a retarded as usual

delicate lotus
#

@little eagle german?

queen cargo
#

he is

delicate lotus
#

I saw that (bearbeited) in his message

#

instantly knowed it

#

lol

halcyon crypt
#

so I guess when the wiki says "(same as _id param)", "(same as _uid param)", etc it's save to assume that those variable are available without explicitly doing the params ["_id", "_uid", "etc"]; thingy, right?

rancid ruin
#

ask commy and x39 you will get the correct answer

#

and some drama to go with it

halcyon crypt
#

๐Ÿ˜„

little eagle
#

it's save to assume that those variable are available without explicitly doing the params
No, all it means that the wiki is ambiguous. "same as" refers to the stacked and command versions.

subtle ore
#

Fucking germans man ๐Ÿ™„

#

:P

halcyon crypt
#

well using those variables without params doesn't seem to be throwing errors soo I'm lost ๐Ÿ˜›

icy raft
#

in sqf it's never safe to asume anything

#

ever

#

Do error checking before trying something risky if you want to be safe, and even then sometimes it will blow up

subtle ore
#

@icy raft into bits and pieces

icy raft
#

With fire, lots of it

halcyon crypt
#

oh I know, I'm just not in a position to actually test anything at the moment :/

subtle ore
#

@halcyon crypt huh?

#

@icy raft blue fire out the back of the psu? ๐Ÿ˜€

halcyon crypt
#

huh huh?

subtle ore
#

@halcyon crypt youre not in the position to test? Im not sure what you are talking about

halcyon crypt
#

on Linux and BI/VP taking a long ass time to update the port from 1.64 to 1.72 ๐Ÿ˜

subtle ore
#

Ooooh..sweet a linux update :D

halcyon crypt
#

I wish ๐Ÿ˜›

subtle ore
#

1.72 is the latest is it not?

halcyon crypt
#

for Windows yes

subtle ore
#

Damn,

icy raft
#

@subtle ore and butterflies

subtle ore
#

@icy raft Shieett.

tranquil nymph
#

@halcyon crypt What's your question, I'll answer it with no drama ๐Ÿ˜›

halcyon crypt
#

whether or not the magic variables are available in EHs set with addMissionEventHandler vs BIS_fnc_addStackedEventHandler

#

e.g. _id and _uid in the case of PlayerConnected

subtle ore
#

@tranquil nymph takes cover from shots above head

tranquil nymph
#

When using the script command onPlayerConnected or the stacked function, they are local variables pre-set before the code you pass in runs

#

You should always be using addMissionEventHandler these days anyway though

#

Hope that clears everything up

halcyon crypt
#

so you're saying that _id and _uid are definitely set without going through the params ["_id", "_uid"]; dance

tranquil nymph
#

In the case of the script command onPlayerConnected and when using BIS_fnc_addStackedEventHandler yes

#

Those are both obsolete methods though and addMissionEventHandler is preferable for compatibility and performance reasons

#

Plus, personally, I find that having all arguments consistently given as _this is much cleaner than magic local variables that are not explicitly declared

halcyon crypt
#

sure, I agree. Just mentally debugging some code laying around ๐Ÿ˜›

tranquil nymph
#

๐Ÿ‘

subtle ore
#

@halcyon crypt A mental debugger? What are you the first cyborg we don't know about?

halcyon crypt
#

I'm not allowed to discus such things! ๐Ÿค

subtle ore
#

Shit, we're on to them. Spies! Lies! Gov experiments! Arma debuggers, what's next?

tranquil nymph
#

Have you tried running it through the sqf linter? ๐Ÿ˜ƒ

subtle ore
#

SQF Linter HAHA ๐Ÿ˜„

tranquil nymph
#

It exists!

subtle ore
#

Holy fuck, it exists!

tranquil nymph
#

Not perfect, but pretty close and has saved me some headaches before

halcyon crypt
#

I've been told it's not throwing any errors so it should be correct

subtle ore
#

@halcyon crypt not always true

halcyon crypt
#

@little eagle was right after all

tranquil nymph
#

He usually is

halcyon crypt
#

_id, _uid, etc aren't set with addMissionEventHandler

tranquil nymph
#

I...just said that ๐Ÿ˜†

halcyon crypt
#

you didn't ๐Ÿ˜›

little eagle
#

marcel

well using those variables without params doesn't seem to be throwing errors soo I'm lost ๐Ÿ˜›
Because the code of eventhandlers run in unscheduled environment where undefined variables are usable and simply report nil

tranquil nymph
#

I wish discord had a quote feature

little eagle
#

commy2 was right after all
What did you expect?

halcyon crypt
#

@tranquil nymph I'm sorry.. I must've misread the bits after that โค

subtle ore
#

All hail Commy? ๐Ÿ˜›

halcyon crypt
#

๐Ÿ™‡

tranquil nymph
#

haha it's cool, I figured as much

halcyon crypt
#

and just to annoy @queen cargo, you were wrong ๐Ÿ˜

queen cargo
#

You misunderstood what I said

subtle ore
#

Do I need to grab my popcorn?

halcyon crypt
#

I know.. reread it lol

#

I'm an ass ๐Ÿ˜„

#

sorry

#

โค you all ๐Ÿค—

little eagle
#

No one understands what X39 says, because it makes no sense to begin with.

rotund cypress
#

Hey guys, can I use try catch without throw and still get an exception?

rancid ruin
#

try catch works?

rotund cypress
#

It works, but I am not sure, it works a bit differently from other languages

little eagle
#

Only throw makes it jump to the catch block.

#

Script errors don't. assert doesn't either.

#

The whole try-throw-catch command structure is pointless.

#

It's a glorified if-then-else.

rancid ruin
#

hmmm i'll wait for x39's opinion

little eagle
#

Ahaha. He'll probably say it's useful or some cray shit like that.

rancid ruin
#

if/then/else is for hipsters

little eagle
#

Dunno about that, but try-throw-catch certainly is.

icy raft
#

Did you know that...?

tranquil nymph
#

Yeah the try catch sqf syntax is dumb

#

It's like they added it because programming languages have it, but they didn't grasp the purpose of it

rotund cypress
#

@little eagle that makes it absolute useless

#

The whole point of try catch is non-existant but it's still in? ๐Ÿค”

tardy yacht
#

Hey y'all there's something I can't seem to understand: I'm trying to display the player's cash and bank from my spawn menu (life) but can't seem to parse formatted text to the structured text thing.

#

17:06:16 Error in expression <x) select 0];
} forEach _spCfg;

CONTROL(38500,38575) ctrlSetStructuredText pars>

#

I don't think I know what I'm doing with that "CONTROL(X,X)" thing

rotund cypress
#

Join the life frameworks discord @tardy yacht

#

There is no one here who knows what those macros are doing

tardy yacht
#

Well you still helped me by telling me that was a macro. I was right, I don't know what I'm doing. Thank you!

queen cargo
#

try catch and throw got their usecases
but nobody (not even BIS) is using it anyway ...

#

in regards of "is not catching script errors" well ... actually surrounding scripts with trycatch is a pretty bad way ...
even in everyday coding you should not surround everything that could throw exceptions with a try catch

it indeed is bad however, that it is not catching exceptions
would be kinda simple to do so one would think

rotund cypress
#

Well, try catch in other languages are very handy sometimes, for things that causes errors that is out of programmers control @queen cargo

#

Which is exactly what it is intended for

queen cargo
#

you do not have those things in arma
thats the point

#

there is no IO stuff

#

no networking

#

no nothing like that

#

only those pisky script errors

#

which can most of the time be catched by using params

rotund cypress
#

There is things in ArmA that is out of users control, that can cause issues depending on different situations

rancid ruin
#

need to run x39's messages through the commy linter

rotund cypress
#

๐Ÿ™ƒ @little eagle

little eagle
#

need to run x39's messages through the commy linter
"try catch and throw got their usecases"
->
๐Ÿ’ฉ

subtle ore
#

Commy, how badly do you hate X39's gut?

little eagle
#

I don't. I just hate the poo poo he writes all the time.

rancid ruin
#

while {true} do {hate += 1}

#

imagine if you could += in SQF like a proper language

#

and don't show me some cba macro commy

#

cos i'm sure there's one for that

little eagle
#

I was about to write something different, but meh

subtle ore
#

what's the hate threshold then?

rancid ruin
#

you were about to show me a cba macro weren't you

little eagle
#

It's:

INC(_number);

btw.

rancid ruin
#

let me run that through the dscha linter and see what it says

little eagle
#

what's the hate threshold then?
0.5

#

Eh, I'm not even advocating for using this macro or all the similar ones.

#

I think pure SQF is easier to read in such cases.

tardy yacht
#

I'm unsure why I get this error Error position: <(38500,38575) ctrlSetStructuredText pars> 18:17:39 Error Missing ;

#

Full line: ((findDisplay 38500) displayCtrl 38575) ctrlSetStructuredText parseText format ["<img size='1.7' image='icons\ico_bank.paa'/> $%1<br/><img size='1.6' image='icons\ico_money.paa'/> $%2",[BANK] call life_fnc_numberText,[CASH] call life_fnc_numberText];

jade abyss
#

```sqf
NewLinesWithYourCode
```

tardy yacht
#
18:17:39 Error in expression <ct 1,localize "STR_Spawn_CSP"]];
CONTROL(38500,38575) ctrlSetStructuredText pars>
18:17:39   Error position: <(38500,38575) ctrlSetStructuredText pars>
18:17:39   Error Missing ;
#

like this?

#
private ["_spCfg","_sp","_ctrl"];
disableSerialization;

if (life_is_arrested) exitWith {
    [] call life_fnc_respawned;
};

if (life_respawned) then {
    [] call life_fnc_respawned;
};
cutText["","BLACK FADED"];
0 cutFadeOut 9999999;
if (!(createDialog "life_spawn_selection")) exitWith {[] call life_fnc_spawnMenu;};
(findDisplay 38500) displaySetEventHandler ["keyDown","_this call life_fnc_displayHandler"];

CONTROL(38500,38575) ctrlSetStructuredText parseText format ["<img size='1.7' image='icons\ico_bank.paa'/> $%1<br/><img size='1.6' image='icons\ico_money.paa'/> $%2",[CASH] call life_fnc_numberText,[BANK] call life_fnc_numberText];

_spCfg = [playerSide] call life_fnc_spawnPointCfg;


_ctrl = ((findDisplay 38500) displayCtrl 38510);
{
    _ctrl lnbAddRow[(_spCfg select _ForEachIndex) select 1,(_spCfg select _ForEachIndex) select 0,""];
    _ctrl lnbSetPicture[[_ForEachIndex,0],(_spCfg select _ForEachIndex) select 2];
    _ctrl lnbSetData[[_ForEachIndex,0],(_spCfg select _ForEachIndex) select 0];
} forEach _spCfg;

_sp = _spCfg select 0; //First option is set by default

[((findDisplay 38500) displayCtrl 38502),1,0.1,getMarkerPos (_sp select 0)] call life_fnc_setMapPosition;
life_spawn_point = _sp;

ctrlSetText[38501,format ["%2: %1",_sp select 1,localize "STR_Spawn_CSP"]];
#

CONTROL(38500,38575) is ((findDisplay 38500) displayCtrl 38575)

dusk sage
#

Are the macros included in here?

tardy yacht
#

They are, somewhere.

#

Actually

#

Jesus

dusk sage
#

๐Ÿ‘

tardy yacht
#

Tried it and it works. I feel smart. Thank you

queen cargo
#

@rancid ruin in SQF it would have to be inc _xyz due to that has to be a unary command
if build into the actual SQF language (like the = operation) it could be possible though

rancid ruin
#

commy parse that message for me please

little eagle
#

๐Ÿ’ฉ

lean tiger
#

Is there any way to determine if an object is an object that was originally part of the map or not?

#

even something as arcane as setting the object IDs everything is assigned crazy high?

#

so that if <, then it's old map stuff?

#

ahhhh, I see, inverse of that is allMissionObjects

rancid ruin
lean tiger
#

You da real mvp

#

ah, pretty recent!

#

Thanks man

rancid ruin
#

๐Ÿคถ๐Ÿฟ

cedar kindle
tardy yacht
#

Anyone have a clue of how TextPos class works when using a buttonshortcut?

#

I'm trying to center the text horizontally and vertically in the green button.

vapid frigate
#

you tried style = ST_CENTER + ST_VCENTER; ?

#

(style = 0x02 + 0x0C;)

tough abyss
#

@little eagle I've never seen anyone use try, throw and catch commands in SQF.

little eagle
#

Yes, because anyone but X39 realizes that they are pointless.

tough abyss
#
try {
    throw true;
} catch {
    _exception;
};
#

That's...

vapid frigate
#

pretty sure he uses them wrong

tough abyss
#

...something.

vapid frigate
#

uses them like control statments

#
private _balance = param [0, 0, [0]];

try {
    if (_balance <= 0) throw false;
    if ((lilc_player_cash - _balance) < 0) throw false;
    
    throw true;
} catch {
    _exception;
};```
#

uses it like 'return'

#

or exitWith

subtle ore
#

Does it exit the same way?

vapid frigate
#

assuming any of his code works, i guess so

subtle ore
#

Would have to if it worked. /shrug

vapid frigate
#

would be confusing if lilc_player_cash was nil though.. would return a string with the error in it instead of true/false

subtle ore
#

Seems like a bit extensive for just a return.

vapid frigate
#

yeh i dunno.. could be cheaper than exitWith potentially

#

since exitWith creates a new scope

subtle ore
#

Depends on how fast all of it is, condition and return data size right?

vapid frigate
#

just depends how fast try/catch/throw is compared to exitWith {}

subtle ore
#

Odd, i thought exitWith existed in executed scope?

vapid frigate
#

i could be wrong about scope, but it's code (hence the { })

subtle ore
#

Right

vapid frigate
#

unlikely to make enough difference to do that to your code anyway imo

subtle ore
#

True. Other uses may seem to prove otherwise

tough abyss
#

@little eagle I use try catch to save some lines. I can just throw my exception and put it out as a formatted hint. So i can just use 1 hint but a dynamic exception if you get what I mean.

little eagle
#

100% you can do it with less lines @tough abyss

subtle ore
#

Have we tested performance yet..?

little eagle
#

Test what?

subtle ore
#

Well look above, something like exitWith versus and exit with try catch

#

Throw

little eagle
#

"something with"

#

Not very helpful.

subtle ore
#

Well hell, unless there is something wrong with the speed of the commands i dont see a problem with it. You forgot your less than commy ;)

vapid frigate
#

i don't think you can do what cloud said at all without try/catch?

#

let alone with less lines

#

(that's what try catch is generally for)

subtle ore
#

Well true, i believe in any case it depends on what you are using it for

vapid frigate
#

unless 'exceptions' are only things you throw manually, not script errors etc

subtle ore
#

๐Ÿคท

dusk sage
#

unless 'exceptions' are only things you throw manually

#

Correct

#

It is a user handled system

little eagle
#

You forgot your less than commy ;)
?

#

try-throw-catch is trash. Just an example from the posted repo:

try {
    if (_cameraName == "") throw configNull;
    
    private _camera = (missionConfigFile >> "CfgStaticCameras" >> _cameraName);
    if (isNull _camera) throw configNull;
    
    throw _camera;
} catch {
    _exception;
};

This whole function could just be:

missionConfigFile >> "CfgStaticCameras" >> _cameraName
#

and it would be exactly the same.

atomic jetty
#

common usage of try/catch: as few as absolutely required
in a3: a bit senseless

#

๐Ÿ˜„

little eagle
#

There is no point in comparing SQF try-throw-catch with the ones from other langues, because they are completely different.

#

Just because they share the same name, doesn't mean they have anything to do with each other.

tough abyss
#

^

little eagle
#

I hate this. Why do people care so much about the names of things?

tough abyss
#

SQF is a String interpreter in a nutshell

#

SQF code (strings) -> Interpreter -> Some intermediate stage -> Action

#

Thats the extent of it right @little eagle

little eagle
#

I don't know if this necessarily has a connection with what try-throw-catch does.

#

I don't see it.

#

It fails to demonstrate why that being different would change anything about the control structure or what it would have to look like to make try-throw-catch useful.

tough abyss
#

Does try-throw-catch serve any uses?

little eagle
#

No.

tough abyss
#

So why not remove it? Actually come to think of it there might be BI functions that depende on it still...

little eagle
#

Backwards compatibility.

tough abyss
#

Yeah I thought that.

little eagle
#

Just because someone uses it, doesn't mean that the functionality couldn't be achieved with different commands in a better way, or the whole structure of the script could be simplified.

#

And it being useless does not mean that deleting it would do any good.

vapid frigate
#

you might be able to do easy error handling in it if throws go back to outer scopes

#

like if you call 10 functions inside other functions and the 10th one 'throws' an error.. it returns all the way back to the catch

little eagle
#

Please provide an example. This sounds like a horrible mess.

vapid frigate
#
_fnc_C = {
    if(_this == "nothing") then {
        throw "Nothing passed to C";
    };
    [] call _fnc_C;
};
_fnc_B = {
    _vA = something;
    _vB = _va call _fnc_C;
    //do something with _vB
};
_fnc_A = {
    _vC = call _fnc_B;
    //do something with _vC
};
try {
    [] call fnc_A;
} catch {
    hint "FAILED: " + _exception;
};```
#

seems like it's either that, handle it in every function, or let it 'die of natural causes'

#

most scripts just tend to do the latter

little eagle
#

I see no application for that. Has anyone ever used it this way?

vapid frigate
#

don't know.. but seems like it could be feasible in some circumstances

little eagle
#

It really doesn't.

vapid frigate
#

I'm only assuming that would work.. but i don't see any easier alternative (other than not handling it)

#

don't think there's any other way to sorta exit all scopes of script?

#

other than letting it fall apart

little eagle
#

Handling what? You could just put the hint where all the throw atm are!

vapid frigate
#

then what happens with the 'do somethings'

#

would have to check in each function that something valid was returned

little eagle
#

Yes, every function should be designed in a way that it always reports something meaningful.

#

That way they can be used interchangeably at any point in the project where they could be useful.

#

And not depend on a control structure of a function on a lower level.

vapid frigate
#

yeah, not saying it's a good design (i've never used it.. don't know what happens when you 'throw' outside a try)

#

but seems like it could be useful in some circumstances

little eagle
#

I too am saying that it's not good design. And my evidence for it not being useful is, that no one bothered to implement it the way you suggested.

vapid frigate
#

yeah, most scripts don't bother error handling

#

because the scripts will generally just stop and show a half-decent error anyway

little eagle
#

I think relying on control structures that are distributed across multiple functions is universally a bad idea. Because it hurts readability a lot. So I reject your example as being a template for anything decent.

vapid frigate
#

that's how try/catch is generally used in other languages too.. just guessing that's what it's there for

little eagle
#

Most of the examples I have seen so far end with:

catch {
    _exception
};

And it's easily demonstrated that these can be either simplified by using exithWith, or, if the throw is inside a secondary scope, with breakOut.

#

And even breakOut is a novelty.

#

If you have many secondary and tertiary (or worse) scopes, your script already is ugly.

vapid frigate
#

yeah looks like most usages of it are as a control structure.. that's not what an exception should be

#

but maybe it's faster or something.. who knows

little eagle
#

Yes, it lacks the capability of handling actual SQF exceptions, therefore is just a control structure and it fails to have any meaningful benefits compared to other available control structures.

#

The only reason people think it has uses is, because they compare it with stuff from other languages. But I don't believe in names.

vapid frigate
#

it does the same thing as in other languages

#

just doesn't catch internal exceptions

tough abyss
#

best you can do for handling errors is assert

#

If you wanted to you could mass generalize a try-catch-throw system.

#

To get a set of boolean values.

#

As a function then plug them in.

little eagle
#

Sigh. "It's the same thing, but lacks this fundamental component"

best you can do for handling errors is assert
fml

#

All hope seems lost here. Just because something exists, doesn't mean it serves any practical use.

#

assert's only use is showing (confusing) on screen errors. You can do the same thing way better with hint or a custom control, BIS_fnc_error etc etc.And do the RPT logging with diag_log.

tough abyss
#

@little eagle Ok ok...

#

Maybe, it would be a good idea to say these functions are deprecated?

#

And old?

little eagle
#

That would imply that they ever had a use, so no, it would not be a good idea.

subtle ore
#

@little eagle. define > "less than"

little eagle
#

Backtracking... Can't remember what exactly this was about. You might want to repeat it.

subtle ore
#

@little eagle you had asked why i had said "you missed your less than" since you use it instead of mentioning someone.

little eagle
#

Yeah, sorry.

is for quoting. It works in Slack and Github that way. Can't be done in discord easily.

subtle ore
#

Ooh, that makes a lot of sense now.

little eagle
#

Also it's a "greater than", not a "less than"?

subtle ore
#

Oh, duh . fuck it, its 4:56 in the morning. All semantics if you ask me as of right now

little eagle
#

The difference is pretty elemental and beyond "semantics" ๐Ÿ˜›

distant egret
#

Hello guys, I'm trying to make a sort of a music player and I'm trying to pull all the music that's currently loaded.

'true' configClasses (configFile >> 'CfgMusic')
#

However I get for example with testing,

getArray (("true" configClasses (configFile >> "CfgMusic") select 30) >> "sound")

returns,

["\DBE1\Models_dbe1\Music\WithCare_War.ogg",1,1]
#

How do I transfer this to a classname so it can be used with playMusic?

indigo snow
#

The configName of the class that contains that property? Been a while since I messed with sounds.

distant egret
#

ah thanks that did it,

configName ("true" configClasses (configFile >> "CfgMusic") select 30)
#

"WithCare_War"

little eagle
#
configName (configFile >> "CfgMusic" select 30)

This does the same thing btw.

distant egret
#

Yea the configClasses is used to all the CfgMusic

#

I left it in there with testing

indigo snow
#

Also uh take care that number 30 might not always be the right one when modding gets involved

distant egret
#

Nah it was just a quick test to get a value

#

I'm using a forEach and list them up in a dialog

queen cargo
#

try catch and throw have much in common with other languages
the whole reason why it is that "usable" in other languages is due to the fact that they throw theese by themself
by checking that stuff before calling

you got giant frameworks rdy to be used which all contain exceptions
even the exception class of pretty much all langs is in fact: a class on its own

#

only thing in SQF is that it wont catch input errors (eg. int * string)

#

which is that kind of stuff you are already supposed to manually check for

#

reason for try catch throw not being useful in SQF is because nobody chekcs for that stuff and neither they throw when they do (including BI)

little eagle
#

There is no point in posting this article here, precisely because the SQF command structure cannot handle native exceptions. The C++ version and the SQF version are fundamentally different.
And if the exceptions are not handled internally, you should instead handle them with the available control structures.

still forum
#

@rancid ruin

imagine if you could += in SQF like a proper language
You could add that with Intercept ๐Ÿ˜„

@little eagle

assert's only use is showing (confusing) on screen errors.
Or breaking in the Debugger if you use one.

little eagle
#

You could use any other faulty expression instead, so no.

queen cargo
#

in which aspect are the c++ version and sqf version fundamentally different?

#

enlighten me

little eagle
#

SQF is composed of a long list of functions that are called "commands".

#

These don't throw exceptions that can be handled by try-throw-catch.

vapid frigate
#

doesn't mean you can't throw your own exceptions (not that sqf scripts are usually complex enough for it to help much)

#

could be useful if all script functions used them.. but kinda pointless as it is

queen cargo
#

So you cannot come up with a proper argument?
Only reason those commands are not throwing exceptions capturable is because bis decided so
C++ the dev of the method also had to decide when it would throw

#

You develop your cide
So do not blame others for not doing what you also are not doing

#

You could easily throw in a simple throw on all functions that you yourself write so that you could use try catch

#

As you and others are not doing so

#

It is useless

little eagle
#

How is that not a proper argument? If SQF would be different ("because bis decided so") then of course it could be useful.

queen cargo
#

Not due to its design

little eagle
#

But it's not and as long as that not changes, try-throw -catch is useless.

queen cargo
#

If sqf was like c++ bis still would have had to insert the throw themselves

little eagle
#

The sqf functions not throwing exceptions is design

#

If sqf was like c++ bis still would have had to insert the throw themselves
Yes if SQF was different, anything I said could be false.

#

Problem is, it's not.

queen cargo
#

You just love to blame sqf for everything

#

Including the community not utilizing all available commands drawing some useless

little eagle
#

Blame? I'm just saying what's true. "If A was like that, B would be useful" is not a proper argument either.

queen cargo
#

start using try catch

#

and it will get useful

#

and sanitize your inputs

little eagle
#

No, it cannot handle exceptions.

#

And we have no way to rewrite SQF at the command level.

#

And if I had to rewrite it at the function level, that would cause huge problems too.

#

It's a ton of work and then you have to maintain two libraries.

queen cargo
#

there are no exceptions in any language on that level that you are asking for

little eagle
#

C++ does not have such an extensive command list.

#

They are functions that don't support exceptions catchable by try-throw-catch

#

"on that level". SQF doesn't support it at ANY level.

cedar kindle
#

i always ๐Ÿคฆ when i read SQF written by someone and it has try catch

queen cargo
#

cpp also will not catch its faults for the "commands" it has
writing to NULL will not be catchable

#

SQF supports it ... using try catch

#

and throw is how you provide the engine an exception

little eagle
#

Yes, but the C++ commands are actually "commands" and not functions. C++ and SQF are different dude.

vapid frigate
#

all exceptions come from some code somewhere having 'throw something'

little eagle
#

And no, neither the commands nor the functions library supports exceptions like that.

#

all exceptions come from some code somewhere having 'throw something'
Wow such an insightful comment...

queen cargo
#

better then your bullshit flaming about SQF all the time

#

use try catch

#

and it will for some weirdo reason start to be useful

#

do not use it

#

and for some weird reason nobody else will use it too

little eagle
#

How is it flaming to point out that some concepts were introduced at one point and then abandoned?

queen cargo
#

how was it abandoned

#

because it is not catching the low level problems?

little eagle
#

It's not supported.

#

Yes.

queen cargo
#

so lets get back to my comparison to c++

little eagle
#

No.

#

This squabble is pointless.

queen cargo
#

you just try to avoid to say that try catch would have a usage if stupids like you would stop blaming SQF for their problems and start using it

little eagle
#

Why not demonstrate the usefulness? Show me what you've written and how try-throw-catch was in any way helpful.

#

Also

stop blaming SQF for their problems and start using it
Why would I not blame X for it's problems?

queen cargo
#

because you are X

#

not SQF

#

SQF is the tool you are provided with

#

and you blame the tool that nobody uses its abilities

little eagle
#

And the tool doesn't support exceptions in any meaningful way...

queen cargo
#

you still do not understand the whole fucking shit

#

talking to you is like talking to a wall

#

an extremist

#

or whatever wont even try to take apart

little eagle
#

You're a talentless hack, X39.

queen cargo
#

ye ...

#

i am a complete script noob

#

tell that all your friends

cedar kindle
#

"it's abilities" the problem here is that it's a crippling ability

queen cargo
#

how is it crippling? tell me

little eagle
#

It's creates bad code.

cedar kindle
#

because you're better off using literally anything else

queen cargo
#

how does throwing exceptions create bad code

#

convince me

#

that i am wrong

#

because trying so will invalidate ALL try catch functions in literally all languages

little eagle
#

You cannot be convinced, because you're a fraud. Create something useful for once and proof how useful try-throw-catch is.

queen cargo
#

Create something useful for once already did

#

showed my usefulness to the community
stopped caring after AGM came up with a lot larger team

little eagle
#

And it supports your ideas about try-throw-catch's usefulness?

#

Show it so we can laugh at it.

queen cargo
#

why should it? the user was never supposed to call any function in there
i am not creating user functions

little eagle
#

So all you've created is yet more evidence in favor of what I said. Thanks.

queen cargo
#

try to turn your "argument" around however you want

little eagle
#

You don't even know what an argument is.

queen cargo
#

you just try what koffeinflummi tried when he was the "big guy"
ppl like you come and go
they always think they are the best as they got their lil baby to show

little eagle
#

I didn't show anything here.

#

Stop making up narratives.

queen cargo
#

no need to
everybody knows

little eagle
#

Knows what?

#

Maybe you assume shit that never happened. And that's why you spout non-sense all the time. It's called delusions.

queen cargo
#

you mean what you are doing the whole time?
thing is: continuing this way will summon dwarden
and i do not plan to clutter this chat further with you not even trying to stop blaming SQF for your and the communities faults

little eagle
#

I will keep "blaming" X for it's faults. That is the reasonable thing to do.

queen cargo
#

KK had examples for trycatch inb4

try {
    if !(assert isNull _unit) then {throw _unit};
    /*...code...*/
} catch {
    diag_log format ["Unit <%1> is not null", _exception];
};
#

such a stupid as i know

#

completly useless guy

#

commy obviously is right like always

#

-i am out- for this convo now

little eagle
#

Oh, KK said it, so it's true.

#

What a great thinker you are.

#

Now look at Github and check out the projects there.

#

And see that no one uses try-throw-catch.

queen cargo
#

put away popcorn @jade abyss
blocked commy for now again

little eagle
#

X39 is bad at thinking.

jade abyss
#

Excuse me? I haven't even typed in here. Just clicked in.

warped thicket
#

that example of try-catch is simply pointless, in C++ exception catching is meant for exceptions thrown deeper in the code, not in the actual try block (but something that is called from it for example), in this case it would be a lot shorter and simpler to just do an if check

queen cargo
#

was just one example
obviously it would happen in a function you call using ... well call

frosty cave
#

looking for a good way to start debugging a mod's scripts - getting low fps on server and want to find a way to see which scripts are causing the most problems

tough abyss
frosty cave
#

thanks, didn't know that was a thing. does the profiling branch help me here? can't find a lot of info about it #perf_prof_branch

queen cargo
#

soonโ„ข ArmA.Studio will also include that

#

something to get diagnostics of performance

warm gorge
#

Is there a character limit to diag_log messages?

#

Nevermind, apparantly theres a 1044 character limit. Not sure of any way around that

vapid frigate
#

could split the string if you really need it that long

#

depending on what you're doing, copyToClipboard might be better

warm gorge
#

Yeah true

still forum
frosty cave
#

thanks Dedmen

rancid ruin
#

guys does try/throw/catch have any use in arma 3 sqf? anyone know?

still forum
#

Well. It's not broken.. so..

#

If you have a use then you do.

frosty cave
#

is this a meme? I swear I've seen this conversation like 5 times the last two days

rancid ruin
#

what is meme?

frosty cave
rancid ruin
#

fake screenshot

cedar kindle
#

wrap all your code in try catch for extra safety

modern sigil
#

The toxicity in the Arma community by some people over the ethics of using try-catch-throw in a niche scripting language just makes me ๐Ÿคข

XMedSys was Cool and Goodโ„ข fight me irl

rancid ruin
#

the ethics of using try-catch-throw ๐Ÿ˜น

rugged lake
#

Hi, I'm learning stuff and looking for a script to turn on spotlights without doing so manually, has anyone accomplished this?

rancid ruin
#

maybe something like this @rugged lake

player action ["lightOn",  the_spotlight_object];
#

I can't remember how "player" works on a dedicated server though, you might want to get a player from allPlayers to do the action, not sure the best way

#

or any other unit I guess, doesn't have to be a player

woeful dust
#

Use the unit name instead of player on a dedicated server

rugged lake
#

@rancid ruin say I stick an AI on the spotlight, could I use a script a command similar to what you posted to make them turn the light on ? Instead of player using the thisunit function? I'm really new to this sorry

still forum
#

(driver the_spotlight_object) action ["lightOn", the_spotlight_object];
or maybe gunner instead of driver not very sure

rancid ruin
#

yeah it doesn't matter which unit does the action or their distance, or anything if I remember correctly

#

ye that might be it, dedmen's one

rugged lake
#

gunnegunner is correct

rancid ruin
#

does setPilotLight not work? cos I used that for cars and stuff in a persistent database thing I made

#

ah yeah use the action function instead, probably easier
(setPilotLight) Switches headlights of a vehicle on/off. Note that the vehicle has to be local, for global variant use Arma 3 Actions "LightOn"/"LightOff"

still forum
#

Never heard of it

rugged lake
#

@still forum I got it to work using your script

#

this action ["lightOn", the_spotlight_object]

#

Thank you!

#

the both of you.

still forum
#

That's not really my script tho ^^

#

Happy its working for you

#

keep up the learning

rancid ruin
#

it is and you are now responsible for maintaining said script

rugged lake
#

Well you brought it to my attention, as somebody who knows almost nothing about scripting you are now a god in my eyes ๐Ÿ˜›

#

Huh, now both the spotlight operators turn their lights from the original position to look at the same point?

rancid ruin
#

welcome. you have arrived at Arma Scripting

#

next train is to misery and disappointment, leaving in approximately one hour

rugged lake
#

Huh.....greeeat

#

It is working. I don't know how and I don't know why, but it's working.

royal abyss
#

is it possible to make a script that prevents showing error messages like "could not find p3d" ?

rancid ruin
#

yeah more than likely, but you should fix the problem instead

#

if it's not your addon then tell the developer

royal abyss
#

the problem is that the error is a wanted error to create the effekt of it

#

its basicly to make some parts invisible and if there is a p3d it would cast a shadow ...

rancid ruin
#

that sounds fucked up. this is probably a #arma3_model question

#

you're not trying to do things which you shouldn't be are you?

royal abyss
#

what do you mean with that ?

rancid ruin
#

I mean are you ripping models from other games, or modifying other people's addons?

vapid frigate
#

don't think it's possible to disable those errors

royal abyss
#

no i dont @rancid ruin its just a config for arma 3 models that lead to not existing p3d and paa so the backpacks are invisible i could work with Globaltexture but then they cast shadows...

#

and backpacks are nice to have to store weapons and stuff but the apex bergen for example is abit to big for my taste ๐Ÿ˜„

#

i knew there was also a way to set the position of backpacks but not sure how to ๐Ÿ˜ƒ

vapid frigate
#

could you use a dummy model/paa instead?

rancid ruin
#

ask in #arma3_model bro, someone there will know the exact best way to tackle this

little eagle
#

Great experts. No wonder this game is broken every other patch.

#

I bet this will make it into the next version without being fixed.

tough abyss
#

dang

#

someones mad

royal abyss
#

lul ๐Ÿ˜ฌ

little eagle
#

The problem has been pointed out a month ago and it's still ignored. And what's worse is, that the broken code is now even advertised on the forums as a scripting solution.

#

It is very concerning that the one in charge of rewriting the functions library lacks basic knowledge of the scripting language.

#

And so is the resistance to criticisms.

#

If the next patch crashes and burns then don't say I haven't told you so.

tardy wagon
#

manglement at it again

rancid ruin
#

@little eagle how did this end up happening?

#

did they try to improve eventhandlers in some way and failed, or what?

little eagle
#

That's my guess, yes.

rancid ruin
#

they need to just slow down patch releases if this shit is still happening

little eagle
#

Well, anyone decently knowledgeable in SQF wouldn't have made that error in the first place. Especially when the exact same thing was pointed out and discussed months ago already. And many times since release.

#

It's baffling really. Passing arguments is the one benefit the stacked ehs have over the mission ehs. And it was wrecked just like that.

#

It's again because people assume something is "essentially the same" just because it shares it's name.

#

But again onEachFrame stacked eventhandler is fundamentally different from EachFrame mission eventhandler. And the same is true for the rest of them.

rancid ruin
#

quick explanation of difference between onEachFrame stacked EH and eachFrame mission EH?

vapid frigate
#

you can pass arguments to the former

#

(well you used to be able to)

rancid ruin
#

that's it?

vapid frigate
#

i don't know how it works behind the scenes, but usage wise i think that's it

#

seems like all they need is 1 global var per event type (or all in 1 big array) of [[args, code], [args, code]] and to run them from a mission event handler

tough abyss
#

KK done fucked up.

#

We need @little eagle to be in charge of rewriting functions.

rancid ruin
#

commy & x39 imo

#

the dream team

jade abyss
#

oh god

vague hull
#

imagine the talk section of any command/function

rancid ruin
#

lol

#

I understand people giving KK a hard time if he fucks something up badly, but before BI took him on wasn't there even more problems which were never looked at?

#

or is it a case of BI using KK instead of a more seasoned internal developer, and things getting done badly?

vague hull
#

I think this is more about: "One who lives in glass houses shouldnt throw stones"

rancid ruin
#

in what sense?

vague hull
#

KK (in my memory at least) used to be kinda arrogant when it came to mistakes he made or being Mr. IamBetterInEverything sometimes

#

especially on Feedbacktracker and wiki

rancid ruin
#

that's true. good communication and inter-personal skills don't always go hand in hand with programmers, talented or not

#

he seemed to always love putting things up on his youtube channel which he knew would get 50 comments asking "how did you do that?" but never actually tell people lol

#

but on the other hand - his blog is/was one of the only real blogs for arma 3 scripting, so full credit there

tough abyss
#

commy & x39 imo
i'd watch that in TV ๐Ÿ˜›

vague hull
#

yep.. well, personally I find the underlaying situation of BI only having a single person to do it more problematic

rancid ruin
#

single person could be fine if they were more inclined to integrate in to and communicate with the community itself

vague hull
#

IMO they should just halt current DLC plans or make the Orange DLC become a cleanup patch

rancid ruin
#

can't see them ever doing that until the end of arma 3's life

#

I keep delaying finishing and polishing my arma 3 projects in the hope of a truly "stable" version of the game, but it probably won't come

vague hull
#

I dont see a reason why the arma 3 function library isnt a git repo yet

#

but thats none of ym business

tough abyss
#

Isn't Arma sort of an open source game?

vague hull
#

nope

#

the sqf side is

tough abyss
#

I mean, one can unpack the game's PBOs and basically see the games code.

vague hull
#

but thats just stuff they cant hide

tough abyss
#

Hmm, I guess.

vague hull
#

you wont ever see game code by unpacking pbos ^^

#

the "magic" all happens in the exe and dlls

indigo snow
#

You can take a peek at some of the content, but nothing at what makes it work

tough abyss
#

I expected more DLLs TBH.

#

Are the DLLs encrypted?

vague hull
#

google dll first pls

tough abyss
#

I know what a DLL is.

vague hull
#

it appears you dont

tough abyss
#

Do enlighten me.

still forum
#

@royal abyss

is it possible to make a script that prevents showing error messages like "could not find p3d" ?
Script. No.

#

No the DLL's are not encrypted. So what now?

vague hull
#

DLLs are binaries .. raw code to be executed so to speak
there is nothing to encrypt (well you could ofc)

dusk sage
#

What lol

royal abyss
#

i fixed it with another script instead of using a config ^^

little eagle
#

@tough abyss

Isn't Arma sort of an open source game?
No. By opening PBO files you reconstruct the human editable code from binarized files. Open source means that you have all the unbinned files available which can then be used to build the software yourself.

#

And there are large parts that cannot be reconstructed.

#

Everything that is not inside a PBO

vague hull
#

@dusk sage ?

tough abyss
#

Thanks for explaining.

grand berry
warm gorge
#

@pliant stream How would you go about that?

#

Oh the BIS functions?

#

In functions viewer?

#

Ah yep, sounds interesting

queen cargo
#

@grand berry commy is just a gigantic asshole
He wanted to prove that in the forums too now

open vigil
#

Discussions about copy protection or copying, backing-up, hacking, cracking or reverse engineering of any of BI's products or the products of any other developer will not be tolerated and such discussions will be deleted immediately. Any breach of this rule may result in the poster no longer having access to the forum.

It applies here as well. This is the only warning on the subject.

still forum
#

Can you link those rules please? Never read that and also didn't know forum rules apply to Discord

#

Exactly. Maybe just in #info_help_tips Because I'm very sure no one knows that these rules apply here

jade abyss
#

Common sense?

tough abyss
#

^^^^

#

๐Ÿ™„

open vigil
#

My common sense says continue and see how long you remain here.

jade abyss
#

๐Ÿคฆ

open vigil
#

To come into a company's official Discord and think it's ok to discuss illegal activities regarding their product is unreasonable.

dusk sage
#

As you said

#
-FM- - 05/14/2017
Intercept is the future
#

๐Ÿคฃ

vague hull
#

intercept didnt use any reverse engineering, the offsets and all were only good guessing ;)