#arma3_scripting

1 messages ยท Page 242 of 1

native hemlock
#

The best part is the wiki for difficulty has both true, false, 0 and 1

lone glade
#

i'm now going to try on dedicated on regular

jade abyss
#

hum

native hemlock
#

Here they have true and false for values, but then in a3\data_f\config.cpp they use 0 and 1

#

So perhaps they have a macro for true and false internally

lone glade
#

yeah they do

#

I've seen it around while looking at configs

jade abyss
#

hmm... what does TASKS count as? Waypoints?

lone glade
#

markers

jade abyss
#

Sure? ๐Ÿ˜›

lone glade
#

I saw a BI marker in allMapMarkers ๐Ÿ˜›

#

had only one task active, so I suppose they're markers

#

tbh they could be their own data type and have a marker too

#

aaand the markers appear

jade abyss
#

What did you changed?

lone glade
#

absolutely nothing

jade abyss
#

lol

#

ARS

lone glade
#

oh wait, I did restart my game

#

let's see if restarting it again will break it ๐Ÿ˜›

#

yep restarting the game broke em'

jade abyss
#

hmm

lone glade
#

(and before anyone mentions it, no it's not JIP related)

jade abyss
#

Could it be JIP related?

native hemlock
#

lol Dscha

#

Is this just on a server by yourself?

jade abyss
#

๐Ÿ˜›

lone glade
#

yes

jade abyss
#

On Dedi also?

lone glade
#

yep

jade abyss
#

hm

#

ffs.. i need more space on my desk...

tame portal
#

I have a small desk stop complaining ๐Ÿ˜›

jade abyss
#

nope, i will continue ๐Ÿ˜›
(removed it, doesn't belong in scripting, just wanted to randomly complain about stuff ๐Ÿ˜„ )

native hemlock
#

If you want to send me things relevant to it @lone glade I'd like to mess around with it

lone glade
#

gimme a minute, i'll pack errythin'

native hemlock
#

Cool, thanks

lone glade
#

vanilla mission, no mods required.

native hemlock
#

Did you run it both on dedicated server and local hosted with regular difficulty?

lone glade
#

yep

jade abyss
#

gnahhhhhh..... -.-
forgot 1st rule for scripting, when it doesn't work -> Check .rpt...

#

testing for ~45min... wondering why it doesn't work...

dusk sage
#

var dump

runic spoke
#

log everything!

tough abyss
#

Yay!

jade abyss
#

Keyhandler?

#

"zoomOut" iirc

#

@tough abyss

tough abyss
#

That would catch everyone that just zooms out tho

#

Wouldn't tell us who has the high FOV

jade abyss
#

hmm

tough abyss
#

I think getting a maxFOV in server.cfg would be best

fading dust
#

hello

jade abyss
#

"I need help" - "No"

fading dust
#

is they are anyone can help me

jade abyss
#

i knew it

#

@tough abyss Lemme test some stuff.

fading dust
#

why u don't help

#

it's config error

jade abyss
#

BECAUSE YOU DON'T EVEN SAY YOUR PROBLEM

#

aoedgnfsbgdfpgindfaspgdfsgndfsgn

#

Standardreply from my side ๐Ÿ˜›

fading dust
#

i'm creating new unit addon and i got this error Undefined base class

jade abyss
#

Ah, that error. Waiiitttt a moment. I am gonna take a look at my magicglassbowl to get your config

#

Mootaz, pls. If you need somebody to help, give him some infos.

fading dust
#

let me upload it to google drive

#

line 131

jade abyss
#

+for configs -> You better use pastebin.com or something similar

runic spoke
#

๐Ÿ˜‚

jade abyss
#

Because: I will NOT Download anything from anyone i don't rly know, in a Chatroom ๐Ÿ˜‰

runic spoke
#

^^ 202% agreed.

fading dust
#

is they are someone here that would help

tough abyss
#

Upload to pastebin or similar @fading dust

jade abyss
#

Currently searching for my old script... i did that crap before, but can't remember how -.-

fading dust
#

what is pastebin

runic spoke
fading dust
#

ok thx

#

i never used it and i'm creating my 1st addon

#

done

#

i upload it to postebin

runic spoke
#

link?..

fading dust
runic spoke
#

What is the error you are getting?

fading dust
#

when i launch arma it crash and say class Tunisian_Rifleman: B_Soldier_F .... Undefined base class line 131 c

#

so

velvet merlin
#

add "class B_Soldier_F;"

#

@tough abyss maybe you can loadFile the arma.3cfg - problem is ppl can have a custom name and location; you could read that from the rpt file, but same applies for that ๐Ÿ˜›

dull parrot
#

Anyone have experince with RscTitles? As far as pushing variables to the screen?

tame portal
#

Yeah they work pretty much like dialogs

#

Except you do not get the mouse cursor and you can define the fade in, fade out and duration time

#

I usually create them with cutRsc

rancid ruin
#

I just wrote a little script to allow closing the gear menu when you press the gear button. it works but I'm not used to using eventhandlers - is this a good script?

#
    _xxx = [] spawn {
        disableSerialization;
        waitUntil {!(isNull (findDisplay 602))};
        oneoh_eh_close_gear = (findDisplay 602) displayAddEventHandler ["KeyDown", {
            if ((_this select 1) in (actionKeys "Gear")) then
            {
                (findDisplay 602) closeDisplay 1;
            };
        }];
    };
}]; ```
tough abyss
#

not very used to dialogs and such but why not just:
player addEventHandler ["InventoryOpened", { (findDisplay 602) closeDisplay 1; }];

tame portal
#

Because that would just close the inventory

#

The point of his script is to enable the gear key which you use to open it to also close it

rancid ruin
#

^ that

#

i'm just wondering if that's the correct way to do it...seems too easy

tough abyss
#

ah ok, sry missread that then ^^

lone glade
#

that or they decided to adopt tanoa fashion

lean tiger
#

Any way to get an editor-placed object's (in this case playable slot) name?

indigo snow
#

which name do you want? the object reference or what you see when slotting?

dull parrot
#

Why is my text

#

in ff_GameClockTime

#

not center on the box

#

ff_GameClock

lean tiger
#

the object reference name

#

I realize that that's just a variable, but I can't help but think player slots have something unique to them I could call

lone glade
#

no

#

they're just playable slots

lean tiger
#

that happen to be units, got it

#

thanks

tough abyss
#

Hey all,

Getting a type error for line 14 of my script

/*
    Hit.sqf
    This function provides effects when a unit is hit either by enemy / friendly shots
*/

private _unitHit = _this select 0;
private _unitResponsible = _this select 1;
private _sound = "";

//check if unit damaged itself, if so then exit
if (_unitHit isEqualTo _unitResponsible ) exitWith {};

//check if unit hit is vehicle, if so then exit
if (!_unitHit isEqualTo vehicle _unitHit) exitWith {};

//TODO figure out a way to variate sounds between different male sound classes e.g. tm1, tm2, tm3

//assign hit sound from random selection of available sounds
_sound = selectRandom ["tm1_wounded_self1","tm1_wounded_self2","tm1_wounded_self3", "tm1_wounded_self4", "tm1_wounded_self5","tm1_wounded_self6","tm1_wounded_self7","tm1_wounded_self8", "tm1_wounded_self9", "tm1_wounded_self10", "tm1_wounded_self11","tm1_wounded_self12","tm1_wounded_self13","tm1_wounded_self14","tm1_wounded_self15", "tm1_wounded_self16", "tm1_wounded_self17", "tm1_wounded_self18"];
_unitHit say _sound;
sleep 0.5;



//check if it was friendly fire else play radio chatter
if (side _unitHit == side _unitResponsible && side _unitResponsible == WEST) then
{
    _sound = selectRandom ["tm1_ff_generic1","tm1_ff_generic2","tm1_ff_generic3"];
    playSound _sound;
}
else
{
    _sound = selectRandom ["tm1_wounded_team1","tm1_wounded_team2", "tm1_wounded_team3"];
    playSound _sound;
}

Error Type Object, expected Bool for if (!_unitHit isEqualTo vehicle _unitHit) exitWith {};

#

This was working fine in a previous mission I made in ArmA 3 Alpha but now it doesn't work anymore :S

lone glade
#

do
(isNull objectparent _unitHit)

tough abyss
#

Ok I will try that, what is the difference in evaluation?

lone glade
#

isNull objectparent is a bit faster

tough abyss
#

Any ideas why it was working before and not now?

queen cargo
#

simply because it is not centered @dull parrot

dull parrot
#

I got her fixed thanks X39

native hemlock
#

@tough abyss there shouldn't really be a reason it would have worked before, as the issue is caused by !_unitHit

lone glade
#

that

native hemlock
#

You are trying to flip the boolean value of an object

dull parrot
#

I was under the impress using RscText would create a box, and using center stylings would have done the trick

queen cargo
#

thx to you btw. @dull parrot i noted that my UI editor acttually works with normal arma screen width etc. shit โค

dull parrot
#

That editor is handy btw

queen cargo
#

it will btw.
just that you have to size it correctly

indigo snow
#

@lean tiger if its inside eden, get3DENSelected should be what you need

lean tiger
#

Placed down in the editor you mean?

indigo snow
tough abyss
#

One last question, is there a way I can test these functions in the debugger, can I compile them and then call them in game. At the moment I am checking syntax with debugger and recompiling any time I get a logic error

native hemlock
#

Debug console won't work for scripts with comments, but if you remove those there isn't really a reason you can't do

_testFunc = {
your code here...
};
[parameters] call _testFunc;
tough abyss
#

Got it, thanks

native hemlock
#

One small thing that you might find a convenient is utilizing the params command (added in 1.48) https://community.bistudio.com/wiki/params

So this

private _unitHit = _this select 0;
private _unitResponsible = _this select 1;

is equivalent to this

params ["_unitHit", "_unitResponsible"];
#

params will both privatize and set the values for passed arguments. As well as being slightly faster

tough abyss
#

You are correct, I need to refactor this like with the script you helped me with last night.

#

@lone glade I made the change on that line, however now it is exiting when a friendly unit fires at them. I don't want the script to exit in that case.

#

Maybe (isNull objectparent _unitHit equalTo _unitResponsible)?

native hemlock
#

So instead of

if (!_unitHit isEqualTo vehicle _unitHit) exitWith {};

you now have

if (isNull objectparent _unitHit) exitWith {};
#

is that what you have?

tough abyss
#

Yea, I wonder why it is causing it to exit.

native hemlock
#

Well you need to put the exclamation point back in

#

_unitHit isEqualTo vehicle _unitHit is equivalent to isNull objectParent _unitHit

tough abyss
#

That works now

#

Is there an easier way to simplify checking the _unitHit side is the same as _unitResponsible side and that they are both WEST.
Getting a generic error reported from that line.

#

Yea my expression is bad because after I kill a few friendlies I become hostile and my else case seems to work fine.

#

Aha I just changed the == operator to equalTo

native hemlock
#

Oh well that's confusing

(side player isEqualTo WEST) //true
(side player isEqualTo "WEST") //false
(side player == WEST) //true
(side player == "WEST") //error
tough abyss
#

It's like java and string equality haha

native hemlock
#

Actually that's not that confusing

#

Let me explain

dull parrot
#

_alphaOld = POINT_CONTROL_STATUS select 0;
systemChat format ["BLUE STATUS WAS = %1", _alphaOld];
POINT_CONTROL_STATUS set [0, (_alpha+1)];
_alphaNew = POINT_CONTROL_STATUS select 0;
systemChat format ["BLUE STATUS IS NOW = %1", _alphaNew];

#

why is _alphaOld inside my system chat output giving me an undefined error.

native hemlock
#

Because it is undefined?

#

We don't know what the content of POINT_CONTROL_STATUS is

dull parrot
#

It's a global array

#

Sorry

#

And it's init to [0,0,0] before it ever hitss this function as well.

#

I have tested it and if I output jusst the array, it gives me the three 0s so I know it's there.

#

Is this a scope thing?

lone glade
#

code blocks please ```

