#arma3_scripting

1 messages ยท Page 456 of 1

gleaming oyster
#

since it's inception it slows the game down to a slow, slow, crawl.

#

Vehicles exploding like firecrackers

inner swallow
#

random question, as i was reading the optimisation page:
how does

private _myVar = [33, 66] select (false);```
compare to 
```sqf
private _myVar = [33, 66] select (0);```
?
gleaming oyster
#

Well I would guess the index zero of the second one would be 33?

inner swallow
#

yeah

gleaming oyster
#

and uh? False?

still forum
#

@inner swallow same

inner swallow
#

i mean in terms of perf

thorn saffron
#

@gleaming oyster Usually you can substitute 0 with false

still forum
#

second one faster because 0 is a constant

gleaming oyster
#

Alt syntax

inner swallow
#

oh, so false isn't a constant? ๐Ÿ˜

still forum
#

yep

#

true/false are commands

inner swallow
#

aha

gleaming oyster
#

@thorn saffron Not always

inner swallow
#

so uh...should that be added to the code optimisation page ๐Ÿค”

#

i was under the impression that they're boolean values and faster, i use them quite a bit lol

still forum
#

Probably yeah. Just a note that true/false/nil aren't constants. That should also be added to the forEach vs count because count is slower if you need to add true/false/nil to make it work.

#

@winter rose ^

delicate lotus
#

now, how much are they faster? around 1%?

molten folio
#

@still forum Thanks

still forum
#

for this simple example I'd say a little more than 1%

cosmic lichen
#

Probably more if you compare them side by side, but since false is a pretty fast operator it's almost neglectable. 99% of 0.00001 seconds is still nearly nothing

still forum
#

[33, 66] select (false) 0.0017ms
[33, 66] select (0) 0.0012ms

delicate lotus
#

Another question I have is, when a player is Unconscious, and I use setUnconscious false on the player he still has those grey scale camera effects, how can I remove those?

cosmic lichen
#

@Dedmen Interesting, should definitely be added to the code optimisation page

flat eagle
#

I have a question im working on a simple sector control game mode but im having trouble when it comes to getting a objective to give me a side like east, west, or independent. i know the code looks like this--A getVariable side-- but every time i use it on the sector module it give me LOGIC. does anyone know how to make it give me a proper side?

delicate lotus
#

well the side of the sector logic is LOGIC...

flat eagle
#

thanks man

pulsar anchor
#

is "execFSM" the only way to execute an FSM?

meager heart
#

//--- initServer.sqf

TAG_fnc_initSector = {
    params ["_sector"];
    private _owner = _sector getVariable ["owner",[]];
    if (_owner in [west,east,resistance]) then {
        /* something */
    };    
};

[<sector_name>,"ownerchanged",{<sector_name> call TAG_fnc_initSector}] call bis_fnc_addScriptedEventHandler;
#

@flat eagle

flat eagle
#

handy thank you

#

@meager heart

#

this script can i be put in the editors init?

meager heart
#

well you can, sector modules have expression field, but

#

wait a bit

#
params ["_sector", "_owner", "_oldOwner"];
#

on top of that script ^

#

so _owner < who captured _oldOwner < who was owner before sector was captured

#

_sector < module sector

delicate lotus
#

Is it possible to have a linebreak in the establishing shot text?

flat eagle
#

now what im trying to do is based on who holds the objective the objective spawns support i.e. a tank, helicopter support extra. and the script you just gave is just checking for the side and who last had the side right? or can it do more?

meager heart
#

yes and yes ๐Ÿ˜€

flat eagle
#

sweet

#

alright so for instance how you get B_MBT_01_cannon_F to spawn at mrk1?

#

when west hold objective A

steady terrace
#

how would I run my script locally on every player's pc? I'm trying ["params"] remoteExec ["tasks.sqf", 0]; but it's not doing anything at all

#

this is task.sqf

##task.sqf

params ["_name", "_title", "_description", "_goal"];

[player,[_name],[_description, _title, str(_goal)],getPos _goal,1,2,true] call BIS_fnc_taskCreate;
still forum
#

"tasks.sqf"

#

remoteExec can't execute files

#

it can execute commands and functions

steady terrace
#

oh

#

how should I do this then?

still forum
#

you can remoteExec execVM or put your code into a function

steady terrace
#

okay.. it's not as easy as remoteExec[["task", "testtaak", "hier moet je heen!", final] execVM ["tasks.sqf", 0]];, and I don't see any examples on the wiki page so how should I do that?

still forum
#

Execute the execVM command. And pass the parameters that it wants

#

as you've shown above. You know how to pass parameters.

meager heart
#

BIS_fnc_execVM < also for RE

steady terrace
#

["task", "testtaak", "hier moet je heen!", final] remoteExec ["execVM "tasks.sqf", 0] ..? @still forum

thorn saffron
#

Say i have a nested array like this:

megaArray = [
 [[_A1],[_A2]], //A
 [[_B1],[_B2]], //B
 [[_C1],[_C2]]  //C
];```
Now I want to edit the B sub array, would this replace the whole B subarray?
```sqf
megaArray select 1 = [[_G1],[_G2]];
still forum
#

@steady terrace Why don't you see that?

#

Just look at

["task", "testtaak", "hier moet je heen!", final] remoteExec ["execVM "tasks.sqf", 0]

Can you see the error?
Also the command is execVM. Not execVM "tasks.sqf

#

@thorn saffron you cannot use = if you want to edit arrays by reference

#

you need to use set/append/deleteAt/deleteRange/pushBack

thorn saffron
#

I want to replace the subarray completely

still forum
#

in that case you probably want set then

thorn saffron
#

But I do not want to it one by one value, I have a repalcement array ready and i just want to replace the subarray in one go

still forum
#

yes... use set

#

set replaces an element in an array.

thorn saffron
#

so

megArray set [2, _outputArray]:

will replace the C Subarray completely with my new _outputArray right?

still forum
#

ye

edgy dune
#

is there a way to get a units helment? ik u can use unitBackpack to get the backpack I wasnt able to find one for like unitHelmet or something

meager heart
#

headgear

edgy dune
#

๐Ÿคฆ I cry

winter rose
#

headgear will only return the headgear class; backpack too for the backpack.
unitBackpack only exists to get the actual object so you can add items etc. to it

edgy dune
#

makes sense

meager heart
#

also hmd != goggles !!11

winter rose
#

yeah between glasses, scarves, goggles, masks, facewear, the terms are more than covered ><

edgy dune
#

whats a hmd?

winter rose
#

Head-Mounted Device

#

NVGs or Thermals

edgy dune
#

oh

#

so when using uniform is there a way to return the object rather then the class name?

gleaming oyster
#

Object? How do you mean?

edgy dune
#

welll

errant jasper
#

You mean like uniformContainer?

edgy dune
#

What im doing right now is just changing the color of a units uniform,vest,backpack and helmet to like say the VR entity texture and material , just for shits and giggles. I can change the vest and backpack becuase of the following

   //vest
    _this setObjectMaterial [0,"a3\characters_f_bootcamp\common\data\vrarmoremmisive.rvmat"];
    _this setObjectTexture[0,"#(argb,8,8,3)color(0.0,0.6,1.0,1,ca)"] ;
    
    //backpack
    (unitBackpack _this) setObjectMaterial [0,"a3\characters_f_bootcamp\common\data\vrarmoremmisive.rvmat"];
    (unitBackpack _this) setObjectTexture[0,"#(argb,8,8,3)color(0.0,0.6,1.0,1,ca)"] ;
molten folio
#

how is LnBAddRow used

#

tried to follow the Wiki but didnt work

thorn saffron
#
_inputArray = [["30Rnd_65x39_caseless_mag","16Rnd_9x21_Mag","11Rnd_45ACP_Mag","30Rnd_45ACP_Mag_SMG_01","100Rnd_65x39_caseless_mag","30Rnd_556x45_Stanag","9Rnd_45ACP_Mag","200Rnd_556x45_Box_Red_F","30Rnd_9x21_Mag"],[8,1,1,1,2,8,1,2,1]];

private _categoryToRecount = [[],[]];

{
(_categoryToRecount select 0) append ((_inputArray select 0) select _x);
(_categoryToRecount select 1) append ((_inputArray select 1) select _x);
} forEach (_inputArray select 0);

This gives me this error:

20:56:16 Error in expression <elect 0) append ((_inputArray select 0) select _x);
(_categoryToRecount select 1>
20:56:16   Error position: <select _x);
(_categoryToRecount select 1>
20:56:16   Error select: Type String, expected Number,Bool,Array,code```
I'm trying to append the ``_categoryToRecount `` with stuff from input array ``_inputArray ``. I do not know why I get error like this as 
```sqf
((_inputArray select 0) select 3)```
does return ``"30Rnd_45ACP_Mag_SMG_01"``  I do not remember having troubles with appending arrays with classnames like this
#

Derp, it was easier then I made it to be:

(_categoryToRecount select 0) append (_inputArray select 0);
(_categoryToRecount select 1) append (_inputArray select 1);```
still forum
#

you cannot select x on a string

#

your forEach iterates through the arrays in _inputArray

#

meaning the forEach iterates through two arrays

#

your first _x has an array of strings. Your second _x has an array of numbers

#

you cannot select with an array of strings

cerulean whale
#

I originally made this for a life server because a friend of mine asked me to (Yes I know a life server, holy crap I'm an idiot) but I'm thinking of publically releasing it for everyone who wants it, any recommendations on how I should improve the design? Thanks. https://www.youtube.com/watch?v=btpsCfuw2p8

thorn saffron
#

BTW: whats the maximum length for an array?

winter rose
cerulean whale
#

longer than you will ever need

winter rose
#

10M -1 elements yup ๐Ÿ˜ƒ

thorn saffron
#

๐Ÿ˜„ I sometimes completely suck at seeing stuff. I was looking for "length" or "size"

#

are nested arrays count as combined or not? Like if you have 2 arrays where both of them have 10000 values, does it count as a 20000 long array or just 2?

gleaming oyster
#

please tell me this is just for fuckery

thorn saffron
#

Just curious

still forum
#

@thorn saffron no

winter rose
#

each array has a limit, but the SQF police won't check your trunk to see if you have more bags inside your bags ๐Ÿ‘€ ๐Ÿš”

meager heart
#

๐Ÿ™„ hides

gleaming oyster
#

Bags inside bags inside bags inside bags inside bags

#

Turns out, you have one bag that equals many

#
#define BAG (random 2500) * (random 2500)
molten folio
#

how is LnBAddRow used
tried to follow the Wiki but didnt work

compact maple
polar folio
#

@molten folio are you sure you need the nbox version? or just normal listbox. just makin sure

molten folio
#

u need RscListNBox

polar folio
#

k. what does your code look like though? hard to say without seeing it

molten folio
#

xDD 1 sec

#

Kinda deleted it

#

as it didnt work

drowsy axle
#

anyone able to help me out with this? init.sqf: ```sqf
waitUntil {time > 2};

_vehicle = [
"C_Hatchback_01_F",
"C_Heli_Light_01_blue_F",
"C_Offroad_01_white_F",
"C_Quadbike_01_black_F",
"C_SUV_01_F",
"C_Truck_02_box_F",
"C_Truck_02_covered_F",
"C_Truck_02_fuel_F",
"C_Truck_02_transport_f"
];

_stand = [
car_stand_1
];

_spawn = [
car_spawn_1
];