dull parrot
#

'''

#
          systemChat format ["BLUE STATUS WAS = %1", _alphaOld];
          POINT_CONTROL_STATUS set [0, (_alpha+1)];
          _alphaNew = POINT_CONTROL_STATUS select 0;
          systemChat format ["BLUE STATUS IS NOW = %1", _alphaNew]; ```
native hemlock
#

So you are saying

systemChat format ["%1", POINT_CONTROL_STATUS];

prints "[0, 0, 0]", and then

_alphaOld = POINT_CONTROL_STATUS select 0;
systemChat format [%1", _alphaOld];

prints "any"

#

Correct?

lean tiger
#

@indigo snow -- thanks for the tip, but it's even more basic than that -- you can just cast "player" within their locality to a string

#

stumbled on it on accident ๐Ÿ™ƒ

little eagle
foggy pike
#

๐Ÿ‘Œ

warped thicket
#

who is that jonpas guy and why is he stealing my name

delicate mason
#

๐Ÿ‘

dull parrot
#

@native hemlock Yes it does.

queen cargo
#

mimimi @warped thicket

#

but you got my name right at least

lone glade
#

it's easy, it's marked in giant letters on your blog ๐Ÿ˜›

queen cargo
#

X-3-9

#

not X-39

#

not that simple

foggy pike
#

What does it mean?

queen cargo
dull parrot
#

I am an idoit..

#

Haha, what a brain fart moment on that _alpha shit.

tame portal
#

How exactly did X39 got into the muted trolls group?

queen cargo
tame portal
#

I guess you can count that as an achievement

jade abyss
#

He does ๐Ÿ˜„

agile pumice
#

so I'm having an issue with groups. In the editor the group shows fine, but on the dedicated server the group shows as null group

native hemlock
#

We probably could use more information. The group might exist in the editor because it is occupied by AI that are listed as playable, but then not on a dedicated server because those units making up that gorup aren't being played

agile pumice
#

I have 4 groups that only contain non-playable AI

#

I renamed each of the groups

#

the AI are not playable

#

I dont know what else I can say that would be useful

native hemlock
#

What is the result of getting the AIs group once it's on a dedicated server?

agile pumice
#

I have a (server side) firednear eventhandler on the ai in the group and have a switch block for what group they're in

#

would also note that I can't return the ai with cursortarget

#

wait a sec

#

shit

#

the ai I was testing with had simulation disabled, testing now

vapid frigate
#

"but on the dedicated server the group shows as null group" < how are you checking this?

agile pumice
#

group cursortarget

#

then i tried cursorobject

#

but it was still saying null, so I thought it was an issue with the group

#

let me test again

#

would I be correct in stating that ai with simulaiton disabled won't return their group?

vapid frigate
#

no idea.. i thought every unit had to have a group

#

u checked that cursortarget is the unit?

agile pumice
#

yep, its fixed now

#

lthough the group names weren't what I set them to in the editor, oh well

hallow spear
#

is there anyway to hide the ammo count and fire mode top right corner of screen?

dusk sage
#

weaponInfo = 0 in difficulty?

native hemlock
hallow spear
#

awesome, works great. thanks a bunch

midnight idol
#

hello script that opens boom fot nato help plz

foggy pike
queen cargo
#

for me just by looking at the images it looks like you use wrong XY values

#

tested using some other control?

#

((as i am at work i cannot currently go through your code files))

foggy pike
#

the position is definitely correct, and yes I ctrlCommit'd

#

I'll post code here 1 sec

#
/*
 * Author: Kingsley
 * Creates a map control
 *
 * Arguments:
 * 0: Control config <STRING>
 * 1: IDC <NUMBER>
 * 2: Group IDC <NUMBER>
 * 3: Position <ARRAY>
 *
 * Return Value:
 * Created control <CONTROL>
 *
 * Example:
 * ["configFile >> 'SomeConfig'", 100, 90, [0,0,0,0]] call mars_attributes_fnc_ctrlMap;
 *
 * Public: No
 */

#include "script_component.hpp"
#include "\z\mars\addons\common\macros.hpp"

params [
    ["_config", "", [""]],
    ["_idc", -1, [0]],
    ["_group", -1, [0]],
    ["_position", [0,0,0,0], [[]]]
];

_config = call compile _config;
_display = GETUVAR(GVAR(interface),displayNull);

_controlGroup = _display displayCtrl _group;

_ctrlMap = _display ctrlCreate ["MARS_gui_ctrlMap", _idc, _controlGroup];
_ctrlMapTemp = _display ctrlCreate ["MARS_gui_ctrlStaticBackground", _idc, _controlGroup];

_position set [3, (_position select 2)];
_ctrlMap ctrlSetPosition _position;
_ctrlMapTemp ctrlSetPosition _position;
_ctrlMapTemp ctrlSetBackgroundColor [1,0.5,0.25,1];

_startPosition = [call compile getText (_config >> "position"), getArray (_config >> "position")] select (isArray (_config >> "position"));

_ctrlMap ctrlMapAnimAdd [0, 0.1, _startPosition];
ctrlMapAnimCommit _ctrlMap;

_ctrlMap setVariable [QGVAR(controlKey), [_config] call FUNC(createControlKey)];
_ctrlMap setVariable [QGVAR(execReturnData), ""];

_ctrlMap ctrlCommit 0;
_ctrlMapTemp ctrlCommit 0;

mapAnimCommit;

systemChat format ["mapAnimDone: %1", mapAnimDone];

_ctrlMap
#

logging both positions returns the same thing, so there's no difference

queen cargo
#

tested using some other control?

#

also where you get the position from

#

_config is not set in your sqf file

#

thus it is hard to observe

foggy pike
queen cargo
#

thats the worst style i ever have seen dude ...

                _requiredConfig,
                format ["'%1'", QGVARMAIN(attributes)],
                format ["'%1'", _component],
                format ["'%1'", _attribute],
                "'AttributeCategories'",
                format ["'%1'", configName _catConfig],
                "'AttributeItems'",
                format ["'%1'", configName _itemConfig],
                "'AttributeControls'",
                format ["'%1'", configName _ctrlConfig]
            ] joinString " >> ";```
#

wanna tell me what this resolves to?

#

forget what i said

#

just saw you linked what i wanted

#

where you call the function? and get the position from?

#

cannot find the function call of the function you provided (and as said ... actually at work so cannot check deeply)

foggy pike
#

it's on onAttributesLoad.sqf, it's in there somewhere, but I wouldn't recommend sifting through it to find the position, not even I remember how that shit works

#

"[""%1"", %7, %8, [%2,%3,%4,%5]] call %6"

#

the array in that string is the position

#

so this:

CATEGORY_SPACING + LABEL_WIDTH + GRID_W + (_ctrlIndex * _ctrlIWidth),
_totalLabel + _itemLabelY,
_ctrlIWidth,
LABEL_HEIGHT,
#

pretty meaningless

queen cargo
#

actually that is where the whole problem most likely is located at

foggy pike
#

but it's not..

queen cargo
#

your code requires a rewrite dude ... that is clear at least ๐Ÿ˜ƒ

foggy pike
#

the position code works flawlessly, with every other control type

#

nope

queen cargo
#

will check it out when i am at home

#

alternativly, just create the control without the script around and check if that is the root cause

foggy pike
#

someone just suggested it could be the controls group offset

#

but as the gif shows, the map is technically in the right position because you can move the map itself clicking/dragging on the expected pos, it's just the image itself that is misaligned

velvet merlin
#

not familiar yet with ctrlCreate scripting. what are the dimensions of the image and could the offset be due to that?

#

i would try a 2^X as a test and see if aligns correctly top left at least

#

controls groups are also the pure evil

#

best avoid that as much as possible

foggy pike
velvet merlin
#

well interaction part seems to be correct. it could be just bugged controls groups

#

had a really bad time trying to use them 2-3 years ago

foggy pike
#

i tried making the map in the parent controls group, so not in the child, but same problem occurs

velvet merlin
#

no idea if anything has improved meanwhile

foggy pike
#

control groups are necessary

#

and useful for things like scrolling a collection of controls

velvet merlin
#

i would reduce the issue to a simple test case. if its still bugged, send it over to Karel or muf from BI and hope they fix it

rancid ruin
#

any ideas why I can't ctrlCreate a progress bar?
buttons, sliders, images all work fine. can't create a progress bar for shit though.

little eagle
#

just use a RscText with a background

#

center it

#

set the width to 0

#

then to the max value

#

and use ctrlCommit where the number is the time until the bar is full

rancid ruin
#

have you used that technique before?

little eagle
#

yes

rancid ruin
#

nice, i'll give it a go

#

progress bars were a bitch with the last config defined ui i did, but i can't even get one to display with ctrlCreate, fk progress bars tbh

little eagle
#

They've changed it since to use the dedicated progress bar control

foggy pike
#

2 space indentation?! living life on the edge

little eagle
#

but that is pretty pointless imo

#

kingsley, in AGM this was the convention

#

thanks to Flummi

#

I didn't like it. I wanted four

#

cause everything looks the same with 2

foggy pike
#

yeah it does

little eagle
#

at least on my 17.4"

#

Though, if you open AGM_Core you still see the resemblance to ace_common

#

I have no idea how we managed without include

#

jesus

rancid ruin
#

you're saying progress bars have been annoying better scripters than me? excellent

foggy pike
#

trust me, everything to do with UI annoys all scripters

little eagle
#

you get addicted if you do it to much

queen cargo
#

@rancid ruin SQF annoys all kind of scripters

rancid ruin
little eagle
#

very simple and outdated dik code to key lookup table

#

"1"

#

as in key 1 will report 2

#

which is the DIK code of 1

#

interestingly

#

Esc is 1

#

1 is 2

#

2 is 3

#

etc.

rancid ruin
#

madness

little eagle
#

pretty sure there are better solutions

#

I think it was for the AGM interaction menu "commy rose"

#

it only supported a-z and 1-9 and 0 as hotkeys, so it was sufficient

#

it's probably better to enter the DIK_Codes in code

#

by including the librabry for them

#

but that was not what we were doing in AGM

#

because we didn't know any better

#

And writing "R" is certainly better than writing 15

#

It's just that writing DIK_R is better than both

rancid ruin
#

the real mystery is why you didn't put an easter egg in the first item in that array

little eagle
#

I think it was so it reports "" if you use an invalid (or unspported) dik code

#

instead of erroring out

rancid ruin
#

yeah but it could have reported "commy is best" instead

little eagle
#

then the menu would show "commy is best" as shortcut when the button never had shortcuts configured

#

(almost none had these shortcuts)

#

only gestures uses a shortcut

rancid ruin
#

ohhh i remember that radial menu

little eagle
#

I remember making it ๐Ÿ˜ƒ

rancid ruin
#

when's it a good idea to start using CfgFunctions for your own scripts in a mission? ASAP? if it starts to get big? if you know you'll re-use the functions? always?

little eagle
rancid ruin
#

tornikee [sic] lol

little eagle
#

when's it a good idea to start using CfgFunctions for your own scripts in a mission?
Functions are always good. When you use some piece of code twice it basically has to be a function imo

#

Even if you just use it once it can be beneficial

#

I'm not a fan of scripts with more than 200 lines personally

rancid ruin
#

and just going mytag_myfunc = {} isn't technically making a function?

little eagle
#

It is, but having fifty of them in one files isn't to good if you want to find and edit one

rancid ruin
#

yeah i'm starting to see the importance of laying things out well

little eagle
#

CfgFunctions also manages stuff like function caching

#

and prevents them from being overwritten by cheaters

#

somewhat

#

And it adds debug stuff like _scriptName and _scriptNameParent

rancid ruin
#

it seems like it could take a little longer to get an understanding of how a project is laid out (like looking at AGM just then) but when it comes to debugging or collaborating it'll be worth it

little eagle
#

You'd have to set up all this yourself

#

it seems like it could take a little longer to get an understanding of how a project is laid out (like looking at AGM just then) but when it comes to debugging or collaborating it'll be worth it
exactly

#

ACE is even more complicated, but it's easy to work with it if you know what youre doing

rancid ruin
#

yeah ace was very overwhelming when i tried to investigate adding things to it's interaction menu

#

i'm gonna look at cfgFunctions today, thanks

little eagle
#

Yeah, those functions are sub optimal

#

Imo

rancid ruin
#

feel like it'll be worth the effort if it makes me lay my projects out better

little eagle
#

even with colors

#

omg, discord breaks the link

#

just add the closing parenthesis

rancid ruin
#

yeah i've read that but it doesn't really advise when is a good idea to start using them

#

actually i guess this line does

#
When writing a script, consider registering it into the Functions Library.
#

basically, always then. got it.

little eagle
#

Yeah

#

I think CfgFunctions is the only way to execute functions on mission start

#

(outside of CBA)

#

with the postInit and preInit flags

rancid ruin
#

interesting, i'm learning things today

#

apparently server admins might not like it if you hack as well

#
Server admins might blacklist your addon if they find out you're using the function for hacking.
#

so is preInit before simulation starts, right after clicking play on the lobby screen?

#

literally before init.sqf and initserver.sqf and initplayer.sqf are run?

queen cargo
rancid ruin
#

nice, fun reading

#

thanks

lean tiger
#

Sort of in a conundrum, wondering what the cleanest way to execute this is

#

I have a JIP remoteexec that handles player setup, loadout, etc. At the end it attaches an event handler on respawn to delete their corpse.

#

Works well, of course now the issue is when they disconnect they leave bodies

#

I can't attach event handlers to JIP slots, so I can't flip it serverside

lone glade
#

don't use a JIP remoteExec for that, use initPlayerLocal, for the disconnected problem you can use the proper EH serverside

#

gimme a sec, i'll link an example

dusk sage
#

addMissionEventHandler ["HandleDisconnect",{_this call TAG_fnc_disconnect; false;}];

lone glade
#

no need to call a specific function for that

lean tiger
#

the only disconnect handler I could find only returned session information?

dusk sage
#

Was the quickest one I could copy paste ๐Ÿ˜‰

lone glade
#

๐Ÿ˜›

dusk sage
#

addMissionEventHandler ["HandleDisconnect",{deleteVehicle (_this select 0);}]; kind of thing

lean tiger
#

oh, dangit -- I just found it now

#

I was lokoing at playerDisconnected

#

thanks @lone glade , @dusk sage ๐Ÿ˜ƒ

dusk sage
#

Remember to pop it on the server

lean tiger
#

Ofc, I grok locality ๐Ÿ˜ƒ

#

Oh my, these MissionEventHandlers are new to me though -- and god they really simplify a bit

dusk sage
#

๐Ÿ˜‰

lone glade
#

was added a while ago, but the doc is new (ish)

lean tiger
#

no note if it accepts negative?

#

could try it, I guess

lone glade
#

also it seems that whomever enhanced the revive system read my feedback tracker ticket ๐Ÿ˜›

lean tiger
#

is Kerry technically universal?

#

well, different class, but, can do everything?

tough abyss
#

hello

#

does anyone know what the sneak peak command is for steam cmd

#

for example 107410 -beta development

high plume
#

guys, small numbers like 1.2123e something , is there a way to round them to let's say this format: 0.000 ?

dusk sage
#

The ARMA engine as like most languages will process numbers with exponential notation

#

If you leave this as a scalar, there is probably not. However, you can convert it to a string without said notation, if you wish to display it, etc

#

Which I can't see any other reason for

high plume
#

yeah im monitoring very small numbers but in the end i only work with numbers up to 0.01 so having it rounded to that would be awesome.

dusk sage
#

So you want to round the numbers? Or display the numbers in a readable format?

high plume
#

uhm. display only actually.

high plume
#

up to 2 or 3 digits after point.

like this: 0.001

dusk sage
#

[scalar] call BIS_fnc_numberText will output it correctly

high plume
#

thank you

#

hmm, it still outputs "8.10376e-012"

dusk sage
#

Interesting, so it would seem numberText has its limits then

#

Gimme a sec

high plume
#

im writing audio engine documentation for wiki, which is why i need to know this.

#

get into a jeep (devb ranch) and use this function. then put camera inside and watch the value go down into oblivion.

lone glade
#

............... BIS_fnc_drawRespawnPositions is a while true do loop

native hemlock
#

lol does it have a sleep?

lone glade
#

yes, 0.001......

runic spoke
#

Create your own BIS_fnc_drawRespawnPositions ๐Ÿ˜›

lone glade
#

fun fact: the respawn pos aren't drawn.....

#

that loop is running for nothing.

runic spoke
#

i wouldent doubt that

lone glade
#

also, revive was finally improved, and they used params and param ๐Ÿ˜›

#

nah, I got mine

#

they still haven't fixed zeus saving owners into unit var instead of missionNamespace

#

zeus doesn't get reassigned after death if the unit is deleted

#

which BIS revive does

lean tiger
#

typeOf cursorObject is returning null on most buildings -- any smarter way?

#

just looking to grab "land_miloffices_v1_f" etc

lone glade
#

aim better ?

lean tiger
#

oh common hear me out: casting it to a string returns the id, model file, etc

#

but typeOf returns a zero-length

lone glade
#

typeOf cursorObject works perfectly fine in the debug console watch field

#

if you want classnames use 3DEN, place the building and copy the classname (there's a right click entry for that )

#

note that some 3DEN buildings do return empty strings for some reasons.

lean tiger
#

cc, thanks

rancid ruin
#

is there a reliable way to detect if a unit is inside a building?

dusk sage
#

Reliable, no

#

Is there some sort of a way, yes

rancid ruin
#

what technique? line intersects?

lone glade
#

you can check for lineIntersections in a 360ยฐ radius

#

or check if the player bounding box is within a building' one.

dusk sage
#

Checks infront, behind, left, right etc

rancid ruin
#

my first thought was bounding box, but my 2nd thought was how inaccurate it'd be

lone glade
#

the question is "why" you want to check that.

#

maybe we can find alternative solutions to your problem

dusk sage
#

Then again, using lineIntersects in that manner, may not be the optimal solution

rancid ruin
#

i'm helping a friend with a mission he's making where the player has some kind of "exposure" level

little eagle
#

I tried the scheduler today

#

a while true loop to print the FPS

#

just for debugging

#

I forgot the sleep

lone glade
#

inb4 it crashed

little eagle
#

It crashed 3 times after 10 seconds

native hemlock
#

lol

lone glade
#

hahaah

little eagle
#

game just died

native hemlock
#

With a hint?

#

or hintSilent

little eagle
#

yep

#

hint

native hemlock
#

Yeah the sound is what kills it

little eagle
#

That wasn't the case in previous versions

#

I wasn't using silent, because I was listening to my mp3 player and had the pc sound turned off

#

That's just ridiculous

#

I thought I fucked up in my scripting

rancid ruin
#

what was the fps though?

little eagle
#

but it was definitely the while loop

dusk sage
#

@little eagle Up for testing if for "_i" from 0 to 1 step 0 do {}; is any better than a while true loop, ignoring the number of possible iterations in an un-scheduled environment ๐Ÿ˜› ?

little eagle
#

97

native hemlock
#

Not really, that will probably still run multiple times per frame

little eagle
#

it was just for debugging

#

oh and the FPS was 97 after I added the sleep of 1

#

it went to 30 and below without sleep

#

But I guess thats to be expected?

dusk sage
#

done that one

#

well

#

Half done

#

Excluding shutting down the process

little eagle
#

But crashing the game? That's just dumb

#

how do I know that it doesn't crash the game after the first use

#

allvariables does report [] in MP

dusk sage
#

Screw hints

#

This one is absolutely horrible

little eagle
#

because some people think it was a security risk

#

or something

#

allvariables does report [] in MP
at least for mission and ui namespace

#

I though it was missionNamespace

dusk sage
#

Global in the sense everyone sees you get kicked for not responding

little eagle
#

profileNamespace doesn't even make sense

#

you can just read it in SP

#

...

dusk sage
#

When your game instantly crashes out

zealous solstice
#

@little eagle only for uiNamespace and profilenamespace

dusk sage
#

๐Ÿ˜„

little eagle
#

ok rgr

#

like there is anything secret in the profile namespace

#

do you store your banking stuff there? I don't think so

#

it's silly. well, as long as it works on objects and locations I'm ok with it

#

allVariables shouldn't be used on these big namespaces anyway outside of debugging

lean tiger
#

Any handy method to convert XYZ anglular rotation to vectordirandup?

#

I'm trying to copy out a bunch of stuff I've placed down in the editor out of the SQM -- has to be placed on the fly, and I'd rather not just unhide it

little eagle
#
vectorDir _obj params ["_x", "_y", "_z"];
_azimuth = _x atan2 _y;
_inclination = asin _z;
#

You have to keep the vectorUp to know the tilt of the object.

#

azimuth will be -180 ... 180

#

0: north, 90 east, 180/-180 south, -90 west

#

inclination will be -90 .. 90 with 0 being forwards

lone glade
#

......

#

re-read what renowolf asked

little eagle
#

Yeah. That would be the easiest way. No idea wht he is doing exactly

#

I'm not sure anymore either, alganthe

lean tiger
#

Trying to createVehicle on the fly, and then rotate it properly -- it's on a hill so it's not pretty ๐Ÿ˜ฆ

little eagle
#

BIS_fnc_setPitchBank ?

lean tiger
#

yeah, was looking at that

little eagle
#

It sorta works

#

good enough for spawning vehicles I think

lean tiger
#

Never knew they existed, taking a peek

#

Bah, I'm just going to have a fire event to copy it out of the editor -- shoulda done that before bothering you all

#

Thanks @tough abyss

rancid ruin
#

what are all these BIS_fncs containing "OO"? left overs from the attempt to integrate java?

little eagle
#

object oriented

#

No idea if they work, they look meh

queen cargo
#

well ... using OOS should be the more simple way to use SQF with OOP modelling :3

high plume
#

guys. can you save code as a variable and then call that variable in order to "paste" the code?

like this:

code = {doStuff;
moreStuff;
Morestuff};

while {true} do {
code
};
?

jade abyss
#
ABC = {systemchat "wรถrks"};
while{true}do
{
call ABC;
};```
indigo snow
#

while {true} do ABC

jade abyss
#

Or that

indigo snow
#

A = if (true); A then {code}

#

Anything with a typename you can do this stuff

pliant stream
#
_code = { systemChat "!" };

while _condition do _code;```
#

how to sqf

high plume
#

thanks guys.

bronze trellis
#

is there any way i can run several arma 3 clients on the same pc? i want to test mp scripting

native hemlock
#

I don't think you could if the server had battle eye running, but otherwise I guess you could

vapid frigate
#

i've done it accidentally a few times

rancid ruin
#

i think you need to edit server.cfg accordingly if it's a dedi, it's called allowDuplicateIDs or something

dull parrot
#

Here is one I have not been able to find anywhere.

#

How would one, based off a conditional, attempt to alter the point a individual unit spawns at.

#

I need to dynamicly rotate from a TDM type spawning system, into a round based spawning system, mid match.

#

I also need to alter what a unit spawns in with, given the same conditional.

#

I am guessing on player death

#

???

bronze trellis
#

Designer?

dull parrot
#
sleep 0.5;

// Increase for west
if (_side isEqualTo west) then {

  //  Should never increase status if status is at 10
  if !(_alpha isEqualTo 10) then {
    systemChat "BLUE IS TAKING ALPHA!";
    // _alpha = POINT_CONTROL_STATUS select 0;
    POINT_CONTROL_STATUS set [0, (_alpha+1)];
    sleep 0.5;
    // _alpha = POINT_CONTROL_STATUS select 0;
    systemChat format ["ALPHA STATUS IS NOW = %1", _alpha];
  };
};```
#

With the above, _alpha is a int.

#

Assuming the conditions all line up to true, which in testing they are, why is my output for the first system chat, always the same as the second one.

#

Yet the incrementation is happening

#

And it's happening within the guidlines I want.

#

IE, never going over ten.

#

Output is something like

#

"ALPHA STATUS WAS = 0"
"BLUE IS TAKING ALPHA"
"ALPHA STATUS IS = 0"
"ALPHA STATUS WAS = 1"
"BLUE IS TAKING ALPHA"
"ALPHA STATUS IS = 1"

#

etc.

#

If I am leaving anything important out let me know.

jaunty drift
#

Within the if statement you never increment _alpha but you still use that in your systemChat command. If you do systemChat format["ALPHA STATUS IS NOW = %1", POINT_CONTROL_STATUS select 0]; or uncomment the line right above the final systemChat then it should display the new value of _alpha.

dull parrot
#

So in order to get the real new value of the array element, I need to re assign it into alpha after incrementing?

#

_alpha = POINT_CONTROL_STATUS select 0;

#

That is _alphas creation.

#

I see, so alpha is still just a int.

#

And it has nothing to do with the actual value stored in my array.

#

correct?

jaunty drift
#

Which one are you talking about? I see two of those lines commented out in different places in what you posted.

dull parrot
#
sleep 0.5;

// Increase for west
if (_side isEqualTo west) then {

  //  Should never increase status if status is at 10
  if !(_alpha isEqualTo 10) then {
    systemChat "BLUE IS TAKING ALPHA!";
    POINT_CONTROL_STATUS set [0, (_alpha+1)];
    sleep 0.5;
    systemChat format ["ALPHA STATUS IS NOW = %1", _alpha];
  };
};```\
#

Basicly, I mis understood what _alpha = POINT_CONTROL_STATUS select 0; was doing.

#

I thought it would update it self in accordance with the array element after creation.

#

But it's only a int.

#

And has nothing to do with the array element within POINT_CONTROL_STATUS

#

So, the only time it updated was when the script itself fired.

#

Because at the time, I re-set _alpha to the value of POINT_CONTROL_STATUS select 0

#

I see my mistake, just find it funny such a silly think to overlook.

dull parrot
#
// 1. Render the display of point capture status in coordination with ff_pointControlStatus
// 2. While rendered continuously update itself.
private["_display"];
disableSerialization;

_display = _this select 0;
_AlphaStatus = _display displayCtrl 1301;
_BravoStatus = _display displayCtrl 1302;
_CharlieStatus = _display displayCtrl 1303;

// Init the display variables
while {!isnull player && ACTION_PHASE} do {
  // set and render?
  // Set images for the point display crtls
  _AlphaStatus ctrlSetText format["%1", ALPHA_DISPLAY_STATUS];
  _BravoStatus ctrlSetText format["%1", BRAVO_DISPLAY_STATUS];
  _CharlieStatus ctrlSetText format["%1", CHARLIE_DISPLAY_STATUS];
  // alpha = 10 west owns, set flag image.
  sleep 1;
  waituntil {!isnull player};
  // cut the display
  cutRsc ["ffDisplay", "PLAIN"];
}; // while ```
#

The above indeed outputs a display, but it doesn't update the display with the ctrlSetText.

#

I know the variables are being assigned.

#
    // INVOKE ACTION PHASE + START TIMER
    [] spawn ff_hudManager;
    systemChat format ["TIMER STATUS : %1", TIMER_RUNNING];
    TIMER_RUNNING = true;
    [ROUND_TIME] spawn ff_timer;
    systemChat format ["TIMER STATUS : %1 and TIMER IS NOW RUNNING!", TIMER_RUNNING];
    // START FLAG LOOPS
    [] spawn ff_AlphaFlagHandler;
    [] spawn ff_BravoFlagHandler;
    [] spawn ff_CharlieFlagHandler;
    // RUN ALL UNTIL TIMER IS UP
    waituntil {!TIMER_RUNNING};
    CURRENT_ROUND = CURRENT_ROUND + 1;
    ACTION_PHASE = false;
  };```
#

That loop first the hudmanager, which is what outputs the display.

#

The flaghandlers are what would be assiging the variables.

sacred fox
#

is this a correct statement?
[cursorobject,["HitEngine",1]] remoteexec ['sethitpointdamage'];

would that work? or should i just use
cursortarget sethitpointdamage [HitEngine,1];'

The problem i have is that i want damage to be applied globally, but i cant get it to work.

remoteExec on the server is setup correctly, the function for the script is also added to exceptions and loads without any error in postinit.

dull parrot
#

Each is a loop, which runs until ACTION_PHASE is false.

sacred fox
#

here is s part of the SQF file and config file.

#Config.cpp

class CfgFunctions
{
    class IBZ
    {
        class Immobilizer
        {
            file = "\immobilizer";
            class Immobilizer {postinit = 1;};
        };
    };
};

#\immobilizer\fn_immobilizer.sqf

if (hasInterface) then
{
  vehicle player AddEventHandler ["Fired",
    {
      if (!isNull cursorObject && currentWeapon vehicle player == "Immobilizer" && vehicle player distance cursorObject < 200) then {
      IBZ_targetHit = True;
      hint 'Keep on target!';
      player say "immobilizer_locking";
      IBZ_target = typeof cursorobject;
      []spawn
        {
        if (isNull CursorObject) then {
        IBZ_targetHit = False;
        };
        sleep 7;
      if (IBZ_targetHit && currentWeapon vehicle player == "Immobilizer" && typeof cursorObject == IBZ_target) then
          {
            [cursorobject,["HitEngine",1]] remoteexec ['sethitpointdamage'];
            hint 'Vehicle Immobilized!';
            []spawn {
          currentvehicle = cursorobject;
          [currentvehicle, "immobilized"] remoteExec ["say"];
          if (!(isNil "enginesmoke")) then {deletevehicle enginesmoke};
          enginesmoke = "#particlesource" createVehicle position currentvehicle;
          enginesmoke setParticleClass "SmokeTrailEffect1";
          enginesmoke attachto [cursorobject, [0,0,0]];
          sleep 60;
          deletevehicle enginesmoke;

            };
            player say "immobilizer_success";
            cursortarget say "immobilized";
            } else {if(IBZ_target != typeof cursorObject && currentweapon vehicle player == "Immobilizer") then {
            hint 'Immobilization Failed!';
            player say "immobilizer_failed";
            };
          };
        };
      }

its the same immobilizer i have been working on earlier, which i am determined to get to work. Im starting to think that it is an Exile issue.

#

i want to add that it works perfectly on a listen server and in the A3 editor.

sacred fox
#

is it because of cursortarget is not local?, i guess somehow i need to execute the

SetHitpointDamage locally somehow

im reading up on remoteExec and im kinda confused about locality. how would you suggest i call this action?

sacred fox
#

i just found KK's locality tutorial, and the pieces are starting to get together now ๐Ÿ˜ƒ

rancid ruin
#

not sure of the bigger picture, or if you're having issues with this bit of the script, but i was playing with cursorObject earlier and I think rather than

if (isNull CursorObject) 

you should maybe test for

if (cursorObject isEqualTo objNull)
willow basin
#

I'd use reveal for nearest objects before using cursorXyz, I've noticed that else cursorTarget and cursorObject are not very reliable on busy servers and sometimes take ages to get what's actually in front of you.

sacred fox
#

ah, ok.. but this is supposed to only affect what is being tracked with the crosshair

#

if i would use nearestObjects it would not really be that accurate, and it would be too easy toimmobilize, right now you actually need to track the target for 5 secs, it will only success to immobilize if you still have the cursor on the target after 5 seconds

#

but i understand what you say, as it might not really be a reliable solution

#

to give you the full perspective of the script.. it is a immobilizer script the co-pilot/gunner in a helicopter, the CCTV operator will track a vehicle with the camera, hit fire (which will trigger the script) and then it will:

  1. Find what the target is
  2. create a spawn with a timer that counts down.
  3. if the cursor remains on target after countdown it will, continue to execute the immobilization,, in this case SetHitPointDamage "HitEngine", i have read up on locality on KK's blog, and atleast i have understood that i need to run the command locally on each client via a publicvariable. im not at home right now, so cant test it yet, but i tried to modify his setfuel example. and this is what i got so far.
private ["_IBZ_target","_EngineHit"];
    _IBZ_target = IBZ_target;
    _EngineHit = 1;
    if (local _IBZ_target) then {
        _IBZ_target setHitPointDamage ["HitEngine",_EngineHit];
    } 
    else 
    {
        GlobalHit = _this;
        publicVariable "GlobalHit";
    };
};
"GlobalHit" addPublicVariableEventHandler {
    _IBZ_target = _this select 1 select 0;
    _EngineHit = 1;
    if (local _IBZ_target) then {
        _IBZ_target setHitPointDamage ["HitEngine",_EngineHit];
    };
};
little eagle
#

that is a very convoluted way of writing something that only needs one line

rancid ruin
#

setHitPointDamage is global afaik

little eagle
#

setHitPointDamage requires a local unit but has global effects

rancid ruin
#

alright mr encyclopaedia ๐Ÿ˜ƒ

little eagle
#

[IBZ_target, ["HitEngine"_engineHit]] remoteExec ["setHitPointDamage", IBZ_target];

#

editied. It's something like that

#

note that this won't work for helicopters reliably, because those have multiple engine hitpoints since the heli dlc

#

HitEngine1, HitEngine2, HitEngine3 etc.

#

depending on the heli

#

You don't set the hitpoints of those with this function, which means that HitEngine, the master hitpoints, will be recalculated back to the previous damage if any of the other engine compartments are hit

#

Hitting it with a 5.56 bullet is enough in this case. It doesn't have to do actual "damage"

sacred fox
#

ok, well its mainly intended for groundvehicles as target

little eagle
#

No vanilla vehicle has "dependsOn" (I think that's how they are called in config) HitEngine hit points

#

But addons might have

sacred fox
#

this was my last code i tried btw
[cursorobject,["HitEngine",1]] remoteexec ['sethitpointdamage'];

#

aha

little eagle
#

setting HitEngine to 1 is also kinda pointless

#

The vehicle will explode

#

might as well use setDamage in that case

sacred fox
#

no actually the vehicle wont explode..that i know, because i have done it multiple times locally, i will post a link to a short demonstration video

little eagle
#

oh, sorry you are right

#

BI changed it from HitEngine to HitFuel

sacred fox
#

aha

#

anyway in the video you see the script working.. Locally in the editor, also, it works as server, but not on our dedicated box, and the remoteExec is set up allright

#

i have even added the function to the exceptions there aswell

little eagle
#

I don't think the error is with remoteexec in that case

#

you should add some diag_log to see if your code is even executed on the dedicated

sacred fox
#

interesting, how would i go about that?

#

but what you say hereis basically that i would aim for using remoteExec and not using the way i posted above?

#

this is the top of the actual code atm

if (hasInterface) then
{
  vehicle player AddEventHandler ["Fired",
    {
      if (!isNull cursorObject && currentWeapon vehicle player == "Immobilizer" && vehicle player distance cursorObject < 200) then {
      IBZ_targetHit = True;
      hint 'Keep on target!';
      player say "immobilizer_locking";
      IBZ_target = typeof cursorobject;
      []spawn
        {
        if (isNull CursorObject) then {
        IBZ_targetHit = False;
        };
        sleep 7;
      if (IBZ_targetHit && currentWeapon vehicle player == "Immobilizer" && typeof cursorObject == IBZ_target) then
          {
         [cursorobject,["HitEngine",1]] remoteexec ['sethitpointdamage'];
little eagle
#

I don't know if your code is executed on the dedicated or on a client

#

You are sure that sethitpointdamage isn't blacklisted on your server?

#

I think that is possible which is why I personally never use remoteExec - not reliable

sacred fox
#

no because i did it from the debug console in infistar, but just
cursorObject sethitpointdamage ["HitEngine",1];

little eagle
#

you have to be the driver of the vehicle on the dedi for that to work

sacred fox
#

i dont want to use it either if i dont have to.. im just trying to find out the best way for my intentions

#

oh

#

well that aint gonna happen x

#

and it doenst have interface either so

little eagle
#

vehicles switch locality depending on who is driving

#

so it's actually steerable ...

sacred fox
#

yeah read that on KKs blog

little eagle
#

remoteExec is the way to go for mission makers

#

[cursorobject, ["HitEngine",1]] remoteexec ['sethitpointdamage', cursorobject];

#

try to only target the machine where the object is local

sacred fox
#

well if i target a moving vehicle, the driver should always be local right? P

#

i mean the car will be local to the driver

little eagle
#

yes

sacred fox
#

but this isnt in a mission, its in a mod

little eagle
#

hmm. I'll think about it, but I have to go now

sacred fox
#

here's the example KK did for setFuel

KK_fnc_setFuel = {
    private ["_veh","_fuel"];
    _veh = _this select 0;
    _fuel = _this select 1;
    if (local _veh) then {
        _veh setFuel _fuel;
    } else {
        PVsetFuel = _this;
        publicVariable "PVsetFuel";
    };
};
"PVsetFuel" addPublicVariableEventHandler {
    _veh = _this select 1 select 0;
    _fuel = _this select 1 select 1;
    if (local _veh) then {
        _veh setFuel _fuel;
    };
};
#

the onei edited for my purpose

little eagle
#

he made this befor remoteexev was made

sacred fox
#

oh, ok

#

so you think i should totally focus this on getting it to work with remoteExec then?

#

the "say" and the smokeparticle spawn works atleast even on our server, its just the sethitpointdamage part... the other commands doesnt seem to need to be remotely executed

lean tiger
#

Any reason why some of the 'persistent' modes prefer to use the profile information rather than the player UID (steam id)?

#

Is it preferred to not have people able to know each other's ID (if its a database)

#

I'm basing this only on "don't delete your profile, or Koth/Arma life/persistent wasteland won't copy over" -- out of some developers mouths IIRC

pine crystal
#

Hey, is there a way to check if the player is freefalling?

tough abyss
#

maybe check if the players current animation is the freefall animation

pine crystal
#

yep, that did the trick, thanks!

rancid ruin
#

@lean tiger it allows you to have multiple characters rather than just one tied to your UID

jaunty drift
#

@lean tiger some game types like KOTH save a variable to your profileNamespace rather than having to hook up a database to each of their servers.

lean tiger
#

TL;DR: It's more a technical preference than a security/technical concern

#

?

tough abyss
#

If the data stored clientside of course there are security risks envolved ๐Ÿ˜›

#

Its up to decide if you want data stored serverside that you could query / alter.
Or to store it clientside and hope the player don't mess with profile data i.e by accessing it via the editor.

Personally i perfer using a external database, it makes backups / restores alot easier than using profilenamespace

jade abyss
#

Means -> Securitywise a hugggeeeeeeeeeeeeeee(+10000 "e") hole

tame portal
#

I know another reason why Torndeco is using external databases hue

#

But srsly, everything has been said ^

queen cargo
#

@tame portal in fact ... depending on the ammount of data, it can be smarter to use proper db systems

#

also, the database allows you to query the results

#

which you have to implement first for the non-database system

lone glade
#

it also can't be modified by the player

queen cargo
#

nope ... it can be modified just like the non-db stuff

lone glade
#

well, less easily at least

jade abyss
#

If done serverside -> Nope

queen cargo
#

If done serverside -> Nope
just gimme a week
can proove you wrong ๐Ÿ˜ƒ

jade abyss
#

well, less easily at least

queen cargo
#

better

jade abyss
#

Still, done on server -> Without hacking -> Nope.

lone glade
#

that ^

queen cargo
#

Still, done on server -> Without hacking -> Nope.
there have been ways
there might still be some

#

you just have to find them

lean tiger
#

You're talking to a database goon ^^

#

I guess I just meant to ask if playerUID relatively unbuggy? Nothing weird with players disconnecting in and out of those slots, etc

compact galleon
#
_syntaxHighlighting is underrated on this channel;```
lean tiger
#

goofy question, can you add a procedural texture on top of an existing texture?

#

for setObjectTexture*

native hemlock
#

It would replace it

lean tiger
#

any way to 'tint' it then perhaps?

#

without having to make a seperate .paa?

#

was hoping there was some poorly documented trick like
obj setObjectTexture [0, "images\asdf.paa#(rgb,8,8,3)color(0.5,200,0,0)"]

#

^^

shadow sapphire
#

Any tips on ending a PVP multiplayer mission with multiple ends per mission?

Would this work out or would it be problematic?

#
["END2"] remoteExecCall ['BIS_fnc_endMission', EAST];

sleep 15;

"END7" call BIS_fnc_endMissionServer;```
warm thorn
#

Have anyone an idea how to fix (or a workaround) that Arma3 Vanilla Item EXPLOIT, which I posted in #server_admins ?

jovial nebula
jovial nebula
#

Oh thanks!

#

Oneachframe? Quite heavy isn't it?

lone glade
#

drawIcon and drawIcon3D are quite heavy

jovial nebula
#

Got it,well thank you so much

little eagle
#
    class controlsBackground {
        class Vignette: RscVignette {
            idc = 114998;
            onLoad = "(_this select 0) ctrlshow !is3DEN;";
        };
#

1.62 onLoad for controls?

queen cargo
#

interesting

little eagle
#

maybe it's bs and doesn't work

lone glade
#

it's true afaik commy

#

I saw some glimpse of it in the new revive

queen cargo
#

kinda unneeded if you would ask me

little eagle
#

no one asked you

queen cargo
#

nobody ever does

#

ppl might should start doing so

little eagle
#

sorry, you went there

#

was too exploitable

#

it means that we can add onLoad scripts without overloading the onLoad of the display by adding dummy controls

queen cargo
#

no need to sorry, ppl rly never ask me and tend to do things on their own way even if i really know it better (eg. tenting ...)
but usually the normal display onLoad function can do as much as here ... and it is much cleaner using SQF file currently anyway as the UI-Editing is a nightmare already in arma

#

still this can get damn handy for my UI-Editor

#

any other new EHs we can use directly in the config?

little eagle
#

haven't noticed anything else yet

queen cargo
#

would be glad if you could just randomly try the others (currently at work + would have to redownload apex again ...)

little eagle
#

haven't checked if these work. I just noticed them because I have to adjust all displays in CBA for the new grid they use

queen cargo
#

ahh
kk

#

new grid?

little eagle
#

nothing special

#

the configure display uses the centered grid now

#

and a few other similar adjustments...

queen cargo
#

ahhh

little eagle
#

totally unnecessary

#

this alone breaks CBA compatibility between apex and the linux branch

#

: /

queen cargo
#

why not centering using safezone?

#

had some broken algorithm which accidently did exactly that in the UI-Editor ^^'

little eagle
#

the GRID is safezone

halcyon crypt
#

why is X39 in the @muted_trolls group yet he isn't muted? ๐Ÿค”

#

not that I think he should be muted, just wondering

lone glade
#

muted for dwarden and the BIMINIONS

queen cargo
little eagle
#

they changed GUI_GRID_X to GUI_GRID_X_CENTER

halcyon crypt
#

lol

little eagle
#

#define GUI_GRID_X (safezoneX)

queen cargo
#

got some solution for that in theory
you wont like it though ...

little eagle
#

#define GUI_GRID_CENTER_X (safezoneX + (safezoneW - GUI_GRID_CENTER_WAbs)/2)

queen cargo
#
#define GUI_GRID_CENTER_X fooofooo
#endif```
#

should make keep compatibility

#

but has to be added everywhere

little eagle
#

it's not that difficult. problem is that CBA keybinding doesn't use the macros , but the raw safezone math shit

#

so it's a bit cumbersome to edit

queen cargo
#

ohh hell ...
well ... i do know why i never even considered contributing to CBA

halcyon crypt
#

do you really need to keep compatibility with the linux port? It's so far behind and hopefully the port will be updated once APEX is released..

little eagle
#

well ... i do know why i never even considered contributing to CBA
that's why no one likes you

#

do you really need to keep compatibility with the linux port? It's so far behind and hopefully the port will be updated once APEX is released..
people keep asking for it

queen cargo
#

yup
would have to commit a "few" changes first before i would even consider starting to work on it

little eagle
#

you didn't even realize what I meant

#

It's not about CBA

#

but you didn't even consider helping out someone else

#

doesn't matter if it's CBA or not

queen cargo
#

i did realized
and i also told you what would be my personal problem

lone glade
#

I doubt the linux branch will be updated to 1.62 on apex release

#

it's still on 1.54 atm, right ?

little eagle
#

Same. Last I heard they are working on 1.58

halcyon crypt
#

waiting for APEX makes sense though

little eagle
#

well. you can't release a CBA that works with APEX and stable

#

it's too different in some key places

#

So people will have to wait for JR with APEX weapons etc

halcyon crypt
#

stable being 1.62 without the APEX expansion?

little eagle
#

stable is 1.60

#

apex is 1.62

#

or whatever dev version they use

halcyon crypt
#

oh right ^^

queen cargo
#

well ... you could however start releasing a linux & windows build

little eagle
#

sure

queen cargo
#

would require some tricky merging and separated branching

little eagle
#

but that would be a pain to maintain

queen cargo
#

but possible

little eagle
#

yeah

#

Or you know

#

they keep using 2.4.1 as legacy

#

that would be my plan

queen cargo
#

maintainers prob kinda :3
would be solvable using macros
werent there some macro lovers here?

nocturne bluff
#

X39 , the reason you dont contribute to CBA, is that anything you submit would get rekt by the review members

little eagle
#

#ifndef LINUX_BUILD
    (_turrets select {{_x == _weapon} count (_vehicle weaponsTurret _x) > 0}) param [0, []]
#else
    ([_turrets, {{_x == _weapon} count (_vehicle weaponsTurret _x) > 0}] call BIS_fnc_conditionalSelect) param [0, []]
#endif
#

I know it looks horrible

#

but sometimes you have _this vs _x

queen cargo
#

@nocturne bluff lemme repeat: i would have to change a hell lot of things so that it would match me (not you)

#

not like i would let myself get stopped by some review members if i would have to get something into CBA ...

#

but not using CBA --> no need to get something into it

#

--> no need to satisfy somebody

nocturne bluff
#

Whatever makes you sleep at night.

queen cargo
#

it is that i know that many of you will sooner or later come in contact with some fiddle i wrote and that you will rage about the fact that you have been using it or thought "well ... not that bad" โค

nocturne bluff
#

But you coulden't do CBA contributions becasue macros

#

Hah

#

I've seen your code.

queen cargo
#

loads of gibberish without commenting

nocturne bluff
#

Btw, you arent a useful asset to this community, stop pretending you are.

queen cargo
#

aww i โค you too @nocturne bluff

full kindle
#

typical - my script is longer than yours

little eagle
#

hahaha

queen cargo
#

((in fact: i was one of the key components before i stopped to maintain XMedSys as AGM arised, just to note))

#

still ... XMedSys was a pile of junk code

#

wonder that it ever worked

nocturne bluff
#

hahah

#

ye Xmedsys

#

wow

foggy pike
#

dreams crushed

queen cargo
#

not rly @foggy pike ... but i already can see where this would go to ... and i already got a strike on my ass
do not need a second one

foggy pike
#

wut

#

I was saying dreams crushed to no previews

queen cargo
#

anyway ... sorry then

foggy pike
#

๐Ÿ˜ถ

warped thicket
#

@queen cargo CBA has established standards for code in there, just because I am wondering, what would you change to "fit your needs"?

queen cargo
#

established standards

#

thats what i would change

lone glade
#

wait what

#

you don't like standards?

queen cargo
#

i do not like those used by CBA and ACE

foggy pike
#

so what would the alternative standard be?

queen cargo
#

would have to review everything ... but it starts at the location of the {s eg

warped thicket
#

ok and why would anyone change the standard to fit your needs?

#

typical "my code style is best style" guy

foggy pike
#

so..

if (condition) then
{
};
```?
lone glade
#

it doesn't wrap properly

delicate mason
#

Oh yes the 40 year old standard of wasting a line

queen cargo
#

nobody will @warped thicket
as i also said: do not need to contribute, so i do not need to take care of those style rules myself

lone glade
#

which is infiurating

warped thicket
#

that was not my question man

#

we are talking hypothetically obviously

little eagle
#
if (
  condition
)
then
{
  do stuff
};
warped thicket
#

I just don't see your reasoning of why anything should be like you want it to even consider contributing

queen cargo
#

thats garbage @little eagle and you know it ...

little eagle
#

how are { different from ( ?

queen cargo
#

hypothetically, if i was in need to change something i would commit stuff in line with the style rules

warped thicket
#

that's good to hear

queen cargo
#

but as i am not, i also would not commit according to the style rules

warped thicket
#

but that's not what you said earlier

queen cargo
#

the discussion in regards of what is better @little eagle is complete nonsense ... it is mostly to personal style ...
started with java, used to hate the { in new line
started doing stuff in C/C++/C#, started seeing that the additional line for { actually can be pretty cool

warped thicket
#

I think all of that is completely subjective, one can be better for one thing the other for the other

foggy pike
#

but what is the newline { good for? i've never seen a difference other than styling

lone glade
#

making configs look like giant stairs

queen cargo
foggy pike
#

so one of those answers suggests that it's good for large codebases that perhaps have a lot of stuff inside if's. but i've worked with a lot of code inside if's using same line { and never had any problems. personal preference at the end of the day ofc

little eagle
#

I followed that link

Whichever style you choose, be consistent
Write your code for other people.

#

no one said anything about change everything to your liking if you contribute to something already established

queen cargo
#

as i said @little eagle
no need to contribute for me --> no need to follow established rules

willow basin
#

Don't freaking mess with my styling rules! I was taught that each curly braces need an own line, but it takes too much space and I feel it's ugly so I'll never use it.... same discussion like tabs vs spaces ~ I love tabs and I don't care what other people may use

rancid ruin
#

if the UI editor is good it seems i'll be the first person to like x39 ๐Ÿ˜‚

foggy pike
#

oh hey it's the creator of vscode sqf ๐Ÿ˜„

willow basin
#

๐Ÿ˜‰

#

Hey @foggy pike ^^ I remeber your name from the issue tracker xD

queen cargo
#

@rancid ruin you already can see where it is going
and much more is planned

rancid ruin
velvet merlin
#

you guys should really start using code beautifiers with local custom style and forced style on the server via commit hooks

little eagle
#

meh, sounds like extra work

velvet merlin
#

actually saves you work when integrated into your code editor/IDE

queen cargo
#

would also only work for the styling @velvet merlin
differences between eg. private <array>, private <string> and private <variable> could not easily be sorted out

little eagle
#

private array is objectively worse

queen cargo
#

private array is obviously the best
followed by private variable

where private string is just stupid

little eagle
#

how is it "obviously the best"?
it's verbose
you have to write the variable names one more time each
it's slower
when editing you code, you have to look at another place -> easy to miss one

queen cargo
#

when editing you code, you have to look at another place -> easy to miss one
nope
actually you just have to look at one place

#

and that is at the very top of given block

little eagle
#

at one additional place, yes

queen cargo
#

using enforced private <array> will allow for everyone to see the private variables of given block in a single view

#

makes reviewing code more simple

#

as it prevents private usage in mid-code

little eagle
#

but that's pointless

#

get a good editor which highlights "private" and you see all variables used in a block too.
and you get context
seeing all variables at one place doesn't help at all

queen cargo
#
foo = foo * 4;
private bar = foo + 1;
bar = if (foo < 2) then
{
[moarcode]
private foo = bar;
foo * 1
};```
little eagle
#

we constantly had unused variables in these private arrays

#

or missing ones

#

that doesn't happen anymore

#

because you set the home scope of a variable when you define it

queen cargo
#

now someone can add new private variables inbetween two ifs ๐Ÿ˜ƒ

#

not removing the variable from the private array is also just lazyness

little eagle
#

There are so many foos, i have no idea what that code even does

#

lazyness is very good when you are coding

queen cargo
#

it is actually the worst ...

little eagle
#

I have no idea what you are trying to says with that example code

#

you are using private there

#

private keyword that is

#

but naming two different variables the same is bad style

queen cargo
#
if(<condition> then {<code>};
private _foo = bar;
<morecode>```
#

more clear now?

little eagle
#

No. Sorry I don't understand what you mean at all

#

private _foo; is invalid syntax

#

unless _foo is you variable name as string

#

which makes no sense

queen cargo
#

god ... its a bloody example hell ... <code> is also no valid syntax

#

more happy now?

#

thing is: having everything at one spot (this also includes private <var> at the very top of each scope) causes a better overview

#

also, you tend to be more descriptive with your variables then

little eagle
#

but you don't have "everything at one spot"

#

you have a additional place where you put all variables

#

the variables are scattered throughout the script

queen cargo
#

you do not get my point and i do not have the time to explain it in more detail ...

little eagle
#

and private is just another place -> more work, especially when mainting

#

<code> is also no valid syntax
I get that that was a placeholder

#

back to this:

if(<condition> then {<code>};
private _foo = bar;
#

what's wrong with it?

#

I assume there must be something wrong with it, since it's using the keyword while you argue for array

#

looks fine to me (ignoring the one parenthesis)

halcyon crypt
#

[3:52 PM] X39: using enforced private <array> will allow for everyone to see the private variables of given block in a single view
[3:53 PM] X39: makes reviewing code more simple
[3:53 PM] X39: as it prevents private usage in mid-code

little eagle
#

this demonstrates none of these points.

#

sorry, but when we were using private ARRAY, we had to write a python script to validate if we didn't miss a variable

#

and if we didn't set one that was never used

halcyon crypt
#

shrug, I personally prefer private _var = 0; over private ["_var"];. Just feels neater. ๐Ÿ˜ƒ

little eagle
#

that is no longer necessary

#

and that is a good thing

#

exactly, marceldev89

halcyon crypt
#

neither of you is going to "win" the argument though, just like tabs vs spaces or vim vs emacs

willow basin
#

Are we back to tabs vs spaces? ๐Ÿ˜„

halcyon crypt
#

oh crap, did I bring up a bad topic? ๐Ÿ˜ฆ

little eagle
#

tabs vs spaces is preference

queen cargo
#

mid code definition of variables is bad
thats the whole point i was trying to communicate here ...
private <array> prevents this unless somebody is a complete dumpass

little eagle
#

so is the curly bracket on the newline

#

but seriously, private array is just worse

#

mid code definition of variables is bad
what?

queen cargo
#
if (<condition>) then {<code>};
private _foo = bar;
<morecode>```
little eagle
#

It still doesn't make any sense

#

at all

queen cargo
#

mid var definition

little eagle
#

there is nothing wrong with that

queen cargo
#

ye ... as said ... no time

#

hf, you won this as i gave up

willow basin
#

I give a meh, but I agree it confused me aswell when I started with sqf. on the other side "private _private" might aswell is a bit confusing for SQF newbies ^^

halcyon crypt
#

Defining variables at the beginning of the scope is neater than somewhere else, but if you have to, why not? It's not a big deal. :S

little eagle
#

... you define them when you need them

#

and no where else

halcyon crypt
#

I guess that's a preference thing then ^^

lone glade
#

it's a big deal actually

#

because vars going fuck wack is a big pain in the ass to figure out

#

private every local var

little eagle
#

I grant you that I define my controls at the beginning of a UI script

lone glade
#

well it's configs at this point

little eagle
#

yeah

halcyon crypt
#

Yeah exactly. Likewise, defining a (expensive) variable at the top while the code might break out of the scope before it's used is weird as well.

foggy pike
#
private _result = 2;
private _var1 = allUnits select {alive _x && {!isPlayer _x} && {vehicle _x == _x}};
private _var2 = 2;

if (isServer) then {
    { /* code */ } forEach _var1;
} else {
    _result = -1;
};

there's an example why you should always define variables when you need them

delicate mason
#

@foggy pike lazy eval though

#

(Sorry I had to)

halcyon crypt
#

ah thank you for enforcing my line above it ๐Ÿ˜„

foggy pike
#

fixed

little eagle
#

allUnits only reports alive units

delicate mason
#

I like how this turned to us critisizing kingsley's example

halcyon crypt
#

semantics

vagrant kite
#
if(_var1 > 0) then {
_var2 = 1;
}```
#

no need for big examples ๐Ÿ˜›

halcyon crypt
#

inb4: "you're missing the private keyword" ๐ŸŒž

little eagle
#

shrug. I don't get any of your examples

#

yourstruly's one does absolutely nothing

#

unless you are trolling

halcyon crypt
#

Not trying to be offensive or anything but I feel like you have some trouble with imagination. It's good to know though, might improve the atmosphere in here a bit. ๐Ÿค”

#

Still love you for what you are ๐Ÿ˜˜

little eagle
#

improve the atmosphere
It's just passionate talk about Arma scripting, no worries

#

trouble with imagination.
It would help if an example about X contained X

vagrant kite
#

my example is for defining variable when you need it

halcyon crypt
#

mhm, like I said, it would get rid of some "frustration" if people know that you prefer proper valid examples ๐Ÿ˜ƒ

vagrant kite
#

if you defined _var1 and var2 on the top - you'd never use _var2

halcyon crypt
#

at least between you and @queen cargo ๐Ÿ˜‹

little eagle
#

yourstruly:

private ["_var1", "_var2"];

_var1 = random 2 - 1;

if (_var1 > 0) then {
    _var2 = 1;
};
private _var1 = random 2 - 1;

if (_var1 > 0) then {
    private _var2 = 1;
};
queen cargo
#

not correct @little eagle
aka: you failed

little eagle
#

what did I miss?

queen cargo
#

_var1 = random 2 - 1;

if (_var1 > 0) then {
   private ["_var2"];
    _var2 = 1;
};``` ๐Ÿ˜ƒ
#

said: at the begining of each block

lone glade
#

:facepalm:

halcyon crypt
#

rofl

little eagle
#

congratualtions

#

that looks even worse

queen cargo
#

mainly because this example barely makes any sense

halcyon crypt
#

f*ckin code nazis ๐Ÿ˜„

little eagle
#

and got rid of the only benefit: _var2 beign defined in all scopes

queen cargo
#

if that was your intension, then it was correct what you provided

#

still it was not visible from the example provided that this was the intension

trail rose
#

So what is your issue with using private _var ?

little eagle
#

We use it

queen cargo
#

ye ... because that is the real reason @little eagle ... i hate everything you do

dusk sage
#

Hate is a strong word

foggy pike
#

is there anything cba/ace has built that you would consider good?

dusk sage
#

๐Ÿ’ฉ

#

You guys are arguing about private arrays, meanwhile people are being shot to death in Germany, the world is a funny place

halcyon crypt
#

oh?

#

what's happening?

queen cargo
#

there is nothing i would not find something to do crit @foggy pike

rancid ruin
#

has there always been scripting drama? since ofp days?

dusk sage
#

Some guy with a gun in a cinema, Google it

queen cargo
tough abyss
#

@rancid ruin yea its called drArmA

little eagle
#

It's in West Germany. I don't care. It can all burn down.

delicate mason
#

@tough abyss +1

rancid ruin
#

15 years of drArmA

halcyon crypt
#

@dusk sage it's kinda bs to use that to complain about the arguing though...

dusk sage
#

I'm not complaining, I was just laughing at the contrast between the two. As I said, the world is a funny place. Keep arguing it's fun to read ๐Ÿฟ

foggy pike
#

I concur

#

๐Ÿฟ

halcyon crypt
#

alright, view restored ๐Ÿ˜ƒ

dusk sage
#

Do we need to rumble everything to happen again

#

Private arrays are the only sensible thing to use!!

foggy pike
#

tbh every line of code should be a string like this

_array = call compile "[1,2,3,4,5]";
_unit = call compile "player";
dusk sage
#

Hehehehe

shadow sapphire
#

How might I build an eventhandler for helicopters that would stop the helicopter from immediatly blowing up if it crashes?

Something like:

if (heli damage > 0.95) then {
stop damage};
Sleep 60;
set heli damage 1;
};```

Or some ish like that. Any advice or things I should look at?
dusk sage
#

HandleDamage?

shadow sapphire
#

Google isn't giving me the biki for that.

shadow sapphire
#

Oh! It is an event handler. Okay!

dusk sage
#

It might be a hard one though, as it'll be taking multiple lots of damage