{
_standVar = _x;

{
    _spawnPos = getPos _x;
    _spawnDir = getDir _x;
} forEach _spawn;
    sleep 0.5;
{
    _formatString = "Spawn Vehicle: %1.";
    _vehicleVar = _x;
    hint format["%1",_x];
    sleep 0.5;
    _standVar addAction [format [_formatString, _vehicleVar], {

        _vehicleSpawn = _vehicleVar createVehicle position _spawnPos;

        _vehicleSpawn setDir _spawnDir;

        hint format ["Vehicle: %1. Has been successfull spawned at: %2", _vehicleVar, _spawnPos];
    }];
} forEach _vehicle;

} forEach _stand;```

still forum
#

Ah cool.

#

now what?

polar folio
#

fix it!

winter rose
#

@drowsy axle
1/ tell us what the problem is
2/ if you want to respawn at the original pos, be sure to store it before the vehicle moves.
3/


    {
        _spawnPos = getPos _x;
        _spawnDir = getDir _x;
    } forEach _spawn;

^ wrong design
4/ quit reassigning _x?
5/ why _stand and _spawnโ€ฆ

still forum
#

_spawnPos and _spawnDir are never really defined. They are deleted immediately after.
And you cannot access local variables inside addAction code because that's a different script. You have to pass them as arguments to addAction

#

I'm quite sure I explained you the same stuff atleast 3 times already ^^

drowsy axle
#

Hmm okay. I see that now thank you @still forum and @winter rose

still forum
#

reassigning _x for _standVar is required so you can access it in the inside. But _vehicleVar is not required. But still nice for readability

winter rose
#

advice:
write down in human language what you want to accomplish, then when you have the logical steps in mind, write them in code

still forum
#
    {
        _spawnPos = getPos _x;
        _spawnDir = getDir _x;
    } forEach _spawn;

That code doesn't make sense either way, logically.
If you intended the variables to be accessible from outside. Then you would always just get the last entry of the _spawn array. So why not just select the last entry if you only want that?

winter rose
drowsy axle
#

What do you mean @still forum

still forum
#

I mean what I wrote...

#

Even if you fix the variables not being accessible. the loop will still not make sense

#

let's say you have 100 elements in _spawn. You loop through all of them and throw all of them away except the last one. Why even loop if you only want the last one? Just take the last directly

#

And why take an array if you only want a single value

drowsy axle
#

That's not what I am trying to achieve.

#

I'm trying to get each one (_spawn & _vehicle), and place it into the addaction, which is in a stand.

still forum
#

then you have to put that inside the loop

drowsy axle
#

They are... aren;t they?

still forum
#
    {
        _spawnPos = getPos _x;
        _spawnDir = getDir _x;
    } forEach _spawn;

Well...

#

There are two lines inside that loop.

#

I don't know where you see the addAction in there but I don't

drowsy axle
#

this is better? ```sqf
{
_standVar = _x;
{
_spawnPos = getPos _x;
_spawnDir = getDir _x;
{
_vehicleVar = _x;

        _vehicleName = getText (configfile >> "CfgVehicles" >> _vehicleVar >> "displayName");

        _standVar addAction [format ["Spawn Vehicle: %1.", _vehicleName], {
            (_this select 3) = (_this select 4) createVehicle position (_this select 5);
            (_this select 3) setDir (_this select 6);
            hint format ["Vehicle: %1. Has been successfully spawned at: %2", (_this select 6), (_this select 5)];
        }, _vehicleSpawn _vehicleVar _spawnPos _spawnDir _vehicleName];

    } forEach _vehicle;
} forEach _spawn;

} forEach _stand;```

still forum
#

Now you only have to pass the variables to the addAction and get them back out from _this

#

for that see:

drowsy axle
#

So, the addaction is wrong..?

still forum
#

The code inside it

drowsy axle
#

Okay.

still forum
#

Which I already told you. But apparently you didn't read that
And you cannot access local variables inside addAction code because that's a different script. You have to pass them as arguments to addAction

drowsy axle
#

arguments... okay. One second.

#

Check above. ^

#

How can I change the local vars, or are they allowed as arguments? @still forum

winter rose
tough abyss
#

Anyone know where I could look at the source code for Triggers? Couldn't find any in the pbos. They have some UI overlays I can't find anywhere else, ex the 'video glitch'

meager heart
#

afaik you can't, triggers hardcoded

tough abyss
#

Alternative, do you know how I could use the 'Video Glitch' and similar RscTitles already in Arma? Couldn't find their videos anywhere.

meager heart
#

'Video Glitch' ? ๐Ÿค”

tough abyss
#

That's the name of it. Static effect that flickers on the screen. You've probably seen it before.

winter rose
#

BIS_fnc_playVideo, or BIS_fnc_VRintro (or something like that)

meager heart
#

[] spawn BIS_fnc_VRFadeIn; ? this one ๐Ÿค”

tough abyss
#

That does the trick, thanks.

#
/*
    Author: Josef Zemanek

    Description:
    Fade In effect for VR.

    Parameter(s):
        NONE

    Returns:
    Nothing
*/

titleCut ["", "BLACK IN", 1];
titleRsc ["RscStatic","PLAIN"];
playSound "RscDisplayCurator_visionMode";
meager heart
#

ok

tough abyss
#

The trigger must just use that, rather than an RscCut. Which is odd, since it has the Bohemia splashscreens available too, and those are RscCuts.

meager heart
#

i have no idea about trigger effects tbh

tough abyss
#

Bonus: BIS_fnc_VRTimer. Counts up, but could change it to count down. Nifty little gui bit

queen cargo
#

<string> callExtension [<string>] would this be allowed or not?
wiki is not clear about this

edgy dune
#

whats the diffrence between #define BUFFER 1.053 and _buffer = 1.053;?

queen cargo
#

one actually assigns a variable

#

the other is just a preprocesor var

edgy dune
#

I still dont get that, what does it mean to preprocess?

queen cargo
edgy dune
#

I guess it also extends to my lack of knowledge of compile preprocessFileLineNumbers

queen cargo
#

pretty much the following: preprocessor processes a file and manipulates it

#
#define DMG 0.053
player setDamage DMG ```
will get to
```sqf

player setDamage 0.053```
edgy dune
#

I see

astral tendon
#
{_x setTaskState "Succeeded"} forEach ({simpleTasks _x} forEach allplayers);

This does not give a hint when the task is set to Succeeded, any fix for that?

queen cargo
#

it is a damn wonder that is not throwing errors around you

#

or more luck`

#

simpleTasks returns an array

#

forEach returns whatever was the result of the LAST iteration

#

what you want to archive here already is done wrong thus with the {simpleTasks _x} forEach allplayers

#
{_x setTaskState "Succeeded"} forEach ({simpleTasks _x} apply allplayers);```
#

this is the first fix you should use

#

and it might fix your second one too

astral tendon
#

nop, generic error

queen cargo
#

ye ... because i was kinda stupid here?

#

or more an oversight*

#
{simpleTasks _x} apply allplayers```
returns `[[...], [...], ...]`
#

thus your lefthandside code is still wrong

astral tendon
#
[Task Secure Civlilian:C Alpha 2-1:1 (id 0),Task Secure Civlilian:C Alpha 1-3:1 (id 1),Task Secure Civlilian:C Alpha 3-6:1 (id 2),Task Defuse Bomb:C Alpha 4-6:1 (id 3),Task Defuse Bomb:C Alpha 4-5:1 (id 4),Task Defuse Bomb:B Alpha 3-6:1 (id 5),Task Defuse Bomb:B Alpha 4-4:1 (id 6),Task Secure Civlilian:C Alpha 4-5:1 (id 7),Task Secure Civlilian:C Bravo 1-6:1 (id 8),Task Secure Civlilian:C Bravo 2-4:1 (id 9)]
#

hum...

queen cargo
#

best way to do it afaic is:

_arr = [];
{
    _arr pushBack simpleTasks _x;
} forEach allPlayers;
{
    _x setTaskState "Succeeded";
} forEach _arr;```
astral tendon
#

my ({simpleTasks _x} forEach allplayers) return the aray like this

queen cargo
astral tendon
#

using {simpleTasks _x} apply allplayers gives a generic error

queen cargo
#

check above for the reasoning

#

missed out the fact that simpleTasks returns an array
posted correct code afterwards

#

your code just handles the last player in allPlayers

astral tendon
#
_arr = []; 
{ 
    _arr pushBack simpleTasks _x; 
} forEach allPlayers;
_arr

Returns

[[Task Secure Civlilian:C Alpha 2-1:1 (id 0),Task Secure Civlilian:C Alpha 1-3:1 (id 1),Task Secure Civlilian:C Alpha 3-6:1 (id 2),Task Defuse Bomb:C Alpha 4-6:1 (id 3),Task Defuse Bomb:C Alpha 4-5:1 (id 4),Task Defuse Bomb:B Alpha 3-6:1 (id 5),Task Defuse Bomb:B Alpha 4-4:1 (id 6),Task Secure Civlilian:C Alpha 4-5:1 (id 7),Task Secure Civlilian:C Bravo 1-6:1 (id 8),Task Secure Civlilian:C Bravo 2-4:1 (id 9)]]
queen cargo
#

and wastes some time on the other players there

#

correct

#

which is exactly what your other method expects

#

or ... no ... wait

#

gah ... should catch some sleep finally

astral tendon
#

yup

#

i noticed

queen cargo
#

sorry, obviously wrong ๐Ÿ™ˆ

astral tendon
#

i did not what to be rude

queen cargo
#

it is ok

#

if i looked like i understood it that way, i am sorry too ๐Ÿ™ˆ

astral tendon
#

Nah, its ok, you do help me when i need too.

queen cargo
#
_arr = [];
{
    _arr append simpleTasks _x;
} forEach allPlayers;
{
    _x setTaskState "Succeeded";
} forEach _arr;```
astral tendon
#

though, what about the notifications

queen cargo
#

this time*

astral tendon
#

that does the same as it do with my one, i just need the notification

queen cargo
#

no, it does not as i said

#

forEach just returns the last result

#

while this really takes all players tasks

#

your missing notification is nothing i can help with tbh

#

not even sure what notification you are talking about

astral tendon
#

"Task completed : NameOft"

queen cargo
#

if it is this, needs to be raised manually

astral tendon
#

darn

#

though

({simpleTasks _x} forEach allplayers)

Retuns

[Task Secure Civlilian:C Alpha 2-1:1 (id 0),Task Secure Civlilian:C Alpha 1-3:1 (id 1),Task Secure Civlilian:C Alpha 3-6:1 (id 2),Task Defuse Bomb:C Alpha 4-6:1 (id 3),Task Defuse Bomb:C Alpha 4-5:1 (id 4),Task Defuse Bomb:B Alpha 3-6:1 (id 5),Task Defuse Bomb:B Alpha 4-4:1 (id 6),Task Secure Civlilian:C Alpha 4-5:1 (id 7),Task Secure Civlilian:C Bravo 1-6:1 (id 8),Task Secure Civlilian:C Bravo 2-4:1 (id 9)]
queen cargo
#

and read the return

#

if allPlayers is > 1 then the return value will be wrong

#
_arr1 = {simpleTasks _x} forEach allplayers;
_arr2 = simpleTasks (allPlayers select (count allPlayers - 1));
_arr1 isEqualTo _arr2; //true
astral tendon
#

That means its going to screw up for me if in MP with other players?

queen cargo
#

yes
because that is not what the command was designed for

#

though ... you should not just blindly close all tasks assigned anyways

astral tendon
#

Well, that is my goal

#

because the mission on that area is over

queen cargo
#
{ { _x setTaskState "succeeded"; } forEach _x; } forEach allPlayers```
#

there you go

#

will not get simpler

#

does the same as the sqf _arr = []; { _arr append simpleTasks _x; } forEach allPlayers; { _x setTaskState "Succeeded"; } forEach _arr; code

#

besides that the latter is using an extra array

astral tendon
#

though

#

this command is not clear if is MP compatible or if needs remote exec

queen cargo
#

true on that one

#

but usually that means it is global

astral tendon
#

Better i test that with a second arma opem before work with this, aka fuck my PC

#

yup, not mp compatible

#
{ { _x setTaskState "succeeded"; } forEach _x; } forEach allPlayers //generic error
_arr = []; 
{ 
    _arr append simpleTasks _x; 
} forEach allPlayers; 
{ 
    _x setTaskState "Succeeded"; 
} forEach _arr;

/\ worked for the pc that called it but not for the second player, he still have the task

#

neither my worked, same as above

{_x setTaskState "Succeeded"} forEach ({simpleTasks _x} forEach allplayers);
#
{{_x setTaskState "Succeeded"} forEach (simpleTasks player);} remoteExec ["bis_fnc_call", 0]; 

This one worked, all players got all tasks set to succeeded

meager heart
#
sldt1ck - Last Wednesday at 22:12
{
    if (toLower taskstate _x in ["created","assigned"]) then {_x settaskstate "succeeded"};
} foreach simpletasks player;
#

@astral tendon

#
{
    {
        if (toLower taskstate _x in ["created","assigned"]) then {_x settaskstate "succeeded"}
    } foreach simpletasks player;
} remoteExec ["bis_fnc_call"]; 
#

also targets (Optional): [default: 0 = everyone]

warm gorge
#
params [
    ["_seconds", 0, [0]]
];

private _hours = floor ((_seconds % 86400) / 3600);
private _minutes = floor ((_seconds % 3600) / 60);
private _seconds = floor ((_seconds % 60));

switch true do {
    case (_hours isEqualTo 0 && {_minutes isEqualTo 0}): {format ["%1 seconds", _seconds]};
    case (_hours isEqualTo 0): {format ["%1 minutes, %2 seconds", _minutes, _seconds]};
    case (_minutes isEqualTo 0): {format ["%1 hours, %2 minutes, %3 seconds", _hours, _minutes, _seconds]};
    default {format ["%1 hours, %2 minutes, %3 seconds", _hours, _minutes, _seconds]};
};

Any idea why this returns the incorrect amount of hours when seconds of hours over 24 are provided?

meager heart
astral tendon
#

is there a limit on how many Task can be created?

meager heart
#

afaik no

#

as long as tasks id's are different

flat eagle
#

TAG_fnc_initSector = {
params ["A"];
private _owner = A getVariable "owner";
if (_owner in [WEST]) then {tank setPos [7412.082,8377.723,0]
};
};

[A,"ownerchanged",{A call TAG_fnc_initSector}] call bis_fnc_addScriptedEventHandler;

can some one tell me what im doing wrong here?

edgy dune
#

TFW ur tryna make cool particle effects,and think u find a particle effects list, but https://community.bistudio.com/wiki/Category:ParticleShape ๐Ÿ˜ญ

#

is empty ๐Ÿ˜ญ

thorn saffron
#

does arma have an infity character I can use in text?

still forum
#

@warm gorge because your (_seconds % 86400) does nothing until 24 hours. After that it cut's off 24 hours and returns the rest.

#

the modulo divides by the number and always returns the rest.
1 hour is 3600 seconds. % divides by 86400. result is 0, leftover is 3600, it returns 3600.
You then divide by 3600 and out you get one hour.

Let's say you have 24 hours which is 86400 seconds.
% divides by 86400. Result is 1, rest is 0. It returns the rest.
Then you divide 0/3600 which is 0. Result is 0 hours.

warm gorge
#

@still forum Fixed it by just changing the hours calculation to floor (_time / 3600)

#

Cheers for the help

molten folio
#
{
    if (ITEM_VALUE(configName _x) > 0) then {
        _inv lbAdd format ["%1x - %2",ITEM_VALUE(configName _x),localize (getText(_x >> "displayName"))];
        _inv lbSetData [(lbSize _inv)-1,configName _x];
        _icon = M_CONFIG(getText,"VirtualItems",configName _x,"icon");
        if (!(_icon isEqualTo "")) then {
            _inv lbSetPicture [(lbSize _inv)-1,_icon];
        };
    };
} forEach ("true" configClasses (missionConfigFile >> "VirtualItems"));
``` is it possible to increase the text size when the Item is added to the List?
modern snow
#

exist elseif or else if in sqf? Trying to make a if statement.

winter rose
#

switch/case ,
if (โ€ฆ) exitWith {},
or if () then {} else { if () then {} };

no else if nor elseif

modern snow
#

Thanks! ๐Ÿ˜„

winter rose
#

๐Ÿ‘

flat eagle
#

TAG_fnc_initSector = {
params ["A"];
private _owner = A getVariable "owner";
if (_owner in [WEST]) then {tank setPos [7412.082,8377.723,0]
};
};

[A,"ownerchanged",{A call TAG_fnc_initSector}] call bis_fnc_addScriptedEventHandler;

does some one know what im doing wrong here?

winter rose
#

@flat eagle please format your sqf with

```sqf
// your sqf here
```

// your sqf here
peak plover
#

A is not a valid local variable

flat eagle
#

alright

peak plover
#

Can't use it in params

winter rose
#

A โ†’ _a

flat eagle
#

ok

winter rose
#

or better, name it properly _unit

flat eagle
#

A is an objective

peak plover
#

_objectiveA

winter rose
#

I dunno your code, so suit yourself ๐Ÿ˜„

peak plover
#

Also if owner in [west]

#

Just do owner isEqualTo west

#

Only 1 element, no point for using in

still forum
#

elseif exists but not in vanilla arma

winter rose
#

รจ_รฉ

#

else if exists in C# @still forum ๐Ÿ‘€

compact maple
#

Hey guys, does anyone know whatโ€™s the difference between the function camCommit, and camCommitPrepared ?

still forum
#

camCommitPrepared commits prepared changes and camCommit commits normal changes... Man that's not.. One sec

austere granite
#

It seems like it would do the exact same thing? ๐Ÿ˜„

still forum
#

if you do camPrepareTarget for example. camCommit won't set the target but camCommitPrepared will.
If you use camSetTarget camCommit and camCommitPrepared will set the target.

There is like a internal buffer of "prepared" parameters. camCommit ignores these and commits the actual parameters.
camCommitPrepared moves the "prepared" parameters from the internal buffer to the actual parameters, and then executes normal camCommit

#

so you could like.. Have two sets of parameters. Set one and commit it. Then prepare the others and when ready commit when ready.

astral tendon
#
((configFile >> "cfgWeapons") call BIS_fnc_getCfgSubClasses);

Im trying to sort weapons by rifles, lauchers, pistols, explosives etc. or any other possible way to sort, you guys got any idea.

winter rose
#

sort?

meager heart
#

bis_fnc_itemType?

velvet merlin
#

is there already a function to filter input fields (like you want to allow only numbers/floats)

winter rose
#

you can setup your filter in it

astral tendon
#
"isnil getText (_x >> 'access')" configClasses (configFile >> "cfgWeapons");

returns

[bin\config.bin/CfgWeapons/Default,bin\config.bin/CfgWeapons/PistolCore,bin\config.bin/CfgWeapons/RifleCore,bin\config.bin/....

How to set that back to strings?

winter rose
#

str? getText?

#

you obtained config entries; from this you should use getText

getText (_oneEntry >> "displayName");
still forum
#

maybe className too

winter rose
#

it's for a location according to wiki ๐Ÿค” quite a generic nameโ€ฆ

still forum
#

location is a value type

winter rose
still forum
#

Oh. Yeah. But I actually meant configName

winter rose
#

๐Ÿค

still forum
#

is that a hand shake or thumb fight?

winter rose
#

BOTH

#

you activated my trap card!

still forum
#

trap card has a different meaning nowadays than it had 5 years ago

winter rose
#

I realised that while typingโ€ฆ it's old-schooler way ๐Ÿ‘€

gleaming oyster
still forum
#

expected rick roll.

gleaming oyster
#

Trust me, I considered it.

velvet merlin
#

is there already a function to filter input fields (like you want to allow only numbers/floats)

#

also very confused with this one:

diag_log [_display,_idcOffset,_parameterName];
        _sliderControl ctrlAddEventHandler
        [
            "SliderPosChanged",
            format ["[_this,%1,%2,%3] call Test_fnc_sliderChangedOnBottomBox",_display,_idcOffset,_parameterName]
        ];```
#

returns:
[Display #4711,0,"apertureMin"]
["Test_fnc_sliderChangedOnBottomBox",[[Control #3003,27.8132],any,0,any]]

#

like it seems only certain variables can be passed to the ctrlEH

#

BI is doing stuff like

_ctrlButtonNext ctrladdeventhandler ["buttonclick",format ["[%1,%2,nil,finddisplay %3] spawn bis_fnc_3dentutorial",_path,_index + 1,_displayIDD]];
_ctrlButtonExit ctrladdeventhandler [
    "buttonclick",
    format [
        "
            _completed = profilenamespace getvariable ['display3DENTutorial_completed',[]];
            if !(%1 in _completed) then {
                _completed pushback %1;
                profilenamespace setvariable ['display3DENTutorial_completed',_completed];
                saveprofilenamespace;
                uinamespace setvariable ['display3DENTutorial_select',%1];
            };
            _display = finddisplay %2;
            [nil,nil,nil,_display] spawn bis_fnc_3dentutorial;
            if (ctrlidd _display == 313) then {
                _display createdisplay 'Display3DENTutorial';
            };
        ",
        _path,
        _displayIDD
    ]```
#

seems only numbers can be passed on

still forum
#

like it seems only certain variables can be passed to the ctrlEH you are not passing stuff to the ctrlEH

#

you are turning things into strings and expect them to magically turn back to what they were when compiled

velvet merlin
#

_parameterName is a string in the first place

still forum
#

if you turn a number into string it becomes

0

What happens when you execute 0? Right. It returns the number 0.
for the display

Display #4711

What happens whe n you run that? It uses the global variable Display and then selects the 4711'th element out of the Array inside Display.

velvet merlin
#

the display is different yes, however i would still expect not to return just any

still forum
#

parameterName is a string yes.
What happens when you format that?
format ["[%1]", "string"]
turns into "[string]" which is code

string

which is the variable string. Which is not defined. Thus any

velvet merlin
#

thanks fixed

gleaming oyster
#

Do clients ever get any cached information from a server mod?

#

I want to be able to ban / kick automatically without any exposure of the server command passwore

#

since I know the mission gets cached alongside mp anim data

still forum
#

no

gleaming oyster
#

Okay, excellent.

half monolith
#

it appears that
showGPS true;
is ineffective, does anyone know of a workaround ?

gleaming oyster
#

Do you have a gps? :p

half monolith
#

yes all linked and everything ๐Ÿ˜ƒ

#

it does appear as though there may be a ticket out on the subject, but id like to avoid a scripted minimap and use the vanilla

runic rose
#

Am trying to make an interactive dialog appear in Eden. 'createDialog' works but allows background objects to be selected, can I stop this and lock focus to the dialog in any way? Very new to GUIs!

winter rose
#

I am no expert, but my hacky mind would think of a big invisible background element that would grab all clicks outside his controls ๐Ÿ˜ƒ

#

note that this may not be the good solution ๐Ÿ‘€

meager heart
#

open debug console in eden (tools> debug console) and paste this

0 spawn { 
    disableSerialization; 
    private _display = findDisplay 313 createDisplay "RscDisplayEmpty"; 
    private _control = _display ctrlCreate ["RscButton", -1]; 
 
    _control ctrlSetPosition [0.35,0.5,0.25,0.1]; 
    _control ctrlCommit 0; 
     
    _control ctrlSetText "CLICK IT !!!"; 
    _control ctrlAddEventHandler ["ButtonClick", { 
        params ["_control"]; 
        ctrlParent _control closeDisplay 0; 
    }]; 
};
#

@runic rose

runic rose
#

@meager heart Amazing! Many thanks โค

edgy dune
#

is there away to get the config path if I have the class name?

still forum
#

Do you know what kind of classname it is? Aka if it's a weapon or a vehicle?

edgy dune
#

what would backpacks be classified as?

still forum
#

vehicles

winter rose
still forum
#

Well...

#

configFile >> "CfgVehicles" >> <your classname here>

winter rose
#

yup

#

that's what these functions do internally btw

gleaming oyster
#

Surely BI didn't do

params["_blah"];
_return = configFile >> "CfgVehicles" >> _blah 
#

it's always some convaluted over complicated fnc

hollow thistle
#

addAction isn't JIP compatible, is it?

winter rose
#

it is if you remoteExec it

#

else, no

gleaming oyster
#

Local effects

hollow thistle
#

Great, thanks for the information!

gleaming oyster
#

global args but local effects <<

hollow thistle
#

What will happen if I will queue it for jip with remoteExec and then delete object?

#

Should I take care of removing action via remoteExec too when deleting object?

winter rose
#

nothing, as far as I know? you can remove the remoteExec JIP action yes, it's preferable

hollow thistle
#

Good. We're rewritting KP Liberation currently and I'm trying to get as simple code as possible. ๐Ÿ˜„

winter rose
#
    // removes a message identified by "IamUnique" from the JIP queue
    remoteExecCall ["", "IamUnique"]; 
amber eagle
#

hello, is there any way to disable the fire when car, tank etc blow up? I want to get only wreck without fire.

meager heart
#

_vehicle setDamage [1, false]; < no effects

#

๐Ÿค”

amber eagle
#

ohhh wow

meager heart
#

locationPosition < object position (if attached)
position <location> < location position (if attached/if not attached)
(description says it) @winter rose

amber eagle
#

so there is option to disable it global?

meager heart
#

effects for setDamage command are global... if that what you mean

amber eagle
#

no, i think when the vehicle is spawned by someone like buyed and spawned vehicle is there option to disable fire when the vehicle blow up?

winter rose
#

@meager heart had trouble splitting the two info at the time, thanks

edgy dune
#

how does the game know whenever you press a button what action to do. Like say i have something like Shift+L bound for like 2 mods, how does the game determine which action to do?

#

just curious how arma handles controls

still forum
#

Shift+L bound for like 2 mods

#

you can't bind buttons to mods in Arma

#

if you mean "configure addon controls" that's CBA, not Arma

edgy dune
#

oh thats cba

#

I thought that was always there

willow rover
#

Can you attach a vehicle that is your CursorTarget to you? My attempts just crash my server. The only way I have been able to attach the vehicle was using a addAction to the car for anyone with a var on the spawn of the car.

minor lance
#

Is there any way to launch the editor vรญa script in main menu rather than with "playMission"

radiant needle
#

Is there a way to edit an individual units ACE fatigue params through script?

#

I tried player setVariable ["ace_advanced_fatigue_recoveryFactor",5] and it doesn't seem to work

minor lance
#

This is not working either [] spawn {ctrlActivate ((findDisplay 0) displayCtrl 142);};

#

when I press ok on map selection it does nothing... only close selection dialog

radiant needle
#

Does onSIngleMapClick still apply if player dies?

#

and respawns

unborn ether
#

@radiant needle It is, since its a mission event handler and its tied to a mission, not a player.

radiant needle
#

Oh wait so if I do onSingleMapClick, it changes behaviour for all players?

unborn ether
#

@radiant needle No, AFAIK all mission event handlers all stricly local to an instigating PC.

thorn saffron
#

Is it possible to edit the depth of field setting via scripts? I want to try making a script where DoF is enabled when you use weapon sights, but otherwise DoF will be off.

peak plover
#

Splendid camera and look into ace33 nvg

radiant needle
#

Is it possible to edit ace settings for individual units?

#

Like if I execute missionNameSpace setVariable ["VarName",0] will it only apply for the player it's executed on, or everybody?

digital jacinth
#

it only applies to the player the command is executed on.

inner swallow
#

@willow rover it's possible it's creating a strange race condition because the cursor Target changes? Dunno. Something you may want to report to @ Dwarden#6450 btw

still forum
#

@radiant needle variables you set locally will only be set locally.

astral tendon
#

How to put icons/text over a object? like in king of the hill were you have words on the base

still forum
#

probably drawIcon3D

earnest path
#

Hey guys do you know of a way to overwrite the default texture of a p3d object in arma without making a new mod and without using the global texture setter?

still forum
#

So... You want to overwrite the texture without using any of the ways to overwrite the texture?

#

I don't think that'll work

earnest path
#

I will give you example. I want to overwrite the texture of a default outfit in Arma. However the problem with setTextureGlobal is that if you take that item and place it on the ground than pick it up it will change the texture again to default. The only way i know to overcome this is with a thread that can periodically set the texture to keep it the one you want but that is not worth the processing power just to have a pretty uniform.

still forum
#

you need a mod for that

earnest path
#

I have a memory that arma released a way to custom set your vehicle accelaration handling and so on. I was kinda hoping that i can use that to alter default texture setting as well

little oxide
#

If i remember right, setObjectTextureGlobal have an example, to keep texture on uniform

earnest path
#

With a thread it will work but its not worth spawning a thread for the sake of having a pretty uniform

errant jasper
#

@earnest path I do a InventoryClosed check, but only for human players, to reset the uniform:

        player addEventHandler ["InventoryClosed", {
            params ["_unit", "_targetContainer"];
            private _curUniform = uniformContainer _unit;
            if (_curUniform != MF_fnc_setUnitInsignia_lastUniform) then {
                MF_fnc_setUnitInsignia_lastUniform = _curUniform;
                if (not (isNull _curUniform)) then {
                    [_unit, "REFRESH", true] call MF_fnc_setUnitInsigniaGlobal;
                };
            };
        }];```
earnest path
#

Plus that command is going to add traffic to JIP

#

@errant jasper Ok so you set the texture with global and than you keep on doing a sync every time inventory is closed

errant jasper
#

Well sort of. I run my global command, which itself only runs the local setObjectTexture because my insignia image is in the mission folder, and setObjectTextureGlobal does not work properly then. And then yes I check each inventory close, but no traffic is sent unless a change is made.

earnest path
#

This will help you fix your problem with the not working ObjectTextureGlobal

#

I like your solution

errant jasper
#

@earnest path You are going to have to be more specific about how that fixes my problem? My problem is specifically, that if you try to set a texture using setObjectTextureGlobal, that works fine if the texture is in an addon. But if you try to set it to a texture in the mission, then first constructs a path that is correct on your machine, and then tries to apply it to other machines where it fails.

#

One thing I haven't though of about my solution, is whether or not you can swap your uniform with one on the ground, without opening inventory.

earnest path
#

Good point

errant jasper
#

Oh, I see you mean Pierre top comment on remoteExec. Well that is basically the solution I use.

earnest path
#

Yes correct

#

Cool thanks for your help

#

I will play around and see what happens

winter dune
#

should I ask here for cfgRemoteExec?

errant jasper
#

Don't see any problem with that. Ask away.

winter dune
#

searched better on the wiki, thanks anyway

minor lance
#

Is there any way to launch the editor vรญa script in main menu rather than with "playMission" This is not working either [] spawn {ctrlActivate ((findDisplay 0) displayCtrl 142);};
when I press ok on map selection it does nothing... only close selection dialog

astral tendon
#

Is there a way to know if player is in Cutcene?

hollow thistle
#

apparently MPKilled does not fire when vehicle is sunken (testing on vanilla huron), what is most graceful way to check if vehicle is destroyed by water?
Should I also use MPHit event and check if unit is in water and damage > xx ?

#

Strange that it works for B_Slingload_01_Cargo_F. For both alive x returns false ๐Ÿค”

modern snow
#

Do you guys know, why this not working:

fn_test1.sqf:

[2] call Client_fnc_test2;

fn_test2.sqf:

params ["_test"];

if(_test == 2) then {
    hint "working";
};
meager heart
#

fn_test1.sqf> Client_fnc_test2 ๐Ÿค”

#

try Client_fnc_test1 or fn_test2.sqf /s

modern snow
#

That not my problem. If i remove my if statement and just making a "hint", it's works.
I can't use my params...

winter rose
#

it's the proper syntax yeah

#

2 call Client_fnc_test2
or
[2] call Client_fnc_test2 should work

try, in the fn_test2.sqf file, to hint str _this and see what you get.

do you have showScriptErrors activated in the launcher?

modern snow
#

@winter rose Thanks.
hint str _test show the number. I don't know why it's not working, and I didn't know anything about "showScriptErrors". I will try that ๐Ÿ˜„

winter rose
#

somewhere, the rest of the file may have a script error preventing the whole file to be used

modern snow
#

@winter rose

My sqf file:


_shopNumber = str _shop;

if(_shopNumber == 1) then {
    _name = ((missionConfigFile >> "shops" >> "generalstore" >> "shopName") call BIS_fnc_getCfgData);
    _items = ((missionConfigFile >> "shops" >> "generalstore" >> "buyItems") call BIS_fnc_getCfgData);
} else {
    _name = ((missionConfigFile >> "shops" >> "drugdealer" >> "shopName") call BIS_fnc_getCfgData);
    _items = ((missionConfigFile >> "shops" >> "drugdealer" >> "buyItems") call BIS_fnc_getCfgData);
};```

Logs error: 

``` 18:49:18 Error in expression <shopNumber = str _shop;

if(_shopNumber == 1) then {
_name = ((missionConfigFile>
18:49:18   Error position: <== 1) then {
_name = ((missionConfigFile>
18:49:18   Error Generic error in expression
18:49:18 File Functions\modules\ShopSystem\fn_openVirtualShop.sqf [ClientModules_fnc_openVirtualShop], line 30 ```
ruby breach
#

_shopNumber is a string. 1 is a number

winter rose
#

โ†‘ @modern snow

modern snow
#

Ahh thanks. I'm stupid ๐Ÿ˜„

#

_shop is not working, but it should be a number...

winter rose
#
systemChat format ["_shop = %1 (type %2)", _shop, typeName _shop];
modern snow
#

@winter rose Output _shop = 1 (type SCALAR)

winter rose
#

so it's perfect. btw, restart your game with showScriptErrors if it's not the case already

modern snow
#

I don't understand. It's a number and my if statement is not working..:

    _name = ((missionConfigFile >> "shops" >> "generalstore" >> "shopName") call BIS_fnc_getCfgData);
    _items = ((missionConfigFile >> "shops" >> "generalstore" >> "buyItems") call BIS_fnc_getCfgData);
}; ```
winter rose
#

error is out there ๐Ÿ‘€

#

what does showScriptErrors say?

modern snow
#

my "_shopName" is undefined because my if statement not working.

winter rose
#

_name undefined, last line

velvet merlin
#

how would you design a filter for an input box (RscEdit) that is meant to allow only numbers between 0-255, or in another case floats from 0 to 15.00 (2 digits)
have a keyUp EH on the control, convert the context to array, drop all non valid characters and refresh the display with the remaining valid ones?

modern snow
#

yeah my name is also undefined because my if statement. _name being created in my if statement.

winter rose
#

@velvet merlin on lost focus/form confirmation

#

@modern snow your _name var, if defined in an if-then, is destroyed as soon as the if-then closes.

private "_name";
if (true) then { _name = "name"; };
hint _name; // will work
velvet merlin
#

well thats somewhat annoying as the input would cause live screen updates - so to change focus first would be an inconvenience

winter rose
#

if it's an input, someone may make a mistake while writing (like typing ! instead of 1)
I'd hate the input text to reset to 0 in that case :3 a UX designer I know would agree

modern snow
#

@winter rose You are the best! I love you ๐Ÿ˜„

winter rose
#

I know ๐Ÿ˜Ž ๐Ÿ‘ Thanks, glad I could help ;-)

@velvet merlin or make the input read-only with +/- buttons :p

velvet merlin
#

why would one need to reset? you can just drop an invalid character when entered?

winter rose
#

let's imagine you type 3, then 5, then 5 - would the last 5 be refused?

velvet merlin
#

yes or you would set the input to 255/maxValue

winter rose
#

I don't know, it's really up to you (depending on what you wantโ€ฆ)
what is the context for this interface?

velvet merlin
astral tendon
#

Any tool to convert jpg to PAA than ImageToPaa? its gives me error "has an incorrect file size"

winter rose
#

@velvet merlin oh, I though some IP hacking device ๐Ÿ˜„ well in this case I wouldโ€ฆ either stick to what BI does in A3 video settings menu (can you type text, does it update when leaving?)
or your own method then: onKeyDown, if newValue is alphanumerical, keep currentValue, if newValue > 255, top it to 255 yes

#

@astral tendon then your file is most likely to an incorrect size

#

2^n ร— 2^o ?

astral tendon
#

yip

winter rose
#

dimensions?

astral tendon
#

1920x1080

winter rose
#

โ€ฆ

#

no.
1920 is not a power of 2.
1080 is not a power of 2.

#

128, 256, 512, 1024, 2048, 4096 are power of 2.

astral tendon
#

strange, usualy if i put in the game those images get a blue tint

#

if they are not power of 2

winter rose
#

stretch/resize it to 2048ร—1024 and it will be as swift as a fart on satin sheets

astral tendon
#
Checking file list...
Checking 'Storage' - Appears to be valid.
File list checked.
Processing Storage (218 KB)...
Fail to process Storage
Failed to convert 1 file(s)
#

Rip

#

soo, any other tool?

winter rose
#

what size is your picture?

astral tendon
#

1024x512

winter rose
#

jpg?

astral tendon
#

yes

winter rose
#

send it to me in pm

#

(please)

#

ImageToPAA refused to process a file that was gladly converted by TexView2 ๐Ÿ˜

unkempt birch
#

Is anyone willing to come into a voice channel with me and help me with getting this moving unit marker to work properly with multiple units.

Please don't try and explain it by text, I have dyslexia and it will just end up confusing, I learn better if I am walked through it by voice.

Thank you

#

...

unkempt birch
#

Is anyone going to help me with this, I though this was a Discord that helps people

wary vine
#

People have lives too

still forum
#

unlikely

#

scripting is text. Text in voice chat is....

wary vine
#

and its saturday night

unkempt birch
#

God damit

wary vine
#

Pretty good spelling for someone with dyslexia

unkempt birch
#

Clearly you do not know how Dyslexia effects people differently then do you

bitter bough
#

Either
A.) The important people have lives
or
B.) Code doesn't work well when dealing with hearing comprehension

unkempt birch
#

Hold your tongue before you say something ingnorant

wary vine
#

I will give you a tip tho

#

Actually

#

No I wont.

#

maybe you will hold your tounge

unkempt birch
#

Good for you, be ignorant child

wary vine
#

Child ? now you are just being rude.

bitter bough
#

oof, lets not get hasty now.
If nobody can help lets just wait for someone who can.

wary vine
#

I was going to help him

unkempt birch
#

Ignorant > Child > Rude?

Ok

#

Clearly

still forum
#

In my brain calling someone a ignorant child is rude.

unkempt birch
#

Then don't be ignorant then

#

Simple

wary vine
#

I wasn't being rude by saying you have good spelling for someone with dyslexia, its was a compliment, but whatever.

unkempt birch
#

No you said it like this Pretty good spelling for someone with dyslexia, that to me, is you being cynical

#

But ok

wary vine
#

maybe next time you should think before you act.

bitter bough
#

I'd like to reiterate that not all tone of voice can be carried through text....

wary vine
#

Im not a rude person sorry. I try to help people as much as I can, but as you got rude. Im not going too.

unkempt birch
#

I tell you what then, you go away, because clearly, you are not going to help, so stop ok.

Calm down, and go back to whatever it is that you was doing, thank you

wary vine
#

o/

winter rose
#

don't be ignorant says the guy asking for help ๐Ÿ‘€

not everyone is here for your blue eyes champ, so take a chill pill and wait for someone to answer. Personally I think I could help with your script, but I am not at ease with voice explanation. Also, I am not invited due to your displayed lack of patience.

meager heart
#

why not just pastebin that script, will be more chances for some help... ๐Ÿคท

unkempt birch
#

Ignorant, would be somone who did not bother to search, or there own research before asking for help.

Can see here some people still live at home, logic clearly does not apply to some of you

wary vine
#

welp, If I didn't live at home , where would I live ?

#

maybe you should think over your insults twice before you use them

still forum
#

correct. I live at home. Where else?

wary vine
#

In a house.

delicate lotus
#

if I setVariable a player, will he lose the variable upon respawn?

still forum
#

afaik no. But don't quote me on that

winter rose
#

I live at home become it's not far from my place

unborn ether
#

Anybody here helps with scripting?

meager heart
#

nah, we just chat here about... things

minor lance
#

In an object init, whats the object this or this?

#

this or _this

meager heart
#

this <this

minor lance
#

well

meager heart
#

yes

minor lance
#

why is not workin this? [this] spawn aa_fnc_code

#

working*

meager heart
#

0 = [this] spawn aa_fnc_code; < try this

minor lance
#

undefined variable this

meager heart
#

in object init field ?

minor lance
#

yes

#

its inside an addaction

#

that should be the problem

meager heart
#

lol

#

better just show all your code

minor lance
#

this addaction ["<t color=""#37ad3b"">" + "Enter", "0 = [this] spawn rb_fnc_enter;"];

#

the easy fix is using the object variable

#

just courious why this is not working

cosmic lichen
#

this needs to be parsed as parameter

meager heart
#
action_id = this addaction ["<t color=""#37ad3b"">" + "Enter", {
    /*[target, caller, ID, arguments]*/ //--- what you need from that ?
}];
minor lance
#

its just an action that fires a script that takes an object as parameter

#

ans the object should be the object in wich the addaction is assigned

#

so i should use _this select 0

cosmic lichen
#

yes

minor lance
#

as its the object'

meager heart
#

object who used action or object where action is added ?

minor lance
#

object that action is added

#

the addaction has its own scope

#

so "this"

#

is outside

#

solved hahaha

#

this addaction ["<t color=""#37ad3b"">" + "Enter", "0 = [_this select 0] spawn rb_fnc_enter;"];

#

that should work

meager heart
#
action_id = this addaction ["<t color=""#37ad3b"">" + "Enter", {
    params ["_target"];
    [_target] spawn aa_fnc_code;
}];
minor lance
#

should work too

#

hhow do you put the code thing?

#

dd

#

cc

meager heart
#

```sqf
code
```

minor lance
#

ยดdddยด

#

dd

#

thanks ๐Ÿ˜„

meager heart
#

also "<t color=""#37ad3b"">" + "Enter" โ†’ "<t color='#37ad3b'>Enter</t>" ๐Ÿ‘Œ

minor lance
#

""

#

^^

molten folio
#
_TitleText_Meme ctrlSetFont "PuristaBold";
    _TitleText_Meme ctrlSetBackgroundColor [0,0,0,0];
    _TitleText_Meme ctrlSetText "Working";``` is there a way to increase the text size?
meager heart
#

ctrlSetFontHeight ๐Ÿค”

meager heart
#

\๐Ÿ”ผ

queen cargo
#

@molten folio at best you already Set the desired Text size Config level

unborn ether
#

Anybody has an ideas of how do you snap a 2D-object in Arma to something like a building wall, so it doesn't "dig" in its surface? Something like a painting or image on the wall.

molten folio
#

@still forum can you help me?

#

how do i increase the Text Size in CtrlSetText

#

anyone plz?

meager heart
#

๐Ÿ™„

#

with lineIntersectsSurfaces maybe, @unborn ether

#

(surfaceNormal < from return)

unborn ether
#

@molten folio ctrlSetFontHeight for RscText and <t size='0.8'>YourText</t> for RscStructuredText

molten folio
#

Ty @unborn ether

meager heart
#

lol

untold lily
#

Still getting the hang of ARMA Scripting but

diag_log [_id, _uid, _name];
}] call BIS_fnc_addStackedEventHandler;

onPlayerConnected {diag_log [_id, _uid, _name]};```

Both produce the same result. Should one be preferred over the other?
#

Other than the top one not triggering when its not a JIP event, Im looking more if there is some performance difference? Or if one of them is the old way of doing it and considered legacy

still forum
#

the second one can only have a single eventhandler

#

so if someone else uses it yours will be removed

#

actually both of them are deprecated

#

the first one is only useful to pass additional parameters

#

if you have many handlers the BIS_fnc_addStackedEventHandler has better performance. Because addMissionEH recompiles the script before every execution.

untold lily
#

Ok, thanks

unborn ether
#

vectors commands list is so magnificent

warm gorge
#

How would I go about checking what interface size a player is on?

tough abyss
#

Anyone know how to make this stack and not replace an existing option? I'd like it to keep adding them so I can call them as needed rather than it replace an existing radio support.


_radio_2 = createTrigger["EmptyDetector",[0,0]];
_radio_2 setTriggerActivation["Bravo","PRESENT",false];
_radio_2 setTriggerStatements["this","execVM 'Cargo_Airdrops_GF\GF_Cargo_Airdrops_Request.sqf'",""];
2 setRadioMsg "Airdrop";
unborn ether
quasi rover
#

Who is the killer if UAV attack our side ? The UAV is created by script like this, and controlled by player.

_air1_array = [_spawnmark, 180, _uav, (side player)] call BIS_fnc_spawnVehicle;
_air1 = _air1_array select 0;
player connectTerminalToUav _air1;  //connect player to uav

When UAV attack our side for test. the killer is AI, not the controller(player), like this chatting msg:
barnes was incapaciated by Wilson(AI) (friendly fire)
EH 'HandleDamage' also say '_source' is the AI, not the controller. So how can I identify the player killer? p.s. Do I have to check the '_instigator' of EH 'HandleDamage' ?

unborn ether
#

AFAIK any Arma kills lies to a vehicle "DRIVER" role (car or uav for example) or its owner, if it has no "DRIVER" seat (bullet?). _instigator should return it properly, but I've never tested that with UAV. End solution might be using UAVControl which returns all the info about that very UAV. @barnes#7447

quasi rover
#

Thx, I'll check the uavControl p.s. I found uavControl has the uav operator, but how can I confirm that the friendly fire is caused by the uav operator?

thorn saffron
#

Is it possible to open Arsenal on a solider you are looking at in order to customize his gear (not yours)?

unborn ether
#

@thorn saffron No, that requires some scripting of your own

digital jacinth
#

Eh, zeus can do it so why not us? Lemme look it up real quick

#

Snippet from the zeus module to add arsenal on a unit that is not a player/not in group sidelogic and not in avehicle etc,

["Open",[true,nil,_unit]] call bis_fnc_arsenal;

So in Taro's case, they just need to look at someone (preferably not a player) and call this

["Open",[true,nil,cursorobject]] call bis_fnc_arsenal;
warm gorge
#

@unborn ether When I say interface size, I mean the interface size setting in the video game settings e.g small large very large. Unless getResolution can do that?

verbal otter
#

hello, how can i get units array of group player?

#

i try'ed group player but get number

copper raven
#

units group player

still forum
#

@warm gorge would be nice if you could just read the command description

warm gorge
#

Oh wow im stupid, I didn't even notice that

shadow sapphire
#

So, I've got this:

Orca addeventhandler ["Handledamage",{
    if (_this select 2 > 0.9) then {
        Orca allowdamage false;
    };
}];```

Which stops the Orca from being destroyed from a gentle fucking landing. But it is OP and not immersive.
I want to figure out how to make it basically be:

```sqf
Orca addeventhandler ["Handledamage",{
    if (_this select 2 > 0.9) then {
        Orca_Hull allowdamage false;
    };
}];```

But I don't know how to tell it to reference that hitpoint. I know "hull_hit" is a hitpoint, but just don't know how to grab it. Anyone have advice?
unkempt birch
#

Any way to post a picture to fix the issue I am having in game?

#

[BIS_fnc_activateaddons] The function can be activated only during the mission init.

Now I put this into the init.sqf file.

_addons = activatedAddons;

and this

/*

Description:
Activate addons upon mission start.
Doesn't work when the mission is already running.

Parameter(s):
    0: ARRAY of STRINGs - addon clases from CfgPatches or object classes from CfgVehicles

Returns:
ARRAY of STRINGS - activated addons

// Descrip

But it still keeps popping up

If anyone could help me with this, it would be much appreciated

radiant egret
unkempt birch
#

So copy this one yeah?

class CfgFunctions
{
class myTag
{
class myCategory
{
class myFunction
{
preInit = 1; //(formerly known as "forced") 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
postInit = 1; //1 to call the function upon mission start, after objects are initialized. Passed arguments are ["postInit", didJIP]
preStart = 1; //1 to call the function upon game start, before title screen, but after all addons are loaded (config.cpp only)
ext = ".fsm"; //Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
headerType = -1; //Set function header type: -1 - no header; 0 - default header; 1 - system header.
recompile = 1; //1 to recompile the function upon mission start (config.cpp only; functions in description.ext are compiled upon mission start already)
};
};
};
};

inner swallow
shadow sapphire
#

@inner swallow, that's very interesting. Thank you.

However, if allowdamage is object wide, then it doesn't do me any good.

I still need to know how to call those hitpoints, because my workaround might be to set the damage of each hitpoint excluding the hull to one.

inner swallow
shadow sapphire
#

Like this:

Orca addeventhandler ["Handledamage",{
    if (_this select 2 > 0.9) then {
        Orca allowdamage false;
        Orca setdamage "fuel_hit" 1;
        Orca setdamage "avionics_hit" 1;
        Orca setdamage "engine_1_hit" 1;
        Orca setdamage "engine_2_hit" 1;
        Orca setdamage "engine_hit" 1;
        Orca setdamage "main_rotor_hit" 1;
    };
}];```
#

Oh, perfect! Thank ya!

inner swallow
#

No problem ๐Ÿ˜„

#

if you see the additional information, there are a bunch of others

shadow sapphire
#

Indeed.

unkempt birch
#

I fixed my issue I had, no need to worry

unborn ether
#

Jeez, that HandleDamage disrespect.

#

@shadow sapphire HandleDamage returns a final hitpoint damage before it is applied to the EVH argument (unit, vehicle whatever). So basically, if you get the last hitpoint damage with getHitIndex and set it as return, no damage will be applied. The only thing to remember is that your orca should be local to you.

shadow sapphire
#

I don't understand.

astral tendon
#

Im trying to use agents to do animations but they are moving laggy, any idea?

unborn ether
#

@shadow sapphire
HandleDamage has this params:

params ["_unit","_part","_damage","_source","_projectile","_hitindex","_instigator","_hitpoint"]; 

And it triggers for every hitpoint of a damaged object, so in your case it is simple to override it with something like this:

orca addEventHandler ['HandleDamage',{
    params ["_object","_part","_damage","_source","_projectile","_hitindex","_instigator","_hitpoint"];
    if (_hitindex isEqualTo 2) then {_damage = _object getHitIndex _hitindex};
    _damage
}];

Where your 2 index is an actual part, you can also use a hitpoint name instead

shadow sapphire
#

I was trying to make it where helicopters using advanced flight model won't blow up by tipping twenty degrees on the helipad. It's impossible. Even disabling damage completely doesn't stop the helicopters from being destroyed when tipping them on the ground.

https://www.youtube.com/watch?v=c2JtfFpALJA

#

I wanted to allow it to crash, but just stop it from killing everyone aboard instantly for slowly tipping over, but it just doesn't work anyway.

astral tendon
#
FixAPC synchronizeObjectsAdd [player];
synchronizedObjects FixAPC; //returns empty array

why is it?

meager heart
#
private _ehId  = Orca addEventHandler ["Dammaged", {
    params ["_object", "", "_damage", "", "_hitPoint"];
    if (_damage >= 0.8) then {
        _object setHitPointDamage [_hitPoint, 1];
    } else {
        _object setDamage _damage;
    };
}];
```try this ^ @shadow sapphire
meager heart
#

edited ^

unborn ether
#

This will kill any hitpoint and most likely destroy the helicopter even faster

meager heart
little eagle
#

urg HD eh

errant jasper
#

Wait a minute this addEventHandler ["Dammaged", {.. They repeated the ****** spelling mistake for the event handler too? Can't believe I never noticed. Why they not add one with no error spelling then, it it is fine for the commands?

meager heart
#

sorry commy (forgot about gyazo issues lol)

#
The typo is "intentional": it is Dammaged with two "m".
#

ยฏ_(ใƒ„)_/ยฏ

#

from the wiki ^

errant jasper
#

I know. But they could at least add an internal alias for it, so we don't have to "intentionally remember" the spelling error like they did with setDamage/setDammage.

meager heart
#

afaik both works also ๐Ÿ˜€

errant jasper
#

That's something. Lol, wonder if I can use "HandleDammage" ๐Ÿ˜›

meager heart
wary vine
tender fossil
#
_dynRange = if (_town getVariable "wfbe_active" || _town getVariable "wfbe_active_air") then {_range_detect_active} else {_range_detect};
_detected = (_town nearEntities [["Man","Car","Motorcycle","Tank","Air","Ship"],_dynRange]) unitsBelowHeight 20;

_enemies = [_detected, _side] Call WFBE_CO_FNC_GetAreaEnemiesCount;

WFBE_CO_FNC_GetAreaEnemiesCount:

/*
    Get enemies in area according to sides.
     Parameters:
        - Units/Objects array.
        - Friendly Side.
        - {Ignored sides}
*/

Private ["_count","_sides","_sideFriendly","_sideIgnored","_units"];

_units = _this select 0;
_sideFriendly = _this select 1;
_sideIgnored = if (count _this > 2) then {_this select 2} else {[]};

_sides = [west, east, resistance, sideEnemy] - [_sideFriendly] - _sideIgnored;
_count = 0;

{_count = _count + (_x countSide _units)} forEach _sides;

_count
#

The function returns 0 enemy units, when there are enemies in the area

#

_dynRange is 600

#

And the units are closer than 600 meters from the point, so they should be in the area

#

So what goes wrong here?

winter rose
#

โ€ฆwhy unitsBelowHeight?
also, use params, it reaaally helps

still forum
#

_sideIgnored = if (count _this > 2) then {_this select 2} else {[]};
literally turns unto ["_sideIgnored", []]

tender fossil
#

@winter rose Also aerial units are counted if they're at lower altitude than given threshold

still forum
#

are there units in _detected?

winter rose
#

oh right, "Air" I missed that

tender fossil
#

@still forum There should be, but can't be absolutely sure

still forum
#

Why don't you like.. check?

tender fossil
#

For example, if there's a man standing 300 meters from the point when

_dynrange = 600;

I think it should be included

#

I'll test it ASAP

tender fossil
#

@still forum It returns enemy units that are in the area

#

Like it should

#
21:34:56 "[WFBE (INFORMATION)] [frameno:29940 | ticktime:613.008 | fps:46.5116] server_town_ai.sqf: Value of _detected: [B 1-1-A:1 (Damage) REMOTE]"
#

So the array is not empty

still forum
#

and the enemy side is not in _side by accident?

tender fossil
#

Correction: _side is the side of the town, so if eg. BLUFOR has captured the town, it returns BLUFOR / west

still forum
#

Value of _detected: [B 1-1-A:1 (Damage) REMOTE]"
B Blufor.

#

I think

shadow sapphire
#

Does anyone know off hand of a simple way to script an AI group to crouch or prone?

Like the group version of SQF Leader (_G1) setunitpos "Middle";

tender fossil
#

@still forum Yes, and the BLUFOR unit is in town controlled by OPFOR

#

So why does the function return "0 enemies in the area"? I have no idea, but I guess the error must be in that function. Are the array commands correct?

winter rose
#

@shadow sapphire well that's about that

{ _x setUnitPos "Middle"; } forEach units _G1;
shadow sapphire
#

@winter rose, thanks!

winter rose
#

๐Ÿ‘

tender fossil
#

Maybe this line is faulty?

_sides = [west, east, resistance, sideEnemy] - [_sideFriendly] - _sideIgnored;
#

Is the syntax correct?

winter rose
#

[] for both pls

little eagle
#
_sides = [west, east, resistance, sideEnemy] - [_sideFriendly, _sideIgnored];
winter rose
#

โ†‘

astral tendon
#

Rip _sides

tender fossil
#

It still returns 0! What kind of sorcery is this ๐Ÿ˜„

#
22:02:36 "[WFBE (INFORMATION)] [frameno:12102 | ticktime:224.473 | fps:45.977] server_town_ai.sqf: Value of _detected: [B 1-1-A:1 (Net_2) REMOTE,O 1-1-A:1 (Miksuu) REMOTE]"

22:02:36 "[WFBE (INFORMATION)] [frameno:12102 | ticktime:224.473 | fps:45.977] server_town_ai.sqf: 0 enemies counted in the area."
#

So there's both B = BLUFOR and O = OPFOR unit in a town controlled by BLUFOR, so it should count 1 enemy in the area

#

But it doesn't. How? ๐Ÿ˜„

little eagle
#

Bad script.

tender fossil
#

Here's the function counting the enemies @little eagle

/*
    Get enemies in area according to sides.
     Parameters:
        - Units/Objects array.
        - Friendly Side.
        - {Ignored sides}
*/

Private ["_count","_sides","_sideFriendly","_sideIgnored","_units"];

_units = _this select 0;
_sideFriendly = _this select 1;
_sideIgnored = if (count _this > 2) then {_this select 2} else {[]};

_sides = [west, east, resistance, sideEnemy] - [_sideFriendly, _sideIgnored];
_count = 0;

{_count = _count + (_x countSide _units)} forEach _sides;

_count
#

Or just scroll up

#

The code calling it is

_enemies = [_detected, _side] Call WFBE_CO_FNC_GetAreaEnemiesCount;

and the value of _enemies at the time of calling the function is:

_detected: [B 1-1-A:1 (Net_2) REMOTE,O 1-1-A:1 (Miksuu) REMOTE]
little eagle
#

Well, I don't want to sound like an ass, but it is indeed a bad script imo.

tender fossil
#

Not done by me, so go on ๐Ÿ˜„

#

Do you have any idea what might cause the issue? I'm totally out of ideas

gleaming oyster
#
private []

๐Ÿคข

little eagle
#

I would help you, but I can't even tell what the script is supposed to do.

#

Like, the functions header is completely useless.

tender fossil
#

It's supposed to count enemies in given area (in given distance from given point)

little eagle
#

Enemies of what?

tender fossil
#

Scroll up if you want to see the explanation

little eagle
#

Everyone is born an enemy to millions thanks to politics and religion.

tender fossil
#

Units of enemy side

#

So if eg. OPFOR holds an area 600 m from given point (town), BLUFOR unit entering that area should trigger the script to burp out _count with value higher than 0

little eagle
#

Scrap that function, write your own.

tender fossil
#

lol, I see

little eagle
#

It's a one liner, maybe 5 max.

tender fossil
#

Aight, I'll try to write my own

little eagle
#

@tender fossil

commy_fnc_isEnemyNearby = {
    params ["_position", "_radius", "_side"];

    if (_side isEqualType objNull) then {
        _side = side group _side;
    };

    allUnits findIf {
        _x distance2D _position < _radius && {
            [side group _x, _side] call BIS_fnc_sideIsEnemy;
        } // return
    } != -1 // return
};

// enemies to player on position of the player with 500m radius
[getPosWorld player, 500, player] call commy_fnc_isEnemyNearby;

untested

wary vine
#
params [
    ["_units", [], [[]]],
    ["_sideFriendly", "", [""]],
    ["_sideIgnored", [], [[]]]
];

private _sides = [west, east, resistance, sideEnemy] - [_sideFriendly, _sideIgnored];

_enemyUnits = ((side _x) in _sides) count _units;

_enemyUnits;
``` maybe ?
little eagle
#

What is _units? That makes no sense to me in this script,.

#

It's supposed to find the nearby enemies, no? Or at least report if there are any.

wary vine
#

idk maybe he is passing the units in an area through to this script

little eagle
#

That's very strange, I like my idea more.

wary vine
#

yea use a center position, and radius xD

little eagle
#
commy_fnc_isEnemyNearby = {
    params ["_side", "_position", "_radius"];

    if (_side isEqualType objNull) then {
        _side = side group _side;
    };

    private _enemySides = [west, east, resistance, sideEnemy] select {
        [_x, _side] call BIS_fnc_sideIsEnemy;
    };

    allUnits inAreaArray [_position, _radius, _radius] findIf {
        side _x in _enemySides // return
    } != -1 // return
};

// enemies to player on position of the player with 500m radius
[player, getPosWorld player, 500] call commy_fnc_isEnemyNearby;

There.

hollow thistle
#

From tests that Wyqer did using nearEntities was faster than distance2.

little eagle
#

Nah, what I posted beats all versions.

hollow thistle
#

Ye, looks more performant as findIf will exit after first unit found.

little eagle
#

The nice part is the inAreaArray

#

Moves the whole distance check to C++

hollow thistle
#

Good to know!

little eagle
#

nearEntities has the problem that it only picks up entites, and units inside vehicles are no entities.

hollow thistle
#

I wish there was a page where there would be performance comparison for things that are commonly scripted in sqf.

still forum
#

Uhm.. There is ๐Ÿ˜„

little eagle
#

entities*

cosmic lichen
hollow thistle
#

I've read it few times already.

still forum
#

the near units thing is not on there. But good idea to add that

hollow thistle
#

I see it was recently updated.

#

I think it looks better than last time i read it.

still forum
#

it better be ๐Ÿ˜„ Was alot of work

cosmic lichen
#

Lou will be glad to hear that ๐Ÿ˜„

winter rose
#

he is

still forum
#

Why does everyone have to always throw compliments at Lou

hollow thistle
#

xD

still forum
#

Lou you are too good. people can't cope

winter rose
#

sorry. won't do that again. ._.

hollow thistle
#

Btw we are currently rewriting KP Liberation from scratch. So if anyone experienced likes this mission and would like to track development and hint us what could be written better or more performant we would gladly receive some constructive criticism.

tough abyss
#

Hello Lou

hollow thistle
winter rose
#

but it's a lot of teamwork for benchmarks, suggestions & all, so @still forum & @cosmic lichen you deserve your fair share of compliments too (and @meager heart and @gleaming oyster , and maybe I forgot some)

still forum
#

btw is the kp liberation finally getting a complete rewrite?

hollow thistle
#

it is.

winter rose
#

@tough abyss hi!

still forum
#

nice.

tough abyss
#

@winter rose do you know how radio actions work off hand?

hollow thistle
#

Old inherited code was a mess. ๐Ÿ˜‰

tender fossil
#

@little eagle "What is _units? That makes no sense to me in this script,."

_units is an array containing every unit in certain radius (here: 600 m) from given point

winter rose
tender fossil
#

I'll test your code

still forum
#

@hollow thistle yeah. Have been saying the same ^^

tough abyss
#

Like radio supports

hollow thistle
#

So as I have no big sqf background prepare yourself for stupid questions soon!

still forum
#

you are working on the rewrite without big sqf background? :u

hollow thistle
#

With Wyqer (lead dev).

#

Why not I have software engineering background.

still forum
#

didn't say that's a bad idea ^^

#

the code from you that I have seen so far looks better than what the average sqf dev writes

hollow thistle
#

Average sqf dev copy pastes stuff from forum sadly.

still forum
#

copy pastes 5 year old outdated crap*

hollow thistle
#

๐Ÿ˜„

little eagle
#

You just called them above average. Dedmen.

still forum
#

is that wrong?

#

Don't confuse me

hollow thistle
#

What is the most performant way to addAction to player when he is area? In Lib we have fobs and when player is in fob he can recycle stuff, build, redeploy etc.

#

Old lib had a loop that checked if a player is in any fob and added actions to him when he was in area... this is obviously BAD.

still forum
#

you mean most performant way to check if he is in area or not?

#

most performant is to not have the action when he is not there

#

no that is not obviously bad

#

a scheduled loop that checks all 10 seconds or so is quite good

#

that's probably what I'd do. Just in unscheduled cuz I'm too lazy

hollow thistle
#

Old liberation had scheduled loop for everything.

#

Well i guess reasonable amount of loops is fine.

little eagle
#

They're nice, except that they stop working after half an hour.

hollow thistle
#

But how it compares to eg. trigger created via scripting?

little eagle
#

Both shit.

still forum
#

I experienced scheduled scripts on insurgency yesterday. Enemies spawning in front of me. Then the code that should teleport them away get's scheduled and doesn't run for like 20 seconds..

#

End result. A full enemy group spawns right in my face. Notices me. Kills me and then teleports away

hollow thistle
#

ยฏ_(ใƒ„)_/ยฏ

cosmic lichen
#

Noob

still forum
#

But hey! scheduled is cool right?

little eagle
#

Dedmen, you can never go back, right???

still forum
#

CBA pfh every 10 seconds to check if you are in FOB zone. Makes sure it really checks every 10 seconds. And... Doesn't kill perf in any way

little eagle
#

Remember that AGM was scripted in scheduled in large parts.

still forum
#

but you probably don't have CBA right?

hollow thistle
#

We wanted to have vanilla compatiblity.

still forum
#

you could rewrite CBA pfh on your own. It's script only

hollow thistle
#

But CBA is used by almost everyone anyway I guess.

cosmic lichen
#

If folks can't install CBA they should delete arma

little eagle
#

If folks can't write CBA, they should delete Arma.

cosmic lichen
#

Damn

hollow thistle
#

I would need to talk about it with rest of the team. (Wyqer)

still forum
#

nowadays you can even run CBA serverside only. But the FOB check script would run clientside..

cosmic lichen
#

bye then =/

hollow thistle
#

deletes arma.

still forum
#

but again. Scheduled loop with 10 sec sleep is probably fine for that

#

if it takes 20 instead of 10 seconds that's still fine

#

Or.....

#

You add the action to the FOB building

#

for stuff like arsenal or that window to select missions that would work fine

hollow thistle
still forum
#

I really hate it in liberation when the sector takes too long to activate

#

but I'd say not a gameplay killer

#

Nah that code looks fine in scheduled

hollow thistle
#

It can be annoying if it activates so long you are already landing helicopter and then shilka spawns in front. ๐Ÿ˜„

still forum
#

no one's gonna get hurt if a sector get's activated a couple seconds late.
But remember my thing about units spawning in your face and not teleporting away right away ๐Ÿ˜„

#

Also big advantage for unscheduled.. You can use my script profiler ๐Ÿ˜‰ ๐Ÿ˜„

hollow thistle
#

In lib there is only propability of spawning right in your face. No teleporting away from crime scene ;>

earnest path
#

Hey guys i have a little script that i run on initPlayer.sqf of my mission but it does not work and i cant figure out why

player addEventHandler ["GetInMan",
{
    params ["_unit", "_role", "_vehicle", "_turret"];

    Hint "You entered a vehicle";

    _unit = _this select 0;
    _role = _this select 1;
    _vehicle = _this select 2;
    _turret = _this select 3;

    _vehicle setPlateNumber "CEY ROLLO";

    true
}];
still forum
#

Why are you getting the input variables twice?

cosmic lichen
#

params and this select 0 ?

still forum
#

Don't see any error in that besides that weirdness

hollow thistle
#

So to create unscheduled loop and not kill performance it should be throttled with usage of CBA or by writing it by ourselves?

still forum
#

I would recommend to re-implement the CBA PFH stuff yourself

cosmic lichen
#

well, besides not using the parameters except vehicle

still forum
#

It'll definetly be useful later on

little eagle
#

There's no reason not to write your own PFH thingy, except time.

earnest path
#

Do you know if there is only one handler attached to GetInMan or you can have many that stack?

still forum
#

many.

little eagle
#

Also, don't replace every loop with a pfh.

still forum
#

Like all addEventHandler

little eagle
#

Event based code.

hollow thistle
#

We will write our own copy of CBA custom events propably too.

#

As I want to achieve easier customization of mission without tinkering in core code.

little eagle
#

You know what they do, but have no experience in SQF?

hollow thistle
#

Kinda.

still forum
#

๐Ÿ› ๐Ÿ˜ด ๐Ÿ‘‹ ๐Ÿ’ค

little eagle
#

gn8

cosmic lichen
#

gn8

hollow thistle
#

gn8, thanks for answers.

earnest path
#
player addEventHandler ["GetInMan",
{
    params ["_unit", "_role", "_vehicle", "_turret"];
    _vehicle setPlateNumber "CEY ROLLO";
    true
}];
#

I changed the script to this and if i execute it trough debug console

#

It works

#

But in playerInit it doesnt ๐Ÿ˜ฆ

meager heart
#

Hey guys i have a little script that i run on initPlayer.sqf
i think you can try:
rename your initPlayer.sqf to โ†’ initPlayerLocal.sqf
and for the script

player addEventHandler ["GetInMan", {
    params ["_unit", "_role", "_vehicle"];
    hint "You entered a vehicle";
    _vehicle setPlateNumber "CEY ROLLO";
}];
``` ๐Ÿ˜€
#

@earnest path

earnest path
#

Yes it is initPlayerLocal.sqf sorry for the missleading

#

Maybe the Exile mod removes all even handlers when you spawn.

meager heart
#

i have no idea about Exile mod and what it will remove, sorry

errant jasper
#

@earnest path Does it work in vanilla ("empty" mission I mean)? According to BIKI the argument has to be local, maybe it is only local shortly after the handler runs, and not before? Also locality only transfers to the driver I believe (though this might be a desirable effect in your case - but just to clarify, getting in as non-driver will almost certainly result in running the command with a non-local target in MP).

warm bronze
#

Trying to get group respawn going on respawn_ASQL, scenario was that Bravo would rescue alpha from their alimo. When bravo get within x distance of the alpha respawn the code deleteMarker Respawn_ASQL; will run. Moving alphas default qrf back to respawn_west. Is there anyway to get over JIP issues with that. Meaning people in alpha continually spawning at a marker that is deleted for the rest of the side. Obvious solution is to just move the marker to the new respawn location, but is there any other solution?

meager heart
#

MenuPosition in your case

thorn saffron
#

How can you add a unit as a high command commander in a middle of a mission? I tried synchronizeObjectsAdd but it seems to have no effect

warm bronze
#

Donโ€™t use a menu currently. Breaks immersion, being able to choose where a squad can respawn as well. Disregarding the fact there is actually respawns and how that effects immersion.

unborn ether
#

@modest rapidszleflash#7409 GetInMan is only applied to a unit, not a vehicle. Since player is strictly local to you (in case if its not null) - this EVH will trigger constantly.

#

Discord cmon

little eagle
#

GetInMan would also fire for remote units.

torpid pike
#

hey all, wanted to ask about some avionic commands used in ArmA 3. So am I right in understanding that I can use 1. 'velocity' to get the speed of a vehicle, 2. 'vectorDir' to get the roll/pitch of an aircraft, 3. 'getPos' or 'getPosAsl' to get the height of the vehicle for altitude, 4. 'getDir' for the heading on a compass and 5. 'rotorsRpmRTD' to get the torque or RPM value of the rotor speed? Need to figure these out before I start planning any flight instruments.

#

please correct me if any of these are wrong, or if there are specific instrumentation commands that the flight model uses to return values.

little eagle
#

speed refers to a scalar usually, while velocity is a vector with the speed as length. Ingame speed command also is in km/h instead of m/s and can report negative values for moving backwards.

#

vectorDir reports the direction the vehicle is heading. The direction alone is insufficient to tell the roll, but I guess you can get heading and pitch from it.

#

getPos/ASL/ATL report the same X,Y and only the Z is different.
getPos - AGLS format, z=0 is the first walkable surface including objects and terrain below the object and at this X,Y.
getPosASL - ASL format, z=0 is the constant sea level / normal null.
getPosASLW - ASLW format, z=0 is the current height of the waves at this X,Y and time.
getPosATL - ATL format, z=0 is the terrain surface at this X,Y.
ASLToAGL getPosASL - AGL format, z=0 is above land the same as ATL, and above sea the same as ASLW. This is the most common format used by other commands, despite having no getPosX-variant directly.
getPosWorld - ASL format, is the same as ASL, but reports the height above z=0 not from the lowest point of the object, but the object center.

#

Note that setPos uses AGL, but getPos reports AGLS, which means that these are not bijective iff there is a walkable surface other than the terrain below the object.

#

Also note that only ASL has a constant z=0, so vector math can be done accurately only in ASL format.

unborn ether
#

You can use vectorCrossProduct between two vectors (vehicle center + some part of helicopter) to get some kind of a roll.

little eagle
#

"ASLW" and "AGL over sea" format are time sensitive, as the waves move.

#

Yeah, you usually use vectorDir and vectorUp to retrieve the heading/pitch/bank of a plane.

#

AGLS format also can never be bijective, because there are multiple z=0 at every X,Y - each walkable surface. Only the first one below the object is considered, but without object, it's not clear which one that is.

unborn ether
#

Is that getPosASLVisual that counts any interference over a terrain into its return?

little eagle
#

getPosASLVisual is exactly the same as getPosASL. The only difference is, that XVisual reads the position from the render thread instead of the simulation thread, so it reports where the object is drawn, not actually exists (including hitbox and geometry).

#

drawn position is interpolated between simulated position and updated more frequently, so the game looks smooth.

unborn ether
#

So there is no command that is able to count height of any object over terrain/sea?

little eagle
#

getPosATL/ASL _object select 2

#

Good enough imo.

unborn ether
#

๐Ÿค”

little eagle
#

What are you thonking about?

#

I got 7 more minutes, so ask now.

unborn ether
#

Ah nvm, just thinking of how you lock that object, according to that you can't know whats it exactly. I think just make a 90 degree interesection ray, but that might be not accurate..

little eagle
#

You want the direction vector from one object to another?

unborn ether
#

No, kinda find some object(s) below you (from a helicopter for example) and check if you have a space to land.

little eagle
#

Probably best to do some raycasts using lineIntersectsSurface.

#

GEOM LOD.

#

To cover all objects inside, nearObjects plus nearTerrainObjects I'd say.

#

Idk how one would determine the slope at a position. Probably some math using the four edges and maybe the center and halfway points between the sides etc.

#

Definitely not the BIS function. That one sucks.

unborn ether
#

Yeah..

little eagle
#

Oh.

#

heading = yaw = direction
pitch
bank = roll
These are my conventions and everyone else can fuck off.

#

!!!!

fervent terrace
#

Is it actually impossible to use a script to close the canopy on the Black Wasp while it's empty, or am I just dumb? I spent the last two hours trying to figure it out, but the only animation available in the config relating to the canopy is canopy_hide, which is for ejection and simply removes it.

still forum
#

if virtual garage can do it then script can do it too

#

probably some animation yeah. Doesn't have to be shown in config

edgy dune
still forum
#

exactly that.

verbal otter
#

hello, trying to use setMarkerTextLocal but is not working, i no idea why, could you help me please?

#

trying this

#
"markernamesd" setMarkerTextLocal "[EASY] ะงะธัั‚ะพ";
"markernamesd" setMarkerShapeLocal "ELLIPSE";
"markernamesd" setMarkerBrushLocal "Border";
"markernamesd" setMarkerColorLocal "ColorBlue";
"markernamesd" setMarkerSizeLocal [100,100];```
#

but no text on marker

still forum
#

only the text not working? Are the other things working?

unborn ether
#
  1. You dont have a setMarkerTypeLocal for it to display
  2. Only setMarkerShape of type "ICON" support text AFAIK.
verbal otter
#

@still forum yes, all another is working

unborn ether
#

You can just simply go with 2 separate markers, one elliptic, one icon.

verbal otter
#

@unborn ether ty, will try

#

still not working ๐Ÿ˜ฆ

#
createMarkerLocal ["markertextsd",player];
"markertextsd" setMarkerTypeLocal "hd_marker";
"markertextsd" setMarkerShapeLocal "ICON";
"markertextsd" setMarkerTextLocal "[EASY] ะงะธัั‚ะพ";
"markernamesd123" setMarkerShapeLocal "ELLIPSE";
"markernamesd123" setMarkerBrushLocal "Border";
"markernamesd123" setMarkerColorLocal "ColorBlue";
"markernamesd123" setMarkerSizeLocal [150,150];```
still forum
#

my guess is on the russian text. Try with just some latin characters

verbal otter
#

changed text to eng, still not working

unborn ether
#

You dont have setMarkerSizeLocal for a text marker

#

There are few conditions for markers to be visible on the map, that one is in it i think.

meager heart
#
private _marker = createMarkerLocal ["markernamesd123", player];
_marker setMarkerTextLocal "[EASY] ะงะธัั‚ะพ";

๐Ÿค”

#

also afaik russian text works

unborn ether
#

Yes, arma supports cyrillic

still forum
#

Arma supports everything besides null characters

meager heart
#

also

<Key ID="STR_sector_name">
    <English>ย  FOBย  </English> //--- white space alt code 

works

#

(for the marker name)

still forum
#

Only thing that's limited is what the fonts can display. for example they can't display emoji afaik. But using emoji in strings like variable names still works fine

meager heart
#

i saw only one emoji โ˜  < this one ๐Ÿ˜€

#

there is

class ScenarioData
{
    author="Tom_48_97 โ˜ ";
};
still forum
#

lol

#

tom probably took special care to make sure BI supports that ๐Ÿ˜„

meager heart
#

๐Ÿ˜„

peak plover
#

missionNamespace setvariable works in preinit, rite?

still forum
#

ye

peak plover
#

thanks

errant jasper
#

@unborn ether @little eagle Earlier about, about GetInMan. My comments on locality was about setPlateNumber which requires the argument (the vehicle) be local, and how I am not sure whether the vehicle become local before or after the event handler runs (and only when getting in as driver).

compact maple
#

@still forum thanks you for answering me about camPrepareCommit, just saw ur answer !

still forum
#

Wasn't that like a week ago? ^^

compact maple
#

It was 4 days ago yea ๐Ÿ˜„

willow rover
#

can you detach your cursorTarget from a different script then the one you use attachTo?

still forum
#

you can detach stuff in scripts yes..

willow rover
#

so if I attachTo myself In one script, I can call a detach from another?

still forum
#

yes.

#

You can do stuff in as many different scripts as you like

willow rover
#

okay thanks

compact maple
#

@still forum do you work with, or use a headless client ?

#

i read that itโ€™s possible to have multiple HC

quasi rover
#
private _units = [];

allUnits select {
    private _man = _x;
    if (({{_x isEqualTo _man} count crew _x > 0} count allUnitsUav) isEqualTo 0) then {
        _units pushBackUnique _x;
    };
};

what's the if-clause mean?

still forum
#

yes I do @compact maple I usually run two or 3

#

@quasi rover first of. That if is useless and dumb

compact maple
#

oh thatโ€™s nice, the perf are getting better with them ?

#

if player1 is equal to player1 ? lol

still forum
#

that code checks that the units are not in UAV's

#

Well. The AI reacts faster and doesn't lag as much

#

If that's what you mean by perf

compact maple
#

hm Kay I was more wondering about fps in game

still forum
#

no then.

compact maple
#

okay

still forum
#

@quasi rover that code is in general completly stupid.

#
private _units = allUnits select {
    private _man = _x;
    {_man in crew _x} count allUnitsUav == 0
};

There.

#

in human:
select all Units that are not inside a UAV.

quasi rover
#

Thx, if the unit is player, player can be inside a UAV? UAV is unmanned.... sorry.

still forum
#

uhhhh

lone glade
still forum
#

yes a player can be inside a uav.
How can a human be inside a unmanned vehicle? That doesn't make sense

#

And he can't if you want the script to do what it was made for. Because the script clearly checks that he is NOT inside a UAV

#

"Breaking news: A man was seen sitting in a unmanned vehicle, was he a woman? Click now to find out"

compact maple
#

xd

#

that killed me

errant jasper
#

Dunno about, Arma 3, but pretty damn sure that UAVs ported from Arma 2 still uses the old AI driver/gunner to move about.

#

I distinctly remember, even once fooling around in the editor to order one of them out. Like a clown car thing a dude popped out of a Pchela.

quasi rover
#

By the way, when I was killed by UAV that is operated by our side-player, I got this team-kill msg:
barnes was incapaciated by Wilson(AI) (friendly fire)
why this happened? the UAV is operated by our side player.

still forum
#

Uh..

#

Because exactly that?

meager heart
#

remote control probably...

#

he mean kill feed, maybe

still forum
#

friendly fire is when someone from your side kills you

#

that's what happened.. That's what the message also says.

winter rose
#

UAV is operated by an AI, and the AI is remoteControlled by the player
so it seems the kill got to the AI

quasi rover
#

Aha! so i was killed by the AI who is remoteControlled by the player. wow.. but actually the player pulled the trigger = LMB click.

winter rose
#

yep, dunno much more

quasi rover
#

thx guys.

winter rose
quasi rover
#

UAV open terminal has the role maybe.

kindred briar
#

This has probably been tried, however would it be possible to script a manual gearbox?

#

Instead of the game engine changing gears, the player has to press a button for it to continue?

winter rose
#

2014

willow rover
#

Okay so I can attachTo an NPC but once it is attached, it is a Null-Object. Anyone got any idea why?

still forum
#

you attach to the NPC. or you attachTo the NPC to something else?

willow rover
#

I attached the NPC to my Pelvis and everything was fine in Eden but now on server its a Null Object after attaching it.

still forum
#

It's not a NPC anymore after being attached

#

it's a block of flesh that's attached to you